public void InsertEducationByIdProfile_InvalidEducationObject_ShouldBeThrownValidationException() { Mock <IUnitOfWork> uow = new Mock <IUnitOfWork>(); EducationService service = new EducationService(uow.Object); service.Insert(null); }
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 }); }
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()); }