Ejemplo n.º 1
0
        public void RemoveGroup_Group_RemovesParentFromChild()
        {
            var rootGroup  = new TestGroup_InheritsGroupBase("/");
            var childGroup = new SubGroup("Child");

            rootGroup.AddGroup(childGroup);
            rootGroup.RemoveGroup(childGroup);

            Assert.Null(childGroup.Parent);
        }
Ejemplo n.º 2
0
        public void RemoveGroup_Group_RemovesChildFromGroups()
        {
            var rootGroup = new TestGroup_InheritsGroupBase("/");
            var subGroup  = new SubGroup("Child");

            rootGroup.AddGroup(subGroup);
            rootGroup.RemoveGroup(subGroup);

            Assert.DoesNotContain(subGroup, rootGroup.SubGroups);
        }
Ejemplo n.º 3
0
        public void RemoveGroup_ParentDoesNotContainChild_DoesNothing()
        {
            var rootGroup     = new TestGroup_InheritsGroupBase("/");
            var subGroup      = new SubGroup("Child");
            var otherSubGroup = new SubGroup("Other");

            rootGroup.AddGroup(subGroup);
            rootGroup.RemoveGroup(otherSubGroup);

            Assert.Contains(subGroup, rootGroup.SubGroups);
            Assert.DoesNotContain(otherSubGroup, rootGroup.SubGroups);
        }