Пример #1
0
        public void UserInfo()
        {
            var c = new Crawler(username, pwd);
            var user = c.ExecuteUserInfo("735376220");

            Assert.AreEqual("techdong", user.Username);
        }
Пример #2
0
        public void UserInfo()
        {
            var c = new Crawler(username, pwd);
            c.PageSize = 500;
            var list = c.ExecuteUserList();

            var failedCount = 0;
            var count = 0;
            list.ForEach(u =>
            {
                count++;
                if (count % 10 == 0)
                {
                    //c = new Crawler(username, pwd);
                }
                var user = c.ExecuteUserInfo(u.id);
                if (user != null)
                {
                    Debug.WriteLine("user:{0}_{1}", user.NickName, user.FakeId);
                }
                else
                {
                    failedCount++;
                }

                if (failedCount > 2)
                {
                    Debug.WriteLine("错误了{0}次,执行了{1}", failedCount, count);
                    Assert.IsFalse(true);
                }
            });

            //Assert.AreEqual("techdong", user.Username);
        }