コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnTheFirstStrategyThatWorksFromThoseConfigured()
        public virtual void ShouldReturnTheFirstStrategyThatWorksFromThoseConfigured()
        {
            // given
            Config config = Config.defaults(upstream_selection_strategy, "yet-another-dummy,dummy,another-dummy");

            // when
            UpstreamDatabaseStrategiesLoader strategies = new UpstreamDatabaseStrategiesLoader(mock(typeof(TopologyService)), config, _myself, NullLogProvider.Instance);

            // then
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertEquals(typeof(UpstreamDatabaseStrategySelectorTest.YetAnotherDummyUpstreamDatabaseSelectionStrategy), strategies.GetEnumerator().next().GetType());
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnConfiguredClassesOnly()
        public virtual void ShouldReturnConfiguredClassesOnly()
        {
            // given
            Config config = Config.defaults(upstream_selection_strategy, "dummy");

            UpstreamDatabaseStrategiesLoader strategies = new UpstreamDatabaseStrategiesLoader(mock(typeof(TopologyService)), config, _myself, NullLogProvider.Instance);

            // when
            ISet <UpstreamDatabaseSelectionStrategy> upstreamDatabaseSelectionStrategies = asSet(strategies.GetEnumerator());

            // then
            assertEquals(1, upstreamDatabaseSelectionStrategies.Count);
            assertEquals(typeof(UpstreamDatabaseStrategySelectorTest.DummyUpstreamDatabaseSelectionStrategy), upstreamDatabaseSelectionStrategies.Select(UpstreamDatabaseSelectionStrategy.getClass).First().get());
        }