Browse Source

all instances replaced

jasamuels 6 years ago
parent
commit
33376f201f
2 changed files with 5405 additions and 7 deletions
  1. 22
    7
      src/test/java/HamletParserTest.java
  2. 5383
    0
      target/classes/hamlet.txt

+ 22
- 7
src/test/java/HamletParserTest.java View File

1
+import org.junit.Assert;
1
 import org.junit.Before;
2
 import org.junit.Before;
2
 import org.junit.Test;
3
 import org.junit.Test;
3
 
4
 
15
 
16
 
16
     @Test
17
     @Test
17
     public void testChangeHamletToLeon() {
18
     public void testChangeHamletToLeon() {
19
+        hamletText = hamletText.replaceAll("(?i)hamlet", "Leon");
20
+
21
+        Assert.assertFalse(hamletText.contains("Hamlet"));
22
+        Assert.assertFalse(hamletText.contains("hamlet"));
23
+        Assert.assertFalse(hamletText.contains("HAMLET"));
24
+
25
+
18
     }
26
     }
19
 
27
 
20
     @Test
28
     @Test
21
     public void testChangeHoratioToTariq() {
29
     public void testChangeHoratioToTariq() {
22
-    }
23
 
30
 
24
-    @Test
25
-    public void testFindHoratio() {
26
-    }
31
+        hamletText = hamletText.replaceAll("(?i)horatio", "Tariq");
27
 
32
 
28
-    @Test
29
-    public void testFindHamlet() {
33
+        Assert.assertFalse(hamletText.contains("Horatio"));
34
+        Assert.assertFalse(hamletText.contains("horatio"));
35
+        Assert.assertFalse(hamletText.contains("HORATIO"));
30
     }
36
     }
31
-}
37
+}
38
+
39
+//    @Test
40
+//    public void testFindHoratio() {
41
+//    }
42
+//
43
+//    @Test
44
+//    public void testFindHamlet() {
45
+//    }
46
+//}

+ 5383
- 0
target/classes/hamlet.txt
File diff suppressed because it is too large
View File