-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathHamletParserTest.java
More file actions
50 lines (43 loc) · 1.33 KB
/
HamletParserTest.java
File metadata and controls
50 lines (43 loc) · 1.33 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
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() {
//given
String expectedValue="His fell to Leon";
String input="His fell to Hamlet";
//when
String actualValue=HamletParser.changeHamletToLeon(input);
//then
Assert.assertEquals(expectedValue,actualValue);
}
@Test
public void testChangeHoratioToTariq() {
//given
String expectedValue="If you do meet Tariq and Marcellus";
String input="If you do meet Horatio and Marcellus";
//when
String actualValue=HamletParser.changeHoratioToTariq(input);
//then
Assert.assertEquals(expectedValue,actualValue);
}
@Test
public void testFindHoratio() {
boolean actualValue = HamletParser.findHoratio(hamletText);
Assert.assertTrue(actualValue);
}
@Test
public void testFindHamlet() {
boolean actualValue=HamletParser.findHamlet(hamletText);
Assert.assertTrue(actualValue);
}
}