-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add tests to Module and fix bugs of Lesson #301
Add tests to Module and fix bugs of Lesson #301
Conversation
Hi @simonteozw I think this PR is good to merge immediately but I just want you to take a look to see what I have done in this PR (mostly for the refactor of Lesson's messages, I wasn't aware that Lesson's messages structure were quite messy) |
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.
Looks good! Just 2 comments
@Override | ||
public boolean canAddModule() { | ||
return getFilteredModuleList().size() < NUM_MODULE_LIMIT; | ||
} | ||
|
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 feel that this function should also check if the module alr exists in trackit? Or maybe rename the function to hasEnoughSpace
to make it clearer
// | ||
// /** | ||
// * Updates {@code model}'s filtered list to show only the module at the given {@code targetIndex} in the | ||
// * {@code model}'s address book. | ||
// */ | ||
// public static void showModuleAtIndex(Model model, Index targetIndex) { | ||
// assertTrue(targetIndex.getZeroBased() < model.getFilteredModuleList().size()); | ||
// | ||
// Module module = model.getFilteredModuleList().get(targetIndex.getZeroBased()); | ||
// Predicate<Module> p = t -> t.getName().equals(module.getName()); | ||
// model.updateFilteredModuleList(p); | ||
// | ||
// assertEquals(1, model.getFilteredModuleList().size()); | ||
// } | ||
} |
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.
Why is this commented out?
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.
Ah this I copied from TaskTestUtil but realised it's not usable yet
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.
LGTM
No description provided.