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

Function Test_Mock_Unset_WithFuncPanics

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

Source from the content-addressed store, hash-verified

712}
713
714func Test_Mock_Unset_WithFuncPanics(t *testing.T) {
715 t.Parallel()
716
717 // make a test impl object
718 var mockedService = new(TestExampleImplementation)
719 mock1 := mockedService.On("TheExampleMethod", 1)
720 mock1.Arguments = append(mock1.Arguments, func(string) error { return nil })
721
722 assert.Panics(t, func() {
723 mock1.Unset()
724 })
725}
726
727func Test_Mock_Return(t *testing.T) {
728 t.Parallel()

Callers

nothing calls this directly

Calls 3

PanicsFunction · 0.92
UnsetMethod · 0.80
OnMethod · 0.45

Tested by

no test coverage detected