|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
namespace Tests;
|
|
|
|
|
using Models.Game;
|
|
|
|
|
using Models.Rules;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
|
|
|
|
public class RulesTests
|
|
|
|
|
{
|
|
|
|
@ -201,7 +202,7 @@ public class RulesTests
|
|
|
|
|
Assert.Empty(map.Zones);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void IsZoneValidAndAddToZones_AddsToExistingZone_WhenAdjacentCellWithSameValueExists()
|
|
|
|
|
{
|
|
|
|
@ -211,11 +212,13 @@ public class RulesTests
|
|
|
|
|
cell.Value = 1;
|
|
|
|
|
Cell adjacentCell = new Cell(0, 1);
|
|
|
|
|
adjacentCell.Value = 1;
|
|
|
|
|
Cell finalCell = new Cell(0, 2);
|
|
|
|
|
|
|
|
|
|
map.Boards.ToList().Add(cell);
|
|
|
|
|
map.Boards.ToList().Add(adjacentCell);
|
|
|
|
|
map.Zones.Add(new List<Cell> { adjacentCell });
|
|
|
|
|
rules.NewZoneIsCreated(cell, adjacentCell, map);
|
|
|
|
|
|
|
|
|
|
rules.IsZoneValidAndAddToZones(cell, map);
|
|
|
|
|
rules.IsZoneValidAndAddToZones(finalCell, map);
|
|
|
|
|
Assert.Contains(cell, map.Zones[0]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -229,11 +232,12 @@ public class RulesTests
|
|
|
|
|
Cell adjacentCell = new Cell(0, 1);
|
|
|
|
|
adjacentCell.Value = 1;
|
|
|
|
|
|
|
|
|
|
map.Boards.ToList().Add(adjacentCell);
|
|
|
|
|
map.Boards[0].Value = 1;
|
|
|
|
|
map.Boards[1].Value = 1;
|
|
|
|
|
|
|
|
|
|
rules.IsZoneValidAndAddToZones(cell, map);
|
|
|
|
|
Assert.Contains(cell, map.Zones[0]);
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void IsValueInZones_ReturnsFalse_WhenCellIsNull()
|
|
|
|
|