public void NoError() { var req = new GetTimeEntryRequest() { Id = 1, }; validator.ShouldNotHaveValidationErrorFor(x => x.Id, req); }
public void ZeroId() { var req = new GetTimeEntryRequest() { Id = 0, }; validator.ShouldHaveValidationErrorFor(x => x.Id, req); }
public async Task GetTimeEntryAsync(int id, bool success) { var req = new GetTimeEntryRequest() { Id = id, }; var service = new TimeEntryService(timeMapper, timeRepo); var result = await service.GetTimeEntryAsync(req); if (success) { result.ShouldNotBeNull(); } else { result.ShouldBeNull(); } }
public async Task <TimeEntryResponse> GetTimeEntryAsync(GetTimeEntryRequest req) { var result = await _repo.GetEntryAsync(req.Id); return(_mapper.Map(result)); }