예제 #1
0
        public void InsertSkillToProgrammer_InvalidProgrammerSkillObject_ShouldBeThrownValidationException()
        {
            Mock <IUnitOfWork> uow     = new Mock <IUnitOfWork>();
            SkillService       service = new SkillService(uow.Object);

            service.InsertSkillToProgrammer(null);
        }
예제 #2
0
        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());
        }
예제 #3
0
        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());
        }