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()); }
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()); }
public void ChannelInactiveShouldCloseStreams() { _handler = NewHandler(); _handler.ChannelInactive(_ctx.Object); _connection.Verify(x => x.CloseAsync(It.IsAny <IPromise>())); }