import FunktioLaskin.Control;
import FunktioLaskin.FunktioLaskinView;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import org.junit.Test;
import org.testfx.framework.junit.ApplicationTest;

import static org.testfx.api.FxAssert.verifyThat;
import static org.testfx.matcher.control.TextInputControlMatchers.hasText;

/**
 * FunktioLaskin
 *
 * @author diftraku
 * @package FunktioLaskin
 * @copyright Copyright (c) 2016, Diftraku
 * @license https://opensource.org/licenses/MIT The MIT License (MIT)
 */

public class FunktioLaskinGUITest extends ApplicationTest {
    @Override
    public void start(Stage stage) throws Exception {
        Control control = Control.getInstance();
        FunktioLaskinView view = new FunktioLaskinView();
        stage.setTitle("Calc");
        stage.initStyle(StageStyle.UNIFIED);
        stage.setResizable(false);
        stage.setScene(new Scene(view));
        stage.show();
    }

    @Test
    public void one_plus_two_equals_three() {
        clickOn("#number_one");
        clickOn("#add");
        clickOn("#number_two");
        clickOn("#equals");
        verifyThat("#result", hasText("3.0"));
    }
}

@@ -4,69 +4,58 @@
 ort 
-FunktioLaskin.Control;%0Aimport FunktioLaskin.FunktioLaskinView
+javafx.fxml.FXMLLoader;%0Aimport javafx.scene.Parent
 ;%0Aim
@@ -110,40 +110,8 @@
 ge;%0A
-import javafx.stage.StageStyle;%0A
 impo
@@ -635,216 +635,112 @@
     
-Co
+Pare
 nt
+ 
 ro
-l control = Control.getInstance();%0A        FunktioLaskinView view = new FunktioLaskinView();%0A        stage.setTitle(%22Calc%22);%0A        stage.initStyle(StageStyle.UNIFIED);%0A        stage.setResizable(false
+ot = FXMLLoader.load(getClass().getResource(%22/View.fxml%22));%0A        stage.setTitle(%22Calculator%22
 );%0A 
@@ -775,12 +775,22 @@
 ene(
-view
+root, 800, 700
 ));%0A
@@ -892,23 +892,16 @@
 ickOn(%22#
-number_
 one%22);%0A 
@@ -921,11 +921,12 @@
 n(%22#
-add
+plus
 %22);%0A
@@ -947,15 +947,8 @@
 n(%22#
-number_
 two%22
@@ -1003,14 +1003,14 @@
 t(%22#
-result
+screen
 %22, h

Fix GUI test stub