Exemplo n.º 1
0
        public void ContactModification()
        {
            var       newData = new ContactBuilder().Build();
            const int contactToModifyIndex = 1;

            List <ContactFormData> oldContacts = ContactFormData.GetAllContacts();
            ContactFormData        oldData     = oldContacts[0];

            app.Contacts.Modify(newData, oldData);

            Assert.AreEqual(oldContacts.Count, app.Contacts.GetContactCount());

            oldContacts[0].Lastname  = newData.Lastname;
            oldContacts[0].Firstname = newData.Firstname;
            List <ContactFormData> newContacts = ContactFormData.GetAllContacts();

            oldContacts.Sort();
            newContacts.Sort();

            Assert.AreEqual(oldContacts, newContacts);

            foreach (ContactFormData contact in newContacts)
            {
                if (contact.Id == oldData.Id)
                {
                    Assert.AreEqual(newData.Lastname, contact.Lastname);
                    Assert.AreEqual(newData.Firstname, contact.Firstname);
                }
            }
        }
Exemplo n.º 2
0
        private void CreateContactIfNotExists()
        {
            var  newContact        = new ContactBuilder().Build();
            bool contactIsNotExist = !IsElementPresent(By.CssSelector("td[class=center]"));

            if (contactIsNotExist)
            {
                Create(newContact);
            }
        }
Exemplo n.º 3
0
        public void NewContact()
        {
            List <ContactFormData> oldContacts = ContactFormData.GetAllContacts();

            var newContact = new ContactBuilder().Build();

            app.Contacts.Create(newContact);

            Assert.AreEqual(oldContacts.Count + 1, app.Contacts.GetContactCount());

            List <ContactFormData> newContacts = ContactFormData.GetAllContacts();

            oldContacts.Add(newContact);
            oldContacts.Sort();
            newContacts.Sort();
            Assert.AreEqual(oldContacts, newContacts);
        }