// Code generated by eevee. DO NOT EDIT!

package repository

import (
	"context"
	"log"
	"reflect"
	"simple/entity"
	"simple/model"

	"golang.org/x/xerrors"
)

type UserMock struct {
	expect *UserExpect
}

func (r *UserMock) EXPECT() *UserExpect {
	return r.expect
}

func NewUserMock() *UserMock {
	return &UserMock{expect: NewUserExpect()}
}

type UserToModelExpect struct {
	expect        *UserExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(value *entity.User)
	value         *entity.User
	r0            *model.User
}

func (r *UserToModelExpect) Return(r0 *model.User) *UserToModelExpect {
	r.r0 = r0
	return r
}

func (r *UserToModelExpect) Do(action func(value *entity.User)) *UserToModelExpect {
	r.actions = append(r.actions, action)
	return r
}

func (r *UserToModelExpect) OutOfOrder() *UserToModelExpect {
	r.isOutOfOrder = true
	return r
}

func (r *UserToModelExpect) AnyTimes() *UserToModelExpect {
	r.isAnyTimes = true
	return r
}

func (r *UserToModelExpect) Times(n int) *UserToModelExpect {
	r.requiredTimes = n
	return r
}

func (r *UserMock) ToModel(value *entity.User) (r0 *model.User) {
	if len(r.expect.toModel) == 0 {
		log.Printf("cannot find mock method for User.ToModel")
		return
	}
	for _, exp := range r.expect.toModel {
		if !reflect.DeepEqual(exp.value, value) {
			continue
		}
		for _, action := range exp.actions {
			action(value)
		}
		if exp.isAnyTimes {
			r0 = exp.r0
			return
		}
		if exp.requiredTimes > 1 && exp.calledTimes > exp.requiredTimes {
			log.Printf("invalid call times. requiredTimes: [%d] calledTimes: [%d]", exp.requiredTimes, exp.calledTimes)
			return
		}
		exp.calledTimes++
		r0 = exp.r0
		return
	}
	log.Printf("invalid argument User value:[%+v]", value)
	return
}

func (r *UserExpect) ToModel(value *entity.User) *UserToModelExpect {
	exp := &UserToModelExpect{
		actions: []func(value *entity.User){},
		expect:  r,
		value:   value,
	}
	r.toModel = append(r.toModel, exp)
	return exp
}

type UserToModelsExpect struct {
	expect        *UserExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(values entity.Users)
	values        entity.Users
	r0            *model.Users
}

func (r *UserToModelsExpect) Return(r0 *model.Users) *UserToModelsExpect {
	r.r0 = r0
	return r
}

func (r *UserToModelsExpect) Do(action func(values entity.Users)) *UserToModelsExpect {
	r.actions = append(r.actions, action)
	return r
}

func (r *UserToModelsExpect) OutOfOrder() *UserToModelsExpect {
	r.isOutOfOrder = true
	return r
}

func (r *UserToModelsExpect) AnyTimes() *UserToModelsExpect {
	r.isAnyTimes = true
	return r
}

func (r *UserToModelsExpect) Times(n int) *UserToModelsExpect {
	r.requiredTimes = n
	return r
}

func (r *UserMock) ToModels(values entity.Users) (r0 *model.Users) {
	if len(r.expect.toModels) == 0 {
		log.Printf("cannot find mock method for User.ToModels")
		return
	}
	for _, exp := range r.expect.toModels {
		if !reflect.DeepEqual(exp.values, values) {
			continue
		}
		for _, action := range exp.actions {
			action(values)
		}
		if exp.isAnyTimes {
			r0 = exp.r0
			return
		}
		if exp.requiredTimes > 1 && exp.calledTimes > exp.requiredTimes {
			log.Printf("invalid call times. requiredTimes: [%d] calledTimes: [%d]", exp.requiredTimes, exp.calledTimes)
			return
		}
		exp.calledTimes++
		r0 = exp.r0
		return
	}
	log.Printf("invalid argument User values:[%+v]", values)
	return
}

func (r *UserExpect) ToModels(values entity.Users) *UserToModelsExpect {
	exp := &UserToModelsExpect{
		actions: []func(values entity.Users){},
		expect:  r,
		values:  values,
	}
	r.toModels = append(r.toModels, exp)
	return exp
}

type UserCreateExpect struct {
	expect        *UserExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(ctx context.Context, value *entity.User)
	ctx           context.Context
	value         *entity.User
	r0            *model.User
	r1            error
}

