// 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" ) // NewIssueStore creates a new instance of IssueStore. 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 NewIssueStore(t interface { mock.TestingT Cleanup(func()) }) *IssueStore { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &IssueStore{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // IssueStore is an autogenerated mock type for the IssueStore type type IssueStore struct { mock.Mock } type IssueStore_Expecter struct { mock *mock.Mock } func (_m *IssueStore) EXPECT() *IssueStore_Expecter { return &IssueStore_Expecter{mock: &_m.Mock} } // Create provides a mock function for the type IssueStore func (_mock *IssueStore) Create(ctx context.Context, issue domain.Issue) (domain.Issue, error) { ret := _mock.Called(ctx, issue) 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.Issue) (domain.Issue, error)); ok { return returnFunc(ctx, issue) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Issue) domain.Issue); ok { r0 = returnFunc(ctx, issue) } else { r0 = ret.Get(0).(domain.Issue) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Issue) error); ok { r1 = returnFunc(ctx, issue) } else { r1 = ret.Error(1) } return r0, r1 } // IssueStore_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' type IssueStore_Create_Call struct { *mock.Call } // Create is a helper method to define mock.On call // - ctx context.Context // - issue domain.Issue func (_e *IssueStore_Expecter) Create(ctx any, issue any) *IssueStore_Create_Call { return &IssueStore_Create_Call{Call: _e.mock.On("Create", ctx, issue)} } func (_c *IssueStore_Create_Call) Run(run func(ctx context.Context, issue domain.Issue)) *IssueStore_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.Issue if args[1] != nil { arg1 = args[1].(domain.Issue) } run( arg0, arg1, ) }) return _c } func (_c *IssueStore_Create_Call) Return(issue1 domain.Issue, err error) *IssueStore_Create_Call { _c.Call.Return(issue1, err) return _c } func (_c *IssueStore_Create_Call) RunAndReturn(run func(ctx context.Context, issue domain.Issue) (domain.Issue, error)) *IssueStore_Create_Call { _c.Call.Return(run) return _c } // Get provides a mock function for the type IssueStore func (_mock *IssueStore) Get(ctx context.Context, repo domain.RepoName, number int64) (domain.Issue, error) { ret := _mock.Called(ctx, repo, number) if len(ret) == 0 { panic("no return value specified for Get") } var r0 domain.Issue var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64) (domain.Issue, error)); ok { return returnFunc(ctx, repo, number) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64) domain.Issue); ok { r0 = returnFunc(ctx, repo, number) } else { r0 = ret.Get(0).(domain.Issue) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, int64) error); ok { r1 = returnFunc(ctx, repo, number) } else { r1 = ret.Error(1) } return r0, r1 } // IssueStore_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type IssueStore_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - number int64 func (_e *IssueStore_Expecter) Get(ctx any, repo any, number any) *IssueStore_Get_Call { return &IssueStore_Get_Call{Call: _e.mock.On("Get", ctx, repo, number)} } func (_c *IssueStore_Get_Call) Run(run func(ctx context.Context, repo domain.RepoName, number int64)) *IssueStore_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.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 int64 if args[2] != nil { arg2 = args[2].(int64) } run( arg0, arg1, arg2, ) }) return _c } func (_c *IssueStore_Get_Call) Return(issue domain.Issue, err error) *IssueStore_Get_Call { _c.Call.Return(issue, err) return _c } func (_c *IssueStore_Get_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, number int64) (domain.Issue, error)) *IssueStore_Get_Call { _c.Call.Return(run) return _c } // List provides a mock function for the type IssueStore func (_mock *IssueStore) List(ctx context.Context, repo domain.RepoName, params ports.ListIssuesParams) (ports.IssuePage, error) { ret := _mock.Called(ctx, repo, 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.RepoName, ports.ListIssuesParams) (ports.IssuePage, error)); ok { return returnFunc(ctx, repo, params) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, ports.ListIssuesParams) ports.IssuePage); ok { r0 = returnFunc(ctx, repo, params) } else { r0 = ret.Get(0).(ports.IssuePage) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, ports.ListIssuesParams) error); ok { r1 = returnFunc(ctx, repo, params) } else { r1 = ret.Error(1) } return r0, r1 } // IssueStore_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' type IssueStore_List_Call struct { *mock.Call } // List is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - params ports.ListIssuesParams func (_e *IssueStore_Expecter) List(ctx any, repo any, params any) *IssueStore_List_Call { return &IssueStore_List_Call{Call: _e.mock.On("List", ctx, repo, params)} } func (_c *IssueStore_List_Call) Run(run func(ctx context.Context, repo domain.RepoName, params ports.ListIssuesParams)) *IssueStore_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.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 ports.ListIssuesParams if args[2] != nil { arg2 = args[2].(ports.ListIssuesParams) } run( arg0, arg1, arg2, ) }) return _c } func (_c *IssueStore_List_Call) Return(issuePage ports.IssuePage, err error) *IssueStore_List_Call { _c.Call.Return(issuePage, err) return _c } func (_c *IssueStore_List_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, params ports.ListIssuesParams) (ports.IssuePage, error)) *IssueStore_List_Call { _c.Call.Return(run) return _c } // ListComments provides a mock function for the type IssueStore func (_mock *IssueStore) ListComments(ctx context.Context, repo domain.RepoName, number int64) ([]domain.IssueComment, error) { ret := _mock.Called(ctx, repo, number) if len(ret) == 0 { panic("no return value specified for ListComments") } var r0 []domain.IssueComment var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64) ([]domain.IssueComment, error)); ok { return returnFunc(ctx, repo, number) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64) []domain.IssueComment); ok { r0 = returnFunc(ctx, repo, number) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]domain.IssueComment) } } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, int64) error); ok { r1 = returnFunc(ctx, repo, number) } else { r1 = ret.Error(1) } return r0, r1 } // IssueStore_ListComments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListComments' type IssueStore_ListComments_Call struct { *mock.Call } // ListComments is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - number int64 func (_e *IssueStore_Expecter) ListComments(ctx any, repo any, number any) *IssueStore_ListComments_Call { return &IssueStore_ListComments_Call{Call: _e.mock.On("ListComments", ctx, repo, number)} } func (_c *IssueStore_ListComments_Call) Run(run func(ctx context.Context, repo domain.RepoName, number int64)) *IssueStore_ListComments_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 int64 if args[2] != nil { arg2 = args[2].(int64) } run( arg0, arg1, arg2, ) }) return _c } func (_c *IssueStore_ListComments_Call) Return(issueComments []domain.IssueComment, err error) *IssueStore_ListComments_Call { _c.Call.Return(issueComments, err) return _c } func (_c *IssueStore_ListComments_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, number int64) ([]domain.IssueComment, error)) *IssueStore_ListComments_Call { _c.Call.Return(run) return _c } // ListOpenAll provides a mock function for the type IssueStore func (_mock *IssueStore) ListOpenAll(ctx context.Context) ([]domain.Issue, error) { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for ListOpenAll") } var r0 []domain.Issue var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context) ([]domain.Issue, error)); ok { return returnFunc(ctx) } if returnFunc, ok := ret.Get(0).(func(context.Context) []domain.Issue); ok { r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]domain.Issue) } } if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } return r0, r1 } // IssueStore_ListOpenAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListOpenAll' type IssueStore_ListOpenAll_Call struct { *mock.Call } // ListOpenAll is a helper method to define mock.On call // - ctx context.Context func (_e *IssueStore_Expecter) ListOpenAll(ctx any) *IssueStore_ListOpenAll_Call { return &IssueStore_ListOpenAll_Call{Call: _e.mock.On("ListOpenAll", ctx)} } func (_c *IssueStore_ListOpenAll_Call) Run(run func(ctx context.Context)) *IssueStore_ListOpenAll_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } run( arg0, ) }) return _c } func (_c *IssueStore_ListOpenAll_Call) Return(issues []domain.Issue, err error) *IssueStore_ListOpenAll_Call { _c.Call.Return(issues, err) return _c } func (_c *IssueStore_ListOpenAll_Call) RunAndReturn(run func(ctx context.Context) ([]domain.Issue, error)) *IssueStore_ListOpenAll_Call { _c.Call.Return(run) return _c } // SaveComment provides a mock function for the type IssueStore func (_mock *IssueStore) SaveComment(ctx context.Context, issue domain.Issue, c domain.IssueComment) error { ret := _mock.Called(ctx, issue, c) if len(ret) == 0 { panic("no return value specified for SaveComment") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Issue, domain.IssueComment) error); ok { r0 = returnFunc(ctx, issue, c) } else { r0 = ret.Error(0) } return r0 } // IssueStore_SaveComment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveComment' type IssueStore_SaveComment_Call struct { *mock.Call } // SaveComment is a helper method to define mock.On call // - ctx context.Context // - issue domain.Issue // - c domain.IssueComment func (_e *IssueStore_Expecter) SaveComment(ctx any, issue any, c any) *IssueStore_SaveComment_Call { return &IssueStore_SaveComment_Call{Call: _e.mock.On("SaveComment", ctx, issue, c)} } func (_c *IssueStore_SaveComment_Call) Run(run func(ctx context.Context, issue domain.Issue, c domain.IssueComment)) *IssueStore_SaveComment_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Issue if args[1] != nil { arg1 = args[1].(domain.Issue) } var arg2 domain.IssueComment if args[2] != nil { arg2 = args[2].(domain.IssueComment) } run( arg0, arg1, arg2, ) }) return _c } func (_c *IssueStore_SaveComment_Call) Return(err error) *IssueStore_SaveComment_Call { _c.Call.Return(err) return _c } func (_c *IssueStore_SaveComment_Call) RunAndReturn(run func(ctx context.Context, issue domain.Issue, c domain.IssueComment) error) *IssueStore_SaveComment_Call { _c.Call.Return(run) return _c } // Update provides a mock function for the type IssueStore func (_mock *IssueStore) Update(ctx context.Context, issue domain.Issue) error { ret := _mock.Called(ctx, issue) if len(ret) == 0 { panic("no return value specified for Update") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Issue) error); ok { r0 = returnFunc(ctx, issue) } else { r0 = ret.Error(0) } return r0 } // IssueStore_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' type IssueStore_Update_Call struct { *mock.Call } // Update is a helper method to define mock.On call // - ctx context.Context // - issue domain.Issue func (_e *IssueStore_Expecter) Update(ctx any, issue any) *IssueStore_Update_Call { return &IssueStore_Update_Call{Call: _e.mock.On("Update", ctx, issue)} } func (_c *IssueStore_Update_Call) Run(run func(ctx context.Context, issue domain.Issue)) *IssueStore_Update_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Issue if args[1] != nil { arg1 = args[1].(domain.Issue) } run( arg0, arg1, ) }) return _c } func (_c *IssueStore_Update_Call) Return(err error) *IssueStore_Update_Call { _c.Call.Return(err) return _c } func (_c *IssueStore_Update_Call) RunAndReturn(run func(ctx context.Context, issue domain.Issue) error) *IssueStore_Update_Call { _c.Call.Return(run) return _c }