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

            service.Insert(null);
        }
예제 #2
0
        public void InsertEducationByIdProfile_InvalidEducationId_ShouldBeThrownValidationException()
        {
            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.Insert(new EducationDTO {
                Id = 1
            });
        }
예제 #3
0
        public void InsertEducation_NewEducationAddingToDatabase_ShouldBeAddedNewEducation()
        {
            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.Insert(new EducationDTO()
            {
                Id = 1, ProgrammerId = "1", CloseDate = new DateTime(2010, 11, 10), EntryDate = new DateTime(2009, 10, 10), Level = "high", NameInstitution = "KPI"
            });
            uow.Verify(x => x.Save());
        }