public void ProductSellByQuantity_EmptyTest() { // arrange ProductSellByQuantity p = new ProductSellByQuantity(); // act decimal price = p.getPrice(); // assert Assert.AreEqual(0, price); }
public void ProductSellByQuantity_PriceTest() { // arrange ProductSellByQuantity p = new ProductSellByQuantity { productId = 276, productName = "Boxes of Cheerios", unitPrice = 6.99m }; p.addQuantity(2); //act decimal price = p.getPrice(); // assert const decimal expectedPrice = 6.99m * 2; Assert.AreEqual(expectedPrice, price); }