예제 #1
0
        public void RemoveContactToGroup()
        {
            Class3_ContactData contact;

            app.Contacts.ContactExist();
            app.Groups.GroupExist();

            Class2_GroupData group = Class2_GroupData.GetAllGroupInfo()
                                     .Find(x => x.Name.Contains("NewTest"));

            if (group == null)
            {
                group = Class2_GroupData.GetAllGroupInfo()[0];
            }

            List <Class3_ContactData> oldList = group.GetContacts();

            if (group.GetContacts().Count == 0)
            {
                contact = Class3_ContactData.GetAllContactInfo()[0];
                app.Contacts.AddContactToGroup(contact, group);
            }
            else
            {
                contact = oldList[0];
            }

            app.Contacts.RemoveContactFromGroup(contact, group);
            List <Class3_ContactData> newList = group.GetContacts();

            oldList.Remove(contact);
            oldList.Sort();
            newList.Sort();
            Assert.AreEqual(oldList, newList);
        }
예제 #2
0
        public void AddContactToGroup()
        {
            Class3_ContactData contact;

            app.Contacts.ContactExist();
            app.Groups.GroupExist();

            Class2_GroupData          group   = Class2_GroupData.GetAllGroupInfo()[0];
            List <Class3_ContactData> oldList = group.GetContacts();

            if (Class2_GroupData.GetAllGroupInfo().Count == oldList.Count)
            {
                contact = new Class3_ContactData("new", "contact");
                app.Contacts.CreateContact(contact);
            }

            contact = Class3_ContactData.GetAllContactInfo()
                      .Except(oldList).First();

            app.Contacts.AddContactToGroup(contact, group);

            List <Class3_ContactData> newList = group.GetContacts();

            oldList.Add(contact);
            oldList.Sort();
            newList.Sort();
            Assert.AreEqual(oldList, newList);
        }
예제 #3
0
 public void CompareContactUI_DB()
 {
     if (PERFORM_LONG_UI_CHECKS)
     {
         List <Class3_ContactData> fromUI = app.Contacts.GetContactsList();
         List <Class3_ContactData> fromDB = Class3_ContactData.GetAllContactInfo();
         fromUI.Sort();
         fromDB.Sort();
         Assert.AreEqual(fromUI, fromDB);
     }
 }
        public void TheAddContactTest(Class3_ContactData contact)
        {
            List <Class3_ContactData> oldContact = Class3_ContactData.GetAllContactInfo();

            app.Contacts.CreateContact(contact);
            List <Class3_ContactData> newContact = Class3_ContactData.GetAllContactInfo();

            oldContact.Add(contact);
            oldContact.Sort();
            newContact.Sort();
            Assert.AreEqual(oldContact, newContact);
        }
예제 #5
0
        public void RemoveContactTest()
        {
            app.Contacts.ContactExist();
            List <Class3_ContactData> oldContact  = Class3_ContactData.GetAllContactInfo();
            Class3_ContactData        toBeRemoved = oldContact[0];

            app.Contacts.RemoveContactDB(toBeRemoved);
            List <Class3_ContactData> newContact = Class3_ContactData.GetAllContactInfo();

            oldContact.RemoveAt(0);
            oldContact.Sort();
            newContact.Sort();
            Assert.AreEqual(oldContact, newContact);
        }
예제 #6
0
        public void ModifyContactTest()
        {
            Class3_ContactData data = new Class3_ContactData("Croopper", null);

            data.Firstname   = "Croopper";
            data.Lastname    = null;
            data.MobilePhone = null;
            List <Class3_ContactData> oldContact = Class3_ContactData.GetAllContactInfo();

            app.Contacts.ModifyContact(oldContact[0], data);
            List <Class3_ContactData> newContact = Class3_ContactData.GetAllContactInfo();

            oldContact[0].Firstname = data.Firstname;
            oldContact.Sort();
            newContact.Sort();
            Assert.AreEqual(oldContact, newContact);
        }