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

Function Test_Mock_Called_For_SetTime_Expectation

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

Source from the content-addressed store, hash-verified

1421}
1422
1423func Test_Mock_Called_For_SetTime_Expectation(t *testing.T) {
1424 t.Parallel()
1425
1426 var mockedService = new(TestExampleImplementation)
1427
1428 mockedService.On("TheExampleMethod", 1, 2, 3).Return(5, "6", true).Times(4)
1429
1430 mockedService.TheExampleMethod(1, 2, 3)
1431 mockedService.TheExampleMethod(1, 2, 3)
1432 mockedService.TheExampleMethod(1, 2, 3)
1433 mockedService.TheExampleMethod(1, 2, 3)
1434 assert.Panics(t, func() {
1435 mockedService.TheExampleMethod(1, 2, 3)
1436 })
1437
1438}
1439
1440func Test_Mock_Called_Unexpected(t *testing.T) {
1441 t.Parallel()

Callers

nothing calls this directly

Calls 5

PanicsFunction · 0.92
TimesMethod · 0.80
ReturnMethod · 0.80
TheExampleMethodMethod · 0.65
OnMethod · 0.45

Tested by

no test coverage detected