// Code generated by http://github.com/gojuno/minimock (v3.4.0). DO NOT EDIT.

package mock

//go:generate minimock -i route256/loms/internal/domain/service.OrderRepository -o order_repository_mock.go -n OrderRepositoryMock -p mock

import (
	"context"
	"route256/loms/internal/domain/entity"
	"sync"
	mm_atomic "sync/atomic"
	mm_time "time"

	"github.com/gojuno/minimock/v3"
)

// OrderRepositoryMock implements mm_service.OrderRepository
type OrderRepositoryMock struct {
	t          minimock.Tester
	finishOnce sync.Once

	funcOrderCreate          func(ctx context.Context, order *entity.Order) (i1 entity.ID, err error)
	funcOrderCreateOrigin    string
	inspectFuncOrderCreate   func(ctx context.Context, order *entity.Order)
	afterOrderCreateCounter  uint64
	beforeOrderCreateCounter uint64
	OrderCreateMock          mOrderRepositoryMockOrderCreate

	funcOrderGetByID          func(ctx context.Context, orderID entity.ID) (op1 *entity.Order, err error)
	funcOrderGetByIDOrigin    string
	inspectFuncOrderGetByID   func(ctx context.Context, orderID entity.ID)
	afterOrderGetByIDCounter  uint64
	beforeOrderGetByIDCounter uint64
	OrderGetByIDMock          mOrderRepositoryMockOrderGetByID

	funcOrderSetStatus          func(ctx context.Context, orderID entity.ID, newStatus string) (err error)
	funcOrderSetStatusOrigin    string
	inspectFuncOrderSetStatus   func(ctx context.Context, orderID entity.ID, newStatus string)
	afterOrderSetStatusCounter  uint64
	beforeOrderSetStatusCounter uint64
	OrderSetStatusMock          mOrderRepositoryMockOrderSetStatus
}

// NewOrderRepositoryMock returns a mock for mm_service.OrderRepository
func NewOrderRepositoryMock(t minimock.Tester) *OrderRepositoryMock {
	m := &OrderRepositoryMock{t: t}

	if controller, ok := t.(minimock.MockController); ok {
		controller.RegisterMocker(m)
	}

	m.OrderCreateMock = mOrderRepositoryMockOrderCreate{mock: m}
	m.OrderCreateMock.callArgs = []*OrderRepositoryMockOrderCreateParams{}

	m.OrderGetByIDMock = mOrderRepositoryMockOrderGetByID{mock: m}
	m.OrderGetByIDMock.callArgs = []*OrderRepositoryMockOrderGetByIDParams{}

	m.OrderSetStatusMock = mOrderRepositoryMockOrderSetStatus{mock: m}
	m.OrderSetStatusMock.callArgs = []*OrderRepositoryMockOrderSetStatusParams{}

	t.Cleanup(m.MinimockFinish)

	return m
}

type mOrderRepositoryMockOrderCreate struct {
	optional           bool
	mock               *OrderRepositoryMock
	defaultExpectation *OrderRepositoryMockOrderCreateExpectation
	expectations       []*OrderRepositoryMockOrderCreateExpectation

	callArgs []*OrderRepositoryMockOrderCreateParams
	mutex    sync.RWMutex

	expectedInvocations       uint64
	expectedInvocationsOrigin string
}

// OrderRepositoryMockOrderCreateExpectation specifies expectation struct of the OrderRepository.OrderCreate
type OrderRepositoryMockOrderCreateExpectation struct {
	mock               *OrderRepositoryMock
	params             *OrderRepositoryMockOrderCreateParams
	paramPtrs          *OrderRepositoryMockOrderCreateParamPtrs
	expectationOrigins OrderRepositoryMockOrderCreateExpectationOrigins
	results            *OrderRepositoryMockOrderCreateResults
	returnOrigin       string
	Counter            uint64
}

// OrderRepositoryMockOrderCreateParams contains parameters of the OrderRepository.OrderCreate
type OrderRepositoryMockOrderCreateParams struct {
	ctx   context.Context
	order *entity.Order
}

// OrderRepositoryMockOrderCreateParamPtrs contains pointers to parameters of the OrderRepository.OrderCreate
type OrderRepositoryMockOrderCreateParamPtrs struct {
	ctx   *context.Context
	order **entity.Order
}

// OrderRepositoryMockOrderCreateResults contains results of the OrderRepository.OrderCreate
type OrderRepositoryMockOrderCreateResults struct {
	i1  entity.ID
	err error
}

// OrderRepositoryMockOrderCreateOrigins contains origins of expectations of the OrderRepository.OrderCreate
type OrderRepositoryMockOrderCreateExpectationOrigins struct {
	origin      string
	originCtx   string
	originOrder string
}

// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning
// the test will fail minimock's automatic final call check if the mocked method was not called at least once.
// Optional() makes method check to work in '0 or more' mode.
// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to
// catch the problems when the expected method call is totally skipped during test run.
func (mmOrderCreate *mOrderRepositoryMockOrderCreate) Optional() *mOrderRepositoryMockOrderCreate {
	mmOrderCreate.optional = true
	return mmOrderCreate
}

// Expect sets up expected params for OrderRepository.OrderCreate
func (mmOrderCreate *mOrderRepositoryMockOrderCreate) Expect(ctx context.Context, order *entity.Order) *mOrderRepositoryMockOrderCreate {
	if mmOrderCreate.mock.funcOrderCreate != nil {
		mmOrderCreate.mock.t.Fatalf("OrderRepositoryMock.OrderCreate mock is already set by Set")
	}

	if mmOrderCreate.defaultExpectation == nil {
		mmOrderCreate.defaultExpectation = &OrderRepositoryMockOrderCreateExpectation{}
	}

	if mmOrderCreate.defaultExpectation.paramPtrs != nil {
		mmOrderCreate.mock.t.Fatalf("OrderRepositoryMock.OrderCreate mock is already set by ExpectParams functions")
	}

	mmOrderCreate.defaultExpectation.params = &OrderRepositoryMockOrderCreateParams{ctx, order}
	mmOrderCreate.defaultExpectation.expectationOrigins.origin = minimock.CallerInfo(1)
	for _, e := range mmOrderCreate.expectations {
		if minimock.Equal(e.params, mmOrderCreate.defaultExpectation.params) {
			mmOrderCreate.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmOrderCreate.defaultExpectation.params)
		}
	}

	return mmOrderCreate
}

// ExpectCtxParam1 sets up expected param ctx for OrderRepository.OrderCreate
func (mmOrderCreate *mOrderRepositoryMockOrderCreate) ExpectCtxParam1(ctx context.Context) *mOrderRepositoryMockOrderCreate {
	if mmOrderCreate.mock.funcOrderCreate != nil {
		mmOrderCreate.mock.t.Fatalf("OrderRepositoryMock.OrderCreate mock is already set by Set")
	}

	if mmOrderCreate.defaultExpectation == nil {
		mmOrderCreate.defaultExpectation = &OrderRepositoryMockOrderCreateExpectation{}
	}

	if mmOrderCreate.defaultExpectation.params != nil {
		mmOrderCreate.mock.t.Fatalf("OrderRepositoryMock.OrderCreate mock is already set by Expect")
	}

	if mmOrderCreate.defaultExpectation.paramPtrs == nil {
		mmOrderCreate.defaultExpectation.paramPtrs = &OrderRepositoryMockOrderCreateParamPtrs{}
	}
	mmOrderCreate.defaultExpectation.paramPtrs.ctx = &ctx
	mmOrderCreate.defaultExpectation.expectationOrigins.originCtx = minimock.CallerInfo(1)

	return mmOrderCreate
}

// ExpectOrderParam2 sets up expected param order for OrderRepository.OrderCreate
func (mmOrderCreate *mOrderRepositoryMockOrderCreate) ExpectOrderParam2(order *entity.Order) *mOrderRepositoryMockOrderCreate {
	if mmOrderCreate.mock.funcOrderCreate != nil {
		mmOrderCreate.mock.t.Fatalf("OrderRepositoryMock.OrderCreate mock is already set by Set")
	}

	if mmOrderCreate.defaultExpectation == nil {
		mmOrderCreate.defaultExpectation = &OrderRepositoryMockOrderCreateExpectation{}
	}

	if mmOrderCreate.defaultExpectation.params != nil {
		mmOrderCreate.mock.t.Fatalf("OrderRepositoryMock.OrderCreate mock is already set by Expect")
	}

	if mmOrderCreate.defaultExpectation.paramPtrs == nil {
		mmOrderCreate.defaultExpectation.paramPtrs = &OrderRepositoryMockOrderCreateParamPtrs{}
	}
	mmOrderCreate.defaultExpectation.paramPtrs.order = &order
	mmOrderCreate.defaultExpectation.expectationOrigins.originOrder = minimock.CallerInfo(1)

	return mmOrderCreate
}

// Inspect accepts an inspector function that has same arguments as the OrderRepository.OrderCreate
func (mmOrderCreate *mOrderRepositoryMockOrderCreate) Inspect(f func(ctx context.Context, order *entity.Order)) *mOrderRepositoryMockOrderCreate {
	if mmOrderCreate.mock.inspectFuncOrderCreate != nil {
		mmOrderCreate.mock.t.Fatalf("Inspect function is already set for OrderRepositoryMock.OrderCreate")
	}

	mmOrderCreate.mock.inspectFuncOrderCreate = f

	return mmOrderCreate
}

// Return sets up results that will be returned by OrderRepository.OrderCreate
func (mmOrderCreate *mOrderRepositoryMockOrderCreate) Return(i1 entity.ID, err error) *OrderRepositoryMock {
	if mmOrderCreate.mock.funcOrderCreate != nil {
		mmOrderCreate.mock.t.Fatalf("OrderRepositoryMock.OrderCreate mock is already set by Set")
	}

	if mmOrderCreate.defaultExpectation == nil {
		mmOrderCreate.defaultExpectation = &OrderRepositoryMockOrderCreateExpectation{mock: mmOrderCreate.mock}
	}
	mmOrderCreate.defaultExpectation.results = &OrderRepositoryMockOrderCreateResults{i1, err}
	mmOrderCreate.defaultExpectation.returnOrigin = minimock.CallerInfo(1)
	return mmOrderCreate.mock
}

// Set uses given function f to mock the OrderRepository.OrderCreate method
func (mmOrderCreate *mOrderRepositoryMockOrderCreate) Set(f func(ctx context.Context, order *entity.Order) (i1 entity.ID, err error)) *OrderRepositoryMock {
	if mmOrderCreate.defaultExpectation != nil {
		mmOrderCreate.mock.t.Fatalf("Default expectation is already set for the OrderRepository.OrderCreate method")
	}

	if len(mmOrderCreate.expectations) > 0 {
		mmOrderCreate.mock.t.Fatalf("Some expectations are already set for the OrderRepository.OrderCreate method")
	}

	mmOrderCreate.mock.funcOrderCreate = f
	mmOrderCreate.mock.funcOrderCreateOrigin = minimock.CallerInfo(1)
	return mmOrderCreate.mock
}

// When sets expectation for the OrderRepository.OrderCreate which will trigger the result defined by the following
// Then helper
func (mmOrderCreate *mOrderRepositoryMockOrderCreate) When(ctx context.Context, order *entity.Order) *OrderRepositoryMockOrderCreateExpectation {
	if mmOrderCreate.mock.funcOrderCreate != nil {
		mmOrderCreate.mock.t.Fatalf("OrderRepositoryMock.OrderCreate mock is already set by Set")
	}

	expectation := &OrderRepositoryMockOrderCreateExpectation{
		mock:               mmOrderCreate.mock,
		params:             &OrderRepositoryMockOrderCreateParams{ctx, order},
		expectationOrigins: OrderRepositoryMockOrderCreateExpectationOrigins{origin: minimock.CallerInfo(1)},
	}
	mmOrderCreate.expectations = append(mmOrderCreate.expectations, expectation)
	return expectation
}

// Then sets up OrderRepository.OrderCreate return parameters for the expectation previously defined by the When method
func (e *OrderRepositoryMockOrderCreateExpectation) Then(i1 entity.ID, err error) *OrderRepositoryMock {
	e.results = &OrderRepositoryMockOrderCreateResults{i1, err}
	return e.mock
}

// Times sets number of times OrderRepository.OrderCreate should be invoked
func (mmOrderCreate *mOrderRepositoryMockOrderCreate) Times(n uint64) *mOrderRepositoryMockOrderCreate {
	if n == 0 {
		mmOrderCreate.mock.t.Fatalf("Times of OrderRepositoryMock.OrderCreate mock can not be zero")
	}
	mm_atomic.StoreUint64(&mmOrderCreate.expectedInvocations, n)
	mmOrderCreate.expectedInvocationsOrigin = minimock.CallerInfo(1)
	return mmOrderCreate
}

func (mmOrderCreate *mOrderRepositoryMockOrderCreate) invocationsDone() bool {
	if len(mmOrderCreate.expectations) == 0 && mmOrderCreate.defaultExpectation == nil && mmOrderCreate.mock.funcOrderCreate == nil {
		return true
	}

	totalInvocations := mm_atomic.LoadUint64(&mmOrderCreate.mock.afterOrderCreateCounter)
	expectedInvocations := mm_atomic.LoadUint64(&mmOrderCreate.expectedInvocations)

	return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations)
}

// OrderCreate implements mm_service.OrderRepository
func (mmOrderCreate *OrderRepositoryMock) OrderCreate(ctx context.Context, order *entity.Order) (i1 entity.ID, err error) {
	mm_atomic.AddUint64(&mmOrderCreate.beforeOrderCreateCounter, 1)
	defer mm_atomic.AddUint64(&mmOrderCreate.afterOrderCreateCounter, 1)

	mmOrderCreate.t.Helper()

	if mmOrderCreate.inspectFuncOrderCreate != nil {
		mmOrderCreate.inspectFuncOrderCreate(ctx, order)
	}

	mm_params := OrderRepositoryMockOrderCreateParams{ctx, order}

	// Record call args
	mmOrderCreate.OrderCreateMock.mutex.Lock()
	mmOrderCreate.OrderCreateMock.callArgs = append(mmOrderCreate.OrderCreateMock.callArgs, &mm_params)
	mmOrderCreate.OrderCreateMock.mutex.Unlock()

	for _, e := range mmOrderCreate.OrderCreateMock.expectations {
		if minimock.Equal(*e.params, mm_params) {
			mm_atomic.AddUint64(&e.Counter, 1)
			return e.results.i1, e.results.err
		}
	}

	if mmOrderCreate.OrderCreateMock.defaultExpectation != nil {
		mm_atomic.AddUint64(&mmOrderCreate.OrderCreateMock.defaultExpectation.Counter, 1)
		mm_want := mmOrderCreate.OrderCreateMock.defaultExpectation.params
		mm_want_ptrs := mmOrderCreate.OrderCreateMock.defaultExpectation.paramPtrs

		mm_got := OrderRepositoryMockOrderCreateParams{ctx, order}

		if mm_want_ptrs != nil {

			if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) {
				mmOrderCreate.t.Errorf("OrderRepositoryMock.OrderCreate got unexpected parameter ctx, expected at\n%s:\nwant: %#v\n got: %#v%s\n",
					mmOrderCreate.OrderCreateMock.defaultExpectation.expectationOrigins.originCtx, *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx))
			}

			if mm_want_ptrs.order != nil && !minimock.Equal(*mm_want_ptrs.order, mm_got.order) {
				mmOrderCreate.t.Errorf("OrderRepositoryMock.OrderCreate got unexpected parameter order, expected at\n%s:\nwant: %#v\n got: %#v%s\n",
					mmOrderCreate.OrderCreateMock.defaultExpectation.expectationOrigins.originOrder, *mm_want_ptrs.order, mm_got.order, minimock.Diff(*mm_want_ptrs.order, mm_got.order))
			}

		} else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
			mmOrderCreate.t.Errorf("OrderRepositoryMock.OrderCreate got unexpected parameters, expected at\n%s:\nwant: %#v\n got: %#v%s\n",
				mmOrderCreate.OrderCreateMock.defaultExpectation.expectationOrigins.origin, *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
		}

		mm_results := mmOrderCreate.OrderCreateMock.defaultExpectation.results
		if mm_results == nil {
			mmOrderCreate.t.Fatal("No results are set for the OrderRepositoryMock.OrderCreate")
		}
		return (*mm_results).i1, (*mm_results).err
	}
	if mmOrderCreate.funcOrderCreate != nil {
		return mmOrderCreate.funcOrderCreate(ctx, order)
	}
	mmOrderCreate.t.Fatalf("Unexpected call to OrderRepositoryMock.OrderCreate. %v %v", ctx, order)
	return
}

// OrderCreateAfterCounter returns a count of finished OrderRepositoryMock.OrderCreate invocations
func (mmOrderCreate *OrderRepositoryMock) OrderCreateAfterCounter() uint64 {
	return mm_atomic.LoadUint64(&mmOrderCreate.afterOrderCreateCounter)
}

// OrderCreateBeforeCounter returns a count of OrderRepositoryMock.OrderCreate invocations
func (mmOrderCreate *OrderRepositoryMock) OrderCreateBeforeCounter() uint64 {
	return mm_atomic.LoadUint64(&mmOrderCreate.beforeOrderCreateCounter)
}

// Calls returns a list of arguments used in each call to OrderRepositoryMock.OrderCreate.
// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
func (mmOrderCreate *mOrderRepositoryMockOrderCreate) Calls() []*OrderRepositoryMockOrderCreateParams {
	mmOrderCreate.mutex.RLock()

	argCopy := make([]*OrderRepositoryMockOrderCreateParams, len(mmOrderCreate.callArgs))
	copy(argCopy, mmOrderCreate.callArgs)

	mmOrderCreate.mutex.RUnlock()

	return argCopy
}

// MinimockOrderCreateDone returns true if the count of the OrderCreate invocations corresponds
// the number of defined expectations
func (m *OrderRepositoryMock) MinimockOrderCreateDone() bool {
	if m.OrderCreateMock.optional {
		// Optional methods provide '0 or more' call count restriction.
		return true
	}

	for _, e := range m.OrderCreateMock.expectations {
		if mm_atomic.LoadUint64(&e.Counter) < 1 {
			return false
		}
	}

	return m.OrderCreateMock.invocationsDone()
}

// MinimockOrderCreateInspect logs each unmet expectation
func (m *OrderRepositoryMock) MinimockOrderCreateInspect() {
	for _, e := range m.OrderCreateMock.expectations {
		if mm_atomic.LoadUint64(&e.Counter) < 1 {
			m.t.Errorf("Expected call to OrderRepositoryMock.OrderCreate at\n%s with params: %#v", e.expectationOrigins.origin, *e.params)
		}
	}

	afterOrderCreateCounter := mm_atomic.LoadUint64(&m.afterOrderCreateCounter)
	// if default expectation was set then invocations count should be greater than zero
	if m.OrderCreateMock.defaultExpectation != nil && afterOrderCreateCounter < 1 {
		if m.OrderCreateMock.defaultExpectation.params == nil {
			m.t.Errorf("Expected call to OrderRepositoryMock.OrderCreate at\n%s", m.OrderCreateMock.defaultExpectation.returnOrigin)
		} else {
			m.t.Errorf("Expected call to OrderRepositoryMock.OrderCreate at\n%s with params: %#v", m.OrderCreateMock.defaultExpectation.expectationOrigins.origin, *m.OrderCreateMock.defaultExpectation.params)
		}
	}
	// if func was set then invocations count should be greater than zero
	if m.funcOrderCreate != nil && afterOrderCreateCounter < 1 {
		m.t.Errorf("Expected call to OrderRepositoryMock.OrderCreate at\n%s", m.funcOrderCreateOrigin)
	}

	if !m.OrderCreateMock.invocationsDone() && afterOrderCreateCounter > 0 {
		m.t.Errorf("Expected %d calls to OrderRepositoryMock.OrderCreate at\n%s but found %d calls",
			mm_atomic.LoadUint64(&m.OrderCreateMock.expectedInvocations), m.OrderCreateMock.expectedInvocationsOrigin, afterOrderCreateCounter)
	}
}

type mOrderRepositoryMockOrderGetByID struct {
	optional           bool
	mock               *OrderRepositoryMock
	defaultExpectation *OrderRepositoryMockOrderGetByIDExpectation
	expectations       []*OrderRepositoryMockOrderGetByIDExpectation

	callArgs []*OrderRepositoryMockOrderGetByIDParams
	mutex    sync.RWMutex

	expectedInvocations       uint64
	expectedInvocationsOrigin string
}

// OrderRepositoryMockOrderGetByIDExpectation specifies expectation struct of the OrderRepository.OrderGetByID
type OrderRepositoryMockOrderGetByIDExpectation struct {
	mock               *OrderRepositoryMock
	params             *OrderRepositoryMockOrderGetByIDParams
	paramPtrs          *OrderRepositoryMockOrderGetByIDParamPtrs
	expectationOrigins OrderRepositoryMockOrderGetByIDExpectationOrigins
	results            *OrderRepositoryMockOrderGetByIDResults
	returnOrigin       string
	Counter            uint64
}

// OrderRepositoryMockOrderGetByIDParams contains parameters of the OrderRepository.OrderGetByID
type OrderRepositoryMockOrderGetByIDParams struct {
	ctx     context.Context
	orderID entity.ID
}

// OrderRepositoryMockOrderGetByIDParamPtrs contains pointers to parameters of the OrderRepository.OrderGetByID
type OrderRepositoryMockOrderGetByIDParamPtrs struct {
	ctx     *context.Context
	orderID *entity.ID
}

// OrderRepositoryMockOrderGetByIDResults contains results of the OrderRepository.OrderGetByID
type OrderRepositoryMockOrderGetByIDResults struct {
	op1 *entity.Order
	err error
}

// OrderRepositoryMockOrderGetByIDOrigins contains origins of expectations of the OrderRepository.OrderGetByID
type OrderRepositoryMockOrderGetByIDExpectationOrigins struct {
	origin        string
	originCtx     string
	originOrderID string
}

// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning
// the test will fail minimock's automatic final call check if the mocked method was not called at least once.
// Optional() makes method check to work in '0 or more' mode.
// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to
// catch the problems when the expected method call is totally skipped during test run.
func (mmOrderGetByID *mOrderRepositoryMockOrderGetByID) Optional() *mOrderRepositoryMockOrderGetByID {
	mmOrderGetByID.optional = true
	return mmOrderGetByID
}

// Expect sets up expected params for OrderRepository.OrderGetByID
func (mmOrderGetByID *mOrderRepositoryMockOrderGetByID) Expect(ctx context.Context, orderID entity.ID) *mOrderRepositoryMockOrderGetByID {
	if mmOrderGetByID.mock.funcOrderGetByID != nil {
		mmOrderGetByID.mock.t.Fatalf("OrderRepositoryMock.OrderGetByID mock is already set by Set")
	}

	if mmOrderGetByID.defaultExpectation == nil {
		mmOrderGetByID.defaultExpectation = &OrderRepositoryMockOrderGetByIDExpectation{}
	}

	if mmOrderGetByID.defaultExpectation.paramPtrs != nil {
		mmOrderGetByID.mock.t.Fatalf("OrderRepositoryMock.OrderGetByID mock is already set by ExpectParams functions")
	}

	mmOrderGetByID.defaultExpectation.params = &OrderRepositoryMockOrderGetByIDParams{ctx, orderID}
	mmOrderGetByID.defaultExpectation.expectationOrigins.origin = minimock.CallerInfo(1)
	for _, e := range mmOrderGetByID.expectations {
		if minimock.Equal(e.params, mmOrderGetByID.defaultExpectation.params) {
			mmOrderGetByID.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmOrderGetByID.defaultExpectation.params)
		}
	}

	return mmOrderGetByID
}

// ExpectCtxParam1 sets up expected param ctx for OrderRepository.OrderGetByID
func (mmOrderGetByID *mOrderRepositoryMockOrderGetByID) ExpectCtxParam1(ctx context.Context) *mOrderRepositoryMockOrderGetByID {
	if mmOrderGetByID.mock.funcOrderGetByID != nil {
		mmOrderGetByID.mock.t.Fatalf("OrderRepositoryMock.OrderGetByID mock is already set by Set")
	}

	if mmOrderGetByID.defaultExpectation == nil {
		mmOrderGetByID.defaultExpectation = &OrderRepositoryMockOrderGetByIDExpectation{}
	}

	if mmOrderGetByID.defaultExpectation.params != nil {
		mmOrderGetByID.mock.t.Fatalf("OrderRepositoryMock.OrderGetByID mock is already set by Expect")
	}

	if mmOrderGetByID.defaultExpectation.paramPtrs == nil {
		mmOrderGetByID.defaultExpectation.paramPtrs = &OrderRepositoryMockOrderGetByIDParamPtrs{}
	}
	mmOrderGetByID.defaultExpectation.paramPtrs.ctx = &ctx
	mmOrderGetByID.defaultExpectation.expectationOrigins.originCtx = minimock.CallerInfo(1)

	return mmOrderGetByID
}

// ExpectOrderIDParam2 sets up expected param orderID for OrderRepository.OrderGetByID
func (mmOrderGetByID *mOrderRepositoryMockOrderGetByID) ExpectOrderIDParam2(orderID entity.ID) *mOrderRepositoryMockOrderGetByID {
	if mmOrderGetByID.mock.funcOrderGetByID != nil {
		mmOrderGetByID.mock.t.Fatalf("OrderRepositoryMock.OrderGetByID mock is already set by Set")
	}

	if mmOrderGetByID.defaultExpectation == nil {
		mmOrderGetByID.defaultExpectation = &OrderRepositoryMockOrderGetByIDExpectation{}
	}

	if mmOrderGetByID.defaultExpectation.params != nil {
		mmOrderGetByID.mock.t.Fatalf("OrderRepositoryMock.OrderGetByID mock is already set by Expect")
	}

	if mmOrderGetByID.defaultExpectation.paramPtrs == nil {
		mmOrderGetByID.defaultExpectation.paramPtrs = &OrderRepositoryMockOrderGetByIDParamPtrs{}
	}
	mmOrderGetByID.defaultExpectation.paramPtrs.orderID = &orderID
	mmOrderGetByID.defaultExpectation.expectationOrigins.originOrderID = minimock.CallerInfo(1)

	return mmOrderGetByID
}

// Inspect accepts an inspector function that has same arguments as the OrderRepository.OrderGetByID
func (mmOrderGetByID *mOrderRepositoryMockOrderGetByID) Inspect(f func(ctx context.Context, orderID entity.ID)) *mOrderRepositoryMockOrderGetByID {
	if mmOrderGetByID.mock.inspectFuncOrderGetByID != nil {
		mmOrderGetByID.mock.t.Fatalf("Inspect function is already set for OrderRepositoryMock.OrderGetByID")
	}

	mmOrderGetByID.mock.inspectFuncOrderGetByID = f

	return mmOrderGetByID
}

// Return sets up results that will be returned by OrderRepository.OrderGetByID
func (mmOrderGetByID *mOrderRepositoryMockOrderGetByID) Return(op1 *entity.Order, err error) *OrderRepositoryMock {
	if mmOrderGetByID.mock.funcOrderGetByID != nil {
		mmOrderGetByID.mock.t.Fatalf("OrderRepositoryMock.OrderGetByID mock is already set by Set")
	}

	if mmOrderGetByID.defaultExpectation == nil {
		mmOrderGetByID.defaultExpectation = &OrderRepositoryMockOrderGetByIDExpectation{mock: mmOrderGetByID.mock}
	}
	mmOrderGetByID.defaultExpectation.results = &OrderRepositoryMockOrderGetByIDResults{op1, err}
	mmOrderGetByID.defaultExpectation.returnOrigin = minimock.CallerInfo(1)
	return mmOrderGetByID.mock
}

// Set uses given function f to mock the OrderRepository.OrderGetByID method
func (mmOrderGetByID *mOrderRepositoryMockOrderGetByID) Set(f func(ctx context.Context, orderID entity.ID) (op1 *entity.Order, err error)) *OrderRepositoryMock {
	if mmOrderGetByID.defaultExpectation != nil {
		mmOrderGetByID.mock.t.Fatalf("Default expectation is already set for the OrderRepository.OrderGetByID method")
	}

	if len(mmOrderGetByID.expectations) > 0 {
		mmOrderGetByID.mock.t.Fatalf("Some expectations are already set for the OrderRepository.OrderGetByID method")
	}

	mmOrderGetByID.mock.funcOrderGetByID = f
	mmOrderGetByID.mock.funcOrderGetByIDOrigin = minimock.CallerInfo(1)
	return mmOrderGetByID.mock
}

// When sets expectation for the OrderRepository.OrderGetByID which will trigger the result defined by the following
// Then helper
func (mmOrderGetByID *mOrderRepositoryMockOrderGetByID) When(ctx context.Context, orderID entity.ID) *OrderRepositoryMockOrderGetByIDExpectation {
	if mmOrderGetByID.mock.funcOrderGetByID != nil {
		mmOrderGetByID.mock.t.Fatalf("OrderRepositoryMock.OrderGetByID mock is already set by Set")
	}

	expectation := &OrderRepositoryMockOrderGetByIDExpectation{
		mock:               mmOrderGetByID.mock,
		params:             &OrderRepositoryMockOrderGetByIDParams{ctx, orderID},
		expectationOrigins: OrderRepositoryMockOrderGetByIDExpectationOrigins{origin: minimock.CallerInfo(1)},
	}
	mmOrderGetByID.expectations = append(mmOrderGetByID.expectations, expectation)
	return expectation
}

// Then sets up OrderRepository.OrderGetByID return parameters for the expectation previously defined by the When method
func (e *OrderRepositoryMockOrderGetByIDExpectation) Then(op1 *entity.Order, err error) *OrderRepositoryMock {
	e.results = &OrderRepositoryMockOrderGetByIDResults{op1, err}
	return e.mock
}