func (r *UserCreateExpect) Return(r0 *model.User, r1 error) *UserCreateExpect {
	r.r0 = r0
	r.r1 = r1
	return r
}

func (r *UserCreateExpect) Do(action func(ctx context.Context, value *entity.User)) *UserCreateExpect {
	r.actions = append(r.actions, action)
	return r
}

func (r *UserCreateExpect) OutOfOrder() *UserCreateExpect {
	r.isOutOfOrder = true
	return r
}

func (r *UserCreateExpect) AnyTimes() *UserCreateExpect {
	r.isAnyTimes = true
	return r
}

func (r *UserCreateExpect) Times(n int) *UserCreateExpect {
	r.requiredTimes = n
	return r
}

func (r *UserMock) Create(ctx context.Context, value *entity.User) (r0 *model.User, r1 error) {
	if len(r.expect.create) == 0 {
		r1 = xerrors.New("cannot find mock method for User.Create")
		return
	}
	for _, exp := range r.expect.create {
		if !reflect.DeepEqual(exp.ctx, ctx) {
			continue
		}
		if !reflect.DeepEqual(exp.value, value) {
			continue
		}
		for _, action := range exp.actions {
			action(ctx, value)
		}
		if exp.isAnyTimes {
			r0 = exp.r0
			r1 = exp.r1
			return
		}
		if exp.requiredTimes > 1 && exp.calledTimes > exp.requiredTimes {
			r1 = xerrors.Errorf("invalid call times. requiredTimes: [%d] calledTimes: [%d]", exp.requiredTimes, exp.calledTimes)
			return
		}
		exp.calledTimes++
		r0 = exp.r0
		r1 = exp.r1
		return
	}
	r1 = xerrors.Errorf("invalid argument User ctx:[%+v] value:[%+v]", ctx, value)
	return
}

func (r *UserExpect) Create(ctx context.Context, value *entity.User) *UserCreateExpect {
	exp := &UserCreateExpect{
		actions: []func(ctx context.Context, value *entity.User){},
		ctx:     ctx,
		expect:  r,
		value:   value,
	}
	r.create = append(r.create, exp)
	return exp
}

type UserCreatesExpect struct {
	expect        *UserExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(ctx context.Context, entities entity.Users)
	ctx           context.Context
	entities      entity.Users
	r0            *model.Users
	r1            error
}

func (r *UserCreatesExpect) Return(r0 *model.Users, r1 error) *UserCreatesExpect {
	r.r0 = r0
	r.r1 = r1
	return r
}

func (r *UserCreatesExpect) Do(action func(ctx context.Context, entities entity.Users)) *UserCreatesExpect {
	r.actions = append(r.actions, action)
	return r
}

func (r *UserCreatesExpect) OutOfOrder() *UserCreatesExpect {
	r.isOutOfOrder = true
	return r
}

func (r *UserCreatesExpect) AnyTimes() *UserCreatesExpect {
	r.isAnyTimes = true
	return r
}

func (r *UserCreatesExpect) Times(n int) *UserCreatesExpect {
	r.requiredTimes = n
	return r
}

func (r *UserMock) Creates(ctx context.Context, entities entity.Users) (r0 *model.Users, r1 error) {
	if len(r.expect.creates) == 0 {
		r1 = xerrors.New("cannot find mock method for User.Creates")
		return
	}
	for _, exp := range r.expect.creates {
		if !reflect.DeepEqual(exp.ctx, ctx) {
			continue
		}
		if !reflect.DeepEqual(exp.entities, entities) {
			continue
		}
		for _, action := range exp.actions {
			action(ctx, entities)
		}
		if exp.isAnyTimes {
			r0 = exp.r0
			r1 = exp.r1
			return
		}
		if exp.requiredTimes > 1 && exp.calledTimes > exp.requiredTimes {
			r1 = xerrors.Errorf("invalid call times. requiredTimes: [%d] calledTimes: [%d]", exp.requiredTimes, exp.calledTimes)
			return
		}
		exp.calledTimes++
		r0 = exp.r0
		r1 = exp.r1
		return
	}
	r1 = xerrors.Errorf("invalid argument User ctx:[%+v] entities:[%+v]", ctx, entities)
	return
}

func (r *UserExpect) Creates(ctx context.Context, entities entity.Users) *UserCreatesExpect {
	exp := &UserCreatesExpect{
		actions:  []func(ctx context.Context, entities entity.Users){},
		ctx:      ctx,
		entities: entities,
		expect:   r,
	}
	r.creates = append(r.creates, exp)
	return exp
}

