示例#1
0
        public void Divided_Text_In_Line_Is_Correct()
        {
            var textDivider = new TextDivider();
            var result      = textDivider.DivideText("þodis þodis þodis", 13);

            ReadStringLines(result, (line) => Assert.IsTrue(line.Count(c => !Char.IsWhiteSpace(c)) <= 13));

            var result2 = textDivider.DivideText("ðiuolaikiðkas ir mano þodis", 7);

            ReadStringLines(result2, (line) => Assert.IsTrue(line.Count(c => !Char.IsWhiteSpace(c)) <= 7));
        }
示例#2
0
        public void Divides_Text_To_Lines_Correctly()
        {
            var textDivider = new TextDivider();
            var result      = textDivider.DivideText("þodis þodis þodis", 13);

            Assert.AreEqual(2, Regex.Matches(result, "\n").Count);

            var result2 = textDivider.DivideText("ðiuolaikiðkas ir mano þodis", 7);

            Assert.AreEqual(4, Regex.Matches(result2, "\n").Count);
        }