public void Basket_Should_CreateNewBasket_When_BuyerIsGiven() { var basket = new eShop_ApplicationCore.Model.Basket.Basket { BuyerGuid = BuyerId }; Assert.IsNotNull(basket); }
public void Basket_AddItem_Should_AddDistinctSingleItem_When_ItemIsGivenAndQuantityIsNotGiven( int productId, decimal price, int result) { var basket = new eShop_ApplicationCore.Model.Basket.Basket { BuyerGuid = BuyerId }; basket.AddProduct(productId, price); Assert.AreEqual(result, basket.Items.Count); }
public void Basket_RemoveSingleItem_Should_DecreaseProductQuantity_When_ItemQuantityIsMoreThanOne(int productId, decimal price, int quantity) { _testBasket.AddProduct(productId, price, quantity); _testBasket.AddProduct(productId, price, quantity); var basketWithSingleProductWithQuantityEqualsOne = new eShop_ApplicationCore.Model.Basket.Basket { BuyerGuid = BuyerId }; basketWithSingleProductWithQuantityEqualsOne.AddProduct(1, 1, 1); var testProductQuantity = basketWithSingleProductWithQuantityEqualsOne.Items.First().Quantity; _testBasket.RemoveSingleProduct(productId); Assert.AreEqual(testProductQuantity, _testBasket.Items.First().Quantity); }
public void CreteNewEmptyBasket_IsNotNul() { var basket = new eShop_ApplicationCore.Model.Basket.Basket(); Assert.IsNotNull(basket); }