public void ContainsSameObjectByRef()
        {
            ISet <object> set = GetIdentitySet();

            MutableHashCode item1Copy = item1;

            set.Add(item1);

            Assert.AreSame(item1, item1Copy);
            Assert.IsTrue(set.Contains(item1Copy), "We should be able to get the same object out of the IdentitySet with " +
                          "two different references to the same object.");
        }
Example #2
0
        public void ContainsSameObjectByRef()
        {
            IDictionary map = GetIdentityMap();

            MutableHashCode item1Copy = item1;

            map.Add(item1, new object());

            Assert.AreSame(item1, item1Copy);
            Assert.IsTrue(map.Contains(item1Copy), "We should be able to get the same object out of the IdentityMap with " +
                          "two different references to the same object.");
        }
        public void SetUp()
        {
            item1 = new MutableHashCode(1);
            item2 = new MutableHashCode(2);

            value1 = new object();
            value2 = new object();

            noHashCode1 = new NoHashCode();
            noHashCode2 = new NoHashCode();

            expectedMap = new Hashtable();
            expectedMap.Add(item1, value1);
            expectedMap.Add(item2, value2);
        }
		public void SetUp()
		{
			item1 = new MutableHashCode(1);
			item2 = new MutableHashCode(2);

			value1 = new object();
			value2 = new object();

			noHashCode1 = new NoHashCode();
			noHashCode2 = new NoHashCode();

			expectedMap = new Hashtable();
			expectedMap.Add(item1, value1);
			expectedMap.Add(item2, value2);
		}