// Code generated by eevee. DO NOT EDIT!

package repository

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

	"golang.org/x/xerrors"
)

type WorldMock struct {
	expect *WorldExpect
}

func (r *WorldMock) EXPECT() *WorldExpect {
	return r.expect
}

func NewWorldMock() *WorldMock {
	return &WorldMock{expect: NewWorldExpect()}
}

type WorldToModelExpect struct {
	expect        *WorldExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(value *entity.World)
	value         *entity.World
	r0            *model.World
}

func (r *WorldToModelExpect) Return(r0 *model.World) *WorldToModelExpect {
	r.r0 = r0
	return r
}

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

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

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

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

func (r *WorldMock) ToModel(value *entity.World) (r0 *model.World) {
	if len(r.expect.toModel) == 0 {
		log.Printf("cannot find mock method for World.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 World value:[%+v]", value)
	return
}

func (r *WorldExpect) ToModel(value *entity.World) *WorldToModelExpect {
	exp := &WorldToModelExpect{
		actions: []func(value *entity.World){},
		expect:  r,
		value:   value,
	}
	r.toModel = append(r.toModel, exp)
	return exp
}

type WorldToModelsExpect struct {
	expect        *WorldExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(values entity.Worlds)
	values        entity.Worlds
	r0            *model.Worlds
}

func (r *WorldToModelsExpect) Return(r0 *model.Worlds) *WorldToModelsExpect {
	r.r0 = r0
	return r
}

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

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

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

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

func (r *WorldMock) ToModels(values entity.Worlds) (r0 *model.Worlds) {
	if len(r.expect.toModels) == 0 {
		log.Printf("cannot find mock method for World.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 World values:[%+v]", values)
	return
}

func (r *WorldExpect) ToModels(values entity.Worlds) *WorldToModelsExpect {
	exp := &WorldToModelsExpect{
		actions: []func(values entity.Worlds){},
		expect:  r,
		values:  values,
	}
	r.toModels = append(r.toModels, exp)
	return exp
}

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

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

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

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

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

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

func (r *WorldMock) Create(ctx context.Context, value *entity.World) (r0 *model.World, r1 error) {
	if len(r.expect.create) == 0 {
		r1 = xerrors.New("cannot find mock method for World.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 World ctx:[%+v] value:[%+v]", ctx, value)
	return
}

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

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

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

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

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

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

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

func (r *WorldMock) Creates(ctx context.Context, entities entity.Worlds) (r0 *model.Worlds, r1 error) {
	if len(r.expect.creates) == 0 {
		r1 = xerrors.New("cannot find mock method for World.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 World ctx:[%+v] entities:[%+v]", ctx, entities)
	return
}

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

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

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

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

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

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

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

func (r *WorldMock) FindAll(a0 context.Context) (r0 *model.Worlds, r1 error) {
	if len(r.expect.findAll) == 0 {
		r1 = xerrors.New("cannot find mock method for World.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 World a0:[%+v]", a0)
	return
}

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

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

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

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

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

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

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

func (r *WorldMock) FindByID(a0 context.Context, a1 uint64) (r0 *model.World, r1 error) {
	if len(r.expect.findByID) == 0 {
		r1 = xerrors.New("cannot find mock method for World.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 World a0:[%+v] a1:[%+v]", a0, a1)
	return
}

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

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

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

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

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

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

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

func (r *WorldMock) FindByIDs(a0 context.Context, a1 []uint64) (r0 *model.Worlds, r1 error) {
	if len(r.expect.findByIDs) == 0 {
		r1 = xerrors.New("cannot find mock method for World.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 World a0:[%+v] a1:[%+v]", a0, a1)
	return
}

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

type WorldUpdateByIDExpect struct {
	expect        *WorldExpect
	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 *WorldUpdateByIDExpect) Return(r0 error) *WorldUpdateByIDExpect {
	r.r0 = r0
	return r
}

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

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

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

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

func (r *WorldMock) 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 World.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 World a0:[%+v] a1:[%+v] a2:[%+v]", a0, a1, a2)
	return
}

func (r *WorldExpect) UpdateByID(a0 context.Context, a1 uint64, a2 map[string]interface{}) *WorldUpdateByIDExpect {
	exp := &WorldUpdateByIDExpect{
		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 WorldUpdateByIDsExpect struct {
	expect        *WorldExpect
	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 *WorldUpdateByIDsExpect) Return(r0 error) *WorldUpdateByIDsExpect {
	r.r0 = r0
	return r
}

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

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

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

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

func (r *WorldMock) 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 World.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 World a0:[%+v] a1:[%+v] a2:[%+v]", a0, a1, a2)
	return
}

func (r *WorldExpect) UpdateByIDs(a0 context.Context, a1 []uint64, a2 map[string]interface{}) *WorldUpdateByIDsExpect {
	exp := &WorldUpdateByIDsExpect{
		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 WorldDeleteByIDExpect struct {
	expect        *WorldExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(a0 context.Context, a1 uint64)
	a0            context.Context
	a1            uint64
	r0            error
}

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

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

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

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

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

func (r *WorldMock) DeleteByID(a0 context.Context, a1 uint64) (r0 error) {
	if len(r.expect.deleteByID) == 0 {
		r0 = xerrors.New("cannot find mock method for World.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 World a0:[%+v] a1:[%+v]", a0, a1)
	return
}

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

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

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

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

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

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

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

func (r *WorldMock) DeleteByIDs(a0 context.Context, a1 []uint64) (r0 error) {
	if len(r.expect.deleteByIDs) == 0 {
		r0 = xerrors.New("cannot find mock method for World.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 World a0:[%+v] a1:[%+v]", a0, a1)
	return
}

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

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

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

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

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

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

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

func (r *WorldMock) Count(a0 context.Context) (r0 int64, r1 error) {
	if len(r.expect.count) == 0 {
		r1 = xerrors.New("cannot find mock method for World.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 World a0:[%+v]", a0)
	return
}

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

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

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

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

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

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

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

func (r *WorldMock) Delete(a0 context.Context, a1 *entity.World) (r0 error) {
	if len(r.expect.delete) == 0 {
		r0 = xerrors.New("cannot find mock method for World.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 World a0:[%+v] a1:[%+v]", a0, a1)
	return
}

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

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

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

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

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

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

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

func (r *WorldMock) Update(a0 context.Context, a1 *entity.World) (r0 error) {
	if len(r.expect.update) == 0 {
		r0 = xerrors.New("cannot find mock method for World.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 World a0:[%+v] a1:[%+v]", a0, a1)
	return
}

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

type WorldExpect struct {
	toModel     []*WorldToModelExpect
	toModels    []*WorldToModelsExpect
	create      []*WorldCreateExpect
	creates     []*WorldCreatesExpect
	findAll     []*WorldFindAllExpect
	findByID    []*WorldFindByIDExpect
	findByIDs   []*WorldFindByIDsExpect
	updateByID  []*WorldUpdateByIDExpect
	updateByIDs []*WorldUpdateByIDsExpect
	deleteByID  []*WorldDeleteByIDExpect
	deleteByIDs []*WorldDeleteByIDsExpect
	count       []*WorldCountExpect
	delete      []*WorldDeleteExpect
	update      []*WorldUpdateExpect
}

func NewWorldExpect() *WorldExpect {
	return &WorldExpect{
		count:       []*WorldCountExpect{},
		create:      []*WorldCreateExpect{},
		creates:     []*WorldCreatesExpect{},
		delete:      []*WorldDeleteExpect{},
		deleteByID:  []*WorldDeleteByIDExpect{},
		deleteByIDs: []*WorldDeleteByIDsExpect{},
		findAll:     []*WorldFindAllExpect{},
		findByID:    []*WorldFindByIDExpect{},
		findByIDs:   []*WorldFindByIDsExpect{},
		toModel:     []*WorldToModelExpect{},
		toModels:    []*WorldToModelsExpect{},
		update:      []*WorldUpdateExpect{},
		updateByID:  []*WorldUpdateByIDExpect{},
		updateByIDs: []*WorldUpdateByIDsExpect{},
	}
}
