package com.fundynamic.d2tm.game.map;

import com.fundynamic.d2tm.game.terrain.Terrain;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;

import static org.mockito.Matchers.any;

public class CellTest {

    @Test (expected = IllegalArgumentException.class)
    public void constructorThrowsIllegalArgumentExceptionWhenArgumentIsNull() {
        new Cell(null);
    }

    @Test
    public void isSameTerrainReturnsTrueWhenTerrainEquals() {
        Terrain terrain = Mockito.mock(Terrain.class);
        Mockito.when(terrain.isSame(any(Terrain.class))).thenReturn(true);

        final Cell cell = new Cell(terrain);
        Assert.assertTrue(cell.isSameTerrain(Mockito.mock(Terrain.class)));
    }

//
//	@Test
//	public void isSameTerrainReturnsFalseWhenClassNameDoesNotEqual() {
//		final Cell cell = new Cell(new TestableSandTerrain());
//		Assert.assertTrue(cell.isSameTerrain(new TestableSandTerrain()));
//	}


}
@@ -132,77 +132,8 @@
 est;
-%0Aimport org.mockito.Mockito;%0A%0Aimport static org.mockito.Matchers.any;
 %0A%0Apu
@@ -324,554 +324,5 @@
  %7D%0A%0A
-    @Test%0A    public void isSameTerrainReturnsTrueWhenTerrainEquals() %7B%0A        Terrain terrain = Mockito.mock(Terrain.class);%0A        Mockito.when(terrain.isSame(any(Terrain.class))).thenReturn(true);%0A%0A        final Cell cell = new Cell(terrain);%0A        Assert.assertTrue(cell.isSameTerrain(Mockito.mock(Terrain.class)));%0A    %7D%0A%0A//%0A//%09@Test%0A//%09public void isSameTerrainReturnsFalseWhenClassNameDoesNotEqual() %7B%0A//%09%09final Cell cell = new Cell(new TestableSandTerrain());%0A//%09%09Assert.assertTrue(cell.isSameTerrain(new TestableSandTerrain()));%0A//%09%7D%0A%0A%0A
 %7D

remove obselete tests