@@ -0,0 +1,2414 @@
+package linenux.command;%0A%0Aimport static linenux.helpers.Assert.assertChangeBy;%0Aimport static linenux.helpers.Assert.assertNoChange;%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport linenux.model.Schedule;%0Aimport linenux.model.Task;%0A%0Apublic class UndoCommandTest %7B%0A    private Schedule schedule;%0A    private UndoCommand undoCommand;%0A%0A    @Before%0A    public void setUpUndoCommand() %7B%0A        this.schedule = new Schedule();%0A        this.undoCommand = new UndoCommand(this.schedule);%0A    %7D%0A%0A    /**%0A     * Should only return true if the user input is %22undo%22 without any other spaces or characters.%0A     */%0A    @Test%0A    public void testRespondToUndoCommand() %7B%0A        assertTrue(undoCommand.respondTo(%22undo%22));%0A        assertFalse(undoCommand.respondTo(%22undo %22));%0A    %7D%0A%0A    /**%0A     * Test that respondTo is case-insensitive.%0A     */%0A    @Test%0A    public void testCaseInsensitiveUndoCommand() %7B%0A        assertTrue(undoCommand.respondTo(%22UnDo%22));%0A    %7D%0A%0A    /**%0A     * Test that respondTo will return false for commands not related to add tasks.%0A     */%0A    @Test%0A    public void testNotRespondToOtherCommands() %7B%0A        assertFalse(this.undoCommand.respondTo(%22halp%22));%0A    %7D%0A%0A    /**%0A     * Test that undo successfully removes a state if number of states %3E 1.%0A     */%0A    @Test%0A    public void testExecuteUndo() %7B%0A        this.schedule.addTask(new Task(%22task1%22));%0A        assertChangeBy(() -%3E this.schedule.getStates().size(),%0A                -1,%0A                () -%3E this.undoCommand.execute(%22undo%22));%0A    %7D%0A%0A    /**%0A     * Test that undo does not remove the last state if number of states = 1.%0A     */%0A    @Test%0A    public void testExecuteUndoWhenStateIsOne() %7B%0A        assertNoChange(() -%3E this.schedule.getStates().size(),%0A                () -%3E this.undoCommand.execute(%22undo%22));%0A    %7D%0A%0A    /**%0A     * Test successful undo message.%0A     */%0A    @Test%0A    public void testSuccessfulUndo() %7B%0A        this.schedule.addTask(new Task(%22task1%22));%0A        assertEquals(%22Successfully undo last command.%22, this.undoCommand.execute(%22undo%22).getFeedback());%0A    %7D%0A%0A    /**%0A     * Test no more states to undo message.%0A     */%0A    @Test%0A    public void testUnsuccessfulUndo() %7B%0A        assertEquals(%22No more commands to undo!%22, this.undoCommand.execute(%22undo%22).getFeedback());%0A    %7D%0A%7D%0A

Add undo test cases