4
4
import static org .junit .jupiter .api .Assertions .assertEquals ;
5
5
import static org .junit .jupiter .api .Assertions .assertFalse ;
6
6
import static org .junit .jupiter .api .Assertions .assertNotEquals ;
7
- import org .junit .jupiter .api .BeforeEach ;
8
- import org .junit .jupiter .api .Test ;
9
7
10
8
import com .codedifferently .lesson16 .boxer .Boxer .BoxerHasNoFightsException ;
11
9
import com .codedifferently .lesson16 .boxer .Boxer .BoxerIsRetiredException ;
10
+ import org .junit .jupiter .api .BeforeEach ;
11
+ import org .junit .jupiter .api .Test ;
12
12
13
13
public class BoxerTest {
14
14
@@ -31,8 +31,10 @@ void testRest_restingToIncreaseHealth() {
31
31
boxer .rest ();
32
32
assertNotEquals (boxer .getHealth (), previousHealth );
33
33
}
34
+
34
35
@ Test
35
- void testGetFightHistory_makingAFighterToHaveABout () throws BoxerHasNoFightsException , BoxerIsRetiredException {
36
+ void testGetFightHistory_makingAFighterToHaveABout ()
37
+ throws BoxerHasNoFightsException , BoxerIsRetiredException {
36
38
Boxer mike = new Boxer ("mike" , 1000 , 1000 );
37
39
boxer .bout (mike );
38
40
assertEquals ("You fought " + mike .getName () + " L" , boxer .getFights ());
@@ -57,14 +59,16 @@ void testBout_makingNewBoxerToFightAnotherAndSeeTheResults() throws BoxerIsRetir
57
59
}
58
60
59
61
@ Test
60
- void testBout_makingNewBoxerToFightAndDraw () throws BoxerIsRetiredException , BoxerHasNoFightsException {
62
+ void testBout_makingNewBoxerToFightAndDraw ()
63
+ throws BoxerIsRetiredException , BoxerHasNoFightsException {
61
64
Boxer ryan = new Boxer ("Ryan Garcia" , 99 , 99 );
62
65
boxer .bout (ryan );
63
66
assertEquals (boxer .getFights (), "You fought Ryan Garcia D" );
64
67
}
65
68
66
69
@ Test
67
- void testBout_makingNewBoxerToWinAgainstWithBoxer () throws BoxerIsRetiredException , BoxerHasNoFightsException {
70
+ void testBout_makingNewBoxerToWinAgainstWithBoxer ()
71
+ throws BoxerIsRetiredException , BoxerHasNoFightsException {
68
72
Boxer hitman = new Boxer ("Thomas Hearns" , 98 , 98 );
69
73
boxer .bout (hitman );
70
74
assertEquals (boxer .getFights (), "You fought " + hitman .getName () + " W" );
@@ -128,7 +132,8 @@ void testSetHealth() {
128
132
}
129
133
130
134
@ Test
131
- void testBoxerIsRetiredException_retiringBoxerThenThrowingException () throws BoxerIsRetiredException {
135
+ void testBoxerIsRetiredException_retiringBoxerThenThrowingException ()
136
+ throws BoxerIsRetiredException {
132
137
Boxer leaonard = new Boxer ("Sugar ray" , 200 , 200 );
133
138
boxer .retire ();
134
139
assertThatThrownBy (
0 commit comments