public void QuestionBcTests_GetQuestion() { var random = TestUtils.RandomString(10); var question = new QuestionRequestModel { Question = $"Random question {random} with choice (Get)", ImageUrl = "https://www.google.pt/search?q=image", ThumbUrl = "https://www.google.pt/search?q=thumb", Choices = new[] { $"choice1_{random}", $"choice2_{random}", $"choice3_{random}" } }; var dbQuestion = questionBc.CreateQuestion(question); Assert.IsNotNull(questionBc.GetById(dbQuestion.Id)); }
public async Task <IHttpActionResult> GetQuestion( long id, CancellationToken cancellationToken = default(CancellationToken)) { return(await ExecuteAsync <IHttpActionResult>(() => { return Ok(questionBc.GetById(id)); }, cancellationToken)); }