Exemplo n.º 1
0
        public void TestLength()
        {
            HpackDynamicTable table = new HpackDynamicTable(100);

            Assert.Equal(0, table.Length());
            HpackHeaderField entry = new HpackHeaderField((AsciiString)"foo", (AsciiString)"bar");

            table.Add(entry);
            Assert.Equal(1, table.Length());
            table.Clear();
            Assert.Equal(0, table.Length());
        }
Exemplo n.º 2
0
        public void TestGetEntry()
        {
            HpackDynamicTable table = new HpackDynamicTable(100);
            HpackHeaderField  entry = new HpackHeaderField((AsciiString)"foo", (AsciiString)"bar");

            table.Add(entry);
            Assert.Equal(entry, table.GetEntry(1));
            table.Clear();
            try
            {
                table.GetEntry(1);
                Assert.False(true);
            }
            catch (IndexOutOfRangeException)
            {
                //success
            }
        }