Exemplo n.º 1
0
 public void Player_Constructor()
 {
     var player = new Player
     {
         Name = "John Doe",
         DisplayName = "Johnny",
         NickName = "Connor"
     };
     Assert.Equal("John Doe", player.Name);
     Assert.Equal("Johnny", player.DisplayName);
     Assert.Equal("Connor", player.NickName);
     Assert.Equal(player.Name, player.ToString());
 }
Exemplo n.º 2
0
 public void AddPlayer(Player player)
 {
     if (NumberOfPlayers < Capacity)
     {
         Players.Add(player);
         GetEmptySeat().Player = player;
     }
     else
     {
         throw new InvalidOperationException("The table is full. Cannot add a new player.");
     }
 }