Esempio n. 1
0
        public virtual void TestStrongIntern()
        {
            string strongInternLiteralABC   = StringInterner.StrongIntern("ABC");
            string strongInternSubstringABC = StringInterner.StrongIntern(Runtime.Substring
                                                                              ("ABCDE", 0, 3));
            string strongInternHeapABC = StringInterner.StrongIntern(new string("ABC"));

            NUnit.Framework.Assert.AreSame(strongInternLiteralABC, strongInternSubstringABC);
            NUnit.Framework.Assert.AreSame(strongInternLiteralABC, strongInternHeapABC);
            NUnit.Framework.Assert.AreSame(strongInternSubstringABC, strongInternHeapABC);
        }