Skip to content

Commit 1f6909b

Browse files
authored
Merge branch 'boolean-uk:main' into main
2 parents b89fcf2 + 4fb8532 commit 1f6909b

File tree

7 files changed

+57
-4
lines changed

7 files changed

+57
-4
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Extension Criteria
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
jobs:
8+
build-gradle-project:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout project sources
12+
uses: actions/checkout@v2
13+
- name: Setup Gradle
14+
uses: gradle/gradle-build-action@v2
15+
- name: Run build with Gradle Wrapper
16+
run: ./gradlew test --tests com.booleanuk.extension.*

.github/workflows/standard-criteria.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ jobs:
1313
- name: Setup Gradle
1414
uses: gradle/gradle-build-action@v2
1515
- name: Run build with Gradle Wrapper
16-
run: ./gradlew build
16+
run: ./gradlew test --tests com.booleanuk.core.*

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
## Set up instructions
77
- Fork this repository and clone the forked version to your machine
88
- Open the root directory of the project in IntelliJ
9-
- Implement the requirements listed in comments in the `./src/main/java/com.booleanuk/Exercise.java` file
10-
- When ready to test your solution, open the `./src/test/java/com.booleanuk/ExerciseTest.java` file and click a "Run Test" button. You can either run the entire test suite via figure 1 in the screenshot below, or run a specific test via figure 2.
9+
- Implement the requirements listed in comments in the `./src/main/java/com.booleanuk/core/Exercise.java` file
10+
- When ready to test your solution, open the `./src/test/java/com.booleanuk/core/ExerciseTest.java` file and click a "Run Test" button. You can either run the entire test suite via figure 1 in the screenshot below, or run a specific test via figure 2.
1111

1212
![](./assets/run-a-test.PNG)
1313

@@ -21,6 +21,6 @@ In the sample screenshot below, we've tried to complete the first step of the ex
2121

2222
At the top, we see `expected: <32> but was: <33>`. This means the test expected the value to be 32, but the value the student provided was 33. We can see this in the code snippets at the top of the screenshot.
2323

24-
In the stack trace itself, we see this line: `at app//com.booleanuk.ExerciseTest.shouldBeAged32(ExerciseTest.java:20)`. This is helpful! This tells us the exact line in the ExerciseTest.java file (line 20) where the failure happened, as well as the method name (shouldBeAged32), helping us to identify where the issue began. This is the kind of thing you need to look for; a relevant file name, method name, class name and line number to give you a good starting point for debugging.
24+
In the stack trace itself, we see this line: `at app//com.booleanuk.core.ExerciseTest.shouldBeAged32(ExerciseTest.java:20)`. This is helpful! This tells us the exact line in the ExerciseTest.java file (line 20) where the failure happened, as well as the method name (shouldBeAged32), helping us to identify where the issue began. This is the kind of thing you need to look for; a relevant file name, method name, class name and line number to give you a good starting point for debugging.
2525

2626
![](./assets/test-failure.PNG)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.booleanuk.core;
2+
3+
public class Exercise {
4+
public static String sayHelloWorld() {
5+
return "Hello, world!";
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.booleanuk.extension;
2+
3+
public class Extension {
4+
public static String sayHelloWorld() {
5+
return "Hello, world!";
6+
}
7+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.booleanuk.core;
2+
3+
import com.booleanuk.core.Exercise;
4+
import org.junit.jupiter.api.Assertions;
5+
import org.junit.jupiter.api.Test;
6+
7+
class ExerciseTest {
8+
@Test
9+
public void shouldSayHelloWorld() {
10+
Assertions.assertEquals("Hello, world!", Exercise.sayHelloWorld());
11+
}
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.booleanuk.extension;
2+
3+
import org.junit.jupiter.api.Assertions;
4+
import org.junit.jupiter.api.Test;
5+
6+
public class ExtensionTest {
7+
@Test
8+
public void shouldSayHelloWorld() {
9+
Assertions.assertEquals("Hello, world!", Extension.sayHelloWorld());
10+
}
11+
}

0 commit comments

Comments
 (0)