// Times sets number of times OrderRepository.OrderGetByID should be invoked
func (mmOrderGetByID *mOrderRepositoryMockOrderGetByID) Times(n uint64) *mOrderRepositoryMockOrderGetByID {
	if n == 0 {
		mmOrderGetByID.mock.t.Fatalf("Times of OrderRepositoryMock.OrderGetByID mock can not be zero")
	}
	mm_atomic.StoreUint64(&mmOrderGetByID.expectedInvocations, n)
	mmOrderGetByID.expectedInvocationsOrigin = minimock.CallerInfo(1)
	return mmOrderGetByID
}

func (mmOrderGetByID *mOrderRepositoryMockOrderGetByID) invocationsDone() bool {
	if len(mmOrderGetByID.expectations) == 0 && mmOrderGetByID.defaultExpectation == nil && mmOrderGetByID.mock.funcOrderGetByID == nil {
		return true
	}

	totalInvocations := mm_atomic.LoadUint64(&mmOrderGetByID.mock.afterOrderGetByIDCounter)
	expectedInvocations := mm_atomic.LoadUint64(&mmOrderGetByID.expectedInvocations)

	return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations)
}

// OrderGetByID implements mm_service.OrderRepository
func (mmOrderGetByID *OrderRepositoryMock) OrderGetByID(ctx context.Context, orderID entity.ID) (op1 *entity.Order, err error) {
	mm_atomic.AddUint64(&mmOrderGetByID.beforeOrderGetByIDCounter, 1)
	defer mm_atomic.AddUint64(&mmOrderGetByID.afterOrderGetByIDCounter, 1)

	mmOrderGetByID.t.Helper()

	if mmOrderGetByID.inspectFuncOrderGetByID != nil {
		mmOrderGetByID.inspectFuncOrderGetByID(ctx, orderID)
	}

	mm_params := OrderRepositoryMockOrderGetByIDParams{ctx, orderID}

	// Record call args
	mmOrderGetByID.OrderGetByIDMock.mutex.Lock()
	mmOrderGetByID.OrderGetByIDMock.callArgs = append(mmOrderGetByID.OrderGetByIDMock.callArgs, &mm_params)
	mmOrderGetByID.OrderGetByIDMock.mutex.Unlock()

	for _, e := range mmOrderGetByID.OrderGetByIDMock.expectations {
		if minimock.Equal(*e.params, mm_params) {
			mm_atomic.AddUint64(&e.Counter, 1)
			return e.results.op1, e.results.err
		}
	}

	if mmOrderGetByID.OrderGetByIDMock.defaultExpectation != nil {
		mm_atomic.AddUint64(&mmOrderGetByID.OrderGetByIDMock.defaultExpectation.Counter, 1)
		mm_want := mmOrderGetByID.OrderGetByIDMock.defaultExpectation.params
		mm_want_ptrs := mmOrderGetByID.OrderGetByIDMock.defaultExpectation.paramPtrs

		mm_got := OrderRepositoryMockOrderGetByIDParams{ctx, orderID}

		if mm_want_ptrs != nil {

			if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) {
				mmOrderGetByID.t.Errorf("OrderRepositoryMock.OrderGetByID got unexpected parameter ctx, expected at\n%s:\nwant: %#v\n got: %#v%s\n",
					mmOrderGetByID.OrderGetByIDMock.defaultExpectation.expectationOrigins.originCtx, *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx))
			}

			if mm_want_ptrs.orderID != nil && !minimock.Equal(*mm_want_ptrs.orderID, mm_got.orderID) {
				mmOrderGetByID.t.Errorf("OrderRepositoryMock.OrderGetByID got unexpected parameter orderID, expected at\n%s:\nwant: %#v\n got: %#v%s\n",
					mmOrderGetByID.OrderGetByIDMock.defaultExpectation.expectationOrigins.originOrderID, *mm_want_ptrs.orderID, mm_got.orderID, minimock.Diff(*mm_want_ptrs.orderID, mm_got.orderID))
			}

		} else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
			mmOrderGetByID.t.Errorf("OrderRepositoryMock.OrderGetByID got unexpected parameters, expected at\n%s:\nwant: %#v\n got: %#v%s\n",
				mmOrderGetByID.OrderGetByIDMock.defaultExpectation.expectationOrigins.origin, *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
		}

		mm_results := mmOrderGetByID.OrderGetByIDMock.defaultExpectation.results
		if mm_results == nil {
			mmOrderGetByID.t.Fatal("No results are set for the OrderRepositoryMock.OrderGetByID")
		}
		return (*mm_results).op1, (*mm_results).err
	}
	if mmOrderGetByID.funcOrderGetByID != nil {
		return mmOrderGetByID.funcOrderGetByID(ctx, orderID)
	}
	mmOrderGetByID.t.Fatalf("Unexpected call to OrderRepositoryMock.OrderGetByID. %v %v", ctx, orderID)
	return
}

// OrderGetByIDAfterCounter returns a count of finished OrderRepositoryMock.OrderGetByID invocations
func (mmOrderGetByID *OrderRepositoryMock) OrderGetByIDAfterCounter() uint64 {
	return mm_atomic.LoadUint64(&mmOrderGetByID.afterOrderGetByIDCounter)
}

// OrderGetByIDBeforeCounter returns a count of OrderRepositoryMock.OrderGetByID invocations
func (mmOrderGetByID *OrderRepositoryMock) OrderGetByIDBeforeCounter() uint64 {
	return mm_atomic.LoadUint64(&mmOrderGetByID.beforeOrderGetByIDCounter)
}

// Calls returns a list of arguments used in each call to OrderRepositoryMock.OrderGetByID.
// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
func (mmOrderGetByID *mOrderRepositoryMockOrderGetByID) Calls() []*OrderRepositoryMockOrderGetByIDParams {
	mmOrderGetByID.mutex.RLock()

	argCopy := make([]*OrderRepositoryMockOrderGetByIDParams, len(mmOrderGetByID.callArgs))
	copy(argCopy, mmOrderGetByID.callArgs)

	mmOrderGetByID.mutex.RUnlock()

	return argCopy
}

// MinimockOrderGetByIDDone returns true if the count of the OrderGetByID invocations corresponds
// the number of defined expectations
func (m *OrderRepositoryMock) MinimockOrderGetByIDDone() bool {
	if m.OrderGetByIDMock.optional {
		// Optional methods provide '0 or more' call count restriction.
		return true
	}

	for _, e := range m.OrderGetByIDMock.expectations {
		if mm_atomic.LoadUint64(&e.Counter) < 1 {
			return false
		}
	}

	return m.OrderGetByIDMock.invocationsDone()
}

// MinimockOrderGetByIDInspect logs each unmet expectation
func (m *OrderRepositoryMock) MinimockOrderGetByIDInspect() {
	for _, e := range m.OrderGetByIDMock.expectations {
		if mm_atomic.LoadUint64(&e.Counter) < 1 {
			m.t.Errorf("Expected call to OrderRepositoryMock.OrderGetByID at\n%s with params: %#v", e.expectationOrigins.origin, *e.params)
		}
	}

	afterOrderGetByIDCounter := mm_atomic.LoadUint64(&m.afterOrderGetByIDCounter)
	// if default expectation was set then invocations count should be greater than zero
	if m.OrderGetByIDMock.defaultExpectation != nil && afterOrderGetByIDCounter < 1 {
		if m.OrderGetByIDMock.defaultExpectation.params == nil {
			m.t.Errorf("Expected call to OrderRepositoryMock.OrderGetByID at\n%s", m.OrderGetByIDMock.defaultExpectation.returnOrigin)
		} else {
			m.t.Errorf("Expected call to OrderRepositoryMock.OrderGetByID at\n%s with params: %#v", m.OrderGetByIDMock.defaultExpectation.expectationOrigins.origin, *m.OrderGetByIDMock.defaultExpectation.params)
		}
	}
	// if func was set then invocations count should be greater than zero
	if m.funcOrderGetByID != nil && afterOrderGetByIDCounter < 1 {
		m.t.Errorf("Expected call to OrderRepositoryMock.OrderGetByID at\n%s", m.funcOrderGetByIDOrigin)
	}

	if !m.OrderGetByIDMock.invocationsDone() && afterOrderGetByIDCounter > 0 {
		m.t.Errorf("Expected %d calls to OrderRepositoryMock.OrderGetByID at\n%s but found %d calls",
			mm_atomic.LoadUint64(&m.OrderGetByIDMock.expectedInvocations), m.OrderGetByIDMock.expectedInvocationsOrigin, afterOrderGetByIDCounter)
	}
}

