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