Beispiel #1
0
        public async Task Then_Expected_Results_Are_Returned(long aoUkprn, long uln, bool isActiveAssessment, bool expectedResponse)
        {
            await WhenAsync(aoUkprn, uln, isActiveAssessment);

            if (_result == null)
            {
                expectedResponse.Should().BeFalse();
                return;
            }

            TqPathwayAssessment expectedAssessment = null;

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

            expectedAssessment.Should().NotBeNull();

            var expectedAssessmentDetails = new AssessmentEntryDetails
            {
                ProfileId            = expectedAssessment.TqRegistrationPathway.TqRegistrationProfileId,
                AssessmentId         = expectedAssessment.Id,
                AssessmentSeriesName = expectedAssessment.AssessmentSeries.Name
            };

            // Assert
            _result.ProfileId.Should().Be(expectedAssessmentDetails.ProfileId);
            _result.AssessmentId.Should().Be(expectedAssessmentDetails.AssessmentId);
            _result.AssessmentSeriesName.Should().Be(expectedAssessmentDetails.AssessmentSeriesName);
        }
Beispiel #2
0
        private static void AssertPathwayAssessment(TqPathwayAssessment actualAssessment, TqPathwayAssessment expectedAssessment)
        {
            actualAssessment.Should().NotBeNull();
            actualAssessment.TqRegistrationPathwayId.Should().Be(expectedAssessment.TqRegistrationPathwayId);
            actualAssessment.AssessmentSeriesId.Should().Be(expectedAssessment.AssessmentSeriesId);
            actualAssessment.IsOptedin.Should().BeTrue();
            actualAssessment.IsBulkUpload.Should().BeTrue();

            if (actualAssessment.TqRegistrationPathway.Status == Common.Enum.RegistrationPathwayStatus.Active)
            {
                actualAssessment.EndDate.Should().BeNull();
            }
            else
            {
                actualAssessment.EndDate.Should().NotBeNull();
            }
        }
Beispiel #3
0
        public static void AssertPathwayAssessment(TqPathwayAssessment actualAssessment, TqPathwayAssessment expectedAssessment, bool isRejoin = false)
        {
            actualAssessment.Should().NotBeNull();
            if (!isRejoin)
            {
                actualAssessment.TqRegistrationPathwayId.Should().Be(expectedAssessment.TqRegistrationPathwayId);
            }

            actualAssessment.TqRegistrationPathway.TqProviderId.Should().Be(expectedAssessment.TqRegistrationPathway.TqProviderId);
            actualAssessment.AssessmentSeriesId.Should().Be(expectedAssessment.AssessmentSeriesId);
            actualAssessment.IsOptedin.Should().BeTrue();
            actualAssessment.IsBulkUpload.Should().BeFalse();

            if (actualAssessment.TqRegistrationPathway.Status == RegistrationPathwayStatus.Active)
            {
                actualAssessment.EndDate.Should().BeNull();
            }
            else
            {
                actualAssessment.EndDate.Should().NotBeNull();
            }
        }