From 93d91e711243fee9571d002bbb438b3a055c7c21 Mon Sep 17 00:00:00 2001 From: Julius Dewender Date: Thu, 14 Jan 2021 20:54:29 +0100 Subject: [PATCH] initial figure movement field check (smaller than expected) --- build.gradle | 12 ++++++++---- fh.fd.ci.client/build.gradle | 2 +- .../src/main/java/de/fd/fh/Figure.java | 9 +++++++++ .../src/test/java/de/fd/fh/FigureTest.java | 17 +++++++++++++++++ 4 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java create mode 100644 fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java diff --git a/build.gradle b/build.gradle index 4fc1d1f..e2ba4fd 100644 --- a/build.gradle +++ b/build.gradle @@ -10,10 +10,6 @@ repositories { jcenter() } -dependencies { - testCompile group: 'junit', name: 'junit', version: '4.12' -} - subprojects { apply plugin: 'java' @@ -23,11 +19,19 @@ subprojects { jcenter() } + test { + useJUnitPlatform() + } + dependencies { compileOnly 'org.projectlombok:lombok:1.18.16' annotationProcessor 'org.projectlombok:lombok:1.18.16' testCompileOnly 'org.projectlombok:lombok:1.18.16' testAnnotationProcessor 'org.projectlombok:lombok:1.18.16' + + testImplementation('org.junit.jupiter:junit-jupiter:5.7.0') + testImplementation('org.mockito:mockito-core:3.7.0') + testImplementation('org.hamcrest:hamcrest-core:2.2') } } diff --git a/fh.fd.ci.client/build.gradle b/fh.fd.ci.client/build.gradle index 2e0dd87..e2d7f57 100644 --- a/fh.fd.ci.client/build.gradle +++ b/fh.fd.ci.client/build.gradle @@ -1,6 +1,6 @@ plugins { id 'application' - id 'org.openjfx.javafxplugin' version '0.0.8' + id 'org.openjfx.javafxplugin' version '0.0.9' } mainClassName = 'de.fd.fh.ClientApp' diff --git a/fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java b/fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java new file mode 100644 index 0000000..3b3815d --- /dev/null +++ b/fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java @@ -0,0 +1,9 @@ +package de.fd.fh; + +public class Figure +{ + public boolean moveAllowed(int src, int dst, int[] field) + { + return false; + } +} diff --git a/fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java b/fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java new file mode 100644 index 0000000..0494e0a --- /dev/null +++ b/fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java @@ -0,0 +1,17 @@ +package de.fd.fh; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class FigureTest +{ + @Test + void checkMoveWithInvalidFieldSmall() // Feldgröße sollte 8*8 betragen + { + Figure f = new Figure(); + assertFalse(f.moveAllowed(0,0, new int[0])); + } + + +} \ No newline at end of file