1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9 "io"
10
11 "github.com/bnema/dumber/internal/application/port"
12 mock "github.com/stretchr/testify/mock"
13)
14
15// NewMockBrowserWindowOpener creates a new instance of MockBrowserWindowOpener. 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 NewMockBrowserWindowOpener(t interface {
18 mock.TestingT
19 Cleanup(func())
20}) *MockBrowserWindowOpener {
21 mock := &MockBrowserWindowOpener{}
22 mock.Mock.Test(t)
23
24 t.Cleanup(func() { mock.AssertExpectations(t) })
25
26 return mock
27}
28
29// MockBrowserWindowOpener is an autogenerated mock type for the BrowserWindowOpener type
30type MockBrowserWindowOpener struct {
31 mock.Mock
32}
33
34type MockBrowserWindowOpener_Expecter struct {
35 mock *mock.Mock
36}
37
38func (_m *MockBrowserWindowOpener) EXPECT() *MockBrowserWindowOpener_Expecter {
39 return &MockBrowserWindowOpener_Expecter{mock: &_m.Mock}
40}
41
42// OpenExternalURL provides a mock function for the type MockBrowserWindowOpener
43func (_mock *MockBrowserWindowOpener) OpenExternalURL(ctx context.Context, url string) error {
44 ret := _mock.Called(ctx, url)
45
46 if len(ret) == 0 {
47 panic("no return value specified for OpenExternalURL")
48 }
49
50 var r0 error
51 if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
52 r0 = returnFunc(ctx, url)
53 } else {
54 r0 = ret.Error(0)
55 }
56 return r0
57}
58
59// MockBrowserWindowOpener_OpenExternalURL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OpenExternalURL'
60type MockBrowserWindowOpener_OpenExternalURL_Call struct {
61 *mock.Call
62}
63
64// OpenExternalURL is a helper method to define mock.On call
65// - ctx context.Context
66// - url string
67func (_e *MockBrowserWindowOpener_Expecter) OpenExternalURL(ctx any, url any) *MockBrowserWindowOpener_OpenExternalURL_Call {
68 return &MockBrowserWindowOpener_OpenExternalURL_Call{Call: _e.mock.On("OpenExternalURL", ctx, url)}
69}
70
71func (_c *MockBrowserWindowOpener_OpenExternalURL_Call) Run(run func(ctx context.Context, url string)) *MockBrowserWindowOpener_OpenExternalURL_Call {
72 _c.Call.Run(func(args mock.Arguments) {
73 var arg0 context.Context
74 if args[0] != nil {
75 arg0 = args[0].(context.Context)
76 }
77 var arg1 string
78 if args[1] != nil {
79 arg1 = args[1].(string)
80 }
81 run(
82 arg0,
83 arg1,
84 )
85 })
86 return _c
87}
88
89func (_c *MockBrowserWindowOpener_OpenExternalURL_Call) Return(err error) *MockBrowserWindowOpener_OpenExternalURL_Call {
90 _c.Call.Return(err)
91 return _c
92}
93
94func (_c *MockBrowserWindowOpener_OpenExternalURL_Call) RunAndReturn(run func(ctx context.Context, url string) error) *MockBrowserWindowOpener_OpenExternalURL_Call {
95 _c.Call.Return(run)
96 return _c
97}
98
99// OpenFreshWindow provides a mock function for the type MockBrowserWindowOpener
100func (_mock *MockBrowserWindowOpener) OpenFreshWindow(ctx context.Context, url string) error {
101 ret := _mock.Called(ctx, url)
102
103 if len(ret) == 0 {
104 panic("no return value specified for OpenFreshWindow")
105 }
106
107 var r0 error
108 if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
109 r0 = returnFunc(ctx, url)
110 } else {
111 r0 = ret.Error(0)
112 }
113 return r0
114}
115
116// MockBrowserWindowOpener_OpenFreshWindow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OpenFreshWindow'
117type MockBrowserWindowOpener_OpenFreshWindow_Call struct {
118 *mock.Call
119}
120
121// OpenFreshWindow is a helper method to define mock.On call
122// - ctx context.Context
123// - url string
124func (_e *MockBrowserWindowOpener_Expecter) OpenFreshWindow(ctx any, url any) *MockBrowserWindowOpener_OpenFreshWindow_Call {
125 return &MockBrowserWindowOpener_OpenFreshWindow_Call{Call: _e.mock.On("OpenFreshWindow", ctx, url)}
126}
127
128func (_c *MockBrowserWindowOpener_OpenFreshWindow_Call) Run(run func(ctx context.Context, url string)) *MockBrowserWindowOpener_OpenFreshWindow_Call {
129 _c.Call.Run(func(args mock.Arguments) {
130 var arg0 context.Context
131 if args[0] != nil {
132 arg0 = args[0].(context.Context)
133 }
134 var arg1 string
135 if args[1] != nil {
136 arg1 = args[1].(string)
137 }
138 run(
139 arg0,
140 arg1,
141 )
142 })
143 return _c
144}
145
146func (_c *MockBrowserWindowOpener_OpenFreshWindow_Call) Return(err error) *MockBrowserWindowOpener_OpenFreshWindow_Call {
147 _c.Call.Return(err)
148 return _c
149}
150
151func (_c *MockBrowserWindowOpener_OpenFreshWindow_Call) RunAndReturn(run func(ctx context.Context, url string) error) *MockBrowserWindowOpener_OpenFreshWindow_Call {
152 _c.Call.Return(run)
153 return _c
154}
155
156// NewMockBrowserLaunchRelay creates a new instance of MockBrowserLaunchRelay. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
157// The first argument is typically a *testing.T value.
158func NewMockBrowserLaunchRelay(t interface {
159 mock.TestingT
160 Cleanup(func())
161}) *MockBrowserLaunchRelay {
162 mock := &MockBrowserLaunchRelay{}
163 mock.Mock.Test(t)
164
165 t.Cleanup(func() { mock.AssertExpectations(t) })
166
167 return mock
168}
169
170// MockBrowserLaunchRelay is an autogenerated mock type for the BrowserLaunchRelay type
171type MockBrowserLaunchRelay struct {
172 mock.Mock
173}
174
175type MockBrowserLaunchRelay_Expecter struct {
176 mock *mock.Mock
177}
178
179func (_m *MockBrowserLaunchRelay) EXPECT() *MockBrowserLaunchRelay_Expecter {
180 return &MockBrowserLaunchRelay_Expecter{mock: &_m.Mock}
181}
182
183// DeliverOpenExternalURL provides a mock function for the type MockBrowserLaunchRelay
184func (_mock *MockBrowserLaunchRelay) DeliverOpenExternalURL(ctx context.Context, url string) (bool, error) {
185 ret := _mock.Called(ctx, url)
186
187 if len(ret) == 0 {
188 panic("no return value specified for DeliverOpenExternalURL")
189 }
190
191 var r0 bool
192 var r1 error
193 if returnFunc, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok {
194 return returnFunc(ctx, url)
195 }
196 if returnFunc, ok := ret.Get(0).(func(context.Context, string) bool); ok {
197 r0 = returnFunc(ctx, url)
198 } else {
199 r0 = ret.Get(0).(bool)
200 }
201 if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
202 r1 = returnFunc(ctx, url)
203 } else {
204 r1 = ret.Error(1)
205 }
206 return r0, r1
207}
208
209// MockBrowserLaunchRelay_DeliverOpenExternalURL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeliverOpenExternalURL'
210type MockBrowserLaunchRelay_DeliverOpenExternalURL_Call struct {
211 *mock.Call
212}
213
214// DeliverOpenExternalURL is a helper method to define mock.On call
215// - ctx context.Context
216// - url string
217func (_e *MockBrowserLaunchRelay_Expecter) DeliverOpenExternalURL(ctx any, url any) *MockBrowserLaunchRelay_DeliverOpenExternalURL_Call {
218 return &MockBrowserLaunchRelay_DeliverOpenExternalURL_Call{Call: _e.mock.On("DeliverOpenExternalURL", ctx, url)}
219}
220
221func (_c *MockBrowserLaunchRelay_DeliverOpenExternalURL_Call) Run(run func(ctx context.Context, url string)) *MockBrowserLaunchRelay_DeliverOpenExternalURL_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 string
228 if args[1] != nil {
229 arg1 = args[1].(string)
230 }
231 run(
232 arg0,
233 arg1,
234 )
235 })
236 return _c
237}
238
239func (_c *MockBrowserLaunchRelay_DeliverOpenExternalURL_Call) Return(b bool, err error) *MockBrowserLaunchRelay_DeliverOpenExternalURL_Call {
240 _c.Call.Return(b, err)
241 return _c
242}
243
244func (_c *MockBrowserLaunchRelay_DeliverOpenExternalURL_Call) RunAndReturn(run func(ctx context.Context, url string) (bool, error)) *MockBrowserLaunchRelay_DeliverOpenExternalURL_Call {
245 _c.Call.Return(run)
246 return _c
247}
248
249// DeliverOpenFreshWindow provides a mock function for the type MockBrowserLaunchRelay
250func (_mock *MockBrowserLaunchRelay) DeliverOpenFreshWindow(ctx context.Context, url string) (bool, error) {
251 ret := _mock.Called(ctx, url)
252
253 if len(ret) == 0 {
254 panic("no return value specified for DeliverOpenFreshWindow")
255 }
256
257 var r0 bool
258 var r1 error
259 if returnFunc, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok {
260 return returnFunc(ctx, url)
261 }
262 if returnFunc, ok := ret.Get(0).(func(context.Context, string) bool); ok {
263 r0 = returnFunc(ctx, url)
264 } else {
265 r0 = ret.Get(0).(bool)
266 }
267 if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
268 r1 = returnFunc(ctx, url)
269 } else {
270 r1 = ret.Error(1)
271 }
272 return r0, r1
273}
274
275// MockBrowserLaunchRelay_DeliverOpenFreshWindow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeliverOpenFreshWindow'
276type MockBrowserLaunchRelay_DeliverOpenFreshWindow_Call struct {
277 *mock.Call
278}
279
280// DeliverOpenFreshWindow is a helper method to define mock.On call
281// - ctx context.Context
282// - url string
283func (_e *MockBrowserLaunchRelay_Expecter) DeliverOpenFreshWindow(ctx any, url any) *MockBrowserLaunchRelay_DeliverOpenFreshWindow_Call {
284 return &MockBrowserLaunchRelay_DeliverOpenFreshWindow_Call{Call: _e.mock.On("DeliverOpenFreshWindow", ctx, url)}
285}
286
287func (_c *MockBrowserLaunchRelay_DeliverOpenFreshWindow_Call) Run(run func(ctx context.Context, url string)) *MockBrowserLaunchRelay_DeliverOpenFreshWindow_Call {
288 _c.Call.Run(func(args mock.Arguments) {
289 var arg0 context.Context
290 if args[0] != nil {
291 arg0 = args[0].(context.Context)
292 }
293 var arg1 string
294 if args[1] != nil {
295 arg1 = args[1].(string)
296 }
297 run(
298 arg0,
299 arg1,
300 )
301 })
302 return _c
303}
304
305func (_c *MockBrowserLaunchRelay_DeliverOpenFreshWindow_Call) Return(b bool, err error) *MockBrowserLaunchRelay_DeliverOpenFreshWindow_Call {
306 _c.Call.Return(b, err)
307 return _c
308}
309
310func (_c *MockBrowserLaunchRelay_DeliverOpenFreshWindow_Call) RunAndReturn(run func(ctx context.Context, url string) (bool, error)) *MockBrowserLaunchRelay_DeliverOpenFreshWindow_Call {
311 _c.Call.Return(run)
312 return _c
313}
314
315// Listen provides a mock function for the type MockBrowserLaunchRelay
316func (_mock *MockBrowserLaunchRelay) Listen(ctx context.Context, opener port.BrowserWindowOpener) (io.Closer, error) {
317 ret := _mock.Called(ctx, opener)
318
319 if len(ret) == 0 {
320 panic("no return value specified for Listen")
321 }
322
323 var r0 io.Closer
324 var r1 error
325 if returnFunc, ok := ret.Get(0).(func(context.Context, port.BrowserWindowOpener) (io.Closer, error)); ok {
326 return returnFunc(ctx, opener)
327 }
328 if returnFunc, ok := ret.Get(0).(func(context.Context, port.BrowserWindowOpener) io.Closer); ok {
329 r0 = returnFunc(ctx, opener)
330 } else {
331 if ret.Get(0) != nil {
332 r0 = ret.Get(0).(io.Closer)
333 }
334 }
335 if returnFunc, ok := ret.Get(1).(func(context.Context, port.BrowserWindowOpener) error); ok {
336 r1 = returnFunc(ctx, opener)
337 } else {
338 r1 = ret.Error(1)
339 }
340 return r0, r1
341}
342
343// MockBrowserLaunchRelay_Listen_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Listen'
344type MockBrowserLaunchRelay_Listen_Call struct {
345 *mock.Call
346}
347
348// Listen is a helper method to define mock.On call
349// - ctx context.Context
350// - opener port.BrowserWindowOpener
351func (_e *MockBrowserLaunchRelay_Expecter) Listen(ctx any, opener any) *MockBrowserLaunchRelay_Listen_Call {
352 return &MockBrowserLaunchRelay_Listen_Call{Call: _e.mock.On("Listen", ctx, opener)}
353}
354
355func (_c *MockBrowserLaunchRelay_Listen_Call) Run(run func(ctx context.Context, opener port.BrowserWindowOpener)) *MockBrowserLaunchRelay_Listen_Call {
356 _c.Call.Run(func(args mock.Arguments) {
357 var arg0 context.Context
358 if args[0] != nil {
359 arg0 = args[0].(context.Context)
360 }
361 var arg1 port.BrowserWindowOpener
362 if args[1] != nil {
363 arg1 = args[1].(port.BrowserWindowOpener)
364 }
365 run(
366 arg0,
367 arg1,
368 )
369 })
370 return _c
371}
372
373func (_c *MockBrowserLaunchRelay_Listen_Call) Return(closer io.Closer, err error) *MockBrowserLaunchRelay_Listen_Call {
374 _c.Call.Return(closer, err)
375 return _c
376}
377
378func (_c *MockBrowserLaunchRelay_Listen_Call) RunAndReturn(run func(ctx context.Context, opener port.BrowserWindowOpener) (io.Closer, error)) *MockBrowserLaunchRelay_Listen_Call {
379 _c.Call.Return(run)
380 return _c
381}