You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sae201_qwirkle/Qwirkle/TestBase/TestTileBag.cs

49 lines
919 B

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