Exemple #1
0
        public async Task WriteGoAway_UnsetsReservedBit()
        {
            // Arrange
            var pipe        = new Pipe(new PipeOptions(_dirtyMemoryPool, PipeScheduler.Inline, PipeScheduler.Inline));
            var frameWriter = new Http2FrameWriter(pipe.Writer, null, null, null, null, null, null, _dirtyMemoryPool, new Mock <IKestrelTrace>().Object);

            // Act
            await frameWriter.WriteGoAwayAsync(1, Http2ErrorCode.NO_ERROR);

            // Assert
            var payload = await pipe.Reader.ReadForLengthAsync(Http2FrameReader.HeaderLength + 4);

            Assert.Equal(new byte[] { 0x00, 0x00, 0x00, 0x01 }, payload.Skip(Http2FrameReader.HeaderLength).Take(4).ToArray());
        }