//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldLogConnectionResetErrorsAtWarningLevelAndClosesContext() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldLogConnectionResetErrorsAtWarningLevelAndClosesContext()
        {
            // Given
            ChannelHandlerContext     context = ChannelHandlerContextMock();
            AssertableLogProvider     logging = new AssertableLogProvider();
            TransportSelectionHandler handler = new TransportSelectionHandler(null, null, false, false, logging, null);

            IOException connResetError = new IOException("Connection reset by peer");

            // When
            handler.ExceptionCaught(context, connResetError);

            // Then
            verify(context).close();
            logging.AssertExactly(inLog(typeof(TransportSelectionHandler)).warn("Fatal error occurred when initialising pipeline, " + "remote peer unexpectedly closed connection: %s", context.channel()));
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldLogOnUnexpectedExceptionsAndClosesContext() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldLogOnUnexpectedExceptionsAndClosesContext()
        {
            // Given
            ChannelHandlerContext     context = ChannelHandlerContextMock();
            AssertableLogProvider     logging = new AssertableLogProvider();
            TransportSelectionHandler handler = new TransportSelectionHandler(null, null, false, false, logging, null);

            // When
            Exception cause = new Exception("Oh no!");

            handler.ExceptionCaught(context, cause);

            // Then
            verify(context).close();
            logging.AssertExactly(inLog(typeof(TransportSelectionHandler)).error(equalTo("Fatal error occurred when initialising pipeline: " + context.channel()), sameInstance(cause)));
        }