コード例 #1
0
        public void NoError()
        {
            var req = new GetTimeEntryRequest()
            {
                Id = 1,
            };

            validator.ShouldNotHaveValidationErrorFor(x => x.Id, req);
        }
コード例 #2
0
        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();
            }
        }
コード例 #4
0
        public async Task <TimeEntryResponse> GetTimeEntryAsync(GetTimeEntryRequest req)
        {
            var result = await _repo.GetEntryAsync(req.Id);

            return(_mapper.Map(result));
        }