Package br.com.ema.maze.agents

Source Code of br.com.ema.maze.agents.MazeCharacterTest

/**
*
*/
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));
  }
 

}
TOP

Related Classes of br.com.ema.maze.agents.MazeCharacterTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.