コード例 #1
0
        public void Setup()
        {
            var questions = new List <Question>()
            {
                new Question(Guid.NewGuid(), "Question 1", new List <QuestionAnswer>()
                {
                    new QuestionAnswer(Guid.NewGuid(), "", true)
                }),
                new Question(Guid.NewGuid(), "Question 2", new List <QuestionAnswer>()
                {
                    new QuestionAnswer(Guid.NewGuid(), "", true)
                }),
                new Question(Guid.NewGuid(), "Question 3", new List <QuestionAnswer>()
                {
                    new QuestionAnswer(Guid.NewGuid(), "", true)
                }),
                new Question(Guid.NewGuid(), "Question 4", new List <QuestionAnswer>()
                {
                    new QuestionAnswer(Guid.NewGuid(), "", true)
                }),
            };

            var questionRepo = Substitute.For <IQuestionRepository>();

            questionRepo.GetAll().ReturnsForAnyArgs(questions);

            var validator = new StartQuizCommandValidator();

            _service = new QuizService(questionRepo, validator);
        }
コード例 #2
0
 public void Setup()
 {
     _validator = new StartQuizCommandValidator();
 }