Beispiel #1
0
        public void ListLimitGamesByPrefTestGood()
        {
            //delete all users and games
            //RestartSystem();
            SetupUser1();
            var limitGames     = GameBridge.GetGamesByGameMode(GameMode.Limit);
            int numLimitBefore = limitGames == null ? 0 : limitGames.Count;
            int roomId1        = GameBridge.CreateGameRoomWithPref(UserId, 10, false, GameMode.Limit,
                                                                   2, 8, 1, 1);

            Assert.True(roomId1 != -1);
            RegisterUser2();
            var noLimitGames     = GameBridge.GetGamesByGameMode(GameMode.NoLimit);
            int numNoLimitBefore = noLimitGames == null ? 0 : noLimitGames.Count;
            int roomId2          = GameBridge.CreateGameRoomWithPref(_userId2, 10, false, GameMode.NoLimit,
                                                                     2, 8, 1, 1);

            Assert.True(roomId2 != -1);
            limitGames = GameBridge.GetGamesByGameMode(GameMode.Limit);
            int numLimitAfter = limitGames == null ? 0 : limitGames.Count;

            noLimitGames = GameBridge.GetGamesByGameMode(GameMode.NoLimit);
            int numNoLimitAfter = noLimitGames == null ? 0 : noLimitGames.Count;

            Assert.AreEqual(numNoLimitAfter, numNoLimitBefore + 1);
            Assert.AreEqual(numLimitAfter, numLimitBefore + 1);
            CleanUp(roomId1);
            CleanUp(roomId2);
        }
Beispiel #2
0
        public void ListGamesByPrefTestBad()
        {
            //delete all users and games
            //RestartSystem();
            SetupUser1();
            var games            = GameBridge.GetGamesByGameMode(GameMode.PotLimit);
            int numOfGamesBefore = games == null ? 0 : games.Count;

            RoomId = GameBridge.CreateGameRoomWithPref(UserId, 10, false, GameMode.Limit, 2, 8, 1, 1);
            Assert.True(RoomId != -1);
            RegisterUser2();
            int roomId2 = GameBridge.CreateGameRoomWithPref(_userId2, 10, false, GameMode.NoLimit, 2, 8, 1, 1);

            Assert.True(roomId2 != -1);
            games = GameBridge.GetGamesByGameMode(GameMode.PotLimit);
            int numOfGamesAfter = games == null ? 0 : games.Count;

            Assert.AreEqual(numOfGamesBefore, numOfGamesAfter);
            CleanUp(RoomId);
            CleanUp(roomId2);
        }