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

package mocks

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

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

// CartServiceMock is a mock implementation of anor.CartService.
//
//	func TestSomethingThatUsesCartService(t *testing.T) {
//
//		// make and configure a mocked anor.CartService
//		mockedCartService := &CartServiceMock{
//			AddCartItemFunc: func(ctx context.Context, cartID int64, p anor.AddCartItemParams) (anor.CartItem, error) {
//				panic("mock out the AddItem method")
//			},
//			CountCartItemsFunc: func(ctx context.Context, cartID int64) (int64, error) {
//				panic("mock out the CountCartItems method")
//			},
//			CreateCartFunc: func(ctx context.Context, userID int64) (anor.Cart, error) {
//				panic("mock out the CreateCart method")
//			},
//			DeleteCartItemFunc: func(ctx context.Context, cartItemID int64) error {
//				panic("mock out the DeleteItem method")
//			},
//			GetCartFunc: func(ctx context.Context, userID int64, includeCartItems bool) (anor.Cart, error) {
//				panic("mock out the GetCart method")
//			},
//			GetGuestCartItemsFunc: func(ctx context.Context, cartID int64) ([]*anor.CartItem, error) {
//				panic("mock out the GetGuestCartItems method")
//			},
//			IsCartItemOwnerFunc: func(ctx context.Context, userID int64, cartItemId int64) (bool, error) {
//				panic("mock out the IsCartItemOwner method")
//			},
//			IsGuestCartItemOwnerFunc: func(ctx context.Context, cartID int64, cartItemId int64) (bool, error) {
//				panic("mock out the IsGuestCartItemOwner method")
//			},
//			UpdateCartFunc: func(ctx context.Context, c anor.Cart) error {
//				panic("mock out the UpdateCart method")
//			},
//			UpdateCartItemFunc: func(ctx context.Context, cartItemID int64, p anor.UpdateCartItemParams) error {
//				panic("mock out the UpdateItem method")
//			},
//		}
//
//		// use mockedCartService in code that requires anor.CartService
//		// and then make assertions.
//
//	}
type CartServiceMock struct {
	// AddCartItemFunc mocks the AddCartItem method.
	AddCartItemFunc func(ctx context.Context, cartID int64, p anor.AddCartItemParams) (anor.CartItem, error)

	// CountCartItemsFunc mocks the CountCartItems method.
	CountCartItemsFunc func(ctx context.Context, cartID int64) (int64, error)

	// CreateCartFunc mocks the CreateCart method.
	CreateCartFunc func(ctx context.Context, userID int64) (anor.Cart, error)

	// DeleteCartItemFunc mocks the DeleteCartItem method.
	DeleteCartItemFunc func(ctx context.Context, cartItemID int64) error

	// GetCartFunc mocks the GetCart method.
	GetCartFunc func(ctx context.Context, userID int64, includeCartItems bool) (anor.Cart, error)

	// GetGuestCartItemsFunc mocks the GetGuestCartItems method.
	GetGuestCartItemsFunc func(ctx context.Context, cartID int64) ([]*anor.CartItem, error)

	// IsCartItemOwnerFunc mocks the IsCartItemOwner method.
	IsCartItemOwnerFunc func(ctx context.Context, userID int64, cartItemId int64) (bool, error)

	// IsGuestCartItemOwnerFunc mocks the IsGuestCartItemOwner method.
	IsGuestCartItemOwnerFunc func(ctx context.Context, cartID int64, cartItemId int64) (bool, error)

	// UpdateCartFunc mocks the UpdateCart method.
	UpdateCartFunc func(ctx context.Context, c anor.Cart) error

	// UpdateCartItemFunc mocks the UpdateCartItem method.
	UpdateCartItemFunc func(ctx context.Context, cartItemID int64, p anor.UpdateCartItemParams) error

	// calls tracks calls to the methods.
	calls struct {
		// AddCartItem holds details about calls to the AddCartItem method.
		AddCartItem []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// CartID is the cartID argument value.
			CartID int64
			// P is the p argument value.
			P anor.AddCartItemParams
		}
		// CountCartItems holds details about calls to the CountCartItems method.
		CountCartItems []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// CartID is the cartID argument value.
			CartID int64
		}
		// CreateCart holds details about calls to the CreateCart method.
		CreateCart []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// UserID is the userID argument value.
			UserID int64
		}
		// DeleteCartItem holds details about calls to the DeleteCartItem method.
		DeleteCartItem []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// CartItemID is the cartItemID argument value.
			CartItemID int64
		}
		// GetCart holds details about calls to the GetCart method.
		GetCart []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// UserID is the userID argument value.
			UserID int64
			// IncludeCartItems is the includeCartItems argument value.
			IncludeCartItems bool
		}
		// GetGuestCartItems holds details about calls to the GetGuestCartItems method.
		GetGuestCartItems []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// CartID is the cartID argument value.
			CartID int64
		}
		// IsCartItemOwner holds details about calls to the IsCartItemOwner method.
		IsCartItemOwner []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// UserID is the userID argument value.
			UserID int64
			// CartItemId is the cartItemId argument value.
			CartItemId int64
		}
		// IsGuestCartItemOwner holds details about calls to the IsGuestCartItemOwner method.
		IsGuestCartItemOwner []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// CartID is the cartID argument value.
			CartID int64
			// CartItemId is the cartItemId argument value.
			CartItemId int64
		}
		// UpdateCart holds details about calls to the UpdateCart method.
		UpdateCart []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// C is the c argument value.
			C anor.Cart
		}
		// UpdateCartItem holds details about calls to the UpdateCartItem method.
		UpdateCartItem []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// CartItemID is the cartItemID argument value.
			CartItemID int64
			// P is the p argument value.
			P anor.UpdateCartItemParams
		}
	}
	lockAddCartItem          sync.RWMutex
	lockCountCartItems       sync.RWMutex
	lockCreateCart           sync.RWMutex
	lockDeleteCartItem       sync.RWMutex
	lockGetCart              sync.RWMutex
	lockGetGuestCartItems    sync.RWMutex
	lockIsCartItemOwner      sync.RWMutex
	lockIsGuestCartItemOwner sync.RWMutex
	lockUpdateCart           sync.RWMutex
	lockUpdateCartItem       sync.RWMutex
}

// AddCartItem calls AddCartItemFunc.
func (mock *CartServiceMock) AddCartItem(ctx context.Context, cartID int64, p anor.AddCartItemParams) (anor.CartItem, error) {
	if mock.AddCartItemFunc == nil {
		panic("CartServiceMock.AddCartItemFunc: method is nil but CartService.AddItem was just called")
	}
	callInfo := struct {
		Ctx    context.Context
		CartID int64
		P      anor.AddCartItemParams
	}{
		Ctx:    ctx,
		CartID: cartID,
		P:      p,
	}
	mock.lockAddCartItem.Lock()
	mock.calls.AddCartItem = append(mock.calls.AddCartItem, callInfo)
	mock.lockAddCartItem.Unlock()
	return mock.AddCartItemFunc(ctx, cartID, p)
}

// AddCartItemCalls gets all the calls that were made to AddCartItem.
// Check the length with:
//
//	len(mockedCartService.AddCartItemCalls())
func (mock *CartServiceMock) AddCartItemCalls() []struct {
	Ctx    context.Context
	CartID int64
	P      anor.AddCartItemParams
} {
	var calls []struct {
		Ctx    context.Context
		CartID int64
		P      anor.AddCartItemParams
	}
	mock.lockAddCartItem.RLock()
	calls = mock.calls.AddCartItem
	mock.lockAddCartItem.RUnlock()
	return calls
}

