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

Function Test_Mock_On_WithMapArgMatcher

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

Source from the content-addressed store, hash-verified

410}
411
412func Test_Mock_On_WithMapArgMatcher(t *testing.T) {
413 t.Parallel()
414
415 var mockedService TestExampleImplementation
416
417 mockedService.On("TheExampleMethod6",
418 MatchedBy(func(m map[string]bool) bool { return m == nil }),
419 ).Return(errors.New("fixture1"))
420
421 assert.EqualError(t, mockedService.TheExampleMethod6(nil), "fixture1")
422}
423
424func Test_Mock_On_WithSliceArgMatcher(t *testing.T) {
425 t.Parallel()

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected