コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup()
        public virtual void Setup()
        {
            KernelTransaction transaction = mock(typeof(KernelTransaction));

            _tokenRead  = mock(typeof(TokenRead));
            _schemaRead = mock(typeof(SchemaRead));
            _procedure  = new IndexProcedures(transaction, null);

            when(transaction.TokenRead()).thenReturn(_tokenRead);
            when(transaction.SchemaRead()).thenReturn(_schemaRead);
            _indexingService = mock(typeof(IndexingService));
            _procedure       = new IndexProcedures(transaction, _indexingService);
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup()
        public virtual void Setup()
        {
            _dataSource = mock(typeof(NeoStoreDataSource));
            StorageEngine storageEngine = mock(typeof(StorageEngine));
            StorageReader storageReader = mock(typeof(StorageReader));

            when(storageEngine.NewReader()).thenReturn(storageReader);
            _indexingService = mock(typeof(IndexingService));
            TokenHolders tokenHolders = MockedTokenHolders();

            when(tokenHolders.LabelTokens().getIdByName(EXISTING_LABEL)).thenReturn(LABEL_ID);
            when(tokenHolders.PropertyKeyTokens().getIdByName(EXISTING_PROPERTY)).thenReturn(PROPERTY_ID);
            when(tokenHolders.PropertyKeyTokens().getIdByName(NON_EXISTING_PROPERTY)).thenReturn(-1);
            when(tokenHolders.LabelTokens().getIdByName(NON_EXISTING_LABEL)).thenReturn(NO_TOKEN);
            DependencyResolver resolver = mock(typeof(DependencyResolver));

            when(resolver.ResolveDependency(typeof(IndexingService))).thenReturn(_indexingService);
            when(resolver.ResolveDependency(typeof(StorageEngine))).thenReturn(storageEngine);
            when(resolver.ResolveDependency(typeof(TokenHolders))).thenReturn(tokenHolders);
            when(_dataSource.DependencyResolver).thenReturn(resolver);
        }
コード例 #3
0
 internal State(StorageEngine storageEngine, IndexingService indexingService, TokenHolders tokenHolders)
 {
     this.StorageEngine   = storageEngine;
     this.IndexingService = indexingService;
     this.TokenHolders    = tokenHolders;
 }