public void Test_SubGrid_RemoveFromParent_Null() { // This can't be tested fully as the entire Set/Get subgrid functionality is abstract at this point, and // RemoveFromParent is part of that abstract workflow. At this level, we will test that no exception occurs // if the parent relationship is null SubGridTree tree = new SubGridTree(SubGridTreeConsts.SubGridTreeLevels, 1.0, new SubGridFactory <NodeSubGrid, LeafSubGrid>()); var leafSubgrid = new SubGrid(tree, null, SubGridTreeConsts.SubGridTreeLevels); leafSubgrid.RemoveFromParent(); leafSubgrid.Parent.Should().BeNull(); // Good! }