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

Function Test_AssertExpectationsForObjects_Helper

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

Source from the content-addressed store, hash-verified

1450}
1451
1452func Test_AssertExpectationsForObjects_Helper(t *testing.T) {
1453 t.Parallel()
1454
1455 var mockedService1 = new(TestExampleImplementation)
1456 var mockedService2 = new(TestExampleImplementation)
1457 var mockedService3 = new(TestExampleImplementation)
1458 var mockedService4 = new(TestExampleImplementation) // No expectations does not cause a panic
1459
1460 mockedService1.On("Test_AssertExpectationsForObjects_Helper", 1).Return()
1461 mockedService2.On("Test_AssertExpectationsForObjects_Helper", 2).Return()
1462 mockedService3.On("Test_AssertExpectationsForObjects_Helper", 3).Return()
1463
1464 mockedService1.Called(1)
1465 mockedService2.Called(2)
1466 mockedService3.Called(3)
1467
1468 assert.True(t, AssertExpectationsForObjects(t, &mockedService1.Mock, &mockedService2.Mock, &mockedService3.Mock, &mockedService4.Mock))
1469 assert.True(t, AssertExpectationsForObjects(t, mockedService1, mockedService2, mockedService3, mockedService4))
1470
1471}
1472
1473func Test_AssertExpectationsForObjects_Helper_Failed(t *testing.T) {
1474 t.Parallel()

Callers

nothing calls this directly

Calls 5

TrueFunction · 0.92
ReturnMethod · 0.80
CalledMethod · 0.80
OnMethod · 0.45

Tested by

no test coverage detected