Skip to content

Commit

Permalink
Refactor JUnit tests
Browse files Browse the repository at this point in the history
The JUnit tests could be better structured.

This needs to change to ensure that the tests are clear and
maintainable.

Let's refactor the JUnit tests.

This enhances test-code readability and maintainability.
  • Loading branch information
wkxcass committed Sep 16, 2024
1 parent 82ef127 commit 814e5bb
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 41 deletions.
20 changes: 0 additions & 20 deletions src/test/java/moimoi/util/command/AddCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,24 +158,4 @@ public void execute_invalidPeriod_invalidPeriodExceptionThrown() {
}
}

@Test
public void execute_validInputs_success() throws Exception {

AddCommand addCommand;

addCommand = new AddCommand(CommandEnum.DEADLINE, "dummy /by 2024-08-22 18:00");
addCommand.execute(this.storage, this.tasks);

addCommand = new AddCommand(CommandEnum.EVENT,
"dummy /from 2024-08-22 18:00 /to 2024-08-22 18:30");
addCommand.execute(this.storage, this.tasks);

addCommand = new AddCommand(CommandEnum.PERIOD, "dummy /for 17");
addCommand.execute(this.storage, this.tasks);

addCommand = new AddCommand(CommandEnum.PERIOD, "dummy /for 17.5");
addCommand.execute(this.storage, this.tasks);

}

}
7 changes: 0 additions & 7 deletions src/test/java/moimoi/util/command/DeleteTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,4 @@ public void execute_invalidIndex_invalidIndexExceptionThrown() {

}

@Test
public void execute_validIndex_success() throws Exception {
this.tasks.add(this.task);
DeleteCommand deleteCommand = new DeleteCommand("1");
deleteCommand.execute(this.storage, this.tasks);
}

}
7 changes: 0 additions & 7 deletions src/test/java/moimoi/util/command/MarkCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,4 @@ public void execute_invalidIndex_invalidIndexExceptionThrown() {

}

@Test
public void execute_validIndex_success() throws Exception {
this.tasks.add(this.task);
MarkCommand markCommand = new MarkCommand("1");
markCommand.execute(this.storage, this.tasks);
}

}
7 changes: 0 additions & 7 deletions src/test/java/moimoi/util/command/UnmarkCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,4 @@ public void execute_invalidIndex_invalidIndexExceptionThrown() {

}

@Test
public void execute_validIndex_success() throws Exception {
this.tasks.add(this.task);
UnmarkCommand unmarkCommand = new UnmarkCommand("1");
unmarkCommand.execute(this.storage, this.tasks);
}

}

0 comments on commit 814e5bb

Please sign in to comment.