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

Function Test_Mock_On_WithSliceArgMatcher

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

Source from the content-addressed store, hash-verified

422}
423
424func Test_Mock_On_WithSliceArgMatcher(t *testing.T) {
425 t.Parallel()
426
427 var mockedService TestExampleImplementation
428
429 mockedService.On("TheExampleMethod7",
430 MatchedBy(func(slice []bool) bool { return slice == nil }),
431 ).Return(errors.New("fixture1"))
432
433 assert.EqualError(t, mockedService.TheExampleMethod7(nil), "fixture1")
434}
435
436func Test_Mock_On_WithVariadicFunc(t *testing.T) {
437 t.Parallel()

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected