forked from nus-cs2103-AY2122S1/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.
- Loading branch information
1 parent
ae519f8
commit 86b9868
Showing
3 changed files
with
48 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import duke.TaskList; | ||
import duke.Task; | ||
import org.junit.Test; | ||
|
||
import java.time.LocalDate; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
|
||
public class TaskListTest { | ||
@Test | ||
public void confirmTaskAdded() { | ||
TaskList temp = new TaskList("./test/junit.txt"); | ||
LocalDate d = LocalDate.parse("2015-10-20"); | ||
String desc = "read a book"; | ||
temp.addDeadline(desc, d); | ||
Task task = temp.get(0); | ||
assertEquals("[D][ ] read a book by: 2015-10-20", task.toString()); | ||
} | ||
|
||
@Test | ||
public void checkNumberOfTasks() { | ||
TaskList temp = new TaskList("./test/junit.txt"); | ||
LocalDate d1 = LocalDate.parse("2015-10-20"); | ||
for (int i = 0; i < 10; i++) { | ||
temp.addDeadline("read a book", d1); | ||
} | ||
assertEquals(10 , temp.size()); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import duke.Ui; | ||
import org.junit.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class UiTest { | ||
@Test | ||
public void showErrorTest() { | ||
Ui u = new Ui(); | ||
assertEquals("There has been a loading error", u.showLoadingError()); | ||
} | ||
} |