diff --git a/src/main/java/seedu/address/model/module/Module.java b/src/main/java/seedu/address/model/module/Module.java index 09281658529..acecc715f6a 100644 --- a/src/main/java/seedu/address/model/module/Module.java +++ b/src/main/java/seedu/address/model/module/Module.java @@ -1,11 +1,11 @@ package seedu.address.model.module; -import seedu.address.commons.util.ToStringBuilder; - import static seedu.address.commons.util.CollectionUtil.requireAllNonNull; import java.util.Set; +import seedu.address.commons.util.ToStringBuilder; + /** * Represents a Module in the system. * Guarantees: details are present and not null, field values are validated, immutable. diff --git a/src/main/java/seedu/address/model/moduleplan/ModulePlanSemesterList.java b/src/main/java/seedu/address/model/moduleplan/ModulePlanSemesterList.java index 9e605c852c6..42ed754ce0f 100644 --- a/src/main/java/seedu/address/model/moduleplan/ModulePlanSemesterList.java +++ b/src/main/java/seedu/address/model/moduleplan/ModulePlanSemesterList.java @@ -8,7 +8,6 @@ import javafx.collections.FXCollections; import javafx.collections.ObservableList; -import seedu.address.logic.parser.Parser; import seedu.address.model.module.Module; import seedu.address.model.module.ModuleCode; import seedu.address.model.module.exceptions.ModuleNotFoundException; diff --git a/src/test/java/seedu/address/logic/commands/AddCommandTest.java b/src/test/java/seedu/address/logic/commands/AddCommandTest.java index 6e983a99e3e..8bc2fa8f690 100644 --- a/src/test/java/seedu/address/logic/commands/AddCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/AddCommandTest.java @@ -10,7 +10,6 @@ import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; -import java.util.function.Predicate; import org.junit.jupiter.api.Test; @@ -18,9 +17,7 @@ import seedu.address.commons.core.GuiSettings; import seedu.address.logic.Messages; import seedu.address.logic.commands.exceptions.CommandException; -import seedu.address.model.AddressBook; import seedu.address.model.Model; -import seedu.address.model.ReadOnlyAddressBook; import seedu.address.model.ReadOnlyUserPrefs; import seedu.address.model.module.Module; import seedu.address.model.module.ModuleCode; diff --git a/src/test/java/seedu/address/logic/commands/CommandTestUtil.java b/src/test/java/seedu/address/logic/commands/CommandTestUtil.java index 1f6f989ed0e..e0eaf9ba388 100644 --- a/src/test/java/seedu/address/logic/commands/CommandTestUtil.java +++ b/src/test/java/seedu/address/logic/commands/CommandTestUtil.java @@ -1,30 +1,18 @@ package seedu.address.logic.commands; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS; -import static seedu.address.logic.parser.CliSyntax.PREFIX_CODE; -import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; import static seedu.address.logic.parser.CliSyntax.PREFIX_GRADE; -import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; -import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; import static seedu.address.logic.parser.CliSyntax.PREFIX_SEMESTER; -import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG; import static seedu.address.logic.parser.CliSyntax.PREFIX_YEAR; import static seedu.address.testutil.Assert.assertThrows; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -import seedu.address.commons.core.index.Index; import seedu.address.logic.commands.exceptions.CommandException; -import seedu.address.model.AddressBook; import seedu.address.model.Model; import seedu.address.model.moduleplan.ModulePlan; import seedu.address.model.moduleplan.ModulePlanSemester; -import seedu.address.model.person.NameContainsKeywordsPredicate; -import seedu.address.model.person.Person; import seedu.address.testutil.EditModuleDescriptorBuilder; /** diff --git a/src/test/java/seedu/address/logic/commands/EditCommandTest.java b/src/test/java/seedu/address/logic/commands/EditCommandTest.java index f69992678fd..4b035afb510 100644 --- a/src/test/java/seedu/address/logic/commands/EditCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/EditCommandTest.java @@ -38,7 +38,7 @@ public void execute_allFieldsSpecified_success() { ModuleCode moduleCode = new ModuleCode(VALID_CODE_CS2040S); Module module = model.findModuleUsingCode(moduleCode); - Module editedModule = new ModuleBuilder().build(); + Module editedModule = new ModuleBuilder().withCode(VALID_CODE_CS2040S).build(); EditModuleDescriptor descriptor = new EditModuleDescriptorBuilder(editedModule).build(); EditCommand editCommand = new EditCommand(moduleCode, descriptor); diff --git a/src/test/java/seedu/address/model/module/ModuleTest.java b/src/test/java/seedu/address/model/module/ModuleTest.java index a499b74bf28..e11bb398888 100644 --- a/src/test/java/seedu/address/model/module/ModuleTest.java +++ b/src/test/java/seedu/address/model/module/ModuleTest.java @@ -1,11 +1,7 @@ package seedu.address.model.module; -import org.junit.jupiter.api.Test; -import seedu.address.testutil.ModuleBuilder; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import static seedu.address.logic.commands.CommandTestUtil.VALID_CODE_CS2101; import static seedu.address.logic.commands.CommandTestUtil.VALID_GRADE_CS2040S; @@ -17,6 +13,9 @@ import static seedu.address.testutil.TypicalModules.CS2040S; import static seedu.address.testutil.TypicalModules.CS2101; +import org.junit.jupiter.api.Test; +import seedu.address.testutil.ModuleBuilder; + public class ModuleTest { @Test public void isSameModule() { @@ -39,8 +38,8 @@ public void isSameModule() { @Test public void equals() { // same values -> returns true - Module CS2040SCopy = new ModuleBuilder(CS2040S).build(); - assertTrue(CS2040S.equals(CS2040SCopy)); + Module cS2040SCopy = new ModuleBuilder(CS2040S).build(); + assertTrue(CS2040S.equals(cS2040SCopy)); // same object -> returns true assertTrue(CS2040S.equals(CS2040S)); diff --git a/src/test/java/seedu/address/model/moduleplan/ModulePlanTest.java b/src/test/java/seedu/address/model/moduleplan/ModulePlanTest.java index 9bca439e740..c98cf0b24a7 100644 --- a/src/test/java/seedu/address/model/moduleplan/ModulePlanTest.java +++ b/src/test/java/seedu/address/model/moduleplan/ModulePlanTest.java @@ -4,10 +4,8 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static seedu.address.testutil.Assert.assertThrows; -import static seedu.address.testutil.TypicalModules.GEA1000; import static seedu.address.testutil.TypicalModules.CS2040S; - - +import static seedu.address.testutil.TypicalModules.GEA1000; import java.util.Arrays; import java.util.Collection; @@ -21,11 +19,7 @@ import seedu.address.model.module.Module; import seedu.address.model.module.Semester; import seedu.address.model.module.Year; -import seedu.address.model.moduleplan.ModulePlan; -import seedu.address.model.moduleplan.ModulePlanSemester; -import seedu.address.model.moduleplan.ReadOnlyModulePlan; import seedu.address.model.moduleplan.exceptions.DuplicateSemesterException; - import seedu.address.testutil.ModuleBuilder; import seedu.address.testutil.TypicalModules; @@ -100,8 +94,8 @@ public void getModulePlanSemesterList_modifyList_throwsUnsupportedOperationExcep @Test public void toStringMethod() { -// String expected = AddressBook.class.getCanonicalName() + "{persons=" + addressBook.getPersonList() + "}"; -// assertEquals(expected, modulePlan.toString()); + // String expected = AddressBook.class.getCanonicalName() + "{persons=" + addressBook.getPersonList() + "}"; + // assertEquals(expected, modulePlan.toString()); } /**