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

Function Test_Mock_On_WithChannelArgMatcher

mock/mock_test.go:400–410  ·  mock/mock_test.go::Test_Mock_On_WithChannelArgMatcher
(t *testing.T)

Source from the content-addressed store, hash-verified

398}
399
400func Test_Mock_On_WithChannelArgMatcher(t *testing.T) {
401 t.Parallel()
402
403 var mockedService TestExampleImplementation
404
405 mockedService.On("TheExampleMethod5",
406 MatchedBy(func(ch chan struct{}) bool { return ch == nil }),
407 ).Return(errors.New("fixture1"))
408
409 assert.EqualError(t, mockedService.TheExampleMethod5(nil), "fixture1")
410}
411
412func Test_Mock_On_WithMapArgMatcher(t *testing.T) {
413 t.Parallel()

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected