2
2
import org .junit .Ignore ;
3
3
import org .junit .Test ;
4
4
5
- import static org .junit . Assert . assertEquals ;
5
+ import static org .assertj . core . api . Assertions . assertThat ;
6
6
7
7
public class TwoferTest {
8
8
@@ -15,39 +15,31 @@ public void setup() {
15
15
16
16
@ Test
17
17
public void noNameGiven () {
18
- String input = null ;
19
- String expected = "One for you, one for me." ;
20
-
21
- assertEquals (expected , twofer .twofer (input ));
18
+ assertThat (twofer .twofer (null ))
19
+ .isEqualTo ("One for you, one for me." );
22
20
}
23
21
24
22
@ Ignore ("Remove to run test" )
25
23
@ Test
26
24
public void aNameGiven () {
27
- String input = "Alice" ;
28
- String expected = "One for Alice, one for me." ;
29
-
30
- assertEquals (expected , twofer .twofer (input ));
25
+ assertThat (twofer .twofer ("Alice" ))
26
+ .isEqualTo ("One for Alice, one for me." );
31
27
}
32
28
33
29
@ Ignore ("Remove to run test" )
34
30
@ Test
35
31
public void anotherNameGiven () {
36
- String input = "Bob" ;
37
- String expected = "One for Bob, one for me." ;
38
-
39
- assertEquals (expected , twofer .twofer (input ));
32
+ assertThat (twofer .twofer ("Bob" ))
33
+ .isEqualTo ("One for Bob, one for me." );
40
34
}
41
35
42
36
/* Track specific */
43
37
44
38
@ Ignore ("Remove to run test" )
45
39
@ Test
46
40
public void emptyStringIsNotTheSameAsNull () {
47
- String input = "" ;
48
- String expected = "One for , one for me." ;
49
-
50
- assertEquals (expected , twofer .twofer (input ));
41
+ assertThat (twofer .twofer ("" ))
42
+ .isEqualTo ("One for , one for me." );
51
43
}
52
-
44
+
53
45
}
0 commit comments