예제 #1
0
        public override void Given()
        {
            var expectedStage2Response = new List <AssessmentCsvRecordResponse>
            {
                new AssessmentCsvRecordResponse {
                    RowNum = 1, Uln = 1111111111, CoreCode = "12345678", CoreAssessmentEntry = "Summer 2022"
                },
                new AssessmentCsvRecordResponse {
                    RowNum = 2, Uln = 1111111112, SpecialismCode = "LAR12345", SpecialismAssessmentEntry = "Autumn 2023"
                },
                new AssessmentCsvRecordResponse {
                    RowNum = 3, Uln = 1111111113, CoreCode = "12345678", CoreAssessmentEntry = "Summer 2022", SpecialismCode = "LAR12345", SpecialismAssessmentEntry = "Autumn 2023"
                }
            };

            expectedStage3Response = new List <AssessmentRecordResponse>
            {
                new AssessmentRecordResponse {
                    TqRegistrationPathwayId = 1, PathwayAssessmentSeriesId = 11
                },
                new AssessmentRecordResponse {
                    TqRegistrationSpecialismId = 2, SpecialismAssessmentSeriesId = 22
                },
                new AssessmentRecordResponse {
                    TqRegistrationPathwayId = 3, PathwayAssessmentSeriesId = 33, TqRegistrationSpecialismId = 333, SpecialismAssessmentSeriesId = 3333
                }
            };

            var csvResponse = new CsvResponseModel <AssessmentCsvRecordResponse> {
                Rows = expectedStage2Response
            };
            var expectedWriteFileBytes = new byte[5];

            BlobService.DownloadFileAsync(Arg.Any <BlobStorageData>()).Returns(new MemoryStream(Encoding.ASCII.GetBytes("Test File")));
            CsvService.ReadAndParseFileAsync(Arg.Any <AssessmentCsvRecordRequest>()).Returns(csvResponse);
            AssessmentService.ValidateAssessmentsAsync(AoUkprn, Arg.Any <IEnumerable <AssessmentCsvRecordResponse> >()).Returns(expectedStage3Response);
            CsvService.WriteFileAsync(Arg.Any <List <BulkProcessValidationError> >()).Returns(expectedWriteFileBytes);

            var transformationResponse = GetTransformAssessmentsModel();

            AssessmentService.TransformAssessmentsModel(expectedStage3Response, Arg.Any <string>()).Returns(transformationResponse);

            var assessmentsProcessResult = new AssessmentProcessResponse {
                IsSuccess = true
            };

            AssessmentService.CompareAndProcessAssessmentsAsync(transformationResponse.Item1, transformationResponse.Item2).
            Returns(assessmentsProcessResult);
        }
예제 #2
0
 public override Task When()
 {
     _result = AssessmentService.TransformAssessmentsModel(_assessmentRecords, _performedBy);
     return(Task.CompletedTask);
 }