Skip to content
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

Merged
merged 13 commits into from Oct 25, 2018

Conversation

kangmingtay
Copy link
Collaborator

add command to remove member from the member list

@kangmingtay kangmingtay added status.ongoing The issue is currently being worked on. note: remove this label before closing an issue. priority.medium Nice to have labels Oct 23, 2018
@kangmingtay kangmingtay added this to the v1.4 milestone Oct 23, 2018
Copy link
Collaborator

@kianhong95 kianhong95 left a 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

@kangmingtay kangmingtay added status.review-pending The pull request is ready to be reviewed. and removed status.ongoing The issue is currently being worked on. note: remove this label before closing an issue. labels Oct 25, 2018
@kangmingtay kangmingtay modified the milestones: v1.4, v1.3 Oct 25, 2018
* 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) {
Copy link
Collaborator

@px1099 px1099 Oct 25, 2018

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 ?

Copy link
Collaborator

@px1099 px1099 Oct 25, 2018

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

Copy link
Collaborator

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

Date date = orderMember.getDate();

for(Member member : allMembers) {
if((name == member.getName()) && (points == member.getPoints()) && (date == member.getDate())) {
Copy link
Collaborator

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

@px1099 px1099 added status.completed The pull request has been reviewed. and removed status.review-pending The pull request is ready to be reviewed. labels Oct 25, 2018
@px1099 px1099 merged commit f19b357 into CS2113-AY1819S1-F09-2:master Oct 25, 2018
@kangmingtay kangmingtay deleted the more-member-functions branch November 10, 2018 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority.medium Nice to have status.completed The pull request has been reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants