2 writes to CurrentSegment
Microsoft.AspNetCore.SignalR.Common.Tests (2)
Internal\Protocol\Utf8BufferTextWriterTests.cs (2)
356CurrentSegment = Memory<byte>.Empty; 377CurrentSegment = new Memory<byte>(new byte[_segmentSize]);
26 references to CurrentSegment
Microsoft.AspNetCore.SignalR.Common.Tests (26)
Internal\Protocol\Utf8BufferTextWriterTests.cs (26)
27Assert.Equal((byte)'[', bufferWriter.CurrentSegment.Span[0]); 32Assert.Equal((byte)'"', bufferWriter.CurrentSegment.Span[1]); 45Assert.Equal((byte)0xC2, bufferWriter.CurrentSegment.Span[2]); 46Assert.Equal((byte)0xA3, bufferWriter.CurrentSegment.Span[3]); 47Assert.Equal((byte)0xC2, bufferWriter.CurrentSegment.Span[4]); 48Assert.Equal((byte)0xA3, bufferWriter.CurrentSegment.Span[5]); 49Assert.Equal((byte)'"', bufferWriter.CurrentSegment.Span[6]); 54Assert.Equal((byte)']', bufferWriter.CurrentSegment.Span[7]); 69Assert.Equal((byte)0xC2, bufferWriter.CurrentSegment.Span[0]); 70Assert.Equal((byte)0xA3, bufferWriter.CurrentSegment.Span[1]); 83Assert.Equal((byte)'[', bufferWriter.CurrentSegment.Span[0]); 88Assert.Equal((byte)'"', bufferWriter.CurrentSegment.Span[1]); 99Assert.Equal((byte)'"', bufferWriter.CurrentSegment.Span[4002]); 105var result = Encoding.UTF8.GetString(bufferWriter.CurrentSegment.Slice(0, bufferWriter.Position).ToArray()); 144var actualData = bufferWriter.CurrentSegment.Slice(0, 4).ToArray(); 173var actualData = bufferWriter.CurrentSegment.Slice(0, 4).ToArray(); 191Assert.Equal((byte)'w', bufferWriter.CurrentSegment.Span[0]); 368if ((sizeHint == 0 && CurrentSegment.Length == Position) || (CurrentSegment.Length - Position < sizeHint)) 373_completedSegments.Add(CurrentSegment.Slice(0, Position)); 381return CurrentSegment.Slice(Position, CurrentSegment.Length - Position); 391if (CurrentSegment.IsEmpty && _completedSegments.Count == 0) 409CurrentSegment.Slice(0, Position).CopyTo(result.AsMemory(totalWritten, Position)); 422if (CurrentSegment.Length > 0) 424list.Add(CurrentSegment.Slice(0, Position));