//@@author A0143409J

package seedu.address.logic.parser;

import static org.junit.Assert.assertEquals;
import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;

import java.lang.reflect.Field;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import seedu.address.logic.commands.IncorrectCommand;
import seedu.address.logic.commands.FinishCommand;

public class FinishCommandParserTest {

    @Rule
    public ExpectedException thrown = ExpectedException.none();

    @Test
    public void nullTest() throws Exception {
        thrown.expect(NullPointerException.class);
        FinishCommandParser.parse(null);
    }

    @Test
    public void validTest() throws Exception {
        Field field = FinishCommand.class.getDeclaredField("targetIndex");
        field.setAccessible(true);

        FinishCommand finishCommand = (FinishCommand) FinishCommandParser.parse("1");
        assertEquals(field.get(finishCommand), 1);
    }

    @Test
    public void invalidTest() throws Exception {
        Field field = IncorrectCommand.class.getDeclaredField("feedbackToUser");
        field.setAccessible(true);

        IncorrectCommand incorrectCommand = (IncorrectCommand) FinishCommandParser.parse("+");
        assertEquals(field.get(incorrectCommand),
                String.format(MESSAGE_INVALID_COMMAND_FORMAT, FinishCommand.MESSAGE_USAGE));
    }
}

@@ -338,25 +338,22 @@
 ommands.
-Incorrect
+Finish
 Command;
@@ -381,38 +381,41 @@
 .logic.commands.
-Finish
+Incorrect
 Command;%0A%0Apublic

Modify to match lexicographical order