|
@@ -1,3 +1,4 @@
|
|
1
|
+import org.junit.Assert;
|
1
|
2
|
import org.junit.Before;
|
2
|
3
|
import org.junit.Test;
|
3
|
4
|
|
|
@@ -15,17 +16,37 @@ public class HamletParserTest {
|
15
|
16
|
|
16
|
17
|
@Test
|
17
|
18
|
public void testChangeHamletToLeon() {
|
|
19
|
+ HamletParser hamletParser = new HamletParser();
|
|
20
|
+ String beforeAnyChangesMade = hamletParser.getHamletData();
|
|
21
|
+ hamletParser.hamletToLeon();
|
|
22
|
+ String afterChangesMade = hamletParser.getHamletData();
|
|
23
|
+ Assert.assertNotEquals(beforeAnyChangesMade, afterChangesMade);
|
18
|
24
|
}
|
19
|
25
|
|
20
|
26
|
@Test
|
21
|
27
|
public void testChangeHoratioToTariq() {
|
|
28
|
+ HamletParser hamletParser = new HamletParser();
|
|
29
|
+ String beforeAnyChangesMade = hamletParser.getHamletData();
|
|
30
|
+ hamletParser.horatioToTariq();
|
|
31
|
+ String afterChangesMade = hamletParser.getHamletData();
|
|
32
|
+ Assert.assertNotEquals(beforeAnyChangesMade, afterChangesMade);
|
22
|
33
|
}
|
23
|
34
|
|
24
|
35
|
@Test
|
25
|
36
|
public void testFindHoratio() {
|
|
37
|
+ HamletParser hamletParser = new HamletParser();
|
|
38
|
+ String beforeAnyChangesMade = "Hello Horatio hello HORATIO";
|
|
39
|
+ hamletParser.horatioToTariq();
|
|
40
|
+ String actual = "Hello Tariq hello Tariq";
|
|
41
|
+ Assert.assertNotEquals(beforeAnyChangesMade, actual);
|
26
|
42
|
}
|
27
|
43
|
|
28
|
44
|
@Test
|
29
|
45
|
public void testFindHamlet() {
|
|
46
|
+ HamletParser hamletParser = new HamletParser();
|
|
47
|
+ String beforeAnyChangesMade = "Hello Hamlet hello HAMLET";
|
|
48
|
+ hamletParser.horatioToTariq();
|
|
49
|
+ String actual = "Hello Leon hello Leon";
|
|
50
|
+ Assert.assertNotEquals(beforeAnyChangesMade, actual);
|
30
|
51
|
}
|
31
|
52
|
}
|