Ejemplo n.º 1
0
        static void IncrementAndGetStreamShouldSucceed(IHttp2ConnectionEndpoint endpoint)
        {
            IHttp2Stream streamA = endpoint.CreateStream(endpoint.IncrementAndGetNextStreamId, true);
            IHttp2Stream streamB = endpoint.CreateStream(streamA.Id + 2, true);
            IHttp2Stream streamC = endpoint.CreateStream(endpoint.IncrementAndGetNextStreamId, true);

            Assert.Equal(streamB.Id + 2, streamC.Id);
            endpoint.CreateStream(streamC.Id + 2, true);
        }
Ejemplo n.º 2
0
 static void IncrementAndGetStreamShouldRespectOverflow(IHttp2ConnectionEndpoint endpoint, int streamId)
 {
     Assert.True(streamId > 0);
     try
     {
         endpoint.CreateStream(streamId, true);
         streamId = endpoint.IncrementAndGetNextStreamId;
     }
     catch (Exception t)
     {
         Assert.False(true, t.Message);
     }
     Assert.True(streamId < 0);
     endpoint.CreateStream(streamId, true);
 }