using QwirkleClassLibrary.Tiles; namespace TestBase; public class TestTileBag { [Theory] [InlineData(false, 5)] [InlineData(false, -5)] [InlineData(true, 2)] public void Test_TileBagConstructor(bool isValid, int nbset) { if (!isValid) { Assert.Throws(() => new TileBag(nbset)); return; } TileBag bag = new TileBag(nbset); Assert.Equal(bag.TilesBag.Count, nbset * 36); } [Fact] public void Test_AddTileInBag() { Tile tok = new(Shape.Club, Color.Green); TileBag bag = new TileBag(2); Assert.True(bag.AddTileInBag(tok)); } [Theory] [InlineData(true)] [InlineData(false)] public void Test_RemoveTileInBag(bool except) { TileBag bag = new TileBag(1); if (except) { Assert.True(bag.RemoveTileInBag(bag.TilesBag[1])); return; } Tile tile = bag.TilesBag[0]; bag.RemoveTileInBag(tile); Assert.False(bag.RemoveTileInBag(tile)); return; } }