-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathHamletParserTest.java
More file actions
59 lines (47 loc) · 1.48 KB
/
HamletParserTest.java
File metadata and controls
59 lines (47 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
public class HamletParserTest {
private String hamletText;
private HamletParser hamletParser;
@Before
public void setUp() {
this.hamletParser = new HamletParser();
this.hamletText = hamletParser.getHamletData();
}
@Test
public void testChangeHamletToLeon() {
String name = "Hamlet";
String expected = "Leon";
String actual = this.hamletParser.changeHamletToLeon(name);
Assert.assertEquals(expected, actual);
}
@Test
public void testChangeHamletToLeonFalse() {
String name = "Tim";
String expected = null;
String actual = this.hamletParser.changeHamletToLeon(name);
Assert.assertEquals(expected, actual);
}
@Test
public void testChangeHoratioToTariq() {
String name = "Horatio";
String expected = "Tariq";
String actual = this.hamletParser.changeHoratioToTariq(name);
Assert.assertEquals(expected, actual);
}
@Test
public void testFindHoratio() {
String hor = "Horatio";
boolean expected = true;
boolean actual = this.hamletParser.findHoratio(hor);
Assert.assertEquals(expected, actual);
}
@Test
public void testFindHamlet() {
boolean expected = true;
boolean actual = this.hamletParser.findHamlet("Hamlet");
Assert.assertEquals(expected, actual);
}
}