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<ArgumentException>(() => new TileBag(nbset));
            return;
        }
        TileBag bag = new TileBag(nbset);
        Assert.Equal(bag.TilesBag!.Count, nbset * 36);
    }


    [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;


    }


}

