public void QuotedCommasArePartOfValue()
        {
            var segments = new HeaderSegmentCollection(new[] { "\"   value  ,  yep   \"" }).ToArray();

            segments.Count().ShouldBe(1);
            segments[0].Formatting.Value.ShouldBe(string.Empty);
            segments[0].Data.Value.ShouldBe("\"   value  ,  yep   \"");
        }
        public void CommasSplitUp()
        {
            var segments = new HeaderSegmentCollection(new[] { " \r\n \t value, yep" }).ToArray();

            segments.Count().ShouldBe(2);
            segments[0].Formatting.Value.ShouldBe(" \r\n \t ");
            segments[0].Data.Value.ShouldBe("value");
            segments[1].Formatting.Value.ShouldBe(", ");
            segments[1].Data.Value.ShouldBe("yep");
        }
        public void TrailingWhitespaceCausesFormattingSegmentWithNoData()
        {
            var segments = new HeaderSegmentCollection(new[] { "x " }).ToArray();

            segments.Count().ShouldBe(2);
            segments[0].Formatting.Value.ShouldBe(string.Empty);
            segments[0].Data.Value.ShouldBe("x");
            segments[1].Formatting.Value.ShouldBe(" ");
            segments[1].Data.Value.ShouldBe(null);
        }
        public void WhitespaceAddedToNextFormatting()
        {
            var segments = new HeaderSegmentCollection(new[] { "value  ,  yep" }).ToArray();

            segments.Count().ShouldBe(2);
            segments[0].Formatting.Value.ShouldBe(string.Empty);
            segments[0].Data.Value.ShouldBe("value");
            segments[1].Formatting.Value.ShouldBe("  ,  ");
            segments[1].Data.Value.ShouldBe("yep");
        }
        public void CommasSplitUp()
        {
            var segments = new HeaderSegmentCollection(new[] { " \r\n \t value, yep" }).ToArray();

            segments.Count().ShouldBe(2);
            segments[0].Formatting.Value.ShouldBe(" \r\n \t ");
            segments[0].Data.Value.ShouldBe("value");
            segments[1].Formatting.Value.ShouldBe(", ");
            segments[1].Data.Value.ShouldBe("yep");
        }
        public void TailingWhitespaceHasThatEffectOn()
        {
            var segments = new HeaderSegmentCollection(new[] { "   value  ,  yep   " }).ToArray();

            segments.Count().ShouldBe(3);
            segments[0].Formatting.Value.ShouldBe("   ");
            segments[0].Data.Value.ShouldBe("value");
            segments[1].Formatting.Value.ShouldBe("  ,  ");
            segments[1].Data.Value.ShouldBe("yep");
            segments[2].Formatting.Value.ShouldBe("   ");
            segments[2].Data.Value.ShouldBe(null);
        }
        public void WhitespaceAddedToNextFormatting()
        {
            var segments = new HeaderSegmentCollection(new[] { "value  ,  yep" }).ToArray();

            segments.Count().ShouldBe(2);
            segments[0].Formatting.Value.ShouldBe(string.Empty);
            segments[0].Data.Value.ShouldBe("value");
            segments[1].Formatting.Value.ShouldBe("  ,  ");
            segments[1].Data.Value.ShouldBe("yep");
        }
        public void TrailingWhitespaceCausesFormattingSegmentWithNoData()
        {
            var segments = new HeaderSegmentCollection(new[] { "x " }).ToArray();

            segments.Count().ShouldBe(2);
            segments[0].Formatting.Value.ShouldBe(string.Empty);
            segments[0].Data.Value.ShouldBe("x");
            segments[1].Formatting.Value.ShouldBe(" ");
            segments[1].Data.Value.ShouldBe(null);
        }
        public void TailingWhitespaceHasThatEffectOn()
        {
            var segments = new HeaderSegmentCollection(new[] { "   value  ,  yep   " }).ToArray();

            segments.Count().ShouldBe(3);
            segments[0].Formatting.Value.ShouldBe("   ");
            segments[0].Data.Value.ShouldBe("value");
            segments[1].Formatting.Value.ShouldBe("  ,  ");
            segments[1].Data.Value.ShouldBe("yep");
            segments[2].Formatting.Value.ShouldBe("   ");
            segments[2].Data.Value.ShouldBe(null);
        }
        public void QuotedCommasArePartOfValue()
        {
            var segments = new HeaderSegmentCollection(new[] { "\"   value  ,  yep   \"" }).ToArray();

            segments.Count().ShouldBe(1);
            segments[0].Formatting.Value.ShouldBe(string.Empty);
            segments[0].Data.Value.ShouldBe("\"   value  ,  yep   \"");
        }