Beispiel #1
0
        public void AddPlayerWorksCorrectly()
        {
            ServerPlayerModel serverPlayer = TestEnvironment.GetTestPlayerModel();
            PlayerService playerService = new PlayerService();

            playerService.AddPlayer(serverPlayer.SignalRId, serverPlayer.UserId);

            ServerPlayerModel result = playerService.GetPlayer(serverPlayer.SignalRId);

            Assert.IsTrue((serverPlayer.SignalRId == result.SignalRId && serverPlayer.UserId == result.UserId));

            playerService.RemovePlayer(serverPlayer.SignalRId);

            TestEnvironment.DeleteTestUser();
        }
Beispiel #2
0
        public void RemovePlayerWorksCorrectly()
        {
            ServerPlayerModel serverPlayer = TestEnvironment.GetTestPlayerModel();
            PlayerService playerService = new PlayerService();

            playerService.AddPlayer(serverPlayer.SignalRId, serverPlayer.UserId);

            playerService.RemovePlayer(serverPlayer.SignalRId);

            Assert.IsNull(playerService.GetPlayer(serverPlayer.SignalRId));
        }