public async Task CanGetQuestionDifficultiesList() { var authorizedClient = SystemTestExtension.GetTokenAuthorizeHttpClient(_factory); var getQuestionDifficultiesListQuery = new GetQuestionDifficultiesListQueryModel { Skip = 0, Take = 10 }; var httpResponse = await authorizedClient.GetAsync( requestUri : $"/QuestionDifficulty?Skip={getQuestionDifficultiesListQuery.Skip}&Take={getQuestionDifficultiesListQuery.Take}"); httpResponse.EnsureSuccessStatusCode(); Assert.Equal(HttpStatusCode.OK, httpResponse.StatusCode); }
public async Task <ActionResult <ResponseModel <QuestionDifficultiesListModel> > > Get([FromQuery] GetQuestionDifficultiesListQueryModel query) { try { var questionDifficultiesListModel = await Mediator.Send(new GetQuestionDifficultiesListQuery(query.Skip, query.Take)); return(Ok(questionDifficultiesListModel)); } catch (NotFoundException) { return(NotFound()); } catch { return(StatusCode(HttpStatusCode.InternalServerError.ToInt())); } }