-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ryanjansen] iP #219
base: master
Are you sure you want to change the base?
[ryanjansen] iP #219
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very impressed with your coding standards! Well done! The most that I have observed is just whitespaces that need to be added here and there! Other than that, no major violations! Keep up the good work! I'm sure that you will be a good programmer in the tP if you keep this coding standard up! :) Jiayous for the rest of CS2103!
private ArrayList<Task> tasks; | ||
|
||
public TaskList() { | ||
this.tasks = new ArrayList<>(100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh? Is there a need to specify the capacity to 100? Why not use the default capacity, which is
this.tasks = new ArrayList<>();
package duke.command; | ||
import duke.TaskList; | ||
import duke.Ui; | ||
import duke.Storage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to put a whitespace like so :)
package duke.command;
import duke.TaskList;
import duke.Ui;
import duke.Storage;
import duke.task.Task; | ||
public class DeleteCommand extends Command { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to add a whitespace here! :)
} | ||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespace here too!
import java.time.LocalDate; | ||
public class EventCommand extends Command { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespace here too! :)
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 spaces here!
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 spaces here! should be 1!
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
public class ExitCommandTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import static org.junit.jupiter.api.Assertions.assertEquals; | |
public class ExitCommandTest { | |
import static org.junit.jupiter.api.Assertions.assertEquals; | |
public class ExitCommandTest { |
Whitespace here too! :)
deadline finish ip /by 2359 | ||
event lecture /from now /to later | ||
list | ||
todo survive one more day | ||
mark 1 | ||
list | ||
mark 3 | ||
unmark 3 | ||
list | ||
bye |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to push test files! Can gitignore! :)
____________________________________________________________ | ||
Hello! I'm Duke | ||
What can I do for you? | ||
____________________________________________________________ | ||
____________________________________________________________ | ||
Got it. I've added this task: | ||
[D][ ] finish ip (by: 2359) | ||
Now you have 1 tasks in the list | ||
____________________________________________________________ | ||
____________________________________________________________ | ||
Got it. I've added this task: | ||
[E][ ] lecture (from: now to: later) | ||
Now you have 2 tasks in the list | ||
____________________________________________________________ | ||
____________________________________________________________ | ||
Here are the tasks in your list: | ||
1.[D][ ] finish ip (by: 2359) | ||
2.[E][ ] lecture (from: now to: later) | ||
____________________________________________________________ | ||
____________________________________________________________ | ||
Got it. I've added this task: | ||
[T][ ] survive one more day | ||
Now you have 3 tasks in the list | ||
____________________________________________________________ | ||
____________________________________________________________ | ||
Nice! I've marked this task as done: | ||
[D][X] finish ip (by: 2359) | ||
____________________________________________________________ | ||
____________________________________________________________ | ||
Here are the tasks in your list: | ||
1.[D][X] finish ip (by: 2359) | ||
2.[E][ ] lecture (from: now to: later) | ||
3.[T][ ] survive one more day | ||
____________________________________________________________ | ||
____________________________________________________________ | ||
Nice! I've marked this task as done: | ||
[T][X] survive one more day | ||
____________________________________________________________ | ||
____________________________________________________________ | ||
OK! I've marked this task as not done yet: | ||
[T][ ] survive one more day | ||
____________________________________________________________ | ||
____________________________________________________________ | ||
Here are the tasks in your list: | ||
1.[D][X] finish ip (by: 2359) | ||
2.[E][ ] lecture (from: now to: later) | ||
3.[T][ ] survive one more day | ||
____________________________________________________________ | ||
____________________________________________________________ | ||
Bye. Hope to see you again soon! | ||
____________________________________________________________ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to push test files! Can gitignore! :)
Refactored much of the code to make it more readable. Main changes were removing nested if statements, refactoring them into switch statements instead and removing unecessary string builder instances from the UI class.
Assert that the title of the new tasks added match the title passed to the respective method.
Added assertions
Duke
Duke is a simple, easy to use task manager for those who can't remember jack.
Features
How to add a task
Here's a demo of checking a task:
Here's an example of the code:
public class Main { public static void main(String[] args) { Application.launch(MainApp.class, args); } }