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);
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
 public IActionResult PutSkill(Guid id, [FromBody] Skill skill)
 {
     try
     {
         _skillsService.UpdateSkill(id, skill);
     }
     catch (ArgumentException)
     {
         return(BadRequest());
     }
     catch (InvalidOperationException)
     {
         return(NotFound());
     }
     return(NoContent());
 }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
 public void Update(UiSkill uiSkill)
 {
     _skillsService.UpdateSkill(_autoMapper.MapToSvcRequest(uiSkill));
 }