public async Task CanGetTrainingSeriessList() { var authorizedClient = SystemTestExtension.GetTokenAuthorizeHttpClient(_factory); var getTrainingSeriesesListQuery = new GetTrainingSeriesesListQueryModel { Skip = 0, Take = 10 }; var httpResponse = await authorizedClient.GetAsync( requestUri : $"/TrainingSeries?Skip={getTrainingSeriesesListQuery.Skip}&Take={getTrainingSeriesesListQuery.Take}"); httpResponse.EnsureSuccessStatusCode(); Assert.Equal(HttpStatusCode.OK, httpResponse.StatusCode); }
public async Task <ActionResult <ResponseModel <TrainingSeriesesListModel> > > Get([FromQuery] GetTrainingSeriesesListQueryModel query) { try { var tenantId = Guid.Parse(Claims[ClaimTypes.UserData]); var trainingSeriesesListModel = await Mediator.Send(new GetTrainingSeriesesListQuery(tenantId, query.Skip, query.Take)); return(Ok(trainingSeriesesListModel)); } catch (NotFoundException) { return(NotFound()); } catch { return(StatusCode(HttpStatusCode.InternalServerError.ToInt())); } }