NodeItemTest: ensure that removeParent() removes the child from the parent too

This commit is contained in:
Paul Campbell 2016-05-26 13:17:21 +01:00
parent 136bc0b4ba
commit 1ea7802768

View file

@ -761,11 +761,12 @@ public class NodeItemTest {
public void removingParentFromNodeWithParentRemovesParent() { public void removingParentFromNodeWithParentRemovesParent() {
//given //given
node = new NodeItem<>(null); node = new NodeItem<>(null);
NodeItem<String> child = new NodeItem<>(null, node); val child = new NodeItem<String>(null, node);
//when //when
child.removeParent(); child.removeParent();
//then //then
assertThat(child.getParent()).isEmpty(); assertThat(child.getParent()).isEmpty();
assertThat(node.getChildren()).isEmpty();
} }
@Test @Test