Skip to content

Commit

Permalink
Refine execute_tryToViewMissingPerson_errorMessage()
Browse files Browse the repository at this point in the history
  • Loading branch information
damithc committed Sep 8, 2016
1 parent 07f0f43 commit 7d5766c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions test/java/seedu/addressbook/logic/LogicTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -278,24 +278,23 @@ public void execute_view_onlyShowsNonPrivate() throws Exception {
}

@Test
public void execute_view_missingInAddressBook() throws Exception {
public void execute_tryToViewMissingPerson_errorMessage() throws Exception {
TestDataHelper helper = new TestDataHelper();
Person p1 = helper.generatePerson(1, false);
Person p2 = helper.generatePerson(2, false);
List<Person> lastShownList = new ArrayList<>();
lastShownList.add(p1);
lastShownList.add(p2);
List<Person> lastShownList = helper.generatePersonList(p1, p2);

AddressBook expectedAB = new AddressBook();
expectedAB.addPerson(p2);

addressBook.addPerson(p2);
logic.setLastShownList(lastShownList);
CommandResult r = logic.execute("view 1");

assertEquals(Messages.MESSAGE_PERSON_NOT_IN_ADDRESSBOOK, r.feedbackToUser);
assertFalse(r.getRelevantPersons().isPresent());
assertLogicObjectStateEquals(expectedAB, lastShownList);
assertNonMutatingCommandBehavior("view 1",
Messages.MESSAGE_PERSON_NOT_IN_ADDRESSBOOK,
expectedAB,
false,
lastShownList);
}

@Test
Expand Down

0 comments on commit 7d5766c

Please sign in to comment.