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_WillSetQuestionName() { var singleChoiceQuestionFactory = new SingleChoiceQuestionFactory(); ChoiceQuestion choiceQuestion = singleChoiceQuestionFactory.CreateChoiceQuestion("SC Sex 2 Female Male"); Assert.IsInstanceOf(typeof(SingleChoiceQuestion), choiceQuestion); Assert.AreEqual("Sex", choiceQuestion.Name); }
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]); }