예제 #1
0
        public virtual void TestEmptyMap()
        {
            ObjectIdOwnerMap <ObjectIdOwnerMapTest.SubId> m = new ObjectIdOwnerMap <ObjectIdOwnerMapTest.SubId
                                                                                    >();

            NUnit.Framework.Assert.IsTrue(m.IsEmpty());
            NUnit.Framework.Assert.AreEqual(0, m.Size());
            Iterator <ObjectIdOwnerMapTest.SubId> i = m.Iterator();

            NUnit.Framework.Assert.IsNotNull(i);
            NUnit.Framework.Assert.IsFalse(i.HasNext());
            NUnit.Framework.Assert.IsFalse(m.Contains(Id(1)));
        }
예제 #2
0
        public virtual void TestAddGetAndContains()
        {
            ObjectIdOwnerMap <ObjectIdOwnerMapTest.SubId> m = new ObjectIdOwnerMap <ObjectIdOwnerMapTest.SubId
                                                                                    >();

            m.Add(id_1);
            m.Add(id_2);
            m.Add(id_3);
            m.Add(id_a31);
            m.Add(id_b31);
            NUnit.Framework.Assert.IsFalse(m.IsEmpty());
            NUnit.Framework.Assert.AreEqual(5, m.Size());
            NUnit.Framework.Assert.AreSame(id_1, m.Get(id_1));
            NUnit.Framework.Assert.AreSame(id_1, m.Get(Id(1)));
            NUnit.Framework.Assert.AreSame(id_1, m.Get(Id(1).Copy()));
            NUnit.Framework.Assert.AreSame(id_2, m.Get(Id(2).Copy()));
            NUnit.Framework.Assert.AreSame(id_3, m.Get(Id(3).Copy()));
            NUnit.Framework.Assert.AreSame(id_a31, m.Get(Id(31).Copy()));
            NUnit.Framework.Assert.AreSame(id_b31, m.Get(id_b31.Copy()));
            NUnit.Framework.Assert.IsTrue(m.Contains(id_1));
        }