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
implementation of more member functions #99
implementation of more member functions #99
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.
The three test methods: updateMemberPoints(), invalidMemberInOrder() and validMemberInOrder(), should assert some sort of expected output, otherwise the test would be redundant.
For updateMemberPoints() and validMemberInOrder() assert an expected output for them.
For invalidMemberInOrder(), if you don't want to use assertion can use something like:
@test(expected = IndexOutOfBoundsException.class)
instead of throwing an Exception
…e result becomes negative
src/seedu/addressbook/data/Rms.java
Outdated
* Checks if a member in the order is in the list of members | ||
* Returns the member if found, else create a new Member using the data from the member in the order | ||
*/ | ||
public Member findMemberInOrder(Member orderMember) { |
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.
Can you change the parameter type to ReadOnlyMember ?
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.
Better yet, you can create another overloading version that can except ReadOnlyMember instead
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.
Changing the parameter type to ReadOnlyMember can cover both Member and ReadOnlyMember inputs
src/seedu/addressbook/data/Rms.java
Outdated
Date date = orderMember.getDate(); | ||
|
||
for(Member member : allMembers) { | ||
if((name == member.getName()) && (points == member.getPoints()) && (date == member.getDate())) { |
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.
you can make use of the isSameStateAs() method from ReadOnlyMember.java
add command to remove member from the member list