public async Task Then_result_is_ignore_out_date(int learnStartDateAddDays, int plannedEndDateAddDays)
        {
            // Arrange
            ImportLearnerDetail = CreateImportLearnerDetail(LearnerOne.Source, LearnerOne.UkPrn, LearnerOne.Uln, LearnerOne.StdCode,
                                                            LearnerOne.FundingModel, LearnerOne.GivenNames, LearnerOne.FamilyName, LearnerOne.EpaOrgId,
                                                            LearnerOne.LearnStartDate.AddDays(learnStartDateAddDays),
                                                            LearnerOne.PlannedEndDate.Value.AddDays(plannedEndDateAddDays),
                                                            LearnerOne.CompletionStatus, LearnerOne.LearnRefNumber, LearnerOne.DelLocPostCode,
                                                            LearnerOne.LearnActEndDate, LearnerOne.WithdrawReason, LearnerOne.Outcome, LearnerOne.AchDate, LearnerOne.OutGrade);

            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            Response.LearnerDetailResults.Count.Should().Be(1);
            Response.LearnerDetailResults[0].Outcome.Should().Be("IgnoreOutOfDate");
        }
Esempio n. 2
0
        public async Task Then_an_existing_learner_record_is_replaced(string epaOrgId, string learnActEndDate, int?withdrawReason,
                                                                      int?outcome, string achDate, string outGrade)
        {
            // Arrange
            ImportLearnerDetail = CreateImportLearnerDetail(LearnerOne.Source, LearnerOne.UkPrn, LearnerOne.Uln, LearnerOne.StdCode,
                                                            LearnerOne.FundingModel, LearnerOne.GivenNames, LearnerOne.FamilyName, epaOrgId,
                                                            LearnerOne.LearnStartDate.AddDays(10), // add 10 days to the start date
                                                            LearnerOne.PlannedEndDate, LearnerOne.CompletionStatus, LearnerOne.LearnRefNumber, LearnerOne.DelLocPostCode,
                                                            learnActEndDate == null ? (DateTime?)null : DateTime.Parse(learnActEndDate, CultureInfo.InvariantCulture),
                                                            withdrawReason, outcome,
                                                            achDate == null ? (DateTime?)null : DateTime.Parse(achDate, CultureInfo.InvariantCulture),
                                                            outGrade);

            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            VerifyIlrReplaced(ImportLearnerDetail, Times.Once);
        }
        public async Task Then_learner_records_are_not_created(string source, int?ukprn, long?uln, int?stdCode,
                                                               int?fundingModel, string givenNames, string familyName, string learnStartDate, string plannedEndDate,
                                                               int?completionStatus, string learnRefNumber, string delLocPostCode)
        {
            // Arrange
            ImportLearnerDetail = CreateImportLearnerDetailRequest(source, ukprn, uln, stdCode, fundingModel, givenNames, familyName,
                                                                   (learnStartDate == null ? (DateTime?)null : DateTime.Parse(learnStartDate, CultureInfo.InvariantCulture)),
                                                                   (plannedEndDate == null ? (DateTime?)null : DateTime.Parse(plannedEndDate, CultureInfo.InvariantCulture)),
                                                                   completionStatus, learnRefNumber, delLocPostCode);

            // Arrange
            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            IlrRepository.Verify(r => r.Create(It.IsAny <Ilr>()), Times.Never);
        }
        public async Task Then_result_is_error_missing_mandatory_field(string source, int?ukprn, long?uln, int?stdCode,
                                                                       int?fundingModel, string givenNames, string familyName, string learnStartDate, string plannedEndDate,
                                                                       int?completionStatus, string learnRefNumber, string delLocPostCode, string missingFieldNames)
        {
            // Arrange
            ImportLearnerDetail = CreateImportLearnerDetailRequest(source, ukprn, uln, stdCode, fundingModel, givenNames, familyName,
                                                                   (learnStartDate == null ? (DateTime?)null : DateTime.Parse(learnStartDate, CultureInfo.InvariantCulture)),
                                                                   (plannedEndDate == null ? (DateTime?)null : DateTime.Parse(plannedEndDate, CultureInfo.InvariantCulture)),
                                                                   completionStatus, learnRefNumber, delLocPostCode);

            // Arrange
            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            Response.LearnerDetailResults.Count.Should().Be(1);
            Response.LearnerDetailResults[0].Outcome.Should().Be("ErrorMissingMandatoryField");
            foreach (string missingFieldName in missingFieldNames.Split(','))
            {
                Response.LearnerDetailResults[0].Errors.Should().Contain(p => p.Contains(missingFieldName));
            }
        }
        public async Task Then_an_existing_learner_record_is_updated(string epaOrgId, string learnActEndDate, int?withdrawReason,
                                                                     int?outcome, string achDate, string outGrade)
        {
            // Arrange
            ImportLearnerDetail = CreateImportLearnerDetail(LearnerOne.Source, LearnerOne.UkPrn, LearnerOne.Uln, LearnerOne.StdCode,
                                                            55, "NewFirstName", "NewFamilyName", epaOrgId, LearnerOne.LearnStartDate,
                                                            LearnerOne.PlannedEndDate, 55, "55555555", "55POST55",
                                                            learnActEndDate == null ? (DateTime?)null : DateTime.Parse(learnActEndDate, CultureInfo.InvariantCulture),
                                                            withdrawReason, outcome,
                                                            achDate == null ? (DateTime?)null : DateTime.Parse(achDate, CultureInfo.InvariantCulture),
                                                            outGrade);

            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            VerifyIlrUpdated(ImportLearnerDetail.Source, ImportLearnerDetail.Ukprn.Value, ImportLearnerDetail.Uln.Value, ImportLearnerDetail.StdCode.Value,
                             ImportLearnerDetail.FundingModel, ImportLearnerDetail.GivenNames, ImportLearnerDetail.FamilyName,
                             epaOrgId == null ? LearnerOne.EpaOrgId : epaOrgId,                                                                    // keep current when null
                             ImportLearnerDetail.LearnStartDate, ImportLearnerDetail.PlannedEndDate, ImportLearnerDetail.CompletionStatus, ImportLearnerDetail.LearnRefNumber, ImportLearnerDetail.DelLocPostCode,
                             learnActEndDate == null ? LearnerOne.LearnActEndDate : DateTime.Parse(learnActEndDate, CultureInfo.InvariantCulture), // keep current when null
                             withdrawReason == null ? LearnerOne.WithdrawReason : withdrawReason,                                                  // keep current when null
                             outcome == null ? LearnerOne.Outcome : outcome,                                                                       // keep current when null
                             achDate == null ? LearnerOne.AchDate : DateTime.Parse(achDate, CultureInfo.InvariantCulture),                         // keep current when null
                             outGrade == null ? LearnerOne.OutGrade : outGrade,                                                                    // keep current when null
                             Times.Once);
        }
        public async Task Then_result_is_update(string epaOrgId, string learnActEndDate, int?withdrawReason,
                                                int?outcome, string achDate, string outGrade)
        {
            // Arrange
            ImportLearnerDetail = CreateImportLearnerDetail(LearnerOne.Source, LearnerOne.UkPrn, LearnerOne.Uln, LearnerOne.StdCode,
                                                            LearnerOne.FundingModel, LearnerOne.GivenNames, LearnerOne.FamilyName, epaOrgId, LearnerOne.LearnStartDate,
                                                            LearnerOne.PlannedEndDate, LearnerOne.CompletionStatus, LearnerOne.LearnRefNumber, LearnerOne.DelLocPostCode,
                                                            learnActEndDate == null ? (DateTime?)null : DateTime.Parse(learnActEndDate, CultureInfo.InvariantCulture),
                                                            withdrawReason, outcome,
                                                            achDate == null ? (DateTime?)null : DateTime.Parse(achDate, CultureInfo.InvariantCulture),
                                                            outGrade);

            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            Response.LearnerDetailResults.Count.Should().Be(1);
            Response.LearnerDetailResults[0].Outcome.Should().Be("UpdatedLearnerDetail");
        }
        public void Arrange(string epaOrgId, string learnActEndDate, int?withdrawReason,
                            int?outcome, string achDate, string outGrade)
        {
            BaseArrange();

            // Arrange
            ImportLearnerDetail = CreateImportLearnerDetail(
                LearnerWithCertificate.Source,
                LearnerWithCertificate.UkPrn,
                LearnerWithCertificate.Uln,
                LearnerWithCertificate.StdCode,
                55,
                "NewFirstName",
                "NewFamilyName",
                epaOrgId,
                LearnerWithCertificate.LearnStartDate,
                LearnerWithCertificate.PlannedEndDate,
                55,
                "55555555",
                "55POST55",
                learnActEndDate == null ? (DateTime?)null : DateTime.Parse(learnActEndDate, CultureInfo.InvariantCulture),
                withdrawReason,
                outcome,
                achDate == null ? (DateTime?)null : DateTime.Parse(achDate, CultureInfo.InvariantCulture),
                outGrade);

            Request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };
        }
