benjasm411 / NCTaskManager

0 stars 0 forks source link

P7 - Tasks Calendar #3

Open geramg opened 2 years ago

geramg commented 2 years ago

https://github.com/benjasm411/NCTaskManager/blob/8e0759394558b2bde664a7561c103fd9090446e5/src/main/java/mx/tc/j2se/tasks/Tasks.java#L72-L85

  1. Filter is already an iterator. You can use streams like foreach.
  2. You don't make any distinction between Repeated and Non Repeated tasks. If you have a non repeated how would it finish the while loop?
  3. You need to check whether the time is already on the calendar. Map already prevents you to have the same key repeated, but you are overriding the previous set with you new set containing only the current task.

Good test would be 1 non repeated task, 2 repeated task with different but overlapping intervals (like 1 day and 2 days, they will overlap every 2 days). You need to check on time you overlap you calendar contains all the tasks (set) for that day (key)

geramg commented 2 years ago

In you own test only Morning Run task shows up.