Skip to content

Commit

Permalink
Refine execute_find_matchesIfAnyKeywordPresent()
Browse files Browse the repository at this point in the history
  • Loading branch information
damithc committed Sep 8, 2016
1 parent 3c31f3e commit 4bad62b
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 @@ -477,25 +477,16 @@ public void execute_find_matchesIfAnyKeywordPresent() 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 rAnDoM");
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 rAnDoM",
Command.getMessageForPersonListShownSummary(expectedList),
expectedAB,
true,
expectedList);
}

/**
Expand Down

0 comments on commit 4bad62b

Please sign in to comment.