Esempio n. 1
0
 public void TestProductDiscountWithNullDiscount()
 {
     ProductId prodOneId = new ProductId("1");
     Product prodOne = new Product(prodOneId, 10m);
     decimal discountedPrice = prodOne.DiscountPrice(null);
     Assert.IsTrue(discountedPrice == 10m);
 }
Esempio n. 2
0
 public void TestProductDiscountWithValidDiscountByDate()
 {
     ProductId prodOneId = new ProductId("1");
     Product prodOne = new Product(prodOneId, 10m);
     DiscountByDate discount = new DiscountByDate(.1m, DateTime.Now.AddDays(1));
     decimal discountedPrice = prodOne.DiscountPrice(discount);
     Assert.IsTrue(discountedPrice == 9m);
 }
Esempio n. 3
0
 public void TestProductDiscountWithInvalidDiscount()
 {
     ProductId prodOneId = new ProductId("1");
     Product prodOne = new Product(prodOneId, 10m);
     string notADiscount = "bad discount";
     decimal discountedPrice = prodOne.DiscountPrice(notADiscount);
     Assert.IsTrue(discountedPrice == 10m);
 }