/
mock_AuthRepository.go
145 lines (119 loc) · 4.31 KB
/
mock_AuthRepository.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
// Code generated by mockery v2.23.4. DO NOT EDIT.
package auth
import (
model "github.com/kevindharmawan/saas-backend/internal/model"
mock "github.com/stretchr/testify/mock"
)
// MockAuthRepository is an autogenerated mock type for the AuthRepository type
type MockAuthRepository struct {
mock.Mock
}
type MockAuthRepository_Expecter struct {
mock *mock.Mock
}
func (_m *MockAuthRepository) EXPECT() *MockAuthRepository_Expecter {
return &MockAuthRepository_Expecter{mock: &_m.Mock}
}
// CreateAuthUser provides a mock function with given fields: _a0
func (_m *MockAuthRepository) CreateAuthUser(_a0 *model.Auth) (int64, *model.AppError) {
ret := _m.Called(_a0)
var r0 int64
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(*model.Auth) (int64, *model.AppError)); ok {
return rf(_a0)
}
if rf, ok := ret.Get(0).(func(*model.Auth) int64); ok {
r0 = rf(_a0)
} else {
r0 = ret.Get(0).(int64)
}
if rf, ok := ret.Get(1).(func(*model.Auth) *model.AppError); ok {
r1 = rf(_a0)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*model.AppError)
}
}
return r0, r1
}
// MockAuthRepository_CreateAuthUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateAuthUser'
type MockAuthRepository_CreateAuthUser_Call struct {
*mock.Call
}
// CreateAuthUser is a helper method to define mock.On call
// - _a0 *model.Auth
func (_e *MockAuthRepository_Expecter) CreateAuthUser(_a0 interface{}) *MockAuthRepository_CreateAuthUser_Call {
return &MockAuthRepository_CreateAuthUser_Call{Call: _e.mock.On("CreateAuthUser", _a0)}
}
func (_c *MockAuthRepository_CreateAuthUser_Call) Run(run func(_a0 *model.Auth)) *MockAuthRepository_CreateAuthUser_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(*model.Auth))
})
return _c
}
func (_c *MockAuthRepository_CreateAuthUser_Call) Return(_a0 int64, _a1 *model.AppError) *MockAuthRepository_CreateAuthUser_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockAuthRepository_CreateAuthUser_Call) RunAndReturn(run func(*model.Auth) (int64, *model.AppError)) *MockAuthRepository_CreateAuthUser_Call {
_c.Call.Return(run)
return _c
}
// GetAuthUserByEmail provides a mock function with given fields: email
func (_m *MockAuthRepository) GetAuthUserByEmail(email string) (*model.Auth, *model.AppError) {
ret := _m.Called(email)
var r0 *model.Auth
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(string) (*model.Auth, *model.AppError)); ok {
return rf(email)
}
if rf, ok := ret.Get(0).(func(string) *model.Auth); ok {
r0 = rf(email)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Auth)
}
}
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
r1 = rf(email)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*model.AppError)
}
}
return r0, r1
}
// MockAuthRepository_GetAuthUserByEmail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAuthUserByEmail'
type MockAuthRepository_GetAuthUserByEmail_Call struct {
*mock.Call
}
// GetAuthUserByEmail is a helper method to define mock.On call
// - email string
func (_e *MockAuthRepository_Expecter) GetAuthUserByEmail(email interface{}) *MockAuthRepository_GetAuthUserByEmail_Call {
return &MockAuthRepository_GetAuthUserByEmail_Call{Call: _e.mock.On("GetAuthUserByEmail", email)}
}
func (_c *MockAuthRepository_GetAuthUserByEmail_Call) Run(run func(email string)) *MockAuthRepository_GetAuthUserByEmail_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string))
})
return _c
}
func (_c *MockAuthRepository_GetAuthUserByEmail_Call) Return(_a0 *model.Auth, _a1 *model.AppError) *MockAuthRepository_GetAuthUserByEmail_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockAuthRepository_GetAuthUserByEmail_Call) RunAndReturn(run func(string) (*model.Auth, *model.AppError)) *MockAuthRepository_GetAuthUserByEmail_Call {
_c.Call.Return(run)
return _c
}
// NewMockAuthRepository creates a new instance of MockAuthRepository. 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 NewMockAuthRepository(t interface {
mock.TestingT
Cleanup(func())
}) *MockAuthRepository {
mock := &MockAuthRepository{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}