public void Equals_Subset () { ApplicationId id1 = new ApplicationId (defaultPublicKeyToken, defaultName, defaultVersion, defaultProc, defaultCulture); ApplicationId id2 = new ApplicationId (defaultPublicKeyToken, defaultName, defaultVersion, null, defaultCulture); Assert.IsFalse (id1.Equals (id2), "Equals-A1"); Assert.IsFalse (id2.Equals (id1), "Equals-A2"); // would have expected IsFalse Assert.IsTrue (id1.GetHashCode () == id2.GetHashCode (), "GetHashCode-A"); ApplicationId id3 = new ApplicationId (defaultPublicKeyToken, defaultName, defaultVersion, defaultProc, null); Assert.IsFalse (id1.Equals (id3), "Equals-B1"); Assert.IsFalse (id3.Equals (id1), "Equals-B2"); // would have expected IsFalse Assert.IsTrue (id1.GetHashCode () == id3.GetHashCode (), "GetHashCode-B"); }
public void Equals () { ApplicationId id1 = new ApplicationId (defaultPublicKeyToken, defaultName, defaultVersion, defaultProc, defaultCulture); ApplicationId id2 = new ApplicationId (defaultPublicKeyToken, defaultName, defaultVersion, defaultProc, defaultCulture); Assert.IsTrue (id1.Equals (id2), "Equals-1"); Assert.IsTrue (id2.Equals (id1), "Equals-2"); Assert.AreEqual (id1.GetHashCode (), id2.GetHashCode (), "GetHashCode"); }