public EmploymentService Build() { _repo = new Mock <IEmploymentStateRepository>(); _repo.Setup(s => s.CreateEmploymentState(It.IsAny <Guid>(), It.IsAny <Guid>(), It.IsAny <Guid>())).Returns(new Fakes.EmploymentState()); var sut = new EmploymentService(_repo.Object); return(sut); }
public Result Update(Employment employment) { var result = new Result(); try { EmploymentService employmentService = new EmploymentService(); employmentService.Update(employment); result.IsSuccess = true; } catch (Exception exception) { result.IsSuccess = false; result.ExceptionInfo = exception; } return(result); }
public Result <Employment> Get(int Id) { var result = new Result <Employment>(); try { EmploymentService employmentService = new EmploymentService(); var client = employmentService.Get(Id); result.Value = (Employment)client; result.IsSuccess = true; } catch (Exception exception) { result.IsSuccess = false; result.ExceptionInfo = exception; } return(result); }