public void Wraptest_WhenLongLine_ThenBreakAtSpaceOrLineLength() { string wrapped = WordWrapper.Wrap("word word word", 8); Assert.AreEqual("word\nword\nword", wrapped); }
public void Wraptest_WhenLineShorterThanMax_ThenWrappedLineSame() { string wrapped = WordWrapper.Wrap("word", 5); Assert.AreEqual("word", wrapped); }
public void Wraptest_WhenLineLengthAtLetter_ThenWrapAtFirstSpaceLeftOfLineLength() { string wrapped = WordWrapper.Wrap("word word word", 12); Assert.AreEqual("word word\nword", wrapped); }
public void WrapTest_WhenVeryLongWord_ThenBreakAtLineLengthAnyway() { string wrapped = WordWrapper.Wrap("texttext text", 4); Assert.AreEqual("text\ntext\ntext", wrapped); }
public void Wraptest_WhenInEmpty_ThenOutEmpty() { string wrapped = WordWrapper.Wrap("", 2); Assert.AreEqual("", wrapped); }
public void WrapTest_WhenSpaceAtLineLenght_ThenBreakAtSpace() { string wrapped = WordWrapper.Wrap("text text text", 10); Assert.AreEqual("text text\ntext", wrapped, "wrap at Space and Linelength not working"); }
public void WrapTest_WhenSpace2BeforeLineLength_ThenBreakBeforeSpace() { string wrapped = WordWrapper.Wrap("text text text", 11); Assert.AreEqual("text text\ntext", wrapped); }
public void WrapTest_WhenEmpty_ThenReturnEmpty() { Assert.AreEqual("", WordWrapper.Wrap("", 10), "empty string not properly wrapped"); }
public void WrapTest_WhenShorterThanLine_ThenReturnLineUnchanged() { Assert.AreEqual("Text", WordWrapper.Wrap("Text", 10), "short string needs no wrapping"); }
public void Wrap_ShouldReturnStringWithLineBreaks(string input, int columnLength, string expectedResult) { var result = WordWrapper.Wrap(input, columnLength); result.Should().Be(expectedResult); }
public void WrapTest_WhenLineWithSpaceAfterLineMax_ThenBreakAtLastSpace() { Assert.AreEqual("word word\nword", WordWrapper.Wrap("word word word", 9)); Assert.AreEqual("word word\nword", WordWrapper.Wrap("word word word", 11)); Assert.AreEqual("word\nword\nword", WordWrapper.Wrap("word word word", 8)); }
public void WrapTest_WhenLineWithSpace_ThenBreakAtLastSpace() { Assert.AreEqual("word word\nword", WordWrapper.Wrap("word word word", 10)); }
public void WrapTest_WhenLongLineNoSpace_ThenNoBreakAtLineLength() { Assert.AreEqual("longw\nord", WordWrapper.Wrap("longword", 5)); Assert.AreEqual("word\nword\nword", WordWrapper.Wrap("wordwordword", 4)); }
public void WrapTest_WhenShortLine_ThenNoBreak() { Assert.AreEqual("", WordWrapper.Wrap("", 5)); Assert.AreEqual("word", WordWrapper.Wrap("word", 5)); }