// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "time" mock "github.com/stretchr/testify/mock" ) // NewIssueBanStore creates a new instance of IssueBanStore. 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 NewIssueBanStore(t interface { mock.TestingT Cleanup(func()) }) *IssueBanStore { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &IssueBanStore{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // IssueBanStore is an autogenerated mock type for the IssueBanStore type type IssueBanStore struct { mock.Mock } type IssueBanStore_Expecter struct { mock *mock.Mock } func (_m *IssueBanStore) EXPECT() *IssueBanStore_Expecter { return &IssueBanStore_Expecter{mock: &_m.Mock} } // Ban provides a mock function for the type IssueBanStore func (_mock *IssueBanStore) Ban(ctx context.Context, hash []byte, until time.Time) error { ret := _mock.Called(ctx, hash, until) if len(ret) == 0 { panic("no return value specified for Ban") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, []byte, time.Time) error); ok { r0 = returnFunc(ctx, hash, until) } else { r0 = ret.Error(0) } return r0 } // IssueBanStore_Ban_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ban' type IssueBanStore_Ban_Call struct { *mock.Call } // Ban is a helper method to define mock.On call // - ctx context.Context // - hash []byte // - until time.Time func (_e *IssueBanStore_Expecter) Ban(ctx any, hash any, until any) *IssueBanStore_Ban_Call { return &IssueBanStore_Ban_Call{Call: _e.mock.On("Ban", ctx, hash, until)} } func (_c *IssueBanStore_Ban_Call) Run(run func(ctx context.Context, hash []byte, until time.Time)) *IssueBanStore_Ban_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 []byte if args[1] != nil { arg1 = args[1].([]byte) } var arg2 time.Time if args[2] != nil { arg2 = args[2].(time.Time) } run( arg0, arg1, arg2, ) }) return _c } func (_c *IssueBanStore_Ban_Call) Return(err error) *IssueBanStore_Ban_Call { _c.Call.Return(err) return _c } func (_c *IssueBanStore_Ban_Call) RunAndReturn(run func(ctx context.Context, hash []byte, until time.Time) error) *IssueBanStore_Ban_Call { _c.Call.Return(run) return _c } // Banned provides a mock function for the type IssueBanStore func (_mock *IssueBanStore) Banned(ctx context.Context, hash []byte, now time.Time) (bool, error) { ret := _mock.Called(ctx, hash, now) if len(ret) == 0 { panic("no return value specified for Banned") } var r0 bool var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, []byte, time.Time) (bool, error)); ok { return returnFunc(ctx, hash, now) } if returnFunc, ok := ret.Get(0).(func(context.Context, []byte, time.Time) bool); ok { r0 = returnFunc(ctx, hash, now) } else { r0 = ret.Get(0).(bool) } if returnFunc, ok := ret.Get(1).(func(context.Context, []byte, time.Time) error); ok { r1 = returnFunc(ctx, hash, now) } else { r1 = ret.Error(1) } return r0, r1 } // IssueBanStore_Banned_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Banned' type IssueBanStore_Banned_Call struct { *mock.Call } // Banned is a helper method to define mock.On call // - ctx context.Context // - hash []byte // - now time.Time func (_e *IssueBanStore_Expecter) Banned(ctx any, hash any, now any) *IssueBanStore_Banned_Call { return &IssueBanStore_Banned_Call{Call: _e.mock.On("Banned", ctx, hash, now)} } func (_c *IssueBanStore_Banned_Call) Run(run func(ctx context.Context, hash []byte, now time.Time)) *IssueBanStore_Banned_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 []byte if args[1] != nil { arg1 = args[1].([]byte) } var arg2 time.Time if args[2] != nil { arg2 = args[2].(time.Time) } run( arg0, arg1, arg2, ) }) return _c } func (_c *IssueBanStore_Banned_Call) Return(b bool, err error) *IssueBanStore_Banned_Call { _c.Call.Return(b, err) return _c } func (_c *IssueBanStore_Banned_Call) RunAndReturn(run func(ctx context.Context, hash []byte, now time.Time) (bool, error)) *IssueBanStore_Banned_Call { _c.Call.Return(run) return _c }