detector_mock_test.go RawHistoryFolder
1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package hints
6
7import (
8 "context"
9
10 mock "github.com/stretchr/testify/mock"
11)
12
13// newMockdetector creates a new instance of mockdetector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
14// The first argument is typically a *testing.T value.
15func newMockdetector(t interface {
16 mock.TestingT
17 Cleanup(func())
18}) *mockdetector {
19 if helper, ok := t.(interface{ Helper() }); ok {
20 helper.Helper()
21 }
22
23 mock := &mockdetector{}
24 mock.Mock.Test(t)
25
26 t.Cleanup(func() {
27 if helper, ok := t.(interface{ Helper() }); ok {
28 helper.Helper()
29 }
30 mock.AssertExpectations(t)
31 })
32
33 return mock
34}
35
36// mockdetector is an autogenerated mock type for the detector type
37type mockdetector struct {
38 mock.Mock
39}
40
41type mockdetector_Expecter struct {
42 mock *mock.Mock
43}
44
45func (_m *mockdetector) EXPECT() *mockdetector_Expecter {
46 return &mockdetector_Expecter{mock: &_m.Mock}
47}
48
49// Close provides a mock function for the type mockdetector
50func (_mock *mockdetector) Close() error {
51 ret := _mock.Called()
52
53 if len(ret) == 0 {
54 panic("no return value specified for Close")
55 }
56
57 var r0 error
58 if returnFunc, ok := ret.Get(0).(func() error); ok {
59 r0 = returnFunc()
60 } else {
61 r0 = ret.Error(0)
62 }
63 return r0
64}
65
66// mockdetector_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
67type mockdetector_Close_Call struct {
68 *mock.Call
69}
70
71// Close is a helper method to define mock.On call
72func (_e *mockdetector_Expecter) Close() *mockdetector_Close_Call {
73 return &mockdetector_Close_Call{Call: _e.mock.On("Close")}
74}
75
76func (_c *mockdetector_Close_Call) Run(run func()) *mockdetector_Close_Call {
77 _c.Call.Run(func(args mock.Arguments) {
78 run()
79 })
80 return _c
81}
82
83func (_c *mockdetector_Close_Call) Return(err error) *mockdetector_Close_Call {
84 _c.Call.Return(err)
85 return _c
86}
87
88func (_c *mockdetector_Close_Call) RunAndReturn(run func() error) *mockdetector_Close_Call {
89 _c.Call.Return(run)
90 return _c
91}
92
93// Detect provides a mock function for the type mockdetector
94func (_mock *mockdetector) Detect(ctx context.Context, f detFrame) ([]detection, error) {
95 ret := _mock.Called(ctx, f)
96
97 if len(ret) == 0 {
98 panic("no return value specified for Detect")
99 }
100
101 var r0 []detection
102 var r1 error
103 if returnFunc, ok := ret.Get(0).(func(context.Context, detFrame) ([]detection, error)); ok {
104 return returnFunc(ctx, f)
105 }
106 if returnFunc, ok := ret.Get(0).(func(context.Context, detFrame) []detection); ok {
107 r0 = returnFunc(ctx, f)
108 } else {
109 if ret.Get(0) != nil {
110 r0 = ret.Get(0).([]detection)
111 }
112 }
113 if returnFunc, ok := ret.Get(1).(func(context.Context, detFrame) error); ok {
114 r1 = returnFunc(ctx, f)
115 } else {
116 r1 = ret.Error(1)
117 }
118 return r0, r1
119}
120
121// mockdetector_Detect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Detect'
122type mockdetector_Detect_Call struct {
123 *mock.Call
124}
125
126// Detect is a helper method to define mock.On call
127// - ctx context.Context
128// - f detFrame
129func (_e *mockdetector_Expecter) Detect(ctx any, f any) *mockdetector_Detect_Call {
130 return &mockdetector_Detect_Call{Call: _e.mock.On("Detect", ctx, f)}
131}
132
133func (_c *mockdetector_Detect_Call) Run(run func(ctx context.Context, f detFrame)) *mockdetector_Detect_Call {
134 _c.Call.Run(func(args mock.Arguments) {
135 var arg0 context.Context
136 if args[0] != nil {
137 arg0 = args[0].(context.Context)
138 }
139 var arg1 detFrame
140 if args[1] != nil {
141 arg1 = args[1].(detFrame)
142 }
143 run(
144 arg0,
145 arg1,
146 )
147 })
148 return _c
149}
150
151func (_c *mockdetector_Detect_Call) Return(detectionMoqParams []detection, err error) *mockdetector_Detect_Call {
152 _c.Call.Return(detectionMoqParams, err)
153 return _c
154}
155
156func (_c *mockdetector_Detect_Call) RunAndReturn(run func(ctx context.Context, f detFrame) ([]detection, error)) *mockdetector_Detect_Call {
157 _c.Call.Return(run)
158 return _c
159}