@Before public void createPlotPartMove() { parent = new PlotPart("parentPart", DummyPlotUnit.Plot, null); // $NON-NLS-1$ formerChild = parent.addChild("child1"); // $NON-NLS-1$ middleChild = parent.addChild("middleChild"); // $NON-NLS-1$ laterChild = parent.addChild("child2"); // $NON-NLS-1$ this.plotPartMove = new PlotPartMove(laterChild, formerChild); }
@Test public void isMovedBeforeIfLocationIsBefore() throws Exception { plotPartMove.moveTo(RelativeLocation.Before); assertArrayEquals(new PlotPart[] {laterChild, formerChild, middleChild}, parent.getChildren()); }