type UserFindAllExpect struct {
	expect        *UserExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(a0 context.Context)
	a0            context.Context
	r0            *model.Users
	r1            error
}

func (r *UserFindAllExpect) Return(r0 *model.Users, r1 error) *UserFindAllExpect {
	r.r0 = r0
	r.r1 = r1
	return r
}

func (r *UserFindAllExpect) Do(action func(a0 context.Context)) *UserFindAllExpect {
	r.actions = append(r.actions, action)
	return r
}

func (r *UserFindAllExpect) OutOfOrder() *UserFindAllExpect {
	r.isOutOfOrder = true
	return r
}

func (r *UserFindAllExpect) AnyTimes() *UserFindAllExpect {
	r.isAnyTimes = true
	return r
}

func (r *UserFindAllExpect) Times(n int) *UserFindAllExpect {
	r.requiredTimes = n
	return r
}

func (r *UserMock) FindAll(a0 context.Context) (r0 *model.Users, r1 error) {
	if len(r.expect.findAll) == 0 {
		r1 = xerrors.New("cannot find mock method for User.FindAll")
		return
	}
	for _, exp := range r.expect.findAll {
		if !reflect.DeepEqual(exp.a0, a0) {
			continue
		}
		for _, action := range exp.actions {
			action(a0)
		}
		if exp.isAnyTimes {
			r0 = exp.r0
			r1 = exp.r1
			return
		}
		if exp.requiredTimes > 1 && exp.calledTimes > exp.requiredTimes {
			r1 = xerrors.Errorf("invalid call times. requiredTimes: [%d] calledTimes: [%d]", exp.requiredTimes, exp.calledTimes)
			return
		}
		exp.calledTimes++
		r0 = exp.r0
		r1 = exp.r1
		return
	}
	r1 = xerrors.Errorf("invalid argument User a0:[%+v]", a0)
	return
}

func (r *UserExpect) FindAll(a0 context.Context) *UserFindAllExpect {
	exp := &UserFindAllExpect{
		a0:      a0,
		actions: []func(a0 context.Context){},
		expect:  r,
	}
	r.findAll = append(r.findAll, exp)
	return exp
}

type UserFindByIDExpect struct {
	expect        *UserExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(a0 context.Context, a1 uint64)
	a0            context.Context
	a1            uint64
	r0            *model.User
	r1            error
}

func (r *UserFindByIDExpect) Return(r0 *model.User, r1 error) *UserFindByIDExpect {
	r.r0 = r0
	r.r1 = r1
	return r
}

func (r *UserFindByIDExpect) Do(action func(a0 context.Context, a1 uint64)) *UserFindByIDExpect {
	r.actions = append(r.actions, action)
	return r
}

func (r *UserFindByIDExpect) OutOfOrder() *UserFindByIDExpect {
	r.isOutOfOrder = true
	return r
}

func (r *UserFindByIDExpect) AnyTimes() *UserFindByIDExpect {
	r.isAnyTimes = true
	return r
}

func (r *UserFindByIDExpect) Times(n int) *UserFindByIDExpect {
	r.requiredTimes = n
	return r
}

func (r *UserMock) FindByID(a0 context.Context, a1 uint64) (r0 *model.User, r1 error) {
	if len(r.expect.findByID) == 0 {
		r1 = xerrors.New("cannot find mock method for User.FindByID")
		return
	}
	for _, exp := range r.expect.findByID {
		if !reflect.DeepEqual(exp.a0, a0) {
			continue
		}
		if !reflect.DeepEqual(exp.a1, a1) {
			continue
		}
		for _, action := range exp.actions {
			action(a0, a1)
		}
		if exp.isAnyTimes {
			r0 = exp.r0
			r1 = exp.r1
			return
		}
		if exp.requiredTimes > 1 && exp.calledTimes > exp.requiredTimes {
			r1 = xerrors.Errorf("invalid call times. requiredTimes: [%d] calledTimes: [%d]", exp.requiredTimes, exp.calledTimes)
			return
		}
		exp.calledTimes++
		r0 = exp.r0
		r1 = exp.r1
		return
	}
	r1 = xerrors.Errorf("invalid argument User a0:[%+v] a1:[%+v]", a0, a1)
	return
}

func (r *UserExpect) FindByID(a0 context.Context, a1 uint64) *UserFindByIDExpect {
	exp := &UserFindByIDExpect{
		a0:      a0,
		a1:      a1,
		actions: []func(a0 context.Context, a1 uint64){},
		expect:  r,
	}
	r.findByID = append(r.findByID, exp)
	return exp
}

