// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "bnema.dev/ermite/internal/domain" "bnema.dev/ermite/internal/ports" mock "github.com/stretchr/testify/mock" ) // NewIssueModerationService creates a new instance of IssueModerationService. 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 NewIssueModerationService(t interface { mock.TestingT Cleanup(func()) }) *IssueModerationService { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &IssueModerationService{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // IssueModerationService is an autogenerated mock type for the IssueModerationService type type IssueModerationService struct { mock.Mock } type IssueModerationService_Expecter struct { mock *mock.Mock } func (_m *IssueModerationService) EXPECT() *IssueModerationService_Expecter { return &IssueModerationService_Expecter{mock: &_m.Mock} } // Approve provides a mock function for the type IssueModerationService func (_mock *IssueModerationService) Approve(ctx context.Context, p domain.Principal, repo domain.RepoName, id domain.PendingIssueID) (domain.Issue, error) { ret := _mock.Called(ctx, p, repo, id) if len(ret) == 0 { panic("no return value specified for Approve") } var r0 domain.Issue var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.PendingIssueID) (domain.Issue, error)); ok { return returnFunc(ctx, p, repo, id) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.PendingIssueID) domain.Issue); ok { r0 = returnFunc(ctx, p, repo, id) } else { r0 = ret.Get(0).(domain.Issue) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, domain.PendingIssueID) error); ok { r1 = returnFunc(ctx, p, repo, id) } else { r1 = ret.Error(1) } return r0, r1 } // IssueModerationService_Approve_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Approve' type IssueModerationService_Approve_Call struct { *mock.Call } // Approve is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - id domain.PendingIssueID func (_e *IssueModerationService_Expecter) Approve(ctx any, p any, repo any, id any) *IssueModerationService_Approve_Call { return &IssueModerationService_Approve_Call{Call: _e.mock.On("Approve", ctx, p, repo, id)} } func (_c *IssueModerationService_Approve_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, id domain.PendingIssueID)) *IssueModerationService_Approve_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 domain.RepoName if args[2] != nil { arg2 = args[2].(domain.RepoName) } var arg3 domain.PendingIssueID if args[3] != nil { arg3 = args[3].(domain.PendingIssueID) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *IssueModerationService_Approve_Call) Return(issue domain.Issue, err error) *IssueModerationService_Approve_Call { _c.Call.Return(issue, err) return _c } func (_c *IssueModerationService_Approve_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, id domain.PendingIssueID) (domain.Issue, error)) *IssueModerationService_Approve_Call { _c.Call.Return(run) return _c } // ListPending provides a mock function for the type IssueModerationService func (_mock *IssueModerationService) ListPending(ctx context.Context, p domain.Principal, repo domain.RepoName, page ports.ListPendingParams) (ports.PendingIssuePage, error) { ret := _mock.Called(ctx, p, repo, page) if len(ret) == 0 { panic("no return value specified for ListPending") } var r0 ports.PendingIssuePage var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.ListPendingParams) (ports.PendingIssuePage, error)); ok { return returnFunc(ctx, p, repo, page) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.ListPendingParams) ports.PendingIssuePage); ok { r0 = returnFunc(ctx, p, repo, page) } else { r0 = ret.Get(0).(ports.PendingIssuePage) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, ports.ListPendingParams) error); ok { r1 = returnFunc(ctx, p, repo, page) } else { r1 = ret.Error(1) } return r0, r1 } // IssueModerationService_ListPending_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPending' type IssueModerationService_ListPending_Call struct { *mock.Call } // ListPending is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - page ports.ListPendingParams func (_e *IssueModerationService_Expecter) ListPending(ctx any, p any, repo any, page any) *IssueModerationService_ListPending_Call { return &IssueModerationService_ListPending_Call{Call: _e.mock.On("ListPending", ctx, p, repo, page)} } func (_c *IssueModerationService_ListPending_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, page ports.ListPendingParams)) *IssueModerationService_ListPending_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 domain.RepoName if args[2] != nil { arg2 = args[2].(domain.RepoName) } var arg3 ports.ListPendingParams if args[3] != nil { arg3 = args[3].(ports.ListPendingParams) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *IssueModerationService_ListPending_Call) Return(pendingIssuePage ports.PendingIssuePage, err error) *IssueModerationService_ListPending_Call { _c.Call.Return(pendingIssuePage, err) return _c } func (_c *IssueModerationService_ListPending_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, page ports.ListPendingParams) (ports.PendingIssuePage, error)) *IssueModerationService_ListPending_Call { _c.Call.Return(run) return _c } // Reject provides a mock function for the type IssueModerationService func (_mock *IssueModerationService) Reject(ctx context.Context, p domain.Principal, repo domain.RepoName, id domain.PendingIssueID, ban bool) error { ret := _mock.Called(ctx, p, repo, id, ban) if len(ret) == 0 { panic("no return value specified for Reject") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.PendingIssueID, bool) error); ok { r0 = returnFunc(ctx, p, repo, id, ban) } else { r0 = ret.Error(0) } return r0 } // IssueModerationService_Reject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reject' type IssueModerationService_Reject_Call struct { *mock.Call } // Reject is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - id domain.PendingIssueID // - ban bool func (_e *IssueModerationService_Expecter) Reject(ctx any, p any, repo any, id any, ban any) *IssueModerationService_Reject_Call { return &IssueModerationService_Reject_Call{Call: _e.mock.On("Reject", ctx, p, repo, id, ban)} } func (_c *IssueModerationService_Reject_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, id domain.PendingIssueID, ban bool)) *IssueModerationService_Reject_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 domain.RepoName if args[2] != nil { arg2 = args[2].(domain.RepoName) } var arg3 domain.PendingIssueID if args[3] != nil { arg3 = args[3].(domain.PendingIssueID) } var arg4 bool if args[4] != nil { arg4 = args[4].(bool) } run( arg0, arg1, arg2, arg3, arg4, ) }) return _c } func (_c *IssueModerationService_Reject_Call) Return(err error) *IssueModerationService_Reject_Call { _c.Call.Return(err) return _c } func (_c *IssueModerationService_Reject_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, id domain.PendingIssueID, ban bool) error) *IssueModerationService_Reject_Call { _c.Call.Return(run) return _c }