summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco de Wild <mdwild@sogyo.nl>2021-01-19 15:10:18 +0100
committerMarco de Wild <mdwild@sogyo.nl>2021-01-19 15:10:18 +0100
commit6f89051b1f3d2ff2e6e4e4a574276cc06ecedbb7 (patch)
treeed4dee99845cd20814b89b6f53964d53bededa76
parent848d54d91a894b6a62284e08db471a95b0d1cdaa (diff)
Added explanation about failing test
-rw-r--r--README.md6
-rw-r--r--domain/src/main/java/mancala/domain/Foo.java2
-rw-r--r--domain/src/test/java/mancala/domain/FooTest.java6
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