コード例 #1
0
        [TestFixtureSetUp] public void Context()
        {
            Product   product   = new Product(10);
            Promotion promotion = CreatePromotion.WithDiscountOf(.1m).Starting(DateTime.Now.AddDays(-4)).Ending(DateTime.Now.AddDays(-1));

            _order = CreateOrder.Of(product).On(DateTime.Now).Apply(promotion).In(StateOf.UT);
        }
 [TestFixtureSetUp] public void Context()
 {
     _order = CreateOrder.Of(new Product(10)
     {
         IsLuxuryItem = true
     }).Apply(CreatePromotion.WithDiscountOf(.1m)).In(StateOf.NV);
 }
        [TestFixtureSetUp] public void Context()
        {
            Product   product   = new Product(5);
            Promotion promotion = CreatePromotion.WithDiscountOf(.1m);
            Coupon    coupon    = CreateCoupon.For(product).WithDiscountOf(.2m);

            _order = CreateOrder.Of(product, product).Apply(promotion, coupon).In(StateOf.UT);
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: efarr/Simple-CS-BDD
        private static void Sample5()
        {
            Product luxuryProduct = new Product(10)
            {
                IsLuxuryItem = true
            };
            Product nonLuxuryProduct = new Product(10);
            Order   order            = CreateOrder.Of(luxuryProduct, nonLuxuryProduct).
                                       Apply(CreatePromotion.WithDiscountOf(.1m), CreateCoupon.For(luxuryProduct).WithDiscountOf(.5m)).
                                       In(StateOf.NC);

            DisplayOrder(order, "Order in North Carolina (5% tax rate) with $10 luxury item and $10 non-luxury item and 10% promotion and 50% coupon on luxury item:");
        }
コード例 #5
0
 [TestFixtureSetUp] public void Context()
 {
     _order = CreateOrder.Of(new Product(10)).Apply(CreatePromotion.WithDiscountOf(.5m)).In(StateOf.FL);
 }
コード例 #6
0
ファイル: Program.cs プロジェクト: efarr/Simple-CS-BDD
        private static void Sample1()
        {
            Product luxuryProduct = new Product(10)
            {
                IsLuxuryItem = true
            };
            Product nonLuxuryProduct = new Product(10);
            Order   order            = CreateOrder.Of(luxuryProduct, nonLuxuryProduct).Apply(CreatePromotion.WithDiscountOf(.1m)).In(StateOf.FL);

            DisplayOrder(order, "Order in Florida (5% tax rate) with $10 luxury item and $10 non-luxury item and 10% promotion:");
        }
コード例 #7
0
 [TestFixtureSetUp] public void Context()
 {
     _order = CreateOrder.Of().Apply(CreatePromotion.WithDiscountOf(.1m)).In(StateOf.AR);
 }