// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq

package mocks

import (
	"context"
	"github.com/aliml92/anor"
	"sync"
)

// Ensure, that OrderServiceMock does implement anor.OrderService.
// If this is not the case, regenerate this file with moq.
var _ anor.OrderService = &OrderServiceMock{}

// OrderServiceMock is a mock implementation of anor.OrderService.
//
//	func TestSomethingThatUsesOrderService(t *testing.T) {
//
//		// make and configure a mocked anor.OrderService
//		mockedOrderService := &OrderServiceMock{
//			ConvertCartToOrderFunc: func(ctx context.Context, cart anor.Cart, piID string) (anor.Order, error) {
//				panic("mock out the ConvertCartToOrder method")
//			},
//		}
//
//		// use mockedOrderService in code that requires anor.OrderService
//		// and then make assertions.
//
//	}
type OrderServiceMock struct {
	// ConvertCartToOrderFunc mocks the ConvertCartToOrder method.
	ConvertCartToOrderFunc func(ctx context.Context, cart anor.Cart, piID string) (anor.Order, error)

	// calls tracks calls to the methods.
	calls struct {
		// ConvertCartToOrder holds details about calls to the ConvertCartToOrder method.
		ConvertCartToOrder []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Cart is the cart argument value.
			Cart anor.Cart
			// PiID is the piID argument value.
			PiID string
		}
	}
	lockConvertCartToOrder sync.RWMutex
}

// ConvertCartToOrder calls ConvertCartToOrderFunc.
func (mock *OrderServiceMock) ConvertCartToOrder(ctx context.Context, cart anor.Cart, piID string) (anor.Order, error) {
	if mock.ConvertCartToOrderFunc == nil {
		panic("OrderServiceMock.ConvertCartToOrderFunc: method is nil but OrderService.ConvertCartToOrder was just called")
	}
	callInfo := struct {
		Ctx  context.Context
		Cart anor.Cart
		PiID string
	}{
		Ctx:  ctx,
		Cart: cart,
		PiID: piID,
	}
	mock.lockConvertCartToOrder.Lock()
	mock.calls.ConvertCartToOrder = append(mock.calls.ConvertCartToOrder, callInfo)
	mock.lockConvertCartToOrder.Unlock()
	return mock.ConvertCartToOrderFunc(ctx, cart, piID)
}

// ConvertCartToOrderCalls gets all the calls that were made to ConvertCartToOrder.
// Check the length with:
//
//	len(mockedOrderService.ConvertCartToOrderCalls())
func (mock *OrderServiceMock) ConvertCartToOrderCalls() []struct {
	Ctx  context.Context
	Cart anor.Cart
	PiID string
} {
	var calls []struct {
		Ctx  context.Context
		Cart anor.Cart
		PiID string
	}
	mock.lockConvertCartToOrder.RLock()
	calls = mock.calls.ConvertCartToOrder
	mock.lockConvertCartToOrder.RUnlock()
	return calls
}
