sonar good, sonar is good!
continuous-integration/drone/push Build is passing Details

test_old_branch
Jérémy Mouyon 11 months ago
parent 1f227fd53b
commit f527eb1c2e

@ -24,32 +24,19 @@ namespace QwirkleClassLibrary.Tiles
throw new ArgumentException(nbSet.ToString()); throw new ArgumentException(nbSet.ToString());
} }
// for (int i = 0; i < nbSet; i++) for (int i = 0; i < nbSet; i++)
// { {
// foreach (Shape s in Enum.GetValues(typeof(Shape))) foreach (Shape s in Enum.GetValues(typeof(Shape)))
// { {
// foreach (Color c in Enum.GetValues(typeof(Color))) foreach (Color c in Enum.GetValues(typeof(Color)))
// { {
// Tile t = new Tile(s, c); Tile t = new Tile(s, c);
// tiles.Add(t); tiles.Add(t);
// } }
// } }
// } }
tiles.Add(new Tile(Shape.Club, Color.Blue));
tiles.Add(new Tile(Shape.Club, Color.Green));
tiles.Add(new Tile(Shape.Club, Color.Orange));
tiles.Add(new Tile(Shape.Club, Color.Purple));
tiles.Add(new Tile(Shape.Club, Color.Red));
tiles.Add(new Tile(Shape.Club, Color.Yellow));
tiles.Add(new Tile(Shape.Round, Color.Blue));
tiles.Add(new Tile(Shape.Round, Color.Green));
tiles.Add(new Tile(Shape.Round, Color.Orange));
tiles.Add(new Tile(Shape.Round, Color.Purple));
tiles.Add(new Tile(Shape.Round, Color.Red));
tiles.Add(new Tile(Shape.Round, Color.Yellow));
TilesBag = tiles.AsReadOnly(); TilesBag = tiles.AsReadOnly();
} }

@ -130,6 +130,11 @@ public class TestGame
public void Test_BoardReturn() public void Test_BoardReturn()
{ {
Game game = new Game(); Game game = new Game();
game.AddPlayerInGame("Test1");
game.AddPlayerInGame("Test2");
game.StartGame();
game.SetFirstPlayer();
Assert.IsType<Board>(game.GetBoard()); Assert.IsType<Board>(game.GetBoard());
} }
@ -137,14 +142,22 @@ public class TestGame
public void Test_EmptyCell() public void Test_EmptyCell()
{ {
Game game = new Game(); Game game = new Game();
Board b = game.GetBoard();
Cell? c = b.GetCell(1, 1);
game.AddPlayerInGame("Test1");
game.AddPlayerInGame("Test2");
game.StartGame();
game.SetFirstPlayer();
Board? b = game.GetBoard();
Cell? c = b!.GetCell(1, 1);
game.AddCellUsed(c); game.AddCellUsed(c);
game.EmptyCellUsed(); game.EmptyCellUsed();
Assert.Empty(game.CellsUsed); Assert.Equal(0, game.CellsUsed.Count);
} }
[Fact] [Fact]
@ -403,7 +416,6 @@ public class TestGame
Assert.Empty(game.PlayerList); Assert.Empty(game.PlayerList);
Assert.Null(game.GetTileBag()); Assert.Null(game.GetTileBag());
Assert.Null(game.GetBoard());
Assert.Equal(-1, game.GetPlayingPlayerPosition()); Assert.Equal(-1, game.GetPlayingPlayerPosition());
} }

Loading…
Cancel
Save