Esempio n. 8
0
 public async Task <ImportLearnerDetailResponse> ImportLearnerDetails(ImportLearnerDetailRequest importLearnerDetailRequest)
 {
     using (var request = new HttpRequestMessage(HttpMethod.Post, "api/v1/learnerdetails/import"))
     {
         return(await PostPutRequestWithResponse <ImportLearnerDetailRequest, ImportLearnerDetailResponse>(request,
                                                                                                           importLearnerDetailRequest));
     }
 }
Esempio n. 9
0
        private async Task <RefreshIlrsProviderMessage> ExportLearnerDetails(RefreshIlrsProviderMessage providerMessage)
        {
            RefreshIlrsProviderMessage nextPageProviderMessage = null;

            var aimType      = 1;
            var allStandards = -1;
            var fundModels   = ConfigurationHelper.ConvertCsvValueToList <int>(_refreshIlrsOptions.LearnerFundModels);
            var allProgTypes = -1;
            var pageSize     = _refreshIlrsOptions.LearnerPageSize;

            var learnersPage = await _dataCollectionServiceApiClient.GetLearners(providerMessage.Source, providerMessage.Ukprn, aimType, allStandards, fundModels, allProgTypes, pageSize, providerMessage.LearnerPageNumber);

            if (learnersPage != null)
            {
                if (learnersPage.PagingInfo.TotalPages > learnersPage.PagingInfo.PageNumber)
                {
                    // queue a new message to process the next page
                    nextPageProviderMessage = new RefreshIlrsProviderMessage
                    {
                        Ukprn             = providerMessage.Ukprn,
                        Source            = providerMessage.Source,
                        LearnerPageNumber = providerMessage.LearnerPageNumber + 1
                    };
                }

                // the learners must be filtered to remove learning deliveries which do not match the filters as the
                // data collection API returns learners which have at least one learning delivery matching a filter,
                // but it then returns ALL learning deliveries for each matching learner
                var filteredLearners = FilterLearners(learnersPage.Learners, providerMessage.Source, aimType, fundModels);
                if (filteredLearners.Count > 0)
                {
                    ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
                    {
                        ImportLearnerDetails = filteredLearners
                    };

                    var response = await _assessorServiceApiClient.ImportLearnerDetails(request);

                    var totalErrorsInResponse = response?.LearnerDetailResults?.Sum(e => e.Errors?.Count ?? 0);
                    if (totalErrorsInResponse > 0)
                    {
                        _logger.LogInformation($"Request to import {request.ImportLearnerDetails.Count} learner details resulted in {totalErrorsInResponse} error(s)");
                    }

                    response?.LearnerDetailResults?.ForEach(ld =>
                    {
                        if ((ld.Errors?.Count ?? 0) > 0)
                        {
                            _logger.LogDebug($"Request to import learner details (Uln:{ld.Uln},StdCode:{ld.StdCode}) failed due to '{ld.Outcome}' '{string.Join(", ", ld?.Errors)}'");
                        }
                    });
                }
            }

            return(nextPageProviderMessage);
        }
        public void Arrange()
        {
            BaseArrange();

            // Arrange
            ImportLearnerDetail = CreateImportLearnerDetail(LearnerWithCertificate);  // Source and Ukprn unchanged
            ImportLearnerDetail.LearnActEndDate = ImportLearnerDetail.LearnStartDate; // LearnActEndDate is the same as LearnStartDate

            Request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };
        }
