public void ShouldIndentProperly()
        {
            var expected = new StringBuilder().AppendLine("header-1")
                                              .AppendLine("  header-1.1 foo")
                                              .AppendLine("    item-1.1.1")
                                              .AppendLine("    item-1.1.2")
                                              .AppendLine("  header-1.2")
                                              .ToString();

            var writer = new TestWriter();
            writer.WriteLine("header-1");
            using (writer.Indent(2))
            {
                writer.Write("header-1.1");
                using (writer.Indent(2))
                {
                    writer.WriteLine(" foo");
                    writer.WriteLine("item-1.1.1");
                    writer.WriteLine("item-1.1.2");
                }
                writer.WriteLine("header-1.2");
            }

            writer.ToString().ShouldBe(expected);
        }
        public void ShouldWrapProperly()
        {
            var expected = new StringBuilder().AppendLine("123 123")
                                              .AppendLine("123")
                                              .AppendLine()
                                              .AppendLine("12341234")
                                              .AppendLine("1234")
                                              .AppendLine()
                                              .AppendLine("1234567")
                                              .AppendLine("1234567")
                                              .AppendLine()
                                              .AppendLine("abcdefghij")
                                              .AppendLine("klmnopqrst")
                                              .AppendLine("uvwxyz")
                                              .ToString();

            var writer = new TestWriter(10);

            writer.WriteLine("123 123 123");
            writer.WriteLine();

            writer.Write("1234");
            writer.Write("1234");
            writer.Write("1234");
            writer.WriteLine();
            writer.WriteLine();

            writer.WriteLine("1234567 \r\n 1234567");
            writer.WriteLine();

            writer.WriteLine("abcdefghijklmnopqrstuvwxyz");

            writer.ToString().ShouldBe(expected);
        }
        public void ShouldBeAbleToUseNonBreakingSpaces()
        {
            var expected = new StringBuilder().AppendLine("1234")
                                              .AppendLine("1234 1234")
                                              .AppendLine("1234")
                                              .ToString();

            var writer = new TestWriter(10);

            writer.Write("1234");
            writer.Write("1234 1234".ReplaceSpaceWithNonBreakingSpace());
            writer.WriteLine("1234");

            writer.ToString().ShouldBe(expected);
        }