Skip to content

Commit

Permalink
Changed isDone tick and cross to D and X due to encoding issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Impala36 committed Jan 26, 2021
1 parent 88e5b9b commit 9923add
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/duke/database/Database.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public TaskList extractTasks(ArrayList<String> lines, TaskList tasks, Ui ui, Dat
ui.printInvalidTask();
break;
}
if (taskStatus.equals("")) {
if (taskStatus.equals("D")) {
tasks.get(tasks.size() - 1).setDone();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/duke/task/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void setDone() {
}

String getTaskStatus(Boolean isDone) {
return "[" + (isDone ? "\u2713" : "\u2718") + "] "; //return tick or X symbols
return "[" + (isDone ? "D" : "X") + "] ";
}

public String getDescription() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/duke/ui/Ui.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public String printTaskRemoved(TaskList tasks, int index) {

public String printTaskCompleted(int index, TaskList tasks) {
return "Good work there! Now we have:\n"
+ colorGreen("Task [" + index + "] ")
+ colorGreen(index + ". ")
+ tasks.get(index - 1).getDescription() + colorGreen(" set as completed!");
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/DatabaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public void testExtractTasks() throws IOException {
lines.add("1. [✘] [Todo] something");
database.extractTasks(lines, tasks, ui, database);

assertEquals(tasks.get(0).getDescription(), "[] [Todo] something");
assertEquals(tasks.get(0).getDescription(), "[X] [Todo] something");
}
}
2 changes: 1 addition & 1 deletion src/test/java/EventCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ public void eventCommandTest() {
String lineWithoutCommand = "submit /at 27/09/2020 2323 /to 2359";
new EventCommand(lineWithoutCommand, tasks, ui, database).execute();

assertEquals(tasks.get(0).getDescription(),"[] [Event] submit (at: 27 Sep 2020 11:23PM - 11:59PM)");
assertEquals(tasks.get(0).getDescription(),"[X] [Event] submit (at: 27 Sep 2020 11:23PM - 11:59PM)");
}
}

0 comments on commit 9923add

Please sign in to comment.