Adding unit test
This commit is contained in:
@ -11,6 +11,13 @@ namespace drinkMe.Server.Services
|
||||
{
|
||||
public async Task<bool> Pay(PurchaseCart purchaseCart)
|
||||
{
|
||||
if (!purchaseCart.IsPayedWithCash &&
|
||||
(purchaseCart.CreditCardNumber is { Length: 0 } || purchaseCart.CreditCardExpirationYear is { Length: 0 } ||
|
||||
purchaseCart.CreditCardExpirationMonth is { Length: 0 } || purchaseCart.CreditCardCVVCode is { Length: 0 }))
|
||||
return false;
|
||||
|
||||
if (purchaseCart.PurchasingItems.Count == 0)
|
||||
return false;
|
||||
//completing the purchase
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user