// Code generated by eevee. DO NOT EDIT!

package repository

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

	"golang.org/x/xerrors"
)

type UserFieldMock struct {
	expect *UserFieldExpect
}

func (r *UserFieldMock) EXPECT() *UserFieldExpect {
	return r.expect
}

func NewUserFieldMock() *UserFieldMock {
	return &UserFieldMock{expect: NewUserFieldExpect()}
}

type UserFieldToModelExpect struct {
	expect        *UserFieldExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(value *entity.UserField)
	value         *entity.UserField
	r0            *model.UserField
}

func (r *UserFieldToModelExpect) Return(r0 *model.UserField) *UserFieldToModelExpect {
	r.r0 = r0
	return r
}

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

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

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

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

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

func (r *UserFieldExpect) ToModel(value *entity.UserField) *UserFieldToModelExpect {
	exp := &UserFieldToModelExpect{
		actions: []func(value *entity.UserField){},
		expect:  r,
		value:   value,
	}
	r.toModel = append(r.toModel, exp)
	return exp
}

type UserFieldToModelsExpect struct {
	expect        *UserFieldExpect
	isOutOfOrder  bool
	isAnyTimes    bool
	requiredTimes int
	calledTimes   int
	actions       []func(values entity.UserFields)
	values        entity.UserFields
	r0            *model.UserFields
}

func (r *UserFieldToModelsExpect) Return(r0 *model.UserFields) *UserFieldToModelsExpect {
	r.r0 = r0
	return r
}

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

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

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

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

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

func (r *UserFieldExpect) ToModels(values entity.UserFields) *UserFieldToModelsExpect {
	exp := &UserFieldToModelsExpect{
		actions: []func(values entity.UserFields){},
		expect:  r,
		values:  values,
	}
	r.toModels = append(r.toModels, exp)
	return exp
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

type UserFieldExpect struct {
	toModel  []*UserFieldToModelExpect
	toModels []*UserFieldToModelsExpect
	create   []*UserFieldCreateExpect
	creates  []*UserFieldCreatesExpect
}

func NewUserFieldExpect() *UserFieldExpect {
	return &UserFieldExpect{
		create:   []*UserFieldCreateExpect{},
		creates:  []*UserFieldCreatesExpect{},
		toModel:  []*UserFieldToModelExpect{},
		toModels: []*UserFieldToModelsExpect{},
	}
}
