private void PopulateSvcSkills() { var dbSkills = _skillsRepo.GetSkills(); var svcSkills = _svcAutoMapper.MapToSvc(dbSkills); CachedSvcSkills = _skillTotalCalculator.AddTotals(svcSkills).ToDictionary(skill => skill.Id); _logger.LogEntry(); }
public void GetAllSkills_GetsFromDatabaseAndAddsTotals() { //Arrange var skillId = Guid.NewGuid(); var dbSkills = new List <Skill> { new Skill { Id = skillId, Name = "Skill1", PrimaryStatId = AbilityType.Cha, HasArmourCheckPenalty = true, Ranks = 5, Trained = true, UseUntrained = true } }; var correctSvcSkills = new List <API.Dto.Skill> { new API.Dto.Skill { Id = skillId, Name = "Skill1", PrimaryStatId = API.Dto.AbilityType.Cha, HasArmourCheckPenalty = true, Ranks = 5, Class = true, UseUntrained = true } }; A.CallTo(() => _skillsRepo.GetSkills()).Returns(dbSkills); A.CallTo(() => _svcAutoMapper.MapToSvc(dbSkills)).Returns(correctSvcSkills); A.CallTo(() => _skillTotalCalculator.AddTotals(correctSvcSkills)).Returns(correctSvcSkills); //Act var result = _skillsService.GetAllSkills(); //Assert result.Should().BeEquivalentTo(correctSvcSkills); }
public IActionResult Index() { return(View(_skillsRepo.GetSkills())); }