public static TransactionStateChecker Create(TransitionalPeriodTransactionMessContainer container) { KernelTransaction topLevelTransactionBoundToThisThread = container.Bridge.getKernelTransactionBoundToThisThread(true); KernelStatement kernelStatement = ( KernelStatement )topLevelTransactionBoundToThisThread.AcquireStatement(); return(new TransactionStateChecker(kernelStatement, nodeId => kernelStatement.HasTxStateWithChanges() && kernelStatement.TxState().nodeIsDeletedInThisTx(nodeId), relId => kernelStatement.HasTxStateWithChanges() && kernelStatement.TxState().relationshipIsDeletedInThisTx(relId))); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Before public void setUp() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void SetUp() { GraphDatabaseQueryService cypherService = new GraphDatabaseCypherService(this.Database.GraphDatabaseAPI); _compilerFactory = mock(typeof(CompilerFactory)); _transactionalContext = mock(typeof(TransactionalContext)); KernelStatement kernelStatement = mock(typeof(KernelStatement)); _executor = mock(typeof(SnapshotExecutionEngine.ParametrizedQueryExecutor)); _versionContext = mock(typeof(VersionContext)); _executionEngine = CreateExecutionEngine(cypherService); when(kernelStatement.VersionContext).thenReturn(_versionContext); when(_transactionalContext.statement()).thenReturn(kernelStatement); Result result = mock(typeof(Result)); QueryStatistics statistics = mock(typeof(QueryStatistics)); when(result.QueryStatistics).thenReturn(statistics); when(_executor.execute(any(), anyMap(), any())).thenReturn(result); }