//
        // GET: /Home/
        public ActionResult Index()
        {
            var web = new HtmlWeb();
            var url = new IndieMarketplaceUrlBuilder { PageNumber = 1, PageSize = 90 };
            var doc = web.Load(url.ToString());

            var xp = new XboxParser();
            var games = xp.LoadTopGames(doc.DocumentNode);

            return View(new Index { TopGames = games.ToList() });
        }
        public void TestLoadTopGamesLocal()
        {
            var xp = new XboxParser();
            var doc = new HtmlDocument();
            doc.LoadHtml(Resources.Top);
            var games = xp.LoadTopGames(doc.DocumentNode);

            Assert.AreEqual(30, games.Count());

            var topGame = games.First();
            Assert.AreEqual("CastleMiner Z", topGame.Title);
            Assert.AreEqual("http://download.xbox.com/content/xna/assets/585509DC_World/webboxart.jpg", topGame.ThumbUrl);
        }
        public void TestLoadTopGamesWeb()
        {
            var web = new HtmlWeb();
            var doc = web.Load("http://marketplace.xbox.com/en-US/Games/XboxIndieGames");

            var xp = new XboxParser();
            var games = xp.LoadTopGames(doc.DocumentNode);

            Assert.AreEqual(30, games.Count());

            var topGame = games.First();
            Assert.AreEqual("CastleMiner Z", topGame.Title);
            Assert.AreEqual("http://download.xbox.com/content/xna/assets/585509DC_World/webboxart.jpg", topGame.ThumbUrl);
        }