-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGoldilocksTest.java
More file actions
40 lines (33 loc) · 922 Bytes
/
GoldilocksTest.java
File metadata and controls
40 lines (33 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.example.testing.pitest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
/**
* A test which demonstrates the value of pitest - these tests don't catch a mutation.
*/
class GoldilocksTest {
private final Goldilocks goldilocks = new Goldilocks();
@Test
void too_low() {
assertThat(goldilocks.likesPorridge(30))
.isFalse();
}
@Test
void too_high() {
assertThat(goldilocks.likesPorridge(90))
.isFalse();
}
@Test
void just_right() {
assertThat(goldilocks.likesPorridge(50))
.isTrue();
}
@Disabled
@Test
void boundary_fix() {
assertThat(goldilocks.likesPorridge(40))
.isFalse();
assertThat(goldilocks.likesPorridge(60))
.isTrue();
}
}