private static void AssertRanges(AllEntriesLabelScanReader reader, Labels[] data) { IEnumerator <NodeLabelRange> iterator = reader.GetEnumerator(); long highestRangeId = highestRangeId(data); for (long rangeId = 0; rangeId <= highestRangeId; rangeId++) { SortedDictionary <long, IList <long> > expected = RangeOf(data, rangeId); if (expected != null) { //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: assertTrue("Was expecting range " + expected, iterator.hasNext()); //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: NodeLabelRange range = iterator.next(); assertEquals(rangeId, range.Id()); foreach (KeyValuePair <long, IList <long> > expectedEntry in expected.SetOfKeyValuePairs()) { long[] labels = range.Labels(expectedEntry.Key); assertArrayEquals(asArray(expectedEntry.Value.GetEnumerator()), labels); } } // else there was nothing in this range } //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: assertFalse(iterator.hasNext()); }
private static void AssertRanges(IEnumerator <NodeLabelRange> iterator, int[] expectedRanges) { for (int expectedRangeId = 0; expectedRangeId < expectedRanges.Length; expectedRangeId++) { //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: assertTrue(iterator.hasNext()); //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: NodeLabelRange actualRange = iterator.next(); assertEquals(expectedRangeId, actualRange.Id()); int expectedRange = expectedRanges[expectedRangeId]; long baseNodeId = expectedRangeId * RANGE_SIZE; for (int i = 0; i < RANGE_SIZE; i++) { long nodeId = baseNodeId + i; long[] expectedLabelIds = (expectedRange & (1 << i)) == 0 ? EMPTY_LONG_ARRAY : _labelIds; assertArrayEquals(expectedLabelIds, actualRange.Labels(nodeId)); assertEquals(nodeId, actualRange.Nodes()[i]); } } //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: assertFalse(iterator.hasNext()); }