public void UpdateWorkExperienceByIdProfile_InvalidWorkExperienceObject_ShouldBeThrownValidationException() { Mock <IUnitOfWork> uow = new Mock <IUnitOfWork>(); WorkExperienceService service = new WorkExperienceService(uow.Object); service.Update(It.IsAny <int>(), null); }
public void UpdateWorkExperience_WorkExperienceExist_ShouldBeEditingSaved() { Mock <IUnitOfWork> uow = new Mock <IUnitOfWork>(); WorkExperienceService service = new WorkExperienceService(uow.Object); uow.Setup(a => a.WorkExperiences.Get(It.IsAny <int>())).Returns(new WorkExperience()); service.Update(It.IsAny <int>(), new WorkExperienceDTO()); uow.Verify(x => x.Save()); }
public void UpdateWorkExperienceByIdProfile_WorkExperienceIdNotMatch_ShouldBeThrownValidationException() { Mock <IUnitOfWork> uow = new Mock <IUnitOfWork>(); WorkExperienceService service = new WorkExperienceService(uow.Object); service.Update(1, new WorkExperienceDTO() { Id = 2, ProgrammerId = "1" }); }
public void UpdateWorkExperienceByIdProfile_InvalidWorkExperienceId_ShouldBeThrownValidationException() { Mock <IUnitOfWork> uow = new Mock <IUnitOfWork>(); WorkExperienceService service = new WorkExperienceService(uow.Object); uow.Setup(a => a.WorkExperiences.Get(It.IsAny <int>())).Returns((WorkExperience)null); service.Update(2, new WorkExperienceDTO() { Id = 2, ProgrammerId = "1" }); }