public void Create_WhenSC_AlwaysWillCreateASingleChocieQuestion()
        {
            var singleChoiceQuestionFactory = new SingleChoiceQuestionFactory();

            var question = singleChoiceQuestionFactory.Create("SC Sex 2 Female Male");

            Assert.IsInstanceOf(typeof(SingleChoiceQuestion), question);
        }
        public void Create_Always_WillSetTheListOfPossibleAnswers()
        {
            var singleChoiceQuestionFactory = new SingleChoiceQuestionFactory();

            var question = singleChoiceQuestionFactory.Create("SC Sex 2 Female Male");

            Assert.AreEqual(2, question.Items.Count);
        }
        public void CreateChoiceQuestion_WithSC_WillCreateASingleChocieQuestion()
        {
            SingleChoiceQuestionFactory singleChoiceQuestionFactory = new SingleChoiceQuestionFactory();

            var choiceQuestion = singleChoiceQuestionFactory.CreateChoiceQuestion("Q1 Optiuni 2 op1 op2");

            Assert.IsInstanceOf(typeof(SingleChoiceQuestion), choiceQuestion);
        }
        public void Create_Always_WillReturnANewSingleChoiceQuestion()
        {
            var singleChoiceQuestionFactory = new SingleChoiceQuestionFactory();

            ChoiceQuestion choiceQuestion = singleChoiceQuestionFactory.Create("SC Sex 2 Female Male");

            Assert.IsInstanceOf(typeof(SingleChoiceQuestion), choiceQuestion);
        }
Ejemplo n.º 5
0
        public void Create_Always_WillSetQuestionName()
        {
            var singleChoiceQuestionFactory = new SingleChoiceQuestionFactory();

            ChoiceQuestion choiceQuestion = singleChoiceQuestionFactory.CreateChoiceQuestion("SC Sex 2 Female Male");

            Assert.IsInstanceOf(typeof(SingleChoiceQuestion), choiceQuestion);
            Assert.AreEqual("Sex", choiceQuestion.Name);
        }
Ejemplo n.º 6
0
        public void Create_Always_WillSetTheListOfAnswers()
        {
            var singleChoiceQuestionFactory = new SingleChoiceQuestionFactory();

            ChoiceQuestion choiceQuestion = singleChoiceQuestionFactory.CreateChoiceQuestion("SC Sex 2 Female Male");

            Assert.AreEqual(2, choiceQuestion.Items.Count);
            Assert.AreEqual("Female", choiceQuestion.Items[0].Name);
            Assert.AreEqual("Male", choiceQuestion.Items[1].Name);
        }
        public void CreateChoiceQuestion_WithSC_WillCreateASingleChoiceQuestionWithPossibleAnswers()
        {
            SingleChoiceQuestionFactory singleChoiceQuestionFactory = new SingleChoiceQuestionFactory();

            var choiceQuestion = singleChoiceQuestionFactory.CreateChoiceQuestion("Q1 Optiuni 2 op1 op2");

            Assert.That(2, Is.EqualTo(choiceQuestion.PossibleAnswers.Count));
            Assert.AreEqual("op1", choiceQuestion.PossibleAnswers[0]);
            Assert.AreEqual("op2", choiceQuestion.PossibleAnswers[1]);
        }