type UserFindByIDsExpect struct {
	expect        *UserExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(a0 context.Context, a1 []uint64)
	a0            context.Context
	a1            []uint64
	r0            *model.Users
	r1            error
}

func (r *UserFindByIDsExpect) Return(r0 *model.Users, r1 error) *UserFindByIDsExpect {
	r.r0 = r0
	r.r1 = r1
	return r
}

func (r *UserFindByIDsExpect) Do(action func(a0 context.Context, a1 []uint64)) *UserFindByIDsExpect {
	r.actions = append(r.actions, action)
	return r
}

func (r *UserFindByIDsExpect) OutOfOrder() *UserFindByIDsExpect {
	r.isOutOfOrder = true
	return r
}

func (r *UserFindByIDsExpect) AnyTimes() *UserFindByIDsExpect {
	r.isAnyTimes = true
	return r
}

func (r *UserFindByIDsExpect) Times(n int) *UserFindByIDsExpect {
	r.requiredTimes = n
	return r
}

func (r *UserMock) FindByIDs(a0 context.Context, a1 []uint64) (r0 *model.Users, r1 error) {
	if len(r.expect.findByIDs) == 0 {
		r1 = xerrors.New("cannot find mock method for User.FindByIDs")
		return
	}
	for _, exp := range r.expect.findByIDs {
		if !reflect.DeepEqual(exp.a0, a0) {
			continue
		}
		if len(exp.a1) != len(a1) {
			continue
		}
		if exp.isOutOfOrder {
			isMatched := func() bool {
				for _, exp := range exp.a1 {
					found := false
					for idx, act := range a1 {
						if exp != act {
							continue
						}
						a1 = append(a1[:idx], a1[idx+1:]...)
						found = true
						break
					}
					if !found {
						return false
					}
				}
				return true
			}()
			if !isMatched {
				continue
			}
		} else {
			if !reflect.DeepEqual(exp.a1, a1) {
				continue
			}
		}
		for _, action := range exp.actions {
			action(a0, a1)
		}
		if exp.isAnyTimes {
			r0 = exp.r0
			r1 = exp.r1
			return
		}
		if exp.requiredTimes > 1 && exp.calledTimes > exp.requiredTimes {
			r1 = xerrors.Errorf("invalid call times. requiredTimes: [%d] calledTimes: [%d]", exp.requiredTimes, exp.calledTimes)
			return
		}
		exp.calledTimes++
		r0 = exp.r0
		r1 = exp.r1
		return
	}
	r1 = xerrors.Errorf("invalid argument User a0:[%+v] a1:[%+v]", a0, a1)
	return
}

func (r *UserExpect) FindByIDs(a0 context.Context, a1 []uint64) *UserFindByIDsExpect {
	exp := &UserFindByIDsExpect{
		a0:      a0,
		a1:      a1,
		actions: []func(a0 context.Context, a1 []uint64){},
		expect:  r,
	}
	r.findByIDs = append(r.findByIDs, exp)
	return exp
}

type UserUpdateByIDExpect struct {
	expect        *UserExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(a0 context.Context, a1 uint64, a2 map[string]interface{})
	a0            context.Context
	a1            uint64
	a2            map[string]interface{}
	r0            error
}

func (r *UserUpdateByIDExpect) Return(r0 error) *UserUpdateByIDExpect {
	r.r0 = r0
	return r
}

func (r *UserUpdateByIDExpect) Do(action func(a0 context.Context, a1 uint64, a2 map[string]interface{})) *UserUpdateByIDExpect {
	r.actions = append(r.actions, action)
	return r
}

func (r *UserUpdateByIDExpect) OutOfOrder() *UserUpdateByIDExpect {
	r.isOutOfOrder = true
	return r
}

func (r *UserUpdateByIDExpect) AnyTimes() *UserUpdateByIDExpect {
	r.isAnyTimes = true
	return r
}

func (r *UserUpdateByIDExpect) Times(n int) *UserUpdateByIDExpect {
	r.requiredTimes = n
	return r
}

