Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldHandleParameterizedStatements() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldHandleParameterizedStatements()
        {
            // Given
            MapValue parameters = ValueUtils.asMapValue(map("n", 12L));

            // When
            RunMessage msg = SerializeAndDeserialize(new RunMessage("asd", parameters));

            // Then
            MapValue @params = msg.Params();

            assertThat(@params, equalTo(parameters));
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static org.neo4j.bolt.runtime.StatementMetadata processRunMessage(org.neo4j.bolt.v1.messaging.request.RunMessage message, org.neo4j.bolt.runtime.StatementProcessor statementProcessor) throws Exception
        private static StatementMetadata ProcessRunMessage(RunMessage message, StatementProcessor statementProcessor)
        {
            if (isBegin(message))
            {
                Bookmark bookmark = Bookmark.fromParamsOrNull(message.Params());
                statementProcessor.BeginTransaction(bookmark);
                return(StatementMetadata.EMPTY);
            }
            else if (isCommit(message))
            {
                statementProcessor.CommitTransaction();
                return(StatementMetadata.EMPTY);
            }
            else if (isRollback(message))
            {
                statementProcessor.RollbackTransaction();
                return(StatementMetadata.EMPTY);
            }
            else
            {
                return(statementProcessor.Run(message.Statement(), message.Params()));
            }
        }