Merge branch 'master' of https://codefirst.iut.uca.fr/git/jeremy.mouyon/sae201_qwirkle
commit
a72794acfe
@ -0,0 +1,37 @@
|
|||||||
|
using QwirkleClassLibrary;
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Test_AddTileInBag()
|
||||||
|
{
|
||||||
|
Tile t = null;
|
||||||
|
Tile tok = new(Shape.Club, Color.Green);
|
||||||
|
TileBag bag = new TileBag(2);
|
||||||
|
|
||||||
|
if (bag.AddTileInBag(t) == false)
|
||||||
|
{
|
||||||
|
Assert.True(bag.AddTileInBag(tok));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in new issue