Example #1
0
        public BoltProtocolV1(BoltChannel channel, BoltConnectionFactory connectionFactory, BoltStateMachineFactory stateMachineFactory, LogService logging)
        {
            this._channel = channel;
            this._logging = logging;

            BoltStateMachine stateMachine = stateMachineFactory.NewStateMachine(Version(), channel);

            this._connection = connectionFactory.NewConnection(channel, stateMachine);

            this._neo4jPack     = CreatePack();
            this._messageReader = CreateMessageReader(channel, _neo4jPack, _connection, logging);
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static void testMessageDecoding(org.neo4j.bolt.messaging.RequestMessage message) throws Exception
        private static void TestMessageDecoding(RequestMessage message)
        {
            Neo4jPack neo4jPack = new Neo4jPackV1();

            BoltStateMachine         stateMachine = mock(typeof(BoltStateMachine));
            BoltRequestMessageReader reader       = NewReader(stateMachine);

            PackedInputArray innput = new PackedInputArray(serialize(neo4jPack, message));

            Org.Neo4j.Bolt.messaging.Neo4jPack_Unpacker unpacker = neo4jPack.NewUnpacker(innput);

            reader.Read(unpacker);

            verify(stateMachine).process(eq(message), any());
        }