src\Shared\test\Shared.Tests\runtime\Http2\HPackDecoderTest.cs (84)
122_decoder.Decode(_indexedHeaderStatic, endHeaders: true, handler: _handler);
123Assert.Equal("GET", _handler.DecodedHeaders[":method"]);
125Assert.Equal(":method", _handler.DecodedStaticHeaders[H2StaticTable.MethodGet].Key);
126Assert.Equal("GET", _handler.DecodedStaticHeaders[H2StaticTable.MethodGet].Value);
136_decoder.Decode(encoded, endHeaders: true, handler: _handler);
137Assert.Equal(_headerValueString, _handler.DecodedHeaders[_userAgentString]);
139Assert.Equal(_userAgentString, _handler.DecodedStaticHeaders[H2StaticTable.UserAgent].Key);
140Assert.Equal(_headerValueString, _handler.DecodedStaticHeaders[H2StaticTable.UserAgent].Value);
150_decoder.Decode(_indexedHeaderDynamic, endHeaders: true, handler: _handler);
151Assert.Equal(_headerValueString, _handler.DecodedHeaders[_headerNameString]);
168_decoder.Decode(encoded, endHeaders: true, handler: _handler);
170Assert.Equal(_literalHeaderNameString, _handler.DecodedHeaders[_headerNameString]); // but we got the header anyway
177_decoder.Decode(_indexedHeaderDynamic, endHeaders: true, handler: _handler));
179Assert.Empty(_handler.DecodedHeaders);
253HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(new byte[] { 0x7e }, endHeaders: true, handler: _handler));
255Assert.Empty(_handler.DecodedHeaders);
277HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
279Assert.Empty(_handler.DecodedHeaders);
301HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
303Assert.Empty(_handler.DecodedHeaders);
325HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
327Assert.Empty(_handler.DecodedHeaders);
371HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
373Assert.Empty(_handler.DecodedHeaders);
403HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(new byte[] { 0x0f, 0x2f }, endHeaders: true, handler: _handler));
405Assert.Empty(_handler.DecodedHeaders);
498HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(new byte[] { 0x1f, 0x2f }, endHeaders: true, handler: _handler));
500Assert.Empty(_handler.DecodedHeaders);
511_decoder.Decode(encoded, endHeaders: true, handler: _handler);
513Assert.Single(_handler.DecodedHeaders);
514Assert.True(_handler.DecodedHeaders.ContainsKey(_literalHeaderNameString));
515Assert.Equal(_headerValueString, _handler.DecodedHeaders[_literalHeaderNameString]);
526_decoder.Decode(encoded[..1], endHeaders: false, handler: _handler);
527_decoder.Decode(encoded[1..], endHeaders: true, handler: _handler);
529Assert.Single(_handler.DecodedHeaders);
530Assert.True(_handler.DecodedHeaders.ContainsKey(_literalHeaderNameString));
531Assert.Equal(_headerValueString, _handler.DecodedHeaders[_literalHeaderNameString]);
542_decoder.Decode(encoded[..(_literalHeaderNameString.Length / 2)], endHeaders: false, handler: _handler);
543_decoder.Decode(encoded[(_literalHeaderNameString.Length / 2)..], endHeaders: true, handler: _handler);
545Assert.Single(_handler.DecodedHeaders);
546Assert.True(_handler.DecodedHeaders.ContainsKey(_literalHeaderNameString));
547Assert.Equal(_headerValueString, _handler.DecodedHeaders[_literalHeaderNameString]);
558_decoder.Decode(encoded[..^_headerValue.Length], endHeaders: false, handler: _handler);
559_decoder.Decode(encoded[^_headerValue.Length..], endHeaders: true, handler: _handler);
561Assert.Single(_handler.DecodedHeaders);
562Assert.True(_handler.DecodedHeaders.ContainsKey(_literalHeaderNameString));
563Assert.Equal(_headerValueString, _handler.DecodedHeaders[_literalHeaderNameString]);
574_decoder.Decode(encoded[..^(_headerValue.Length - 1)], endHeaders: false, handler: _handler);
575_decoder.Decode(encoded[^(_headerValue.Length - 1)..], endHeaders: true, handler: _handler);
577Assert.Single(_handler.DecodedHeaders);
578Assert.True(_handler.DecodedHeaders.ContainsKey(_literalHeaderNameString));
579Assert.Equal(_headerValueString, _handler.DecodedHeaders[_literalHeaderNameString]);
590_decoder.Decode(encoded[..^(_headerValueString.Length / 2)], endHeaders: false, handler: _handler);
591_decoder.Decode(encoded[^(_headerValueString.Length / 2)..], endHeaders: true, handler: _handler);
593Assert.Single(_handler.DecodedHeaders);
594Assert.True(_handler.DecodedHeaders.ContainsKey(_literalHeaderNameString));
595Assert.Equal(_headerValueString, _handler.DecodedHeaders[_literalHeaderNameString]);
606_decoder.Decode(new byte[] { 0x3e }, endHeaders: true, handler: _handler);
609Assert.Empty(_handler.DecodedHeaders);
621HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(data, endHeaders: true, handler: _handler));
630_decoder.Decode(_indexedHeaderStatic, endHeaders: false, handler: _handler);
631Assert.Equal("GET", _handler.DecodedHeaders[":method"]);
636HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(data, endHeaders: true, handler: _handler));
645_decoder.Decode(_indexedHeaderStatic, endHeaders: true, handler: _handler);
646Assert.Equal("GET", _handler.DecodedHeaders[":method"]);
650_decoder.Decode(new byte[] { 0x3e }, endHeaders: true, handler: _handler);
664_decoder.Decode(new byte[] { 0x3f, 0xe2, 0x1f }, endHeaders: true, handler: _handler));
666Assert.Empty(_handler.DecodedHeaders);
676HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
678Assert.Empty(_handler.DecodedHeaders);
694decoder.Decode(encoded, endHeaders: true, handler: _handler);
696Assert.Equal(string8193, _handler.DecodedHeaders[string8193]);
727var ex = Assert.Throws<HPackDecodingException>(() => decoder.Decode(encoded, endHeaders: true, handler: _handler));
729Assert.Equal(string8191, _handler.DecodedHeaders[string8191]);
730Assert.Equal(string8193, _handler.DecodedHeaders[string8193]);
731Assert.False(_handler.DecodedHeaders.ContainsKey(string8194));
751decoder.Decode(new byte[] { encoded[i] }, endHeaders: end, handler: _handler);
754Assert.Equal(string8193, _handler.DecodedHeaders[string8193]);
776decoder.Decode(segments[i], endHeaders: end, handler: _handler);
779Assert.Equal(string8193, _handler.DecodedHeaders[string8193]);
867HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
869Assert.Empty(_handler.DecodedHeaders);
901HPackDecodingException exception = Assert.Throws<HPackDecodingException>(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler));
904Assert.Empty(_handler.DecodedHeaders);