type mOrderRepositoryMockOrderSetStatus struct {
	optional           bool
	mock               *OrderRepositoryMock
	defaultExpectation *OrderRepositoryMockOrderSetStatusExpectation
	expectations       []*OrderRepositoryMockOrderSetStatusExpectation

	callArgs []*OrderRepositoryMockOrderSetStatusParams
	mutex    sync.RWMutex

	expectedInvocations       uint64
	expectedInvocationsOrigin string
}

// OrderRepositoryMockOrderSetStatusExpectation specifies expectation struct of the OrderRepository.OrderSetStatus
type OrderRepositoryMockOrderSetStatusExpectation struct {
	mock               *OrderRepositoryMock
	params             *OrderRepositoryMockOrderSetStatusParams
	paramPtrs          *OrderRepositoryMockOrderSetStatusParamPtrs
	expectationOrigins OrderRepositoryMockOrderSetStatusExpectationOrigins
	results            *OrderRepositoryMockOrderSetStatusResults
	returnOrigin       string
	Counter            uint64
}

// OrderRepositoryMockOrderSetStatusParams contains parameters of the OrderRepository.OrderSetStatus
type OrderRepositoryMockOrderSetStatusParams struct {
	ctx       context.Context
	orderID   entity.ID
	newStatus string
}

// OrderRepositoryMockOrderSetStatusParamPtrs contains pointers to parameters of the OrderRepository.OrderSetStatus
type OrderRepositoryMockOrderSetStatusParamPtrs struct {
	ctx       *context.Context
	orderID   *entity.ID
	newStatus *string
}

// OrderRepositoryMockOrderSetStatusResults contains results of the OrderRepository.OrderSetStatus
type OrderRepositoryMockOrderSetStatusResults struct {
	err error
}

// OrderRepositoryMockOrderSetStatusOrigins contains origins of expectations of the OrderRepository.OrderSetStatus
type OrderRepositoryMockOrderSetStatusExpectationOrigins struct {
	origin          string
	originCtx       string
	originOrderID   string
	originNewStatus string
}

// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning
// the test will fail minimock's automatic final call check if the mocked method was not called at least once.
// Optional() makes method check to work in '0 or more' mode.
// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to
// catch the problems when the expected method call is totally skipped during test run.
func (mmOrderSetStatus *mOrderRepositoryMockOrderSetStatus) Optional() *mOrderRepositoryMockOrderSetStatus {
	mmOrderSetStatus.optional = true
	return mmOrderSetStatus
}

// Expect sets up expected params for OrderRepository.OrderSetStatus
func (mmOrderSetStatus *mOrderRepositoryMockOrderSetStatus) Expect(ctx context.Context, orderID entity.ID, newStatus string) *mOrderRepositoryMockOrderSetStatus {
	if mmOrderSetStatus.mock.funcOrderSetStatus != nil {
		mmOrderSetStatus.mock.t.Fatalf("OrderRepositoryMock.OrderSetStatus mock is already set by Set")
	}

	if mmOrderSetStatus.defaultExpectation == nil {
		mmOrderSetStatus.defaultExpectation = &OrderRepositoryMockOrderSetStatusExpectation{}
	}

	if mmOrderSetStatus.defaultExpectation.paramPtrs != nil {
		mmOrderSetStatus.mock.t.Fatalf("OrderRepositoryMock.OrderSetStatus mock is already set by ExpectParams functions")
	}

	mmOrderSetStatus.defaultExpectation.params = &OrderRepositoryMockOrderSetStatusParams{ctx, orderID, newStatus}
	mmOrderSetStatus.defaultExpectation.expectationOrigins.origin = minimock.CallerInfo(1)
	for _, e := range mmOrderSetStatus.expectations {
		if minimock.Equal(e.params, mmOrderSetStatus.defaultExpectation.params) {
			mmOrderSetStatus.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmOrderSetStatus.defaultExpectation.params)
		}
	}

	return mmOrderSetStatus
}

// ExpectCtxParam1 sets up expected param ctx for OrderRepository.OrderSetStatus
func (mmOrderSetStatus *mOrderRepositoryMockOrderSetStatus) ExpectCtxParam1(ctx context.Context) *mOrderRepositoryMockOrderSetStatus {
	if mmOrderSetStatus.mock.funcOrderSetStatus != nil {
		mmOrderSetStatus.mock.t.Fatalf("OrderRepositoryMock.OrderSetStatus mock is already set by Set")
	}

	if mmOrderSetStatus.defaultExpectation == nil {
		mmOrderSetStatus.defaultExpectation = &OrderRepositoryMockOrderSetStatusExpectation{}
	}

	if mmOrderSetStatus.defaultExpectation.params != nil {
		mmOrderSetStatus.mock.t.Fatalf("OrderRepositoryMock.OrderSetStatus mock is already set by Expect")
	}

	if mmOrderSetStatus.defaultExpectation.paramPtrs == nil {
		mmOrderSetStatus.defaultExpectation.paramPtrs = &OrderRepositoryMockOrderSetStatusParamPtrs{}
	}
	mmOrderSetStatus.defaultExpectation.paramPtrs.ctx = &ctx
	mmOrderSetStatus.defaultExpectation.expectationOrigins.originCtx = minimock.CallerInfo(1)

	return mmOrderSetStatus
}

// ExpectOrderIDParam2 sets up expected param orderID for OrderRepository.OrderSetStatus
func (mmOrderSetStatus *mOrderRepositoryMockOrderSetStatus) ExpectOrderIDParam2(orderID entity.ID) *mOrderRepositoryMockOrderSetStatus {
	if mmOrderSetStatus.mock.funcOrderSetStatus != nil {
		mmOrderSetStatus.mock.t.Fatalf("OrderRepositoryMock.OrderSetStatus mock is already set by Set")
	}

	if mmOrderSetStatus.defaultExpectation == nil {
		mmOrderSetStatus.defaultExpectation = &OrderRepositoryMockOrderSetStatusExpectation{}
	}

	if mmOrderSetStatus.defaultExpectation.params != nil {
		mmOrderSetStatus.mock.t.Fatalf("OrderRepositoryMock.OrderSetStatus mock is already set by Expect")
	}

	if mmOrderSetStatus.defaultExpectation.paramPtrs == nil {
		mmOrderSetStatus.defaultExpectation.paramPtrs = &OrderRepositoryMockOrderSetStatusParamPtrs{}
	}
	mmOrderSetStatus.defaultExpectation.paramPtrs.orderID = &orderID
	mmOrderSetStatus.defaultExpectation.expectationOrigins.originOrderID = minimock.CallerInfo(1)

	return mmOrderSetStatus
}

