Пример #1
0
        public async Task ThenSavePublicSectorReport()
        {
            await SetupDatabase();

            _reportSubmittedModel = new ReportSubmitted
            {
                Id                      = 1001,
                DasAccountId            = "EXYZ12",
                DasAccountName          = "DAS Account",
                OrganisationName        = "Organisation",
                ReportingPeriod         = "1718",
                FigureA                 = 20,
                FigureB                 = 15,
                FigureE                 = .75M,
                FigureC                 = 30,
                FigureD                 = 25,
                FigureF                 = 0.3333M,
                FigureG                 = 40,
                FigureH                 = 35,
                FigureI                 = 0.4286M,
                FullTimeEquivalent      = 5,
                OutlineActions          = "Actions",
                OutlineActionsWordCount = 1,
                Challenges              = "Getting things across the line",
                ChallengesWordCount     = 5,
                TargetPlans             = "Do it tomorrow",
                TargetPlansWordCount    = 3,
                AnythingElse            = "No nothing",
                AnythingElseWordCount   = 2,
                SubmittedAt             = DateTime.UtcNow,
                SubmittedName           = "",
                SubmittedEmail          = "",
            };

            PsrsExternalRepositoryMock.Setup(x => x.GetSubmittedReports(It.IsAny <DateTime>()))
            .Returns(Task.FromResult(new List <ReportSubmitted> {
                _reportSubmittedModel
            }.AsEnumerable()));

            await DAS.Data.Functions.Psrs.CreatePsrsSubmittedReportFunction.Run(null, Log, PsrsReportsService);

            var databaseAsExpected = TestHelper.ConditionMet(IsDatabaseInExpectedState, TimeSpan.FromSeconds(60));

            Assert.IsTrue(databaseAsExpected);
        }
Пример #2
0
        public async Task ThenSavePublicSectorSubmissionsSummary()
        {
            await SetupDatabase();

            _reportSubmissionsSummaryModel = new ReportSubmissionsSummary
            {
                ToDate          = DateTime.UtcNow,
                ReportingPeriod = "1718",
                InProcessTotals = 1,
                ViewedTotals    = 2,
                SubmittedTotals = 3,
                Total           = 6,
            };

            PsrsExternalRepositoryMock.Setup(x => x.GetSubmissionsSummary())
            .Returns(Task.FromResult(_reportSubmissionsSummaryModel));

            await DAS.Data.Functions.Psrs.CreatePsrsReportSubmissionsSummaryFunction.Run(null, Log, PsrsReportsService);

            var databaseAsExpected = TestHelper.ConditionMet(IsDatabaseInExpectedState, TimeSpan.FromSeconds(60));

            Assert.IsTrue(databaseAsExpected);
        }