| 1552 | } |
| 1553 | |
| 1554 | func Test_Mock_AssertExpectations_With_Pointers(t *testing.T) { |
| 1555 | t.Parallel() |
| 1556 | |
| 1557 | var mockedService = new(TestExampleImplementation) |
| 1558 | |
| 1559 | mockedService.On("Test_Mock_AssertExpectations_With_Pointers", &struct{ Foo int }{1}).Return(1) |
| 1560 | mockedService.On("Test_Mock_AssertExpectations_With_Pointers", &struct{ Foo int }{2}).Return(2) |
| 1561 | |
| 1562 | tt := new(testing.T) |
| 1563 | assert.False(t, mockedService.AssertExpectations(tt)) |
| 1564 | |
| 1565 | s := struct{ Foo int }{1} |
| 1566 | // make the calls now |
| 1567 | mockedService.Called(&s) |
| 1568 | s.Foo = 2 |
| 1569 | mockedService.Called(&s) |
| 1570 | |
| 1571 | // now assert expectations |
| 1572 | assert.True(t, mockedService.AssertExpectations(tt)) |
| 1573 | |
| 1574 | } |
| 1575 | |
| 1576 | func Test_Mock_AssertExpectationsCustomType(t *testing.T) { |
| 1577 | t.Parallel() |