예제 #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));
        }
예제 #2
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);
            }
        }