コード例 #1
0
 public void SaveContact_WithValidContact_Test()
 {
     ContactData target = new ContactData();
     Contact contact = new Contact() { Email = "*****@*****.**", Name = "test User", Phone = "555-555-5555" };
     bool expected = true;
     bool actual = target.SaveContact(contact);
     Assert.AreEqual(expected, actual);
 }
コード例 #2
0
 public void SearchContactsByName_ValidName_Test()
 {
     ContactData target = new ContactData();
     Contacts testContacts = target.GetContactsByName("test User");
     Assert.IsTrue(testContacts.Count>0);
 }
コード例 #3
0
 public void SearchContactsByName_InvalidName_Test()
 {
     ContactData target = new ContactData();
     Contacts testContacts = target.GetContactsByName("something");
     Assert.AreEqual(0, testContacts.Count);
 }
コード例 #4
0
 public void SearchContactsByName_EmptyName_Test()
 {
     ContactData target = new ContactData();
     Contacts testContacts = target.GetContactsByName("");
     Assert.AreEqual(0,testContacts.Count);
 }
コード例 #5
0
 public void GetContacts_Test()
 {
     ContactData target = new ContactData();
     Contacts testContacts = target.GetContacts();
     Assert.IsTrue(testContacts.Count>0);
 }
コード例 #6
0
 public static IContactData GetContactInterface()
 {
     IContactData myContactData = myContactData= new  ContactData();
     
     return myContactData;
 }