public void Affiliate_Gets_5_Discount_every_100_On_Groceries() { // Arrange Affiliate aff = new Affiliate(); Product prod = new Product(); prod.BillAmount = 310; prod.Category = ProductCategory.Grocery; aff.Product = prod; // Act var netPayable = aff.GetDiscount(aff); // Assert Assert.AreEqual(295, netPayable); }
public void Affiliate_Gets_10_Discount_Non_Groceries() { // Arrange Affiliate aff = new Affiliate(); Product prod = new Product(); prod.BillAmount = 60; prod.Category = ProductCategory.NonGrocery; aff.Product = prod; // Act var netPayable = aff.GetDiscount(aff); // Assert Assert.AreEqual(54, netPayable); }