Ejemplo n.º 1
0
 public void SetUp()
 {
     _table = new SimplifiedHashTable<HashObject, string>(9);
 }
Ejemplo n.º 2
0
        public void Things_get_funky_if_you_dont_override_GetHashCode_when_overriding_Equals()
        {
            var table = new SimplifiedHashTable<ObjectWithCustomEqualsButDefaultHashCode, string>(9);

            // These two objects are equal, but have different hash codes
            var a = new ObjectWithCustomEqualsButDefaultHashCode("abc");
            var b = new ObjectWithCustomEqualsButDefaultHashCode("abc");

            table[a] = "original value";
            table[b] = "modified value";

            Assert.AreEqual("modified value", table[a]);
        }