示例#1
0
        public virtual void TestDictionaryContentsDifferentKey()
        {
            TestObject object1 = new TestObject();
            TestObject object2 = new TestObject();

            object1.AddDictionaryEntry("key1", "value1");
            object2.AddDictionaryEntry("key1", "value1");
            object1.AddDictionaryEntry("key3", "value2");
            object2.AddDictionaryEntry("key2", "value2");

            Assert.IsFalse(object1.Equals(object2));
        }
示例#2
0
        public virtual void TestDictionaryContentsDifferentKey()
        {
            TestObject object1 = new TestObject();
            TestObject object2 = new TestObject();

            object1.AddDictionaryEntry("key1", "value1");
            object2.AddDictionaryEntry("key1", "value1");
            object1.AddDictionaryEntry("key3", "value2");
            object2.AddDictionaryEntry("key2", "value2");

            Assert.AreNotEqual(object1.GetHashCode(), object2.GetHashCode());
        }
示例#3
0
        public virtual void TestDictionaryContentsSame()
        {
            TestObject object1 = new TestObject();
            TestObject object2 = new TestObject();

            object1.AddDictionaryEntry("key1", "value1");
            object2.AddDictionaryEntry("key1", "value1");
            object1.AddDictionaryEntry("key2", "value2");
            object2.AddDictionaryEntry("key2", "value2");

            Assert.IsTrue(object1.Equals(object2));
        }