示例#1
0
 public SubscriptionPackageGrid(SubscriptionPackage model)
 {
     this.Id                 = model.Id;
     this.Price              = model.Price;
     this.Discount           = model.Discount;
     this.DiscountType       = model.DiscountType;
     this.PriceAfterDiscount = model.PriceAfterDiscount();
     this.Duration           = model.Duration;
 }
示例#2
0
        public void TestPriceAfterDiscountPercentage()
        {
            var subPack = new SubscriptionPackage
            {
                Id           = 1,
                Duration     = 1,
                Price        = 100,
                DiscountType = DiscountType.Percentage,
                Discount     = 5
            };

            Assert.Equal(95, subPack.PriceAfterDiscount());
        }
示例#3
0
        public void TestPriceAfterDiscountAmount()
        {
            var subPack = new SubscriptionPackage
            {
                Id           = 1,
                Duration     = 1,
                Price        = 10,
                DiscountType = DiscountType.Amount,
                Discount     = 5
            };

            Assert.Equal(5, subPack.PriceAfterDiscount());
        }