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