public void DeleteGroupTest() { DataGroup newGroup = new DataGroup("test"); newGroup.Header = "test_header"; newGroup.Footer = "test_footer"; List <DataGroup> oldGroups = app.Groups.GetGroupList(); DataGroup toBeRemoved = oldGroups[0]; if (!app.Groups.FindGroup()) { app.Groups.Create(newGroup); } app.Groups.Delete(0); Assert.AreEqual(oldGroups.Count - 1, app.Groups.GetGroupCount()); List <DataGroup> newGroups = app.Groups.GetGroupList(); oldGroups.RemoveAt(0); Assert.AreEqual(oldGroups, newGroups); foreach (DataGroup group in newGroups) { Assert.AreNotEqual(toBeRemoved.Id, group.Id); } }
public void DeleteContactFromGroups(DataNewContact cont, DataGroup group) { manager.Navigation.GoToHomePage(); SelectGroupFilter(group.Name); CheckUserById(cont.Id); RemoveFromGroup(); }
public HelperGroup DeleteById(DataGroup group) { manager.Navigation.OpenGroupPage(); SelectGroupById(group.Id); DeleteGroup(); manager.Navigation.OpenGroupPage(); return(this); }
public void AddContactToGroups(DataNewContact cont, DataGroup group) { manager.Navigation.GoToHomePage(); SelectGroupFilter("[all]"); CheckUserById(cont.Id); SelectGroupToAdd(group.Name); CommitAdd(); }
public HelperGroup Create(DataGroup group) { manager.Navigation.OpenGroupPage(); InitCreateGroup(); FillGroupForm(group); SubmitCreateGroup(); manager.Navigation.OpenGroupPage(); return(this); }
public HelperGroup UpdateById(DataGroup group, DataGroup newData) { manager.Navigation.OpenGroupPage(); SelectGroupById(group.Id); EditGroup(); FillGroupForm(newData); UpdateGroup(); manager.Navigation.OpenGroupPage(); return(this); }
public HelperGroup Update(int indexGroup, DataGroup newData) { manager.Navigation.OpenGroupPage(); SelectGroup(indexGroup); EditGroup(); FillGroupForm(newData); UpdateGroup(); manager.Navigation.OpenGroupPage(); return(this); }
public void CompareGroupsUI_DB() { if (PERFORM_LONG_UI_CHECKS) { List <DataGroup> fromUI = app.Groups.GetGroupList(); List <DataGroup> fromDB = DataGroup.GetAllGroup(); fromUI.Sort(); fromDB.Sort(); Assert.AreEqual(fromUI, fromDB); } }
public void TestDB() { DateTime start = DateTime.Now; List <DataGroup> fromUi = app.Groups.GetGroupList(); DateTime end = DateTime.Now; System.Console.Out.Write(end.Subtract(start)); start = DateTime.Now; List <DataGroup> fromDb = DataGroup.GetAllGroup(); end = DateTime.Now; System.Console.Out.Write(end.Subtract(start)); }
public void GroupCreation(DataGroup group) { List <DataGroup> oldGroups = DataGroup.GetAllGroup(); app.Groups.Create(group); Assert.AreEqual(oldGroups.Count + 1, app.Groups.GetGroupCount()); List <DataGroup> newGroups = DataGroup.GetAllGroup(); oldGroups.Add(group); oldGroups.Sort(); newGroups.Sort(); Assert.AreEqual(oldGroups, newGroups); }
public void TestAddContactToGroup() { DataNewContact newuser = new DataNewContact("Tony", "Stark"); DataGroup newGroup = new DataGroup("test"); if (!app.Contacts.FindUsers()) { app.Contacts.New(newuser); } if (!app.Groups.FindGroups()) { app.Groups.Create(newGroup); } List <DataGroup> countGroups = DataGroup.GetAllGroup(); var contWithoutGroups = new List <DataNewContact>(); int count = countGroups.Count; for (int i = 0; i < count; i++) { DataGroup gr = DataGroup.GetAllGroup()[i]; DataNewContact cont = DataNewContact.GetAllContact().Except(gr.GetContactInGroup()).FirstOrDefault(); if (!contWithoutGroups.Contains(cont)) { contWithoutGroups.Add(cont); } } if (contWithoutGroups.Count == 0) { app.Contacts.New(newuser); } DataGroup group = DataGroup.GetAllGroup()[0]; DataNewContact contact = contWithoutGroups[0]; List <DataNewContact> oldLIst = group.GetContactInGroup(); app.Contacts.AddContactToGroups(contact, group); List <DataNewContact> newList = group.GetContactInGroup(); oldLIst.Add(contact); newList.Sort(); oldLIst.Sort(); Assert.AreEqual(oldLIst, newList); }
public void BadNameGroupCreation() { DataGroup group = new DataGroup("a'a"); group.Header = ""; group.Footer = ""; List <DataGroup> oldGroups = DataGroup.GetAllGroup(); app.Groups.Create(group); Assert.AreEqual(oldGroups.Count + 1, app.Groups.GetGroupCount()); List <DataGroup> newGroups = DataGroup.GetAllGroup(); oldGroups.Add(group); oldGroups.Sort(); newGroups.Sort(); Assert.AreEqual(oldGroups, newGroups); }
public void UpdateGroupTest() { DataGroup newData = new DataGroup("test_2"); newData.Footer = "Footer"; DataGroup newGroup = new DataGroup("test"); newGroup.Header = "test_header"; newGroup.Footer = "test_footer"; if (!app.Groups.FindGroups()) { app.Groups.Create(newGroup); } List <DataGroup> oldGroups = DataGroup.GetAllGroup(); DataGroup oldData = oldGroups[0]; app.Groups.UpdateById(oldData, newData); Assert.AreEqual(oldGroups.Count, app.Groups.GetGroupCount()); List <DataGroup> newGroups = DataGroup.GetAllGroup(); oldGroups[0].Name = newData.Name; oldGroups.Sort(); newGroups.Sort(); Assert.AreEqual(oldGroups, newGroups); foreach (DataGroup group in newGroups) { if (group.Id == oldData.Id) { Assert.AreEqual(newData.Name, group.Name); } } }
public void TestDeleteContactFromGroup() { DataNewContact newuser = new DataNewContact("Tony", "Stark"); DataGroup newGroup = new DataGroup("test"); if (!app.Contacts.FindUsers()) { app.Contacts.New(newuser); } if (!app.Groups.FindGroups()) { app.Groups.Create(newGroup); } List <DataGroup> countGroups = DataGroup.GetAllGroup(); DataGroup group = DataGroup.GetAllGroup()[0]; List <DataNewContact> oldLIst = group.GetContactInGroup(); if (oldLIst == null) { DataNewContact cnt = DataNewContact.GetAllContact().Except(oldLIst).First(); app.Contacts.AddContactToGroups(cnt, group); } DataNewContact contact = oldLIst[0]; app.Contacts.DeleteContactFromGroups(contact, group); List <DataNewContact> newList = group.GetContactInGroup(); oldLIst.Remove(contact); newList.Sort(); oldLIst.Sort(); Assert.AreEqual(oldLIst, newList); }