示例#1
0
        public void InputsLengthGreaterThanLineLimitButDoesNotBreakTheWOrdAtTheEnd()
        {
            string input     = "a lot of words for a single line";
            int    lineLimit = 10;
            string expected  = "a lot of\nwords for\na single\nline";

            Assert.AreEqual(expected, WordWrap.wrap(input, lineLimit));
        }
示例#2
0
        public void InputsLengthLessThanTheLineLimit_InsertsLineBreakAfterTheWord()
        {
            string input     = "Test";
            int    lineLimit = 7;
            string expected  = "Test";

            Assert.AreEqual(expected, WordWrap.wrap(input, lineLimit));
        }
示例#3
0
        public void InputsLengthGreaterThanLineLimit_InsertsLineBreakAfterEachWord()
        {
            string input     = "Hello World";
            int    lineLimit = 7;
            string expected  = "Hello\nWorld";

            Assert.AreEqual(expected, WordWrap.wrap(input, lineLimit));
        }
示例#4
0
        public void InputOfEmptyString_ReturnsAEmptyString()
        {
            string input     = "";
            int    lineLimit = 0;
            string expected  = "";

            Assert.AreEqual(expected, WordWrap.wrap(input, lineLimit));
        }