From 3b16da62322810a9691f1f1c365b28c169cc1d66 Mon Sep 17 00:00:00 2001 From: kkumar-gcc Date: Wed, 2 Oct 2024 20:57:48 +0000 Subject: [PATCH] chore: update mocks --- mocks/errors/Error.go | 233 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 233 insertions(+) create mode 100644 mocks/errors/Error.go diff --git a/mocks/errors/Error.go b/mocks/errors/Error.go new file mode 100644 index 000000000..df3b64ad7 --- /dev/null +++ b/mocks/errors/Error.go @@ -0,0 +1,233 @@ +// Code generated by mockery. DO NOT EDIT. + +package errors + +import ( + errors "github.com/goravel/framework/contracts/errors" + mock "github.com/stretchr/testify/mock" +) + +// Error is an autogenerated mock type for the Error type +type Error struct { + mock.Mock +} + +type Error_Expecter struct { + mock *mock.Mock +} + +func (_m *Error) EXPECT() *Error_Expecter { + return &Error_Expecter{mock: &_m.Mock} +} + +// Args provides a mock function with given fields: _a0 +func (_m *Error) Args(_a0 ...interface{}) errors.Error { + var _ca []interface{} + _ca = append(_ca, _a0...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Args") + } + + var r0 errors.Error + if rf, ok := ret.Get(0).(func(...interface{}) errors.Error); ok { + r0 = rf(_a0...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + + return r0 +} + +// Error_Args_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Args' +type Error_Args_Call struct { + *mock.Call +} + +// Args is a helper method to define mock.On call +// - _a0 ...interface{} +func (_e *Error_Expecter) Args(_a0 ...interface{}) *Error_Args_Call { + return &Error_Args_Call{Call: _e.mock.On("Args", + append([]interface{}{}, _a0...)...)} +} + +func (_c *Error_Args_Call) Run(run func(_a0 ...interface{})) *Error_Args_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *Error_Args_Call) Return(_a0 errors.Error) *Error_Args_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Error_Args_Call) RunAndReturn(run func(...interface{}) errors.Error) *Error_Args_Call { + _c.Call.Return(run) + return _c +} + +// Error provides a mock function with given fields: +func (_m *Error) Error() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Error") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Error_Error_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Error' +type Error_Error_Call struct { + *mock.Call +} + +// Error is a helper method to define mock.On call +func (_e *Error_Expecter) Error() *Error_Error_Call { + return &Error_Error_Call{Call: _e.mock.On("Error")} +} + +func (_c *Error_Error_Call) Run(run func()) *Error_Error_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Error_Error_Call) Return(_a0 string) *Error_Error_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Error_Error_Call) RunAndReturn(run func() string) *Error_Error_Call { + _c.Call.Return(run) + return _c +} + +// Location provides a mock function with given fields: _a0 +func (_m *Error) Location(_a0 string) errors.Error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Location") + } + + var r0 errors.Error + if rf, ok := ret.Get(0).(func(string) errors.Error); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + + return r0 +} + +// Error_Location_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Location' +type Error_Location_Call struct { + *mock.Call +} + +// Location is a helper method to define mock.On call +// - _a0 string +func (_e *Error_Expecter) Location(_a0 interface{}) *Error_Location_Call { + return &Error_Location_Call{Call: _e.mock.On("Location", _a0)} +} + +func (_c *Error_Location_Call) Run(run func(_a0 string)) *Error_Location_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Error_Location_Call) Return(_a0 errors.Error) *Error_Location_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Error_Location_Call) RunAndReturn(run func(string) errors.Error) *Error_Location_Call { + _c.Call.Return(run) + return _c +} + +// WithLocation provides a mock function with given fields: _a0 +func (_m *Error) WithLocation(_a0 bool) errors.Error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for WithLocation") + } + + var r0 errors.Error + if rf, ok := ret.Get(0).(func(bool) errors.Error); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + + return r0 +} + +// Error_WithLocation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithLocation' +type Error_WithLocation_Call struct { + *mock.Call +} + +// WithLocation is a helper method to define mock.On call +// - _a0 bool +func (_e *Error_Expecter) WithLocation(_a0 interface{}) *Error_WithLocation_Call { + return &Error_WithLocation_Call{Call: _e.mock.On("WithLocation", _a0)} +} + +func (_c *Error_WithLocation_Call) Run(run func(_a0 bool)) *Error_WithLocation_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(bool)) + }) + return _c +} + +func (_c *Error_WithLocation_Call) Return(_a0 errors.Error) *Error_WithLocation_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Error_WithLocation_Call) RunAndReturn(run func(bool) errors.Error) *Error_WithLocation_Call { + _c.Call.Return(run) + return _c +} + +// NewError creates a new instance of Error. 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 NewError(t interface { + mock.TestingT + Cleanup(func()) +}) *Error { + mock := &Error{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}