NodeItemTest: ensure that removeParent() removes the child from the parent too
This commit is contained in:
parent
136bc0b4ba
commit
1ea7802768
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue