//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static org.neo4j.logging.AssertableLogProvider emulateFailureWritingError(org.neo4j.bolt.runtime.Neo4jError error, Throwable errorDuringWrite) throws Exception
        private static AssertableLogProvider EmulateFailureWritingError(Neo4jError error, Exception errorDuringWrite)
        {
            AssertableLogProvider     logProvider     = new AssertableLogProvider();
            BoltResponseMessageWriter responseHandler = NewResponseHandlerMock(error.Fatal, errorDuringWrite);

            MessageProcessingHandler handler = new MessageProcessingHandler(responseHandler, mock(typeof(BoltConnection)), logProvider.GetLog("Test"));

            handler.MarkFailed(error);
            handler.OnFinish();

            return(logProvider);
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCallHaltOnUnexpectedFailures() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldCallHaltOnUnexpectedFailures()
        {
            // Given
            BoltResponseMessageWriter msgWriter = NewResponseHandlerMock();

            doThrow(new Exception("Something went horribly wrong")).when(msgWriter).write(any(typeof(SuccessMessage)));

            BoltConnection           connection = mock(typeof(BoltConnection));
            MessageProcessingHandler handler    = new MessageProcessingHandler(msgWriter, connection, mock(typeof(Log)));

            // When
            handler.OnFinish();

            // Then
            verify(connection).stop();
        }