Skip to content

Commit

Permalink
Refine execute_find_isCaseSensitive()
Browse files Browse the repository at this point in the history
  • Loading branch information
damithc committed Sep 8, 2016
1 parent f2edf7f commit 3c31f3e
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions test/java/seedu/addressbook/logic/LogicTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -457,25 +457,16 @@ public void execute_find_isCaseSensitive() throws Exception {
Person p1 = helper.generatePersonWithName("key key");
Person p2 = helper.generatePersonWithName("KEy sduauo");

AddressBook expectedAB = new AddressBook();
expectedAB.addPerson(p1);
expectedAB.addPerson(pTarget1);
expectedAB.addPerson(p2);
expectedAB.addPerson(pTarget2);

List<Person> expectedList = new ArrayList<>();
expectedList.addAll(Arrays.asList(pTarget1, pTarget2));

addressBook.addPerson(p1);
addressBook.addPerson(pTarget1);
addressBook.addPerson(p2);
addressBook.addPerson(pTarget2);
CommandResult r = logic.execute("find KEY");
List<Person> fourPersons = helper.generatePersonList(p1, pTarget1, p2, pTarget2);
AddressBook expectedAB = helper.generateAddressBook(fourPersons);
List<Person> expectedList = helper.generatePersonList(pTarget1, pTarget2);
helper.addToAddressBook(addressBook, fourPersons);

assertEquals(Command.getMessageForPersonListShownSummary(expectedList), r.feedbackToUser);
assertTrue(r.getRelevantPersons().isPresent());
assertEquals(expectedList, r.getRelevantPersons().get());
assertLogicObjectStateEquals(expectedAB, expectedList);
assertNonMutatingCommandBehavior("find KEY",
Command.getMessageForPersonListShownSummary(expectedList),
expectedAB,
true,
expectedList);
}

@Test
Expand Down

0 comments on commit 3c31f3e

Please sign in to comment.