示例#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());
        }