-
Notifications
You must be signed in to change notification settings - Fork 3
/
mock_Logger.go
208 lines (176 loc) Β· 5.62 KB
/
mock_Logger.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
// Code generated by mockery v2.49.0. DO NOT EDIT.
package passkey
import mock "github.com/stretchr/testify/mock"
// MockLogger is an autogenerated mock type for the Logger type
type MockLogger struct {
mock.Mock
}
type MockLogger_Expecter struct {
mock *mock.Mock
}
func (_m *MockLogger) EXPECT() *MockLogger_Expecter {
return &MockLogger_Expecter{mock: &_m.Mock}
}
// Debugf provides a mock function with given fields: format, v
func (_m *MockLogger) Debugf(format string, v ...any) {
var _ca []interface{}
_ca = append(_ca, format)
_ca = append(_ca, v...)
_m.Called(_ca...)
}
// MockLogger_Debugf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Debugf'
type MockLogger_Debugf_Call struct {
*mock.Call
}
// Debugf is a helper method to define mock.On call
// - format string
// - v ...any
func (_e *MockLogger_Expecter) Debugf(format interface{}, v ...interface{}) *MockLogger_Debugf_Call {
return &MockLogger_Debugf_Call{Call: _e.mock.On("Debugf",
append([]interface{}{format}, v...)...)}
}
func (_c *MockLogger_Debugf_Call) Run(run func(format string, v ...any)) *MockLogger_Debugf_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]any, len(args)-1)
for i, a := range args[1:] {
if a != nil {
variadicArgs[i] = a.(any)
}
}
run(args[0].(string), variadicArgs...)
})
return _c
}
func (_c *MockLogger_Debugf_Call) Return() *MockLogger_Debugf_Call {
_c.Call.Return()
return _c
}
func (_c *MockLogger_Debugf_Call) RunAndReturn(run func(string, ...any)) *MockLogger_Debugf_Call {
_c.Call.Return(run)
return _c
}
// Errorf provides a mock function with given fields: format, v
func (_m *MockLogger) Errorf(format string, v ...any) {
var _ca []interface{}
_ca = append(_ca, format)
_ca = append(_ca, v...)
_m.Called(_ca...)
}
// MockLogger_Errorf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Errorf'
type MockLogger_Errorf_Call struct {
*mock.Call
}
// Errorf is a helper method to define mock.On call
// - format string
// - v ...any
func (_e *MockLogger_Expecter) Errorf(format interface{}, v ...interface{}) *MockLogger_Errorf_Call {
return &MockLogger_Errorf_Call{Call: _e.mock.On("Errorf",
append([]interface{}{format}, v...)...)}
}
func (_c *MockLogger_Errorf_Call) Run(run func(format string, v ...any)) *MockLogger_Errorf_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]any, len(args)-1)
for i, a := range args[1:] {
if a != nil {
variadicArgs[i] = a.(any)
}
}
run(args[0].(string), variadicArgs...)
})
return _c
}
func (_c *MockLogger_Errorf_Call) Return() *MockLogger_Errorf_Call {
_c.Call.Return()
return _c
}
func (_c *MockLogger_Errorf_Call) RunAndReturn(run func(string, ...any)) *MockLogger_Errorf_Call {
_c.Call.Return(run)
return _c
}
// Infof provides a mock function with given fields: format, v
func (_m *MockLogger) Infof(format string, v ...any) {
var _ca []interface{}
_ca = append(_ca, format)
_ca = append(_ca, v...)
_m.Called(_ca...)
}
// MockLogger_Infof_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Infof'
type MockLogger_Infof_Call struct {
*mock.Call
}
// Infof is a helper method to define mock.On call
// - format string
// - v ...any
func (_e *MockLogger_Expecter) Infof(format interface{}, v ...interface{}) *MockLogger_Infof_Call {
return &MockLogger_Infof_Call{Call: _e.mock.On("Infof",
append([]interface{}{format}, v...)...)}
}
func (_c *MockLogger_Infof_Call) Run(run func(format string, v ...any)) *MockLogger_Infof_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]any, len(args)-1)
for i, a := range args[1:] {
if a != nil {
variadicArgs[i] = a.(any)
}
}
run(args[0].(string), variadicArgs...)
})
return _c
}
func (_c *MockLogger_Infof_Call) Return() *MockLogger_Infof_Call {
_c.Call.Return()
return _c
}
func (_c *MockLogger_Infof_Call) RunAndReturn(run func(string, ...any)) *MockLogger_Infof_Call {
_c.Call.Return(run)
return _c
}
// Warnf provides a mock function with given fields: format, v
func (_m *MockLogger) Warnf(format string, v ...any) {
var _ca []interface{}
_ca = append(_ca, format)
_ca = append(_ca, v...)
_m.Called(_ca...)
}
// MockLogger_Warnf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Warnf'
type MockLogger_Warnf_Call struct {
*mock.Call
}
// Warnf is a helper method to define mock.On call
// - format string
// - v ...any
func (_e *MockLogger_Expecter) Warnf(format interface{}, v ...interface{}) *MockLogger_Warnf_Call {
return &MockLogger_Warnf_Call{Call: _e.mock.On("Warnf",
append([]interface{}{format}, v...)...)}
}
func (_c *MockLogger_Warnf_Call) Run(run func(format string, v ...any)) *MockLogger_Warnf_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]any, len(args)-1)
for i, a := range args[1:] {
if a != nil {
variadicArgs[i] = a.(any)
}
}
run(args[0].(string), variadicArgs...)
})
return _c
}
func (_c *MockLogger_Warnf_Call) Return() *MockLogger_Warnf_Call {
_c.Call.Return()
return _c
}
func (_c *MockLogger_Warnf_Call) RunAndReturn(run func(string, ...any)) *MockLogger_Warnf_Call {
_c.Call.Return(run)
return _c
}
// NewMockLogger creates a new instance of MockLogger. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockLogger(t interface {
mock.TestingT
Cleanup(func())
}) *MockLogger {
mock := &MockLogger{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}