コード例 #1
0
        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;
        }
コード例 #2
0
        public QuestionEditModel Create(QuestionCreateModel question)
        {
            Guid id = _questionRepository.Add(MapQuestionCreateModelToPersistence(question));

            return(QuizBackofficeService.MapQuestionPersistnenceToEditModel(_questionRepository.Get(id)));
        }