Esempio n. 1
0
        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));
        }
Esempio n. 2
0
 public async Task <IHttpActionResult> GetQuestion(
     long id,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     return(await ExecuteAsync <IHttpActionResult>(() =>
     {
         return Ok(questionBc.GetById(id));
     }, cancellationToken));
 }