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

package mocks

import (
	"context"

	"github.com/bangumi/server/dal/query"
	"github.com/bangumi/server/internal/episode"
	"github.com/bangumi/server/internal/model"
	mock "github.com/stretchr/testify/mock"
)

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

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

	return mock
}

// EpisodeRepo is an autogenerated mock type for the Repo type
type EpisodeRepo struct {
	mock.Mock
}

type EpisodeRepo_Expecter struct {
	mock *mock.Mock
}

func (_m *EpisodeRepo) EXPECT() *EpisodeRepo_Expecter {
	return &EpisodeRepo_Expecter{mock: &_m.Mock}
}

// Count provides a mock function for the type EpisodeRepo
func (_mock *EpisodeRepo) Count(ctx context.Context, subjectID model.SubjectID, filter episode.Filter) (int64, error) {
	ret := _mock.Called(ctx, subjectID, filter)

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

	var r0 int64
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, model.SubjectID, episode.Filter) (int64, error)); ok {
		return returnFunc(ctx, subjectID, filter)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, model.SubjectID, episode.Filter) int64); ok {
		r0 = returnFunc(ctx, subjectID, filter)
	} else {
		r0 = ret.Get(0).(int64)
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, model.SubjectID, episode.Filter) error); ok {
		r1 = returnFunc(ctx, subjectID, filter)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// Count is a helper method to define mock.On call
//   - ctx context.Context
//   - subjectID model.SubjectID
//   - filter episode.Filter
func (_e *EpisodeRepo_Expecter) Count(ctx interface{}, subjectID interface{}, filter interface{}) *EpisodeRepo_Count_Call {
	return &EpisodeRepo_Count_Call{Call: _e.mock.On("Count", ctx, subjectID, filter)}
}

func (_c *EpisodeRepo_Count_Call) Run(run func(ctx context.Context, subjectID model.SubjectID, filter episode.Filter)) *EpisodeRepo_Count_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 model.SubjectID
		if args[1] != nil {
			arg1 = args[1].(model.SubjectID)
		}
		var arg2 episode.Filter
		if args[2] != nil {
			arg2 = args[2].(episode.Filter)
		}
		run(
			arg0,
			arg1,
			arg2,
		)
	})
	return _c
}

func (_c *EpisodeRepo_Count_Call) Return(n int64, err error) *EpisodeRepo_Count_Call {
	_c.Call.Return(n, err)
	return _c
}

func (_c *EpisodeRepo_Count_Call) RunAndReturn(run func(ctx context.Context, subjectID model.SubjectID, filter episode.Filter) (int64, error)) *EpisodeRepo_Count_Call {
	_c.Call.Return(run)
	return _c
}