Esempio n. 11
0
        public async Task Then_learner_records_are_not_updated()
        {
            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            IlrRepository.Verify(r => r.Update(It.IsAny <Ilr>()), Times.Never);
        }
        public void Arrange()
        {
            BaseArrange();

            // Arrange
            ImportLearnerDetail        = CreateImportLearnerDetail(LearnerWithCertificate);
            ImportLearnerDetail.Source = "1819"; // cannot revert from 2021 to 1920

            Request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };
        }
        public void Arrange()
        {
            BaseArrange();

            // Arrange
            ImportLearnerDetail       = CreateImportLearnerDetail(LearnerWithDraftCertificate);
            ImportLearnerDetail.Ukprn = ImportLearnerDetail.Ukprn + 1;

            Request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };
        }
        public async Task Then_an_existing_learner_record_is_replaced()
        {
            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            VerifyIlrReplaced(request.ImportLearnerDetails[0], Times.Once);
        }
Esempio n. 15
0
        public void Arrange(int learnStartDateAddDays, int plannedEndDateAddDays)
        {
            BaseArrange();

            // Arrange
            ImportLearnerDetail = CreateImportLearnerDetail(LearnerWithCertificate);
            ImportLearnerDetail.LearnStartDate = ImportLearnerDetail.LearnStartDate.Value.AddDays(learnStartDateAddDays);
            ImportLearnerDetail.PlannedEndDate = ImportLearnerDetail.PlannedEndDate.Value.AddDays(plannedEndDateAddDays);

            Request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };
        }
        public async Task Then_result_is_replacement()
        {
            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            Response.LearnerDetailResults.Count.Should().Be(1);
            Response.LearnerDetailResults[0].Outcome.Should().Be("ReplacedLearnerDetail");
        }
