MCPcopy
hub / github.com/stretchr/testify / Test_Mock_IsMethodCallable

Function Test_Mock_IsMethodCallable

mock/mock_test.go:1820–1839  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1818}
1819
1820func Test_Mock_IsMethodCallable(t *testing.T) {
1821 t.Parallel()
1822
1823 var mockedService = new(TestExampleImplementation)
1824
1825 arg := []Call{{Repeatability: 1}, {Repeatability: 2}}
1826 arg2 := []Call{{Repeatability: 1}, {Repeatability: 1}}
1827 arg3 := []Call{{Repeatability: 1}, {Repeatability: 1}}
1828
1829 mockedService.On("Test_Mock_IsMethodCallable", arg2).Return(true).Twice()
1830
1831 assert.False(t, mockedService.IsMethodCallable(t, "Test_Mock_IsMethodCallable", arg))
1832 assert.True(t, mockedService.IsMethodCallable(t, "Test_Mock_IsMethodCallable", arg2))
1833 assert.True(t, mockedService.IsMethodCallable(t, "Test_Mock_IsMethodCallable", arg3))
1834
1835 mockedService.MethodCalled("Test_Mock_IsMethodCallable", arg2)
1836 mockedService.MethodCalled("Test_Mock_IsMethodCallable", arg2)
1837
1838 assert.False(t, mockedService.IsMethodCallable(t, "Test_Mock_IsMethodCallable", arg2))
1839}
1840
1841func TestIsArgsEqual(t *testing.T) {
1842 t.Parallel()

Callers

nothing calls this directly

Calls 7

FalseFunction · 0.92
TrueFunction · 0.92
TwiceMethod · 0.80
ReturnMethod · 0.80
IsMethodCallableMethod · 0.80
MethodCalledMethod · 0.80
OnMethod · 0.45

Tested by

no test coverage detected