-
Notifications
You must be signed in to change notification settings - Fork 129
Marcus Ikdal #120
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
base: main
Are you sure you want to change the base?
Marcus Ikdal #120
Conversation
| private ArrayList<Task> tasks = new ArrayList<>(); | ||
|
|
||
| ArrayList<Task> addTask(Task t) { | ||
| tasks.add(t); |
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 would check for duplicates before adding a task
|
|
||
| public Task(String name, int id) { | ||
| this.name = name; | ||
| this.id = id; |
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.
Generally., IDs shou;ld be autogenerated in a Model to ensure consistency
| if (t.getName().equals(taskName)) | ||
| return true; | ||
| } | ||
| return false; |
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.
Good work, but the requirement here was "I want to search for a task and receive a message that says it wasn't found
* if it doesn't exist."
| try { | ||
| TimeUnit.SECONDS.sleep(1); | ||
| } catch (Exception e) { | ||
| System.err.println(e); |
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.
A try-catch oir if-else block in a test is usually not a good idea and it means the test boundary is incorrect. You can just assert that when a task is created, a date and time is set.
No description provided.