Exemplo n.º 1
0
        public async Task WhenIGetTheFileForEstateTheFollowingFileInformationIsReturned(string fileName, string estateName, Table table)
        {
            EstateDetails estateDetails = this.TestingContext.GetEstateDetails(estateName);

            Guid fileId = estateDetails.GetFileId(fileName);

            TableRow tableRow            = table.Rows.First();
            Boolean  processingCompleted = SpecflowTableHelper.GetBooleanValue(tableRow, "ProcessingCompleted");
            Int32    numberOfLines       = SpecflowTableHelper.GetIntValue(tableRow, "NumberOfLines");
            Int32    totaLines           = SpecflowTableHelper.GetIntValue(tableRow, "TotaLines");
            Int32    successfulLines     = SpecflowTableHelper.GetIntValue(tableRow, "SuccessfulLines");
            Int32    ignoredLines        = SpecflowTableHelper.GetIntValue(tableRow, "IgnoredLines");
            Int32    failedLines         = SpecflowTableHelper.GetIntValue(tableRow, "FailedLines");
            Int32    notProcessedLines   = SpecflowTableHelper.GetIntValue(tableRow, "NotProcessedLines");

            await Retry.For(async() =>
            {
                var fileDetails = await this.GetFile(estateName, fileId, CancellationToken.None);
                fileDetails.ProcessingCompleted.ShouldBe(processingCompleted);
                fileDetails.FileLines.Count.ShouldBe(numberOfLines);
                fileDetails.ProcessingSummary.TotalLines.ShouldBe(totaLines);
                fileDetails.ProcessingSummary.SuccessfullyProcessedLines.ShouldBe(successfulLines);
                fileDetails.ProcessingSummary.IgnoredLines.ShouldBe(ignoredLines);
                fileDetails.ProcessingSummary.FailedLines.ShouldBe(failedLines);
                fileDetails.ProcessingSummary.NotProcessedLines.ShouldBe(notProcessedLines);
            }, TimeSpan.FromMinutes(4), TimeSpan.FromSeconds(30));
        }
Exemplo n.º 2
0
        public async Task WhenIGetTheImportLogsBetweenAndTheFollowingDataIsReturned(string estateName, string startDate, string endDate, Table table)
        {
            FileImportLogList importLogList = await this.GetFileImportLogList(estateName, startDate, endDate, CancellationToken.None);

            foreach (TableRow tableRow in table.Rows)
            {
                DateTime importLogDateTime = SpecflowTableHelper.GetDateForDateString(SpecflowTableHelper.GetStringRowValue(tableRow, "ImportLogDate"), DateTime.Now);
                Int32    fileCount         = SpecflowTableHelper.GetIntValue(tableRow, "FileCount");

                // Find the import log now
                FileImportLog?importLog = importLogList.FileImportLogs.SingleOrDefault(fil => fil.ImportLogDate == importLogDateTime.Date && fil.FileCount == fileCount);

                importLog.ShouldNotBeNull();
            }
        }
Exemplo n.º 3
0
        public async Task WhenIGetTheFileForEstateTheFollowingFileLinesAreReturned(string fileName, string estateName, Table table)
        {
            EstateDetails estateDetails = this.TestingContext.GetEstateDetails(estateName);

            Guid fileId = estateDetails.GetFileId(fileName);

            var fileDetails = await this.GetFile(estateName, fileId, CancellationToken.None);

            foreach (TableRow tableRow in table.Rows)
            {
                var lineNumber       = SpecflowTableHelper.GetIntValue(tableRow, "LineNumber");
                var lineData         = SpecflowTableHelper.GetStringRowValue(tableRow, "Data");
                var processingResult = SpecflowTableHelper.GetEnumValue <FileLineProcessingResult>(tableRow, "Result");

                var lineToVerify = fileDetails.FileLines.SingleOrDefault(fl => fl.LineNumber == lineNumber);
                lineToVerify.ShouldNotBeNull();
                lineToVerify.LineData.ShouldBe(lineData);
                lineToVerify.ProcessingResult.ShouldBe(processingResult);
            }
        }