/**
*
*/
package br.com.ema.maze.agents;
import java.util.List;
import static junit.framework.Assert.*;
import org.junit.Test;
import br.com.ema.maze.components.MazeSpace;
/**
* @author Emanuel Cruz Rodrigues -> emanuelcruzrodrigues@gmail.com
*
*/
public class MazeCharacterTest {
@Test
public void test_Character_History_Empty(){
MazeCharacter character = new MazeCharacter(250);
List<MazeSpace> history = character.getHistory();
assertEquals(0, history.size());
}
@Test
public void test_Character_History(){
MazeSpace space00 = new MazeSpace(0,0);
MazeSpace space10 = new MazeSpace(1,0);
MazeSpace space11 = new MazeSpace(1,1);
MazeSpace space21 = new MazeSpace(2,1);
MazeCharacter character = new MazeCharacter(250);
character.setActualSpace(space00);
character.setActualSpace(space10);
character.setActualSpace(space11);
character.setActualSpace(space21);
List<MazeSpace> history = character.getHistory();
assertEquals(4, history.size());
assertEquals(0, history.indexOf(space00));
assertEquals(1, history.indexOf(space10));
assertEquals(2, history.indexOf(space11));
assertEquals(3, history.indexOf(space21));
}
}