diff --git a/src/main/java/seedu/address/MainApp.java b/src/main/java/seedu/address/MainApp.java index dbda0a3f2ea..050a9dbc03d 100644 --- a/src/main/java/seedu/address/MainApp.java +++ b/src/main/java/seedu/address/MainApp.java @@ -15,10 +15,8 @@ import seedu.address.commons.util.StringUtil; import seedu.address.logic.Logic; import seedu.address.logic.LogicManager; -import seedu.address.model.AddressBook; import seedu.address.model.Model; import seedu.address.model.ModelManager; -import seedu.address.model.ReadOnlyAddressBook; import seedu.address.model.ReadOnlyUserPrefs; import seedu.address.model.UserPrefs; import seedu.address.model.moduleplan.ReadOnlyModulePlan; @@ -76,20 +74,22 @@ public void init() throws Exception { private Model initModelManager(Storage storage, ReadOnlyUserPrefs userPrefs) { logger.info("Using data file : " + storage.getAddressBookFilePath()); -// Optional addressBookOptional; -// ReadOnlyAddressBook initialData; -// try { -// addressBookOptional = storage.readAddressBook(); -// if (!addressBookOptional.isPresent()) { -// logger.info("Creating a new data file " + storage.getAddressBookFilePath() -// + " populated with a sample AddressBook."); -// } -// initialData = addressBookOptional.orElseGet(SampleDataUtil::getSampleAddressBook); -// } catch (DataLoadingException e) { -// logger.warning("Data file at " + storage.getAddressBookFilePath() + " could not be loaded." -// + " Will be starting with an empty AddressBook."); -// initialData = new AddressBook(); -// } + /* + Optional addressBookOptional; + ReadOnlyAddressBook initialData; + try { + addressBookOptional = storage.readAddressBook(); + if (!addressBookOptional.isPresent()) { + logger.info("Creating a new data file " + storage.getAddressBookFilePath() + + " populated with a sample AddressBook."); + } + initialData = addressBookOptional.orElseGet(SampleDataUtil::getSampleAddressBook); + } catch (DataLoadingException e) { + logger.warning("Data file at " + storage.getAddressBookFilePath() + " could not be loaded." + + " Will be starting with an empty AddressBook."); + initialData = new AddressBook(); + } + */ //TODO implement loading from storage for ModulePlan. ReadOnlyModulePlan initialData = SampleDataUtil.getSampleModulePlan(); diff --git a/src/main/java/seedu/address/logic/Logic.java b/src/main/java/seedu/address/logic/Logic.java index 66790ce3080..5d2f6cb55a7 100644 --- a/src/main/java/seedu/address/logic/Logic.java +++ b/src/main/java/seedu/address/logic/Logic.java @@ -7,8 +7,6 @@ import seedu.address.logic.commands.CommandResult; import seedu.address.logic.commands.exceptions.CommandException; import seedu.address.logic.parser.exceptions.ParseException; -import seedu.address.model.ReadOnlyAddressBook; -import seedu.address.model.module.Module; import seedu.address.model.moduleplan.ModulePlanSemester; import seedu.address.model.moduleplan.ReadOnlyModulePlan; diff --git a/src/main/java/seedu/address/logic/LogicManager.java b/src/main/java/seedu/address/logic/LogicManager.java index 50e80b85fba..0e918aaa12d 100644 --- a/src/main/java/seedu/address/logic/LogicManager.java +++ b/src/main/java/seedu/address/logic/LogicManager.java @@ -1,7 +1,5 @@ package seedu.address.logic; -import java.io.IOException; -import java.nio.file.AccessDeniedException; import java.nio.file.Path; import java.util.logging.Logger; @@ -11,12 +9,9 @@ import seedu.address.logic.commands.Command; import seedu.address.logic.commands.CommandResult; import seedu.address.logic.commands.exceptions.CommandException; -import seedu.address.logic.parser.AddressBookParser; import seedu.address.logic.parser.ModulePlanParser; import seedu.address.logic.parser.exceptions.ParseException; import seedu.address.model.Model; -import seedu.address.model.ReadOnlyAddressBook; -import seedu.address.model.module.Module; import seedu.address.model.moduleplan.ModulePlanSemester; import seedu.address.model.moduleplan.ReadOnlyModulePlan; import seedu.address.storage.Storage; @@ -55,13 +50,15 @@ public CommandResult execute(String commandText) throws CommandException, ParseE //TODO implement save to storage for ModulePlan -// try { -// storage.saveAddressBook(model.getAddressBook()); -// } catch (AccessDeniedException e) { -// throw new CommandException(String.format(FILE_OPS_PERMISSION_ERROR_FORMAT, e.getMessage()), e); -// } catch (IOException ioe) { -// throw new CommandException(String.format(FILE_OPS_ERROR_FORMAT, ioe.getMessage()), ioe); -// } + /* + try { + storage.saveAddressBook(model.getAddressBook()); + } catch (AccessDeniedException e) { + throw new CommandException(String.format(FILE_OPS_PERMISSION_ERROR_FORMAT, e.getMessage()), e); + } catch (IOException ioe) { + throw new CommandException(String.format(FILE_OPS_ERROR_FORMAT, ioe.getMessage()), ioe); + } + */ return commandResult; } diff --git a/src/main/java/seedu/address/logic/commands/AddCommand.java b/src/main/java/seedu/address/logic/commands/AddCommand.java index 13e4a6dfad6..38100e5b5bf 100644 --- a/src/main/java/seedu/address/logic/commands/AddCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddCommand.java @@ -1,7 +1,10 @@ package seedu.address.logic.commands; import static java.util.Objects.requireNonNull; -import static seedu.address.logic.parser.CliSyntax.*; +import static seedu.address.logic.parser.CliSyntax.PREFIX_CODE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_GRADE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_SEMESTER; +import static seedu.address.logic.parser.CliSyntax.PREFIX_YEAR; import seedu.address.commons.util.ToStringBuilder; import seedu.address.logic.Messages; diff --git a/src/main/java/seedu/address/logic/commands/CalculateCAPCommand.java b/src/main/java/seedu/address/logic/commands/CalculateCapCommand.java similarity index 66% rename from src/main/java/seedu/address/logic/commands/CalculateCAPCommand.java rename to src/main/java/seedu/address/logic/commands/CalculateCapCommand.java index 9958981ba01..8dbf6a758a6 100644 --- a/src/main/java/seedu/address/logic/commands/CalculateCAPCommand.java +++ b/src/main/java/seedu/address/logic/commands/CalculateCapCommand.java @@ -6,9 +6,9 @@ import seedu.address.model.Model; /** - * Deletes a person identified using it's displayed index from the address book. + * Calculates the user's CAP from each module's grade. */ -public class CalculateCAPCommand extends Command { +public class CalculateCapCommand extends Command { public static final String COMMAND_WORD = "calculateCAP"; public static final String MESSAGE_CALCULATION_SUCCESS = "Calculated value: %1$s"; @@ -19,10 +19,10 @@ public CommandResult execute(Model model) throws CommandException { int modularCredits = model.totalModularCredits(); - Float gradePointsByUnits = model.totalGradePointsByUnits(); + Float gradePointsByUnits = model.totalGradePointsByUnits(); - Float calculatedCAPValue = gradePointsByUnits / modularCredits; + Float calculatedCapValue = gradePointsByUnits / modularCredits; - return new CommandResult(String.format(MESSAGE_CALCULATION_SUCCESS, calculatedCAPValue)); + return new CommandResult(String.format(MESSAGE_CALCULATION_SUCCESS, calculatedCapValue)); } -} \ No newline at end of file +} diff --git a/src/main/java/seedu/address/logic/commands/CalculateMCCommand.java b/src/main/java/seedu/address/logic/commands/CalculateMcCommand.java similarity index 82% rename from src/main/java/seedu/address/logic/commands/CalculateMCCommand.java rename to src/main/java/seedu/address/logic/commands/CalculateMcCommand.java index f924fdb21c4..95052119e50 100644 --- a/src/main/java/seedu/address/logic/commands/CalculateMCCommand.java +++ b/src/main/java/seedu/address/logic/commands/CalculateMcCommand.java @@ -5,7 +5,11 @@ import seedu.address.logic.commands.exceptions.CommandException; import seedu.address.model.Model; -public class CalculateMCCommand extends Command { +/** + * Calculates the user's total modular credits from their modules taken. + */ +public class CalculateMcCommand extends Command { + public static final String COMMAND_WORD = "calculateMC"; public static final String MESSAGE_CALCULATION_SUCCESS = "Calculated value: %1$s"; diff --git a/src/main/java/seedu/address/logic/commands/ClearCommand.java b/src/main/java/seedu/address/logic/commands/ClearCommand.java index 5df3046172d..b8ab94a084b 100644 --- a/src/main/java/seedu/address/logic/commands/ClearCommand.java +++ b/src/main/java/seedu/address/logic/commands/ClearCommand.java @@ -2,9 +2,7 @@ import static java.util.Objects.requireNonNull; -import seedu.address.model.AddressBook; import seedu.address.model.Model; -import seedu.address.model.module.Module; import seedu.address.model.moduleplan.ModulePlan; /** diff --git a/src/main/java/seedu/address/logic/commands/EditCommand.java b/src/main/java/seedu/address/logic/commands/EditCommand.java index c22ab271dc3..e46789df1cd 100644 --- a/src/main/java/seedu/address/logic/commands/EditCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditCommand.java @@ -5,14 +5,9 @@ import static seedu.address.logic.parser.CliSyntax.PREFIX_GRADE; import static seedu.address.logic.parser.CliSyntax.PREFIX_SEMESTER; import static seedu.address.logic.parser.CliSyntax.PREFIX_YEAR; -import static seedu.address.model.Model.PREDICATE_SHOW_ALL_MODULES; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; import java.util.Objects; import java.util.Optional; -import java.util.Set; import seedu.address.commons.util.CollectionUtil; import seedu.address.commons.util.ToStringBuilder; @@ -20,11 +15,10 @@ import seedu.address.logic.commands.exceptions.CommandException; import seedu.address.model.Model; import seedu.address.model.module.Grade; +import seedu.address.model.module.Module; import seedu.address.model.module.ModuleCode; import seedu.address.model.module.Semester; import seedu.address.model.module.Year; -import seedu.address.model.module.Module; -import seedu.address.model.module.exceptions.ModuleNotFoundException; /** * Edits the details of an existing person in the address book. diff --git a/src/main/java/seedu/address/logic/commands/FindCommand.java b/src/main/java/seedu/address/logic/commands/FindCommand.java index 5161bc69e1d..7040b9e1ee9 100644 --- a/src/main/java/seedu/address/logic/commands/FindCommand.java +++ b/src/main/java/seedu/address/logic/commands/FindCommand.java @@ -1,9 +1,6 @@ package seedu.address.logic.commands; -import static java.util.Objects.requireNonNull; - import seedu.address.commons.util.ToStringBuilder; -import seedu.address.logic.Messages; import seedu.address.logic.commands.exceptions.CommandException; import seedu.address.model.Model; import seedu.address.model.module.NameContainsKeywordsPredicate; diff --git a/src/main/java/seedu/address/logic/commands/InfoCommand.java b/src/main/java/seedu/address/logic/commands/InfoCommand.java new file mode 100644 index 00000000000..2484af15524 --- /dev/null +++ b/src/main/java/seedu/address/logic/commands/InfoCommand.java @@ -0,0 +1,70 @@ +package seedu.address.logic.commands; + +import static java.util.Objects.requireNonNull; + +import seedu.address.commons.util.ToStringBuilder; +import seedu.address.logic.commands.exceptions.CommandException; +import seedu.address.model.Model; +import seedu.address.model.module.ModuleCode; + +/** + * Displays information of a module identified using it's module code. + */ +public class InfoCommand extends Command { + + public static final String COMMAND_WORD = "info"; + + public static final String MESSAGE_USAGE = COMMAND_WORD + + ": Shows information on the module identified by the module code. " + + "Example: " + COMMAND_WORD + " " + "CS1101S "; + public static final String MESSAGE_INFO_MODULE_SUCCESS = "%1$s: %2$s \n" + + "%3$s \n" + + "%4$s \n"; + public static final String MESSAGE_INFO_MODULE_SUCCESS_SAMPLE = "CS1101S : Programming Methodology \n" + + "4MCs \n" + + "This course introduces the concepts of programming and computational problem solving. " + + "Starting from a small core of fundamental abstractions, the course introduces" + + " programming as a method for communicating computational processes. \n"; + + public static final String MESSAGE_NOT_FOUND_MODULE = "This module is not found."; + + private final ModuleCode moduleCode; + + /** + * @param moduleCode of the module to be shown + */ + public InfoCommand(ModuleCode moduleCode) { + this.moduleCode = moduleCode; + } + + @Override + public CommandResult execute(Model model) throws CommandException { + requireNonNull(model); + + // TODO: Call a method in model to get the module information + + return new CommandResult(MESSAGE_INFO_MODULE_SUCCESS_SAMPLE); + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + + // instanceof handles nulls + if (!(other instanceof InfoCommand)) { + return false; + } + + InfoCommand otherInfoCommand = (InfoCommand) other; + return moduleCode.equals(otherInfoCommand.moduleCode); + } + + @Override + public String toString() { + return new ToStringBuilder(this) + .add("moduleCode", moduleCode) + .toString(); + } +} diff --git a/src/main/java/seedu/address/logic/commands/ListCommand.java b/src/main/java/seedu/address/logic/commands/ListCommand.java index 99c2ac51ca2..6223c3e1543 100644 --- a/src/main/java/seedu/address/logic/commands/ListCommand.java +++ b/src/main/java/seedu/address/logic/commands/ListCommand.java @@ -1,7 +1,6 @@ package seedu.address.logic.commands; import static java.util.Objects.requireNonNull; -import static seedu.address.model.Model.PREDICATE_SHOW_ALL_MODULES; import seedu.address.logic.commands.exceptions.CommandException; import seedu.address.model.Model; diff --git a/src/main/java/seedu/address/logic/parser/AddCommandParser.java b/src/main/java/seedu/address/logic/parser/AddCommandParser.java index dce620ece81..cba7e103d6a 100644 --- a/src/main/java/seedu/address/logic/parser/AddCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/AddCommandParser.java @@ -1,18 +1,20 @@ package seedu.address.logic.parser; import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT; -import static seedu.address.logic.parser.CliSyntax.*; - +import static seedu.address.logic.parser.CliSyntax.PREFIX_CODE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_GRADE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_SEMESTER; +import static seedu.address.logic.parser.CliSyntax.PREFIX_YEAR; import java.util.stream.Stream; import seedu.address.logic.commands.AddCommand; import seedu.address.logic.parser.exceptions.ParseException; import seedu.address.model.module.Grade; +import seedu.address.model.module.Module; import seedu.address.model.module.ModuleCode; import seedu.address.model.module.Semester; import seedu.address.model.module.Year; -import seedu.address.model.module.Module; /** * Parses input arguments and creates a new AddCommand object diff --git a/src/main/java/seedu/address/logic/parser/AddressBookParser.java b/src/main/java/seedu/address/logic/parser/AddressBookParser.java index d64f763898e..06f66c32221 100644 --- a/src/main/java/seedu/address/logic/parser/AddressBookParser.java +++ b/src/main/java/seedu/address/logic/parser/AddressBookParser.java @@ -9,8 +9,8 @@ import seedu.address.commons.core.LogsCenter; import seedu.address.logic.commands.AddCommand; -import seedu.address.logic.commands.CalculateCAPCommand; -import seedu.address.logic.commands.CalculateMCCommand; +import seedu.address.logic.commands.CalculateCapCommand; +import seedu.address.logic.commands.CalculateMcCommand; import seedu.address.logic.commands.ClearCommand; import seedu.address.logic.commands.Command; import seedu.address.logic.commands.DeleteCommand; @@ -18,6 +18,7 @@ import seedu.address.logic.commands.ExitCommand; import seedu.address.logic.commands.FindCommand; import seedu.address.logic.commands.HelpCommand; +import seedu.address.logic.commands.InfoCommand; import seedu.address.logic.commands.ListCommand; import seedu.address.logic.parser.exceptions.ParseException; @@ -64,6 +65,9 @@ public Command parseCommand(String userInput) throws ParseException { case DeleteCommand.COMMAND_WORD: return new DeleteCommandParser().parse(arguments); + case InfoCommand.COMMAND_WORD: + return new InfoCommandParser().parse(arguments); + case ClearCommand.COMMAND_WORD: return new ClearCommand(); @@ -79,11 +83,11 @@ public Command parseCommand(String userInput) throws ParseException { case HelpCommand.COMMAND_WORD: return new HelpCommand(); - case CalculateCAPCommand.COMMAND_WORD: - return new CalculateCAPCommand(); + case CalculateCapCommand.COMMAND_WORD: + return new CalculateCapCommand(); - case CalculateMCCommand.COMMAND_WORD: - return new CalculateMCCommand(); + case CalculateMcCommand.COMMAND_WORD: + return new CalculateMcCommand(); default: diff --git a/src/main/java/seedu/address/logic/parser/EditCommandParser.java b/src/main/java/seedu/address/logic/parser/EditCommandParser.java index 391b80c0415..69750b07870 100644 --- a/src/main/java/seedu/address/logic/parser/EditCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/EditCommandParser.java @@ -7,11 +7,6 @@ import static seedu.address.logic.parser.CliSyntax.PREFIX_SEMESTER; import static seedu.address.logic.parser.CliSyntax.PREFIX_YEAR; -import java.util.Collection; -import java.util.Collections; -import java.util.Optional; -import java.util.Set; - import seedu.address.logic.commands.EditCommand; import seedu.address.logic.commands.EditCommand.EditModuleDescriptor; import seedu.address.logic.parser.exceptions.ParseException; @@ -41,8 +36,7 @@ public EditCommand parse(String args) throws ParseException { if (argMultimap.getValue(PREFIX_CODE).isPresent()) { moduleCode = ParserUtil.parseModuleCode(argMultimap.getValue(PREFIX_CODE).get()); - } - else { + } else { throw new ParseException( String.format(MESSAGE_INVALID_COMMAND_FORMAT, EditCommand.MESSAGE_USAGE), new ParseException(MESSAGE_INVALID_MODULE_CODE)); diff --git a/src/main/java/seedu/address/logic/parser/InfoCommandParser.java b/src/main/java/seedu/address/logic/parser/InfoCommandParser.java new file mode 100644 index 00000000000..0ea6fccfaf3 --- /dev/null +++ b/src/main/java/seedu/address/logic/parser/InfoCommandParser.java @@ -0,0 +1,37 @@ +package seedu.address.logic.parser; + +import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import seedu.address.logic.commands.InfoCommand; +import seedu.address.logic.parser.exceptions.ParseException; +import seedu.address.model.module.ModuleCode; + +/** + * Parses input arguments and creates a new InfoCommmand object + */ +public class InfoCommandParser implements Parser { + + // Probably should be defined elsewhere + // Pattern to check for single argument (no spaces) + private static final Pattern SINGLE_ARGUMENT_FORMAT = Pattern.compile("^[\\w/]+$"); + + /** + * Parses the given {@code String} of arguments in the context of the InfoCommand + * and returns a InfoCommand object for execution. + * @throws ParseException if the user input does not conform the expected format + */ + public InfoCommand parse(String args) throws ParseException { + + Matcher matcher = SINGLE_ARGUMENT_FORMAT.matcher(args.trim()); + if (!matcher.matches()) { + throw new ParseException( + String.format(MESSAGE_INVALID_COMMAND_FORMAT, InfoCommand.MESSAGE_USAGE)); + } + + ModuleCode moduleCode = ParserUtil.parseModuleCode(args); + return new InfoCommand(moduleCode); + } +} diff --git a/src/main/java/seedu/address/logic/parser/ModulePlanParser.java b/src/main/java/seedu/address/logic/parser/ModulePlanParser.java index 952d82453ba..42fe8ef44c8 100644 --- a/src/main/java/seedu/address/logic/parser/ModulePlanParser.java +++ b/src/main/java/seedu/address/logic/parser/ModulePlanParser.java @@ -9,8 +9,8 @@ import seedu.address.commons.core.LogsCenter; import seedu.address.logic.commands.AddCommand; -import seedu.address.logic.commands.CalculateCAPCommand; -import seedu.address.logic.commands.CalculateMCCommand; +import seedu.address.logic.commands.CalculateCapCommand; +import seedu.address.logic.commands.CalculateMcCommand; import seedu.address.logic.commands.ClearCommand; import seedu.address.logic.commands.Command; import seedu.address.logic.commands.DeleteCommand; @@ -18,6 +18,7 @@ import seedu.address.logic.commands.ExitCommand; import seedu.address.logic.commands.FindCommand; import seedu.address.logic.commands.HelpCommand; +import seedu.address.logic.commands.InfoCommand; import seedu.address.logic.commands.ListCommand; import seedu.address.logic.parser.exceptions.ParseException; @@ -55,40 +56,43 @@ public Command parseCommand(String userInput) throws ParseException { switch (commandWord) { - case AddCommand.COMMAND_WORD: - return new AddCommandParser().parse(arguments); + case AddCommand.COMMAND_WORD: + return new AddCommandParser().parse(arguments); - case EditCommand.COMMAND_WORD: - return new EditCommandParser().parse(arguments); + case EditCommand.COMMAND_WORD: + return new EditCommandParser().parse(arguments); - case DeleteCommand.COMMAND_WORD: - return new DeleteCommandParser().parse(arguments); + case DeleteCommand.COMMAND_WORD: + return new DeleteCommandParser().parse(arguments); - case ClearCommand.COMMAND_WORD: - return new ClearCommand(); + case InfoCommand.COMMAND_WORD: + return new InfoCommandParser().parse(arguments); - case FindCommand.COMMAND_WORD: - return new FindCommandParser().parse(arguments); + case ClearCommand.COMMAND_WORD: + return new ClearCommand(); - case ListCommand.COMMAND_WORD: - return new ListCommand(); + case FindCommand.COMMAND_WORD: + return new FindCommandParser().parse(arguments); - case ExitCommand.COMMAND_WORD: - return new ExitCommand(); + case ListCommand.COMMAND_WORD: + return new ListCommand(); - case HelpCommand.COMMAND_WORD: - return new HelpCommand(); + case ExitCommand.COMMAND_WORD: + return new ExitCommand(); - case CalculateCAPCommand.COMMAND_WORD: - return new CalculateCAPCommand(); + case HelpCommand.COMMAND_WORD: + return new HelpCommand(); - case CalculateMCCommand.COMMAND_WORD: - return new CalculateMCCommand(); + case CalculateCapCommand.COMMAND_WORD: + return new CalculateCapCommand(); + case CalculateMcCommand.COMMAND_WORD: + return new CalculateMcCommand(); - default: - logger.finer("This user input caused a ParseException: " + userInput); - throw new ParseException(MESSAGE_UNKNOWN_COMMAND); + + default: + logger.finer("This user input caused a ParseException: " + userInput); + throw new ParseException(MESSAGE_UNKNOWN_COMMAND); } } diff --git a/src/main/java/seedu/address/logic/parser/ParserUtil.java b/src/main/java/seedu/address/logic/parser/ParserUtil.java index 2fb1201cbb3..5c1b140085e 100644 --- a/src/main/java/seedu/address/logic/parser/ParserUtil.java +++ b/src/main/java/seedu/address/logic/parser/ParserUtil.java @@ -10,15 +10,15 @@ import seedu.address.commons.util.StringUtil; import seedu.address.logic.parser.exceptions.ParseException; import seedu.address.model.module.Description; +import seedu.address.model.module.Grade; +import seedu.address.model.module.ModularCredit; import seedu.address.model.module.ModuleCode; import seedu.address.model.module.ModuleName; -import seedu.address.model.module.Year; import seedu.address.model.module.Semester; -import seedu.address.model.module.Grade; -import seedu.address.model.module.ModularCredit; -import seedu.address.model.person.Name; +import seedu.address.model.module.Year; import seedu.address.model.person.Address; import seedu.address.model.person.Email; +import seedu.address.model.person.Name; import seedu.address.model.person.Phone; import seedu.address.model.tag.Tag; diff --git a/src/main/java/seedu/address/model/AddressBook.java b/src/main/java/seedu/address/model/AddressBook.java index 5c2418354ab..e45a6496b1d 100644 --- a/src/main/java/seedu/address/model/AddressBook.java +++ b/src/main/java/seedu/address/model/AddressBook.java @@ -120,7 +120,7 @@ public int totalModularCredits() { /** * Calculates and returns the total grade points weighted by modular credits of all modules in the collection. * - * @return The total grade points weighted by modular credits of all modules in the collection as a floating-point number. + * @return The total grade points weighted by modular credits of all modules in the collection as a float. */ public Float totalGradePointsByUnits() { return modules.gradePointsWithUnits(); diff --git a/src/main/java/seedu/address/model/Model.java b/src/main/java/seedu/address/model/Model.java index c5ff9346dfc..62cac7461fa 100644 --- a/src/main/java/seedu/address/model/Model.java +++ b/src/main/java/seedu/address/model/Model.java @@ -9,7 +9,6 @@ import seedu.address.model.module.ModuleCode; import seedu.address.model.moduleplan.ModulePlanSemester; import seedu.address.model.moduleplan.ReadOnlyModulePlan; -import seedu.address.model.person.Person; /** * The API of the Model component. diff --git a/src/main/java/seedu/address/model/ModelManager.java b/src/main/java/seedu/address/model/ModelManager.java index 6f64ba96b2e..82696de4e2e 100644 --- a/src/main/java/seedu/address/model/ModelManager.java +++ b/src/main/java/seedu/address/model/ModelManager.java @@ -4,11 +4,9 @@ import static seedu.address.commons.util.CollectionUtil.requireAllNonNull; import java.nio.file.Path; -import java.util.function.Predicate; import java.util.logging.Logger; import javafx.collections.ObservableList; -import javafx.collections.transformation.FilteredList; import seedu.address.commons.core.GuiSettings; import seedu.address.commons.core.LogsCenter; import seedu.address.model.module.Module; @@ -16,7 +14,6 @@ import seedu.address.model.moduleplan.ModulePlan; import seedu.address.model.moduleplan.ModulePlanSemester; import seedu.address.model.moduleplan.ReadOnlyModulePlan; -import seedu.address.model.person.Person; /** * Represents the in-memory model of the address book data. diff --git a/src/main/java/seedu/address/model/module/Grade.java b/src/main/java/seedu/address/model/module/Grade.java index 99ebd0b7bd4..ab55c80804b 100644 --- a/src/main/java/seedu/address/model/module/Grade.java +++ b/src/main/java/seedu/address/model/module/Grade.java @@ -3,7 +3,6 @@ import static java.util.Objects.requireNonNull; import static seedu.address.commons.util.AppUtil.checkArgument; -import java.awt.datatransfer.FlavorEvent; import java.util.Arrays; import java.util.stream.Collectors; diff --git a/src/main/java/seedu/address/model/module/ModularCredit.java b/src/main/java/seedu/address/model/module/ModularCredit.java index e3bb8acc0ea..be5fe88e565 100644 --- a/src/main/java/seedu/address/model/module/ModularCredit.java +++ b/src/main/java/seedu/address/model/module/ModularCredit.java @@ -3,6 +3,9 @@ import static java.util.Objects.requireNonNull; import static seedu.address.commons.util.AppUtil.checkArgument; +/** + * Represents the number of Modular Credits a Module is worth. + */ public class ModularCredit { public static final String MESSAGE_CONSTRAINTS = "Modular credits should be a non-negative integer."; diff --git a/src/main/java/seedu/address/model/module/Module.java b/src/main/java/seedu/address/model/module/Module.java index 3d5869741bc..1265dbc519a 100644 --- a/src/main/java/seedu/address/model/module/Module.java +++ b/src/main/java/seedu/address/model/module/Module.java @@ -24,7 +24,7 @@ public class Module { /** * Every field must be present and not null. */ - public Module(ModuleCode moduleCode, Year yearTaken, Semester semesterTaken, Grade grade, ModuleName name, + public Module(ModuleCode moduleCode, Year yearTaken, Semester semesterTaken, Grade grade, ModuleName name, Description description, Set lecturers, ModularCredit modularCredit) { requireAllNonNull(name, moduleCode, description, lecturers, yearTaken, semesterTaken, grade); this.moduleName = name; @@ -36,6 +36,10 @@ public Module(ModuleCode moduleCode, Year yearTaken, Semester semesterTaken, Gr this.grade = grade; this.modularCredit = modularCredit; } + + /** + * Constructs a {@code Module} with only user input fields. + */ public Module(ModuleCode moduleCode, Year year, Semester semester, Grade grade) { requireAllNonNull(moduleCode, year, semester, grade); this.moduleCode = moduleCode; diff --git a/src/main/java/seedu/address/model/module/UniqueModuleList.java b/src/main/java/seedu/address/model/module/UniqueModuleList.java index 06a2b25f0bc..596ca11443b 100644 --- a/src/main/java/seedu/address/model/module/UniqueModuleList.java +++ b/src/main/java/seedu/address/model/module/UniqueModuleList.java @@ -68,17 +68,6 @@ public void setModules(Module target, Module editedModule) { internalList.set(index, editedModule); } - /** - * Removes the equivalent module from the list. - * The module must exist in the list. - */ - public void remove(Module toRemove) { - requireNonNull(toRemove); - if (!internalList.remove(toRemove)) { - throw new ModuleNotFoundException(); - } - } - /** * Replaces the modules in the internal list with the modules from the provided `UniqueModuleList`. * @@ -90,6 +79,30 @@ public void setModules(UniqueModuleList replacement) { internalList.setAll(replacement.internalList); } + /** + * Replaces the contents of this list with {@code modules}. + * {@code modules} must not contain duplicate modules. + */ + public void setModules(List modules) { + requireAllNonNull(modules); + if (!modulesAreUnique(modules)) { + throw new DuplicateModuleException(); + } + + internalList.setAll(modules); + } + + /** + * Removes the equivalent module from the list. + * The module must exist in the list. + */ + public void remove(Module toRemove) { + requireNonNull(toRemove); + if (!internalList.remove(toRemove)) { + throw new ModuleNotFoundException(); + } + } + /** * Finds and returns the module with the specified module code. * @@ -108,7 +121,7 @@ public Module find(ModuleCode code) { } /** - * Calculates and returns the total modular credits of all modules in the internal list. + * Calculates the total modular credits of all modules in the internal list. * * @return The total modular credits of all modules in the internal list. */ @@ -123,7 +136,7 @@ public int modularCredits() { } /** - * Calculates and returns the total grade points weighted by the modular credits of all modules in the internal list. + * Calculates the total grade points weighted by the modular credits of all modules in the internal list. * * @return The total grade points weighted by modular credits as a floating-point number. */ @@ -137,19 +150,6 @@ public Float gradePointsWithUnits() { return gradePoints; } - /** - * Replaces the contents of this list with {@code modules}. - * {@code modules} must not contain duplicate modules. - */ - public void setModules(List modules) { - requireAllNonNull(modules); - if (!modulesAreUnique(modules)) { - throw new DuplicateModuleException(); - } - - internalList.setAll(modules); - } - /** * Returns the backing list as an unmodifiable {@code ObservableList}. */ diff --git a/src/main/java/seedu/address/model/moduleplan/ModulePlan.java b/src/main/java/seedu/address/model/moduleplan/ModulePlan.java index cda0a29949b..7f842a90dec 100644 --- a/src/main/java/seedu/address/model/moduleplan/ModulePlan.java +++ b/src/main/java/seedu/address/model/moduleplan/ModulePlan.java @@ -137,7 +137,7 @@ public int totalModularCredits() { /** * Calculates and returns the total grade points weighted by modular credits of all modules in the collection. * - * @return The total grade points weighted by modular credits of all modules in the collection as a floating-point number. + * @return The total grade points weighted by modular credits of all modules in the collection as a float. */ public Float totalGradePointsByUnits() { return semesters.gradePointsWithUnits(); diff --git a/src/main/java/seedu/address/model/moduleplan/ModulePlanSemester.java b/src/main/java/seedu/address/model/moduleplan/ModulePlanSemester.java index bba84221dd7..a372b2e9159 100644 --- a/src/main/java/seedu/address/model/moduleplan/ModulePlanSemester.java +++ b/src/main/java/seedu/address/model/moduleplan/ModulePlanSemester.java @@ -1,13 +1,16 @@ package seedu.address.model.moduleplan; +import static java.util.Objects.requireNonNull; + +import java.util.List; import javafx.collections.ObservableList; -import seedu.address.model.module.*; import seedu.address.model.module.Module; +import seedu.address.model.module.ModuleCode; +import seedu.address.model.module.Semester; +import seedu.address.model.module.UniqueModuleList; +import seedu.address.model.module.Year; -import java.util.List; - -import static java.util.Objects.requireNonNull; /** * A semester of the Module Plan timetable. @@ -34,12 +37,10 @@ public class ModulePlanSemester { * Wraps all data at the Module Plan semester level. */ public ModulePlanSemester(Year year, Semester semester) { - this.year = year; + this.year = year; this.semester = semester; } - - /** * Replaces the contents of the module list with {@code modules}. * @@ -105,7 +106,7 @@ public int totalModularCredits() { /** * Calculates and returns the total grade points weighted by modular credits of all modules in the collection. * - * @return The total grade points weighted by modular credits of all modules in the collection as a floating-point number. + * @return The total grade points weighted by modular credits of all modules in the collection as a float. */ public Float totalGradePointsByUnits() { return modules.gradePointsWithUnits(); @@ -132,7 +133,7 @@ public ObservableList getModuleList() { } @Override - public String toString(){ + public String toString() { return "Year " + year.toString() + " " + semester.toString(); } diff --git a/src/main/java/seedu/address/model/moduleplan/ModulePlanSemesterList.java b/src/main/java/seedu/address/model/moduleplan/ModulePlanSemesterList.java index 221c7a33d6a..1f2dd783f3b 100644 --- a/src/main/java/seedu/address/model/moduleplan/ModulePlanSemesterList.java +++ b/src/main/java/seedu/address/model/moduleplan/ModulePlanSemesterList.java @@ -10,8 +10,6 @@ import javafx.collections.ObservableList; import seedu.address.model.module.Module; import seedu.address.model.module.ModuleCode; -import seedu.address.model.module.Semester; -import seedu.address.model.module.Year; import seedu.address.model.module.exceptions.ModuleNotFoundException; import seedu.address.model.moduleplan.exceptions.DuplicateSemesterException; import seedu.address.model.moduleplan.exceptions.SemesterNotFoundException; @@ -19,8 +17,9 @@ /** * A list of semesters that enforces uniqueness between its elements and does not allow nulls. - * A semester is considered unique by comparing using {@code ModulePlanSemester#equals(ModulePlanSemester)}. As such, adding and updating of - * module uses ModulePlanSemester#equals(ModulePlanSemester) for equality so as to ensure that the semester being added or updated is + * A semester is considered unique by comparing using {@code ModulePlanSemester#equals(ModulePlanSemester)}. + * As such, adding and updating of module uses ModulePlanSemester#equals(ModulePlanSemester) + * for equality so as to ensure that the semester being added or updated is * unique in terms of identity in the ModulePlanSemesterList. * * Supports a minimal set of list operations. @@ -44,7 +43,8 @@ public void setSemesters(List semesters) { } /** - * Replaces the semesters in the internal list with the semesters from the provided `UniModulePlanSemesterListqueModuleList`. + * Replaces the semesters in the internal list with the semesters from + * the provided `UniModulePlanSemesterListqueModuleList`. * * @param replacement The `ModulePlanSemesterList` containing the semesters to replace the internal list. * @throws NullPointerException If the provided replacement is null. @@ -72,7 +72,7 @@ public boolean containsSemester(ModulePlanSemester toCheck) { public void addSemester(ModulePlanSemester semester) { requireNonNull(semester); - if(containsSemester(semester)) { + if (containsSemester(semester)) { throw new DuplicateSemesterException(); } internalList.add(semester); @@ -87,7 +87,7 @@ public void addSemester(ModulePlanSemester semester) { public void removeSemester(ModulePlanSemester semester) { requireNonNull(semester); - if(!containsSemester(semester)) { + if (!containsSemester(semester)) { throw new SemesterNotFoundException(); } internalList.remove(semester); @@ -187,7 +187,7 @@ public Module findModule(ModuleCode code) { } /** - * Calculates and returns the total modular credits of all modules in the internal list. + * Calculates the total modular credits of all modules in the internal list. * * @return The total modular credits of all modules in the internal list. */ @@ -200,7 +200,7 @@ public int modularCredits() { } /** - * Calculates and returns the total grade points weighted by the modular credits of all modules in the internal list. + * Calculates the total grade points weighted by the modular credits of all modules in the internal list. * * @return The total grade points weighted by modular credits as a floating-point number. */ @@ -254,7 +254,7 @@ public String toString() { private int findSemester(Module m) { for (int i = 0; i < internalList.size(); i++) { - if(internalList.get(i).checkModuleInSemester(m)) { + if (internalList.get(i).checkModuleInSemester(m)) { return i; } } diff --git a/src/main/java/seedu/address/model/moduleplan/ReadOnlyModulePlan.java b/src/main/java/seedu/address/model/moduleplan/ReadOnlyModulePlan.java index c490ac1648d..c26963deea7 100644 --- a/src/main/java/seedu/address/model/moduleplan/ReadOnlyModulePlan.java +++ b/src/main/java/seedu/address/model/moduleplan/ReadOnlyModulePlan.java @@ -13,4 +13,4 @@ public interface ReadOnlyModulePlan { */ ObservableList getModulePlanSemesterList(); -} \ No newline at end of file +} diff --git a/src/main/java/seedu/address/model/util/SampleDataUtil.java b/src/main/java/seedu/address/model/util/SampleDataUtil.java index adc459dbfa4..59ad1b8cf57 100644 --- a/src/main/java/seedu/address/model/util/SampleDataUtil.java +++ b/src/main/java/seedu/address/model/util/SampleDataUtil.java @@ -27,18 +27,18 @@ public class SampleDataUtil { public static Module[] getSampleModules() { return new Module[] { new Module(new ModuleCode("CS1231S"), new Year("1"), new Semester("SEMESTER_1"), new Grade("A+"), - new ModuleName("Discrete Structures"), + new ModuleName("Discrete Structures"), new Description("Introduces mathematical tools required the study of Computer Science"), Set.of(new Lecturer("Aaron Tan")), new ModularCredit("4")), new Module(new ModuleCode("CS2040S"), new Year("1"), new Semester("SEMESTER_2"), new Grade("A"), - new ModuleName("Data Structures and Algorithms"), + new ModuleName("Data Structures and Algorithms"), new Description("Covers the design and implementation of efficient data structures and algorithms"), Set.of(new Lecturer("Tan Sun Teck")), new ModularCredit("4")), new Module(new ModuleCode("CS2101"), new Year("2"), new Semester("SEMESTER_1"), new Grade("A-"), - new ModuleName("Effective Communication for Computing Professionals"), - new Description("Introduces the necessary conceptual and analytic tools for systematic and rigorous development of software systems"), + new ModuleName("Effective Communication for Computing Professionals"), + new Description("Equips students with the skills needed to communicate technical information"), Set.of(new Lecturer("Lee Bu Sung")), new ModularCredit("4")), }; } diff --git a/src/main/java/seedu/address/storage/JsonAdaptedLecturer.java b/src/main/java/seedu/address/storage/JsonAdaptedLecturer.java index ac52ffd2430..1b8ea6c679c 100644 --- a/src/main/java/seedu/address/storage/JsonAdaptedLecturer.java +++ b/src/main/java/seedu/address/storage/JsonAdaptedLecturer.java @@ -1,8 +1,8 @@ package seedu.address.storage; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + import seedu.address.commons.exceptions.IllegalValueException; import seedu.address.model.module.Lecturer; diff --git a/src/main/java/seedu/address/storage/JsonAdaptedModule.java b/src/main/java/seedu/address/storage/JsonAdaptedModule.java index 664a8251c16..ae232866f38 100644 --- a/src/main/java/seedu/address/storage/JsonAdaptedModule.java +++ b/src/main/java/seedu/address/storage/JsonAdaptedModule.java @@ -1,18 +1,25 @@ package seedu.address.storage; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import seedu.address.commons.exceptions.IllegalValueException; -import seedu.address.model.module.*; -import seedu.address.model.module.Module; - import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +import seedu.address.commons.exceptions.IllegalValueException; +import seedu.address.model.module.Description; +import seedu.address.model.module.Grade; +import seedu.address.model.module.Lecturer; +import seedu.address.model.module.ModularCredit; +import seedu.address.model.module.Module; +import seedu.address.model.module.ModuleCode; +import seedu.address.model.module.ModuleName; +import seedu.address.model.module.Semester; +import seedu.address.model.module.Year; + /** * Jackson-friendly version of {@link Module}. */ @@ -33,9 +40,9 @@ public class JsonAdaptedModule { */ @JsonCreator - public JsonAdaptedModule(@JsonProperty("code") String code, + public JsonAdaptedModule(@JsonProperty("code") String code, @JsonProperty("year") String year, - @JsonProperty("sem") String sem, + @JsonProperty("sem") String sem, @JsonProperty("grade") String grade, @JsonProperty("name") String name, @JsonProperty("description") String description, @@ -76,7 +83,8 @@ public JsonAdaptedModule(Module source) { public Module toModelType() throws IllegalValueException { if (code == null) { - throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, ModuleCode.class.getSimpleName())); + throw new IllegalValueException( + String.format(MISSING_FIELD_MESSAGE_FORMAT, ModuleCode.class.getSimpleName())); } if (!ModuleCode.isValidModuleCode(code)) { throw new IllegalValueException(ModuleCode.MESSAGE_CONSTRAINTS); @@ -92,7 +100,8 @@ public Module toModelType() throws IllegalValueException { final Year modelYear = new Year(year); if (sem == null) { - throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Semester.class.getSimpleName())); + throw new IllegalValueException( + String.format(MISSING_FIELD_MESSAGE_FORMAT, Semester.class.getSimpleName())); } if (!Semester.isValidSemester(sem)) { throw new IllegalValueException(Semester.MESSAGE_CONSTRAINTS); @@ -107,8 +116,9 @@ public Module toModelType() throws IllegalValueException { } final Grade modelGrade = new Grade(grade); - if(name == null) { - throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, ModuleName.class.getSimpleName())); + if (name == null) { + throw new IllegalValueException( + String.format(MISSING_FIELD_MESSAGE_FORMAT, ModuleName.class.getSimpleName())); } if (!ModuleName.isValidName(name)) { throw new IllegalValueException(ModuleName.MESSAGE_CONSTRAINTS); @@ -116,20 +126,22 @@ public Module toModelType() throws IllegalValueException { final ModuleName modelName = new ModuleName(name); if (description == null) { - throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Description.class.getSimpleName())); + throw new IllegalValueException( + String.format(MISSING_FIELD_MESSAGE_FORMAT, Description.class.getSimpleName())); } - if(!Description.isValidDescription(description)) { + if (!Description.isValidDescription(description)) { throw new IllegalValueException(Description.MESSAGE_CONSTRAINTS); } final Description modelDescription = new Description(description); - + final List moduleLecturers = new ArrayList<>(); for (JsonAdaptedLecturer lecturer : lecturers) { moduleLecturers.add(lecturer.toModelType()); } - if(modularCredit == null) { - throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, ModularCredit.class.getSimpleName())); + if (modularCredit == null) { + throw new IllegalValueException( + String.format(MISSING_FIELD_MESSAGE_FORMAT, ModularCredit.class.getSimpleName())); } if (!ModularCredit.isValidModularCredit(modularCredit)) { throw new IllegalValueException(ModularCredit.MESSAGE_CONSTRAINTS); @@ -137,7 +149,8 @@ public Module toModelType() throws IllegalValueException { final ModularCredit modelModularCredit = new ModularCredit(modularCredit); final Set modelLecturer = new HashSet<>(moduleLecturers); - return new Module(modelCode, modelYear, modelSem, modelGrade, modelName, modelDescription, modelLecturer, modelModularCredit); + return new Module(modelCode, modelYear, modelSem, modelGrade, modelName, modelDescription, + modelLecturer, modelModularCredit); } } diff --git a/src/main/java/seedu/address/ui/ModulePlanCard.java b/src/main/java/seedu/address/ui/ModulePlanCard.java index b4ee7916b3f..fff40e90efc 100644 --- a/src/main/java/seedu/address/ui/ModulePlanCard.java +++ b/src/main/java/seedu/address/ui/ModulePlanCard.java @@ -1,18 +1,15 @@ package seedu.address.ui; -import java.util.Comparator; - -import javafx.collections.FXCollections; -import javafx.collections.ObservableList; import javafx.fxml.FXML; import javafx.scene.control.Label; -import javafx.scene.control.ListView; import javafx.scene.layout.FlowPane; import javafx.scene.layout.Region; import javafx.scene.layout.VBox; import seedu.address.model.moduleplan.ModulePlanSemester; - +/** + * TODO: JavaDoc + */ public class ModulePlanCard extends UiPart { private static final String FXML = "ModulePlanCard.fxml"; diff --git a/src/main/java/seedu/address/ui/ModulePlanPanel.java b/src/main/java/seedu/address/ui/ModulePlanPanel.java index e92fc60d724..625b0699117 100644 --- a/src/main/java/seedu/address/ui/ModulePlanPanel.java +++ b/src/main/java/seedu/address/ui/ModulePlanPanel.java @@ -2,7 +2,6 @@ import java.util.logging.Logger; -import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.fxml.FXML; import javafx.scene.control.ListCell; @@ -10,7 +9,6 @@ import javafx.scene.layout.Region; import seedu.address.commons.core.LogsCenter; import seedu.address.model.moduleplan.ModulePlanSemester; -import seedu.address.model.person.Person; /** * Panel containing the list of persons. diff --git a/src/test/java/seedu/address/logic/commands/CalculateCAPCommandTest.java b/src/test/java/seedu/address/logic/commands/CalculateCapCommandTest.java similarity index 91% rename from src/test/java/seedu/address/logic/commands/CalculateCAPCommandTest.java rename to src/test/java/seedu/address/logic/commands/CalculateCapCommandTest.java index 1a44b4f15b9..c742f6ec81d 100644 --- a/src/test/java/seedu/address/logic/commands/CalculateCAPCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/CalculateCapCommandTest.java @@ -13,9 +13,9 @@ import seedu.address.testutil.TypicalModules; /** - * Contains integration tests (interaction with the Model) and unit tests for CalculateCAPCommand. + * Contains integration tests (interaction with the Model) and unit tests for CalculateCapCommand. */ -public class CalculateCAPCommandTest { +public class CalculateCapCommandTest { private Model model; private Model expectedModel; diff --git a/src/test/java/seedu/address/logic/commands/CalculateMCCommandTest.java b/src/test/java/seedu/address/logic/commands/CalculateMcCommandTest.java similarity index 91% rename from src/test/java/seedu/address/logic/commands/CalculateMCCommandTest.java rename to src/test/java/seedu/address/logic/commands/CalculateMcCommandTest.java index 40cc738f5e5..036c62e18c5 100644 --- a/src/test/java/seedu/address/logic/commands/CalculateMCCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/CalculateMcCommandTest.java @@ -12,9 +12,9 @@ import seedu.address.testutil.TypicalModules; /** - * Contains integration tests (interaction with the Model) and unit tests for CalculateMCCommand. + * Contains integration tests (interaction with the Model) and unit tests for CalculateMcCommand. */ -public class CalculateMCCommandTest { +public class CalculateMcCommandTest { private Model model; private Model expectedModel; @BeforeEach diff --git a/src/test/java/seedu/address/logic/parser/AddressBookParserTest.java b/src/test/java/seedu/address/logic/parser/AddressBookParserTest.java index 83ba71cfed5..69bae81f7e3 100644 --- a/src/test/java/seedu/address/logic/parser/AddressBookParserTest.java +++ b/src/test/java/seedu/address/logic/parser/AddressBookParserTest.java @@ -14,8 +14,8 @@ import org.junit.jupiter.api.Test; import seedu.address.logic.commands.AddCommand; -import seedu.address.logic.commands.CalculateCAPCommand; -import seedu.address.logic.commands.CalculateMCCommand; +import seedu.address.logic.commands.CalculateCapCommand; +import seedu.address.logic.commands.CalculateMcCommand; import seedu.address.logic.commands.ClearCommand; import seedu.address.logic.commands.DeleteCommand; import seedu.address.logic.commands.EditCommand; @@ -90,13 +90,13 @@ public void parseCommand_list() throws Exception { } @Test - public void parseCommand_calculateCAP() throws Exception { - assertTrue(parser.parseCommand(CalculateCAPCommand.COMMAND_WORD) instanceof CalculateCAPCommand); + public void parseCommand_calculateCap() throws Exception { + assertTrue(parser.parseCommand(CalculateCapCommand.COMMAND_WORD) instanceof CalculateCapCommand); } @Test - public void parseCommand_calculateMC() throws Exception { - assertTrue(parser.parseCommand(CalculateMCCommand.COMMAND_WORD) instanceof CalculateMCCommand); + public void parseCommand_calculateMc() throws Exception { + assertTrue(parser.parseCommand(CalculateMcCommand.COMMAND_WORD) instanceof CalculateMcCommand); } @Test