From bca09032f9a94f9447262d03509ccb9464995c5f Mon Sep 17 00:00:00 2001 From: "jeremy.mouyon" Date: Tue, 7 May 2024 19:12:58 +0200 Subject: [PATCH] fix --- Qwirkle/QwirkleConsoleApp/Program.cs | 27 ++++++++++++++++++++++++++- Qwirkle/TestBase/TestBoard.cs | 17 +++-------------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/Qwirkle/QwirkleConsoleApp/Program.cs b/Qwirkle/QwirkleConsoleApp/Program.cs index ef1a41e..f96e508 100644 --- a/Qwirkle/QwirkleConsoleApp/Program.cs +++ b/Qwirkle/QwirkleConsoleApp/Program.cs @@ -120,6 +120,8 @@ static void MenuSwitch(Game game) while (enter != 3) { + ShowBoard(game); + ShowTiles(game); WriteLine("\n --------------------- CHOICES ------------------------"); @@ -145,6 +147,29 @@ static void MenuSwitch(Game game) } } +static void ShowBoard(Game game) +{ + Board board = game.GetBoard(); + List cells = board.GetCells(); + + for(int i=0; i cells = new List(); - - for (int a = 0; a<12; a++) - { - for (int b = 0; b<12; b++) - { - Cell localcell = new(a, b); - cells.Add(localcell); - } - } - - Assert.Equal(cells, board.GetCells()); + Assert.Equal((12 * 12), board.GetCells().Count()); } [Fact] @@ -93,7 +82,7 @@ public class TestBoard } ReadOnlyCollection readCells = cells.AsReadOnly(); - Assert.Equal(readCells, board.GetReadCells()); + Assert.Equal(readCells.Count(), board.GetReadCells().Count()); }