Skip to content

Commit

Permalink
Merge pull request #3 from nqt230/branch-A-Assertions
Browse files Browse the repository at this point in the history
Branch a assertions
  • Loading branch information
nqt230 authored Sep 10, 2022
2 parents cc9c6aa + 6bbfad1 commit e7d7698
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/duke/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ public void start(Stage stage) {
try {
Duke.initialize();

assert Duke.getIsRunning()
: "Duke.getIsRunning() should be true if Duke.initialize() runs correctly";

FXMLLoader fxmlLoader = new FXMLLoader(Main.class.getResource("/view/MainWindow.fxml"));
AnchorPane ap = fxmlLoader.load();
Scene scene = new Scene(ap);
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/duke/TaskList.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public static List<String> getTasksStrings() {
* @return The task that was added.
*/
public static Task addToList(Task task) {
assert task != null
: "a null Task should not be added to the list";

tasks.add(task);

return task;
Expand Down

0 comments on commit e7d7698

Please sign in to comment.