Пример #1
0
        public void ServerSideFactoryRemovesPlayerFromPlayerListWhenDeletingClient()
        {
            ServerSideClientFactory serverClientFactory = new ServerSideClientFactory(clientFactoryDelegate, playerList);
            Client client = serverClientFactory.MakeNewClient(300);

            serverClientFactory.DeleteClient(client);

            Assert.AreEqual(0, playerList.Players.Count);
        }
Пример #2
0
        public void ServerSideFactoryAddsPlayersToPlayerList()
        {
            ServerSideClientFactory serverClientFactory = new ServerSideClientFactory(clientFactoryDelegate, playerList);

            Client newClient = serverClientFactory.MakeNewClient(300);

            Assert.IsTrue(playerList.Players.Contains(newClient.Player));
            Assert.AreEqual(300, newClient.ID);
        }
Пример #3
0
        public void ServerSideFactoryCantCreateLocalClient()
        {
            ServerSideClientFactory factory = new ServerSideClientFactory(null, new PlayerList());

            factory.GetLocalClient();
        }