Beispiel #1
0
        public void GamePrefLessMinimalBet()
        {
            object objUser = db.getUserByName("test0");

            Assert.IsInstanceOfType(objUser, typeof(SystemUser));
            SystemUser user = (SystemUser)objUser;

            object objGame = sl.createGame(user.id, "Pot_Limit", 1000, 100, 0, 120, 4, 8, true, false);

            Assert.IsInstanceOfType(objGame, typeof(TexasHoldemGame));
            TexasHoldemGame game = (TexasHoldemGame)objGame;

            Assert.IsTrue(game.gamePreferences.isContain(new MustPreferences(new StartingAmountChipsCedPref(0, null), true)));
            StartingAmountChipsCedPref startingChipsPref = (StartingAmountChipsCedPref)game.gamePreferences.getOptionalPref(new StartingAmountChipsCedPref(0, null));

            Assert.AreEqual(0, startingChipsPref.startingChipsPolicy);

            object objUser1 = db.getUserByName("test1");

            Assert.IsInstanceOfType(objUser, typeof(SystemUser));
            SystemUser user1 = (SystemUser)objUser;

            ReturnMessage m = null;

            game.joinGame(user1, 3);
            for (int i = 0; i < game.players.Length; i++)
            {
                if (game.players[i] != null && game.players[i].systemUserID == user1.id)
                {
                    m = game.bet(game.players[i], 100);
                }
            }

            Assert.IsFalse(m.success);
        }
Beispiel #2
0
        public void TestCreateGameWithPotLimitFail()
        {
            object objUser = db.getUserByName("test0");

            Assert.IsInstanceOfType(objUser, typeof(SystemUser));
            SystemUser user = (SystemUser)objUser;

            object objGame = sl.createGame(user.id, "Pot_Limit", 1000, 100, 15000, 120, 4, 8, true, false);

            Assert.IsInstanceOfType(objGame, typeof(TexasHoldemGame));
            TexasHoldemGame game = (TexasHoldemGame)objGame;

            Assert.IsTrue(game.gamePreferences.isContain(new MustPreferences(new GamePolicyDecPref(GameTypePolicy.Pot_Limit, 1000, null), true)));

            object objUser1 = db.getUserByName("test1");

            Assert.IsInstanceOfType(objUser, typeof(SystemUser));
            SystemUser user1 = (SystemUser)objUser;

            ReturnMessage m = null;

            game.joinGame(user1, 3);
            game.pot = 1000;
            for (int i = 0; i < game.players.Length; i++)
            {
                if (game.players[i] != null && game.players[i].systemUserID == user1.id)
                {
                    m = game.bet(game.players[i], 1500);
                    break;
                }
            }
            Assert.IsFalse(m.success);
        }