2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:47:20 +08:00
Files
panel/mocks/biz/ProjectRepo.go
2026-01-23 17:38:07 +00:00

373 lines
10 KiB
Go

// Code generated by mockery. DO NOT EDIT.
package biz
import (
context "context"
request "github.com/acepanel/panel/internal/http/request"
mock "github.com/stretchr/testify/mock"
types "github.com/acepanel/panel/pkg/types"
)
// 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 with no fields
func (_m *ProjectRepo) Count() (int64, error) {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Count")
}
var r0 int64
var r1 error
if rf, ok := ret.Get(0).(func() (int64, error)); ok {
return rf()
}
if rf, ok := ret.Get(0).(func() int64); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(int64)
}
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
} 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(_a0 int64, _a1 error) *ProjectRepo_Count_Call {
_c.Call.Return(_a0, _a1)
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 with given fields: ctx, req
func (_m *ProjectRepo) Create(ctx context.Context, req *request.ProjectCreate) (*types.ProjectDetail, error) {
ret := _m.Called(ctx, req)
if len(ret) == 0 {
panic("no return value specified for Create")
}
var r0 *types.ProjectDetail
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *request.ProjectCreate) (*types.ProjectDetail, error)); ok {
return rf(ctx, req)
}
if rf, ok := ret.Get(0).(func(context.Context, *request.ProjectCreate) *types.ProjectDetail); ok {
r0 = rf(ctx, req)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ProjectDetail)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *request.ProjectCreate) error); ok {
r1 = rf(ctx, req)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// 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
// - ctx context.Context
// - req *request.ProjectCreate
func (_e *ProjectRepo_Expecter) Create(ctx interface{}, req interface{}) *ProjectRepo_Create_Call {
return &ProjectRepo_Create_Call{Call: _e.mock.On("Create", ctx, req)}
}
func (_c *ProjectRepo_Create_Call) Run(run func(ctx context.Context, req *request.ProjectCreate)) *ProjectRepo_Create_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*request.ProjectCreate))
})
return _c
}
func (_c *ProjectRepo_Create_Call) Return(_a0 *types.ProjectDetail, _a1 error) *ProjectRepo_Create_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *ProjectRepo_Create_Call) RunAndReturn(run func(context.Context, *request.ProjectCreate) (*types.ProjectDetail, error)) *ProjectRepo_Create_Call {
_c.Call.Return(run)
return _c
}
// Delete provides a mock function with given fields: ctx, id
func (_m *ProjectRepo) 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
}
// 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
// - ctx context.Context
// - id uint
func (_e *ProjectRepo_Expecter) Delete(ctx interface{}, id interface{}) *ProjectRepo_Delete_Call {
return &ProjectRepo_Delete_Call{Call: _e.mock.On("Delete", ctx, id)}
}
func (_c *ProjectRepo_Delete_Call) Run(run func(ctx context.Context, id uint)) *ProjectRepo_Delete_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint))
})
return _c
}
func (_c *ProjectRepo_Delete_Call) Return(_a0 error) *ProjectRepo_Delete_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *ProjectRepo_Delete_Call) RunAndReturn(run func(context.Context, uint) error) *ProjectRepo_Delete_Call {
_c.Call.Return(run)
return _c
}
// Get provides a mock function with given fields: id
func (_m *ProjectRepo) Get(id uint) (*types.ProjectDetail, error) {
ret := _m.Called(id)
if len(ret) == 0 {
panic("no return value specified for Get")
}
var r0 *types.ProjectDetail
var r1 error
if rf, ok := ret.Get(0).(func(uint) (*types.ProjectDetail, error)); ok {
return rf(id)
}
if rf, ok := ret.Get(0).(func(uint) *types.ProjectDetail); ok {
r0 = rf(id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ProjectDetail)
}
}
if rf, ok := ret.Get(1).(func(uint) error); ok {
r1 = rf(id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ProjectRepo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
type ProjectRepo_Get_Call struct {
*mock.Call
}
// Get is a helper method to define mock.On call
// - id uint
func (_e *ProjectRepo_Expecter) Get(id interface{}) *ProjectRepo_Get_Call {
return &ProjectRepo_Get_Call{Call: _e.mock.On("Get", id)}
}
func (_c *ProjectRepo_Get_Call) Run(run func(id uint)) *ProjectRepo_Get_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(uint))
})
return _c
}
func (_c *ProjectRepo_Get_Call) Return(_a0 *types.ProjectDetail, _a1 error) *ProjectRepo_Get_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *ProjectRepo_Get_Call) RunAndReturn(run func(uint) (*types.ProjectDetail, error)) *ProjectRepo_Get_Call {
_c.Call.Return(run)
return _c
}
// List provides a mock function with given fields: typ, page, limit
func (_m *ProjectRepo) List(typ types.ProjectType, page uint, limit uint) ([]*types.ProjectDetail, int64, error) {
ret := _m.Called(typ, page, limit)
if len(ret) == 0 {
panic("no return value specified for List")
}
var r0 []*types.ProjectDetail
var r1 int64
var r2 error
if rf, ok := ret.Get(0).(func(types.ProjectType, uint, uint) ([]*types.ProjectDetail, int64, error)); ok {
return rf(typ, page, limit)
}
if rf, ok := ret.Get(0).(func(types.ProjectType, uint, uint) []*types.ProjectDetail); ok {
r0 = rf(typ, page, limit)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*types.ProjectDetail)
}
}
if rf, ok := ret.Get(1).(func(types.ProjectType, uint, uint) int64); ok {
r1 = rf(typ, page, limit)
} else {
r1 = ret.Get(1).(int64)
}
if rf, ok := ret.Get(2).(func(types.ProjectType, uint, uint) error); ok {
r2 = rf(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 interface{}, page interface{}, limit interface{}) *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) {
run(args[0].(types.ProjectType), args[1].(uint), args[2].(uint))
})
return _c
}
func (_c *ProjectRepo_List_Call) Return(_a0 []*types.ProjectDetail, _a1 int64, _a2 error) *ProjectRepo_List_Call {
_c.Call.Return(_a0, _a1, _a2)
return _c
}
func (_c *ProjectRepo_List_Call) RunAndReturn(run func(types.ProjectType, uint, uint) ([]*types.ProjectDetail, int64, error)) *ProjectRepo_List_Call {
_c.Call.Return(run)
return _c
}
// Update provides a mock function with given fields: ctx, req
func (_m *ProjectRepo) Update(ctx context.Context, req *request.ProjectUpdate) 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.ProjectUpdate) error); ok {
r0 = rf(ctx, req)
} else {
r0 = ret.Error(0)
}
return r0
}
// ProjectRepo_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update'
type ProjectRepo_Update_Call struct {
*mock.Call
}
// Update is a helper method to define mock.On call
// - ctx context.Context
// - req *request.ProjectUpdate
func (_e *ProjectRepo_Expecter) Update(ctx interface{}, req interface{}) *ProjectRepo_Update_Call {
return &ProjectRepo_Update_Call{Call: _e.mock.On("Update", ctx, req)}
}
func (_c *ProjectRepo_Update_Call) Run(run func(ctx context.Context, req *request.ProjectUpdate)) *ProjectRepo_Update_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*request.ProjectUpdate))
})
return _c
}
func (_c *ProjectRepo_Update_Call) Return(_a0 error) *ProjectRepo_Update_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *ProjectRepo_Update_Call) RunAndReturn(run func(context.Context, *request.ProjectUpdate) error) *ProjectRepo_Update_Call {
_c.Call.Return(run)
return _c
}
// 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
}