Exemplo n.º 1
0
        public void TestHostSpectatorLeftCalledOnDisconnection()
        {
            IHost host  = CreateHost();
            int   count = 0;

            host.HostSpectatorLeft += (spectator1, reason) => count++;
            host.RegisterSpectator(new RaiseExceptionTetriNETCallback(), _clientVersion, "spectator1");

            ISpectator spectator = host.SpectatorManager["spectator1"];

            spectator.OnGamePaused(); // -> raise an exception -> disconnecting spectator

            Assert.AreEqual(count, 1);
        }