Skip to content

Commit

Permalink
Fix checkstyle errors and failed test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
shaowi committed Mar 22, 2023
1 parent 52d1b34 commit ff6d9b6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.function.Predicate;

import org.junit.jupiter.api.Test;

import seedu.address.commons.core.Messages;
import seedu.address.model.Level;
import seedu.address.model.Model;
Expand All @@ -33,10 +34,11 @@
* Contains integration tests (interaction with the Model) for {@code FindCommand}.
*/
public class FindCommandTest {
private static final Module CS2040S = TypicalModules.getCs2040s();
private static final Module ST2334 = TypicalModules.getSt2334();

private Model model = new ModelManager(getTypicalTracker(), new UserPrefs());
private Model expectedModel = new ModelManager(getTypicalTracker(), new UserPrefs());
private final static Module CS2040S = TypicalModules.getCs2040s();
private final static Module ST2334 = TypicalModules.getSt2334();

@Test
public void equals() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
import static seedu.address.logic.commands.CommandTestUtil.INVALID_LECTURE_NAME_DESC;
import static seedu.address.logic.commands.CommandTestUtil.INVALID_MODULE_CODE_DESC;
import static seedu.address.logic.commands.CommandTestUtil.MODULE_CODE_DESC_2103;
import static seedu.address.logic.commands.CommandTestUtil.PREAMBLE_NON_EMPTY;
import static seedu.address.logic.commands.CommandTestUtil.PREAMBLE_WHITESPACE;
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseFailure;
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseSuccess;

import java.util.Arrays;

import org.junit.jupiter.api.Test;

import seedu.address.logic.commands.FindCommand;
import seedu.address.model.lecture.LectureName;
import seedu.address.model.module.ModuleCode;
Expand All @@ -34,16 +36,18 @@ public void parse_validArgs_returnsFindCommand() {
public void parse_invalidArgs_throwsParseException() {
String invalidFormat = String.format(MESSAGE_INVALID_COMMAND_FORMAT, FindCommand.MESSAGE_USAGE);

// No empty args
// No empty keywords
assertParseFailure(parser, PREAMBLE_WHITESPACE, invalidFormat);

// Missing module code and invalid lecture name format
assertParseFailure(parser, INVALID_LECTURE_NAME_DESC, invalidFormat);
// Keyword present, missing module code and invalid lecture name format
assertParseFailure(parser, PREAMBLE_NON_EMPTY + INVALID_LECTURE_NAME_DESC, invalidFormat);

// Invalid module code format
assertParseFailure(parser, INVALID_MODULE_CODE_DESC, ModuleCode.MESSAGE_CONSTRAINTS);
// Keyword present, invalid module code format
assertParseFailure(parser, PREAMBLE_NON_EMPTY + INVALID_MODULE_CODE_DESC, ModuleCode.MESSAGE_CONSTRAINTS);

// Valid module code present but invalid lecture name format
assertParseFailure(parser, MODULE_CODE_DESC_2103 + INVALID_LECTURE_NAME_DESC, LectureName.MESSAGE_CONSTRAINTS);
// Keyword present, valid module code present but invalid lecture name format
assertParseFailure(parser,
PREAMBLE_NON_EMPTY + MODULE_CODE_DESC_2103 + INVALID_LECTURE_NAME_DESC,
LectureName.MESSAGE_CONSTRAINTS);
}
}

0 comments on commit ff6d9b6

Please sign in to comment.