diff --git a/Qwirkle/QwirkleClassLibrary/Games/Game.cs b/Qwirkle/QwirkleClassLibrary/Games/Game.cs index 2b1568e..739efb5 100644 --- a/Qwirkle/QwirkleClassLibrary/Games/Game.cs +++ b/Qwirkle/QwirkleClassLibrary/Games/Game.cs @@ -587,7 +587,7 @@ namespace QwirkleClassLibrary.Games /// /// /// - private static bool CheckWrongCompletedLines(int x, int y, int dx, int dy, Board b, ref List checkdoubles) + public static bool CheckWrongCompletedLines(int x, int y, int dx, int dy, Board b, ref List checkdoubles) { int nbTiles = 1; diff --git a/Qwirkle/TestBase/TestGame.cs b/Qwirkle/TestBase/TestGame.cs index ee641ba..5dd518e 100644 --- a/Qwirkle/TestBase/TestGame.cs +++ b/Qwirkle/TestBase/TestGame.cs @@ -398,6 +398,30 @@ public class TestGame Assert.False(Game.CheckTileInCompletedLines(t1, ref nbTiles, ref checkdoubles)); } + [Fact] + public void Test_CheckWrongCompletedLines() + { + // Arrange + var game = new Game(); + var board = new Board(17, 14); + var checkDoubles = new List(); + int x = 4, y = 1, dx = 1, dy = 0; + + // Add tiles to the board + board.AddTileInCell(1, 1, new Tile(Shape.Club, Color.Red)); + board.AddTileInCell(2, 1, new Tile(Shape.Square, Color.Red)); + board.AddTileInCell(3, 1, new Tile(Shape.Star, Color.Red)); + board.AddTileInCell(5, 1, new Tile(Shape.Round, Color.Red)); + board.AddTileInCell(6, 1, new Tile(Shape.Shuriken, Color.Red)); + board.AddTileInCell(7, 1, new Tile(Shape.Rhombus, Color.Red)); + + // Act + bool result = Game.CheckWrongCompletedLines(x, y, dx, dy, board, ref checkDoubles); + + // Assert + Assert.False(result); + } + [Theory] [InlineData(3, 1, 4, 1, 5, 1, 5)] [InlineData(2, 2, 3, 2, 4, 2, 5)]