예제 #1
0
        public void Then_Returns_Expected_Results()
        {
            BlobService.Received(1).DownloadFileAsync(Arg.Any <BlobStorageData>());
            CsvService.Received(1).ReadAndParseFileAsync(Arg.Any <AssessmentCsvRecordRequest>());
            AssessmentService.Received(1).ValidateAssessmentsAsync(AoUkprn, Arg.Any <IEnumerable <AssessmentCsvRecordResponse> >());

            BlobService.Received(1).MoveFileAsync(Arg.Any <BlobStorageData>());
            DocumentUploadHistoryService.Received(1).CreateDocumentUploadHistory(Arg.Any <DocumentUploadHistoryDetails>());

            Response.IsSuccess.Should().BeTrue();
            Response.ErrorFileSize.Should().Be(0);
            Response.Stats.Should().NotBeNull();
            Response.Stats.TotalRecordsCount.Should().Be(expectedStage3Response.Count);
        }
예제 #2
0
        public void Then_Returns_Expected_Results()
        {
            BlobService.Received(1).DownloadFileAsync(Arg.Any <BlobStorageData>());
            CsvService.Received(1).ReadAndParseFileAsync(Arg.Any <AssessmentCsvRecordRequest>());
            AssessmentService.Received(1).ValidateAssessmentsAsync(AoUkprn, Arg.Is <IEnumerable <AssessmentCsvRecordResponse> >(x => x.All(r => r.IsValid)));
            AssessmentService.DidNotReceive().TransformAssessmentsModel(Arg.Any <IList <AssessmentRecordResponse> >(), Arg.Any <string>());
            CsvService.Received(1).WriteFileAsync(Arg.Any <List <BulkProcessValidationError> >());
            BlobService.Received(1).UploadFromByteArrayAsync(Arg.Any <BlobStorageData>());
            BlobService.Received(1).MoveFileAsync(Arg.Any <BlobStorageData>());
            DocumentUploadHistoryService.Received(1).CreateDocumentUploadHistory(Arg.Any <DocumentUploadHistoryDetails>());

            Response.IsSuccess.Should().BeFalse();
            Response.BlobUniqueReference.Should().Be(BlobUniqueRef);
        }