Skip to content

Commit

Permalink
Add unit test for EmptyDataUtil
Browse files Browse the repository at this point in the history
  • Loading branch information
KrashKart committed Oct 20, 2024
1 parent ae17297 commit f1973a5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/main/java/seedu/address/model/util/SampleDataUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import java.util.Set;
import java.util.stream.Collectors;

import seedu.address.model.CampusConnect;
import seedu.address.model.ReadOnlyCampusConnect;
//import seedu.address.model.CampusConnect;
//import seedu.address.model.ReadOnlyCampusConnect;
import seedu.address.model.person.Email;
import seedu.address.model.person.Name;
import seedu.address.model.person.Person;
Expand Down Expand Up @@ -33,13 +33,15 @@ public static Person[] getSamplePersons() {
};
}

// Schedule for deletion
/*
public static ReadOnlyCampusConnect getSampleCampusConnect() {
CampusConnect sampleAb = new CampusConnect();
for (Person samplePerson : getSamplePersons()) {
sampleAb.addPerson(samplePerson);
}
return sampleAb;
}
}*/

/**
* Returns a tag set containing the list of strings given.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ public void execute_multipleKeywords_multiplePersonsFound() {
PhoneContainsKeywordsPredicate predicate = preparePredicate("9482 563");
FindByPhoneCommand command = new FindByPhoneCommand(predicate);
expectedModel.updateFilteredPersonList(predicate);
System.out.println(command);
System.out.println(expectedModel.getFilteredPersonList().toString());
assertCommandSuccess(command, model, expectedMessage, expectedModel);
assertEquals(Arrays.asList(CARL, ELLE, FIONA, GEORGE), model.getFilteredPersonList());
}
Expand Down
12 changes: 12 additions & 0 deletions src/test/java/seedu/address/model/util/EmptyDataUtilTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package seedu.address.model.util;

import static org.junit.jupiter.api.Assertions.assertTrue;

import org.junit.jupiter.api.Test;

public class EmptyDataUtilTest {
@Test
public void getSampleCampusConnect_returnsEmptyCampusConnect() {
assertTrue(EmptyDataUtil.getSampleCampusConnect().getPersonList().isEmpty());
}
}

0 comments on commit f1973a5

Please sign in to comment.