// Code generated by mockery v2.45.1. DO NOT EDIT.

package benefactorvalidator

import (
	context "context"

	entity "git.gocasts.ir/ebhomengo/niki/entity"
	mock "github.com/stretchr/testify/mock"
)

// MockRepository is an autogenerated mock type for the Repository type
type MockRepository struct {
	mock.Mock
}

type MockRepository_Expecter struct {
	mock *mock.Mock
}

func (_m *MockRepository) EXPECT() *MockRepository_Expecter {
	return &MockRepository_Expecter{mock: &_m.Mock}
}

// GetByPhoneNumber provides a mock function with given fields: ctx, phoneNumber
func (_m *MockRepository) GetByPhoneNumber(ctx context.Context, phoneNumber string) (entity.Benefactor, error) {
	ret := _m.Called(ctx, phoneNumber)

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

	var r0 entity.Benefactor
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string) (entity.Benefactor, error)); ok {
		return rf(ctx, phoneNumber)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string) entity.Benefactor); ok {
		r0 = rf(ctx, phoneNumber)
	} else {
		r0 = ret.Get(0).(entity.Benefactor)
	}

	if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = rf(ctx, phoneNumber)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// MockRepository_GetByPhoneNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByPhoneNumber'
type MockRepository_GetByPhoneNumber_Call struct {
	*mock.Call
}

// GetByPhoneNumber is a helper method to define mock.On call
//   - ctx context.Context
//   - phoneNumber string
func (_e *MockRepository_Expecter) GetByPhoneNumber(ctx interface{}, phoneNumber interface{}) *MockRepository_GetByPhoneNumber_Call {
	return &MockRepository_GetByPhoneNumber_Call{Call: _e.mock.On("GetByPhoneNumber", ctx, phoneNumber)}
}

func (_c *MockRepository_GetByPhoneNumber_Call) Run(run func(ctx context.Context, phoneNumber string)) *MockRepository_GetByPhoneNumber_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(string))
	})
	return _c
}

func (_c *MockRepository_GetByPhoneNumber_Call) Return(_a0 entity.Benefactor, _a1 error) *MockRepository_GetByPhoneNumber_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *MockRepository_GetByPhoneNumber_Call) RunAndReturn(run func(context.Context, string) (entity.Benefactor, error)) *MockRepository_GetByPhoneNumber_Call {
	_c.Call.Return(run)
	return _c
}

// NewMockRepository creates a new instance of MockRepository. 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 NewMockRepository(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockRepository {
	mock := &MockRepository{}
	mock.Mock.Test(t)

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

	return mock
}
