public void TestContactDB() { foreach (ContactData contact in ContactData.GetAllContacts()) { System.Console.WriteLine(contact.Deprecated); } }
public void CheckAbilityAddContactToGroup(GroupData group) { if (ContactData.GetAllContacts().Except(group.GetContactsFromGroup()).Count() == 0) { ContactData contact = group.GetContactsFromGroup().First(); RemoveContactFromGroup(contact, group); } }
public void CheckAbilityRemoveContactFromGroup(GroupData group) { manager.Navigator.GoToHomePage(); if (group.GetContactsFromGroup().Count() == 0) { ContactData contact = ContactData.GetAllContacts()[0]; AddContactToGroup(contact, group); } }
public void CompareContactsUI_DB() { if (PERFORM_LONG_UI_CHECKS) { List <ContactData> contactsFromUI = app.Contact.GetContactList(); List <ContactData> contactsFromDB = ContactData.GetAllContacts(); contactsFromUI.Sort(); contactsFromDB.Sort(); Assert.AreEqual(contactsFromUI, contactsFromDB); } }
public void ContactCreationTest(ContactData contactData) { List <ContactData> oldContacts = ContactData.GetAllContacts(); app.Contact.Create(contactData); List <ContactData> newContacts = ContactData.GetAllContacts(); oldContacts.Add(contactData); oldContacts.Sort(); newContacts.Sort(); Assert.AreEqual(oldContacts, newContacts); }
public void TestContactDBConnectivity() { DateTime start = DateTime.Now; List <ContactData> contactFromUI = app.Contact.GetContactList(); DateTime end = DateTime.Now; System.Console.WriteLine(String.Format("Время выполнения получения списка групп из UI: {0} секунд", end.Subtract(start).TotalSeconds)); start = DateTime.Now; List <ContactData> contactFromDB = ContactData.GetAllContacts(); end = DateTime.Now; System.Console.WriteLine(String.Format("Время выполнения получения списка групп из БД: {0} секунд", end.Subtract(start).TotalSeconds)); }
public void ContactModificationTest() { ContactData newContactData = new ContactData("Yan", "Сидоров-Иванов"); List <ContactData> oldContacts = ContactData.GetAllContacts(); app.Contact.Modify(oldContacts[0], newContactData); List <ContactData> newContacts = ContactData.GetAllContacts(); oldContacts[0].Firstname = newContactData.Firstname; oldContacts[0].Lastname = newContactData.Lastname; oldContacts.Sort(); newContacts.Sort(); Assert.AreEqual(oldContacts, newContacts); }
public void TestAddingContactToGroup() { GroupData group = GroupData.GetAllGroups()[0]; app.Contact.CheckAbilityAddContactToGroup(group); List <ContactData> oldList = group.GetContactsFromGroup(); ContactData contact = ContactData.GetAllContacts().Except(oldList).First(); app.Contact.AddContactToGroup(contact, group); List <ContactData> newList = group.GetContactsFromGroup(); oldList.Add(contact); oldList.Sort(); newList.Sort(); Assert.AreEqual(oldList, newList); }
public void TestRemovingContactFromGroup() { GroupData group = GroupData.GetAllGroups()[0]; app.Contact.CheckAbilityRemoveContactFromGroup(group); List <ContactData> oldList = group.GetContactsFromGroup(); ContactData contact = ContactData.GetAllContacts().Intersect(oldList).First(); app.Contact.RemoveContactFromGroup(contact, group); List <ContactData> newList = group.GetContactsFromGroup(); oldList.RemoveAt(0); oldList.Sort(); newList.Sort(); Assert.AreEqual(oldList, newList); }
public void ContactRemovalTest() { List <ContactData> oldContacts = ContactData.GetAllContacts(); ContactData toBeRemoved = oldContacts[0]; app.Contact.Remove(toBeRemoved, true); List <ContactData> newContacts = ContactData.GetAllContacts(); oldContacts.RemoveAt(0); oldContacts.Sort(); newContacts.Sort(); Assert.AreEqual(oldContacts, newContacts); foreach (ContactData contact in newContacts) { Assert.AreNotEqual(contact.IdContact, toBeRemoved.IdContact); } }