mirror of
				https://github.com/inf112-v20/Fiasko.git
				synced 2025-11-04 11:43:44 +01:00 
			
		
		
		
	Adds testing to Tile class
This commit is contained in:
		
							
								
								
									
										41
									
								
								src/test/java/inf112/fiasko/roborally/TileTest.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								src/test/java/inf112/fiasko/roborally/TileTest.java
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,41 @@
 | 
			
		||||
package inf112.fiasko.roborally;
 | 
			
		||||
 | 
			
		||||
import inf112.fiasko.roborally.element_properties.Direction;
 | 
			
		||||
import inf112.fiasko.roborally.element_properties.TileType;
 | 
			
		||||
import inf112.fiasko.roborally.objects.Tile;
 | 
			
		||||
import org.junit.Before;
 | 
			
		||||
import org.junit.Test;
 | 
			
		||||
 | 
			
		||||
import static org.junit.Assert.*;
 | 
			
		||||
 | 
			
		||||
public class TileTest {
 | 
			
		||||
    private Tile tile;
 | 
			
		||||
    private Tile tile2;
 | 
			
		||||
 | 
			
		||||
    @Before
 | 
			
		||||
    public void setUp() {
 | 
			
		||||
        tile = new Tile(TileType.HOLE, Direction.NORTH);
 | 
			
		||||
        tile2 = new Tile(TileType.COGWHEEL_RIGHT, Direction.SOUTH);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    public void getTileTypeFromTile() {
 | 
			
		||||
        assertEquals(TileType.HOLE, tile.getTileType());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    public void getTileTypeFromTile2() {
 | 
			
		||||
        assertEquals(TileType.COGWHEEL_RIGHT, tile2.getTileType());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    public void getDirectionFromTile() {
 | 
			
		||||
        assertEquals(Direction.NORTH, tile.getDirection());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    public void getDirectionFromTile2() {
 | 
			
		||||
        assertEquals(Direction.SOUTH, tile2.getDirection());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user