예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void roundRobinWithNoSlaves()
        public virtual void RoundRobinWithNoSlaves()
        {
            // Given
            SlavePriority roundRobin = SlavePriorities.RoundRobin();

            // When
            IEnumerator <Slave> slaves = roundRobin.Prioritize(slaves()).GetEnumerator();

            // Then
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertFalse(slaves.hasNext());
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void roundRobinWithTwoSlavesAndPushFactorOne()
        public virtual void RoundRobinWithTwoSlavesAndPushFactorOne()
        {
            // Given
            SlavePriority roundRobin = SlavePriorities.RoundRobin();

            // When
            Slave slave1 = roundRobin.Prioritize(Slaves(2, 3)).GetEnumerator().next();
            Slave slave2 = roundRobin.Prioritize(Slaves(2, 3)).GetEnumerator().next();

            // Then
            assertEquals(2, slave1.ServerId);
            assertEquals(3, slave2.ServerId);
        }
예제 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void roundRobinWithTwoSlavesAndPushFactorTwo()
        public virtual void RoundRobinWithTwoSlavesAndPushFactorTwo()
        {
            // Given
            SlavePriority roundRobin = SlavePriorities.RoundRobin();

            // When
            IEnumerator <Slave> slaves = roundRobin.Prioritize(slaves(2, 3)).GetEnumerator();

            // Then
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertEquals(2, slaves.next().ServerId);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertEquals(3, slaves.next().ServerId);
        }