public void TestGetUserInfo()
        {
            Tuple <string, string> info = _sut.GetUserInfo(_steamId);

            Assert.AreEqual("Contra 0x2F", info.Item1);
            Assert.AreEqual("https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/2a/2ad0555225c30d3d506aa9d2e51e356817ba6be9_medium.jpg", info.Item2);
        }
        public void LoadFromApi()
        {
            ulong numericValue = Convert.ToUInt64(SteamId);

            if (numericValue > 0)
            {
                BackgroundWorker bw = new BackgroundWorker();
                bw.DoWork += (sender, args) =>
                {
                    Status = "Loading user...";
                    Tuple <string, string> userInfo = _facade.GetUserInfo(numericValue);
                    Status = Status + "\r\nLoading games...";
                    List <IGame> games = _facade.GetGamesOfUser(numericValue).ToList();
                    Status = Status + string.Format("\r\n\t-> Loaded {0} games", games.Count);
                    List <IGame> gamesWithAchievements = new List <IGame>(games.Count);
                    int          i         = 0;
                    int          gameCount = games.Count;
                    foreach (IGame g in games)
                    {
                        Status = Status + string.Format("\r\nLoading achievements for '{0}' ({1})... ({2}/{3})", g.Name, g.AppId, i,
                                                        gameCount);
                        // Gets names, icons and global completion
                        try
                        {
                            g.Achievements = _facade.GetAchievements(g.AppId);
                            Status         = Status + string.Format("\r\n\t-> Found {0} achievements", g.Achievements.Count());
                            if (g.Achievements.Any())
                            {
                                gamesWithAchievements.Add(g);
                                // Sets unlock state for current user
                                Status = Status + string.Format("\r\nLoading achievement completion for '{0}' ({1})...", g.Name,
                                                                g.AppId);
                                _facade.GetAchievementCompletionStates(numericValue, g);
                            }
                        }
                        catch (Exception ex)
                        {
                            Status = Status + "\r\nERROR: Could not load achievements: " + ex.Message;
                        }
                        i++;
                    }
                    User = new User(numericValue, userInfo.Item1, userInfo.Item2)
                    {
                        OwnedGames = games
                    };
                    File.WriteAllText("E:\\data\\dev\\net\\achievement_planner_import.log", Status);
                };
                bw.RunWorkerAsync();
            }
        }