Example #1
0
        public void UpdateEducationByIdProfile_InvalidEducationObject_ShouldBeThrownValidationException()
        {
            Mock <IUnitOfWork> uow     = new Mock <IUnitOfWork>();
            EducationService   service = new EducationService(uow.Object);

            service.Update(It.IsAny <int>(), null);
        }
Example #2
0
        public void UpdateEducation_EducationExist_ShouldBeEditingSaved()
        {
            Mock <IUnitOfWork> uow     = new Mock <IUnitOfWork>();
            EducationService   service = new EducationService(uow.Object);

            uow.Setup(a => a.Educations.Get(It.IsAny <int>())).Returns(new Education());
            service.Update(It.IsAny <int>(), new EducationDTO());
            uow.Verify(x => x.Save());
        }
Example #3
0
        public void UpdateEducationByIdProfile_EducationIdNotMatch_ShouldBeThrownValidationException()
        {
            Mock <IUnitOfWork> uow     = new Mock <IUnitOfWork>();
            EducationService   service = new EducationService(uow.Object);

            service.Update(1, new EducationDTO()
            {
                Id = 2, ProgrammerId = "1", CloseDate = new DateTime(2010, 11, 10), EntryDate = new DateTime(2009, 10, 10), Level = "high", NameInstitution = "KPI"
            });
        }
Example #4
0
        public void UpdateEducationByIdProfile_InvalidEducationId_ShouldBeThrownValidationException()
        {
            Mock <IUnitOfWork> uow     = new Mock <IUnitOfWork>();
            EducationService   service = new EducationService(uow.Object);

            uow.Setup(a => a.Educations.Get(It.IsAny <int>())).Returns((Education)null);
            service.Update(2, new EducationDTO()
            {
                Id = 2, ProgrammerId = "1", CloseDate = new DateTime(2010, 11, 10), EntryDate = new DateTime(2009, 10, 10), Level = "high", NameInstitution = "KPI"
            });
        }