当前位置: 首页>>代码示例>>C#>>正文


C# ModelHelper.CreateEeeOutputReturnVersion方法代码示例

本文整理汇总了C#中ModelHelper.CreateEeeOutputReturnVersion方法的典型用法代码示例。如果您正苦于以下问题:C# ModelHelper.CreateEeeOutputReturnVersion方法的具体用法?C# ModelHelper.CreateEeeOutputReturnVersion怎么用?C# ModelHelper.CreateEeeOutputReturnVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ModelHelper的用法示例。


在下文中一共展示了ModelHelper.CreateEeeOutputReturnVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SpgProducerEeeDataHistoryCsvTests_EEEDataHistory_OmitsDataReturnsNotChanged

        public async Task SpgProducerEeeDataHistoryCsvTests_EEEDataHistory_OmitsDataReturnsNotChanged()
        {
            using (DatabaseWrapper db = new DatabaseWrapper())
            {
                //Arrange
                ModelHelper helper = new ModelHelper(db.Model);
                var scheme1 = helper.CreateScheme();
                scheme1.ApprovalNumber = "WEE/TE3334ST/SCH";
                var memberUpload1 = helper.CreateSubmittedMemberUpload(scheme1);
                memberUpload1.ComplianceYear = 2000;

                var producer1 = helper.CreateProducerAsCompany(memberUpload1, "PRN897");
                producer1.ObligationType = "B2B";

                // Create a submission
                EeeOutputAmount eeeOutputAmount1 =
                    helper.CreateEeeOutputAmount(producer1.RegisteredProducer, "B2B", 1, 100);
                EeeOutputReturnVersion eeeOutputReturnVersion1 = helper.CreateEeeOutputReturnVersion();
                helper.AddEeeOutputAmount(eeeOutputReturnVersion1, eeeOutputAmount1);

                var dataReturnVersion1 = helper.CreateDataReturnVersion(scheme1, 2000, 1);
                dataReturnVersion1.SubmittedDate = new DateTime(2015, 1, 1);

                dataReturnVersion1.EeeOutputReturnVersion = eeeOutputReturnVersion1;

                // Create two additional submissions, both having the same data
                // but are different from the first
                EeeOutputAmount eeeOutputAmount2 =
                    helper.CreateEeeOutputAmount(producer1.RegisteredProducer, "B2B", 1, 200);
                EeeOutputReturnVersion eeeOutputReturnVersion2 = helper.CreateEeeOutputReturnVersion();
                helper.AddEeeOutputAmount(eeeOutputReturnVersion2, eeeOutputAmount2);

                var dataReturnVersion2 = helper.CreateDataReturnVersion(scheme1, 2000, 1);
                dataReturnVersion2.SubmittedDate = new DateTime(2015, 1, 2);

                var dataReturnVersion3 = helper.CreateDataReturnVersion(scheme1, 2000, 1);
                dataReturnVersion3.SubmittedDate = new DateTime(2015, 1, 3);

                dataReturnVersion2.EeeOutputReturnVersion = eeeOutputReturnVersion2;
                dataReturnVersion3.EeeOutputReturnVersion = eeeOutputReturnVersion2;

                db.Model.SaveChanges();

                // Act
                var results = await db.StoredProcedures.SpgProducerEeeHistoryCsvData("PRN897");

                //Assert
                Assert.NotNull(results);
                //Only shows entries for tonnage value changes and ignores the ones with no change.
                Assert.Equal(2, results.ProducerReturnsHistoryData.Count);

                Assert.Collection(results.ProducerReturnsHistoryData,
                   (r1) => Assert.Equal(new DateTime(2015, 1, 1), r1.SubmittedDate),
                   (r2) => Assert.Equal(new DateTime(2015, 1, 2), r2.SubmittedDate));

                Assert.Collection(results.ProducerReturnsHistoryData,
                  (r1) => Assert.Equal("No", r1.LatestData),
                  (r2) => Assert.Equal("Yes", r2.LatestData));
            }
        }
开发者ID:EnvironmentAgency,项目名称:prsd-weee,代码行数:60,代码来源:SpgProducerEeeDataHistoryCsvTests.cs


注:本文中的ModelHelper.CreateEeeOutputReturnVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。