delete of uselesse conditoin and remove in test
continuous-integration/drone/push Build is passing Details

test_old_branch
Jérémy Mouyon 11 months ago
parent 44739a89f1
commit 377c81c48c

@ -36,10 +36,6 @@ namespace QwirkleClassLibrary.Tiles
public bool AddTileInBag(Tile tile) public bool AddTileInBag(Tile tile)
{ {
if (tile == null)
{
return false;
}
tiles.Add(tile); tiles.Add(tile);
return true; return true;
} }

@ -16,29 +16,22 @@ public class TestTileBag
return; return;
} }
TileBag bag = new TileBag(nbset); TileBag bag = new TileBag(nbset);
Assert.Equal(bag.TilesBag.Count, nbset * 36); Assert.Equal(bag.TilesBag.Count, nbset*36);
} }
[Theory] [Fact]
[InlineData(true)] public void Test_AddTileInBag()
[InlineData(false)]
public void Test_AddTileInBag(bool select)
{ {
Tile? t = null; Tile? t = null;
Tile tok = new(Shape.Club, Color.Green); Tile tok = new(Shape.Club, Color.Green);
TileBag bag = new TileBag(2); TileBag bag = new TileBag(2);
if (select) if (t != null && bag.AddTileInBag(t) == false)
{ {
Assert.True(bag.AddTileInBag(tok)); Assert.True(bag.AddTileInBag(tok));
return;
} }
Assert.False(bag.AddTileInBag(t));
return;
} }
[Fact] [Fact]

Loading…
Cancel
Save