public void KeyCollection_Equal_False() { var a1 = new KeyCollection(new object[] { 100, "a", true, new DateTime(2015, 05, 12) }); var a2 = new KeyCollection(new object[] { 100, "a", false, new DateTime(2015, 05, 12) }); var dico = new Dictionary<KeyCollection, object>(); dico.Add(a1, null); Assert.That(a1, Is.Not.EqualTo(a2)); Assert.That(a1.GetHashCode(), Is.Not.EqualTo(a2.GetHashCode())); Assert.That(dico.ContainsKey(a2), Is.Not.True); }
public void KeyCollection_Equal_False() { var a1 = new KeyCollection(new object[] { 100, "a", true, new DateTime(2015, 05, 12) }); var a2 = new KeyCollection(new object[] { 100, "a", false, new DateTime(2015, 05, 12) }); var dico = new Dictionary <KeyCollection, object>(); dico.Add(a1, null); Assert.That(a1, Is.Not.EqualTo(a2)); Assert.That(a1.GetHashCode(), Is.Not.EqualTo(a2.GetHashCode())); Assert.That(dico.ContainsKey(a2), Is.Not.True); }
public void KeyCollectionWithNullVersusEmpty_Equal_False() { var a1 = new KeyCollection(new object[] { 100, DBNull.Value, true, new DateTime(2015, 05, 12) }); var a2 = new KeyCollection(new object[] { 100, string.Empty, true, new DateTime(2015, 05, 12) }); var dico = new Dictionary <KeyCollection, object> { { a1, null } }; Assert.That(a1, Is.Not.EqualTo(a2)); Assert.That(a1.GetHashCode(), Is.Not.EqualTo(a2.GetHashCode())); Assert.That(dico.ContainsKey(a2), Is.Not.True); }