/
Timer.go
154 lines (122 loc) · 3.39 KB
/
Timer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
// Code generated by mockery v2.22.1. DO NOT EDIT.
package mocks
import (
time "time"
mock "github.com/stretchr/testify/mock"
)
// Timer is an autogenerated mock type for the Timer type
type Timer struct {
mock.Mock
}
type Timer_Expecter struct {
mock *mock.Mock
}
func (_m *Timer) EXPECT() *Timer_Expecter {
return &Timer_Expecter{mock: &_m.Mock}
}
// Chan provides a mock function with given fields:
func (_m *Timer) Chan() <-chan time.Time {
ret := _m.Called()
var r0 <-chan time.Time
if rf, ok := ret.Get(0).(func() <-chan time.Time); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(<-chan time.Time)
}
}
return r0
}
// Timer_Chan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Chan'
type Timer_Chan_Call struct {
*mock.Call
}
// Chan is a helper method to define mock.On call
func (_e *Timer_Expecter) Chan() *Timer_Chan_Call {
return &Timer_Chan_Call{Call: _e.mock.On("Chan")}
}
func (_c *Timer_Chan_Call) Run(run func()) *Timer_Chan_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *Timer_Chan_Call) Return(_a0 <-chan time.Time) *Timer_Chan_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Timer_Chan_Call) RunAndReturn(run func() <-chan time.Time) *Timer_Chan_Call {
_c.Call.Return(run)
return _c
}
// Reset provides a mock function with given fields: d
func (_m *Timer) Reset(d time.Duration) {
_m.Called(d)
}
// Timer_Reset_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reset'
type Timer_Reset_Call struct {
*mock.Call
}
// Reset is a helper method to define mock.On call
// - d time.Duration
func (_e *Timer_Expecter) Reset(d interface{}) *Timer_Reset_Call {
return &Timer_Reset_Call{Call: _e.mock.On("Reset", d)}
}
func (_c *Timer_Reset_Call) Run(run func(d time.Duration)) *Timer_Reset_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(time.Duration))
})
return _c
}
func (_c *Timer_Reset_Call) Return() *Timer_Reset_Call {
_c.Call.Return()
return _c
}
func (_c *Timer_Reset_Call) RunAndReturn(run func(time.Duration)) *Timer_Reset_Call {
_c.Call.Return(run)
return _c
}
// Stop provides a mock function with given fields:
func (_m *Timer) Stop() bool {
ret := _m.Called()
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// Timer_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop'
type Timer_Stop_Call struct {
*mock.Call
}
// Stop is a helper method to define mock.On call
func (_e *Timer_Expecter) Stop() *Timer_Stop_Call {
return &Timer_Stop_Call{Call: _e.mock.On("Stop")}
}
func (_c *Timer_Stop_Call) Run(run func()) *Timer_Stop_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *Timer_Stop_Call) Return(_a0 bool) *Timer_Stop_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Timer_Stop_Call) RunAndReturn(run func() bool) *Timer_Stop_Call {
_c.Call.Return(run)
return _c
}
type mockConstructorTestingTNewTimer interface {
mock.TestingT
Cleanup(func())
}
// NewTimer creates a new instance of Timer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewTimer(t mockConstructorTestingTNewTimer) *Timer {
mock := &Timer{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}