public void WhenCoordinateIsWithinCoordinateRange_ReturnTrue() { var coords1 = TestMocksFactory.GetCellCoordinates(0, 0); var coords2 = TestMocksFactory.GetCellCoordinates(2, 0); var range = 2; var isWithinRange = coords1.AreCoordinatesInRange(coords2, range); Assert.IsTrue(isWithinRange); }
public void WhenCoordinateIsNotWithinCoordinateRange_ReturnFalse() { var coords1 = TestMocksFactory.GetCellCoordinates(3, 3); var coords2 = TestMocksFactory.GetCellCoordinates(2, 2); var range = 1; var isWithinRange = coords1.AreCoordinatesInRange(coords2, range); Assert.IsFalse(isWithinRange); }
public void WhenAnUnitIsOnACell_AndAskingIfTheCellIsFree_ReturnFalse() { var grid = TestMocksFactory.GetMockGrid(); var unitSpawnCell = TestMocksFactory.GetMockCell( 0, TestMocksFactory.GetCellCoordinates(0, 0), new int[0] ); var unitController = TestMocksFactory.GetMockCharacterController(unitSpawnCell, grid); grid.AddCharacter(unitController); var isCellFree = grid.IsCellFree(unitController.GetCurrentCellId()); Assert.IsFalse(isCellFree); }