예제 #1
0
        public virtual void TestRemoveMakesEmpty()
        {
            RefList <Ref> one = ToList(REF_A);
            RefList <Ref> two = one.Remove(1);

            NUnit.Framework.Assert.AreNotSame(one, two);
            NUnit.Framework.CollectionAssert.AreEquivalent(two, RefList.EmptyList <Ref>());
        }
예제 #2
0
        public virtual void TestRemoveEndOfList()
        {
            RefList <Ref> one = ToList(REF_A, REF_B, REF_c);
            RefList <Ref> two = one.Remove(2);

            NUnit.Framework.Assert.AreNotSame(one, two);
            NUnit.Framework.Assert.AreEqual(3, one.Size());
            NUnit.Framework.Assert.AreSame(REF_A, one.Get(0));
            NUnit.Framework.Assert.AreSame(REF_B, one.Get(1));
            NUnit.Framework.Assert.AreSame(REF_c, one.Get(2));
            NUnit.Framework.Assert.AreEqual(2, two.Size());
            NUnit.Framework.Assert.AreSame(REF_A, two.Get(0));
            NUnit.Framework.Assert.AreSame(REF_B, two.Get(1));
        }