public override bool Equals(object obj) { RegistrationEntryKey rhs = obj as RegistrationEntryKey; if (rhs == null) { return(false); } return((RegistrationKey.Equals(rhs.RegistrationKey)) && (Version == rhs.Version)); }
public void EqualsIgnoresCase(string idA, string idB, bool expectedEquals) { // Arrange var a = new RegistrationKey(idA); var b = new RegistrationKey(idB); // Act var actualEqualsA = a.Equals(b); var actualEqualsB = b.Equals(a); // Assert Assert.Equal(expectedEquals, actualEqualsA); Assert.Equal(expectedEquals, actualEqualsB); }
public void RegistrationKey_is_equal() { var key1 = new RegistrationKey(typeof(IFoo)); var key2 = new RegistrationKey(typeof(IFoo)); Assert.AreEqual(key1, key2); Assert.AreNotSame(key1, key2); Assert.IsTrue(key1 == key2); Assert.IsTrue(key1.Equals(key2)); var dic = new Dictionary<RegistrationKey, object>(); dic.Add(key1, ""); Assert.IsTrue(dic.ContainsKey(key1)); Assert.IsTrue(dic.ContainsKey(key2)); }