|
@@ -1,6 +1,9 @@
|
1
|
1
|
import org.junit.Before;
|
2
|
2
|
import org.junit.Test;
|
3
|
3
|
|
|
4
|
+import java.util.regex.Matcher;
|
|
5
|
+import java.util.regex.Pattern;
|
|
6
|
+
|
4
|
7
|
import static org.junit.Assert.*;
|
5
|
8
|
|
6
|
9
|
public class HamletParserTest {
|
|
@@ -15,17 +18,62 @@ public class HamletParserTest {
|
15
|
18
|
|
16
|
19
|
@Test
|
17
|
20
|
public void testChangeHamletToLeon() {
|
|
21
|
+ //Given
|
|
22
|
+ HamletParser hamletParser = new HamletParser();
|
|
23
|
+ String hamletText;
|
|
24
|
+ //When
|
|
25
|
+ String expected = "Leon";
|
|
26
|
+ String actual = hamletParser.changeHamletToLeon();
|
|
27
|
+
|
|
28
|
+ //Then
|
|
29
|
+ assertEquals( expected, actual);
|
|
30
|
+
|
18
|
31
|
}
|
19
|
32
|
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
20
|
38
|
@Test
|
21
|
39
|
public void testChangeHoratioToTariq() {
|
|
40
|
+ //Given
|
|
41
|
+ HamletParser hamletParser = new HamletParser();
|
|
42
|
+ String hamletText;
|
|
43
|
+ //When
|
|
44
|
+ String expected = "Tariq";
|
|
45
|
+ String actual = hamletParser.changeHoratioToTariq();
|
|
46
|
+
|
|
47
|
+ //Then
|
|
48
|
+ assertEquals( expected, actual);
|
|
49
|
+
|
22
|
50
|
}
|
23
|
51
|
|
24
|
52
|
@Test
|
25
|
53
|
public void testFindHoratio() {
|
26
|
|
- }
|
|
54
|
+ //Given
|
|
55
|
+ HamletParser hamletParser = new HamletParser();
|
|
56
|
+ String hamletText;
|
|
57
|
+ //When
|
|
58
|
+ int expected = 158;
|
|
59
|
+ int actual = hamletParser.findHoratio();
|
|
60
|
+
|
|
61
|
+ //Then
|
|
62
|
+ assertEquals( expected, actual, 0 );
|
|
63
|
+ }
|
|
64
|
+
|
|
65
|
+
|
27
|
66
|
|
28
|
67
|
@Test
|
29
|
68
|
public void testFindHamlet() {
|
|
69
|
+ //Given
|
|
70
|
+ HamletParser hamletParser = new HamletParser();
|
|
71
|
+ String hamletText;
|
|
72
|
+ //When
|
|
73
|
+ int expected = 472;
|
|
74
|
+ int actual = hamletParser.findHamlet();
|
|
75
|
+
|
|
76
|
+ //Then
|
|
77
|
+ assertEquals( expected, actual, 0 );
|
30
|
78
|
}
|
31
|
79
|
}
|