//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldThrowForUnknownMessage() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldThrowForUnknownMessage()
        {
            Neo4jPack_Unpacker unpacker = mock(typeof(Neo4jPack_Unpacker));

            when(unpacker.UnpackStructSignature()).thenReturn('a');

            RequestMessageDecoder    decoder = new TestRequestMessageDecoder('b', ResponseHandlerMock(), mock(typeof(RequestMessage)));
            BoltRequestMessageReader reader  = new TestBoltRequestMessageReader(ConnectionMock(), ResponseHandlerMock(), singletonList(decoder));

            BoltIOException e = assertThrows(typeof(BoltIOException), () => reader.read(unpacker));

            assertEquals(Org.Neo4j.Kernel.Api.Exceptions.Status_Request.InvalidFormat, e.Status());
            assertFalse(e.CausesFailureMessage());
            assertEquals("Message 0x61 is not a valid message signature.", e.Message);
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldHandleErrorThatCausesFailureMessage() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldHandleErrorThatCausesFailureMessage()
        {
            Neo4jPack_Unpacker unpacker = mock(typeof(Neo4jPack_Unpacker));
            BoltIOException    error    = new BoltIOException(Org.Neo4j.Kernel.Api.Exceptions.Status_General.UnknownError, "Hello");

            when(unpacker.UnpackStructHeader()).thenThrow(error);

            BoltStateMachine stateMachine = mock(typeof(BoltStateMachine));
            BoltConnection   connection   = new SynchronousBoltConnection(stateMachine);

            BoltResponseHandler      externalErrorResponseHandler = ResponseHandlerMock();
            BoltRequestMessageReader reader = new TestBoltRequestMessageReader(connection, externalErrorResponseHandler, emptyList());

            reader.Read(unpacker);

            verify(stateMachine).handleExternalFailure(Neo4jError.from(error), externalErrorResponseHandler);
        }