// CountCartItems calls CountCartItemsFunc.
func (mock *CartServiceMock) CountCartItems(ctx context.Context, cartID int64) (int64, error) {
	if mock.CountCartItemsFunc == nil {
		panic("CartServiceMock.CountCartItemsFunc: method is nil but CartService.CountCartItems was just called")
	}
	callInfo := struct {
		Ctx    context.Context
		CartID int64
	}{
		Ctx:    ctx,
		CartID: cartID,
	}
	mock.lockCountCartItems.Lock()
	mock.calls.CountCartItems = append(mock.calls.CountCartItems, callInfo)
	mock.lockCountCartItems.Unlock()
	return mock.CountCartItemsFunc(ctx, cartID)
}

// CountCartItemsCalls gets all the calls that were made to CountCartItems.
// Check the length with:
//
//	len(mockedCartService.CountCartItemsCalls())
func (mock *CartServiceMock) CountCartItemsCalls() []struct {
	Ctx    context.Context
	CartID int64
} {
	var calls []struct {
		Ctx    context.Context
		CartID int64
	}
	mock.lockCountCartItems.RLock()
	calls = mock.calls.CountCartItems
	mock.lockCountCartItems.RUnlock()
	return calls
}

// CreateCart calls CreateCartFunc.
func (mock *CartServiceMock) CreateCart(ctx context.Context, userID int64) (anor.Cart, error) {
	if mock.CreateCartFunc == nil {
		panic("CartServiceMock.CreateCartFunc: method is nil but CartService.CreateCart was just called")
	}
	callInfo := struct {
		Ctx    context.Context
		UserID int64
	}{
		Ctx:    ctx,
		UserID: userID,
	}
	mock.lockCreateCart.Lock()
	mock.calls.CreateCart = append(mock.calls.CreateCart, callInfo)
	mock.lockCreateCart.Unlock()
	return mock.CreateCartFunc(ctx, userID)
}

// CreateCartCalls gets all the calls that were made to CreateCart.
// Check the length with:
//
//	len(mockedCartService.CreateCartCalls())
func (mock *CartServiceMock) CreateCartCalls() []struct {
	Ctx    context.Context
	UserID int64
} {
	var calls []struct {
		Ctx    context.Context
		UserID int64
	}
	mock.lockCreateCart.RLock()
	calls = mock.calls.CreateCart
	mock.lockCreateCart.RUnlock()
	return calls
}

// DeleteCartItem calls DeleteCartItemFunc.
func (mock *CartServiceMock) DeleteCartItem(ctx context.Context, cartItemID int64) error {
	if mock.DeleteCartItemFunc == nil {
		panic("CartServiceMock.DeleteCartItemFunc: method is nil but CartService.DeleteItem was just called")
	}
	callInfo := struct {
		Ctx        context.Context
		CartItemID int64
	}{
		Ctx:        ctx,
		CartItemID: cartItemID,
	}
	mock.lockDeleteCartItem.Lock()
	mock.calls.DeleteCartItem = append(mock.calls.DeleteCartItem, callInfo)
	mock.lockDeleteCartItem.Unlock()
	return mock.DeleteCartItemFunc(ctx, cartItemID)
}

// DeleteCartItemCalls gets all the calls that were made to DeleteCartItem.
// Check the length with:
//
//	len(mockedCartService.DeleteCartItemCalls())
func (mock *CartServiceMock) DeleteCartItemCalls() []struct {
	Ctx        context.Context
	CartItemID int64
} {
	var calls []struct {
		Ctx        context.Context
		CartItemID int64
	}
	mock.lockDeleteCartItem.RLock()
	calls = mock.calls.DeleteCartItem
	mock.lockDeleteCartItem.RUnlock()
	return calls
}

// GetCart calls GetCartFunc.
func (mock *CartServiceMock) GetCart(ctx context.Context, userID int64, includeCartItems bool) (anor.Cart, error) {
	if mock.GetCartFunc == nil {
		panic("CartServiceMock.GetCartFunc: method is nil but CartService.GetCart was just called")
	}
	callInfo := struct {
		Ctx              context.Context
		UserID           int64
		IncludeCartItems bool
	}{
		Ctx:              ctx,
		UserID:           userID,
		IncludeCartItems: includeCartItems,
	}
	mock.lockGetCart.Lock()
	mock.calls.GetCart = append(mock.calls.GetCart, callInfo)
	mock.lockGetCart.Unlock()
	return mock.GetCartFunc(ctx, userID, includeCartItems)
}

