Package br.com.ema.maze.factory

Source Code of br.com.ema.maze.factory.MazeFileFactoryTest

/**
*
*/
package br.com.ema.maze.factory;

import static junit.framework.Assert.assertEquals;

import java.io.File;
import java.net.URL;

import org.junit.Before;
import org.junit.Test;

import br.com.ema.maze.components.Maze;

/**
* @author Emanuel Cruz Rodrigues -> emanuelcruzrodrigues@gmail.com
*
*/
public class MazeFileFactoryTest {
 
  private MazeFileFactory factory;
 
  @Before
  public void setUp(){
    factory = new MazeFileFactory();
  }
 
  @Test
  public void test_Build_Maze(){
    URL resource = getClass().getResource("maze_file_example.maze");
    File file = new File(resource.getFile());
    MazeFile mazeFile = new MazeFile(file);
   
    Maze maze = factory.buildMaze(mazeFile);
   
    assertEquals(30, maze.getWidth());
    assertEquals(24, maze.getHeight());
   
  }

}
TOP

Related Classes of br.com.ema.maze.factory.MazeFileFactoryTest

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.