Exemplo n.º 1
0
 private static IBTreeRange ToRange(SortedCollection4 sorted)
 {
     if (1 == sorted.Size())
     {
         return((IBTreeRange)sorted.SingleElement());
     }
     return(new BTreeRangeUnion(sorted));
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 private void AssertCollection(int[] expected, SortedCollection4 collection)
 {
     Assert.AreEqual(expected.Length, collection.Size());
     ArrayAssert.AreEqual(IntArrays4.ToObjectArray(expected), collection.ToArray(new object
                                                                                 [collection.Size()]));
 }
Exemplo n.º 4
0
 private static BTreeRangeSingle[] ToArray(SortedCollection4 collection)
 {
     return((BTreeRangeSingle[])collection.ToArray(new BTreeRangeSingle[collection.Size
                                                                            ()]));
 }