Esempio n. 1
0
        public virtual void TestSet()
        {
            RefList <Ref> one = ToList(REF_A, REF_A);
            RefList <Ref> two = one.Set(1, REF_B);

            NUnit.Framework.Assert.AreNotSame(one, two);
            // one is not modified
            NUnit.Framework.Assert.AreEqual(2, one.Size());
            NUnit.Framework.Assert.AreSame(REF_A, one.Get(0));
            NUnit.Framework.Assert.AreSame(REF_A, one.Get(1));
            // but two is
            NUnit.Framework.Assert.AreEqual(2, two.Size());
            NUnit.Framework.Assert.AreSame(REF_A, one.Get(0));
            NUnit.Framework.Assert.AreSame(REF_B, two.Get(1));
        }