// GetCartCalls gets all the calls that were made to GetCart.
// Check the length with:
//
//	len(mockedCartService.GetCartCalls())
func (mock *CartServiceMock) GetCartCalls() []struct {
	Ctx              context.Context
	UserID           int64
	IncludeCartItems bool
} {
	var calls []struct {
		Ctx              context.Context
		UserID           int64
		IncludeCartItems bool
	}
	mock.lockGetCart.RLock()
	calls = mock.calls.GetCart
	mock.lockGetCart.RUnlock()
	return calls
}

// GetGuestCartItems calls GetGuestCartItemsFunc.
func (mock *CartServiceMock) GetGuestCartItems(ctx context.Context, cartID int64) ([]*anor.CartItem, error) {
	if mock.GetGuestCartItemsFunc == nil {
		panic("CartServiceMock.GetGuestCartItemsFunc: method is nil but CartService.GetGuestCartItems was just called")
	}
	callInfo := struct {
		Ctx    context.Context
		CartID int64
	}{
		Ctx:    ctx,
		CartID: cartID,
	}
	mock.lockGetGuestCartItems.Lock()
	mock.calls.GetGuestCartItems = append(mock.calls.GetGuestCartItems, callInfo)
	mock.lockGetGuestCartItems.Unlock()
	return mock.GetGuestCartItemsFunc(ctx, cartID)
}

// GetGuestCartItemsCalls gets all the calls that were made to GetGuestCartItems.
// Check the length with:
//
//	len(mockedCartService.GetGuestCartItemsCalls())
func (mock *CartServiceMock) GetGuestCartItemsCalls() []struct {
	Ctx    context.Context
	CartID int64
} {
	var calls []struct {
		Ctx    context.Context
		CartID int64
	}
	mock.lockGetGuestCartItems.RLock()
	calls = mock.calls.GetGuestCartItems
	mock.lockGetGuestCartItems.RUnlock()
	return calls
}

// IsCartItemOwner calls IsCartItemOwnerFunc.
func (mock *CartServiceMock) IsCartItemOwner(ctx context.Context, userID int64, cartItemId int64) (bool, error) {
	if mock.IsCartItemOwnerFunc == nil {
		panic("CartServiceMock.IsCartItemOwnerFunc: method is nil but CartService.IsCartItemOwner was just called")
	}
	callInfo := struct {
		Ctx        context.Context
		UserID     int64
		CartItemId int64
	}{
		Ctx:        ctx,
		UserID:     userID,
		CartItemId: cartItemId,
	}
	mock.lockIsCartItemOwner.Lock()
	mock.calls.IsCartItemOwner = append(mock.calls.IsCartItemOwner, callInfo)
	mock.lockIsCartItemOwner.Unlock()
	return mock.IsCartItemOwnerFunc(ctx, userID, cartItemId)
}

// IsCartItemOwnerCalls gets all the calls that were made to IsCartItemOwner.
// Check the length with:
//
//	len(mockedCartService.IsCartItemOwnerCalls())
func (mock *CartServiceMock) IsCartItemOwnerCalls() []struct {
	Ctx        context.Context
	UserID     int64
	CartItemId int64
} {
	var calls []struct {
		Ctx        context.Context
		UserID     int64
		CartItemId int64
	}
	mock.lockIsCartItemOwner.RLock()
	calls = mock.calls.IsCartItemOwner
	mock.lockIsCartItemOwner.RUnlock()
	return calls
}

