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); }
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); }
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); }