本文整理汇总了C#中ModelHelper.CreateInvoiceRun方法的典型用法代码示例。如果您正苦于以下问题:C# ModelHelper.CreateInvoiceRun方法的具体用法?C# ModelHelper.CreateInvoiceRun怎么用?C# ModelHelper.CreateInvoiceRun使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelHelper
的用法示例。
在下文中一共展示了ModelHelper.CreateInvoiceRun方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute_ReturnsProducers_ForSpecifiedInvoiceRunOnly
public async Task Execute_ReturnsProducers_ForSpecifiedInvoiceRunOnly()
{
using (DatabaseWrapper db = new DatabaseWrapper())
{
ModelHelper helper = new ModelHelper(db.Model);
var scheme = helper.CreateScheme();
var invoiceRun1 = helper.CreateInvoiceRun();
var memberUpload1 = helper.CreateSubmittedMemberUpload(scheme, invoiceRun1);
memberUpload1.ComplianceYear = 2016;
var producer1 = helper.CreateProducerAsCompany(memberUpload1, "PRN123");
producer1.ChargeThisUpdate = 10;
producer1.Invoiced = true;
var invoiceRun2 = helper.CreateInvoiceRun();
var memberUpload2 = helper.CreateSubmittedMemberUpload(scheme, invoiceRun2);
memberUpload2.ComplianceYear = 2016;
var producer2 = helper.CreateProducerAsCompany(memberUpload2, "PRN567");
producer2.ChargeThisUpdate = 10;
producer2.Invoiced = true;
db.Model.SaveChanges();
var result = await db.StoredProcedures.SpgInvoiceRunChargeBreakdown(invoiceRun2.Id);
Assert.Single(result);
Assert.Equal("PRN567", result.Single().PRN);
}
}
示例2: using
public async Task Execute_ReturnsProducers_OrderedBy_SchemeAscending_ThenByComplianceYearDescending_ThenBySubmittedDateAscending()
{
using (DatabaseWrapper db = new DatabaseWrapper())
{
ModelHelper helper = new ModelHelper(db.Model);
var invoiceRun = helper.CreateInvoiceRun();
var scheme1 = helper.CreateScheme();
scheme1.SchemeName = "BBB";
var memberUpload1 = helper.CreateSubmittedMemberUpload(scheme1, invoiceRun);
memberUpload1.ComplianceYear = 2016;
memberUpload1.SubmittedDate = new DateTime(2016, 12, 31);
var producer1 = helper.CreateProducerAsCompany(memberUpload1, "PRN123");
producer1.ChargeThisUpdate = 10;
producer1.Invoiced = true;
var memberUpload2 = helper.CreateSubmittedMemberUpload(scheme1, invoiceRun);
memberUpload2.ComplianceYear = 2015;
memberUpload2.SubmittedDate = new DateTime(2015, 12, 31);
var producer2 = helper.CreateProducerAsCompany(memberUpload2, "PRN987");
producer2.ChargeThisUpdate = 10;
producer2.Invoiced = true;
var memberUpload3 = helper.CreateSubmittedMemberUpload(scheme1, invoiceRun);
memberUpload3.ComplianceYear = 2015;
memberUpload3.SubmittedDate = new DateTime(2015, 01, 01);
var producer3 = helper.CreateProducerAsCompany(memberUpload3, "PRN999");
producer3.ChargeThisUpdate = 10;
producer3.Invoiced = true;
var scheme2 = helper.CreateScheme();
scheme2.SchemeName = "AAA";
var memberUpload4 = helper.CreateSubmittedMemberUpload(scheme2, invoiceRun);
memberUpload4.ComplianceYear = 2017;
memberUpload4.SubmittedDate = new DateTime(2017, 12, 31);
var producer4 = helper.CreateProducerAsCompany(memberUpload4, "PRN567");
producer4.ChargeThisUpdate = 10;
producer4.Invoiced = true;
db.Model.SaveChanges();
var result = await db.StoredProcedures.SpgInvoiceRunChargeBreakdown(invoiceRun.Id);
Assert.Collection(result,
r1 => Assert.Equal("PRN567", r1.PRN),
r2 => Assert.Equal("PRN123", r2.PRN),
r3 => Assert.Equal("PRN999", r3.PRN),
r4 => Assert.Equal("PRN987", r4.PRN));
}
}