Esempio n. 1
0
            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;
            }
Esempio n. 2
0
            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);
            }
Esempio n. 3
0
            public void PriceReducedMoreThan40Percent_PromoActive()
            {
                Product p = new Product(100);
                p.Price = 50;
                Time.GoForwardInDays(40);
                Promoter.SetPromotion(p);

                Assert.IsFalse(p.IsRedPencilPromoted);
            }
Esempio n. 4
0
            public void PriceReducedbyLess5Percent_PromoNotActive()
            {
                Product p = new Product(100);
                p.Price = 99;
                Time.GoForwardInDays(40);
                Promoter.SetPromotion(p);

                Assert.IsFalse(p.IsRedPencilPromoted);
            }
Esempio n. 5
0
            public void PriceLess30Percent_PromoActive()
            {
                Product p = new Product(100);
                p.Price = 80;
                Time.GoForwardInDays(40);
                Promoter.SetPromotion(p);

                Assert.IsTrue(p.IsRedPencilPromoted);
            }
Esempio n. 6
0
            public void PreviousPriceNeedsToBeStableMoreThan30Days_PromoNOTActive()
            {
                Product p = new Product(100);
                p.Price = 80;
                Time.GoForwardInDays(10);
                Promoter.SetPromotion(p);

                Assert.IsFalse(p.IsRedPencilPromoted);
            }