forked from AY2425S1-CS2103T-F15-2/tp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request AY2425S1-CS2103T-F15-2#152 from ethan-goh/fix-alph…
…a-bugs Fix Alpha Bugs
- Loading branch information
Showing
14 changed files
with
199 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,19 +175,6 @@ public void execute_someFieldsSpecifiedUnfilteredList_success() { | |
assertCommandSuccess(editCommand, model, expectedMessage, expectedModel); | ||
} | ||
|
||
@Test | ||
public void execute_noFieldSpecifiedUnfilteredList_success() { | ||
StudentId studentId = model.getFilteredPersonList().get(0).getStudentId(); | ||
EditCommand editCommand = new EditCommand(studentId, new EditPersonDescriptor()); | ||
Person editedPerson = model.getFilteredPersonList().get(INDEX_FIRST_PERSON.getZeroBased()); | ||
|
||
String expectedMessage = String.format(EditCommand.MESSAGE_EDIT_PERSON_SUCCESS, Messages.format(editedPerson)); | ||
|
||
Model expectedModel = new ModelManager(new EduContacts(model.getEduContacts()), new UserPrefs(), editedPerson); | ||
|
||
assertCommandSuccess(editCommand, model, expectedMessage, expectedModel); | ||
} | ||
|
||
@Test | ||
public void execute_filteredList_success() { | ||
showPersonAtIndex(model, INDEX_FIRST_PERSON); | ||
|
@@ -231,6 +218,35 @@ public void execute_invalidPersonIndexFilteredList_failure() { | |
assertCommandFailure(editCommand, model, Messages.MESSAGE_INVALID_PERSON_DISPLAYED_STUDENTID); | ||
} | ||
|
||
@Test | ||
public void execute_personDisplayedEdited_success() throws CommandException { | ||
|
||
Person personToDisplay = model.getFilteredPersonList().get(INDEX_FIRST_PERSON.getZeroBased()); | ||
model.setPersonToDisplay(personToDisplay); | ||
|
||
EditPersonDescriptor descriptor = new EditPersonDescriptorBuilder() | ||
.withName("Edited Name") | ||
.withPhone("98765432") | ||
.withEmail("[email protected]") | ||
.build(); | ||
|
||
EditCommand editCommand = new EditCommand(personToDisplay.getStudentId(), descriptor); | ||
|
||
Person editedPerson = new PersonBuilder(personToDisplay) | ||
.withName("Edited Name") | ||
.withPhone("98765432") | ||
.withEmail("[email protected]") | ||
.build(); | ||
|
||
String expectedMessage = String.format(EditCommand.MESSAGE_EDIT_PERSON_SUCCESS, Messages.format(editedPerson)); | ||
|
||
Model expectedModel = new ModelManager(model.getEduContacts(), new UserPrefs()); | ||
expectedModel.setPerson(personToDisplay, editedPerson); | ||
expectedModel.setPersonToDisplay(editedPerson); | ||
|
||
assertCommandSuccess(editCommand, model, expectedMessage, expectedModel); | ||
} | ||
|
||
@Test | ||
public void equals() { | ||
StudentId firstPersonId = model.getFilteredPersonList().get(0).getStudentId(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.