From 6f89051b1f3d2ff2e6e4e4a574276cc06ecedbb7 Mon Sep 17 00:00:00 2001 From: Marco de Wild Date: Tue, 19 Jan 2021 15:10:18 +0100 Subject: Added explanation about failing test --- README.md | 6 +++--- domain/src/main/java/mancala/domain/Foo.java | 2 +- domain/src/test/java/mancala/domain/FooTest.java | 6 ------ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 18f211d..ad46ee4 100644 --- a/README.md +++ b/README.md @@ -35,18 +35,18 @@ To tell the build tool which files to compile, the above structure is used. In s ## Using Gradle -You can either install Gradle on your machine and use the installation or use the Gradle wrapper files found next to this README. +You can either install Gradle on your machine and use the installation or use the Gradle wrapper files found next to this README. Replace the `./gradlew` command with `gradle` if using the globally installed Gradle or `.\gradlew.bat` if you're running the Windows batch script. ```bash # Building ./gradlew build -# Testing +# Testing (will fail with the initial code) ./gradlew test # Running (only relevant for the MVC case) ./gradlew run ``` -Replace the `./gradlew` command with `gradle` if using the globally installed Gradle or `.\gradlew.bat` if you're running the Windows batch script. +When you run the test, you will see a build failure. In `domain/src/test/java/mancala/domain.FooTest.java`, there is a failing test. If you fix the failing test, the build will succeed. ## Assignment diff --git a/domain/src/main/java/mancala/domain/Foo.java b/domain/src/main/java/mancala/domain/Foo.java index 51045fe..bcce6fa 100644 --- a/domain/src/main/java/mancala/domain/Foo.java +++ b/domain/src/main/java/mancala/domain/Foo.java @@ -6,6 +6,6 @@ package mancala.domain; public class Foo { public int theAnswerToLifeTheUniverseAndEverything() { - return 42; + return 41; } } \ No newline at end of file diff --git a/domain/src/test/java/mancala/domain/FooTest.java b/domain/src/test/java/mancala/domain/FooTest.java index 2861c43..fa784d3 100644 --- a/domain/src/test/java/mancala/domain/FooTest.java +++ b/domain/src/test/java/mancala/domain/FooTest.java @@ -20,10 +20,4 @@ public class FooTest { Foo foo = new Foo(); assertEquals(42, foo.theAnswerToLifeTheUniverseAndEverything()); } - - @Test - public void thisTestFailsUnfortunately() { - Foo foo = new Foo(); - assertEquals(3, foo.theAnswerToLifeTheUniverseAndEverything()); - } } \ No newline at end of file -- cgit v1.2.3