Beispiel #1
0
        public void AppendWrappedLineIndentsAroundEmbeddedNewLines()
        {
            var builder = new StringBuilder();

            builder.AppendWrappedLine("hello\nworld", 80, 4);
            builder.ToString().Should().Be("    hello" + Environment.NewLine + "    world" + Environment.NewLine);
        }
Beispiel #2
0
        public void AppendWrappedLineWithIndent()
        {
            var builder = new StringBuilder();

            builder.AppendWrappedLine("hello", 3, 2);
            builder.ToString().Should().Be("  h" + Environment.NewLine + "  e" + Environment.NewLine + "  l" + Environment.NewLine + "  l" + Environment.NewLine + "  o" + Environment.NewLine);
        }
Beispiel #3
0
        public void AppendWrappedLineWithMultipleTerminatingNewLines()
        {
            var builder = new StringBuilder();

            builder.AppendWrappedLine("hello\n\n\n", 80);
            builder.ToString().Should().Be("hello" + Environment.NewLine + Environment.NewLine + Environment.NewLine + Environment.NewLine);
        }
Beispiel #4
0
        public void AppendWrappedLineNeedsToWrap()
        {
            var builder = new StringBuilder();

            builder.AppendWrappedLine("hello", 3);
            builder.ToString().Should().Be("hel" + Environment.NewLine + "lo" + Environment.NewLine);
        }
Beispiel #5
0
 public void AppendWrappedLineIgnoresContentsOfBuilder()
 {
     var builder = new StringBuilder();
     builder.Append("PREFIX");
     builder.AppendWrappedLine("hello", 3);
     builder.ToString().Should().Be("PREFIXhel\r\nlo\r\n");
 }
Beispiel #6
0
        public void AppendWrappedLineShortText()
        {
            var builder = new StringBuilder();

            builder.AppendWrappedLine("hello", 80);
            builder.ToString().Should().Be("hello" + Environment.NewLine);
        }
Beispiel #7
0
        public void AppendWrappedLineThrowsOnZeroWidth()
        {
            var builder = new StringBuilder();

            Action append = () => builder.AppendWrappedLine("text", 0);
            append.ShouldThrow<ArgumentOutOfRangeException>();
        }
Beispiel #8
0
        public void AppendWrappedLineIgnoresContentsOfBuilder()
        {
            var builder = new StringBuilder();

            builder.Append("PREFIX");
            builder.AppendWrappedLine("hello", 3);
            builder.ToString().Should().Be("PREFIXhel" + Environment.NewLine + "lo" + Environment.NewLine);
        }
        public void AppendWrappedLineThrowsOnZeroWidth()
        {
            var builder = new StringBuilder();

            Action append = () => builder.AppendWrappedLine("text", 0);

            append.ShouldThrow <ArgumentOutOfRangeException>();
        }
Beispiel #10
0
 public void AppendWrappedLineIndentsAroundEmbeddedNewLines()
 {
     var builder = new StringBuilder();
     builder.AppendWrappedLine("hello\nworld", 80, 4);
     builder.ToString().Should().Be("    hello\r\n    world\r\n");
 }
Beispiel #11
0
 public void AppendWrappedLineWithMultipleTerminatingNewLines()
 {
     var builder = new StringBuilder();
     builder.AppendWrappedLine("hello\n\n\n", 80);
     builder.ToString().Should().Be("hello\r\n\r\n\r\n\r\n");
 }
Beispiel #12
0
 public void AppendWrappedLineWithIndent()
 {
     var builder = new StringBuilder();
     builder.AppendWrappedLine("hello", 3, 2);
     builder.ToString().Should().Be("  h\r\n  e\r\n  l\r\n  l\r\n  o\r\n");
 }
Beispiel #13
0
 public void AppendWrappedLineNeedsToWrap()
 {
     var builder = new StringBuilder();
     builder.AppendWrappedLine("hello", 3);
     builder.ToString().Should().Be("hel\r\nlo\r\n");
 }
Beispiel #14
0
 public void AppendWrappedLineShortText()
 {
     var builder = new StringBuilder();
     builder.AppendWrappedLine("hello", 80);
     builder.ToString().Should().Be("hello\r\n");
 }