// 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" ) // NewIssueService creates a new instance of IssueService. 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 NewIssueService(t interface { mock.TestingT Cleanup(func()) }) *IssueService { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &IssueService{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // IssueService is an autogenerated mock type for the IssueService type type IssueService struct { mock.Mock } type IssueService_Expecter struct { mock *mock.Mock } func (_m *IssueService) EXPECT() *IssueService_Expecter { return &IssueService_Expecter{mock: &_m.Mock} } // AddComment provides a mock function for the type IssueService func (_mock *IssueService) AddComment(ctx context.Context, p domain.Principal, name domain.RepoName, number int64, text string) (domain.IssueComment, error) { ret := _mock.Called(ctx, p, name, number, text) if len(ret) == 0 { panic("no return value specified for AddComment") } var r0 domain.IssueComment var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64, string) (domain.IssueComment, error)); ok { return returnFunc(ctx, p, name, number, text) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64, string) domain.IssueComment); ok { r0 = returnFunc(ctx, p, name, number, text) } else { r0 = ret.Get(0).(domain.IssueComment) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, int64, string) error); ok { r1 = returnFunc(ctx, p, name, number, text) } else { r1 = ret.Error(1) } return r0, r1 } // IssueService_AddComment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddComment' type IssueService_AddComment_Call struct { *mock.Call } // AddComment is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - name domain.RepoName // - number int64 // - text string func (_e *IssueService_Expecter) AddComment(ctx any, p any, name any, number any, text any) *IssueService_AddComment_Call { return &IssueService_AddComment_Call{Call: _e.mock.On("AddComment", ctx, p, name, number, text)} } func (_c *IssueService_AddComment_Call) Run(run func(ctx context.Context, p domain.Principal, name domain.RepoName, number int64, text string)) *IssueService_AddComment_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 int64 if args[3] != nil { arg3 = args[3].(int64) } var arg4 string if args[4] != nil { arg4 = args[4].(string) } run( arg0, arg1, arg2, arg3, arg4, ) }) return _c } func (_c *IssueService_AddComment_Call) Return(issueComment domain.IssueComment, err error) *IssueService_AddComment_Call { _c.Call.Return(issueComment, err) return _c } func (_c *IssueService_AddComment_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, name domain.RepoName, number int64, text string) (domain.IssueComment, error)) *IssueService_AddComment_Call { _c.Call.Return(run) return _c } // Close provides a mock function for the type IssueService func (_mock *IssueService) Close(ctx context.Context, p domain.Principal, name domain.RepoName, number int64) (domain.Issue, error) { ret := _mock.Called(ctx, p, name, number) if len(ret) == 0 { panic("no return value specified for Close") } var r0 domain.Issue var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64) (domain.Issue, error)); ok { return returnFunc(ctx, p, name, number) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64) domain.Issue); ok { r0 = returnFunc(ctx, p, name, number) } else { r0 = ret.Get(0).(domain.Issue) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, int64) error); ok { r1 = returnFunc(ctx, p, name, number) } else { r1 = ret.Error(1) } return r0, r1 } // IssueService_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' type IssueService_Close_Call struct { *mock.Call } // Close is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - name domain.RepoName // - number int64 func (_e *IssueService_Expecter) Close(ctx any, p any, name any, number any) *IssueService_Close_Call { return &IssueService_Close_Call{Call: _e.mock.On("Close", ctx, p, name, number)} } func (_c *IssueService_Close_Call) Run(run func(ctx context.Context, p domain.Principal, name domain.RepoName, number int64)) *IssueService_Close_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 int64 if args[3] != nil { arg3 = args[3].(int64) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *IssueService_Close_Call) Return(issue domain.Issue, err error) *IssueService_Close_Call { _c.Call.Return(issue, err) return _c } func (_c *IssueService_Close_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, name domain.RepoName, number int64) (domain.Issue, error)) *IssueService_Close_Call { _c.Call.Return(run) return _c } // Create provides a mock function for the type IssueService func (_mock *IssueService) Create(ctx context.Context, p domain.Principal, name domain.RepoName, params ports.CreateIssueParams) (domain.Issue, error) { ret := _mock.Called(ctx, p, name, params) if len(ret) == 0 { panic("no return value specified for Create") } var r0 domain.Issue var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.CreateIssueParams) (domain.Issue, error)); ok { return returnFunc(ctx, p, name, params) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.CreateIssueParams) domain.Issue); ok { r0 = returnFunc(ctx, p, name, params) } else { r0 = ret.Get(0).(domain.Issue) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, ports.CreateIssueParams) error); ok { r1 = returnFunc(ctx, p, name, params) } else { r1 = ret.Error(1) } return r0, r1 } // IssueService_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' type IssueService_Create_Call struct { *mock.Call } // Create is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - name domain.RepoName // - params ports.CreateIssueParams func (_e *IssueService_Expecter) Create(ctx any, p any, name any, params any) *IssueService_Create_Call { return &IssueService_Create_Call{Call: _e.mock.On("Create", ctx, p, name, params)} } func (_c *IssueService_Create_Call) Run(run func(ctx context.Context, p domain.Principal, name domain.RepoName, params ports.CreateIssueParams)) *IssueService_Create_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.CreateIssueParams if args[3] != nil { arg3 = args[3].(ports.CreateIssueParams) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *IssueService_Create_Call) Return(issue domain.Issue, err error) *IssueService_Create_Call { _c.Call.Return(issue, err) return _c } func (_c *IssueService_Create_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, name domain.RepoName, params ports.CreateIssueParams) (domain.Issue, error)) *IssueService_Create_Call { _c.Call.Return(run) return _c } // Get provides a mock function for the type IssueService func (_mock *IssueService) Get(ctx context.Context, p domain.Principal, name domain.RepoName, number int64) (ports.IssueDetail, error) { ret := _mock.Called(ctx, p, name, number) if len(ret) == 0 { panic("no return value specified for Get") } var r0 ports.IssueDetail var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64) (ports.IssueDetail, error)); ok { return returnFunc(ctx, p, name, number) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64) ports.IssueDetail); ok { r0 = returnFunc(ctx, p, name, number) } else { r0 = ret.Get(0).(ports.IssueDetail) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, int64) error); ok { r1 = returnFunc(ctx, p, name, number) } else { r1 = ret.Error(1) } return r0, r1 } // IssueService_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type IssueService_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - name domain.RepoName // - number int64 func (_e *IssueService_Expecter) Get(ctx any, p any, name any, number any) *IssueService_Get_Call { return &IssueService_Get_Call{Call: _e.mock.On("Get", ctx, p, name, number)} } func (_c *IssueService_Get_Call) Run(run func(ctx context.Context, p domain.Principal, name domain.RepoName, number int64)) *IssueService_Get_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 int64 if args[3] != nil { arg3 = args[3].(int64) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *IssueService_Get_Call) Return(issueDetail ports.IssueDetail, err error) *IssueService_Get_Call { _c.Call.Return(issueDetail, err) return _c } func (_c *IssueService_Get_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, name domain.RepoName, number int64) (ports.IssueDetail, error)) *IssueService_Get_Call { _c.Call.Return(run) return _c } // List provides a mock function for the type IssueService func (_mock *IssueService) List(ctx context.Context, p domain.Principal, name domain.RepoName, params ports.ListIssuesParams) (ports.IssuePage, error) { ret := _mock.Called(ctx, p, name, params) if len(ret) == 0 { panic("no return value specified for List") } var r0 ports.IssuePage var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.ListIssuesParams) (ports.IssuePage, error)); ok { return returnFunc(ctx, p, name, params) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, ports.ListIssuesParams) ports.IssuePage); ok { r0 = returnFunc(ctx, p, name, params) } else { r0 = ret.Get(0).(ports.IssuePage) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, ports.ListIssuesParams) error); ok { r1 = returnFunc(ctx, p, name, params) } else { r1 = ret.Error(1) } return r0, r1 } // IssueService_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' type IssueService_List_Call struct { *mock.Call } // List is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - name domain.RepoName // - params ports.ListIssuesParams func (_e *IssueService_Expecter) List(ctx any, p any, name any, params any) *IssueService_List_Call { return &IssueService_List_Call{Call: _e.mock.On("List", ctx, p, name, params)} } func (_c *IssueService_List_Call) Run(run func(ctx context.Context, p domain.Principal, name domain.RepoName, params ports.ListIssuesParams)) *IssueService_List_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.ListIssuesParams if args[3] != nil { arg3 = args[3].(ports.ListIssuesParams) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *IssueService_List_Call) Return(issuePage ports.IssuePage, err error) *IssueService_List_Call { _c.Call.Return(issuePage, err) return _c } func (_c *IssueService_List_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, name domain.RepoName, params ports.ListIssuesParams) (ports.IssuePage, error)) *IssueService_List_Call { _c.Call.Return(run) return _c } // Reopen provides a mock function for the type IssueService func (_mock *IssueService) Reopen(ctx context.Context, p domain.Principal, name domain.RepoName, number int64) (domain.Issue, error) { ret := _mock.Called(ctx, p, name, number) if len(ret) == 0 { panic("no return value specified for Reopen") } var r0 domain.Issue var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64) (domain.Issue, error)); ok { return returnFunc(ctx, p, name, number) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64) domain.Issue); ok { r0 = returnFunc(ctx, p, name, number) } else { r0 = ret.Get(0).(domain.Issue) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, int64) error); ok { r1 = returnFunc(ctx, p, name, number) } else { r1 = ret.Error(1) } return r0, r1 } // IssueService_Reopen_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reopen' type IssueService_Reopen_Call struct { *mock.Call } // Reopen is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - name domain.RepoName // - number int64 func (_e *IssueService_Expecter) Reopen(ctx any, p any, name any, number any) *IssueService_Reopen_Call { return &IssueService_Reopen_Call{Call: _e.mock.On("Reopen", ctx, p, name, number)} } func (_c *IssueService_Reopen_Call) Run(run func(ctx context.Context, p domain.Principal, name domain.RepoName, number int64)) *IssueService_Reopen_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 int64 if args[3] != nil { arg3 = args[3].(int64) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *IssueService_Reopen_Call) Return(issue domain.Issue, err error) *IssueService_Reopen_Call { _c.Call.Return(issue, err) return _c } func (_c *IssueService_Reopen_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, name domain.RepoName, number int64) (domain.Issue, error)) *IssueService_Reopen_Call { _c.Call.Return(run) return _c }