예제 #1
0
 public void Setup()
 {
     _sut = new ApprenticeshipSearchResultsItemMapping();
     _apprenticeshipSearchResultsItem = new SFADASApprenticeshipsApiTypesV3ApprenticeshipSearchResultsItem()
     {
         Id            = "123",
         ProgrammeType = SFADASApprenticeshipsApiTypesV3ApprenticeshipSearchResultsItem.ProgrammeTypeEnum.NUMBER_0,
         Duration      = 12,
         EffectiveFrom = DateTime.Now.AddYears(-2),
         EffectiveTo   = new DateTime(2020, 07, 31),
         FrameworkName = "Apprenticeship Name",
         PathwayName   = "Pathway Name",
         JobRoles      = new List <string>()
         {
             "Role 1",
             "Role 2",
             "Role 3"
         },
         Keywords = new List <string>()
         {
             "Keyword 1",
             "Keyword 2",
             "Keyword 3"
         },
         Level     = 3,
         Published = true
     };
 }
예제 #2
0
        public ApprenticeshipSearchResultsItem Map(SFADASApprenticeshipsApiTypesV3ApprenticeshipSearchResultsItem document)
        {
            if (document != null)
            {
                var item = new ApprenticeshipSearchResultsItem
                {
                    Id            = document.Id,
                    FrameworkName = document.FrameworkName,
                    Duration      = document.Duration,
                    EffectiveFrom = document.EffectiveFrom,
                    EffectiveTo   = document.EffectiveTo,
                    Level         = document.Level,
                    Published     = document.Published,
                    PathwayName   = document.PathwayName,
                    Title         = document.Title,
                    Keywords      = document.Keywords?.Any() == true?document.Keywords.ToList() : null,

                                        JobRoles = document.JobRoles?.Any() == true?document.JobRoles.ToList() : null,
                                                       ApprenticeshipType = document.ProgrammeType == SFADASApprenticeshipsApiTypesV3ApprenticeshipSearchResultsItem.ProgrammeTypeEnum.NUMBER_0 ? ApprenticeshipType.Framework : ApprenticeshipType.Standard
                };
                return(item);
            }

            return(null);
        }