本文整理汇总了C#中Order.CalculateOrderPrice方法的典型用法代码示例。如果您正苦于以下问题:C# Order.CalculateOrderPrice方法的具体用法?C# Order.CalculateOrderPrice怎么用?C# Order.CalculateOrderPrice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Order
的用法示例。
在下文中一共展示了Order.CalculateOrderPrice方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateOrderPrice_NoDiscountAndNoTaxes_SumsPrice
public void CalculateOrderPrice_NoDiscountAndNoTaxes_SumsPrice()
{
var order = new Order();
order.AddItem(new Order.OrderItem {Price = 2});
var price = order.CalculateOrderPrice();
Expect(price, Is.EqualTo(2));
}
示例2: CalculateOrderPrice_WithTax_IncludesTax
public void CalculateOrderPrice_WithTax_IncludesTax()
{
var order = new Order {TaxRate = 0.10m};
order.AddItem(new Order.OrderItem {Price = 2});
var price = order.CalculateOrderPrice();
Expect(price, Is.EqualTo(2.2m));
}
示例3: CalculateOrderPrice_Discounted_IncludesDiscount
public void CalculateOrderPrice_Discounted_IncludesDiscount()
{
var order = new Order {DiscountRate = 0.20m};
order.AddItem(new Order.OrderItem {Price = 2});
var price = order.CalculateOrderPrice();
Expect(price, Is.EqualTo(1.6m));
}