Example #1
0
        public void AndMappingIsNationWide(string value, bool expectedResult)
        {
            var domainType = new ApprenticeshipSummary
            {
                VacancyLocationType = value
            };

            var result = _mapper.Map <ApiTypes.ApprenticeshipSummary>(domainType);

            result.IsNationwide.Should().Be(expectedResult);
        }
Example #2
0
        public void ThenTrainingProviderNameMapsCorrectly()
        {
            var providerName = "desc";
            var domainType   = new ApprenticeshipSummary
            {
                ProviderName = providerName
            };

            var result = _mapper.Map <ApiTypes.ApprenticeshipSummary>(domainType);

            result.TrainingProviderName.Should().Be(providerName, "Then map ProviderName to TrainingProviderName");
        }
Example #3
0
        public void ThenShortDescriptionMapsCorrectly()
        {
            var description = "desc";
            var domainType  = new ApprenticeshipSummary
            {
                Description = description
            };

            var result = _mapper.Map <ApiTypes.ApprenticeshipSummary>(domainType);

            result.ShortDescription.Should().Be(description, "Then map Description to ShortDescription");
        }
Example #4
0
        public void ThenProviderUkprnMapsCorrectly()
        {
            var ukprn      = 88888888;
            var domainType = new ApprenticeshipSummary
            {
                Ukprn = ukprn
            };

            var result = _mapper.Map <ApiTypes.ApprenticeshipSummary>(domainType);

            result.Ukprn.Should().Be(ukprn);
        }
Example #5
0
        public void ThenDistanceInMilesMapsCorrectly()
        {
            var expectedDistance = 3245.3245;
            var domainType       = new ApprenticeshipSummary
            {
                DistanceInMiles = expectedDistance
            };

            var result = _mapper.Map <ApiTypes.ApprenticeshipSummary>(domainType);

            result.DistanceInMiles.Should().Be(expectedDistance);
        }
Example #6
0
        public void AndMappingTrainingType(int?standardId, string frameworkCode, ApiTypes.TrainingType expectedTrainingType)
        {
            var expectedTrainingCode = standardId.HasValue ? standardId.ToString() : frameworkCode;
            var domainType           = new ApprenticeshipSummary()
            {
                FrameworkLarsCode = frameworkCode,
                StandardLarsCode  = standardId
            };

            var result = _mapper.Map <ApiTypes.ApprenticeshipSummary>(domainType);

            result.TrainingType.Should().Be(expectedTrainingType);
            result.TrainingCode.Should().Be(expectedTrainingCode);
        }
Example #7
0
        public void ThenGeoCoordinatesMapCorrectly()
        {
            var domainType = new ApprenticeshipSummary
            {
                Location = new GeoPoint()
                {
                    Lat = 51.3288148990, Lon = 0.4452948632
                }
            };

            var result = _mapper.Map <ApiTypes.ApprenticeshipSummary>(domainType);

            result.Location.Latitude.Should().Be(51.3288148990m, "Then map latitude to Location");
            result.Location.Longitude.Should().Be(0.4452948632m, "Then map longitude to Location");
        }