// ExpectNewStatusParam3 sets up expected param newStatus for OrderRepository.OrderSetStatus
func (mmOrderSetStatus *mOrderRepositoryMockOrderSetStatus) ExpectNewStatusParam3(newStatus string) *mOrderRepositoryMockOrderSetStatus {
	if mmOrderSetStatus.mock.funcOrderSetStatus != nil {
		mmOrderSetStatus.mock.t.Fatalf("OrderRepositoryMock.OrderSetStatus mock is already set by Set")
	}

	if mmOrderSetStatus.defaultExpectation == nil {
		mmOrderSetStatus.defaultExpectation = &OrderRepositoryMockOrderSetStatusExpectation{}
	}

	if mmOrderSetStatus.defaultExpectation.params != nil {
		mmOrderSetStatus.mock.t.Fatalf("OrderRepositoryMock.OrderSetStatus mock is already set by Expect")
	}

	if mmOrderSetStatus.defaultExpectation.paramPtrs == nil {
		mmOrderSetStatus.defaultExpectation.paramPtrs = &OrderRepositoryMockOrderSetStatusParamPtrs{}
	}
	mmOrderSetStatus.defaultExpectation.paramPtrs.newStatus = &newStatus
	mmOrderSetStatus.defaultExpectation.expectationOrigins.originNewStatus = minimock.CallerInfo(1)

	return mmOrderSetStatus
}

// Inspect accepts an inspector function that has same arguments as the OrderRepository.OrderSetStatus
func (mmOrderSetStatus *mOrderRepositoryMockOrderSetStatus) Inspect(f func(ctx context.Context, orderID entity.ID, newStatus string)) *mOrderRepositoryMockOrderSetStatus {
	if mmOrderSetStatus.mock.inspectFuncOrderSetStatus != nil {
		mmOrderSetStatus.mock.t.Fatalf("Inspect function is already set for OrderRepositoryMock.OrderSetStatus")
	}

	mmOrderSetStatus.mock.inspectFuncOrderSetStatus = f

	return mmOrderSetStatus
}

// Return sets up results that will be returned by OrderRepository.OrderSetStatus
func (mmOrderSetStatus *mOrderRepositoryMockOrderSetStatus) Return(err error) *OrderRepositoryMock {
	if mmOrderSetStatus.mock.funcOrderSetStatus != nil {
		mmOrderSetStatus.mock.t.Fatalf("OrderRepositoryMock.OrderSetStatus mock is already set by Set")
	}

	if mmOrderSetStatus.defaultExpectation == nil {
		mmOrderSetStatus.defaultExpectation = &OrderRepositoryMockOrderSetStatusExpectation{mock: mmOrderSetStatus.mock}
	}
	mmOrderSetStatus.defaultExpectation.results = &OrderRepositoryMockOrderSetStatusResults{err}
	mmOrderSetStatus.defaultExpectation.returnOrigin = minimock.CallerInfo(1)
	return mmOrderSetStatus.mock
}

// Set uses given function f to mock the OrderRepository.OrderSetStatus method
func (mmOrderSetStatus *mOrderRepositoryMockOrderSetStatus) Set(f func(ctx context.Context, orderID entity.ID, newStatus string) (err error)) *OrderRepositoryMock {
	if mmOrderSetStatus.defaultExpectation != nil {
		mmOrderSetStatus.mock.t.Fatalf("Default expectation is already set for the OrderRepository.OrderSetStatus method")
	}

	if len(mmOrderSetStatus.expectations) > 0 {
		mmOrderSetStatus.mock.t.Fatalf("Some expectations are already set for the OrderRepository.OrderSetStatus method")
	}

	mmOrderSetStatus.mock.funcOrderSetStatus = f
	mmOrderSetStatus.mock.funcOrderSetStatusOrigin = minimock.CallerInfo(1)
	return mmOrderSetStatus.mock
}

// When sets expectation for the OrderRepository.OrderSetStatus which will trigger the result defined by the following
// Then helper
func (mmOrderSetStatus *mOrderRepositoryMockOrderSetStatus) When(ctx context.Context, orderID entity.ID, newStatus string) *OrderRepositoryMockOrderSetStatusExpectation {
	if mmOrderSetStatus.mock.funcOrderSetStatus != nil {
		mmOrderSetStatus.mock.t.Fatalf("OrderRepositoryMock.OrderSetStatus mock is already set by Set")
	}

	expectation := &OrderRepositoryMockOrderSetStatusExpectation{
		mock:               mmOrderSetStatus.mock,
		params:             &OrderRepositoryMockOrderSetStatusParams{ctx, orderID, newStatus},
		expectationOrigins: OrderRepositoryMockOrderSetStatusExpectationOrigins{origin: minimock.CallerInfo(1)},
	}
	mmOrderSetStatus.expectations = append(mmOrderSetStatus.expectations, expectation)
	return expectation
}

// Then sets up OrderRepository.OrderSetStatus return parameters for the expectation previously defined by the When method
func (e *OrderRepositoryMockOrderSetStatusExpectation) Then(err error) *OrderRepositoryMock {
	e.results = &OrderRepositoryMockOrderSetStatusResults{err}
	return e.mock
}

// Times sets number of times OrderRepository.OrderSetStatus should be invoked
func (mmOrderSetStatus *mOrderRepositoryMockOrderSetStatus) Times(n uint64) *mOrderRepositoryMockOrderSetStatus {
	if n == 0 {
		mmOrderSetStatus.mock.t.Fatalf("Times of OrderRepositoryMock.OrderSetStatus mock can not be zero")
	}
	mm_atomic.StoreUint64(&mmOrderSetStatus.expectedInvocations, n)
	mmOrderSetStatus.expectedInvocationsOrigin = minimock.CallerInfo(1)
	return mmOrderSetStatus
}

func (mmOrderSetStatus *mOrderRepositoryMockOrderSetStatus) invocationsDone() bool {
	if len(mmOrderSetStatus.expectations) == 0 && mmOrderSetStatus.defaultExpectation == nil && mmOrderSetStatus.mock.funcOrderSetStatus == nil {
		return true
	}

	totalInvocations := mm_atomic.LoadUint64(&mmOrderSetStatus.mock.afterOrderSetStatusCounter)
	expectedInvocations := mm_atomic.LoadUint64(&mmOrderSetStatus.expectedInvocations)

	return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations)
}

