//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void shouldHandleSingleItemIterators() internal virtual void ShouldHandleSingleItemIterators() { // Given ResourceIterator <long> it1 = asResourceIterator(iterator(1L)); ResourceIterator <long> it2 = asResourceIterator(iterator(5L, 6L, 7L)); CombiningResourceIterator <long> combingIterator = new CombiningResourceIterator <long>(iterator(it1, it2)); // When I iterate through it, things come back in the right order assertThat(Iterators.AsList(combingIterator), equalTo(asList(1L, 5L, 6L, 7L))); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void shouldNotCloseDuringIteration() internal virtual void ShouldNotCloseDuringIteration() { // Given ResourceIterator <long> it1 = spy(asResourceIterator(iterator(1L, 2L, 3L))); ResourceIterator <long> it2 = spy(asResourceIterator(iterator(5L, 6L, 7L))); CombiningResourceIterator <long> combingIterator = new CombiningResourceIterator <long>(iterator(it1, it2)); // When I iterate through it, things come back in the right order assertThat(Iterators.AsList(combingIterator), equalTo(asList(1L, 2L, 3L, 5L, 6L, 7L))); // Then verify(it1, never()).close(); verify(it2, never()).close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void closesAllIteratorsOnShutdown() internal virtual void ClosesAllIteratorsOnShutdown() { // Given ResourceIterator <long> it1 = spy(asResourceIterator(iterator(1L, 2L, 3L))); ResourceIterator <long> it2 = spy(asResourceIterator(iterator(5L, 6L, 7L))); CombiningResourceIterator <long> combingIterator = new CombiningResourceIterator <long>(iterator(it1, it2)); // Given I iterate through half of it int iterations = 4; while (iterations-- > 0) { //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: combingIterator.Next(); } // When combingIterator.Close(); // Then verify(it1).close(); verify(it2).close(); }