public void ShouldHaveErrorForYearBefore3000() { var req = new PreceptorTimeEntryRequest() { Year = 3000, }; validator.ShouldHaveValidationErrorFor(x => x.Year, req); }
public void ShouldHaveErrorForNegativeID() { var req = new PreceptorTimeEntryRequest() { Id = -1, }; validator.ShouldHaveValidationErrorFor(x => x.Id, req); }
public void ShouldBeValid() { var req = new PreceptorTimeEntryRequest() { Id = 1, Year = 2020, }; validator.ShouldNotHaveValidationErrorFor(x => x.Year, req); validator.ShouldNotHaveValidationErrorFor(x => x.Id, req); }
public async Task GetPreceptorTimeEntriesAsync(int id, int year, bool success) { var req = new PreceptorTimeEntryRequest() { Id = id, Year = year, }; var service = new TimeEntryService(timeMapper, timeRepo); var result = await service.GetPreceptorTimeEntriesAsync(req); if (success) { result.ShouldNotBeEmpty(); } else { result.ShouldBeEmpty(); } }
public async Task <IEnumerable <TimeEntryResponse> > GetPreceptorTimeEntriesAsync(PreceptorTimeEntryRequest req) { var result = await _repo.GetTeacherAsync(req.Year, req.Id); return(result.Select(x => _mapper.Map(x)).ToList()); }