func (r *UserMock) UpdateByID(a0 context.Context, a1 uint64, a2 map[string]interface{}) (r0 error) {
	if len(r.expect.updateByID) == 0 {
		r0 = xerrors.New("cannot find mock method for User.UpdateByID")
		return
	}
	for _, exp := range r.expect.updateByID {
		if !reflect.DeepEqual(exp.a0, a0) {
			continue
		}
		if !reflect.DeepEqual(exp.a1, a1) {
			continue
		}
		if !reflect.DeepEqual(exp.a2, a2) {
			continue
		}
		for _, action := range exp.actions {
			action(a0, a1, a2)
		}
		if exp.isAnyTimes {
			r0 = exp.r0
			return
		}
		if exp.requiredTimes > 1 && exp.calledTimes > exp.requiredTimes {
			r0 = xerrors.Errorf("invalid call times. requiredTimes: [%d] calledTimes: [%d]", exp.requiredTimes, exp.calledTimes)
			return
		}
		exp.calledTimes++
		r0 = exp.r0
		return
	}
	r0 = xerrors.Errorf("invalid argument User a0:[%+v] a1:[%+v] a2:[%+v]", a0, a1, a2)
	return
}

func (r *UserExpect) UpdateByID(a0 context.Context, a1 uint64, a2 map[string]interface{}) *UserUpdateByIDExpect {
	exp := &UserUpdateByIDExpect{
		a0:      a0,
		a1:      a1,
		a2:      a2,
		actions: []func(a0 context.Context, a1 uint64, a2 map[string]interface{}){},
		expect:  r,
	}
	r.updateByID = append(r.updateByID, exp)
	return exp
}

type UserUpdateByIDsExpect struct {
	expect        *UserExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(a0 context.Context, a1 []uint64, a2 map[string]interface{})
	a0            context.Context
	a1            []uint64
	a2            map[string]interface{}
	r0            error
}

func (r *UserUpdateByIDsExpect) Return(r0 error) *UserUpdateByIDsExpect {
	r.r0 = r0
	return r
}

func (r *UserUpdateByIDsExpect) Do(action func(a0 context.Context, a1 []uint64, a2 map[string]interface{})) *UserUpdateByIDsExpect {
	r.actions = append(r.actions, action)
	return r
}

func (r *UserUpdateByIDsExpect) OutOfOrder() *UserUpdateByIDsExpect {
	r.isOutOfOrder = true
	return r
}

func (r *UserUpdateByIDsExpect) AnyTimes() *UserUpdateByIDsExpect {
	r.isAnyTimes = true
	return r
}

func (r *UserUpdateByIDsExpect) Times(n int) *UserUpdateByIDsExpect {
	r.requiredTimes = n
	return r
}

func (r *UserMock) UpdateByIDs(a0 context.Context, a1 []uint64, a2 map[string]interface{}) (r0 error) {
	if len(r.expect.updateByIDs) == 0 {
		r0 = xerrors.New("cannot find mock method for User.UpdateByIDs")
		return
	}
	for _, exp := range r.expect.updateByIDs {
		if !reflect.DeepEqual(exp.a0, a0) {
			continue
		}
		if len(exp.a1) != len(a1) {
			continue
		}
		if exp.isOutOfOrder {
			isMatched := func() bool {
				for _, exp := range exp.a1 {
					found := false
					for idx, act := range a1 {
						if exp != act {
							continue
						}
						a1 = append(a1[:idx], a1[idx+1:]...)
						found = true
						break
					}
					if !found {
						return false
					}
				}
				return true
			}()
			if !isMatched {
				continue
			}
		} else {
			if !reflect.DeepEqual(exp.a1, a1) {
				continue
			}
		}
		if !reflect.DeepEqual(exp.a2, a2) {
			continue
		}
		for _, action := range exp.actions {
			action(a0, a1, a2)
		}
		if exp.isAnyTimes {
			r0 = exp.r0
			return
		}
		if exp.requiredTimes > 1 && exp.calledTimes > exp.requiredTimes {
			r0 = xerrors.Errorf("invalid call times. requiredTimes: [%d] calledTimes: [%d]", exp.requiredTimes, exp.calledTimes)
			return
		}
		exp.calledTimes++
		r0 = exp.r0
		return
	}
	r0 = xerrors.Errorf("invalid argument User a0:[%+v] a1:[%+v] a2:[%+v]", a0, a1, a2)
	return
}

func (r *UserExpect) UpdateByIDs(a0 context.Context, a1 []uint64, a2 map[string]interface{}) *UserUpdateByIDsExpect {
	exp := &UserUpdateByIDsExpect{
		a0:      a0,
		a1:      a1,
		a2:      a2,
		actions: []func(a0 context.Context, a1 []uint64, a2 map[string]interface{}){},
		expect:  r,
	}
	r.updateByIDs = append(r.updateByIDs, exp)
	return exp
}

