Merge remote-tracking branch 'origin/master'
continuous-integration/drone/push Build is passing Details

test_old_branch
Jules LASCRET 11 months ago
commit 8e4bc58ddb

@ -1,4 +1,5 @@
using QwirkleClassLibrary.Boards;
using QwirkleClassLibrary.Players;
using QwirkleClassLibrary.Tiles;
using System.Collections.ObjectModel;
namespace TestBase;
@ -105,7 +106,23 @@ public class TestBoard
return;
}
[Fact]
public void Test_EventBoard()
{
Board board = new(12, 12);
Tile tile = new(Shape.Club, Color.Red);
bool eventRaised = false;
board.PropertyChanged += (sender, args) =>
{
eventRaised = true;
};
board.AddTileInCell(1, 1, tile);
Assert.True(eventRaised);
}

@ -66,6 +66,24 @@ public class TestCell
Assert.True(c.IsFree);
}
[Fact]
public void Test_EventCell()
{
Cell c = new(1,1);
Tile tile = new(Shape.Club, Color.Red);
bool eventRaised = false;
c.PropertyChanged += (sender, args) =>
{
eventRaised = true;
};
c.SetTile(tile);
Assert.True(eventRaised);
}

@ -38,7 +38,7 @@ public class TestGame
[Theory]
[InlineData(false, null)]
[InlineData(true, "test")]
public void Test_GameAddPlayerIngame2(bool result, string p)
public void Test_GameAddPlayerIngame2(bool result, string? p)
{
Game game = new Game();
List<string> players = new List<string>();

@ -18,7 +18,25 @@ public class TestPlayers
Assert.Equal(playertag, player.NameTag);
}
[Fact]
[Fact]
public void Test_EventPlayer()
{
Player player = new Player("jeje");
Tile tile = new(Shape.Club, Color.Red);
bool eventRaised = false;
player.PropertyChanged += (sender, args) =>
{
eventRaised = true;
};
player.AddTileToPlayer(tile);
Assert.True(eventRaised);
}
[Fact]
public void Test_AddTilePlayer()
{

Loading…
Cancel
Save