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

package mocks

import (
	"context"
	"time"

	"github.com/bangumi/server/internal/model"
	"github.com/bangumi/server/web/session"
	mock "github.com/stretchr/testify/mock"
)

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

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

	return mock
}

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

type SessionRepo_Expecter struct {
	mock *mock.Mock
}

func (_m *SessionRepo) EXPECT() *SessionRepo_Expecter {
	return &SessionRepo_Expecter{mock: &_m.Mock}
}

// Create provides a mock function for the type SessionRepo
func (_mock *SessionRepo) Create(ctx context.Context, userID model.UserID, regTime time.Time, keyGen func() string) (string, session.Session, error) {
	ret := _mock.Called(ctx, userID, regTime, keyGen)

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

	var r0 string
	var r1 session.Session
	var r2 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, time.Time, func() string) (string, session.Session, error)); ok {
		return returnFunc(ctx, userID, regTime, keyGen)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, model.UserID, time.Time, func() string) string); ok {
		r0 = returnFunc(ctx, userID, regTime, keyGen)
	} else {
		r0 = ret.Get(0).(string)
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, model.UserID, time.Time, func() string) session.Session); ok {
		r1 = returnFunc(ctx, userID, regTime, keyGen)
	} else {
		r1 = ret.Get(1).(session.Session)
	}
	if returnFunc, ok := ret.Get(2).(func(context.Context, model.UserID, time.Time, func() string) error); ok {
		r2 = returnFunc(ctx, userID, regTime, keyGen)
	} else {
		r2 = ret.Error(2)
	}
	return r0, r1, r2
}

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

// Create is a helper method to define mock.On call
//   - ctx context.Context
//   - userID model.UserID
//   - regTime time.Time
//   - keyGen func() string
func (_e *SessionRepo_Expecter) Create(ctx interface{}, userID interface{}, regTime interface{}, keyGen interface{}) *SessionRepo_Create_Call {
	return &SessionRepo_Create_Call{Call: _e.mock.On("Create", ctx, userID, regTime, keyGen)}
}

func (_c *SessionRepo_Create_Call) Run(run func(ctx context.Context, userID model.UserID, regTime time.Time, keyGen func() string)) *SessionRepo_Create_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 model.UserID
		if args[1] != nil {
			arg1 = args[1].(model.UserID)
		}
		var arg2 time.Time
		if args[2] != nil {
			arg2 = args[2].(time.Time)
		}
		var arg3 func() string
		if args[3] != nil {
			arg3 = args[3].(func() string)
		}
		run(
			arg0,
			arg1,
			arg2,
			arg3,
		)
	})
	return _c
}

func (_c *SessionRepo_Create_Call) Return(key string, s session.Session, err error) *SessionRepo_Create_Call {
	_c.Call.Return(key, s, err)
	return _c
}

func (_c *SessionRepo_Create_Call) RunAndReturn(run func(ctx context.Context, userID model.UserID, regTime time.Time, keyGen func() string) (string, session.Session, error)) *SessionRepo_Create_Call {
	_c.Call.Return(run)
	return _c
}

// Get provides a mock function for the type SessionRepo
func (_mock *SessionRepo) Get(ctx context.Context, key string) (session.Session, error) {
	ret := _mock.Called(ctx, key)

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

	var r0 session.Session
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) (session.Session, error)); ok {
		return returnFunc(ctx, key)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) session.Session); ok {
		r0 = returnFunc(ctx, key)
	} else {
		r0 = ret.Get(0).(session.Session)
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = returnFunc(ctx, key)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// Get is a helper method to define mock.On call
//   - ctx context.Context
//   - key string
func (_e *SessionRepo_Expecter) Get(ctx interface{}, key interface{}) *SessionRepo_Get_Call {
	return &SessionRepo_Get_Call{Call: _e.mock.On("Get", ctx, key)}
}

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

func (_c *SessionRepo_Get_Call) Return(session1 session.Session, err error) *SessionRepo_Get_Call {
	_c.Call.Return(session1, err)
	return _c
}

func (_c *SessionRepo_Get_Call) RunAndReturn(run func(ctx context.Context, key string) (session.Session, error)) *SessionRepo_Get_Call {
	_c.Call.Return(run)
	return _c
}

// Revoke provides a mock function for the type SessionRepo
func (_mock *SessionRepo) Revoke(ctx context.Context, key string) error {
	ret := _mock.Called(ctx, key)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
		r0 = returnFunc(ctx, key)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Revoke is a helper method to define mock.On call
//   - ctx context.Context
//   - key string
func (_e *SessionRepo_Expecter) Revoke(ctx interface{}, key interface{}) *SessionRepo_Revoke_Call {
	return &SessionRepo_Revoke_Call{Call: _e.mock.On("Revoke", ctx, key)}
}

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

func (_c *SessionRepo_Revoke_Call) Return(err error) *SessionRepo_Revoke_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *SessionRepo_Revoke_Call) RunAndReturn(run func(ctx context.Context, key string) error) *SessionRepo_Revoke_Call {
	_c.Call.Return(run)
	return _c
}

// RevokeUser provides a mock function for the type SessionRepo
func (_mock *SessionRepo) RevokeUser(ctx context.Context, userID model.UserID) ([]string, error) {
	ret := _mock.Called(ctx, userID)

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

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

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

// RevokeUser is a helper method to define mock.On call
//   - ctx context.Context
//   - userID model.UserID
func (_e *SessionRepo_Expecter) RevokeUser(ctx interface{}, userID interface{}) *SessionRepo_RevokeUser_Call {
	return &SessionRepo_RevokeUser_Call{Call: _e.mock.On("RevokeUser", ctx, userID)}
}

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

func (_c *SessionRepo_RevokeUser_Call) Return(keys []string, err error) *SessionRepo_RevokeUser_Call {
	_c.Call.Return(keys, err)
	return _c
}

func (_c *SessionRepo_RevokeUser_Call) RunAndReturn(run func(ctx context.Context, userID model.UserID) ([]string, error)) *SessionRepo_RevokeUser_Call {
	_c.Call.Return(run)
	return _c
}
