From f1973a58d54010d9c01edfab3e8a1c647fd08644 Mon Sep 17 00:00:00 2001 From: KrashKart Date: Sun, 20 Oct 2024 16:59:21 +0800 Subject: [PATCH] Add unit test for EmptyDataUtil --- .../seedu/address/model/util/SampleDataUtil.java | 8 +++++--- .../logic/commands/FindByPhoneCommandTest.java | 2 -- .../seedu/address/model/util/EmptyDataUtilTest.java | 12 ++++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 src/test/java/seedu/address/model/util/EmptyDataUtilTest.java diff --git a/src/main/java/seedu/address/model/util/SampleDataUtil.java b/src/main/java/seedu/address/model/util/SampleDataUtil.java index 15429433097..5840229f49b 100644 --- a/src/main/java/seedu/address/model/util/SampleDataUtil.java +++ b/src/main/java/seedu/address/model/util/SampleDataUtil.java @@ -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; @@ -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. diff --git a/src/test/java/seedu/address/logic/commands/FindByPhoneCommandTest.java b/src/test/java/seedu/address/logic/commands/FindByPhoneCommandTest.java index 1b99f23006d..e52f5eb4095 100644 --- a/src/test/java/seedu/address/logic/commands/FindByPhoneCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/FindByPhoneCommandTest.java @@ -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()); } diff --git a/src/test/java/seedu/address/model/util/EmptyDataUtilTest.java b/src/test/java/seedu/address/model/util/EmptyDataUtilTest.java new file mode 100644 index 00000000000..2a0527d3f70 --- /dev/null +++ b/src/test/java/seedu/address/model/util/EmptyDataUtilTest.java @@ -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()); + } +}