1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9
10 "bnema.dev/ermite/internal/domain"
11 mock "github.com/stretchr/testify/mock"
12)
13
14// NewCIRefTipStore creates a new instance of CIRefTipStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
15// The first argument is typically a *testing.T value.
16func NewCIRefTipStore(t interface {
17 mock.TestingT
18 Cleanup(func())
19}) *CIRefTipStore {
20 if helper, ok := t.(interface{ Helper() }); ok {
21 helper.Helper()
22 }
23
24 mock := &CIRefTipStore{}
25 mock.Mock.Test(t)
26
27 t.Cleanup(func() {
28 if helper, ok := t.(interface{ Helper() }); ok {
29 helper.Helper()
30 }
31 mock.AssertExpectations(t)
32 })
33
34 return mock
35}
36
37// CIRefTipStore is an autogenerated mock type for the CIRefTipStore type
38type CIRefTipStore struct {
39 mock.Mock
40}
41
42type CIRefTipStore_Expecter struct {
43 mock *mock.Mock
44}
45
46func (_m *CIRefTipStore) EXPECT() *CIRefTipStore_Expecter {
47 return &CIRefTipStore_Expecter{mock: &_m.Mock}
48}
49
50// DeleteRefTip provides a mock function for the type CIRefTipStore
51func (_mock *CIRefTipStore) DeleteRefTip(ctx context.Context, repo domain.RepoName, ref string) error {
52 ret := _mock.Called(ctx, repo, ref)
53
54 if len(ret) == 0 {
55 panic("no return value specified for DeleteRefTip")
56 }
57
58 var r0 error
59 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string) error); ok {
60 r0 = returnFunc(ctx, repo, ref)
61 } else {
62 r0 = ret.Error(0)
63 }
64 return r0
65}
66
67// CIRefTipStore_DeleteRefTip_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteRefTip'
68type CIRefTipStore_DeleteRefTip_Call struct {
69 *mock.Call
70}
71
72// DeleteRefTip is a helper method to define mock.On call
73// - ctx context.Context
74// - repo domain.RepoName
75// - ref string
76func (_e *CIRefTipStore_Expecter) DeleteRefTip(ctx any, repo any, ref any) *CIRefTipStore_DeleteRefTip_Call {
77 return &CIRefTipStore_DeleteRefTip_Call{Call: _e.mock.On("DeleteRefTip", ctx, repo, ref)}
78}
79
80func (_c *CIRefTipStore_DeleteRefTip_Call) Run(run func(ctx context.Context, repo domain.RepoName, ref string)) *CIRefTipStore_DeleteRefTip_Call {
81 _c.Call.Run(func(args mock.Arguments) {
82 var arg0 context.Context
83 if args[0] != nil {
84 arg0 = args[0].(context.Context)
85 }
86 var arg1 domain.RepoName
87 if args[1] != nil {
88 arg1 = args[1].(domain.RepoName)
89 }
90 var arg2 string
91 if args[2] != nil {
92 arg2 = args[2].(string)
93 }
94 run(
95 arg0,
96 arg1,
97 arg2,
98 )
99 })
100 return _c
101}
102
103func (_c *CIRefTipStore_DeleteRefTip_Call) Return(err error) *CIRefTipStore_DeleteRefTip_Call {
104 _c.Call.Return(err)
105 return _c
106}
107
108func (_c *CIRefTipStore_DeleteRefTip_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, ref string) error) *CIRefTipStore_DeleteRefTip_Call {
109 _c.Call.Return(run)
110 return _c
111}
112
113// DeleteRefTipIf provides a mock function for the type CIRefTipStore
114func (_mock *CIRefTipStore) DeleteRefTipIf(ctx context.Context, repo domain.RepoName, ref string, sha string) error {
115 ret := _mock.Called(ctx, repo, ref, sha)
116
117 if len(ret) == 0 {
118 panic("no return value specified for DeleteRefTipIf")
119 }
120
121 var r0 error
122 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string, string) error); ok {
123 r0 = returnFunc(ctx, repo, ref, sha)
124 } else {
125 r0 = ret.Error(0)
126 }
127 return r0
128}
129
130// CIRefTipStore_DeleteRefTipIf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteRefTipIf'
131type CIRefTipStore_DeleteRefTipIf_Call struct {
132 *mock.Call
133}
134
135// DeleteRefTipIf is a helper method to define mock.On call
136// - ctx context.Context
137// - repo domain.RepoName
138// - ref string
139// - sha string
140func (_e *CIRefTipStore_Expecter) DeleteRefTipIf(ctx any, repo any, ref any, sha any) *CIRefTipStore_DeleteRefTipIf_Call {
141 return &CIRefTipStore_DeleteRefTipIf_Call{Call: _e.mock.On("DeleteRefTipIf", ctx, repo, ref, sha)}
142}
143
144func (_c *CIRefTipStore_DeleteRefTipIf_Call) Run(run func(ctx context.Context, repo domain.RepoName, ref string, sha string)) *CIRefTipStore_DeleteRefTipIf_Call {
145 _c.Call.Run(func(args mock.Arguments) {
146 var arg0 context.Context
147 if args[0] != nil {
148 arg0 = args[0].(context.Context)
149 }
150 var arg1 domain.RepoName
151 if args[1] != nil {
152 arg1 = args[1].(domain.RepoName)
153 }
154 var arg2 string
155 if args[2] != nil {
156 arg2 = args[2].(string)
157 }
158 var arg3 string
159 if args[3] != nil {
160 arg3 = args[3].(string)
161 }
162 run(
163 arg0,
164 arg1,
165 arg2,
166 arg3,
167 )
168 })
169 return _c
170}
171
172func (_c *CIRefTipStore_DeleteRefTipIf_Call) Return(err error) *CIRefTipStore_DeleteRefTipIf_Call {
173 _c.Call.Return(err)
174 return _c
175}
176
177func (_c *CIRefTipStore_DeleteRefTipIf_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, ref string, sha string) error) *CIRefTipStore_DeleteRefTipIf_Call {
178 _c.Call.Return(run)
179 return _c
180}
181
182// GetRefTip provides a mock function for the type CIRefTipStore
183func (_mock *CIRefTipStore) GetRefTip(ctx context.Context, repo domain.RepoName, ref string) (domain.CIRefTip, error) {
184 ret := _mock.Called(ctx, repo, ref)
185
186 if len(ret) == 0 {
187 panic("no return value specified for GetRefTip")
188 }
189
190 var r0 domain.CIRefTip
191 var r1 error
192 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string) (domain.CIRefTip, error)); ok {
193 return returnFunc(ctx, repo, ref)
194 }
195 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string) domain.CIRefTip); ok {
196 r0 = returnFunc(ctx, repo, ref)
197 } else {
198 r0 = ret.Get(0).(domain.CIRefTip)
199 }
200 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, string) error); ok {
201 r1 = returnFunc(ctx, repo, ref)
202 } else {
203 r1 = ret.Error(1)
204 }
205 return r0, r1
206}
207
208// CIRefTipStore_GetRefTip_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRefTip'
209type CIRefTipStore_GetRefTip_Call struct {
210 *mock.Call
211}
212
213// GetRefTip is a helper method to define mock.On call
214// - ctx context.Context
215// - repo domain.RepoName
216// - ref string
217func (_e *CIRefTipStore_Expecter) GetRefTip(ctx any, repo any, ref any) *CIRefTipStore_GetRefTip_Call {
218 return &CIRefTipStore_GetRefTip_Call{Call: _e.mock.On("GetRefTip", ctx, repo, ref)}
219}
220
221func (_c *CIRefTipStore_GetRefTip_Call) Run(run func(ctx context.Context, repo domain.RepoName, ref string)) *CIRefTipStore_GetRefTip_Call {
222 _c.Call.Run(func(args mock.Arguments) {
223 var arg0 context.Context
224 if args[0] != nil {
225 arg0 = args[0].(context.Context)
226 }
227 var arg1 domain.RepoName
228 if args[1] != nil {
229 arg1 = args[1].(domain.RepoName)
230 }
231 var arg2 string
232 if args[2] != nil {
233 arg2 = args[2].(string)
234 }
235 run(
236 arg0,
237 arg1,
238 arg2,
239 )
240 })
241 return _c
242}
243
244func (_c *CIRefTipStore_GetRefTip_Call) Return(cIRefTip domain.CIRefTip, err error) *CIRefTipStore_GetRefTip_Call {
245 _c.Call.Return(cIRefTip, err)
246 return _c
247}
248
249func (_c *CIRefTipStore_GetRefTip_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, ref string) (domain.CIRefTip, error)) *CIRefTipStore_GetRefTip_Call {
250 _c.Call.Return(run)
251 return _c
252}
253
254// PutRefTip provides a mock function for the type CIRefTipStore
255func (_mock *CIRefTipStore) PutRefTip(ctx context.Context, t domain.CIRefTip) error {
256 ret := _mock.Called(ctx, t)
257
258 if len(ret) == 0 {
259 panic("no return value specified for PutRefTip")
260 }
261
262 var r0 error
263 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.CIRefTip) error); ok {
264 r0 = returnFunc(ctx, t)
265 } else {
266 r0 = ret.Error(0)
267 }
268 return r0
269}
270
271// CIRefTipStore_PutRefTip_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutRefTip'
272type CIRefTipStore_PutRefTip_Call struct {
273 *mock.Call
274}
275
276// PutRefTip is a helper method to define mock.On call
277// - ctx context.Context
278// - t domain.CIRefTip
279func (_e *CIRefTipStore_Expecter) PutRefTip(ctx any, t any) *CIRefTipStore_PutRefTip_Call {
280 return &CIRefTipStore_PutRefTip_Call{Call: _e.mock.On("PutRefTip", ctx, t)}
281}
282
283func (_c *CIRefTipStore_PutRefTip_Call) Run(run func(ctx context.Context, t domain.CIRefTip)) *CIRefTipStore_PutRefTip_Call {
284 _c.Call.Run(func(args mock.Arguments) {
285 var arg0 context.Context
286 if args[0] != nil {
287 arg0 = args[0].(context.Context)
288 }
289 var arg1 domain.CIRefTip
290 if args[1] != nil {
291 arg1 = args[1].(domain.CIRefTip)
292 }
293 run(
294 arg0,
295 arg1,
296 )
297 })
298 return _c
299}
300
301func (_c *CIRefTipStore_PutRefTip_Call) Return(err error) *CIRefTipStore_PutRefTip_Call {
302 _c.Call.Return(err)
303 return _c
304}
305
306func (_c *CIRefTipStore_PutRefTip_Call) RunAndReturn(run func(ctx context.Context, t domain.CIRefTip) error) *CIRefTipStore_PutRefTip_Call {
307 _c.Call.Return(run)
308 return _c
309}