public void EqualsObjectCastTest() { string firstGivenName = "test-firstGivenName"; PersonInfo personInfo = new PersonInfo(firstGivenName: firstGivenName); object obj = new PersonInfo(firstGivenName: firstGivenName); Assert.True(personInfo.Equals(obj)); }
public void EqualsTest() { string firstGivenName = "test-firstGivenName"; PersonInfo firstGivenName1 = new PersonInfo(firstGivenName: firstGivenName); Assert.Equal(firstGivenName1, firstGivenName1); Assert.Equal(firstGivenName1, new PersonInfo(firstGivenName: firstGivenName)); Assert.NotEqual(firstGivenName1, new PersonInfo(firstGivenName: firstGivenName + "1")); Assert.False(firstGivenName1.Equals(null)); }
public void EqualsTest() { Assert.AreEqual(false, p1.Equals(p2)); Assert.AreEqual(false, p1.Equals(null)); Assert.AreEqual(false, p1.Equals(2414)); Assert.AreEqual(false, p1.Equals("zzk")); Assert.AreEqual(false, p1.Equals(p11)); Assert.AreEqual(true, p1.Equals(p1.Clone())); }
public bool TryMatch(IDictionary<Guid, IList<MediaItemAspect>> extractedAspects, IDictionary<Guid, IList<MediaItemAspect>> existingAspects) { if (!existingAspects.ContainsKey(PersonAspect.ASPECT_ID)) return false; PersonInfo linkedPerson = new PersonInfo(); if (!linkedPerson.FromMetadata(extractedAspects)) return false; PersonInfo existingPerson = new PersonInfo(); if (!existingPerson.FromMetadata(existingAspects)) return false; return linkedPerson.Equals(existingPerson); }