Example #1
0
        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>());
        }
Example #2
0
        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());
        }