Skip to content

Commit

Permalink
Open one of the test case
Browse files Browse the repository at this point in the history
  • Loading branch information
CarrieLi1015 committed Apr 10, 2023
1 parent bc587e2 commit 01f40c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure;
import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess;
import static seedu.address.logic.commands.DeleteScoreCommand.MESSAGE_DELETE_SCORE_SUCCESS;
import static seedu.address.testutil.Assert.assertThrows;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_SCORE;
import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_STUDENT;
import static seedu.address.testutil.TypicalIndexes.INDEX_SECOND_SCORE;
Expand All @@ -24,10 +25,10 @@ class DeleteScoreCommandTest {

private Model model = new ModelManager(getTypicalMathutoring(), new UserPrefs());

/*@Test
@Test
public void constructor_nullIndexes_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> new DeleteScoreCommand(null, null));
}*/
}

@Test
void execute_validIndexScoreDelete_success() {
Expand Down Expand Up @@ -56,10 +57,10 @@ void execute_invalidStudentIndexUnfilteredList_failure() {

@Test
void execute_validStudentIndexInvalidScoreIndexUnfilteredList_failure() {
Index outOfBoundTaskIndex = Index.fromOneBased(model.getFilteredStudentList().get(INDEX_FIRST_STUDENT
.getZeroBased()).getTaskList().asUnmodifiableObservableList().size() + 1);
Index outOfBoundScoreIndex = Index.fromOneBased(model.getFilteredStudentList().get(INDEX_FIRST_STUDENT
.getZeroBased()).getScoreList().asUnmodifiableObservableList().size() + 1);

DeleteScoreCommand deleteScoreCommand = new DeleteScoreCommand(INDEX_FIRST_STUDENT, outOfBoundTaskIndex);
DeleteScoreCommand deleteScoreCommand = new DeleteScoreCommand(INDEX_FIRST_STUDENT, outOfBoundScoreIndex);

assertCommandFailure(deleteScoreCommand, model, Messages.MESSAGE_INVALID_SCORE_DISPLAYED_INDEX);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ public void parse_invalidDate_failure() {
public void parse_futureDate_failure() {
String expectedMessage = String.format(Date.MESSAGE_INVALID_DATE);

// invalid date format
// future date
assertParseFailure(parser, "1" + SCORE_FULL_DATE_IN_FUTURE, expectedMessage);
}

@Test
public void parse_missingAllVariables() {
String expectedMessage = String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddScoreCommand.MESSAGE_USAGE);

// missing score date
// missing multiple variables
assertParseFailure(parser, "1" + SCORE_MISSING_ALL_VARIABLES, expectedMessage);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ public void parse_validArgs_returnsFindCommand() {
// multiple whitespaces between keywords
assertParseSuccess(parser, " \n friends \n \t owesMoney \t", expectedFilterCommand);
}

}

0 comments on commit 01f40c2

Please sign in to comment.