Esempio n. 1
0
        public void test_equals()
        {
            CharSetProperty foo = new CharSetProperty(), bar, baz = new CharSetProperty();

            foo.value.Add("blah");
            foo.value.Add("bloh");
            bar = foo.copy();
            baz.value.Add("blah");
            baz.value.Add("bleh");
            Assert.IsTrue(foo.equals(bar));
            Assert.IsTrue(bar.equals(foo));
            Assert.IsFalse(foo.equals(baz));
            Assert.IsFalse(baz.equals(foo));
        }
Esempio n. 2
0
        public void test_copy()
        {
            CharSetProperty foo = new CharSetProperty(), bar;

            foo.value.Add("blah");
            foo.value.Add("bloh");

            bar = foo.copy();
            Assert.IsFalse(ReferenceEquals(foo, bar));
            Assert.IsFalse(ReferenceEquals(foo.value, bar.value));
            Assert.AreEqual(foo.value.Count, bar.value.Count);
            foreach (string s in foo.value)
            {
                Assert.IsTrue(bar.value.Contains(s));
            }
        }