// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "bnema.dev/ermite/internal/domain" mock "github.com/stretchr/testify/mock" ) // NewPullGate creates a new instance of PullGate. 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 NewPullGate(t interface { mock.TestingT Cleanup(func()) }) *PullGate { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &PullGate{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // PullGate is an autogenerated mock type for the PullGate type type PullGate struct { mock.Mock } type PullGate_Expecter struct { mock *mock.Mock } func (_m *PullGate) EXPECT() *PullGate_Expecter { return &PullGate_Expecter{mock: &_m.Mock} } // WhileOpen provides a mock function for the type PullGate func (_mock *PullGate) WhileOpen(ctx context.Context, repo domain.RepoName, number int64, fn func() error) error { ret := _mock.Called(ctx, repo, number, fn) if len(ret) == 0 { panic("no return value specified for WhileOpen") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, int64, func() error) error); ok { r0 = returnFunc(ctx, repo, number, fn) } else { r0 = ret.Error(0) } return r0 } // PullGate_WhileOpen_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WhileOpen' type PullGate_WhileOpen_Call struct { *mock.Call } // WhileOpen is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - number int64 // - fn func() error func (_e *PullGate_Expecter) WhileOpen(ctx any, repo any, number any, fn any) *PullGate_WhileOpen_Call { return &PullGate_WhileOpen_Call{Call: _e.mock.On("WhileOpen", ctx, repo, number, fn)} } func (_c *PullGate_WhileOpen_Call) Run(run func(ctx context.Context, repo domain.RepoName, number int64, fn func() error)) *PullGate_WhileOpen_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) } var arg3 func() error if args[3] != nil { arg3 = args[3].(func() error) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *PullGate_WhileOpen_Call) Return(err error) *PullGate_WhileOpen_Call { _c.Call.Return(err) return _c } func (_c *PullGate_WhileOpen_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, number int64, fn func() error) error) *PullGate_WhileOpen_Call { _c.Call.Return(run) return _c }