public QuizBackofficeService_Tests() { (var quiz, var questions) = QuizGenerator.GetQuizWithQuestions(); var quizMockRepo = new InMemoryRepository <Quiz>(quiz.ToEnumerableOfOne()); var questionMockRepo = new InMemoryRepository <Question>(questions.Append(stubQuestionOutsideQuiz)); var service = new QuizBackofficeService(quizMockRepo, questionMockRepo); _quizBackofficeService = service; }
public QuestionEditModel Create(QuestionCreateModel question) { Guid id = _questionRepository.Add(MapQuestionCreateModelToPersistence(question)); return(QuizBackofficeService.MapQuestionPersistnenceToEditModel(_questionRepository.Get(id))); }