|
@@ -41,13 +41,54 @@ public class HamletParserTest {
|
41
|
41
|
|
42
|
42
|
@Test
|
43
|
43
|
public void testChangeHoratioToTariq() {
|
|
44
|
+ String sentence = "Horatio hates cowboy fans and will kill them all";
|
|
45
|
+ HamletParser hamletParser = new HamletParser(sentence);
|
|
46
|
+ String expected = "Tariq hates cowboy fans and will kill them all";
|
|
47
|
+ String actual = hamletParser.changeHoratioToTariq(sentence);
|
|
48
|
+ Assert.assertEquals(expected, actual);
|
|
49
|
+
|
44
|
50
|
}
|
|
51
|
+ @Test
|
|
52
|
+ public void testChangeHoratioToTariq2() {
|
|
53
|
+ String sentence = "Horatio loves the eagles horatio was happy when the eagles won the superbowl";
|
|
54
|
+ HamletParser hamletParser = new HamletParser(sentence);
|
|
55
|
+ String expected = "Tariq loves the eagles Tariq was happy when the eagles won the superbowl";
|
|
56
|
+ String actual = hamletParser.changeHoratioToTariq(sentence);
|
|
57
|
+ Assert.assertEquals(expected, actual);
|
|
58
|
+ }
|
|
59
|
+
|
45
|
60
|
|
46
|
61
|
@Test
|
47
|
62
|
public void testFindHoratio() {
|
|
63
|
+ //Given
|
|
64
|
+ boolean expected = true;
|
|
65
|
+
|
|
66
|
+ //when
|
|
67
|
+ hamletParser = new HamletParser();
|
|
68
|
+ boolean actual = hamletParser.findHoratio();
|
|
69
|
+
|
|
70
|
+ //Then
|
|
71
|
+ Assert.assertEquals(expected,actual);
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
48
|
80
|
}
|
49
|
81
|
|
50
|
82
|
@Test
|
51
|
83
|
public void testFindHamlet() {
|
|
84
|
+ //Given
|
|
85
|
+ boolean expected = true;
|
|
86
|
+
|
|
87
|
+ //when
|
|
88
|
+ hamletParser = new HamletParser();
|
|
89
|
+ boolean actual = hamletParser.findHoratio();
|
|
90
|
+
|
|
91
|
+ //Then
|
|
92
|
+ Assert.assertEquals(expected,actual);
|
52
|
93
|
}
|
53
|
94
|
}
|