public void InsertSkillByIdProfile_InvalidSkillObject_ShouldBeThrownValidationException() { Mock <IUnitOfWork> uow = new Mock <IUnitOfWork>(); SkillService service = new SkillService(uow.Object); service.Insert(null); }
public void InsertSkill_NewSkillAddingToDatabase_ShouldBeAddedNewEducation() { 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.Insert(new SkillDTO() { Id = 1 }); uow.Verify(x => x.Save()); }
public void InsertSkill_SkillWhisThisIdAlreadyExist_ShouldBeThrownValidationException() { Mock <IUnitOfWork> uow = new Mock <IUnitOfWork>(); SkillService service = new SkillService(uow.Object); var skills = new List <Skill>() { new Skill() { Id = 1, Name = "Java" } }; SkillDTO skillDTO = new SkillDTO { Id = 1, Name = "C#" }; uow.Setup(a => a.Skills.GetAll()).Returns(skills); service.Insert(skillDTO); }