-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathTagRepo.go
155 lines (126 loc) · 4.01 KB
/
TagRepo.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
// Code generated by mockery v2.43.0. DO NOT EDIT.
package mocks
import (
context "context"
tag "github.com/bangumi/server/internal/tag"
mock "github.com/stretchr/testify/mock"
)
// TagRepo is an autogenerated mock type for the Repo type
type TagRepo struct {
mock.Mock
}
type TagRepo_Expecter struct {
mock *mock.Mock
}
func (_m *TagRepo) EXPECT() *TagRepo_Expecter {
return &TagRepo_Expecter{mock: &_m.Mock}
}
// Get provides a mock function with given fields: ctx, id
func (_m *TagRepo) Get(ctx context.Context, id uint32) ([]tag.Tag, error) {
ret := _m.Called(ctx, id)
if len(ret) == 0 {
panic("no return value specified for Get")
}
var r0 []tag.Tag
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, uint32) ([]tag.Tag, error)); ok {
return rf(ctx, id)
}
if rf, ok := ret.Get(0).(func(context.Context, uint32) []tag.Tag); ok {
r0 = rf(ctx, id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]tag.Tag)
}
}
if rf, ok := ret.Get(1).(func(context.Context, uint32) error); ok {
r1 = rf(ctx, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// TagRepo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
type TagRepo_Get_Call struct {
*mock.Call
}
// Get is a helper method to define mock.On call
// - ctx context.Context
// - id uint32
func (_e *TagRepo_Expecter) Get(ctx interface{}, id interface{}) *TagRepo_Get_Call {
return &TagRepo_Get_Call{Call: _e.mock.On("Get", ctx, id)}
}
func (_c *TagRepo_Get_Call) Run(run func(ctx context.Context, id uint32)) *TagRepo_Get_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint32))
})
return _c
}
func (_c *TagRepo_Get_Call) Return(_a0 []tag.Tag, _a1 error) *TagRepo_Get_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *TagRepo_Get_Call) RunAndReturn(run func(context.Context, uint32) ([]tag.Tag, error)) *TagRepo_Get_Call {
_c.Call.Return(run)
return _c
}
// GetByIDs provides a mock function with given fields: ctx, ids
func (_m *TagRepo) GetByIDs(ctx context.Context, ids []uint32) (map[uint32][]tag.Tag, error) {
ret := _m.Called(ctx, ids)
if len(ret) == 0 {
panic("no return value specified for GetByIDs")
}
var r0 map[uint32][]tag.Tag
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, []uint32) (map[uint32][]tag.Tag, error)); ok {
return rf(ctx, ids)
}
if rf, ok := ret.Get(0).(func(context.Context, []uint32) map[uint32][]tag.Tag); ok {
r0 = rf(ctx, ids)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[uint32][]tag.Tag)
}
}
if rf, ok := ret.Get(1).(func(context.Context, []uint32) error); ok {
r1 = rf(ctx, ids)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// TagRepo_GetByIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByIDs'
type TagRepo_GetByIDs_Call struct {
*mock.Call
}
// GetByIDs is a helper method to define mock.On call
// - ctx context.Context
// - ids []uint32
func (_e *TagRepo_Expecter) GetByIDs(ctx interface{}, ids interface{}) *TagRepo_GetByIDs_Call {
return &TagRepo_GetByIDs_Call{Call: _e.mock.On("GetByIDs", ctx, ids)}
}
func (_c *TagRepo_GetByIDs_Call) Run(run func(ctx context.Context, ids []uint32)) *TagRepo_GetByIDs_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].([]uint32))
})
return _c
}
func (_c *TagRepo_GetByIDs_Call) Return(_a0 map[uint32][]tag.Tag, _a1 error) *TagRepo_GetByIDs_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *TagRepo_GetByIDs_Call) RunAndReturn(run func(context.Context, []uint32) (map[uint32][]tag.Tag, error)) *TagRepo_GetByIDs_Call {
_c.Call.Return(run)
return _c
}
// NewTagRepo creates a new instance of TagRepo. 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 NewTagRepo(t interface {
mock.TestingT
Cleanup(func())
}) *TagRepo {
mock := &TagRepo{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}