コード例 #1
0
 public void test_executeCommands_RoverStateIsNorthandcommandIsRRL_roverStateIsSouth() {
   Position.setLimits(5, 5);
   Position position = new Position(1, 2);
   Rover rover = new Rover(position, 'N');
   CommandFactory cf = CommandFactory.init();
   cf.executeCommands("RRL", rover);
   assertSame('E', rover.getState());
 }
コード例 #2
0
 public void test_executeCommand_commandIsR_TurnLeft() {
   Position.setLimits(5, 5);
   Position position = new Position(1, 2);
   Rover rover = new Rover(position, 'N');
   CommandFactory cf = CommandFactory.init();
   cf.executeCommand('L', rover);
   assertSame('W', rover.getState());
 }