// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify

package mocks

import (
	"context"

	"github.com/aerospike/backup-go/models"
	mock "github.com/stretchr/testify/mock"
)

// NewMockReader creates a new instance of MockReader. 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 NewMockReader[T models.TokenConstraint](t interface {
	mock.TestingT
	Cleanup(func())
}) *MockReader[T] {
	mock := &MockReader[T]{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}

// MockReader is an autogenerated mock type for the Reader type
type MockReader[T models.TokenConstraint] struct {
	mock.Mock
}

type MockReader_Expecter[T models.TokenConstraint] struct {
	mock *mock.Mock
}

func (_m *MockReader[T]) EXPECT() *MockReader_Expecter[T] {
	return &MockReader_Expecter[T]{mock: &_m.Mock}
}

// Close provides a mock function for the type MockReader
func (_mock *MockReader[T]) Close() {
	_mock.Called()
	return
}

// MockReader_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
type MockReader_Close_Call[T models.TokenConstraint] struct {
	*mock.Call
}

// Close is a helper method to define mock.On call
func (_e *MockReader_Expecter[T]) Close() *MockReader_Close_Call[T] {
	return &MockReader_Close_Call[T]{Call: _e.mock.On("Close")}
}

func (_c *MockReader_Close_Call[T]) Run(run func()) *MockReader_Close_Call[T] {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *MockReader_Close_Call[T]) Return() *MockReader_Close_Call[T] {
	_c.Call.Return()
	return _c
}

func (_c *MockReader_Close_Call[T]) RunAndReturn(run func()) *MockReader_Close_Call[T] {
	_c.Run(run)
	return _c
}

// Read provides a mock function for the type MockReader
func (_mock *MockReader[T]) Read(ctx context.Context) (T, error) {
	ret := _mock.Called(ctx)

	if len(ret) == 0 {
		panic("no return value specified for Read")
	}

	var r0 T
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context) (T, error)); ok {
		return returnFunc(ctx)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context) T); ok {
		r0 = returnFunc(ctx)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(T)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
		r1 = returnFunc(ctx)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

// MockReader_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read'
type MockReader_Read_Call[T models.TokenConstraint] struct {
	*mock.Call
}

// Read is a helper method to define mock.On call
//   - ctx
func (_e *MockReader_Expecter[T]) Read(ctx interface{}) *MockReader_Read_Call[T] {
	return &MockReader_Read_Call[T]{Call: _e.mock.On("Read", ctx)}
}

func (_c *MockReader_Read_Call[T]) Run(run func(ctx context.Context)) *MockReader_Read_Call[T] {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context))
	})
	return _c
}

func (_c *MockReader_Read_Call[T]) Return(v T, err error) *MockReader_Read_Call[T] {
	_c.Call.Return(v, err)
	return _c
}

func (_c *MockReader_Read_Call[T]) RunAndReturn(run func(ctx context.Context) (T, error)) *MockReader_Read_Call[T] {
	_c.Call.Return(run)
	return _c
}