type UserDeleteByIDExpect struct {
	expect        *UserExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(a0 context.Context, a1 uint64)
	a0            context.Context
	a1            uint64
	r0            error
}

func (r *UserDeleteByIDExpect) Return(r0 error) *UserDeleteByIDExpect {
	r.r0 = r0
	return r
}

func (r *UserDeleteByIDExpect) Do(action func(a0 context.Context, a1 uint64)) *UserDeleteByIDExpect {
	r.actions = append(r.actions, action)
	return r
}

func (r *UserDeleteByIDExpect) OutOfOrder() *UserDeleteByIDExpect {
	r.isOutOfOrder = true
	return r
}

func (r *UserDeleteByIDExpect) AnyTimes() *UserDeleteByIDExpect {
	r.isAnyTimes = true
	return r
}

func (r *UserDeleteByIDExpect) Times(n int) *UserDeleteByIDExpect {
	r.requiredTimes = n
	return r
}

func (r *UserMock) DeleteByID(a0 context.Context, a1 uint64) (r0 error) {
	if len(r.expect.deleteByID) == 0 {
		r0 = xerrors.New("cannot find mock method for User.DeleteByID")
		return
	}
	for _, exp := range r.expect.deleteByID {
		if !reflect.DeepEqual(exp.a0, a0) {
			continue
		}
		if !reflect.DeepEqual(exp.a1, a1) {
			continue
		}
		for _, action := range exp.actions {
			action(a0, a1)
		}
		if exp.isAnyTimes {
			r0 = exp.r0
			return
		}
		if exp.requiredTimes > 1 && exp.calledTimes > exp.requiredTimes {
			r0 = xerrors.Errorf("invalid call times. requiredTimes: [%d] calledTimes: [%d]", exp.requiredTimes, exp.calledTimes)
			return
		}
		exp.calledTimes++
		r0 = exp.r0
		return
	}
	r0 = xerrors.Errorf("invalid argument User a0:[%+v] a1:[%+v]", a0, a1)
	return
}

func (r *UserExpect) DeleteByID(a0 context.Context, a1 uint64) *UserDeleteByIDExpect {
	exp := &UserDeleteByIDExpect{
		a0:      a0,
		a1:      a1,
		actions: []func(a0 context.Context, a1 uint64){},
		expect:  r,
	}
	r.deleteByID = append(r.deleteByID, exp)
	return exp
}

type UserDeleteByIDsExpect struct {
	expect        *UserExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(a0 context.Context, a1 []uint64)
	a0            context.Context
	a1            []uint64
	r0            error
}

func (r *UserDeleteByIDsExpect) Return(r0 error) *UserDeleteByIDsExpect {
	r.r0 = r0
	return r
}

func (r *UserDeleteByIDsExpect) Do(action func(a0 context.Context, a1 []uint64)) *UserDeleteByIDsExpect {
	r.actions = append(r.actions, action)
	return r
}

func (r *UserDeleteByIDsExpect) OutOfOrder() *UserDeleteByIDsExpect {
	r.isOutOfOrder = true
	return r
}

func (r *UserDeleteByIDsExpect) AnyTimes() *UserDeleteByIDsExpect {
	r.isAnyTimes = true
	return r
}

func (r *UserDeleteByIDsExpect) Times(n int) *UserDeleteByIDsExpect {
	r.requiredTimes = n
	return r
}

func (r *UserMock) DeleteByIDs(a0 context.Context, a1 []uint64) (r0 error) {
	if len(r.expect.deleteByIDs) == 0 {
		r0 = xerrors.New("cannot find mock method for User.DeleteByIDs")
		return
	}
	for _, exp := range r.expect.deleteByIDs {
		if !reflect.DeepEqual(exp.a0, a0) {
			continue
		}
		if len(exp.a1) != len(a1) {
			continue
		}
		if exp.isOutOfOrder {
			isMatched := func() bool {
				for _, exp := range exp.a1 {
					found := false
					for idx, act := range a1 {
						if exp != act {
							continue
						}
						a1 = append(a1[:idx], a1[idx+1:]...)
						found = true
						break
					}
					if !found {
						return false
					}
				}
				return true
			}()
			if !isMatched {
				continue
			}
		} else {
			if !reflect.DeepEqual(exp.a1, a1) {
				continue
			}
		}
		for _, action := range exp.actions {
			action(a0, a1)
		}
		if exp.isAnyTimes {
			r0 = exp.r0
			return
		}
		if exp.requiredTimes > 1 && exp.calledTimes > exp.requiredTimes {
			r0 = xerrors.Errorf("invalid call times. requiredTimes: [%d] calledTimes: [%d]", exp.requiredTimes, exp.calledTimes)
			return
		}
		exp.calledTimes++
		r0 = exp.r0
		return
	}
	r0 = xerrors.Errorf("invalid argument User a0:[%+v] a1:[%+v]", a0, a1)
	return
}

