本文整理汇总了C#中ModelHelper.CreateDataReturnUpload方法的典型用法代码示例。如果您正苦于以下问题:C# ModelHelper.CreateDataReturnUpload方法的具体用法?C# ModelHelper.CreateDataReturnUpload怎么用?C# ModelHelper.CreateDataReturnUpload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelHelper
的用法示例。
在下文中一共展示了ModelHelper.CreateDataReturnUpload方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Get_TwoUploadsForTheSameComplianceYear_OnlyReturnsTheYearOnce
public async void Get_TwoUploadsForTheSameComplianceYear_OnlyReturnsTheYearOnce()
{
using (var database = new DatabaseWrapper())
{
const int complianceYear = 2995;
// Arrange
var modelHelper = new ModelHelper(database.Model);
var organisation = modelHelper.CreateOrganisation();
await database.Model.SaveChangesAsync();
var scheme = modelHelper.CreateScheme(organisation);
await database.Model.SaveChangesAsync();
var firstDataReturn = modelHelper.CreateDataReturn(scheme, complianceYear, (int)QuarterType.Q1);
await database.Model.SaveChangesAsync();
var firstDataReturnVersion = modelHelper.CreateDataReturnVersion(scheme, complianceYear, (int)QuarterType.Q1, true, firstDataReturn);
modelHelper.CreateDataReturnUpload(scheme, firstDataReturnVersion);
await database.Model.SaveChangesAsync();
var secondDataReturn = modelHelper.CreateDataReturn(scheme, complianceYear, (int)QuarterType.Q2);
await database.Model.SaveChangesAsync();
var secondDataReturnVersion = modelHelper.CreateDataReturnVersion(scheme, complianceYear, (int)QuarterType.Q2, true, secondDataReturn);
modelHelper.CreateDataReturnUpload(scheme, secondDataReturnVersion);
await database.Model.SaveChangesAsync();
// Act
var dataAccess = new GetDataReturnsActiveComplianceYearsDataAccess(database.WeeeContext);
var result = await dataAccess.Get();
// Assert
Assert.Single(result.Where(y => y == complianceYear));
}
}
开发者ID:EnvironmentAgency,项目名称:prsd-weee,代码行数:37,代码来源:GetDataReturnsActiveComplianceYearsDataAccessTests.cs