private static IBTreeRange ToRange(SortedCollection4 sorted) { if (1 == sorted.Size()) { return((IBTreeRange)sorted.SingleElement()); } return(new BTreeRangeUnion(sorted)); }
public virtual void TestAddAllAndToArray() { object[] array = IntArrays4.ToObjectArray(new int[] { 6, 4, 1, 2, 7, 3 }); SortedCollection4 collection = NewSortedCollection(); Assert.AreEqual(0, collection.Size()); collection.AddAll(new ArrayIterator4(array)); AssertCollection(new int[] { 1, 2, 3, 4, 6, 7 }, collection); }
private void AssertCollection(int[] expected, SortedCollection4 collection) { Assert.AreEqual(expected.Length, collection.Size()); ArrayAssert.AreEqual(IntArrays4.ToObjectArray(expected), collection.ToArray(new object [collection.Size()])); }
private static BTreeRangeSingle[] ToArray(SortedCollection4 collection) { return((BTreeRangeSingle[])collection.ToArray(new BTreeRangeSingle[collection.Size ()])); }