Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
        }
 public void CompareGroupsUI_DB()
 {
     if (PERFORM_LONG_UI_CHECKS)
     {
         List <Class2_GroupData> fromUI = app.Groups.GetGroupList();
         List <Class2_GroupData> fromDB = Class2_GroupData.GetAllGroupInfo();
         fromUI.Sort();
         fromDB.Sort();
         Assert.AreEqual(fromUI, fromDB);
     }
 }
Ejemplo n.º 4
0
        public void CreateGroup(Class2_GroupData group)
        {
            app.Navigator.GroupsPage();
            List <Class2_GroupData> oldGroups = Class2_GroupData.GetAllGroupInfo();

            app.Groups.Create(group);
            List <Class2_GroupData> newGroups = Class2_GroupData.GetAllGroupInfo();

            oldGroups.Add(group);
            oldGroups.Sort();
            newGroups.Sort();
            Assert.AreEqual(oldGroups, newGroups);
        }
Ejemplo n.º 5
0
        public void RemoveGroupTest()
        {
            app.Navigator.GroupsPage();

            List <Class2_GroupData> oldGroups   = Class2_GroupData.GetAllGroupInfo();
            Class2_GroupData        toBeRemoved = oldGroups[0];

            app.Groups.GroupExist();
            app.Groups.RemoveGroupDB(toBeRemoved);

            //  app.Groups.GroupExist();
            //  app.Groups.RemoveGroup(0);
            List <Class2_GroupData> newGroups = Class2_GroupData.GetAllGroupInfo();

            oldGroups.RemoveAt(0);

            Assert.AreEqual(oldGroups, newGroups);
        }
        public void ModifyGroupTest()
        {
            app.Navigator.GroupsPage();
            Class2_GroupData newData = new Class2_GroupData("Yozha");

            newData.Header = null;
            newData.Footer = null;
            List <Class2_GroupData> oldGroups  = Class2_GroupData.GetAllGroupInfo();
            Class2_GroupData        toBeUpdate = oldGroups[0];

            app.Groups.ModifyGroup(toBeUpdate, newData);
            List <Class2_GroupData> newGroups = Class2_GroupData.GetAllGroupInfo();

            oldGroups[0].Name = newData.Name;
            oldGroups.Sort();
            newGroups.Sort();
            Assert.AreEqual(oldGroups, newGroups);
        }
Ejemplo n.º 7
0
        public void TestDBConnectivity()
        {
            foreach (Class3_ContactData contact in Class2_GroupData.GetAllGroupInfo()[0].GetContacts())
            {
                Console.Out.WriteLine(contact);
            }
            ;



            /* --Скорость проверки из UI и BD
             *
             * DateTime start = DateTime.Now;
             * List<Class2_GroupData> fromUI = app.Groups.GetGroupList();
             * DateTime end = DateTime.Now;
             * Console.Out.WriteLine("UI = " + end.Subtract(start));
             *
             * start = DateTime.Now;
             * List<Class2_GroupData> fromDB = Class2_GroupData.GetAllGroupInfo();
             * end = DateTime.Now;
             * Console.Out.WriteLine("DB = " + end.Subtract(start));
             */
        }