public void InsertSkillToProgrammer_InvalidProgrammerSkillObject_ShouldBeThrownValidationException() { Mock <IUnitOfWork> uow = new Mock <IUnitOfWork>(); SkillService service = new SkillService(uow.Object); service.InsertSkillToProgrammer(null); }
public void InsertSkillToProgrammer_ProgrammerSkillAlreadyExist_ShouldBeThrownValidationException() { Mock <IUnitOfWork> uow = new Mock <IUnitOfWork>(); SkillService service = new SkillService(uow.Object); uow.Setup(a => a.ProgrammerSkills.Get(It.IsAny <string>(), It.IsAny <int>())).Returns(new ProgrammerSkill()); service.InsertSkillToProgrammer(new ProgrammerSkillDTO()); }
public void InsertSkillToProgrammer_NewProgrammerAddToDatabase_ShouldBeAddedNewProgrammerSkill() { Mock <IUnitOfWork> uow = new Mock <IUnitOfWork>(); SkillService service = new SkillService(uow.Object); uow.Setup(a => a.ProgrammerSkills.Get(It.IsAny <string>(), It.IsAny <int>())).Returns((ProgrammerSkill)null); service.InsertSkillToProgrammer(new ProgrammerSkillDTO() { SkillId = 1, ProgrammerId = "1" }); uow.Verify(x => x.Save()); }