private static Product GivenProductIsPromoted() { Product p = new Product(100); p.Price = 80; Time.GoForwardInDays(40); Promoter.SetPromotion(p); // Should assertion be here?? Assert.IsTrue(p.IsRedPencilPromoted); return p; }
public void TwoPromotionsAfterAnother() { // After a red pencil promotion is ended additional red pencil promotions may follow // – as long as the start condition is valid: the price was stable for 30 days // and these 30 days don’t intersect with a previous red pencil promotion. // --> EXAMPLE?? Product p = new Product(100); p.Price = 80; Time.GoForwardInDays(40); Promoter.SetPromotion(p); Assert.IsTrue(p.IsRedPencilPromoted); Time.GoForwardInDays(31); Promoter.SetPromotion(p); Assert.IsFalse(p.IsRedPencilPromoted); p.Price = 70; Time.GoForwardInDays(31); Promoter.SetPromotion(p); Assert.IsTrue(p.IsRedPencilPromoted); }
public void PriceReducedMoreThan40Percent_PromoActive() { Product p = new Product(100); p.Price = 50; Time.GoForwardInDays(40); Promoter.SetPromotion(p); Assert.IsFalse(p.IsRedPencilPromoted); }
public void PriceReducedbyLess5Percent_PromoNotActive() { Product p = new Product(100); p.Price = 99; Time.GoForwardInDays(40); Promoter.SetPromotion(p); Assert.IsFalse(p.IsRedPencilPromoted); }
public void PriceLess30Percent_PromoActive() { Product p = new Product(100); p.Price = 80; Time.GoForwardInDays(40); Promoter.SetPromotion(p); Assert.IsTrue(p.IsRedPencilPromoted); }
public void PreviousPriceNeedsToBeStableMoreThan30Days_PromoNOTActive() { Product p = new Product(100); p.Price = 80; Time.GoForwardInDays(10); Promoter.SetPromotion(p); Assert.IsFalse(p.IsRedPencilPromoted); }