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

Function Test_Mock_AssertExpectations_Placeholder

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

Source from the content-addressed store, hash-verified

1528}
1529
1530func Test_Mock_AssertExpectations_Placeholder(t *testing.T) {
1531 t.Parallel()
1532
1533 var mockedService = new(TestExampleImplementation)
1534
1535 mockedService.On("Test_Mock_AssertExpectations_Placeholder", 1, 2, 3).Return(5, 6, 7).Once()
1536 mockedService.On("Test_Mock_AssertExpectations_Placeholder", 3, 2, 1).Return(7, 6, 5)
1537
1538 tt := new(testing.T)
1539 assert.False(t, mockedService.AssertExpectations(tt))
1540
1541 // make the call now
1542 mockedService.Called(1, 2, 3)
1543
1544 // now assert expectations
1545 assert.False(t, mockedService.AssertExpectations(tt))
1546
1547 // make call to the second expectation
1548 mockedService.Called(3, 2, 1)
1549
1550 // now assert expectations again
1551 assert.True(t, mockedService.AssertExpectations(tt))
1552}
1553
1554func Test_Mock_AssertExpectations_With_Pointers(t *testing.T) {
1555 t.Parallel()

Callers

nothing calls this directly

Calls 7

FalseFunction · 0.92
TrueFunction · 0.92
OnceMethod · 0.80
ReturnMethod · 0.80
CalledMethod · 0.80
AssertExpectationsMethod · 0.65
OnMethod · 0.45

Tested by

no test coverage detected