Exemplo n.º 1
0
        public void EqualsObjectCastTest()
        {
            string     firstGivenName = "test-firstGivenName";
            PersonInfo personInfo     = new PersonInfo(firstGivenName: firstGivenName);
            object     obj            = new PersonInfo(firstGivenName: firstGivenName);

            Assert.True(personInfo.Equals(obj));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
 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()));
 }
Exemplo n.º 4
0
    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);
    }