2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 11:27:17 +08:00

chore: update mocks

This commit is contained in:
devhaozi
2026-01-12 15:31:53 +00:00
committed by github-actions[bot]
parent f2e41a3364
commit cd85032ecb
15 changed files with 613 additions and 441 deletions

View File

@@ -3,9 +3,12 @@
package biz
import (
context "context"
request "github.com/acepanel/panel/internal/http/request"
types "github.com/acepanel/panel/pkg/types"
mock "github.com/stretchr/testify/mock"
types "github.com/acepanel/panel/pkg/types"
)
// ProjectRepo is an autogenerated mock type for the ProjectRepo type
@@ -21,9 +24,9 @@ func (_m *ProjectRepo) EXPECT() *ProjectRepo_Expecter {
return &ProjectRepo_Expecter{mock: &_m.Mock}
}
// Create provides a mock function with given fields: req
func (_m *ProjectRepo) Create(req *request.ProjectCreate) (*types.ProjectDetail, error) {
ret := _m.Called(req)
// 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")
@@ -31,19 +34,19 @@ func (_m *ProjectRepo) Create(req *request.ProjectCreate) (*types.ProjectDetail,
var r0 *types.ProjectDetail
var r1 error
if rf, ok := ret.Get(0).(func(*request.ProjectCreate) (*types.ProjectDetail, error)); ok {
return rf(req)
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(*request.ProjectCreate) *types.ProjectDetail); ok {
r0 = rf(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(*request.ProjectCreate) error); ok {
r1 = rf(req)
if rf, ok := ret.Get(1).(func(context.Context, *request.ProjectCreate) error); ok {
r1 = rf(ctx, req)
} else {
r1 = ret.Error(1)
}
@@ -57,14 +60,15 @@ type ProjectRepo_Create_Call struct {
}
// Create is a helper method to define mock.On call
// - ctx context.Context
// - req *request.ProjectCreate
func (_e *ProjectRepo_Expecter) Create(req interface{}) *ProjectRepo_Create_Call {
return &ProjectRepo_Create_Call{Call: _e.mock.On("Create", req)}
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(req *request.ProjectCreate)) *ProjectRepo_Create_Call {
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].(*request.ProjectCreate))
run(args[0].(context.Context), args[1].(*request.ProjectCreate))
})
return _c
}
@@ -74,22 +78,22 @@ func (_c *ProjectRepo_Create_Call) Return(_a0 *types.ProjectDetail, _a1 error) *
return _c
}
func (_c *ProjectRepo_Create_Call) RunAndReturn(run func(*request.ProjectCreate) (*types.ProjectDetail, error)) *ProjectRepo_Create_Call {
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: id
func (_m *ProjectRepo) Delete(id uint) error {
ret := _m.Called(id)
// 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(uint) error); ok {
r0 = rf(id)
if rf, ok := ret.Get(0).(func(context.Context, uint) error); ok {
r0 = rf(ctx, id)
} else {
r0 = ret.Error(0)
}
@@ -103,14 +107,15 @@ type ProjectRepo_Delete_Call struct {
}
// Delete is a helper method to define mock.On call
// - ctx context.Context
// - id uint
func (_e *ProjectRepo_Expecter) Delete(id interface{}) *ProjectRepo_Delete_Call {
return &ProjectRepo_Delete_Call{Call: _e.mock.On("Delete", id)}
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(id uint)) *ProjectRepo_Delete_Call {
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].(uint))
run(args[0].(context.Context), args[1].(uint))
})
return _c
}
@@ -120,7 +125,7 @@ func (_c *ProjectRepo_Delete_Call) Return(_a0 error) *ProjectRepo_Delete_Call {
return _c
}
func (_c *ProjectRepo_Delete_Call) RunAndReturn(run func(uint) error) *ProjectRepo_Delete_Call {
func (_c *ProjectRepo_Delete_Call) RunAndReturn(run func(context.Context, uint) error) *ProjectRepo_Delete_Call {
_c.Call.Return(run)
return _c
}
@@ -250,17 +255,17 @@ func (_c *ProjectRepo_List_Call) RunAndReturn(run func(types.ProjectType, uint,
return _c
}
// Update provides a mock function with given fields: req
func (_m *ProjectRepo) Update(req *request.ProjectUpdate) error {
ret := _m.Called(req)
// 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(*request.ProjectUpdate) error); ok {
r0 = rf(req)
if rf, ok := ret.Get(0).(func(context.Context, *request.ProjectUpdate) error); ok {
r0 = rf(ctx, req)
} else {
r0 = ret.Error(0)
}
@@ -274,14 +279,15 @@ type ProjectRepo_Update_Call struct {
}
// Update is a helper method to define mock.On call
// - ctx context.Context
// - req *request.ProjectUpdate
func (_e *ProjectRepo_Expecter) Update(req interface{}) *ProjectRepo_Update_Call {
return &ProjectRepo_Update_Call{Call: _e.mock.On("Update", req)}
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(req *request.ProjectUpdate)) *ProjectRepo_Update_Call {
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].(*request.ProjectUpdate))
run(args[0].(context.Context), args[1].(*request.ProjectUpdate))
})
return _c
}
@@ -291,7 +297,7 @@ func (_c *ProjectRepo_Update_Call) Return(_a0 error) *ProjectRepo_Update_Call {
return _c
}
func (_c *ProjectRepo_Update_Call) RunAndReturn(run func(*request.ProjectUpdate) error) *ProjectRepo_Update_Call {
func (_c *ProjectRepo_Update_Call) RunAndReturn(run func(context.Context, *request.ProjectUpdate) error) *ProjectRepo_Update_Call {
_c.Call.Return(run)
return _c
}