本文整理汇总了C#中ModelHelper.CreateWeeeCollectedReturnVersion方法的典型用法代码示例。如果您正苦于以下问题:C# ModelHelper.CreateWeeeCollectedReturnVersion方法的具体用法?C# ModelHelper.CreateWeeeCollectedReturnVersion怎么用?C# ModelHelper.CreateWeeeCollectedReturnVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelHelper
的用法示例。
在下文中一共展示了ModelHelper.CreateWeeeCollectedReturnVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GivenSomeCollectedWeeeExists_StoredProcedureReturnsThatDataSuccessfully
public async Task GivenSomeCollectedWeeeExists_StoredProcedureReturnsThatDataSuccessfully()
{
const int complianceYear = 1372;
const ObligationType obligationType = ObligationType.B2B;
const int collectedTonnage = 179;
const WeeeCategory category = WeeeCategory.AutomaticDispensers;
const QuarterType quarterType = QuarterType.Q1;
using (var dbWrapper = new DatabaseWrapper())
{
var modelHelper = new ModelHelper(dbWrapper.Model);
var org = modelHelper.CreateOrganisation();
var scheme = modelHelper.CreateScheme(org);
scheme.ObligationType = (int)obligationType;
var weeeCollectedReturnVersion = modelHelper.CreateWeeeCollectedReturnVersion();
modelHelper.CreateDataReturnVersion(scheme, complianceYear, (int)quarterType, true, null, weeeCollectedReturnVersion);
await dbWrapper.Model.SaveChangesAsync();
var weeeCollectedAmount = modelHelper.CreateWeeeCollectedAmount(obligationType, collectedTonnage, category);
modelHelper.CreateWeeeCollectedReturnVersionAmount(weeeCollectedAmount, weeeCollectedReturnVersion);
await dbWrapper.Model.SaveChangesAsync();
var results =
await dbWrapper.StoredProcedures.SpgSchemeWeeeCsvAsync(complianceYear, null, obligationType.ToString());
Assert.NotEmpty(results.CollectedAmounts);
var collectedAmountResult = results.CollectedAmounts.Single(ca => ca.SchemeId == scheme.Id);
Assert.NotNull(collectedAmountResult);
Assert.Equal((int)quarterType, collectedAmountResult.QuarterType);
Assert.Equal(collectedTonnage, collectedAmountResult.Tonnage);
Assert.Equal((int)category, collectedAmountResult.WeeeCategory);
var schemeResult = results.Schemes.Single(s => s.SchemeId == scheme.Id);
Assert.NotNull(schemeResult);
}
}