db-migrator.go
237 строк · 7.6 Кб
1// Code generated by mockery. DO NOT EDIT.
2
3package mockaction
4
5import (
6context "context"
7
8entity "github.com/raoptimus/db-migrator.go/internal/dal/entity"
9mock "github.com/stretchr/testify/mock"
10)
11
12// MigrationService is an autogenerated mock type for the MigrationService type
13type MigrationService struct {
14mock.Mock
15}
16
17type MigrationService_Expecter struct {
18mock *mock.Mock
19}
20
21func (_m *MigrationService) EXPECT() *MigrationService_Expecter {
22return &MigrationService_Expecter{mock: &_m.Mock}
23}
24
25// ApplyFile provides a mock function with given fields: ctx, _a1, fileName, safely
26func (_m *MigrationService) ApplyFile(ctx context.Context, _a1 *entity.Migration, fileName string, safely bool) error {
27ret := _m.Called(ctx, _a1, fileName, safely)
28
29var r0 error
30if rf, ok := ret.Get(0).(func(context.Context, *entity.Migration, string, bool) error); ok {
31r0 = rf(ctx, _a1, fileName, safely)
32} else {
33r0 = ret.Error(0)
34}
35
36return r0
37}
38
39// MigrationService_ApplyFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyFile'
40type MigrationService_ApplyFile_Call struct {
41*mock.Call
42}
43
44// ApplyFile is a helper method to define mock.On call
45// - ctx context.Context
46// - _a1 *entity.Migration
47// - fileName string
48// - safely bool
49func (_e *MigrationService_Expecter) ApplyFile(ctx interface{}, _a1 interface{}, fileName interface{}, safely interface{}) *MigrationService_ApplyFile_Call {
50return &MigrationService_ApplyFile_Call{Call: _e.mock.On("ApplyFile", ctx, _a1, fileName, safely)}
51}
52
53func (_c *MigrationService_ApplyFile_Call) Run(run func(ctx context.Context, _a1 *entity.Migration, fileName string, safely bool)) *MigrationService_ApplyFile_Call {
54_c.Call.Run(func(args mock.Arguments) {
55run(args[0].(context.Context), args[1].(*entity.Migration), args[2].(string), args[3].(bool))
56})
57return _c
58}
59
60func (_c *MigrationService_ApplyFile_Call) Return(_a0 error) *MigrationService_ApplyFile_Call {
61_c.Call.Return(_a0)
62return _c
63}
64
65func (_c *MigrationService_ApplyFile_Call) RunAndReturn(run func(context.Context, *entity.Migration, string, bool) error) *MigrationService_ApplyFile_Call {
66_c.Call.Return(run)
67return _c
68}
69
70// Migrations provides a mock function with given fields: ctx, limit
71func (_m *MigrationService) Migrations(ctx context.Context, limit int) (entity.Migrations, error) {
72ret := _m.Called(ctx, limit)
73
74var r0 entity.Migrations
75var r1 error
76if rf, ok := ret.Get(0).(func(context.Context, int) (entity.Migrations, error)); ok {
77return rf(ctx, limit)
78}
79if rf, ok := ret.Get(0).(func(context.Context, int) entity.Migrations); ok {
80r0 = rf(ctx, limit)
81} else {
82if ret.Get(0) != nil {
83r0 = ret.Get(0).(entity.Migrations)
84}
85}
86
87if rf, ok := ret.Get(1).(func(context.Context, int) error); ok {
88r1 = rf(ctx, limit)
89} else {
90r1 = ret.Error(1)
91}
92
93return r0, r1
94}
95
96// MigrationService_Migrations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Migrations'
97type MigrationService_Migrations_Call struct {
98*mock.Call
99}
100
101// Migrations is a helper method to define mock.On call
102// - ctx context.Context
103// - limit int
104func (_e *MigrationService_Expecter) Migrations(ctx interface{}, limit interface{}) *MigrationService_Migrations_Call {
105return &MigrationService_Migrations_Call{Call: _e.mock.On("Migrations", ctx, limit)}
106}
107
108func (_c *MigrationService_Migrations_Call) Run(run func(ctx context.Context, limit int)) *MigrationService_Migrations_Call {
109_c.Call.Run(func(args mock.Arguments) {
110run(args[0].(context.Context), args[1].(int))
111})
112return _c
113}
114
115func (_c *MigrationService_Migrations_Call) Return(_a0 entity.Migrations, _a1 error) *MigrationService_Migrations_Call {
116_c.Call.Return(_a0, _a1)
117return _c
118}
119
120func (_c *MigrationService_Migrations_Call) RunAndReturn(run func(context.Context, int) (entity.Migrations, error)) *MigrationService_Migrations_Call {
121_c.Call.Return(run)
122return _c
123}
124
125// NewMigrations provides a mock function with given fields: ctx
126func (_m *MigrationService) NewMigrations(ctx context.Context) (entity.Migrations, error) {
127ret := _m.Called(ctx)
128
129var r0 entity.Migrations
130var r1 error
131if rf, ok := ret.Get(0).(func(context.Context) (entity.Migrations, error)); ok {
132return rf(ctx)
133}
134if rf, ok := ret.Get(0).(func(context.Context) entity.Migrations); ok {
135r0 = rf(ctx)
136} else {
137if ret.Get(0) != nil {
138r0 = ret.Get(0).(entity.Migrations)
139}
140}
141
142if rf, ok := ret.Get(1).(func(context.Context) error); ok {
143r1 = rf(ctx)
144} else {
145r1 = ret.Error(1)
146}
147
148return r0, r1
149}
150
151// MigrationService_NewMigrations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewMigrations'
152type MigrationService_NewMigrations_Call struct {
153*mock.Call
154}
155
156// NewMigrations is a helper method to define mock.On call
157// - ctx context.Context
158func (_e *MigrationService_Expecter) NewMigrations(ctx interface{}) *MigrationService_NewMigrations_Call {
159return &MigrationService_NewMigrations_Call{Call: _e.mock.On("NewMigrations", ctx)}
160}
161
162func (_c *MigrationService_NewMigrations_Call) Run(run func(ctx context.Context)) *MigrationService_NewMigrations_Call {
163_c.Call.Run(func(args mock.Arguments) {
164run(args[0].(context.Context))
165})
166return _c
167}
168
169func (_c *MigrationService_NewMigrations_Call) Return(_a0 entity.Migrations, _a1 error) *MigrationService_NewMigrations_Call {
170_c.Call.Return(_a0, _a1)
171return _c
172}
173
174func (_c *MigrationService_NewMigrations_Call) RunAndReturn(run func(context.Context) (entity.Migrations, error)) *MigrationService_NewMigrations_Call {
175_c.Call.Return(run)
176return _c
177}
178
179// RevertFile provides a mock function with given fields: ctx, _a1, fileName, safely
180func (_m *MigrationService) RevertFile(ctx context.Context, _a1 *entity.Migration, fileName string, safely bool) error {
181ret := _m.Called(ctx, _a1, fileName, safely)
182
183var r0 error
184if rf, ok := ret.Get(0).(func(context.Context, *entity.Migration, string, bool) error); ok {
185r0 = rf(ctx, _a1, fileName, safely)
186} else {
187r0 = ret.Error(0)
188}
189
190return r0
191}
192
193// MigrationService_RevertFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RevertFile'
194type MigrationService_RevertFile_Call struct {
195*mock.Call
196}
197
198// RevertFile is a helper method to define mock.On call
199// - ctx context.Context
200// - _a1 *entity.Migration
201// - fileName string
202// - safely bool
203func (_e *MigrationService_Expecter) RevertFile(ctx interface{}, _a1 interface{}, fileName interface{}, safely interface{}) *MigrationService_RevertFile_Call {
204return &MigrationService_RevertFile_Call{Call: _e.mock.On("RevertFile", ctx, _a1, fileName, safely)}
205}
206
207func (_c *MigrationService_RevertFile_Call) Run(run func(ctx context.Context, _a1 *entity.Migration, fileName string, safely bool)) *MigrationService_RevertFile_Call {
208_c.Call.Run(func(args mock.Arguments) {
209run(args[0].(context.Context), args[1].(*entity.Migration), args[2].(string), args[3].(bool))
210})
211return _c
212}
213
214func (_c *MigrationService_RevertFile_Call) Return(_a0 error) *MigrationService_RevertFile_Call {
215_c.Call.Return(_a0)
216return _c
217}
218
219func (_c *MigrationService_RevertFile_Call) RunAndReturn(run func(context.Context, *entity.Migration, string, bool) error) *MigrationService_RevertFile_Call {
220_c.Call.Return(run)
221return _c
222}
223
224type mockConstructorTestingTNewMigrationService interface {
225mock.TestingT
226Cleanup(func())
227}
228
229// NewMigrationService creates a new instance of MigrationService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
230func NewMigrationService(t mockConstructorTestingTNewMigrationService) *MigrationService {
231mock := &MigrationService{}
232mock.Mock.Test(t)
233
234t.Cleanup(func() { mock.AssertExpectations(t) })
235
236return mock
237}
238