public void Comparison_WithSameTypeAndName_IsEqual() { var key1 = new DependentDataKey(typeof(int), "name"); var key2 = new DependentDataKey(typeof(int), "name"); Assert.That(key1.GetHashCode(), Is.EqualTo(key2.GetHashCode())); Assert.That(key1.Equals(key2), Is.True); Assert.That(key1.Equals((object)key2), Is.True); }
public void Comparison_WithDifferentType_AreNotEqual() { var key1 = new DependentDataKey(typeof(int), "name"); var key2 = new DependentDataKey(typeof(string), "name"); Assert.That(key1.GetHashCode(), Is.Not.EqualTo(key2.GetHashCode())); Assert.That(key1.Equals(key2), Is.False); Assert.That(key1.Equals((object)key2), Is.False); }