// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "time" "github.com/bnema/dumber/internal/domain/entity" mock "github.com/stretchr/testify/mock" ) // NewMockSessionRepository creates a new instance of MockSessionRepository. 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 NewMockSessionRepository(t interface { mock.TestingT Cleanup(func()) }) *MockSessionRepository { mock := &MockSessionRepository{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockSessionRepository is an autogenerated mock type for the SessionRepository type type MockSessionRepository struct { mock.Mock } type MockSessionRepository_Expecter struct { mock *mock.Mock } func (_m *MockSessionRepository) EXPECT() *MockSessionRepository_Expecter { return &MockSessionRepository_Expecter{mock: &_m.Mock} } // Delete provides a mock function for the type MockSessionRepository func (_mock *MockSessionRepository) Delete(ctx context.Context, id entity.SessionID) error { ret := _mock.Called(ctx, id) if len(ret) == 0 { panic("no return value specified for Delete") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, entity.SessionID) error); ok { r0 = returnFunc(ctx, id) } else { r0 = ret.Error(0) } return r0 } // MockSessionRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' type MockSessionRepository_Delete_Call struct { *mock.Call } // Delete is a helper method to define mock.On call // - ctx context.Context // - id entity.SessionID func (_e *MockSessionRepository_Expecter) Delete(ctx any, id any) *MockSessionRepository_Delete_Call { return &MockSessionRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} } func (_c *MockSessionRepository_Delete_Call) Run(run func(ctx context.Context, id entity.SessionID)) *MockSessionRepository_Delete_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 entity.SessionID if args[1] != nil { arg1 = args[1].(entity.SessionID) } run( arg0, arg1, ) }) return _c } func (_c *MockSessionRepository_Delete_Call) Return(err error) *MockSessionRepository_Delete_Call { _c.Call.Return(err) return _c } func (_c *MockSessionRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, id entity.SessionID) error) *MockSessionRepository_Delete_Call { _c.Call.Return(run) return _c } // DeleteExitedBefore provides a mock function for the type MockSessionRepository func (_mock *MockSessionRepository) DeleteExitedBefore(ctx context.Context, cutoff time.Time) (int64, error) { ret := _mock.Called(ctx, cutoff) if len(ret) == 0 { panic("no return value specified for DeleteExitedBefore") } var r0 int64 var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, time.Time) (int64, error)); ok { return returnFunc(ctx, cutoff) } if returnFunc, ok := ret.Get(0).(func(context.Context, time.Time) int64); ok { r0 = returnFunc(ctx, cutoff) } else { r0 = ret.Get(0).(int64) } if returnFunc, ok := ret.Get(1).(func(context.Context, time.Time) error); ok { r1 = returnFunc(ctx, cutoff) } else { r1 = ret.Error(1) } return r0, r1 } // MockSessionRepository_DeleteExitedBefore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteExitedBefore' type MockSessionRepository_DeleteExitedBefore_Call struct { *mock.Call } // DeleteExitedBefore is a helper method to define mock.On call // - ctx context.Context // - cutoff time.Time func (_e *MockSessionRepository_Expecter) DeleteExitedBefore(ctx any, cutoff any) *MockSessionRepository_DeleteExitedBefore_Call { return &MockSessionRepository_DeleteExitedBefore_Call{Call: _e.mock.On("DeleteExitedBefore", ctx, cutoff)} } func (_c *MockSessionRepository_DeleteExitedBefore_Call) Run(run func(ctx context.Context, cutoff time.Time)) *MockSessionRepository_DeleteExitedBefore_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 time.Time if args[1] != nil { arg1 = args[1].(time.Time) } run( arg0, arg1, ) }) return _c } func (_c *MockSessionRepository_DeleteExitedBefore_Call) Return(n int64, err error) *MockSessionRepository_DeleteExitedBefore_Call { _c.Call.Return(n, err) return _c } func (_c *MockSessionRepository_DeleteExitedBefore_Call) RunAndReturn(run func(ctx context.Context, cutoff time.Time) (int64, error)) *MockSessionRepository_DeleteExitedBefore_Call { _c.Call.Return(run) return _c } // DeleteOldestExited provides a mock function for the type MockSessionRepository func (_mock *MockSessionRepository) DeleteOldestExited(ctx context.Context, keepCount int) (int64, error) { ret := _mock.Called(ctx, keepCount) if len(ret) == 0 { panic("no return value specified for DeleteOldestExited") } var r0 int64 var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, int) (int64, error)); ok { return returnFunc(ctx, keepCount) } if returnFunc, ok := ret.Get(0).(func(context.Context, int) int64); ok { r0 = returnFunc(ctx, keepCount) } else { r0 = ret.Get(0).(int64) } if returnFunc, ok := ret.Get(1).(func(context.Context, int) error); ok { r1 = returnFunc(ctx, keepCount) } else { r1 = ret.Error(1) } return r0, r1 } // MockSessionRepository_DeleteOldestExited_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteOldestExited' type MockSessionRepository_DeleteOldestExited_Call struct { *mock.Call } // DeleteOldestExited is a helper method to define mock.On call // - ctx context.Context // - keepCount int func (_e *MockSessionRepository_Expecter) DeleteOldestExited(ctx any, keepCount any) *MockSessionRepository_DeleteOldestExited_Call { return &MockSessionRepository_DeleteOldestExited_Call{Call: _e.mock.On("DeleteOldestExited", ctx, keepCount)} } func (_c *MockSessionRepository_DeleteOldestExited_Call) Run(run func(ctx context.Context, keepCount int)) *MockSessionRepository_DeleteOldestExited_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 int if args[1] != nil { arg1 = args[1].(int) } run( arg0, arg1, ) }) return _c } func (_c *MockSessionRepository_DeleteOldestExited_Call) Return(n int64, err error) *MockSessionRepository_DeleteOldestExited_Call { _c.Call.Return(n, err) return _c } func (_c *MockSessionRepository_DeleteOldestExited_Call) RunAndReturn(run func(ctx context.Context, keepCount int) (int64, error)) *MockSessionRepository_DeleteOldestExited_Call { _c.Call.Return(run) return _c } // FindByID provides a mock function for the type MockSessionRepository func (_mock *MockSessionRepository) FindByID(ctx context.Context, id entity.SessionID) (*entity.Session, error) { ret := _mock.Called(ctx, id) if len(ret) == 0 { panic("no return value specified for FindByID") } var r0 *entity.Session var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, entity.SessionID) (*entity.Session, error)); ok { return returnFunc(ctx, id) } if returnFunc, ok := ret.Get(0).(func(context.Context, entity.SessionID) *entity.Session); ok { r0 = returnFunc(ctx, id) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*entity.Session) } } if returnFunc, ok := ret.Get(1).(func(context.Context, entity.SessionID) error); ok { r1 = returnFunc(ctx, id) } else { r1 = ret.Error(1) } return r0, r1 } // MockSessionRepository_FindByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByID' type MockSessionRepository_FindByID_Call struct { *mock.Call } // FindByID is a helper method to define mock.On call // - ctx context.Context // - id entity.SessionID func (_e *MockSessionRepository_Expecter) FindByID(ctx any, id any) *MockSessionRepository_FindByID_Call { return &MockSessionRepository_FindByID_Call{Call: _e.mock.On("FindByID", ctx, id)} } func (_c *MockSessionRepository_FindByID_Call) Run(run func(ctx context.Context, id entity.SessionID)) *MockSessionRepository_FindByID_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 entity.SessionID if args[1] != nil { arg1 = args[1].(entity.SessionID) } run( arg0, arg1, ) }) return _c } func (_c *MockSessionRepository_FindByID_Call) Return(session *entity.Session, err error) *MockSessionRepository_FindByID_Call { _c.Call.Return(session, err) return _c } func (_c *MockSessionRepository_FindByID_Call) RunAndReturn(run func(ctx context.Context, id entity.SessionID) (*entity.Session, error)) *MockSessionRepository_FindByID_Call { _c.Call.Return(run) return _c } // GetActive provides a mock function for the type MockSessionRepository func (_mock *MockSessionRepository) GetActive(ctx context.Context) (*entity.Session, error) { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for GetActive") } var r0 *entity.Session var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context) (*entity.Session, error)); ok { return returnFunc(ctx) } if returnFunc, ok := ret.Get(0).(func(context.Context) *entity.Session); ok { r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*entity.Session) } } if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } return r0, r1 } // MockSessionRepository_GetActive_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetActive' type MockSessionRepository_GetActive_Call struct { *mock.Call } // GetActive is a helper method to define mock.On call // - ctx context.Context func (_e *MockSessionRepository_Expecter) GetActive(ctx any) *MockSessionRepository_GetActive_Call { return &MockSessionRepository_GetActive_Call{Call: _e.mock.On("GetActive", ctx)} } func (_c *MockSessionRepository_GetActive_Call) Run(run func(ctx context.Context)) *MockSessionRepository_GetActive_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 *MockSessionRepository_GetActive_Call) Return(session *entity.Session, err error) *MockSessionRepository_GetActive_Call { _c.Call.Return(session, err) return _c } func (_c *MockSessionRepository_GetActive_Call) RunAndReturn(run func(ctx context.Context) (*entity.Session, error)) *MockSessionRepository_GetActive_Call { _c.Call.Return(run) return _c } // GetRecent provides a mock function for the type MockSessionRepository func (_mock *MockSessionRepository) GetRecent(ctx context.Context, limit int) ([]*entity.Session, error) { ret := _mock.Called(ctx, limit) if len(ret) == 0 { panic("no return value specified for GetRecent") } var r0 []*entity.Session var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, int) ([]*entity.Session, error)); ok { return returnFunc(ctx, limit) } if returnFunc, ok := ret.Get(0).(func(context.Context, int) []*entity.Session); ok { r0 = returnFunc(ctx, limit) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*entity.Session) } } if returnFunc, ok := ret.Get(1).(func(context.Context, int) error); ok { r1 = returnFunc(ctx, limit) } else { r1 = ret.Error(1) } return r0, r1 } // MockSessionRepository_GetRecent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRecent' type MockSessionRepository_GetRecent_Call struct { *mock.Call } // GetRecent is a helper method to define mock.On call // - ctx context.Context // - limit int func (_e *MockSessionRepository_Expecter) GetRecent(ctx any, limit any) *MockSessionRepository_GetRecent_Call { return &MockSessionRepository_GetRecent_Call{Call: _e.mock.On("GetRecent", ctx, limit)} } func (_c *MockSessionRepository_GetRecent_Call) Run(run func(ctx context.Context, limit int)) *MockSessionRepository_GetRecent_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 int if args[1] != nil { arg1 = args[1].(int) } run( arg0, arg1, ) }) return _c } func (_c *MockSessionRepository_GetRecent_Call) Return(sessions []*entity.Session, err error) *MockSessionRepository_GetRecent_Call { _c.Call.Return(sessions, err) return _c } func (_c *MockSessionRepository_GetRecent_Call) RunAndReturn(run func(ctx context.Context, limit int) ([]*entity.Session, error)) *MockSessionRepository_GetRecent_Call { _c.Call.Return(run) return _c } // MarkEnded provides a mock function for the type MockSessionRepository func (_mock *MockSessionRepository) MarkEnded(ctx context.Context, id entity.SessionID, endedAt time.Time) error { ret := _mock.Called(ctx, id, endedAt) if len(ret) == 0 { panic("no return value specified for MarkEnded") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, entity.SessionID, time.Time) error); ok { r0 = returnFunc(ctx, id, endedAt) } else { r0 = ret.Error(0) } return r0 } // MockSessionRepository_MarkEnded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkEnded' type MockSessionRepository_MarkEnded_Call struct { *mock.Call } // MarkEnded is a helper method to define mock.On call // - ctx context.Context // - id entity.SessionID // - endedAt time.Time func (_e *MockSessionRepository_Expecter) MarkEnded(ctx any, id any, endedAt any) *MockSessionRepository_MarkEnded_Call { return &MockSessionRepository_MarkEnded_Call{Call: _e.mock.On("MarkEnded", ctx, id, endedAt)} } func (_c *MockSessionRepository_MarkEnded_Call) Run(run func(ctx context.Context, id entity.SessionID, endedAt time.Time)) *MockSessionRepository_MarkEnded_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 entity.SessionID if args[1] != nil { arg1 = args[1].(entity.SessionID) } var arg2 time.Time if args[2] != nil { arg2 = args[2].(time.Time) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MockSessionRepository_MarkEnded_Call) Return(err error) *MockSessionRepository_MarkEnded_Call { _c.Call.Return(err) return _c } func (_c *MockSessionRepository_MarkEnded_Call) RunAndReturn(run func(ctx context.Context, id entity.SessionID, endedAt time.Time) error) *MockSessionRepository_MarkEnded_Call { _c.Call.Return(run) return _c } // Save provides a mock function for the type MockSessionRepository func (_mock *MockSessionRepository) Save(ctx context.Context, session *entity.Session) error { ret := _mock.Called(ctx, session) if len(ret) == 0 { panic("no return value specified for Save") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.Session) error); ok { r0 = returnFunc(ctx, session) } else { r0 = ret.Error(0) } return r0 } // MockSessionRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save' type MockSessionRepository_Save_Call struct { *mock.Call } // Save is a helper method to define mock.On call // - ctx context.Context // - session *entity.Session func (_e *MockSessionRepository_Expecter) Save(ctx any, session any) *MockSessionRepository_Save_Call { return &MockSessionRepository_Save_Call{Call: _e.mock.On("Save", ctx, session)} } func (_c *MockSessionRepository_Save_Call) Run(run func(ctx context.Context, session *entity.Session)) *MockSessionRepository_Save_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 *entity.Session if args[1] != nil { arg1 = args[1].(*entity.Session) } run( arg0, arg1, ) }) return _c } func (_c *MockSessionRepository_Save_Call) Return(err error) *MockSessionRepository_Save_Call { _c.Call.Return(err) return _c } func (_c *MockSessionRepository_Save_Call) RunAndReturn(run func(ctx context.Context, session *entity.Session) error) *MockSessionRepository_Save_Call { _c.Call.Return(run) return _c }