Skip to content

Conversation

@Marcus0410
Copy link

No description provided.

private ArrayList<Task> tasks = new ArrayList<>();

ArrayList<Task> addTask(Task t) {
tasks.add(t);

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;

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;

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);

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants