mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 06:40:59 +08:00
318 lines
9.0 KiB
Go
318 lines
9.0 KiB
Go
// Code generated by mockery. DO NOT EDIT.
|
|
|
|
package biz
|
|
|
|
import (
|
|
context "context"
|
|
|
|
biz "github.com/acepanel/panel/internal/biz"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
request "github.com/acepanel/panel/internal/http/request"
|
|
)
|
|
|
|
// BackupAccountRepo is an autogenerated mock type for the BackupAccountRepo type
|
|
type BackupAccountRepo struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type BackupAccountRepo_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *BackupAccountRepo) EXPECT() *BackupAccountRepo_Expecter {
|
|
return &BackupAccountRepo_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// Create provides a mock function with given fields: ctx, req
|
|
func (_m *BackupAccountRepo) Create(ctx context.Context, req *request.BackupStorageCreate) (*biz.BackupStorage, error) {
|
|
ret := _m.Called(ctx, req)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Create")
|
|
}
|
|
|
|
var r0 *biz.BackupStorage
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *request.BackupStorageCreate) (*biz.BackupStorage, error)); ok {
|
|
return rf(ctx, req)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, *request.BackupStorageCreate) *biz.BackupStorage); ok {
|
|
r0 = rf(ctx, req)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*biz.BackupStorage)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *request.BackupStorageCreate) error); ok {
|
|
r1 = rf(ctx, req)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// BackupAccountRepo_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
|
|
type BackupAccountRepo_Create_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Create is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - req *request.BackupStorageCreate
|
|
func (_e *BackupAccountRepo_Expecter) Create(ctx interface{}, req interface{}) *BackupAccountRepo_Create_Call {
|
|
return &BackupAccountRepo_Create_Call{Call: _e.mock.On("Create", ctx, req)}
|
|
}
|
|
|
|
func (_c *BackupAccountRepo_Create_Call) Run(run func(ctx context.Context, req *request.BackupStorageCreate)) *BackupAccountRepo_Create_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(*request.BackupStorageCreate))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupAccountRepo_Create_Call) Return(_a0 *biz.BackupStorage, _a1 error) *BackupAccountRepo_Create_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupAccountRepo_Create_Call) RunAndReturn(run func(context.Context, *request.BackupStorageCreate) (*biz.BackupStorage, error)) *BackupAccountRepo_Create_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Delete provides a mock function with given fields: ctx, id
|
|
func (_m *BackupAccountRepo) Delete(ctx context.Context, id uint) error {
|
|
ret := _m.Called(ctx, id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Delete")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, uint) error); ok {
|
|
r0 = rf(ctx, id)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// BackupAccountRepo_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
|
|
type BackupAccountRepo_Delete_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Delete is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - id uint
|
|
func (_e *BackupAccountRepo_Expecter) Delete(ctx interface{}, id interface{}) *BackupAccountRepo_Delete_Call {
|
|
return &BackupAccountRepo_Delete_Call{Call: _e.mock.On("Delete", ctx, id)}
|
|
}
|
|
|
|
func (_c *BackupAccountRepo_Delete_Call) Run(run func(ctx context.Context, id uint)) *BackupAccountRepo_Delete_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(uint))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupAccountRepo_Delete_Call) Return(_a0 error) *BackupAccountRepo_Delete_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupAccountRepo_Delete_Call) RunAndReturn(run func(context.Context, uint) error) *BackupAccountRepo_Delete_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Get provides a mock function with given fields: id
|
|
func (_m *BackupAccountRepo) Get(id uint) (*biz.BackupStorage, error) {
|
|
ret := _m.Called(id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Get")
|
|
}
|
|
|
|
var r0 *biz.BackupStorage
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(uint) (*biz.BackupStorage, error)); ok {
|
|
return rf(id)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(uint) *biz.BackupStorage); ok {
|
|
r0 = rf(id)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*biz.BackupStorage)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(uint) error); ok {
|
|
r1 = rf(id)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// BackupAccountRepo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
|
|
type BackupAccountRepo_Get_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Get is a helper method to define mock.On call
|
|
// - id uint
|
|
func (_e *BackupAccountRepo_Expecter) Get(id interface{}) *BackupAccountRepo_Get_Call {
|
|
return &BackupAccountRepo_Get_Call{Call: _e.mock.On("Get", id)}
|
|
}
|
|
|
|
func (_c *BackupAccountRepo_Get_Call) Run(run func(id uint)) *BackupAccountRepo_Get_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(uint))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupAccountRepo_Get_Call) Return(_a0 *biz.BackupStorage, _a1 error) *BackupAccountRepo_Get_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupAccountRepo_Get_Call) RunAndReturn(run func(uint) (*biz.BackupStorage, error)) *BackupAccountRepo_Get_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// List provides a mock function with given fields: page, limit
|
|
func (_m *BackupAccountRepo) List(page uint, limit uint) ([]*biz.BackupStorage, int64, error) {
|
|
ret := _m.Called(page, limit)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for List")
|
|
}
|
|
|
|
var r0 []*biz.BackupStorage
|
|
var r1 int64
|
|
var r2 error
|
|
if rf, ok := ret.Get(0).(func(uint, uint) ([]*biz.BackupStorage, int64, error)); ok {
|
|
return rf(page, limit)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(uint, uint) []*biz.BackupStorage); ok {
|
|
r0 = rf(page, limit)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*biz.BackupStorage)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(uint, uint) int64); ok {
|
|
r1 = rf(page, limit)
|
|
} else {
|
|
r1 = ret.Get(1).(int64)
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(uint, uint) error); ok {
|
|
r2 = rf(page, limit)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// BackupAccountRepo_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
|
|
type BackupAccountRepo_List_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// List is a helper method to define mock.On call
|
|
// - page uint
|
|
// - limit uint
|
|
func (_e *BackupAccountRepo_Expecter) List(page interface{}, limit interface{}) *BackupAccountRepo_List_Call {
|
|
return &BackupAccountRepo_List_Call{Call: _e.mock.On("List", page, limit)}
|
|
}
|
|
|
|
func (_c *BackupAccountRepo_List_Call) Run(run func(page uint, limit uint)) *BackupAccountRepo_List_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(uint), args[1].(uint))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupAccountRepo_List_Call) Return(_a0 []*biz.BackupStorage, _a1 int64, _a2 error) *BackupAccountRepo_List_Call {
|
|
_c.Call.Return(_a0, _a1, _a2)
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupAccountRepo_List_Call) RunAndReturn(run func(uint, uint) ([]*biz.BackupStorage, int64, error)) *BackupAccountRepo_List_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Update provides a mock function with given fields: ctx, req
|
|
func (_m *BackupAccountRepo) Update(ctx context.Context, req *request.BackupStorageUpdate) error {
|
|
ret := _m.Called(ctx, req)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Update")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *request.BackupStorageUpdate) error); ok {
|
|
r0 = rf(ctx, req)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// BackupAccountRepo_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update'
|
|
type BackupAccountRepo_Update_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Update is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - req *request.BackupStorageUpdate
|
|
func (_e *BackupAccountRepo_Expecter) Update(ctx interface{}, req interface{}) *BackupAccountRepo_Update_Call {
|
|
return &BackupAccountRepo_Update_Call{Call: _e.mock.On("Update", ctx, req)}
|
|
}
|
|
|
|
func (_c *BackupAccountRepo_Update_Call) Run(run func(ctx context.Context, req *request.BackupStorageUpdate)) *BackupAccountRepo_Update_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(*request.BackupStorageUpdate))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupAccountRepo_Update_Call) Return(_a0 error) *BackupAccountRepo_Update_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupAccountRepo_Update_Call) RunAndReturn(run func(context.Context, *request.BackupStorageUpdate) error) *BackupAccountRepo_Update_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NewBackupAccountRepo creates a new instance of BackupAccountRepo. 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 NewBackupAccountRepo(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *BackupAccountRepo {
|
|
mock := &BackupAccountRepo{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|