mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 04:22:33 +08:00
chore: update mocks
This commit is contained in:
committed by
github-actions[bot]
parent
06bd235730
commit
86ff6bb88a
317
mocks/biz/BackupAccountRepo.go
Normal file
317
mocks/biz/BackupAccountRepo.go
Normal file
@@ -0,0 +1,317 @@
|
||||
// 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.BackupAccountCreate) (*biz.BackupAccount, error) {
|
||||
ret := _m.Called(ctx, req)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Create")
|
||||
}
|
||||
|
||||
var r0 *biz.BackupAccount
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *request.BackupAccountCreate) (*biz.BackupAccount, error)); ok {
|
||||
return rf(ctx, req)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *request.BackupAccountCreate) *biz.BackupAccount); ok {
|
||||
r0 = rf(ctx, req)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*biz.BackupAccount)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *request.BackupAccountCreate) 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.BackupAccountCreate
|
||||
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.BackupAccountCreate)) *BackupAccountRepo_Create_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*request.BackupAccountCreate))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *BackupAccountRepo_Create_Call) Return(_a0 *biz.BackupAccount, _a1 error) *BackupAccountRepo_Create_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *BackupAccountRepo_Create_Call) RunAndReturn(run func(context.Context, *request.BackupAccountCreate) (*biz.BackupAccount, 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.BackupAccount, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
}
|
||||
|
||||
var r0 *biz.BackupAccount
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(uint) (*biz.BackupAccount, error)); ok {
|
||||
return rf(id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(uint) *biz.BackupAccount); ok {
|
||||
r0 = rf(id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*biz.BackupAccount)
|
||||
}
|
||||
}
|
||||
|
||||
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.BackupAccount, _a1 error) *BackupAccountRepo_Get_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *BackupAccountRepo_Get_Call) RunAndReturn(run func(uint) (*biz.BackupAccount, 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.BackupAccount, int64, error) {
|
||||
ret := _m.Called(page, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for List")
|
||||
}
|
||||
|
||||
var r0 []*biz.BackupAccount
|
||||
var r1 int64
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(uint, uint) ([]*biz.BackupAccount, int64, error)); ok {
|
||||
return rf(page, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(uint, uint) []*biz.BackupAccount); ok {
|
||||
r0 = rf(page, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*biz.BackupAccount)
|
||||
}
|
||||
}
|
||||
|
||||
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.BackupAccount, _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.BackupAccount, 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.BackupAccountUpdate) 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.BackupAccountUpdate) 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.BackupAccountUpdate
|
||||
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.BackupAccountUpdate)) *BackupAccountRepo_Update_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*request.BackupAccountUpdate))
|
||||
})
|
||||
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.BackupAccountUpdate) 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
|
||||
}
|
||||
Reference in New Issue
Block a user