// OrderSetStatus implements mm_service.OrderRepository
func (mmOrderSetStatus *OrderRepositoryMock) OrderSetStatus(ctx context.Context, orderID entity.ID, newStatus string) (err error) {
	mm_atomic.AddUint64(&mmOrderSetStatus.beforeOrderSetStatusCounter, 1)
	defer mm_atomic.AddUint64(&mmOrderSetStatus.afterOrderSetStatusCounter, 1)

	mmOrderSetStatus.t.Helper()

	if mmOrderSetStatus.inspectFuncOrderSetStatus != nil {
		mmOrderSetStatus.inspectFuncOrderSetStatus(ctx, orderID, newStatus)
	}

	mm_params := OrderRepositoryMockOrderSetStatusParams{ctx, orderID, newStatus}

	// Record call args
	mmOrderSetStatus.OrderSetStatusMock.mutex.Lock()
	mmOrderSetStatus.OrderSetStatusMock.callArgs = append(mmOrderSetStatus.OrderSetStatusMock.callArgs, &mm_params)
	mmOrderSetStatus.OrderSetStatusMock.mutex.Unlock()

	for _, e := range mmOrderSetStatus.OrderSetStatusMock.expectations {
		if minimock.Equal(*e.params, mm_params) {
			mm_atomic.AddUint64(&e.Counter, 1)
			return e.results.err
		}
	}

	if mmOrderSetStatus.OrderSetStatusMock.defaultExpectation != nil {
		mm_atomic.AddUint64(&mmOrderSetStatus.OrderSetStatusMock.defaultExpectation.Counter, 1)
		mm_want := mmOrderSetStatus.OrderSetStatusMock.defaultExpectation.params
		mm_want_ptrs := mmOrderSetStatus.OrderSetStatusMock.defaultExpectation.paramPtrs

		mm_got := OrderRepositoryMockOrderSetStatusParams{ctx, orderID, newStatus}

		if mm_want_ptrs != nil {

			if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) {
				mmOrderSetStatus.t.Errorf("OrderRepositoryMock.OrderSetStatus got unexpected parameter ctx, expected at\n%s:\nwant: %#v\n got: %#v%s\n",
					mmOrderSetStatus.OrderSetStatusMock.defaultExpectation.expectationOrigins.originCtx, *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx))
			}

			if mm_want_ptrs.orderID != nil && !minimock.Equal(*mm_want_ptrs.orderID, mm_got.orderID) {
				mmOrderSetStatus.t.Errorf("OrderRepositoryMock.OrderSetStatus got unexpected parameter orderID, expected at\n%s:\nwant: %#v\n got: %#v%s\n",
					mmOrderSetStatus.OrderSetStatusMock.defaultExpectation.expectationOrigins.originOrderID, *mm_want_ptrs.orderID, mm_got.orderID, minimock.Diff(*mm_want_ptrs.orderID, mm_got.orderID))
			}

			if mm_want_ptrs.newStatus != nil && !minimock.Equal(*mm_want_ptrs.newStatus, mm_got.newStatus) {
				mmOrderSetStatus.t.Errorf("OrderRepositoryMock.OrderSetStatus got unexpected parameter newStatus, expected at\n%s:\nwant: %#v\n got: %#v%s\n",
					mmOrderSetStatus.OrderSetStatusMock.defaultExpectation.expectationOrigins.originNewStatus, *mm_want_ptrs.newStatus, mm_got.newStatus, minimock.Diff(*mm_want_ptrs.newStatus, mm_got.newStatus))
			}

		} else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
			mmOrderSetStatus.t.Errorf("OrderRepositoryMock.OrderSetStatus got unexpected parameters, expected at\n%s:\nwant: %#v\n got: %#v%s\n",
				mmOrderSetStatus.OrderSetStatusMock.defaultExpectation.expectationOrigins.origin, *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
		}

		mm_results := mmOrderSetStatus.OrderSetStatusMock.defaultExpectation.results
		if mm_results == nil {
			mmOrderSetStatus.t.Fatal("No results are set for the OrderRepositoryMock.OrderSetStatus")
		}
		return (*mm_results).err
	}
	if mmOrderSetStatus.funcOrderSetStatus != nil {
		return mmOrderSetStatus.funcOrderSetStatus(ctx, orderID, newStatus)
	}
	mmOrderSetStatus.t.Fatalf("Unexpected call to OrderRepositoryMock.OrderSetStatus. %v %v %v", ctx, orderID, newStatus)
	return
}

// OrderSetStatusAfterCounter returns a count of finished OrderRepositoryMock.OrderSetStatus invocations
func (mmOrderSetStatus *OrderRepositoryMock) OrderSetStatusAfterCounter() uint64 {
	return mm_atomic.LoadUint64(&mmOrderSetStatus.afterOrderSetStatusCounter)
}

// OrderSetStatusBeforeCounter returns a count of OrderRepositoryMock.OrderSetStatus invocations
func (mmOrderSetStatus *OrderRepositoryMock) OrderSetStatusBeforeCounter() uint64 {
	return mm_atomic.LoadUint64(&mmOrderSetStatus.beforeOrderSetStatusCounter)
}

// Calls returns a list of arguments used in each call to OrderRepositoryMock.OrderSetStatus.
// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
func (mmOrderSetStatus *mOrderRepositoryMockOrderSetStatus) Calls() []*OrderRepositoryMockOrderSetStatusParams {
	mmOrderSetStatus.mutex.RLock()

	argCopy := make([]*OrderRepositoryMockOrderSetStatusParams, len(mmOrderSetStatus.callArgs))
	copy(argCopy, mmOrderSetStatus.callArgs)

	mmOrderSetStatus.mutex.RUnlock()

	return argCopy
}

// MinimockOrderSetStatusDone returns true if the count of the OrderSetStatus invocations corresponds
// the number of defined expectations
func (m *OrderRepositoryMock) MinimockOrderSetStatusDone() bool {
	if m.OrderSetStatusMock.optional {
		// Optional methods provide '0 or more' call count restriction.
		return true
	}

	for _, e := range m.OrderSetStatusMock.expectations {
		if mm_atomic.LoadUint64(&e.Counter) < 1 {
			return false
		}
	}

	return m.OrderSetStatusMock.invocationsDone()
}

// MinimockOrderSetStatusInspect logs each unmet expectation
func (m *OrderRepositoryMock) MinimockOrderSetStatusInspect() {
	for _, e := range m.OrderSetStatusMock.expectations {
		if mm_atomic.LoadUint64(&e.Counter) < 1 {
			m.t.Errorf("Expected call to OrderRepositoryMock.OrderSetStatus at\n%s with params: %#v", e.expectationOrigins.origin, *e.params)
		}
	}

	afterOrderSetStatusCounter := mm_atomic.LoadUint64(&m.afterOrderSetStatusCounter)
	// if default expectation was set then invocations count should be greater than zero
	if m.OrderSetStatusMock.defaultExpectation != nil && afterOrderSetStatusCounter < 1 {
		if m.OrderSetStatusMock.defaultExpectation.params == nil {
			m.t.Errorf("Expected call to OrderRepositoryMock.OrderSetStatus at\n%s", m.OrderSetStatusMock.defaultExpectation.returnOrigin)
		} else {
			m.t.Errorf("Expected call to OrderRepositoryMock.OrderSetStatus at\n%s with params: %#v", m.OrderSetStatusMock.defaultExpectation.expectationOrigins.origin, *m.OrderSetStatusMock.defaultExpectation.params)
		}
	}
	// if func was set then invocations count should be greater than zero
	if m.funcOrderSetStatus != nil && afterOrderSetStatusCounter < 1 {
		m.t.Errorf("Expected call to OrderRepositoryMock.OrderSetStatus at\n%s", m.funcOrderSetStatusOrigin)
	}

	if !m.OrderSetStatusMock.invocationsDone() && afterOrderSetStatusCounter > 0 {
		m.t.Errorf("Expected %d calls to OrderRepositoryMock.OrderSetStatus at\n%s but found %d calls",
			mm_atomic.LoadUint64(&m.OrderSetStatusMock.expectedInvocations), m.OrderSetStatusMock.expectedInvocationsOrigin, afterOrderSetStatusCounter)
	}
}

// MinimockFinish checks that all mocked methods have been called the expected number of times
func (m *OrderRepositoryMock) MinimockFinish() {
	m.finishOnce.Do(func() {
		if !m.minimockDone() {
			m.MinimockOrderCreateInspect()

			m.MinimockOrderGetByIDInspect()

			m.MinimockOrderSetStatusInspect()
		}
	})
}

// MinimockWait waits for all mocked methods to be called the expected number of times
func (m *OrderRepositoryMock) MinimockWait(timeout mm_time.Duration) {
	timeoutCh := mm_time.After(timeout)
	for {
		if m.minimockDone() {
			return
		}
		select {
		case <-timeoutCh:
			m.MinimockFinish()
			return
		case <-mm_time.After(10 * mm_time.Millisecond):
		}
	}
}

func (m *OrderRepositoryMock) minimockDone() bool {
	done := true
	return done &&
		m.MinimockOrderCreateDone() &&
		m.MinimockOrderGetByIDDone() &&
		m.MinimockOrderSetStatusDone()
}
