forked from nus-cs2103-AY2223S2/ip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add JUnit tests for Task and Deadline
- Loading branch information
Showing
3 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ src/main/resources/docs/ | |
.DS_Store | ||
*.iml | ||
bin/ | ||
*.class | ||
|
||
/text-ui-test/ACTUAL.TXT | ||
text-ui-test/EXPECTED-UNIX.TXT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
package task;public class EventTest { | ||
package task; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import org.junit.jupiter.api.Test; | ||
public class EventTest { | ||
@Test | ||
public void testEventString() { | ||
Event event = new Event("project meeting", "2023-06-12", "2023-07-12", " | 12/06/2023 | 12/06/2023"); | ||
String expected = "[E][ ] project meeting (from: Jun 12 2023 00:00 to: Jul 12 2023 23:59)"; | ||
assertEquals(expected, event.toString()); | ||
} | ||
|
||
@Test | ||
public void testEventDescription() { | ||
Event event = new Event("project meeting", "2023-06-12", "2023-07-12", " | 12/06/2023 | 12/06/2023"); | ||
String expected = "project meeting"; | ||
assertEquals(expected, event.getDescription()); | ||
} | ||
|
||
@Test | ||
public void testEventRemarks() { | ||
Event event = new Event("project meeting", "2023-06-12", "2023-07-12", " | 12/06/2023 | 12/06/2023"); | ||
String expected = " | 12/06/2023 | 12/06/2023"; | ||
assertEquals(expected, event.getRemarks()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,28 @@ | ||
package task; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class TaskTest { | ||
@Test | ||
public | ||
public void testTaskString() { | ||
Task task = new Task("test"); | ||
String expected = "[ ] test"; | ||
assertEquals(expected, task.toString()); | ||
} | ||
|
||
@Test | ||
public void testTaskRemarks() { | ||
Task task = new Task("test", ""); | ||
String expected = ""; | ||
assertEquals(expected, task.getRemarks()); | ||
} | ||
|
||
@Test | ||
public void testTaskDescription() { | ||
Task task = new Task("test"); | ||
String expected = "test"; | ||
assertEquals(expected, task.getDescription()); | ||
} | ||
} |