Skip to content

Commit 0b05747

Browse files
authored
Merge branch 'code-differently:main' into Lesson_14
2 parents d122f2a + 112c87a commit 0b05747

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

lesson_15/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Please review the following resources before lecture:
1414

1515
### Unit Testing
1616

17-
For the code in the Lesson 15 app, you will write tests in the [unit tests project][unit-tests-link]. You must achieve a code coverage of 90% or more. The coverage report can be viewed at [./tdd/tdd_app/build/reports/jacoco/test/html/index.html][coverage-report] after running `./gradlew check` or `./gradlew jacocoTestReport`.
17+
For the code in the Lesson 15 app, you will write tests in the [unit tests project][unit-tests-link]. You must achieve a code coverage of 80% or more. The coverage report can be viewed at [./tdd/tdd_app/build/reports/jacoco/test/html/index.html][coverage-report] after running `./gradlew check` or `./gradlew jacocoTestReport`.
1818

1919
In addition to writing unit tests, you will need to implement a new method on the `Employee` class called `getDetails` that returns a string describing the employee using the Test-Driven Development methodology.
2020

lesson_15/tdd/tdd_app/build.gradle.kts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ tasks.jacocoTestReport {
4949
}
5050
}
5151

52+
tasks.jacocoTestCoverageVerification {
53+
violationRules {
54+
rule {
55+
limit {
56+
minimum = "0.8".toBigDecimal()
57+
}
58+
}
59+
}
60+
}
61+
62+
tasks.check {
63+
dependsOn(tasks.jacocoTestCoverageVerification)
64+
}
5265

5366
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
5467

lesson_15/tdd/tdd_app/src/test/java/com/codedifferently/lesson15/Lesson15Test.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@ class Lesson15Test {
1010
public void testLesson15() {
1111
assertThat(new Lesson15()).isNotNull();
1212
}
13+
14+
@Test
15+
public void testGetGreeting() {
16+
// Act
17+
Lesson15.main(null);
18+
}
1319
}

0 commit comments

Comments
 (0)