コード例 #1
0
        public void AddQuestion_RelationAdded()
        {
            // arrange
            QuizEditModel quiz            = _quizBackofficeService.GetAll().First();
            Guid          dummyQuestionId = stubQuestionOutsideQuiz.Id;

            // act
            _quizBackofficeService.AddQuestion(quiz.Id, dummyQuestionId);

            //assert
            QuizEditModel savedQuiz = _quizBackofficeService.GetAll().First(q => q.Id == quiz.Id);

            Assert.Contains(savedQuiz.Questions, q => q.Id == dummyQuestionId);
        }
コード例 #2
0
 public IActionResult QuizQuestions([FromBody] QuizToQuestionRelation relation)
 {
     _quizBackofficeService.AddQuestion(relation.QuizId, relation.QuestionId);
     return(Ok());
 }