Beispiel #1
0
        public void TestQuestionsEmpty()
        {
            var content = string.Empty;
            var q       = QAReader.GetQuestions(content);

            Assert.AreEqual(0, q.Count);
        }
Beispiel #2
0
        public void TestQuestionsRNRN()
        {
            var content = "\r\n\r\n";
            var q       = QAReader.GetQuestions(content);

            Assert.AreEqual(0, q.Count);
        }
Beispiel #3
0
        public void TestAnswersRNRNRN()
        {
            var content = "\r\n\r\n\r\n";
            var a       = QAReader.GetAnswers(content);

            Assert.AreEqual(0, a.Count);
        }
Beispiel #4
0
        public void TestAnswersOnlyQuestionRNRNRN()
        {
            var content = "antwort1\r\n\r\n\r\n";
            var a       = QAReader.GetAnswers(content);

            Assert.AreEqual(0, a.Count);
        }
Beispiel #5
0
        public void TestAnswersWithoutQuestions()
        {
            var content = "\r\nantwort1";
            var a       = QAReader.GetAnswers(content);

            Assert.AreEqual(1, a.Count);
            Assert.AreEqual("antwort1", a[0]);
        }
Beispiel #6
0
        public void TestAnswersWithComment()
        {
            var content = "frage1\r\nfrage2\r\n\nantwort1\r\n\r\ntest";
            var a       = QAReader.GetAnswers(content);

            Assert.AreEqual(1, a.Count);
            Assert.AreEqual("antwort1", a[0]);
        }
Beispiel #7
0
        public void TestQuestionsWithAnswers()
        {
            var content = "frage1\r\nfrage2\r\n\nantwort1\r\n\r\ntest";
            var q       = QAReader.GetQuestions(content);

            Assert.AreEqual(2, q.Count);
            Assert.AreEqual("frage1", q[0]);
            Assert.AreEqual("frage2", q[1]);
        }
Beispiel #8
0
        public void TestQuestionsNoRN()
        {
            var content = "frage1\r\nfrage2";
            var q       = QAReader.GetQuestions(content);

            Assert.AreEqual(2, q.Count);
            Assert.AreEqual("frage1", q[0]);
            Assert.AreEqual("frage2", q[1]);
        }
Beispiel #9
0
        public void TestAnswersNoQuestionsMultipleAnswers()
        {
            var content = "\r\nantwort1\r\nantwort2\n";
            var a       = QAReader.GetAnswers(content);

            Assert.AreEqual(2, a.Count);
            Assert.AreEqual("antwort1", a[0]);
            Assert.AreEqual("antwort2", a[1]);
        }