예제 #1
0
        public void ContactModificationTestLoadingFromDB()
        {
            ContactData newData = new ContactData("First Name11", "Last Name11");

            if (!app.Contacts.IsContactExisted())
            {
                app.Contacts.CreateNewContact(newData);
                app.Navigation.OpenHomePage();
            }

            List <ContactData> oldContacts = ContactData.GetDataFromDb();
            ContactData        oldData     = oldContacts[0];

            app.Contacts
            .EditContact(oldData.Id)
            .FillContactForm(newData)
            .SubmitNewContactData();
            app.Navigation.OpenHomePage();

            List <ContactData> newContacts = ContactData.GetDataFromDb();

            oldContacts[0].FirstName = newData.FirstName;
            oldContacts[0].LastName  = newData.LastName;
            oldContacts.Sort();
            newContacts.Sort();
            Assert.AreEqual(oldContacts, newContacts);
        }
예제 #2
0
 public void CompareGroupsUI_DB()
 {
     if (PERFORM_LONG_CHECKS)
     {
         List <ContactData> fromUI = app.Contacts.GetContactList();
         List <ContactData> fromDB = ContactData.GetDataFromDb();
         fromUI.Sort();
         fromDB.Sort();
         Assert.AreEqual(fromUI, fromDB);
     }
 }
예제 #3
0
        public void ContactRemovalTestLoadingFromDB()
        {
            ContactData contact = new ContactData("First Name", "Last Name");

            contact.MiddleName = "MiddleName";
            contact.NickName   = "NickName";
            contact.Title      = "Title";

            if (!app.Contacts.IsContactExisted())
            {
                app.Contacts.CreateNewContact(contact);
                app.Navigation.OpenHomePage();
            }

            List <ContactData> oldContacts   = ContactData.GetDataFromDb();
            ContactData        elementRemove = oldContacts[0];

            app.Contacts.Remove(elementRemove);

            List <ContactData> newContacts = ContactData.GetDataFromDb();

            oldContacts.RemoveAt(0);
            Assert.AreEqual(oldContacts, newContacts);
        }