예제 #1
0
        public async Task Then_Maps_ApprenticeshipStatus(
            GetApprenticeshipsResponse.ApprenticeshipDetailsResponse source,
            ApprenticeshipDetailsToViewModelMapper mapper)
        {
            var result = await mapper.Map(source);

            result.Status.Should().Be(source.ApprenticeshipStatus.GetDescription());
        }
예제 #2
0
        public async Task Then_Maps_PlannedEndDate(
            GetApprenticeshipsResponse.ApprenticeshipDetailsResponse source,
            ApprenticeshipDetailsToViewModelMapper mapper)
        {
            var result = await mapper.Map(source);

            result.PlannedEndDate.Should().Be(source.EndDate);
        }
예제 #3
0
        public async Task Then_Maps_CourseName(
            GetApprenticeshipsResponse.ApprenticeshipDetailsResponse source,
            ApprenticeshipDetailsToViewModelMapper mapper)
        {
            var result = await mapper.Map(source);

            result.CourseName.Should().Be(source.CourseName);
        }
예제 #4
0
        public async Task Then_Maps_ApprenticeName(
            GetApprenticeshipsResponse.ApprenticeshipDetailsResponse source,
            ApprenticeshipDetailsToViewModelMapper mapper)
        {
            var result = await mapper.Map(source);

            result.ApprenticeName.Should().Be($"{source.FirstName} {source.LastName}");
        }
예제 #5
0
        public async Task Then_Maps_Alerts(
            GetApprenticeshipsResponse.ApprenticeshipDetailsResponse source,
            ApprenticeshipDetailsToViewModelMapper mapper)
        {
            var alertStrings = source.Alerts.Select(x => x.GetDescription());

            var result = await mapper.Map(source);

            result.Alerts.Should().BeEquivalentTo(alertStrings);
        }
예제 #6
0
        public async Task Then_Maps_ApprenticeshipId(
            GetApprenticeshipsResponse.ApprenticeshipDetailsResponse source,
            string encodedApprenticeshipId,
            [Frozen] Mock <IEncodingService> mockEncodingService,
            ApprenticeshipDetailsToViewModelMapper mapper)
        {
            mockEncodingService
            .Setup(service => service.Encode(source.Id, EncodingType.ApprenticeshipId))
            .Returns(encodedApprenticeshipId);

            var result = await mapper.Map(source);

            result.EncodedApprenticeshipId.Should().Be(encodedApprenticeshipId);
        }