Esempio n. 1
0
        public void extract_paragraph_single_sentence()
        {
            string sampleText           = "This is a test.";
            BaseTextSampleGenerator gen = new BaseTextSampleGenerator();
            string actual = gen.GetParagraphFromTextBlock(sampleText);

            Assert.That(actual, Is.EqualTo(sampleText));
        }
Esempio n. 2
0
        public void extract_paragraph_sentence_lengths_up_to_max_equal_to_unaltered_input()
        {
            string        SAMPLE_SENTENCE = "This is a test. ";
            StringBuilder paraBuilder     = new StringBuilder();

            for (int i = 0; i < BaseTextSampleGenerator.NUM_SENTENCES_IN_A_PARAGRAPH; i++)
            {
                paraBuilder.AppendFormat(SAMPLE_SENTENCE);
                string paragraphBlock = paraBuilder.ToString();

                BaseTextSampleGenerator gen = new BaseTextSampleGenerator();
                string actual = gen.GetParagraphFromTextBlock(paragraphBlock);

                Assert.That(actual, Is.EqualTo(paragraphBlock));
            }
        }