public void CanCalculateSkills()
        {
            offerViewModel = new OfferViewModel()
            {
                TopSkills = new List<SkillModel>()
                {
                    new SkillModel("CSS",7),
                    new SkillModel("PHP",6),
                    new SkillModel("HTML",5),
                    new SkillModel("Java",4),
                    new SkillModel("C#",3)
                }
            };

            var skillModels = new List<SkillModel>()
            {
                new SkillModel("C++",1),
                new SkillModel("C",2),
                new SkillModel("C#",3),
                new SkillModel("Java",4),
                new SkillModel("HTML",5),
                new SkillModel("PHP",6),
                new SkillModel("CSS",7)
            };

            var result = offerViewModel.CalculateTopSkills(skillModels);

            offerViewModel.TopSkills.ShouldBeEquivalentTo(
                result,
                options => options.WithStrictOrdering()
            );
        }
Beispiel #2
0
 public List<OfferViewModel> MapToOffersViewModel(List<JobOffer> offers)
 {
     var offersViewModel = new List<OfferViewModel>();
     foreach (var offer in offers)
     {
         var offerModel = MapToOfferModel(offer);
         var offerViewModel = new OfferViewModel(offerModel, offer.RecruiterId, offer.ModificationDate);
         offersViewModel.Add(offerViewModel);
     }
     return offersViewModel;
 }
 public void SetUp()
 {
     offerViewModel = new OfferViewModel();
 }