// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "time" "bnema.dev/ermite/internal/domain" "bnema.dev/ermite/internal/ports" mock "github.com/stretchr/testify/mock" ) // NewPendingIssueStore creates a new instance of PendingIssueStore. 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 NewPendingIssueStore(t interface { mock.TestingT Cleanup(func()) }) *PendingIssueStore { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &PendingIssueStore{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // PendingIssueStore is an autogenerated mock type for the PendingIssueStore type type PendingIssueStore struct { mock.Mock } type PendingIssueStore_Expecter struct { mock *mock.Mock } func (_m *PendingIssueStore) EXPECT() *PendingIssueStore_Expecter { return &PendingIssueStore_Expecter{mock: &_m.Mock} } // Approve provides a mock function for the type PendingIssueStore func (_mock *PendingIssueStore) Approve(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID, now time.Time) (domain.Issue, error) { ret := _mock.Called(ctx, repo, id, now) 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.RepoName, domain.PendingIssueID, time.Time) (domain.Issue, error)); ok { return returnFunc(ctx, repo, id, now) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.PendingIssueID, time.Time) domain.Issue); ok { r0 = returnFunc(ctx, repo, id, now) } else { r0 = ret.Get(0).(domain.Issue) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.PendingIssueID, time.Time) error); ok { r1 = returnFunc(ctx, repo, id, now) } else { r1 = ret.Error(1) } return r0, r1 } // PendingIssueStore_Approve_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Approve' type PendingIssueStore_Approve_Call struct { *mock.Call } // Approve is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - id domain.PendingIssueID // - now time.Time func (_e *PendingIssueStore_Expecter) Approve(ctx any, repo any, id any, now any) *PendingIssueStore_Approve_Call { return &PendingIssueStore_Approve_Call{Call: _e.mock.On("Approve", ctx, repo, id, now)} } func (_c *PendingIssueStore_Approve_Call) Run(run func(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID, now time.Time)) *PendingIssueStore_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.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 domain.PendingIssueID if args[2] != nil { arg2 = args[2].(domain.PendingIssueID) } var arg3 time.Time if args[3] != nil { arg3 = args[3].(time.Time) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *PendingIssueStore_Approve_Call) Return(issue domain.Issue, err error) *PendingIssueStore_Approve_Call { _c.Call.Return(issue, err) return _c } func (_c *PendingIssueStore_Approve_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID, now time.Time) (domain.Issue, error)) *PendingIssueStore_Approve_Call { _c.Call.Return(run) return _c } // Count provides a mock function for the type PendingIssueStore func (_mock *PendingIssueStore) Count(ctx context.Context) (int, error) { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for Count") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context) (int, error)); ok { return returnFunc(ctx) } if returnFunc, ok := ret.Get(0).(func(context.Context) int); ok { r0 = returnFunc(ctx) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } return r0, r1 } // PendingIssueStore_Count_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Count' type PendingIssueStore_Count_Call struct { *mock.Call } // Count is a helper method to define mock.On call // - ctx context.Context func (_e *PendingIssueStore_Expecter) Count(ctx any) *PendingIssueStore_Count_Call { return &PendingIssueStore_Count_Call{Call: _e.mock.On("Count", ctx)} } func (_c *PendingIssueStore_Count_Call) Run(run func(ctx context.Context)) *PendingIssueStore_Count_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 *PendingIssueStore_Count_Call) Return(n int, err error) *PendingIssueStore_Count_Call { _c.Call.Return(n, err) return _c } func (_c *PendingIssueStore_Count_Call) RunAndReturn(run func(ctx context.Context) (int, error)) *PendingIssueStore_Count_Call { _c.Call.Return(run) return _c } // Delete provides a mock function for the type PendingIssueStore func (_mock *PendingIssueStore) Delete(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID) error { ret := _mock.Called(ctx, repo, id) if len(ret) == 0 { panic("no return value specified for Delete") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.PendingIssueID) error); ok { r0 = returnFunc(ctx, repo, id) } else { r0 = ret.Error(0) } return r0 } // PendingIssueStore_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' type PendingIssueStore_Delete_Call struct { *mock.Call } // Delete is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - id domain.PendingIssueID func (_e *PendingIssueStore_Expecter) Delete(ctx any, repo any, id any) *PendingIssueStore_Delete_Call { return &PendingIssueStore_Delete_Call{Call: _e.mock.On("Delete", ctx, repo, id)} } func (_c *PendingIssueStore_Delete_Call) Run(run func(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID)) *PendingIssueStore_Delete_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 domain.PendingIssueID if args[2] != nil { arg2 = args[2].(domain.PendingIssueID) } run( arg0, arg1, arg2, ) }) return _c } func (_c *PendingIssueStore_Delete_Call) Return(err error) *PendingIssueStore_Delete_Call { _c.Call.Return(err) return _c } func (_c *PendingIssueStore_Delete_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID) error) *PendingIssueStore_Delete_Call { _c.Call.Return(run) return _c } // Get provides a mock function for the type PendingIssueStore func (_mock *PendingIssueStore) Get(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID) (domain.PendingIssue, error) { ret := _mock.Called(ctx, repo, id) if len(ret) == 0 { panic("no return value specified for Get") } var r0 domain.PendingIssue var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.PendingIssueID) (domain.PendingIssue, error)); ok { return returnFunc(ctx, repo, id) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.PendingIssueID) domain.PendingIssue); ok { r0 = returnFunc(ctx, repo, id) } else { r0 = ret.Get(0).(domain.PendingIssue) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.PendingIssueID) error); ok { r1 = returnFunc(ctx, repo, id) } else { r1 = ret.Error(1) } return r0, r1 } // PendingIssueStore_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type PendingIssueStore_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - id domain.PendingIssueID func (_e *PendingIssueStore_Expecter) Get(ctx any, repo any, id any) *PendingIssueStore_Get_Call { return &PendingIssueStore_Get_Call{Call: _e.mock.On("Get", ctx, repo, id)} } func (_c *PendingIssueStore_Get_Call) Run(run func(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID)) *PendingIssueStore_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 domain.PendingIssueID if args[2] != nil { arg2 = args[2].(domain.PendingIssueID) } run( arg0, arg1, arg2, ) }) return _c } func (_c *PendingIssueStore_Get_Call) Return(pendingIssue domain.PendingIssue, err error) *PendingIssueStore_Get_Call { _c.Call.Return(pendingIssue, err) return _c } func (_c *PendingIssueStore_Get_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID) (domain.PendingIssue, error)) *PendingIssueStore_Get_Call { _c.Call.Return(run) return _c } // List provides a mock function for the type PendingIssueStore func (_mock *PendingIssueStore) List(ctx context.Context, repo domain.RepoName, page ports.ListPendingParams) (ports.PendingIssuePage, error) { ret := _mock.Called(ctx, repo, page) if len(ret) == 0 { panic("no return value specified for List") } var r0 ports.PendingIssuePage var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, ports.ListPendingParams) (ports.PendingIssuePage, error)); ok { return returnFunc(ctx, repo, page) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, ports.ListPendingParams) ports.PendingIssuePage); ok { r0 = returnFunc(ctx, repo, page) } else { r0 = ret.Get(0).(ports.PendingIssuePage) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, ports.ListPendingParams) error); ok { r1 = returnFunc(ctx, repo, page) } else { r1 = ret.Error(1) } return r0, r1 } // PendingIssueStore_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' type PendingIssueStore_List_Call struct { *mock.Call } // List is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - page ports.ListPendingParams func (_e *PendingIssueStore_Expecter) List(ctx any, repo any, page any) *PendingIssueStore_List_Call { return &PendingIssueStore_List_Call{Call: _e.mock.On("List", ctx, repo, page)} } func (_c *PendingIssueStore_List_Call) Run(run func(ctx context.Context, repo domain.RepoName, page ports.ListPendingParams)) *PendingIssueStore_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.ListPendingParams if args[2] != nil { arg2 = args[2].(ports.ListPendingParams) } run( arg0, arg1, arg2, ) }) return _c } func (_c *PendingIssueStore_List_Call) Return(pendingIssuePage ports.PendingIssuePage, err error) *PendingIssueStore_List_Call { _c.Call.Return(pendingIssuePage, err) return _c } func (_c *PendingIssueStore_List_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, page ports.ListPendingParams) (ports.PendingIssuePage, error)) *PendingIssueStore_List_Call { _c.Call.Return(run) return _c } // Put provides a mock function for the type PendingIssueStore func (_mock *PendingIssueStore) Put(ctx context.Context, p domain.PendingIssue) error { ret := _mock.Called(ctx, p) if len(ret) == 0 { panic("no return value specified for Put") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.PendingIssue) error); ok { r0 = returnFunc(ctx, p) } else { r0 = ret.Error(0) } return r0 } // PendingIssueStore_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put' type PendingIssueStore_Put_Call struct { *mock.Call } // Put is a helper method to define mock.On call // - ctx context.Context // - p domain.PendingIssue func (_e *PendingIssueStore_Expecter) Put(ctx any, p any) *PendingIssueStore_Put_Call { return &PendingIssueStore_Put_Call{Call: _e.mock.On("Put", ctx, p)} } func (_c *PendingIssueStore_Put_Call) Run(run func(ctx context.Context, p domain.PendingIssue)) *PendingIssueStore_Put_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.PendingIssue if args[1] != nil { arg1 = args[1].(domain.PendingIssue) } run( arg0, arg1, ) }) return _c } func (_c *PendingIssueStore_Put_Call) Return(err error) *PendingIssueStore_Put_Call { _c.Call.Return(err) return _c } func (_c *PendingIssueStore_Put_Call) RunAndReturn(run func(ctx context.Context, p domain.PendingIssue) error) *PendingIssueStore_Put_Call { _c.Call.Return(run) return _c }