public void UpdateSkillTest() { var skill = skillsService.GetSkillByName("TestSkill"); skill.Skill_Name = "TestSkillUpdated"; var sk = skillsService.UpdateSkill(skill); Assert.NotNull(sk); Assert.AreEqual(sk.Skill_Name, skill.Skill_Name); }
public void Update_MapsAndSendsToService() { //Arrange var uiSkill = new UiSkill(); var skillUpdateRequest = new SkillUpdateRequest(); A.CallTo(() => _autoMapper.MapToSvcRequest(uiSkill)).Returns(skillUpdateRequest); //Act _skillModel.Update(uiSkill); //Assert A.CallTo(() => _skillsService.UpdateSkill(skillUpdateRequest)).MustHaveHappened(); }
public IActionResult PutSkill(Guid id, [FromBody] Skill skill) { try { _skillsService.UpdateSkill(id, skill); } catch (ArgumentException) { return(BadRequest()); } catch (InvalidOperationException) { return(NotFound()); } return(NoContent()); }
public HttpResponseMessage UpdateSkill([FromBody] SkillModel skill) { SkillModel result = new SkillModel(); try { var input = Helper.CastObject <Skill>(skill); var res = _skillsService.UpdateSkill(input); result = Helper.CastObject <SkillModel>(res); } catch (Exception ex) { _logManager.WriteLog(ex); } return(ToJson(result)); }
public void Update(UiSkill uiSkill) { _skillsService.UpdateSkill(_autoMapper.MapToSvcRequest(uiSkill)); }