// 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" ) // NewPushService creates a new instance of PushService. 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 NewPushService(t interface { mock.TestingT Cleanup(func()) }) *PushService { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &PushService{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // PushService is an autogenerated mock type for the PushService type type PushService struct { mock.Mock } type PushService_Expecter struct { mock *mock.Mock } func (_m *PushService) EXPECT() *PushService_Expecter { return &PushService_Expecter{mock: &_m.Mock} } // Open provides a mock function for the type PushService func (_mock *PushService) Open(ctx context.Context, p domain.Principal, name domain.RepoName, create bool) error { ret := _mock.Called(ctx, p, name, create) if len(ret) == 0 { panic("no return value specified for Open") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, bool) error); ok { r0 = returnFunc(ctx, p, name, create) } else { r0 = ret.Error(0) } return r0 } // PushService_Open_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Open' type PushService_Open_Call struct { *mock.Call } // Open is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - name domain.RepoName // - create bool func (_e *PushService_Expecter) Open(ctx any, p any, name any, create any) *PushService_Open_Call { return &PushService_Open_Call{Call: _e.mock.On("Open", ctx, p, name, create)} } func (_c *PushService_Open_Call) Run(run func(ctx context.Context, p domain.Principal, name domain.RepoName, create bool)) *PushService_Open_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 domain.RepoName if args[2] != nil { arg2 = args[2].(domain.RepoName) } var arg3 bool if args[3] != nil { arg3 = args[3].(bool) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *PushService_Open_Call) Return(err error) *PushService_Open_Call { _c.Call.Return(err) return _c } func (_c *PushService_Open_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, name domain.RepoName, create bool) error) *PushService_Open_Call { _c.Call.Return(run) return _c }