public void ShouldAddAProductToCart()
        {
            Product bread = new Product("Bread", 10.12m);

            Product[] products =
            {
              new Product("Milk", 12.10m)
            };

            ShoppingCart cart = new ShoppingCart(products);
            cart.AddProductToCart(bread);

            Assert.AreEqual(2, cart.GetLength());
        }
예제 #2
0
 public void ShouldReturnThePriceOfTheProduct()
 {
     Product prod = new Product("Milk", 12.10m);
     decimal expected = prod.GetPrice();
     Assert.AreEqual(12.10m, expected);
 }
예제 #3
0
 public void ShouldReturnTheNameOfTheProduct()
 {
     Product prod = new Product("Milk", 12.10m);
     string expected = prod.GetName();
     Assert.AreEqual("Milk", expected);
 }