func (r *UserExpect) DeleteByIDs(a0 context.Context, a1 []uint64) *UserDeleteByIDsExpect {
	exp := &UserDeleteByIDsExpect{
		a0:      a0,
		a1:      a1,
		actions: []func(a0 context.Context, a1 []uint64){},
		expect:  r,
	}
	r.deleteByIDs = append(r.deleteByIDs, exp)
	return exp
}

type UserCountExpect struct {
	expect        *UserExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(a0 context.Context)
	a0            context.Context
	r0            int64
	r1            error
}

func (r *UserCountExpect) Return(r0 int64, r1 error) *UserCountExpect {
	r.r0 = r0
	r.r1 = r1
	return r
}

func (r *UserCountExpect) Do(action func(a0 context.Context)) *UserCountExpect {
	r.actions = append(r.actions, action)
	return r
}

func (r *UserCountExpect) OutOfOrder() *UserCountExpect {
	r.isOutOfOrder = true
	return r
}

func (r *UserCountExpect) AnyTimes() *UserCountExpect {
	r.isAnyTimes = true
	return r
}

func (r *UserCountExpect) Times(n int) *UserCountExpect {
	r.requiredTimes = n
	return r
}

func (r *UserMock) Count(a0 context.Context) (r0 int64, r1 error) {
	if len(r.expect.count) == 0 {
		r1 = xerrors.New("cannot find mock method for User.Count")
		return
	}
	for _, exp := range r.expect.count {
		if !reflect.DeepEqual(exp.a0, a0) {
			continue
		}
		for _, action := range exp.actions {
			action(a0)
		}
		if exp.isAnyTimes {
			r0 = exp.r0
			r1 = exp.r1
			return
		}
		if exp.requiredTimes > 1 && exp.calledTimes > exp.requiredTimes {
			r1 = xerrors.Errorf("invalid call times. requiredTimes: [%d] calledTimes: [%d]", exp.requiredTimes, exp.calledTimes)
			return
		}
		exp.calledTimes++
		r0 = exp.r0
		r1 = exp.r1
		return
	}
	r1 = xerrors.Errorf("invalid argument User a0:[%+v]", a0)
	return
}

func (r *UserExpect) Count(a0 context.Context) *UserCountExpect {
	exp := &UserCountExpect{
		a0:      a0,
		actions: []func(a0 context.Context){},
		expect:  r,
	}
	r.count = append(r.count, exp)
	return exp
}

type UserDeleteExpect struct {
	expect        *UserExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(a0 context.Context, a1 *entity.User)
	a0            context.Context
	a1            *entity.User
	r0            error
}

func (r *UserDeleteExpect) Return(r0 error) *UserDeleteExpect {
	r.r0 = r0
	return r
}

func (r *UserDeleteExpect) Do(action func(a0 context.Context, a1 *entity.User)) *UserDeleteExpect {
	r.actions = append(r.actions, action)
	return r
}

func (r *UserDeleteExpect) OutOfOrder() *UserDeleteExpect {
	r.isOutOfOrder = true
	return r
}

func (r *UserDeleteExpect) AnyTimes() *UserDeleteExpect {
	r.isAnyTimes = true
	return r
}

func (r *UserDeleteExpect) Times(n int) *UserDeleteExpect {
	r.requiredTimes = n
	return r
}

func (r *UserMock) Delete(a0 context.Context, a1 *entity.User) (r0 error) {
	if len(r.expect.delete) == 0 {
		r0 = xerrors.New("cannot find mock method for User.Delete")
		return
	}
	for _, exp := range r.expect.delete {
		if !reflect.DeepEqual(exp.a0, a0) {
			continue
		}
		if !reflect.DeepEqual(exp.a1, a1) {
			continue
		}
		for _, action := range exp.actions {
			action(a0, a1)
		}
		if exp.isAnyTimes {
			r0 = exp.r0
			return
		}
		if exp.requiredTimes > 1 && exp.calledTimes > exp.requiredTimes {
			r0 = xerrors.Errorf("invalid call times. requiredTimes: [%d] calledTimes: [%d]", exp.requiredTimes, exp.calledTimes)
			return
		}
		exp.calledTimes++
		r0 = exp.r0
		return
	}
	r0 = xerrors.Errorf("invalid argument User a0:[%+v] a1:[%+v]", a0, a1)
	return
}

