Exemple #1
0
        public async Task WhenAsync(long aoUkprn, long uln, bool isActiveAssessment)
        {
            TqPathwayAssessment pathwayAssessment = null;

            if (isActiveAssessment)
            {
                pathwayAssessment = _pathwayAssessments.FirstOrDefault(pa => pa.IsOptedin && pa.EndDate == null && pa.TqRegistrationPathway.TqRegistrationProfile.UniqueLearnerNumber == uln);
            }
            else
            {
                pathwayAssessment = _pathwayAssessments.FirstOrDefault(pa => !pa.IsOptedin && pa.EndDate != null && pa.TqRegistrationPathway.TqRegistrationProfile.UniqueLearnerNumber == uln);
            }

            var assessmentId = pathwayAssessment != null ? pathwayAssessment.Id : 0;

            var removeAssessmentEntryRequest = new RemoveAssessmentEntryRequest {
                AoUkprn = aoUkprn, AssessmentId = assessmentId, PerformedBy = "Test User"
            };

            _result = await AssessmentService.RemovePathwayAssessmentEntryAsync(removeAssessmentEntryRequest);
        }