// Get provides a mock function for the type EpisodeRepo
func (_mock *EpisodeRepo) Get(ctx context.Context, episodeID model.EpisodeID) (episode.Episode, error) {
	ret := _mock.Called(ctx, episodeID)

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

	var r0 episode.Episode
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, model.EpisodeID) (episode.Episode, error)); ok {
		return returnFunc(ctx, episodeID)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, model.EpisodeID) episode.Episode); ok {
		r0 = returnFunc(ctx, episodeID)
	} else {
		r0 = ret.Get(0).(episode.Episode)
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, model.EpisodeID) error); ok {
		r1 = returnFunc(ctx, episodeID)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// Get is a helper method to define mock.On call
//   - ctx context.Context
//   - episodeID model.EpisodeID
func (_e *EpisodeRepo_Expecter) Get(ctx interface{}, episodeID interface{}) *EpisodeRepo_Get_Call {
	return &EpisodeRepo_Get_Call{Call: _e.mock.On("Get", ctx, episodeID)}
}

func (_c *EpisodeRepo_Get_Call) Run(run func(ctx context.Context, episodeID model.EpisodeID)) *EpisodeRepo_Get_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 model.EpisodeID
		if args[1] != nil {
			arg1 = args[1].(model.EpisodeID)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *EpisodeRepo_Get_Call) Return(episode1 episode.Episode, err error) *EpisodeRepo_Get_Call {
	_c.Call.Return(episode1, err)
	return _c
}

func (_c *EpisodeRepo_Get_Call) RunAndReturn(run func(ctx context.Context, episodeID model.EpisodeID) (episode.Episode, error)) *EpisodeRepo_Get_Call {
	_c.Call.Return(run)
	return _c
}

// List provides a mock function for the type EpisodeRepo
func (_mock *EpisodeRepo) List(ctx context.Context, subjectID model.SubjectID, filter episode.Filter, limit int, offset int) ([]episode.Episode, error) {
	ret := _mock.Called(ctx, subjectID, filter, limit, offset)

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

	var r0 []episode.Episode
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, model.SubjectID, episode.Filter, int, int) ([]episode.Episode, error)); ok {
		return returnFunc(ctx, subjectID, filter, limit, offset)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, model.SubjectID, episode.Filter, int, int) []episode.Episode); ok {
		r0 = returnFunc(ctx, subjectID, filter, limit, offset)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]episode.Episode)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, model.SubjectID, episode.Filter, int, int) error); ok {
		r1 = returnFunc(ctx, subjectID, filter, limit, offset)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// List is a helper method to define mock.On call
//   - ctx context.Context
//   - subjectID model.SubjectID
//   - filter episode.Filter
//   - limit int
//   - offset int
func (_e *EpisodeRepo_Expecter) List(ctx interface{}, subjectID interface{}, filter interface{}, limit interface{}, offset interface{}) *EpisodeRepo_List_Call {
	return &EpisodeRepo_List_Call{Call: _e.mock.On("List", ctx, subjectID, filter, limit, offset)}
}

func (_c *EpisodeRepo_List_Call) Run(run func(ctx context.Context, subjectID model.SubjectID, filter episode.Filter, limit int, offset int)) *EpisodeRepo_List_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 model.SubjectID
		if args[1] != nil {
			arg1 = args[1].(model.SubjectID)
		}
		var arg2 episode.Filter
		if args[2] != nil {
			arg2 = args[2].(episode.Filter)
		}
		var arg3 int
		if args[3] != nil {
			arg3 = args[3].(int)
		}
		var arg4 int
		if args[4] != nil {
			arg4 = args[4].(int)
		}
		run(
			arg0,
			arg1,
			arg2,
			arg3,
			arg4,
		)
	})
	return _c
}

func (_c *EpisodeRepo_List_Call) Return(episodes []episode.Episode, err error) *EpisodeRepo_List_Call {
	_c.Call.Return(episodes, err)
	return _c
}

func (_c *EpisodeRepo_List_Call) RunAndReturn(run func(ctx context.Context, subjectID model.SubjectID, filter episode.Filter, limit int, offset int) ([]episode.Episode, error)) *EpisodeRepo_List_Call {
	_c.Call.Return(run)
	return _c
}

// WithQuery provides a mock function for the type EpisodeRepo
func (_mock *EpisodeRepo) WithQuery(query1 *query.Query) episode.Repo {
	ret := _mock.Called(query1)

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

	var r0 episode.Repo
	if returnFunc, ok := ret.Get(0).(func(*query.Query) episode.Repo); ok {
		r0 = returnFunc(query1)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(episode.Repo)
		}
	}
	return r0
}

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

// WithQuery is a helper method to define mock.On call
//   - query1 *query.Query
func (_e *EpisodeRepo_Expecter) WithQuery(query1 interface{}) *EpisodeRepo_WithQuery_Call {
	return &EpisodeRepo_WithQuery_Call{Call: _e.mock.On("WithQuery", query1)}
}

func (_c *EpisodeRepo_WithQuery_Call) Run(run func(query1 *query.Query)) *EpisodeRepo_WithQuery_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 *query.Query
		if args[0] != nil {
			arg0 = args[0].(*query.Query)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *EpisodeRepo_WithQuery_Call) Return(repo episode.Repo) *EpisodeRepo_WithQuery_Call {
	_c.Call.Return(repo)
	return _c
}

func (_c *EpisodeRepo_WithQuery_Call) RunAndReturn(run func(query1 *query.Query) episode.Repo) *EpisodeRepo_WithQuery_Call {
	_c.Call.Return(run)
	return _c
}
