Ejemplo n.º 1
0
        //tear down: (called from case)
        protected override void SubClassDispose()
        {
            if (_userId2 != -1)
            {
                List <int> user2Games = UserBridge.GetUsersGameRooms(_userId2);
                foreach (int roomId in user2Games)
                {
                    //UserBridge.RemoveUserFromRoom(_userId2, roomId);
                    CleanUp(roomId);
                }

                UserBridge.DeleteUser(_userId2);
            }
            _userId2 = -1;

            if (UserId != -1)
            {
                List <int> user1Games = UserBridge.GetUsersGameRooms(UserId);
                foreach (int roomId in user1Games)
                {
                    //UserBridge.RemoveUserFromRoom(_userId2, roomId);
                    CleanUp(roomId);
                }

                UserBridge.DeleteUser(UserId);
            }
            UserId = -1;
        }
Ejemplo n.º 2
0
        public void UserAddToRoomAsPlayerAllMoneyTestGood()
        {
            int roomId = CreateGameWith3Users();

            Assert.True(GameBridge.IsUserInRoom(UserId, roomId));
            Assert.Contains(roomId, UserBridge.GetUsersGameRooms(UserId));
            CleanUp(roomId);
        }
Ejemplo n.º 3
0
        private bool DeleteUser(int id)
        {
            if (id != -1)
            {
                List <int> user2Games = UserBridge.GetUsersGameRooms(id);
                foreach (var roomId in user2Games)
                {
                    UserBridge.RemoveUserFromRoom(id, roomId);
                }

                UserBridge.DeleteUser(id);
                return(true);
            }
            return(false);
        }