func (r *UserExpect) Delete(a0 context.Context, a1 *entity.User) *UserDeleteExpect {
	exp := &UserDeleteExpect{
		a0:      a0,
		a1:      a1,
		actions: []func(a0 context.Context, a1 *entity.User){},
		expect:  r,
	}
	r.delete = append(r.delete, exp)
	return exp
}

type UserUpdateExpect struct {
	expect        *UserExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(a0 context.Context, a1 *entity.User)
	a0            context.Context
	a1            *entity.User
	r0            error
}

func (r *UserUpdateExpect) Return(r0 error) *UserUpdateExpect {
	r.r0 = r0
	return r
}

func (r *UserUpdateExpect) Do(action func(a0 context.Context, a1 *entity.User)) *UserUpdateExpect {
	r.actions = append(r.actions, action)
	return r
}

func (r *UserUpdateExpect) OutOfOrder() *UserUpdateExpect {
	r.isOutOfOrder = true
	return r
}

func (r *UserUpdateExpect) AnyTimes() *UserUpdateExpect {
	r.isAnyTimes = true
	return r
}

func (r *UserUpdateExpect) Times(n int) *UserUpdateExpect {
	r.requiredTimes = n
	return r
}

func (r *UserMock) Update(a0 context.Context, a1 *entity.User) (r0 error) {
	if len(r.expect.update) == 0 {
		r0 = xerrors.New("cannot find mock method for User.Update")
		return
	}
	for _, exp := range r.expect.update {
		if !reflect.DeepEqual(exp.a0, a0) {
			continue
		}
		if !reflect.DeepEqual(exp.a1, a1) {
			continue
		}
		for _, action := range exp.actions {
			action(a0, a1)
		}
		if exp.isAnyTimes {
			r0 = exp.r0
			return
		}
		if exp.requiredTimes > 1 && exp.calledTimes > exp.requiredTimes {
			r0 = xerrors.Errorf("invalid call times. requiredTimes: [%d] calledTimes: [%d]", exp.requiredTimes, exp.calledTimes)
			return
		}
		exp.calledTimes++
		r0 = exp.r0
		return
	}
	r0 = xerrors.Errorf("invalid argument User a0:[%+v] a1:[%+v]", a0, a1)
	return
}

func (r *UserExpect) Update(a0 context.Context, a1 *entity.User) *UserUpdateExpect {
	exp := &UserUpdateExpect{
		a0:      a0,
		a1:      a1,
		actions: []func(a0 context.Context, a1 *entity.User){},
		expect:  r,
	}
	r.update = append(r.update, exp)
	return exp
}

type UserExpect struct {
	toModel     []*UserToModelExpect
	toModels    []*UserToModelsExpect
	create      []*UserCreateExpect
	creates     []*UserCreatesExpect
	findAll     []*UserFindAllExpect
	findByID    []*UserFindByIDExpect
	findByIDs   []*UserFindByIDsExpect
	updateByID  []*UserUpdateByIDExpect
	updateByIDs []*UserUpdateByIDsExpect
	deleteByID  []*UserDeleteByIDExpect
	deleteByIDs []*UserDeleteByIDsExpect
	count       []*UserCountExpect
	delete      []*UserDeleteExpect
	update      []*UserUpdateExpect
}

func NewUserExpect() *UserExpect {
	return &UserExpect{
		count:       []*UserCountExpect{},
		create:      []*UserCreateExpect{},
		creates:     []*UserCreatesExpect{},
		delete:      []*UserDeleteExpect{},
		deleteByID:  []*UserDeleteByIDExpect{},
		deleteByIDs: []*UserDeleteByIDsExpect{},
		findAll:     []*UserFindAllExpect{},
		findByID:    []*UserFindByIDExpect{},
		findByIDs:   []*UserFindByIDsExpect{},
		toModel:     []*UserToModelExpect{},
		toModels:    []*UserToModelsExpect{},
		update:      []*UserUpdateExpect{},
		updateByID:  []*UserUpdateByIDExpect{},
		updateByIDs: []*UserUpdateByIDsExpect{},
	}
}
