diff --git a/source/Trek-12/Stub/Stub.cs b/source/Trek-12/Stub/Stub.cs index a706aa4..5c360bb 100644 --- a/source/Trek-12/Stub/Stub.cs +++ b/source/Trek-12/Stub/Stub.cs @@ -25,8 +25,6 @@ namespace Stub public void LoadPlayer() { - - listplayer.Add(new Player()); listplayer.Add(new Player("Lucas", "profile.jpg")); listplayer.Add(new Player("relavergne", "profile.jpg")); listplayer.Add(new Player("reneveu", "profile.jpg")); diff --git a/source/Trek-12/Tests/RulesTests.cs b/source/Trek-12/Tests/RulesTests.cs index fb9ccde..9566e8a 100644 --- a/source/Trek-12/Tests/RulesTests.cs +++ b/source/Trek-12/Tests/RulesTests.cs @@ -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 { adjacentCell }); - - rules.IsZoneValidAndAddToZones(cell, map); + rules.NewZoneIsCreated(cell, adjacentCell, map); + + rules.IsZoneValidAndAddToZones(finalCell, map); Assert.Contains(cell, map.Zones[0]); } @@ -228,13 +231,14 @@ public class RulesTests cell.Value = 1; 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() {