Esempio n. 17
0
        public async Task Then_result_is_ignore_Lower_source()
        {
            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            Response.LearnerDetailResults.Count.Should().Be(1);
            Response.LearnerDetailResults[0].Outcome.Should().Be("IgnoreSourcePriorToCurrentSource");
        }
        public void Arrange()
        {
            BaseArrange();

            // Arrange
            ImportLearnerDetail       = CreateImportLearnerDetail(4444, 44444444444, 44);
            SecondImportLearnerDetail = CreateImportLearnerDetail(5555, 55555555555, 55);

            Request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail,
                    SecondImportLearnerDetail
                }
            };
        }
Esempio n. 19
0
        public void Arrange(long uln)
        {
            BaseArrange();

            // Arrange
            ImportLearnerDetail     = CreateImportLearnerDetail(LearnerWithCertificate);
            ImportLearnerDetail.Uln = uln;

            // Arrange
            Request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };
        }
        public void Arrange()
        {
            BaseArrange();

            // Arrange
            ImportLearnerDetail                = CreateImportLearnerDetail(LearnerWithoutCertificate);
            ImportLearnerDetail.Ukprn          = ImportLearnerDetail.Ukprn + 1;
            ImportLearnerDetail.LearnStartDate = ImportLearnerDetail.LearnStartDate.Value.AddDays(10);

            Request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };
        }
Esempio n. 21
0
        public async Task Then_result_is_ignore_dummy_learn_act_end_date()
        {
            // Arrange
            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            Response.LearnerDetailResults.Count.Should().Be(1);
            Response.LearnerDetailResults[0].Outcome.Should().Be("IgnoreLearnActEndDateSameAsLearnStartDate");
        }
Esempio n. 22
0
        public async Task Then_a_new_learner_record_is_created()
        {
            // Arrange
            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail,
                    _secondImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            IlrRepository.Verify(r => r.Create(It.Is <Ilr>(p => p.Uln == ImportLearnerDetail.Uln.Value && p.StdCode == ImportLearnerDetail.StdCode.Value)), Times.Once);
            IlrRepository.Verify(r => r.Create(It.Is <Ilr>(p => p.Uln == _secondImportLearnerDetail.Uln.Value && p.StdCode == _secondImportLearnerDetail.StdCode.Value)), Times.Once);
        }
Esempio n. 23
0
        public async Task Then_an_existing_learner_record_is_replaced()
        {
            // Arrange
            ImportLearnerDetail       = CreateImportLearnerDetail(LearnerFive);
            ImportLearnerDetail.Ukprn = 444444444;

            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            VerifyIlrReplaced(ImportLearnerDetail, Times.Once);
        }
