-
Notifications
You must be signed in to change notification settings - Fork 166
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
[W5.7][T16-4]Rezky Arizaputra #427
base: master
Are you sure you want to change the base?
Conversation
Looks good. Just need to correct the wrong parts and update the IO tests (input.txt and expected.txt) |
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.
Good job! Some minor issues that I see are inconsistency in coding syle such as spaces after {
s or extra blank lines. It is also encouraged to update JUnit tests if you have not done so. Please close this PR after you have read my comments.
import org.junit.Before; | ||
import org.junit.Test; | ||
import seedu.addressbook.data.AddressBook; | ||
import seedu.addressbook.data.person.*; |
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.
Avoid using *
for imports. Because then the reader can explicitly see what was imported/used in this file. It is also better practice to import only things that you need instead of importing the entire library/module
|
||
public static final String MESSAGE_SORTED = "Address book is sorted"; | ||
@Override | ||
public CommandResult execute() { |
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 indentation for this method is inconsistent with the lines before it. Java unlike languages like Ruby or Python compiles fine with inconsistent indentation. But it is still important to have consistent proper indentation to make it easy for the user to read and mke your code neat in general
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import static org.junit.Assert.*; |
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.
There is no space between this import line and the public class SortCommandTest {
line but there is a line gap before this line. Just try to standardise line breaks :) Look at Addressbook-4 for inspiration.
assertEquals(expectedMessage, result.feedbackToUser); | ||
assertEquals(expectedAddressBook.getAllPersons(), actualAddressBook.getAllPersons()); | ||
} | ||
|
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 think might be good to not have so many blank lines at the end of the class. Also, assertCommandBehaviour
does not have a blank line before its closing brace while assertSortingSuccessful
does.
/** | ||
* Sorts all people in the list. | ||
*/ | ||
public void sort() {Collections.sort(internalList, new CompareName()); } |
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.
There is no space after {
but space before }
No description provided.