Esempio n. 1
0
        public void GetHostPlayer_NoHostShouldReturnNull()
        {
            var lobby   = new LobbyClient();
            var player1 = new PlayerClient("player1");

            lobby.AddPlayer(player1);

            var actualHost = lobby.GetHostPlayer();

            Assert.Null(actualHost);
        }
Esempio n. 2
0
        public void GetHostPlayer_ShouldWork()
        {
            var lobby   = new LobbyClient();
            var player1 = new PlayerClient("player1");
            var player2 = new PlayerClient("player2");

            lobby.AddPlayer(player1);
            lobby.AddPlayer(player2);
            player1.IsConnected = true;
            player2.IsConnected = true;

            lobby.SetHostPlayer("player1");

            var actualHost = lobby.GetHostPlayer();

            Assert.Equal(player1, actualHost);
        }