本文整理汇总了C#中SalesOrderItemBuilder.Confirm方法的典型用法代码示例。如果您正苦于以下问题:C# SalesOrderItemBuilder.Confirm方法的具体用法?C# SalesOrderItemBuilder.Confirm怎么用?C# SalesOrderItemBuilder.Confirm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SalesOrderItemBuilder
的用法示例。
在下文中一共展示了SalesOrderItemBuilder.Confirm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GivenOrderItemForGood1WithRequiredMarkupPercentage_WhenDerivingPrices_ThenCalculateActualUnitPrice
public void GivenOrderItemForGood1WithRequiredMarkupPercentage_WhenDerivingPrices_ThenCalculateActualUnitPrice()
{
this.InstantiateObjects(this.DatabaseSession);
var item1 = new SalesOrderItemBuilder(this.DatabaseSession).WithProduct(this.good).WithQuantityOrdered(3).WithRequiredMarkupPercentage(45).Build();
this.order.AddSalesOrderItem(item1);
item1.Confirm();
this.DatabaseSession.Derive(true);
Assert.AreEqual(10.15M, item1.ActualUnitPrice);
Assert.AreEqual(10M, item1.UnitBasePrice);
Assert.AreEqual(0, item1.UnitDiscount);
Assert.AreEqual(0, item1.UnitSurcharge);
Assert.AreEqual(10.15M, item1.CalculatedUnitPrice);
Assert.AreEqual(2.13, item1.UnitVat);
Assert.AreEqual(30.45M, item1.TotalBasePrice);
Assert.AreEqual(0, item1.TotalDiscount);
Assert.AreEqual(0, item1.TotalSurcharge);
Assert.AreEqual(30.45M, item1.TotalExVat);
Assert.AreEqual(6.39M, item1.TotalVat);
Assert.AreEqual(36.84M, item1.TotalIncVat);
Assert.AreEqual(7, item1.UnitPurchasePrice);
Assert.AreEqual(decimal.Round(((item1.UnitBasePrice / this.goodPurchasePrice.Price) - 1) * 100, 2), item1.InitialMarkupPercentage);
Assert.AreEqual(decimal.Round(((item1.CalculatedUnitPrice / this.goodPurchasePrice.Price) - 1) * 100, 2), item1.MaintainedMarkupPercentage);
Assert.AreEqual(decimal.Round(((item1.UnitBasePrice - this.goodPurchasePrice.Price) / item1.UnitBasePrice) * 100, 2), item1.InitialProfitMargin);
Assert.AreEqual(decimal.Round(((item1.CalculatedUnitPrice - this.goodPurchasePrice.Price) / item1.CalculatedUnitPrice) * 100, 2), item1.MaintainedProfitMargin);
Assert.AreEqual(30.45M, this.order.TotalBasePrice);
Assert.AreEqual(0, this.order.TotalDiscount);
Assert.AreEqual(0, this.order.TotalSurcharge);
Assert.AreEqual(30.45M, this.order.TotalExVat);
Assert.AreEqual(6.39M, this.order.TotalVat);
Assert.AreEqual(36.84M, this.order.TotalIncVat);
Assert.AreEqual(10.15M, this.order.TotalListPrice);
Assert.AreEqual(7, this.order.TotalPurchasePrice);
}