public void GetSkillById() { //Arrange ISkillRepository sut = GetInMemorySkillRepository(); Skill skill1 = new Skill() { Id = 1, Name = "Weaves", Description = "Follow Instruction", IKC = "The minimum number of poles should be five...", Image = "weaves.jpeg" }; Skill skill2 = new Skill() { Id = 2, Name = "Dog Walk", Description = "Contact", IKC = "A walk plank of 1.2m minimum...", Image = "dogwalk.jpg" }; //Act Skill savedSkill = sut.CreateSkill(skill1); Skill savedSkill2 = sut.CreateSkill(skill2); //Assert var foundSkillById = sut.GetSkillById(2); Assert.Equal("Dog Walk", foundSkillById.Name); }
public void Index_Update_Skill_Name() { //Arrange ISkillRepository sut = GetInMemorySkillRepository(); Skill skill1 = new Skill() { Id = 1, Name = "Weaves", Description = "Follow Instruction", IKC = "The minimum number of poles should be five...", Image = "weaves.jpeg" }; Skill skill2 = new Skill() { Id = 1, Name = "Weave Poles", Description = "Follow Instruction", IKC = "The minimum number of poles should be five...", Image = "weaves.jpeg" }; //Act Skill savedSkill = sut.CreateSkill(skill1); Skill savedSkill1 = sut.UpdateSkill(skill2); //Assert Assert.Single(sut.AllSkills); Assert.Equal("Weave Poles", skill2.Name); }
public async Task <Guid> CreateSkillAsync(SkillDto skillDto) { var skill = _mapper.Map <SkillDto, Skill>(skillDto); _skillRepository.CreateSkill(skill); await _skillRepository.CommitAsync(); return(skill.ID); }
public void Index_DeleteSkill() { //Arrange ISkillRepository sut = GetInMemorySkillRepository(); Skill skill = new Skill() { Id = 1, Name = "Weaves", Description = "Follow Instruction", IKC = "The minimum number of poles should be five...", Image = "weaves.jpeg" }; //Act Skill savedSkill = sut.CreateSkill(skill); Skill savedSkill1 = sut.DeleteSkill(skill); //Assert Assert.Empty(sut.AllSkills); }
public Skill CreateSkill(InputSkillCreate input) => _skills.CreateSkill(input);