NewMockExampleInterface creates a new instance of MockExampleInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
(t interface {
mock.TestingT
Cleanup(func())
})
| 43 | // NewMockExampleInterface creates a new instance of MockExampleInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. |
| 44 | // The first argument is typically a *testing.T value. |
| 45 | func NewMockExampleInterface(t interface { |
| 46 | mock.TestingT |
| 47 | Cleanup(func()) |
| 48 | }) *MockExampleInterface { |
| 49 | mock := &MockExampleInterface{} |
| 50 | mock.Mock.Test(t) |
| 51 | |
| 52 | t.Cleanup(func() { mock.AssertExpectations(t) }) |
| 53 | |
| 54 | return mock |
| 55 | } |