| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
|
|
| package replication |
|
|
| import ( |
| time "time" |
|
|
| mock "github.com/stretchr/testify/mock" |
| ) |
|
|
| |
| type MockTimer struct { |
| mock.Mock |
| } |
|
|
| type MockTimer_Expecter struct { |
| mock *mock.Mock |
| } |
|
|
| func (_m *MockTimer) EXPECT() *MockTimer_Expecter { |
| return &MockTimer_Expecter{mock: &_m.Mock} |
| } |
|
|
| |
| func (_m *MockTimer) AfterFunc(duration time.Duration, fn func()) *time.Timer { |
| ret := _m.Called(duration, fn) |
|
|
| if len(ret) == 0 { |
| panic("no return value specified for AfterFunc") |
| } |
|
|
| var r0 *time.Timer |
| if rf, ok := ret.Get(0).(func(time.Duration, func()) *time.Timer); ok { |
| r0 = rf(duration, fn) |
| } else { |
| if ret.Get(0) != nil { |
| r0 = ret.Get(0).(*time.Timer) |
| } |
| } |
|
|
| return r0 |
| } |
|
|
| |
| type MockTimer_AfterFunc_Call struct { |
| *mock.Call |
| } |
|
|
| |
| |
| |
| func (_e *MockTimer_Expecter) AfterFunc(duration interface{}, fn interface{}) *MockTimer_AfterFunc_Call { |
| return &MockTimer_AfterFunc_Call{Call: _e.mock.On("AfterFunc", duration, fn)} |
| } |
|
|
| func (_c *MockTimer_AfterFunc_Call) Run(run func(duration time.Duration, fn func())) *MockTimer_AfterFunc_Call { |
| _c.Call.Run(func(args mock.Arguments) { |
| run(args[0].(time.Duration), args[1].(func())) |
| }) |
| return _c |
| } |
|
|
| func (_c *MockTimer_AfterFunc_Call) Return(_a0 *time.Timer) *MockTimer_AfterFunc_Call { |
| _c.Call.Return(_a0) |
| return _c |
| } |
|
|
| func (_c *MockTimer_AfterFunc_Call) RunAndReturn(run func(time.Duration, func()) *time.Timer) *MockTimer_AfterFunc_Call { |
| _c.Call.Return(run) |
| return _c |
| } |
|
|
| |
| |
| func NewMockTimer(t interface { |
| mock.TestingT |
| Cleanup(func()) |
| }) *MockTimer { |
| mock := &MockTimer{} |
| mock.Mock.Test(t) |
|
|
| t.Cleanup(func() { mock.AssertExpectations(t) }) |
|
|
| return mock |
| } |
|
|