hash-of-wisdom/internal/service/mocks/mock_quote_service.go

96 lines
2.6 KiB
Go
Raw Normal View History

2025-08-22 16:38:27 +03:00
// Code generated by mockery v2.53.5. DO NOT EDIT.
package mocks
import (
context "context"
quotes "hash-of-wisdom/internal/quotes"
mock "github.com/stretchr/testify/mock"
)
// MockQuoteService is an autogenerated mock type for the QuoteService type
type MockQuoteService struct {
mock.Mock
}
type MockQuoteService_Expecter struct {
mock *mock.Mock
}
func (_m *MockQuoteService) EXPECT() *MockQuoteService_Expecter {
return &MockQuoteService_Expecter{mock: &_m.Mock}
}
// GetRandomQuote provides a mock function with given fields: ctx
func (_m *MockQuoteService) GetRandomQuote(ctx context.Context) (*quotes.Quote, error) {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for GetRandomQuote")
}
var r0 *quotes.Quote
var r1 error
if rf, ok := ret.Get(0).(func(context.Context) (*quotes.Quote, error)); ok {
return rf(ctx)
}
if rf, ok := ret.Get(0).(func(context.Context) *quotes.Quote); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*quotes.Quote)
}
}
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockQuoteService_GetRandomQuote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandomQuote'
type MockQuoteService_GetRandomQuote_Call struct {
*mock.Call
}
// GetRandomQuote is a helper method to define mock.On call
// - ctx context.Context
func (_e *MockQuoteService_Expecter) GetRandomQuote(ctx interface{}) *MockQuoteService_GetRandomQuote_Call {
return &MockQuoteService_GetRandomQuote_Call{Call: _e.mock.On("GetRandomQuote", ctx)}
}
func (_c *MockQuoteService_GetRandomQuote_Call) Run(run func(ctx context.Context)) *MockQuoteService_GetRandomQuote_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *MockQuoteService_GetRandomQuote_Call) Return(_a0 *quotes.Quote, _a1 error) *MockQuoteService_GetRandomQuote_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockQuoteService_GetRandomQuote_Call) RunAndReturn(run func(context.Context) (*quotes.Quote, error)) *MockQuoteService_GetRandomQuote_Call {
_c.Call.Return(run)
return _c
}
// NewMockQuoteService creates a new instance of MockQuoteService. 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 NewMockQuoteService(t interface {
mock.TestingT
Cleanup(func())
}) *MockQuoteService {
mock := &MockQuoteService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}