Ejemplo n.º 1
0
 public void TestCanCopyContact()
 {
     string mail = "*****@*****.**";
     IContact c1 = new Contact("J. Doe", mail);
     IContact c2 = new Contact(c1);
     Assert.IsTrue(c1.IsSameAs(c2));
     IEnumerable<string> A = c1.Emails;
     IEnumerable<string> B = c2.Emails;
     Assert.IsTrue(A.Count() == B.Count() && A.Intersect(B).Count() == B.Count());
 }
Ejemplo n.º 2
0
 public void TestTwoContactsWithSameFullNameAreEqual()
 {
     IContact c1 = new Contact("John Doe");
     IContact c2 = new Contact("John Doe", "*****@*****.**");
     Assert.IsTrue(c1.IsSameAs(c2));
 }
Ejemplo n.º 3
0
 public void TestTwoContactsWithSameEmailAreEqualEvenWithDifferentNames()
 {
     IContact c1 = new Contact("J. Doe", "*****@*****.**");
     IContact c2 = new Contact("John Doe", "*****@*****.**");
     Assert.IsTrue(c1.IsSameAs(c2));
 }
Ejemplo n.º 4
0
 public void TestTwoContactsWithSameEmailAreEqual()
 {
     string mail = "*****@*****.**";
     IContact c1 = new Contact("", mail);
     IContact c2 = new Contact("", mail);
     Assert.IsTrue(c1.IsSameAs(c2));
 }
Ejemplo n.º 5
0
 public void TestTwoContactsWithDifferentFullNamesAreNotEqual()
 {
     IContact c1 = new Contact("John Doe");
     IContact c2 = new Contact("Nancy Botwin");
     Assert.IsFalse(c1.IsSameAs(c2));
 }
Ejemplo n.º 6
0
 public void TestTwoContactsWithCommonEmailAreEqualEvenWithDifferentNames()
 {
     string mail = "*****@*****.**";
     IContact c1 = new Contact("J. Doe", mail);
     IContact c2 = new Contact("John Doe", "*****@*****.**");
     Assert.IsFalse(c1.IsSameAs(c2));
     c2.addMail(mail);
     Assert.IsTrue(c1.IsSameAs(c2));
 }