Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = IllegalStateException.class) public void shouldThrowWhenWriteAndFlushingOnDisposedChannel()
        public virtual void ShouldThrowWhenWriteAndFlushingOnDisposedChannel()
        {
            // given
            SimpleNettyChannel channel = new SimpleNettyChannel(_nettyChannel, NullLog.Instance);

            channel.Dispose();

            // when
            channel.WriteAndFlush(new object());

            // then expected to throw
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldWriteAndFlushOnNettyChannel()
        public virtual void ShouldWriteAndFlushOnNettyChannel()
        {
            // given
            SimpleNettyChannel channel = new SimpleNettyChannel(_nettyChannel, NullLog.Instance);

            // when
            object        msg           = new object();
            Future <Void> writeComplete = channel.WriteAndFlush(msg);

            // then
            assertTrue(writeComplete.Done);
            assertEquals(msg, _nettyChannel.readOutbound());
        }