예제 #1
0
 public void EncoderAndDecoderAreClosedOnChannelInactive()
 {
     _handler = NewHandler();
     _handler.ChannelActive(_ctx.Object);
     _channel.Setup(x => x.IsActive).Returns(false);
     _handler.ChannelInactive(_ctx.Object);
     _encoder.Verify(x => x.Close());
     _decoder.Verify(x => x.Close());
 }
예제 #2
0
 public void ChannelClosedDoesNotThrowPrefaceException()
 {
     _connection.Setup(x => x.IsServer).Returns(true);
     _handler = NewHandler();
     _channel.Setup(x => x.IsActive).Returns(false);
     _handler.ChannelInactive(_ctx.Object);
     _frameWriter.Verify(
         x => x.WriteGoAwayAsync(
             It.IsAny <IChannelHandlerContext>(),
             It.IsAny <int>(),
             It.IsAny <Http2Error>(),
             It.IsAny <IByteBuffer>(),
             It.IsAny <IPromise>()),
         Times.Never());
     _frameWriter.Verify(
         x => x.WriteRstStreamAsync(
             It.IsAny <IChannelHandlerContext>(),
             It.IsAny <int>(),
             It.IsAny <Http2Error>(),
             It.IsAny <IPromise>()),
         Times.Never());
 }
예제 #3
0
 public void ChannelInactiveShouldCloseStreams()
 {
     _handler = NewHandler();
     _handler.ChannelInactive(_ctx.Object);
     _connection.Verify(x => x.CloseAsync(It.IsAny <IPromise>()));
 }