Ejemplo n.º 1
0
        public void ShouldGetQuestion()
        {
            var expectedQuestions = new Questionnaire()
            {
                Questions = new List <string>()
                {
                    "question1"
                }
            };
            var fakeQuestionService = new FakeQuestionnaireService()
            {
                ExpectedQuestions = expectedQuestions
            };
            var questionsController = new QuestionsController(fakeQuestionService);

            var question = questionsController.Get(0);

            Assert.That(question, Is.EqualTo(expectedQuestions.Questions[0]));
        }
Ejemplo n.º 2
0
        public void ShouldGetQuestions()
        {
            //Arrange
            var expectedTitle     = "My expected questions";
            var expectedQuestions = new Questionnaire()
            {
                Title = expectedTitle
            };
            var fakeQuestionService = new FakeQuestionnaireService()
            {
                ExpectedQuestions = expectedQuestions
            };
            var questionsController = new QuestionsController(fakeQuestionService);

            //Act
            var questions = questionsController.Get();

            //Assert
            Assert.That(questions.Title, Is.EqualTo(expectedTitle));
        }