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); }
public IActionResult QuizQuestions([FromBody] QuizToQuestionRelation relation) { _quizBackofficeService.AddQuestion(relation.QuizId, relation.QuestionId); return(Ok()); }