Skip to content
Snippets Groups Projects
Commit f7b8467a authored by Crummy Joker's avatar Crummy Joker
Browse files

added a test

parent 4f6d327b
No related branches found
No related tags found
No related merge requests found
...@@ -8,8 +8,43 @@ ...@@ -8,8 +8,43 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source> <maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target> <maven.compiler.target>11</maven.compiler.target>
<junit.version>5.7.1</junit.version>
<junitplatform.version>1.7.1</junitplatform.version>
<jqwik.version>1.5.0</jqwik.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-commons</artifactId>
<version>${junitplatform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.jqwik</groupId>
<artifactId>jqwik</artifactId>
<version>${jqwik.version}</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.openjfx</groupId> <groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId> <artifactId>javafx-controls</artifactId>
...@@ -23,6 +58,15 @@ ...@@ -23,6 +58,15 @@
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M5</version>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
......
...@@ -25,6 +25,29 @@ import javafx.stage.Stage; ...@@ -25,6 +25,29 @@ import javafx.stage.Stage;
import java.util.Random; import java.util.Random;
import java.io.IOException; import java.io.IOException;
class ColouredCircle{
double x;
double y;
double r;
Color c;
ColouredCircle(double x, double y, double r, Color c){
this.x = x;
this.y = y;
this.r = r;
this.c = c;
}
static ColouredCircle[] circles = new ColouredCircle[]{
new ColouredCircle(60,50,50, Color.RED),
new ColouredCircle(165,50,50, Color.YELLOW),
new ColouredCircle(270,50,50, Color.DODGERBLUE),
new ColouredCircle(375,50,50, Color.ORANGE)
};
}
...@@ -33,6 +56,7 @@ public class App extends Application { ...@@ -33,6 +56,7 @@ public class App extends Application {
Label score = new Label("0"); Label score = new Label("0");
private static Scene scene; private static Scene scene;
int counter = 0; int counter = 0;
@Override @Override
public void start(Stage stage) throws IOException { public void start(Stage stage) throws IOException {
...@@ -40,6 +64,11 @@ public class App extends Application { ...@@ -40,6 +64,11 @@ public class App extends Application {
stage.setWidth(465); stage.setWidth(465);
stage.setHeight(300); stage.setHeight(300);
for (ColouredCircle c : ColouredCircle.circles){
Circle red = new Circle(c.x,c.y,c.r, c.c);
red.setStroke(Color.BLACK);
}
Circle red = new Circle(60,50,50, Color.RED); Circle red = new Circle(60,50,50, Color.RED);
red.setStroke(Color.BLACK); red.setStroke(Color.BLACK);
......
package simon;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
public class test {
@Test
void testX(){
System.out.println("AAAAAAAAAAAA");
for (ColouredCircle c : ColouredCircle.circles){
assertEquals(52, c.r);
}
}
}
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment