Exemplo n.º 1
0
        public void DefaultCtorReturnsEmptyMap()
        {
            PersistentTreeMap m = new PersistentTreeMap();

            Expect(m.count(), EqualTo(0));
            Expect(m.meta(), Null);
        }
Exemplo n.º 2
0
        public void DoBigTest(int numEntries)
        {
            System.Console.WriteLine("Testing {0} items.", numEntries);

            Random rnd = new Random();
            Dictionary <int, int> dict = new Dictionary <int, int>(numEntries);

            for (int i = 0; i < numEntries; i++)
            {
                int r = rnd.Next();
                dict[r] = r;
            }
            PersistentTreeMap m = (PersistentTreeMap)PersistentTreeMap.create(dict);

            Expect(m.count(), EqualTo(dict.Count));

            foreach (int key in dict.Keys)
            {
                Expect(m.containsKey(key));
                Expect(m.valAt(key), EqualTo(key));
            }

            for (ISeq s = m.seq(); s != null; s = s.next())
            {
                Expect(dict.ContainsKey((int)((IMapEntry)s.first()).key()));
            }
        }
Exemplo n.º 3
0
        public void DefaultCtorReturnsEmptyMap()
        {
            PersistentTreeMap m = new PersistentTreeMap();

            Expect(m.count()).To.Equal(0);
            Expect(m.meta()).To.Be.Null();
        }