package deltadak;

import javafx.scene.control.ProgressIndicator;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

/**
 * Tests {@link HelloJavaFX} class.
 */
class HelloJavaFXTest {

    /**
     * Test {@link HelloJavaFX#calculate()} method.
     */
    @Test
    public void testCalculate(){
        HelloJavaFX helloJavaFX = new HelloJavaFX();

        assertEquals(2, helloJavaFX.calculate(), "message");
    }

    @Test
    public void testProgress() {
        HelloJavaFX helloJavaFX = new HelloJavaFX();
        ProgressIndicator progressIndicator = new ProgressIndicator();

        assertTrue(helloJavaFX.setLoading(progressIndicator));
    }

}
@@ -448,16 +448,81 @@
 %0A    %7D%0A%0A
+    /**%0A     * Fails on %60new ProgressIndicator();%60 line.%0A     */%0A
     @Tes
@@ -609,16 +609,171 @@
 vaFX();%0A
+%0A        // Initialise JavaFX Toolkit, needed for using elements like ProgressIndicator.%0A        com.sun.javafx.application.PlatformImpl.startup(()-%3E%7B%7D);%0A%0A
         
@@ -898,16 +898,102 @@
 cator));
+%0A%0A        // Shutdown toolkit.%0A        com.sun.javafx.application.PlatformImpl.exit();
 %0A    %7D%0A%0A

fix tests by initialising fx toolkit