//@@ 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.ViewCommand;

public class ViewCommandParserTest {

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

    @Test
    public void nullTest() throws Exception {

        Field field = IncorrectCommand.class.getDeclaredField("feedbackToUser");
        field.setAccessible(true);

        IncorrectCommand incorrectCommand =  (IncorrectCommand) ViewCommandParser.parse(null);
        assertEquals(field.get(incorrectCommand), String.format(
                MESSAGE_INVALID_COMMAND_FORMAT, ViewCommand.MESSAGE_USAGE));
    }

    @Test
    public void viewNextValidIntTest() throws Exception {

        Field field = ViewCommand.class.getDeclaredField("numberOfDays");
        field.setAccessible(true);

        System.out.println(Integer.valueOf("10"));

        ViewCommand viewCommand =  (ViewCommand) ViewCommandParser.parse("next/10");

        assertEquals(field.get(viewCommand), "10");
    }

    @Test
    public void viewFormatterTest() throws Exception {

        String[] parameters =  ViewCommandParser.formatter("next/10");

        assertEquals(parameters[0], "next");
        assertEquals(parameters[1], "10");
    }
}

@@ -405,16 +405,67 @@
 Command;
+%0Aimport seedu.address.logic.commands.ViewOnCommand;
 %0A%0Apublic
@@ -1172,60 +1172,8 @@
 );%0A%0A
-        System.out.println(Integer.valueOf(%2210%22));%0A%0A
     
@@ -1305,32 +1305,1236 @@
 , %2210%22);%0A    %7D%0A%0A
+    @Test%0A    public void viewNextInvalidIntTest() throws Exception %7B%0A%0A        Field field = IncorrectCommand.class.getDeclaredField(%22feedbackToUser%22);%0A        field.setAccessible(true);%0A%0A        IncorrectCommand incorrectCommand =  (IncorrectCommand) ViewCommandParser.parse(%22next/abc%22);%0A%0A        assertEquals(field.get(incorrectCommand), String.format(%0A                MESSAGE_INVALID_COMMAND_FORMAT, ViewCommand.MESSAGE_USAGE));%0A    %7D%0A%0A    @Test%0A    public void viewOnValidIntTest() throws Exception %7B%0A%0A        Field field = ViewOnCommand.class.getDeclaredField(%22numberOfDays%22);%0A        field.setAccessible(true);%0A%0A        ViewOnCommand viewOnCommand =  (ViewOnCommand) ViewCommandParser.parse(%22on/10%22);%0A%0A        assertEquals(field.get(viewOnCommand), %2210%22);%0A    %7D%0A%0A    @Test%0A    public void viewOnInvalidIntTest() throws Exception %7B%0A%0A        Field field = IncorrectCommand.class.getDeclaredField(%22feedbackToUser%22);%0A        field.setAccessible(true);%0A%0A        IncorrectCommand incorrectCommand =  (IncorrectCommand) ViewCommandParser.parse(%22on/abc%22);%0A%0A        assertEquals(field.get(incorrectCommand), String.format(%0A                MESSAGE_INVALID_COMMAND_FORMAT, ViewCommand.MESSAGE_USAGE));%0A    %7D%0A%0A
     @Test%0A    pu

Update ViewCommandParserTest