// IsGuestCartItemOwner calls IsGuestCartItemOwnerFunc.
func (mock *CartServiceMock) IsGuestCartItemOwner(ctx context.Context, cartID int64, cartItemId int64) (bool, error) {
	if mock.IsGuestCartItemOwnerFunc == nil {
		panic("CartServiceMock.IsGuestCartItemOwnerFunc: method is nil but CartService.IsGuestCartItemOwner was just called")
	}
	callInfo := struct {
		Ctx        context.Context
		CartID     int64
		CartItemId int64
	}{
		Ctx:        ctx,
		CartID:     cartID,
		CartItemId: cartItemId,
	}
	mock.lockIsGuestCartItemOwner.Lock()
	mock.calls.IsGuestCartItemOwner = append(mock.calls.IsGuestCartItemOwner, callInfo)
	mock.lockIsGuestCartItemOwner.Unlock()
	return mock.IsGuestCartItemOwnerFunc(ctx, cartID, cartItemId)
}

// IsGuestCartItemOwnerCalls gets all the calls that were made to IsGuestCartItemOwner.
// Check the length with:
//
//	len(mockedCartService.IsGuestCartItemOwnerCalls())
func (mock *CartServiceMock) IsGuestCartItemOwnerCalls() []struct {
	Ctx        context.Context
	CartID     int64
	CartItemId int64
} {
	var calls []struct {
		Ctx        context.Context
		CartID     int64
		CartItemId int64
	}
	mock.lockIsGuestCartItemOwner.RLock()
	calls = mock.calls.IsGuestCartItemOwner
	mock.lockIsGuestCartItemOwner.RUnlock()
	return calls
}

// UpdateCart calls UpdateCartFunc.
func (mock *CartServiceMock) UpdateCart(ctx context.Context, c anor.Cart) error {
	if mock.UpdateCartFunc == nil {
		panic("CartServiceMock.UpdateCartFunc: method is nil but CartService.UpdateCart was just called")
	}
	callInfo := struct {
		Ctx context.Context
		C   anor.Cart
	}{
		Ctx: ctx,
		C:   c,
	}
	mock.lockUpdateCart.Lock()
	mock.calls.UpdateCart = append(mock.calls.UpdateCart, callInfo)
	mock.lockUpdateCart.Unlock()
	return mock.UpdateCartFunc(ctx, c)
}

// UpdateCartCalls gets all the calls that were made to UpdateCart.
// Check the length with:
//
//	len(mockedCartService.UpdateCartCalls())
func (mock *CartServiceMock) UpdateCartCalls() []struct {
	Ctx context.Context
	C   anor.Cart
} {
	var calls []struct {
		Ctx context.Context
		C   anor.Cart
	}
	mock.lockUpdateCart.RLock()
	calls = mock.calls.UpdateCart
	mock.lockUpdateCart.RUnlock()
	return calls
}

// UpdateCartItem calls UpdateCartItemFunc.
func (mock *CartServiceMock) UpdateCartItem(ctx context.Context, cartItemID int64, p anor.UpdateCartItemParams) error {
	if mock.UpdateCartItemFunc == nil {
		panic("CartServiceMock.UpdateCartItemFunc: method is nil but CartService.UpdateItem was just called")
	}
	callInfo := struct {
		Ctx        context.Context
		CartItemID int64
		P          anor.UpdateCartItemParams
	}{
		Ctx:        ctx,
		CartItemID: cartItemID,
		P:          p,
	}
	mock.lockUpdateCartItem.Lock()
	mock.calls.UpdateCartItem = append(mock.calls.UpdateCartItem, callInfo)
	mock.lockUpdateCartItem.Unlock()
	return mock.UpdateCartItemFunc(ctx, cartItemID, p)
}

// UpdateCartItemCalls gets all the calls that were made to UpdateCartItem.
// Check the length with:
//
//	len(mockedCartService.UpdateCartItemCalls())
func (mock *CartServiceMock) UpdateCartItemCalls() []struct {
	Ctx        context.Context
	CartItemID int64
	P          anor.UpdateCartItemParams
} {
	var calls []struct {
		Ctx        context.Context
		CartItemID int64
		P          anor.UpdateCartItemParams
	}
	mock.lockUpdateCartItem.RLock()
	calls = mock.calls.UpdateCartItem
	mock.lockUpdateCartItem.RUnlock()
	return calls
}
