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; }
public void TestPriceAfterDiscountPercentage() { var subPack = new SubscriptionPackage { Id = 1, Duration = 1, Price = 100, DiscountType = DiscountType.Percentage, Discount = 5 }; Assert.Equal(95, subPack.PriceAfterDiscount()); }
public void TestPriceAfterDiscountAmount() { var subPack = new SubscriptionPackage { Id = 1, Duration = 1, Price = 10, DiscountType = DiscountType.Amount, Discount = 5 }; Assert.Equal(5, subPack.PriceAfterDiscount()); }