package parser;

import com.thoughtworks.rover.parser.StringCommandParser;
import com.thoughtworks.rover.commands.ICommand;
import com.thoughtworks.rover.commands.MoveCommand;
import com.thoughtworks.rover.commands.RotateLeftCommand;
import com.thoughtworks.rover.commands.RotateRightCommand;
import org.junit.Assert;
import org.junit.Test;

import java.util.List;

public class StringCommandParserTest {

    @Test
    public void testThatStringLMapsToRotateLeftCommand() {
        //Given
        String commandString = "L";
        StringCommandParser parser = new StringCommandParser(commandString);

        //When
        List<ICommand> commands = parser.parseToCommands();

        //Then
        Assert.assertTrue(commands.get(0) instanceof RotateLeftCommand);
    }

    @Test
    public void testThatStringRMapsToRotateRightCommand() {
        //Given
        String commandString = "R";
        StringCommandParser parser = new StringCommandParser(commandString);

        //When
        List<ICommand> commands = parser.parseToCommands();

        //Then
        Assert.assertTrue(commands.get(0) instanceof RotateRightCommand);
    }

    @Test
    public void testThatStringMMapsToMoveCommand() {
        //Given
        String commandString = "M";
        StringCommandParser parser = new StringCommandParser(commandString);

        //When
        List<ICommand> commands = parser.parseToCommands();

        //Then
        Assert.assertTrue(commands.get(0) instanceof MoveCommand);
    }

}

@@ -520,16 +520,108 @@
  = %22L%22;%0A
+        // chirag: you can inline commandString it is not adding any more meaning by itself%0A
         
@@ -697,32 +697,90 @@
 %0A        //When%0A
+        // parseToCommands() can be called toCommands(). %0A
         List%3CICo
@@ -904,32 +904,168 @@
 teLeftCommand);%0A
+        //Chirag: useful to assert that the size of the commands list is 1, %0A        // needs to be done only in one testcase not all 3%0A
     %7D%0A%0A    @Test

Update StringCommandParserTest.java