1
1
package org .eol .globi .taxon ;
2
2
3
- import org .apache .commons .lang .StringUtils ;
3
+ import org .apache .commons .lang3 .StringUtils ;
4
4
import org .junit .Ignore ;
5
5
import org .junit .Test ;
6
6
7
7
import static org .hamcrest .MatcherAssert .assertThat ;
8
8
import static org .hamcrest .core .Is .is ;
9
9
10
- public class CapitalizeFirstWordTest {
10
+ public class CapitalizerTest {
11
11
12
12
@ Test
13
13
public void undoLowerCase () {
14
- String corrected = new CapitalizeFirstWord (). suggest ("homo sapiens" );
14
+ String corrected = Capitalizer . capitalize ("homo sapiens" );
15
15
assertThat (corrected , is ("Homo sapiens" ));
16
16
}
17
17
18
18
@ Test
19
19
public void undoLowerCase2 () {
20
- String corrected = new CapitalizeFirstWord (). suggest ("io" );
20
+ String corrected = Capitalizer . capitalize ("io" );
21
21
assertThat (corrected , is ("Io" ));
22
22
}
23
23
24
24
@ Test
25
25
public void doNothing () {
26
- String corrected = new CapitalizeFirstWord (). suggest ("Homo Sapiens" );
26
+ String corrected = Capitalizer . capitalize ("Homo Sapiens" );
27
27
assertThat (corrected , is ("Homo Sapiens" ));
28
28
}
29
29
30
30
@ Test (timeout = 10 )
31
31
public void longName () {
32
32
String aLongName = "7 small acorns or other seed found in cheek pouches during preparation. Seeds are brown, pointed at one end and flattened on the other, 0.75 x 0.6cm." ;
33
- String corrected = new CapitalizeFirstWord (). suggest (aLongName );
33
+ String corrected = Capitalizer . capitalize (aLongName );
34
34
assertThat (corrected , is (aLongName ));
35
35
}
36
36
@@ -42,23 +42,21 @@ public void capitalizeLongName() {
42
42
assertThat (corrected , is (aLongName ));
43
43
}
44
44
45
-
46
45
@ Test (timeout = 10 )
47
46
public void anotherLongName () {
48
47
String anotherLongName = "Acorns or found cheek pouches during preparation are brown pointed at end flattened the x cm" ;
49
48
String corrected
50
- = new CapitalizeFirstWord ()
51
- .suggest (anotherLongName );
49
+ = Capitalizer .capitalize (anotherLongName );
52
50
assertThat (corrected , is (anotherLongName ));
53
51
}
54
52
55
53
@ Test (timeout = 10 )
56
54
public void yetAnotherLongName () {
57
55
String anotherLongName = "Acorns or found cheek pouches during preparation are brown pointed at end flattened the x cm" ;
58
56
String corrected
59
- = new CapitalizeFirstWord ()
60
- .suggest (anotherLongName );
57
+ = Capitalizer .capitalize (anotherLongName );
61
58
assertThat (corrected , is (anotherLongName ));
62
59
}
63
60
61
+
64
62
}
0 commit comments