-
Notifications
You must be signed in to change notification settings - Fork 0
/
ParserTest
34 lines (29 loc) · 1.24 KB
/
ParserTest
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
package linqing.tojava;
import org.junit.Assert;
import org.junit.Test;
public class ParserTest {
public ParserTest() {
}
@Test
public void getCommandWord() {
Assert.assertEquals("todo", Parser.getCommandWord("todo read book"));
Assert.assertEquals("deadline", Parser.getCommandWord("deadline return book /by next Friday"));
Assert.assertEquals("exit", Parser.getCommandWord("exit"));
Assert.assertEquals("", Parser.getCommandWord(""));
Assert.assertEquals("remove", Parser.getCommandWord("remove"));
Assert.assertEquals("print", Parser.getCommandWord("print"));
Assert.assertEquals("save", Parser.getCommandWord("save"));
}
@Test
public void createToDo() throws TaskManagerException {
ToDo actual = Parser.createToDo("todo read book");
ToDo expected = new ToDo("read book");
Assert.assertEquals(expected.toString(), actual.toString());
}
@Test
public void createDeadline() throws TaskManagerException {
Deadline actual = Parser.createDeadline("deadline return book /by next Wednesday");
Deadline expected = new Deadline("return book /by next Wednesday");
Assert.assertEquals(expected.toString(), actual.toString());
}
}