public override void Given() { InputFileContent = GetInputFilecontent(); var failures = new List <ValidationFailure>(); expectedRow = new RegistrationCsvRecordResponse { RowNum = 1, Uln = 123, FirstName = "F name", LastName = "L name", DateOfBirth = new DateTime(2000, 1, 1), ProviderUkprn = 1234, CoreCode = "989", AcademicYear = 2020, SpecialismCodes = new List <string> { "spl1" } }; var regCsvResponse = new ValidationResult(failures); RegValidator.ValidateAsync(Arg.Any <RegistrationCsvRecordRequest>()).Returns(regCsvResponse); DataParser.ParseRow(Arg.Any <RegistrationCsvRecordRequest>(), Arg.Any <int>()).Returns(expectedRow); }
public override void Given() { InputFileContent = GetInputFilecontent(); var errorMessage = string.Format(ValidationMessages.MustHaveDigitsWithLength, ResultFluentHeader.CoreCode, 8); var failures = new List <ValidationFailure> { new ValidationFailure(ResultFileHeader.CoreCode, errorMessage), }; expectedRow = new ResultCsvRecordResponse { Uln = 123, RowNum = 1, ValidationErrors = new List <BulkProcessValidationError> { new BulkProcessValidationError { RowNum = "1", Uln = "1234567890", ErrorMessage = errorMessage }, } }; var regCsvResponse = new ValidationResult(failures); RegValidator.ValidateAsync(Arg.Any <ResultCsvRecordRequest>()).Returns(regCsvResponse); DataParser.ParseErrorObject(Arg.Any <int>(), Arg.Any <ResultCsvRecordRequest>(), regCsvResponse).Returns(expectedRow); }
public override void Given() { InputFileContent = GetInputFilecontent(); var failures = new List <ValidationFailure> { new ValidationFailure(ResultFileHeader.Uln, string.Format(ValidationMessages.Required, ResultFluentHeader.Uln)), }; var regCsvResponse = new ValidationResult(failures); RegValidator.ValidateAsync(Arg.Any <ResultCsvRecordRequest>()).Returns(regCsvResponse); DataParser.ParseErrorObject(Arg.Any <int>(), Arg.Any <ResultCsvRecordRequest>(), regCsvResponse).ReturnsNull(); }
public override void Given() { InputFileContent = GetInputFilecontent(); var failures = new List <ValidationFailure> { new ValidationFailure("ULN", "Uln required"), new ValidationFailure("First name", "First name required"), }; var regCsvResponse = new ValidationResult(failures); RegValidator.ValidateAsync(Arg.Any <RegistrationCsvRecordRequest>()).Returns(regCsvResponse); DataParser.ParseErrorObject(Arg.Any <int>(), Arg.Any <RegistrationCsvRecordRequest>(), regCsvResponse).ReturnsNull(); }
public override void Given() { InputFileContent = GetInputFilecontent(); var failures = new List <ValidationFailure>(); expectedRow = new ResultCsvRecordResponse { RowNum = 1, Uln = 1234567890, CoreCode = "12345678", CoreAssessmentSeries = "Summer 2021", CoreGrade = "A", }; var regCsvResponse = new ValidationResult(failures); RegValidator.ValidateAsync(Arg.Any <ResultCsvRecordRequest>()).Returns(regCsvResponse); DataParser.ParseRow(Arg.Any <ResultCsvRecordRequest>(), Arg.Any <int>()).Returns(expectedRow); }
public override void Given() { InputFileContent = GetInputFilecontent(); var failures = new List <ValidationFailure> { new ValidationFailure("First name", "First name required"), }; expectedRow = new RegistrationCsvRecordResponse { Uln = 123, RowNum = 1, ValidationErrors = new List <BulkProcessValidationError> { new BulkProcessValidationError { RowNum = "1", Uln = "123", ErrorMessage = "First name required" } } }; var regCsvResponse = new ValidationResult(failures); RegValidator.ValidateAsync(Arg.Any <RegistrationCsvRecordRequest>()).Returns(regCsvResponse); DataParser.ParseErrorObject(Arg.Any <int>(), Arg.Any <RegistrationCsvRecordRequest>(), regCsvResponse).Returns(expectedRow); }
public override void Given() { InputFileContent = GetInputFilecontent(); var failures = new List <ValidationFailure> { new ValidationFailure("Core code", "Core code must have 8 digits only"), }; expectedRow = new AssessmentCsvRecordResponse { Uln = 123, RowNum = 1, ValidationErrors = new List <BulkProcessValidationError> { new BulkProcessValidationError { RowNum = "1", Uln = "123", ErrorMessage = "Core code must have 8 digits only" } } }; var regCsvResponse = new ValidationResult(failures); RegValidator.ValidateAsync(Arg.Any <AssessmentCsvRecordRequest>()).Returns(regCsvResponse); DataParser.ParseErrorObject(Arg.Any <int>(), Arg.Any <AssessmentCsvRecordRequest>(), regCsvResponse).Returns(expectedRow); }