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

Function Test_Mock_On_WithInterfaceArgMatcher

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

Source from the content-addressed store, hash-verified

386}
387
388func Test_Mock_On_WithInterfaceArgMatcher(t *testing.T) {
389 t.Parallel()
390
391 var mockedService TestExampleImplementation
392
393 mockedService.On("TheExampleMethod4",
394 MatchedBy(func(a ExampleInterface) bool { return a == nil }),
395 ).Return(errors.New("fixture1"))
396
397 assert.EqualError(t, mockedService.TheExampleMethod4(nil), "fixture1")
398}
399
400func Test_Mock_On_WithChannelArgMatcher(t *testing.T) {
401 t.Parallel()

Callers

nothing calls this directly

Calls 5

TheExampleMethod4Method · 0.95
EqualErrorFunction · 0.92
MatchedByFunction · 0.85
ReturnMethod · 0.80
OnMethod · 0.45

Tested by

no test coverage detected