//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("deprecation") @Before public void before() public virtual void Before() { Db = ( GraphDatabaseAPI )CreateGraphDatabase(); DependencyResolver resolver = Db.DependencyResolver; this.StorageReader = resolver.ResolveDependency(typeof(StorageEngine)).newReader(); this.State = new KernelStatement(null, null, StorageReader, LockTracer.NONE, null, new ClockContext(), EmptyVersionContextSupplier.EMPTY); }
private void SetUpMocks() { _queryService = mock(typeof(GraphDatabaseQueryService)); DependencyResolver resolver = mock(typeof(DependencyResolver)); _txBridge = mock(typeof(ThreadToStatementContextBridge)); _initialStatement = mock(typeof(KernelStatement)); _statistics = new ConfiguredExecutionStatistics(this); QueryRegistryOperations queryRegistryOperations = mock(typeof(QueryRegistryOperations)); InternalTransaction internalTransaction = mock(typeof(InternalTransaction)); when(internalTransaction.TerminationReason()).thenReturn(null); when(_initialStatement.queryRegistration()).thenReturn(queryRegistryOperations); when(_queryService.DependencyResolver).thenReturn(resolver); when(resolver.ResolveDependency(typeof(ThreadToStatementContextBridge))).thenReturn(_txBridge); when(_queryService.beginTransaction(any(), any())).thenReturn(internalTransaction); KernelTransaction mockTransaction = mockTransaction(_initialStatement); when(_txBridge.get()).thenReturn(_initialStatement); when(_txBridge.getKernelTransactionBoundToThisThread(true)).thenReturn(mockTransaction); }