public void GroupModificationTest()
        {
            GroupData newData = new GroupData("zzz");

            newData.Header = null;
            newData.Footer = null;
            if (!app.Groups.IsExistGroup(1))
            {
                CreateNewGroups n = new CreateNewGroups();
                n.CreateNewGroup();
            }

            List <GroupData> oldGroups = app.Groups.GetGroupList();
            GroupData        oldData   = oldGroups[0];


            app.Groups.Modify(0, newData);

            List <GroupData> newGroups = app.Groups.GetGroupList();

            oldGroups.RemoveAt(0);
            oldGroups.Add(newData);
            oldGroups.Sort();
            newGroups.Sort();
            Assert.AreEqual(oldGroups, newGroups);

            foreach (GroupData group in newGroups)
            {
                if (group.Id == oldData.Id)
                {
                    Assert.AreEqual(newData.Name, group.Name);
                }
            }
        }
Пример #2
0
        public void GroupRemovalTest()
        {
            List <GroupData> oldGroups = app.Groups.GetGroupList();

            if (!app.Groups.IsExistGroup(1))
            {
                CreateNewGroups n = new CreateNewGroups();
                n.CreateNewGroup();
            }
            app.Groups.Remove(0);

            List <GroupData> newGroups   = app.Groups.GetGroupList();
            GroupData        toBeRemoved = oldGroups[0];

            oldGroups.RemoveAt(0);
            Assert.AreEqual(oldGroups, newGroups);

            foreach (GroupData group in newGroups)
            {
                Assert.AreNotEqual(group.Id, toBeRemoved.Id);
            }
        }