public void DeleteSkillOfProgrammer_SkillNotExist_ShouldBeThrownValidationException() { Mock <IUnitOfWork> uow = new Mock <IUnitOfWork>(); SkillService service = new SkillService(uow.Object); uow.Setup(a => a.Skills.Get(It.IsAny <int>())).Returns((Skill)null); service.DeleteSkillOfProgrammer(It.IsAny <string>(), It.IsAny <int>()); }
public void DeleteSkillOfProgrammer_DeleteProgrammerSkill_ShouldBeDeletedProgrammerSkill() { Mock <IUnitOfWork> uow = new Mock <IUnitOfWork>(); SkillService service = new SkillService(uow.Object); uow.Setup(a => a.Skills.Get(It.IsAny <int>())).Returns(new Skill()); uow.Setup(a => a.ProgrammerSkills.Get(It.IsAny <string>(), It.IsAny <int>())).Returns(new ProgrammerSkill()); service.DeleteSkillOfProgrammer(It.IsAny <string>(), It.IsAny <int>()); uow.Verify(x => x.Save()); }