public void WriteContentSplitsAsExpected(string source, int width, IEnumerable <Span> expectedSpans) { var js = new JustifiedString(source); var spans = js.SplitToWidth(width).ToArray(); spans.ShouldBe(expectedSpans); }
public void ConstructWithSpaceIndentSetsProperties() { var js = new JustifiedString(" test"); js.Indent.ShouldBe(2); js.StartIndex.ShouldBe(2); }
public void ConstructWithNoContentReturnsEmpty() { var empty = new JustifiedString(null); empty.Source.ShouldBeNull(); empty.StartIndex.ShouldBe(0); empty.Indent.ShouldBe(0); }