Example #1
0
        public void WriteContentSplitsAsExpected(string source, int width, IEnumerable <Span> expectedSpans)
        {
            var js    = new JustifiedString(source);
            var spans = js.SplitToWidth(width).ToArray();

            spans.ShouldBe(expectedSpans);
        }
Example #2
0
        public void ConstructWithSpaceIndentSetsProperties()
        {
            var js = new JustifiedString("  test");

            js.Indent.ShouldBe(2);
            js.StartIndex.ShouldBe(2);
        }
Example #3
0
        public void ConstructWithNoContentReturnsEmpty()
        {
            var empty = new JustifiedString(null);

            empty.Source.ShouldBeNull();
            empty.StartIndex.ShouldBe(0);
            empty.Indent.ShouldBe(0);
        }