-
Notifications
You must be signed in to change notification settings - Fork 50
/
WorkItem.go
176 lines (141 loc) · 4.79 KB
/
WorkItem.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// Code generated by mockery v2.22.1. DO NOT EDIT.
package mocks
import mock "github.com/stretchr/testify/mock"
// WorkItem is an autogenerated mock type for the WorkItem type
type WorkItem struct {
mock.Mock
}
type WorkItem_Expecter struct {
mock *mock.Mock
}
func (_m *WorkItem) EXPECT() *WorkItem_Expecter {
return &WorkItem_Expecter{mock: &_m.Mock}
}
// Monitor provides a mock function with given fields: f
func (_m *WorkItem) Monitor(f func() error) func() error {
ret := _m.Called(f)
var r0 func() error
if rf, ok := ret.Get(0).(func(func() error) func() error); ok {
r0 = rf(f)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(func() error)
}
}
return r0
}
// WorkItem_Monitor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Monitor'
type WorkItem_Monitor_Call struct {
*mock.Call
}
// Monitor is a helper method to define mock.On call
// - f func() error
func (_e *WorkItem_Expecter) Monitor(f interface{}) *WorkItem_Monitor_Call {
return &WorkItem_Monitor_Call{Call: _e.mock.On("Monitor", f)}
}
func (_c *WorkItem_Monitor_Call) Run(run func(f func() error)) *WorkItem_Monitor_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(func() error))
})
return _c
}
func (_c *WorkItem_Monitor_Call) Return(_a0 func() error) *WorkItem_Monitor_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *WorkItem_Monitor_Call) RunAndReturn(run func(func() error) func() error) *WorkItem_Monitor_Call {
_c.Call.Return(run)
return _c
}
// ReportDone provides a mock function with given fields:
func (_m *WorkItem) ReportDone() {
_m.Called()
}
// WorkItem_ReportDone_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReportDone'
type WorkItem_ReportDone_Call struct {
*mock.Call
}
// ReportDone is a helper method to define mock.On call
func (_e *WorkItem_Expecter) ReportDone() *WorkItem_ReportDone_Call {
return &WorkItem_ReportDone_Call{Call: _e.mock.On("ReportDone")}
}
func (_c *WorkItem_ReportDone_Call) Run(run func()) *WorkItem_ReportDone_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *WorkItem_ReportDone_Call) Return() *WorkItem_ReportDone_Call {
_c.Call.Return()
return _c
}
func (_c *WorkItem_ReportDone_Call) RunAndReturn(run func()) *WorkItem_ReportDone_Call {
_c.Call.Return(run)
return _c
}
// ReportError provides a mock function with given fields: err
func (_m *WorkItem) ReportError(err error) {
_m.Called(err)
}
// WorkItem_ReportError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReportError'
type WorkItem_ReportError_Call struct {
*mock.Call
}
// ReportError is a helper method to define mock.On call
// - err error
func (_e *WorkItem_Expecter) ReportError(err interface{}) *WorkItem_ReportError_Call {
return &WorkItem_ReportError_Call{Call: _e.mock.On("ReportError", err)}
}
func (_c *WorkItem_ReportError_Call) Run(run func(err error)) *WorkItem_ReportError_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(error))
})
return _c
}
func (_c *WorkItem_ReportError_Call) Return() *WorkItem_ReportError_Call {
_c.Call.Return()
return _c
}
func (_c *WorkItem_ReportError_Call) RunAndReturn(run func(error)) *WorkItem_ReportError_Call {
_c.Call.Return(run)
return _c
}
// ReportProgress provides a mock function with given fields: step, progress
func (_m *WorkItem) ReportProgress(step int, progress float64) {
_m.Called(step, progress)
}
// WorkItem_ReportProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReportProgress'
type WorkItem_ReportProgress_Call struct {
*mock.Call
}
// ReportProgress is a helper method to define mock.On call
// - step int
// - progress float64
func (_e *WorkItem_Expecter) ReportProgress(step interface{}, progress interface{}) *WorkItem_ReportProgress_Call {
return &WorkItem_ReportProgress_Call{Call: _e.mock.On("ReportProgress", step, progress)}
}
func (_c *WorkItem_ReportProgress_Call) Run(run func(step int, progress float64)) *WorkItem_ReportProgress_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(int), args[1].(float64))
})
return _c
}
func (_c *WorkItem_ReportProgress_Call) Return() *WorkItem_ReportProgress_Call {
_c.Call.Return()
return _c
}
func (_c *WorkItem_ReportProgress_Call) RunAndReturn(run func(int, float64)) *WorkItem_ReportProgress_Call {
_c.Call.Return(run)
return _c
}
type mockConstructorTestingTNewWorkItem interface {
mock.TestingT
Cleanup(func())
}
// NewWorkItem creates a new instance of WorkItem. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewWorkItem(t mockConstructorTestingTNewWorkItem) *WorkItem {
mock := &WorkItem{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}