Ejemplo n.º 1
0
        public void TestAddSequenceTask()
        {
            Quiz quiz = new Quiz("MyQuiz");

            quiz.AddNewTask(new CreatorSequenceTask());
            Assert.AreEqual(quiz.Tasks.Count, 1);
            SequenceTask task = quiz.Tasks[0] as SequenceTask;

            Assert.IsNotNull(task);
            Assert.AreEqual(task.Question, "Введите вопрос...");
            Assert.AreEqual(task.Point, 1);
            Assert.AreEqual(task.Answers.Count, 0);
            Assert.AreEqual(task.Answers.GetType(), typeof(ObservableCollection <SequenceAnswer>));
        }
Ejemplo n.º 2
0
        public void TestAddMultipleResponseTask()
        {
            Quiz quiz = new Quiz("MyQuiz");

            quiz.AddNewTask(new CreatorMultipleResponseTask());
            Assert.AreEqual(quiz.Tasks.Count, 1);
            MultipleResponseTask task = quiz.Tasks[0] as MultipleResponseTask;

            Assert.IsNotNull(task);
            Assert.AreEqual(task.Question, "Введите вопрос...");
            Assert.AreEqual(task.Point, 1);
            Assert.IsFalse(task.SwapAnswer);
            Assert.AreEqual(task.Answers.Count, 0);
            Assert.AreEqual(task.Answers.GetType(), typeof(ObservableCollection <MultipleAnswer>));
        }