Skip to content

Commit

Permalink
Fix testcases for deleting customer
Browse files Browse the repository at this point in the history
  • Loading branch information
nigel27022001 committed Apr 13, 2024
1 parent 59620de commit d42dff3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import static seedu.address.logic.commands.CommandTestUtil.showPersonAtIndex;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_PERSON;
import static seedu.address.testutil.TypicalIndexes.INDEX_SECOND_PERSON;
import static seedu.address.testutil.TypicalPersons.getTypicalAddressBook;
import static seedu.address.testutil.TypicalPersons.getTypicalAddressBookWithPersonsOnly;

import org.junit.jupiter.api.Test;

Expand All @@ -25,7 +25,7 @@
*/
public class DeleteCustomerCommandTest {

private Model model = new ModelManager(getTypicalAddressBook(), new UserPrefs());
private Model model = new ModelManager(getTypicalAddressBookWithPersonsOnly(), new UserPrefs());

@Test
public void execute_validIndexUnfilteredList_success() {
Expand Down
11 changes: 11 additions & 0 deletions src/test/java/seedu/address/testutil/TypicalPersons.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@ public static AddressBook getTypicalAddressBook() {
return ab;
}

public static AddressBook getTypicalAddressBookWithPersonsOnly() {
AddressBook ab = new AddressBook();
ArrayList<Person> typicalPersons = new ArrayList<>();
for (Person person : getTypicalPersons()) {
Person copy = new PersonBuilder(person).build();
ab.addPerson(copy);
typicalPersons.add(copy);
}
return ab;
}

public static List<Person> getTypicalPersons() {
return new ArrayList<>(Arrays.asList(ALICE, BENSON, CARL, DANIEL, ELLE, FIONA, GEORGE));
}
Expand Down

0 comments on commit d42dff3

Please sign in to comment.