Esempio n. 24
0
        public async Task Then_result_is_create()
        {
            // Arrange
            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail,
                    _secondImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            Response.LearnerDetailResults.Count.Should().Be(2);
            Response.LearnerDetailResults[0].Outcome.Should().Be("CreatedLearnerDetail");
            Response.LearnerDetailResults[1].Outcome.Should().Be("CreatedLearnerDetail");
        }
        public async Task Then_no_learner_records_are_updated(long uln)
        {
            // Arrange
            ImportLearnerDetail     = CreateImportLearnerDetail(LearnerOne);
            ImportLearnerDetail.Uln = uln;

            // Arrange
            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            IlrRepository.Verify(r => r.Update(It.IsAny <Ilr>()), Times.Never);
        }
        public void Arrange(string source, int?ukprn, long?uln, int?stdCode,
                            int?fundingModel, string givenNames, string familyName, string learnStartDate, string plannedEndDate,
                            int?completionStatus, string learnRefNumber, string delLocPostCode)
        {
            BaseArrange();

            // Arrange
            ImportLearnerDetail = CreateImportLearnerDetail(source, ukprn, uln, stdCode, fundingModel, givenNames, familyName,
                                                            (learnStartDate == null ? (DateTime?)null : DateTime.Parse(learnStartDate, CultureInfo.InvariantCulture)),
                                                            (plannedEndDate == null ? (DateTime?)null : DateTime.Parse(plannedEndDate, CultureInfo.InvariantCulture)),
                                                            completionStatus, learnRefNumber, delLocPostCode);

            // Arrange
            Request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };
        }
        public void Arrange()
        {
            BaseArrange();

            // Arrange
            ImportLearnerDetail                 = CreateImportLearnerDetail(LearnerWithoutCertificate);
            ImportLearnerDetail.Source          = "2021"; // a later source to which should trigger a replacement, the replacement values are null
            ImportLearnerDetail.EpaOrgId        = null;
            ImportLearnerDetail.LearnActEndDate = null;
            ImportLearnerDetail.WithdrawReason  = null;
            ImportLearnerDetail.Outcome         = null;
            ImportLearnerDetail.AchDate         = null;
            ImportLearnerDetail.OutGrade        = null;

            Request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };
        }
        public async Task Then_an_existing_learner_record_is_replaced()
        {
            // Arrange
            ImportLearnerDetail = CreateImportLearnerDetail(LearnerTwo.Source, 444444444, LearnerTwo.Uln, LearnerTwo.StdCode,
                                                            LearnerTwo.FundingModel, LearnerTwo.GivenNames, LearnerTwo.FamilyName, LearnerTwo.EpaOrgId,
                                                            LearnerTwo.LearnStartDate.AddDays(10), LearnerTwo.PlannedEndDate, LearnerTwo.CompletionStatus, LearnerTwo.LearnRefNumber, LearnerTwo.DelLocPostCode,
                                                            LearnerTwo.LearnActEndDate, LearnerTwo.WithdrawReason, LearnerTwo.Outcome, LearnerTwo.AchDate, LearnerTwo.OutGrade);

            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            VerifyIlrReplaced(ImportLearnerDetail, Times.Once);
        }
        public async Task Then_result_is_ignore_dummy_uln(long uln)
        {
            // Arrange
            ImportLearnerDetail     = CreateImportLearnerDetail(LearnerOne);
            ImportLearnerDetail.Uln = uln;

            // Arrange
            ImportLearnerDetailRequest request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };

            // Act
            Response = await Sut.Handle(request, new CancellationToken());

            // Assert
            Response.LearnerDetailResults.Count.Should().Be(1);
            Response.LearnerDetailResults[0].Outcome.Should().Be("IgnoreUlnDummyValue");
        }
        public void Arrange()
        {
            BaseArrange();

            // Arrange
            ImportLearnerDetail                 = CreateImportLearnerDetail(LearnerWithCertificate);
            ImportLearnerDetail.Source          = "2021";
            ImportLearnerDetail.EpaOrgId        = null; // replacement null value
            ImportLearnerDetail.LearnActEndDate = null; // replacement null value
            ImportLearnerDetail.WithdrawReason  = null; // replacement null value
            ImportLearnerDetail.Outcome         = null; // replacement null value
            ImportLearnerDetail.AchDate         = null; // replacement null value
            ImportLearnerDetail.OutGrade        = null; // replacement null value

            Request = new ImportLearnerDetailRequest
            {
                ImportLearnerDetails = new List <ImportLearnerDetail>
                {
                    ImportLearnerDetail
                }
            };
        }