mirror of
https://github.com/tnb-labs/panel.git
synced 2026-08-29 02:10:58 +08:00
3ce353e8e4
mockery v2 已 EOL,其内嵌的旧版 x/tools 无法解析 Go 1.27 的 export data, 导致 Mockery workflow 在 stable 切到 1.27.0 后持续失败。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
681 lines
18 KiB
Go
681 lines
18 KiB
Go
// Code generated by mockery; DO NOT EDIT.
|
|
// github.com/vektra/mockery
|
|
// template: testify
|
|
|
|
package biz
|
|
|
|
import (
|
|
"github.com/acepanel/panel/v3/internal/biz"
|
|
"github.com/acepanel/panel/v3/internal/request"
|
|
"github.com/acepanel/panel/v3/pkg/types"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// NewProjectRepo creates a new instance of ProjectRepo. 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 NewProjectRepo(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *ProjectRepo {
|
|
mock := &ProjectRepo{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|
|
|
|
// ProjectRepo is an autogenerated mock type for the ProjectRepo type
|
|
type ProjectRepo struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type ProjectRepo_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *ProjectRepo) EXPECT() *ProjectRepo_Expecter {
|
|
return &ProjectRepo_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// Count provides a mock function for the type ProjectRepo
|
|
func (_mock *ProjectRepo) Count() (int64, error) {
|
|
ret := _mock.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Count")
|
|
}
|
|
|
|
var r0 int64
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func() (int64, error)); ok {
|
|
return returnFunc()
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func() int64); ok {
|
|
r0 = returnFunc()
|
|
} else {
|
|
r0 = ret.Get(0).(int64)
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func() error); ok {
|
|
r1 = returnFunc()
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// ProjectRepo_Count_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Count'
|
|
type ProjectRepo_Count_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Count is a helper method to define mock.On call
|
|
func (_e *ProjectRepo_Expecter) Count() *ProjectRepo_Count_Call {
|
|
return &ProjectRepo_Count_Call{Call: _e.mock.On("Count")}
|
|
}
|
|
|
|
func (_c *ProjectRepo_Count_Call) Run(run func()) *ProjectRepo_Count_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_Count_Call) Return(n int64, err error) *ProjectRepo_Count_Call {
|
|
_c.Call.Return(n, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_Count_Call) RunAndReturn(run func() (int64, error)) *ProjectRepo_Count_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Create provides a mock function for the type ProjectRepo
|
|
func (_mock *ProjectRepo) Create(project *biz.Project, req *request.ProjectCreate) error {
|
|
ret := _mock.Called(project, req)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Create")
|
|
}
|
|
|
|
var r0 error
|
|
if returnFunc, ok := ret.Get(0).(func(*biz.Project, *request.ProjectCreate) error); ok {
|
|
r0 = returnFunc(project, req)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
return r0
|
|
}
|
|
|
|
// ProjectRepo_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
|
|
type ProjectRepo_Create_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Create is a helper method to define mock.On call
|
|
// - project *biz.Project
|
|
// - req *request.ProjectCreate
|
|
func (_e *ProjectRepo_Expecter) Create(project any, req any) *ProjectRepo_Create_Call {
|
|
return &ProjectRepo_Create_Call{Call: _e.mock.On("Create", project, req)}
|
|
}
|
|
|
|
func (_c *ProjectRepo_Create_Call) Run(run func(project *biz.Project, req *request.ProjectCreate)) *ProjectRepo_Create_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 *biz.Project
|
|
if args[0] != nil {
|
|
arg0 = args[0].(*biz.Project)
|
|
}
|
|
var arg1 *request.ProjectCreate
|
|
if args[1] != nil {
|
|
arg1 = args[1].(*request.ProjectCreate)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_Create_Call) Return(err error) *ProjectRepo_Create_Call {
|
|
_c.Call.Return(err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_Create_Call) RunAndReturn(run func(project *biz.Project, req *request.ProjectCreate) error) *ProjectRepo_Create_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Delete provides a mock function for the type ProjectRepo
|
|
func (_mock *ProjectRepo) Delete(project *biz.Project) error {
|
|
ret := _mock.Called(project)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Delete")
|
|
}
|
|
|
|
var r0 error
|
|
if returnFunc, ok := ret.Get(0).(func(*biz.Project) error); ok {
|
|
r0 = returnFunc(project)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
return r0
|
|
}
|
|
|
|
// ProjectRepo_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
|
|
type ProjectRepo_Delete_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Delete is a helper method to define mock.On call
|
|
// - project *biz.Project
|
|
func (_e *ProjectRepo_Expecter) Delete(project any) *ProjectRepo_Delete_Call {
|
|
return &ProjectRepo_Delete_Call{Call: _e.mock.On("Delete", project)}
|
|
}
|
|
|
|
func (_c *ProjectRepo_Delete_Call) Run(run func(project *biz.Project)) *ProjectRepo_Delete_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 *biz.Project
|
|
if args[0] != nil {
|
|
arg0 = args[0].(*biz.Project)
|
|
}
|
|
run(
|
|
arg0,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_Delete_Call) Return(err error) *ProjectRepo_Delete_Call {
|
|
_c.Call.Return(err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_Delete_Call) RunAndReturn(run func(project *biz.Project) error) *ProjectRepo_Delete_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetEntity provides a mock function for the type ProjectRepo
|
|
func (_mock *ProjectRepo) GetEntity(id uint) (*biz.Project, error) {
|
|
ret := _mock.Called(id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetEntity")
|
|
}
|
|
|
|
var r0 *biz.Project
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(uint) (*biz.Project, error)); ok {
|
|
return returnFunc(id)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(uint) *biz.Project); ok {
|
|
r0 = returnFunc(id)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*biz.Project)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(uint) error); ok {
|
|
r1 = returnFunc(id)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// ProjectRepo_GetEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEntity'
|
|
type ProjectRepo_GetEntity_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetEntity is a helper method to define mock.On call
|
|
// - id uint
|
|
func (_e *ProjectRepo_Expecter) GetEntity(id any) *ProjectRepo_GetEntity_Call {
|
|
return &ProjectRepo_GetEntity_Call{Call: _e.mock.On("GetEntity", id)}
|
|
}
|
|
|
|
func (_c *ProjectRepo_GetEntity_Call) Run(run func(id uint)) *ProjectRepo_GetEntity_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 uint
|
|
if args[0] != nil {
|
|
arg0 = args[0].(uint)
|
|
}
|
|
run(
|
|
arg0,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_GetEntity_Call) Return(project *biz.Project, err error) *ProjectRepo_GetEntity_Call {
|
|
_c.Call.Return(project, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_GetEntity_Call) RunAndReturn(run func(id uint) (*biz.Project, error)) *ProjectRepo_GetEntity_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// List provides a mock function for the type ProjectRepo
|
|
func (_mock *ProjectRepo) List(typ types.ProjectType, page uint, limit uint) ([]*biz.Project, int64, error) {
|
|
ret := _mock.Called(typ, page, limit)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for List")
|
|
}
|
|
|
|
var r0 []*biz.Project
|
|
var r1 int64
|
|
var r2 error
|
|
if returnFunc, ok := ret.Get(0).(func(types.ProjectType, uint, uint) ([]*biz.Project, int64, error)); ok {
|
|
return returnFunc(typ, page, limit)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(types.ProjectType, uint, uint) []*biz.Project); ok {
|
|
r0 = returnFunc(typ, page, limit)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*biz.Project)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(types.ProjectType, uint, uint) int64); ok {
|
|
r1 = returnFunc(typ, page, limit)
|
|
} else {
|
|
r1 = ret.Get(1).(int64)
|
|
}
|
|
if returnFunc, ok := ret.Get(2).(func(types.ProjectType, uint, uint) error); ok {
|
|
r2 = returnFunc(typ, page, limit)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// ProjectRepo_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
|
|
type ProjectRepo_List_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// List is a helper method to define mock.On call
|
|
// - typ types.ProjectType
|
|
// - page uint
|
|
// - limit uint
|
|
func (_e *ProjectRepo_Expecter) List(typ any, page any, limit any) *ProjectRepo_List_Call {
|
|
return &ProjectRepo_List_Call{Call: _e.mock.On("List", typ, page, limit)}
|
|
}
|
|
|
|
func (_c *ProjectRepo_List_Call) Run(run func(typ types.ProjectType, page uint, limit uint)) *ProjectRepo_List_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 types.ProjectType
|
|
if args[0] != nil {
|
|
arg0 = args[0].(types.ProjectType)
|
|
}
|
|
var arg1 uint
|
|
if args[1] != nil {
|
|
arg1 = args[1].(uint)
|
|
}
|
|
var arg2 uint
|
|
if args[2] != nil {
|
|
arg2 = args[2].(uint)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
arg2,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_List_Call) Return(projects []*biz.Project, n int64, err error) *ProjectRepo_List_Call {
|
|
_c.Call.Return(projects, n, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_List_Call) RunAndReturn(run func(typ types.ProjectType, page uint, limit uint) ([]*biz.Project, int64, error)) *ProjectRepo_List_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NameExists provides a mock function for the type ProjectRepo
|
|
func (_mock *ProjectRepo) NameExists(name string) (bool, error) {
|
|
ret := _mock.Called(name)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for NameExists")
|
|
}
|
|
|
|
var r0 bool
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(string) (bool, error)); ok {
|
|
return returnFunc(name)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(string) bool); ok {
|
|
r0 = returnFunc(name)
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(string) error); ok {
|
|
r1 = returnFunc(name)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// ProjectRepo_NameExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NameExists'
|
|
type ProjectRepo_NameExists_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// NameExists is a helper method to define mock.On call
|
|
// - name string
|
|
func (_e *ProjectRepo_Expecter) NameExists(name any) *ProjectRepo_NameExists_Call {
|
|
return &ProjectRepo_NameExists_Call{Call: _e.mock.On("NameExists", name)}
|
|
}
|
|
|
|
func (_c *ProjectRepo_NameExists_Call) Run(run func(name string)) *ProjectRepo_NameExists_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 string
|
|
if args[0] != nil {
|
|
arg0 = args[0].(string)
|
|
}
|
|
run(
|
|
arg0,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_NameExists_Call) Return(b bool, err error) *ProjectRepo_NameExists_Call {
|
|
_c.Call.Return(b, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_NameExists_Call) RunAndReturn(run func(name string) (bool, error)) *ProjectRepo_NameExists_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// ParseDetail provides a mock function for the type ProjectRepo
|
|
func (_mock *ProjectRepo) ParseDetail(project *biz.Project) (*types.ProjectDetail, error) {
|
|
ret := _mock.Called(project)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ParseDetail")
|
|
}
|
|
|
|
var r0 *types.ProjectDetail
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(*biz.Project) (*types.ProjectDetail, error)); ok {
|
|
return returnFunc(project)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(*biz.Project) *types.ProjectDetail); ok {
|
|
r0 = returnFunc(project)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*types.ProjectDetail)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(*biz.Project) error); ok {
|
|
r1 = returnFunc(project)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// ProjectRepo_ParseDetail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseDetail'
|
|
type ProjectRepo_ParseDetail_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// ParseDetail is a helper method to define mock.On call
|
|
// - project *biz.Project
|
|
func (_e *ProjectRepo_Expecter) ParseDetail(project any) *ProjectRepo_ParseDetail_Call {
|
|
return &ProjectRepo_ParseDetail_Call{Call: _e.mock.On("ParseDetail", project)}
|
|
}
|
|
|
|
func (_c *ProjectRepo_ParseDetail_Call) Run(run func(project *biz.Project)) *ProjectRepo_ParseDetail_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 *biz.Project
|
|
if args[0] != nil {
|
|
arg0 = args[0].(*biz.Project)
|
|
}
|
|
run(
|
|
arg0,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_ParseDetail_Call) Return(projectDetail *types.ProjectDetail, err error) *ProjectRepo_ParseDetail_Call {
|
|
_c.Call.Return(projectDetail, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_ParseDetail_Call) RunAndReturn(run func(project *biz.Project) (*types.ProjectDetail, error)) *ProjectRepo_ParseDetail_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// RemoveUnitFile provides a mock function for the type ProjectRepo
|
|
func (_mock *ProjectRepo) RemoveUnitFile(name string) error {
|
|
ret := _mock.Called(name)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for RemoveUnitFile")
|
|
}
|
|
|
|
var r0 error
|
|
if returnFunc, ok := ret.Get(0).(func(string) error); ok {
|
|
r0 = returnFunc(name)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
return r0
|
|
}
|
|
|
|
// ProjectRepo_RemoveUnitFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUnitFile'
|
|
type ProjectRepo_RemoveUnitFile_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// RemoveUnitFile is a helper method to define mock.On call
|
|
// - name string
|
|
func (_e *ProjectRepo_Expecter) RemoveUnitFile(name any) *ProjectRepo_RemoveUnitFile_Call {
|
|
return &ProjectRepo_RemoveUnitFile_Call{Call: _e.mock.On("RemoveUnitFile", name)}
|
|
}
|
|
|
|
func (_c *ProjectRepo_RemoveUnitFile_Call) Run(run func(name string)) *ProjectRepo_RemoveUnitFile_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 string
|
|
if args[0] != nil {
|
|
arg0 = args[0].(string)
|
|
}
|
|
run(
|
|
arg0,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_RemoveUnitFile_Call) Return(err error) *ProjectRepo_RemoveUnitFile_Call {
|
|
_c.Call.Return(err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_RemoveUnitFile_Call) RunAndReturn(run func(name string) error) *ProjectRepo_RemoveUnitFile_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// RenameUnitFile provides a mock function for the type ProjectRepo
|
|
func (_mock *ProjectRepo) RenameUnitFile(old string, new string) error {
|
|
ret := _mock.Called(old, new)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for RenameUnitFile")
|
|
}
|
|
|
|
var r0 error
|
|
if returnFunc, ok := ret.Get(0).(func(string, string) error); ok {
|
|
r0 = returnFunc(old, new)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
return r0
|
|
}
|
|
|
|
// ProjectRepo_RenameUnitFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RenameUnitFile'
|
|
type ProjectRepo_RenameUnitFile_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// RenameUnitFile is a helper method to define mock.On call
|
|
// - old string
|
|
// - new string
|
|
func (_e *ProjectRepo_Expecter) RenameUnitFile(old any, new any) *ProjectRepo_RenameUnitFile_Call {
|
|
return &ProjectRepo_RenameUnitFile_Call{Call: _e.mock.On("RenameUnitFile", old, new)}
|
|
}
|
|
|
|
func (_c *ProjectRepo_RenameUnitFile_Call) Run(run func(old string, new string)) *ProjectRepo_RenameUnitFile_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 string
|
|
if args[0] != nil {
|
|
arg0 = args[0].(string)
|
|
}
|
|
var arg1 string
|
|
if args[1] != nil {
|
|
arg1 = args[1].(string)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_RenameUnitFile_Call) Return(err error) *ProjectRepo_RenameUnitFile_Call {
|
|
_c.Call.Return(err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_RenameUnitFile_Call) RunAndReturn(run func(old string, new string) error) *ProjectRepo_RenameUnitFile_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Save provides a mock function for the type ProjectRepo
|
|
func (_mock *ProjectRepo) Save(project *biz.Project) error {
|
|
ret := _mock.Called(project)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Save")
|
|
}
|
|
|
|
var r0 error
|
|
if returnFunc, ok := ret.Get(0).(func(*biz.Project) error); ok {
|
|
r0 = returnFunc(project)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
return r0
|
|
}
|
|
|
|
// ProjectRepo_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save'
|
|
type ProjectRepo_Save_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Save is a helper method to define mock.On call
|
|
// - project *biz.Project
|
|
func (_e *ProjectRepo_Expecter) Save(project any) *ProjectRepo_Save_Call {
|
|
return &ProjectRepo_Save_Call{Call: _e.mock.On("Save", project)}
|
|
}
|
|
|
|
func (_c *ProjectRepo_Save_Call) Run(run func(project *biz.Project)) *ProjectRepo_Save_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 *biz.Project
|
|
if args[0] != nil {
|
|
arg0 = args[0].(*biz.Project)
|
|
}
|
|
run(
|
|
arg0,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_Save_Call) Return(err error) *ProjectRepo_Save_Call {
|
|
_c.Call.Return(err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_Save_Call) RunAndReturn(run func(project *biz.Project) error) *ProjectRepo_Save_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// UpdateUnitFile provides a mock function for the type ProjectRepo
|
|
func (_mock *ProjectRepo) UpdateUnitFile(name string, req *request.ProjectUpdate) error {
|
|
ret := _mock.Called(name, req)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for UpdateUnitFile")
|
|
}
|
|
|
|
var r0 error
|
|
if returnFunc, ok := ret.Get(0).(func(string, *request.ProjectUpdate) error); ok {
|
|
r0 = returnFunc(name, req)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
return r0
|
|
}
|
|
|
|
// ProjectRepo_UpdateUnitFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUnitFile'
|
|
type ProjectRepo_UpdateUnitFile_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// UpdateUnitFile is a helper method to define mock.On call
|
|
// - name string
|
|
// - req *request.ProjectUpdate
|
|
func (_e *ProjectRepo_Expecter) UpdateUnitFile(name any, req any) *ProjectRepo_UpdateUnitFile_Call {
|
|
return &ProjectRepo_UpdateUnitFile_Call{Call: _e.mock.On("UpdateUnitFile", name, req)}
|
|
}
|
|
|
|
func (_c *ProjectRepo_UpdateUnitFile_Call) Run(run func(name string, req *request.ProjectUpdate)) *ProjectRepo_UpdateUnitFile_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 string
|
|
if args[0] != nil {
|
|
arg0 = args[0].(string)
|
|
}
|
|
var arg1 *request.ProjectUpdate
|
|
if args[1] != nil {
|
|
arg1 = args[1].(*request.ProjectUpdate)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_UpdateUnitFile_Call) Return(err error) *ProjectRepo_UpdateUnitFile_Call {
|
|
_c.Call.Return(err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *ProjectRepo_UpdateUnitFile_Call) RunAndReturn(run func(name string, req *request.ProjectUpdate) error) *ProjectRepo_UpdateUnitFile_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|