예제 #1
0
        public void CallTestSad()
        {
            //RestartSystem();
            var roomId = CreateGameWith3Users();
            var money  = UserBridge.GetUserMoney(UserId);

            Assert.False(GameBridge.DoAction(UserId, CommunicationMessage.ActionType.Bet, money + 1, roomId));
            CleanUp(roomId);
        }
예제 #2
0
        public void UserAddUserMoneyTestBad()
        {
            ////RestartSystem();
            UserId = SetupUser1();
            const int amountToChange = -10000;
            int       prevAmount     = UserBridge.GetUserMoney(UserId);

            Assert.False(UserBridge.AddUserMoney(UserId, amountToChange));
            Assert.True(prevAmount == UserBridge.GetUserMoney(UserId));
            UserBridge.DeleteUser(UserId);
        }
예제 #3
0
        public void UserAddUserMoneyTestGood()
        {
            UserId = SetupUser1();

            const int amountToChange = 100;
            int       prevAmount     = UserBridge.GetUserMoney(UserId);

            Assert.True(UserBridge.AddUserMoney(UserId, amountToChange));
            Assert.True(prevAmount == UserBridge.GetUserMoney(UserId) - amountToChange);
            UserBridge.DeleteUser(UserId);
        }
예제 #4
0
        private int[] CreateUsersWithCashGain(int numOfUsers)
        {
            int[]  userIds = new int[numOfUsers];
            int    maxInt  = Int32.MaxValue;
            Random rand    = new Random();

            //setup users
            for (int i = 0; i < userIds.Length; i++)
            {
                int id = rand.Next();
                userIds[i] = id;
                RegisterUserToDB(id);
                int currMoney = UserBridge.GetUserMoney(id);
                UserBridge.ChangeUserHighestCashGain(id, maxInt - currMoney);
                maxInt--;
            }
            return(userIds);
        }