src/test/java/guitests/DeleteCommandTest.java
/**
     * Runs the delete command to delete the task at specified index and
     * confirms the result is correct.
     *
     * @param targetIndexOneIndexed
     *            e.g. index 1 to delete the first task in the list,
     * @param currentList
     *            A copy of the current list of tasks (before deletion).
     */
Runs the delete command to delete the task at specified index and
confirms the result is correct.


Runs the delete command to delete the task at specified index and confirms the result is correct .
private void assertDeleteSuccess(int targetIndexOneIndexed, final TestTask[] currentList) {
        TestTask taskToDelete = currentList[targetIndexOneIndexed - 1]; 
        TestTask[] expectedRemainder = TestUtil.removeTaskFromList(currentList, targetIndexOneIndexed);
        commandBox.runCommand("DELETE " + targetIndexOneIndexed);
        assertTrue(eventTaskListPanel.isListMatching(expectedRemainder));
        assertTrue(deadlineTaskListPanel.isListMatching(expectedRemainder));
        assertTrue(floatingTaskListPanel.isListMatching(expectedRemainder));
        assertResultMessage(String.format(MESSAGE_DELETE_TASK_SUCCESS, taskToDelete));
    }
private void assertDeleteSuccess ( int targetIndexOneIndexed , final TestTask [ ] currentList ) { TestTask taskToDelete = currentList [ targetIndexOneIndexed - 1 ] ; TestTask [ ] expectedRemainder = TestUtil . removeTaskFromList ( currentList , targetIndexOneIndexed ) ; commandBox . runCommand ( "DELETE " + targetIndexOneIndexed ) ; assertTrue ( eventTaskListPanel . isListMatching ( expectedRemainder ) ) ; assertTrue ( deadlineTaskListPanel . isListMatching ( expectedRemainder ) ) ; assertTrue ( floatingTaskListPanel . isListMatching ( expectedRemainder ) ) ; assertResultMessage ( String . format ( MESSAGE_DELETE_TASK_SUCCESS , taskToDelete ) ) ; }
Runs the delete command to delete the task at specified index and
 confirms the result is correct.
Runs the delete command to delete the task at specified index and confirms the result is correct .
// -1 as // array // uses // zero // indexing // confirm the list now contains all previous tasks except the deleted // task // confirm the result message is correct