本文整理汇总了C#中Order.Receipt方法的典型用法代码示例。如果您正苦于以下问题:C# Order.Receipt方法的具体用法?C# Order.Receipt怎么用?C# Order.Receipt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Order
的用法示例。
在下文中一共展示了Order.Receipt方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReceiptOneElite
public void ReceiptOneElite()
{
string ResultStatementOneElite = @"Order Receipt for Anywhere Bike Shop 1 x Specialized Venge Elite = $2,000.00 Sub-Total: $2,000.00 Tax: $145.00 Total: $2,145.00";
var order = new Order("Anywhere Bike Shop");
order.AddLine(new Line(Data.Bikes.Elite, 1));
Assert.AreEqual(ResultStatementOneElite, order.Receipt().Replace(Environment.NewLine, " "));
}
示例2: ReceiptOneDuraAce
public void ReceiptOneDuraAce()
{
string ResultStatementOneDuraAce = @"Order Receipt for Anywhere Bike Shop 1 x Specialized S-Works Venge Dura-Ace = $5,000.00 Sub-Total: $5,000.00 Tax: $362.50 Total: $5,362.50";
var order = new Order("Anywhere Bike Shop");
order.AddLine(new Line(Data.Bikes.DuraAce, 1));
Assert.AreEqual(ResultStatementOneDuraAce, order.Receipt().Replace(Environment.NewLine, " "));
}
示例3: ReceiptOneDefy
public void ReceiptOneDefy()
{
string ResultStatementOneDefy = @"Order Receipt for Anywhere Bike Shop 1 x Giant Defy 1 = $1,000.00 Sub-Total: $1,000.00 Tax: $72.50 Total: $1,072.50";
var order = new Order("Anywhere Bike Shop");
order.AddLine(new Line(Data.Bikes.Defy, 1));
Assert.AreEqual(ResultStatementOneDefy, order.Receipt().Replace(Environment.NewLine, " "));
}
示例4: HtmlReceiptFiveS5Discount
public void HtmlReceiptFiveS5Discount()
{
var company = "Anywhere Bike Shop";
var order = new Order(company);
var quantity = 5;
var testLine = new Line(S5, quantity);
order.AddLine(testLine);
var checkReceiptAgainst =
new HtmlReceipt(new ReceiptData(company,
"$32,000.00",
new TupleList<Line, string> {
{
testLine,
"$32,000.00"
}
},
"$2,320.00",
"$34,320.00")).TransformText();
Assert.AreEqual(checkReceiptAgainst, order.Receipt(Order.Format.HTML));
}
示例5: HtmlReceiptOneDuraAce
public void HtmlReceiptOneDuraAce()
{
var company = "Anywhere Bike Shop";
var order = new Order(company);
var quantity = 1;
var testLine = new Line(DuraAce, quantity);
order.AddLine(testLine);
var checkReceiptAgainst =
new HtmlReceipt(new ReceiptData(company,
"$5,000.00",
new TupleList<Line, string> {
{
testLine,
"$5,000.00"
}
},
"$362.50",
"$5,362.50")).TransformText();
Assert.AreEqual(checkReceiptAgainst, order.Receipt(Order.Format.HTML));
}
示例6: ReceiptOneElite
public void ReceiptOneElite()
{
var company = "Anywhere Bike Shop";
var order = new Order(company);
var quantity = 1;
var testLine = new Line(Elite, quantity);
order.AddLine(testLine);
var checkReceiptAgainst =
new TextReceipt(new ReceiptData(company,
"$2,000.00",
new TupleList<Line, string> {
{
testLine,
"$2,000.00"
}
},
"$145.00",
"$2,145.00")).TransformText();
Assert.AreEqual(checkReceiptAgainst, order.Receipt(Order.Format.Text));
}
示例7: PDFReceiptFiveS5Discount
public void PDFReceiptFiveS5Discount()
{
var company = "Anywhere Bike Shop";
var order = new Order(company);
var quantity = 5;
var testLine = new Line(S5, quantity);
order.AddLine(testLine);
var checkReceiptAgainst =
new PdfReceipt(new ReceiptData(company,
"$32,000.00",
new TupleList<Line, string> {
{
testLine,
"$32,000.00"
}
},
"$2,320.00",
"$34,320.00")).TransformText();
var orderReceipt = order.Receipt(Order.Format.PDF);
var modifiedPresentation_checkReceiptAgainst = IgnorePdfCreationDateAndID(checkReceiptAgainst);
var modifiedPresentation_orderReceipt = IgnorePdfCreationDateAndID(orderReceipt);
// Easily see PDF presentation for testing
File.WriteAllBytes("PDFTest.pdf", Convert.FromBase64String(orderReceipt));
Assert.AreEqual(modifiedPresentation_checkReceiptAgainst, modifiedPresentation_orderReceipt);
}
示例8: ReceiptOneElite
public void ReceiptOneElite()
{
var order = new Order("Anywhere Bike Shop");
order.AddLine(new Line(Elite, 1));
Assert.AreEqual(ResultStatementOneElite, order.Receipt());
}