示例#1
0
        public void InsertSkillByIdProfile_InvalidSkillObject_ShouldBeThrownValidationException()
        {
            Mock <IUnitOfWork> uow     = new Mock <IUnitOfWork>();
            SkillService       service = new SkillService(uow.Object);

            service.Insert(null);
        }
示例#2
0
        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());
        }
示例#3
0
        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);
        }