示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void provideAccessOnlyToActiveDatabase()
        internal virtual void ProvideAccessOnlyToActiveDatabase()
        {
            DataSourceManager  manager     = CreateDataSourceManager();
            NeoStoreDataSource dataSource1 = mock(typeof(NeoStoreDataSource));
            NeoStoreDataSource dataSource2 = mock(typeof(NeoStoreDataSource));

            when(dataSource1.DatabaseLayout).thenReturn(_testDirectory.databaseLayout());
            when(dataSource2.DatabaseLayout).thenReturn(_testDirectory.databaseLayout("somethingElse"));
            manager.Register(dataSource1);
            manager.Register(dataSource2);

            assertEquals(dataSource1, manager.DataSource);
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldCallListenersOnDataSourceRegistrationIfManagerAlreadyStarted()
        internal virtual void ShouldCallListenersOnDataSourceRegistrationIfManagerAlreadyStarted()
        {
            // given
            DataSourceManager manager = CreateDataSourceManager();

            DataSourceManager.Listener listener = mock(typeof(DataSourceManager.Listener));
            manager.AddListener(listener);
            manager.Start();

            // when
            manager.Register(mock(typeof(NeoStoreDataSource)));

            // then
            verify(listener).registered(any(typeof(NeoStoreDataSource)));
        }
示例#3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldSupportMultipleStartStopCycles() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ShouldSupportMultipleStartStopCycles()
        {
            // given
            DataSourceManager  manager    = CreateDataSourceManager();
            NeoStoreDataSource dataSource = mock(typeof(NeoStoreDataSource));

            manager.Register(dataSource);
            manager.Init();

            // when
            manager.Start();
            manager.Stop();
            manager.Start();

            // then
            verify(dataSource, times(2)).start();
        }