Beispiel #1
0
        public void CanParseMultiLineXmlWithEmptyLinesFromSequence()
        {
            var bytes = Encoding.UTF8.GetBytes(MultiLineWithEmptyLines);

            var segment1 = new TestSegment(bytes.AsMemory(0, 10), 0);
            var segment2 = new TestSegment(bytes.AsMemory(10, 10), 10);
            var segment3 = new TestSegment(bytes.AsMemory(20), 20);

            segment1.SetNext(segment2);
            segment2.SetNext(segment3);

            var sequence = new ReadOnlySequence <byte>(segment1, 0, segment3, segment3.Memory.Length);

            using (var reader = MemoryReader.Create(sequence))
            {
                var xml = XElement.Load(reader);
                Assert.Equal("root", xml.Name);
            }
        }
Beispiel #2
0
 public void SetNext(TestSegment next)
 {
     Next = next;
 }