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()); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldSeeEntriesWhenOnlyLowestIsPresent() public virtual void ShouldSeeEntriesWhenOnlyLowestIsPresent() { // given long labelId = 0; IList <NodeLabelUpdate> labelUpdates = new List <NodeLabelUpdate>(); labelUpdates.Add(NodeLabelUpdate.labelChanges(0L, new long[] {}, new long[] { labelId })); Start(labelUpdates); // when MutableInt count = new MutableInt(); AllEntriesLabelScanReader nodeLabelRanges = _store.allNodeLabelRanges(); nodeLabelRanges.forEach(nlr => { foreach (long nodeId in nlr.nodes()) { count.add(nlr.labels(nodeId).length); } }); assertThat(count.intValue(), @is(1)); }