public void Then_Maps_Fields_Appropriately_Matching_AchievementRates_With_Sector_And_Level(
            InnerApi.Responses.GetShortlistItem shortlistItem,
            GetAchievementRateItem item,
            GetAchievementRateItem item2,
            GetAchievementRateItem item3)
        {
            shortlistItem.Course.Level = 2;
            item.SectorSubjectArea     = shortlistItem.Course.SectorSubjectAreaTier2Description;
            item.Level = "Two";
            shortlistItem.ProviderDetails.AchievementRates = new List <GetAchievementRateItem>
            {
                item,
                item2
            };
            item3.SectorSubjectArea = shortlistItem.Course.SectorSubjectAreaTier2Description;
            item3.Level             = "Two";

            var response = new GetProviderCourseItem().Map(shortlistItem);

            response.Name.Should().Be(shortlistItem.ProviderDetails.Name);
            response.TradingName.Should().Be(shortlistItem.ProviderDetails.TradingName);
            response.ProviderId.Should().Be(shortlistItem.ProviderDetails.Ukprn);
            response.OverallCohort.Should().Be(item.OverallCohort);
            response.OverallAchievementRate.Should().Be(item.OverallAchievementRate);
        }
        public void Then_Maps_Fields_Appropriately_Returning_Null_For_AchievementRate_Data_If_No_Matching_No_AchievementRates(
            InnerApi.Responses.GetShortlistItem shortlistItem,
            GetAchievementRateItem item,
            GetAchievementRateItem item2)
        {
            shortlistItem.ProviderDetails.AchievementRates = new List <GetAchievementRateItem>
            {
                item,
                item2
            };

            var response = new GetProviderCourseItem().Map(shortlistItem);

            response.Name.Should().Be(shortlistItem.ProviderDetails.Name);
            response.TradingName.Should().Be(shortlistItem.ProviderDetails.TradingName);
            response.ProviderId.Should().Be(shortlistItem.ProviderDetails.Ukprn);
            response.OverallCohort.Should().BeNull();
            response.OverallAchievementRate.Should().BeNull();
        }
        public void Then_Maps_Fields_Appropriately_Matching_AchievementRate(
            string sectorSubjectArea,
            GetProvidersListItem source, GetAchievementRateItem item, GetAchievementRateItem item2)
        {
            item.SectorSubjectArea  = sectorSubjectArea;
            item.Level              = "Two";
            source.AchievementRates = new List <GetAchievementRateItem>
            {
                item,
                item2
            };

            var response = new GetTrainingCourseProviderListItem().Map(source, sectorSubjectArea, 2, null, null, true);

            response.Name.Should().Be(source.Name);
            response.ProviderId.Should().Be(source.Ukprn);
            response.OverallCohort.Should().Be(item.OverallCohort);
            response.HasLocation.Should().BeTrue();
            response.OverallAchievementRate.Should().Be(item.OverallAchievementRate);
        }
        public void Then_Maps_Fields_Appropriately_Returning_Null_For_AchievementRate_Data_If_No_Matching_No_AchievementRate(string sectorSubjectArea,
                                                                                                                             GetProvidersListItem source, GetAchievementRateItem item, GetAchievementRateItem item2)
        {
            source.AchievementRates = new List <GetAchievementRateItem>
            {
                item,
                item2
            };

            var response = new GetTrainingCourseProviderListItem().Map(source, sectorSubjectArea, 1, null, null, true);

            response.Name.Should().Be(source.Name);
            response.ProviderId.Should().Be(source.Ukprn);
            response.OverallCohort.Should().BeNull();
            response.OverallAchievementRate.Should().BeNull();
        }
        public void Then_Maps_Fields_Appropriately_Matching_AchievementRates_With_Sector_And_Level_Higher_Than_Three(string sectorSubjectArea,
                                                                                                                     GetTrainingCourseProviderResult source, GetAchievementRateItem item, GetAchievementRateItem item2)
        {
            item.SectorSubjectArea = sectorSubjectArea;
            item.Level             = "AllLevels";
            source.ProviderStandard.AchievementRates = new List <GetAchievementRateItem>
            {
                item,
                item2
            };

            var response = new GetProviderCourseItem().Map(source, sectorSubjectArea, 5, true);

            response.Name.Should().Be(source.ProviderStandard.Name);
            response.TradingName.Should().Be(source.ProviderStandard.TradingName);
            response.ProviderId.Should().Be(source.ProviderStandard.Ukprn);
            response.OverallCohort.Should().Be(item.OverallCohort);
            response.OverallAchievementRate.Should().Be(item.OverallAchievementRate);
        }