package moe.tristan.easyfxml.util;

import org.junit.Test;
import org.testfx.framework.junit.ApplicationTest;

import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;

public class NodesTest extends ApplicationTest {

    private static final double MARGIN = 5d;
    private static final int WIDTH_PANE = 200;
    private static final int HEIGHT_PANE = 200;

    private Button testButton;

    @Override
    public void start(final Stage stage) {
        this.testButton = new Button();
        final AnchorPane testPane = new AnchorPane(this.testButton);
        stage.setScene(new Scene(testPane, WIDTH_PANE, HEIGHT_PANE));
        stage.show();
    }

    @Test
    public void centerNode() {
        Nodes.centerNode(this.testButton, MARGIN);
    }
}

@@ -104,16 +104,114 @@
 nTest;%0A%0A
+import javafx.beans.property.BooleanProperty;%0Aimport javafx.beans.property.SimpleBooleanProperty;%0A
 import j
@@ -323,18 +323,115 @@
 fx.s
-tage.Stage
+cene.layout.Pane;%0Aimport javafx.stage.Stage;%0A%0Aimport static org.testfx.assertions.api.Assertions.assertThat
 ;%0A%0Ap
@@ -524,16 +524,17 @@
 N = 5d;%0A
+%0A
     priv
@@ -541,91 +541,23 @@
 ate 
-static final int WIDTH_PANE = 200;%0A    private static final int HEIGHT_PANE = 200;%0A
+Pane container;
 %0A   
@@ -694,33 +694,17 @@
     
-final AnchorPane testPa
+contai
 ne
+r
  = n
@@ -772,41 +772,17 @@
 ene(
-testPane, WIDTH_PANE, HEIGHT_PANE
+container
 ));%0A
@@ -907,11 +907,514 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testAutosizeHelpers() %7B%0A        final BooleanProperty shouldDisplay = new SimpleBooleanProperty(true);%0A        final Button testButton = new Button();%0A        Nodes.hideAndResizeParentIf(testButton, shouldDisplay);%0A%0A        assertThat(testButton.isManaged()).isTrue();%0A        assertThat(testButton.isVisible()).isTrue();%0A%0A        shouldDisplay.setValue(false);%0A        assertThat(testButton.isManaged()).isFalse();%0A        assertThat(testButton.isVisible()).isFalse();%0A    %7D
 %0A%7D%0A

Add tests for new node utility methods