|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
using QwirkleClassLibrary.Boards;
|
|
|
|
|
using QwirkleClassLibrary.Games;
|
|
|
|
|
using QwirkleClassLibrary.Players;
|
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
namespace TestBase;
|
|
|
|
|
|
|
|
|
|
public class TestGame
|
|
|
|
@ -158,6 +159,47 @@ public class TestGame
|
|
|
|
|
Assert.Equal(game.PlayerList[0].Tiles[0], game.TileOfPlayerWithPos(0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Theory]
|
|
|
|
|
[InlineData(true)]
|
|
|
|
|
[InlineData(false)]
|
|
|
|
|
public void Test_SetFirstPlayer(bool except)
|
|
|
|
|
{
|
|
|
|
|
Game game = new Game();
|
|
|
|
|
game.AddPlayerInGame("Test1");
|
|
|
|
|
game.AddPlayerInGame("Test2");
|
|
|
|
|
|
|
|
|
|
if (except)
|
|
|
|
|
{
|
|
|
|
|
game.StartGame();
|
|
|
|
|
Assert.IsType<string>(game.SetFirstPlayer());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Assert.Throws<ArgumentException>(() => game.SetFirstPlayer());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Theory]
|
|
|
|
|
[InlineData(true)]
|
|
|
|
|
[InlineData(false)]
|
|
|
|
|
public void Test_Setnextplayer(bool except)
|
|
|
|
|
{
|
|
|
|
|
Game game = new Game();
|
|
|
|
|
game.AddPlayerInGame("Test1");
|
|
|
|
|
game.AddPlayerInGame("Test2");
|
|
|
|
|
|
|
|
|
|
if (except)
|
|
|
|
|
{
|
|
|
|
|
game.StartGame();
|
|
|
|
|
game.SetNextPlayer();
|
|
|
|
|
Assert.IsType<string>(game.SetNextPlayer());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
game.StartGame();
|
|
|
|
|
Assert.Equal(game.SetNextPlayer(), game.SetFirstPlayer());
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|