示例#1
0
        public void ChangeConnectionForPlayer_NonexistentPlayerPassed_ThrowError()
        {
            var lobby  = new LobbyClient();
            var player = new PlayerClient("player");

            lobby.AddPlayer(player);

            Assert.Throws <ArgumentException>(() => lobby.ChangeConnectionForPlayer("nonexistent", true));
        }
示例#2
0
        public void ChangeConnectionForPlayer_ShouldWork(bool newState)
        {
            var lobby  = new LobbyClient();
            var player = new PlayerClient("player");

            lobby.AddPlayer(player);

            lobby.ChangeConnectionForPlayer("player", newState);

            Assert.Equal(newState, player.IsConnected);
        }