当前位置: 首页>>代码示例>>C#>>正文


C# UserRequestProcessor.ProcessResults方法代码示例

本文整理汇总了C#中UserRequestProcessor.ProcessResults方法的典型用法代码示例。如果您正苦于以下问题:C# UserRequestProcessor.ProcessResults方法的具体用法?C# UserRequestProcessor.ProcessResults怎么用?C# UserRequestProcessor.ProcessResults使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserRequestProcessor的用法示例。


在下文中一共展示了UserRequestProcessor.ProcessResults方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProcessResults_Parses_BannerSizes_Response

        public void ProcessResults_Parses_BannerSizes_Response()
        {
            var reqProc = new UserRequestProcessor<User> { Type = UserType.BannerSizes, BaseUrl = "http://api.twitter.com/1.1/" };

            List<User> userList = reqProc.ProcessResults(BannerSizesResponse);

            Assert.IsNotNull(userList);
            Assert.IsTrue(userList.Any());
            Assert.AreEqual(1, userList.Count);
            var user = userList.Single();
            Assert.IsNotNull(user);
            var bannerSizes = user.BannerSizes;
            Assert.IsNotNull(bannerSizes);
            Assert.AreEqual(6, bannerSizes.Count);
            var firstSize = bannerSizes.First();
            Assert.IsNotNull(firstSize);
            Assert.AreEqual("ipad_retina", firstSize.Label);
            Assert.AreEqual(1252, firstSize.Width);
            Assert.AreEqual(626, firstSize.Height);
            Assert.AreEqual("https://si0.twimg.com/profile_banners/16761255/1355801341/ipad_retina", firstSize.Url);
        }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:21,代码来源:UserRequestProcessorTests.cs

示例2: ProcessResults_Returns_Empty_Collection_When_Empty_Results

        public void ProcessResults_Returns_Empty_Collection_When_Empty_Results()
        {
            var userProc = new UserRequestProcessor<User> { BaseUrl = "http://api.twitter.com/1.1/" };

            List<User> users = userProc.ProcessResults(string.Empty);

            Assert.IsFalse(users.Any());
        }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:8,代码来源:UserRequestProcessorTests.cs

示例3: ProcessResults_Parses_Category_Response

        public void ProcessResults_Parses_Category_Response()
        {
            var reqProc = new UserRequestProcessor<User> { Type = UserType.Category, BaseUrl = "http://api.twitter.com/1.1/" };

            List<User> userList = reqProc.ProcessResults(CategoryResponse);

            Assert.IsNotNull(userList);
            Assert.AreEqual(1, userList.Count);
            var user = userList.Single();
            Assert.IsNotNull(user);
            var categories = user.Categories;
            Assert.IsNotNull(categories);
            Assert.IsTrue(categories.Any());
            var category = categories.First();
            Assert.IsNotNull(category);
            Assert.AreEqual(64, category.Size);
            Assert.AreEqual("Funny", category.Name);
            Assert.AreEqual("funny", category.Slug);
            var users = category.Users;
            Assert.IsNotNull(users);
            Assert.IsTrue(users.Any());
            var catUser = users.First();
            Assert.IsNotNull(catUser);
            Assert.AreEqual("OMG TestMethods", catUser.Name);
        }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:25,代码来源:UserRequestProcessorTests.cs

示例4: TestMultipleUserResponse

        void TestMultipleUserResponse(UserType type)
        {
            var reqProc = new UserRequestProcessor<User> { Type = type, BaseUrl = "http://api.twitter.com/1.1/" };

            List<User> userList = reqProc.ProcessResults(MultipleUserResponse);

            Assert.IsNotNull(userList);
            Assert.IsTrue(userList.Any());
            var user = userList.First();
            Assert.IsNotNull(user);
            Assert.AreEqual("bbccff", user.ProfileSidebarBorderColor);
        }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:12,代码来源:UserRequestProcessorTests.cs

示例5: ProcessResults_Parses_Show_Response

        public void ProcessResults_Parses_Show_Response()
        {
            var reqProc = new UserRequestProcessor<User> { Type = UserType.Show, BaseUrl = "https://api.twitter.com/1.1/" };

            List<User> users = reqProc.ProcessResults(SingleUserResponse);

            Assert.IsNotNull(users);
            Assert.AreEqual(1, users.Count);
            var user = users.First();
            VerifySingleUserResponse(user);
        }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:11,代码来源:UserRequestProcessorTests.cs

示例6: ProcessResults_Retains_Original_Input_Parameters

        public void ProcessResults_Retains_Original_Input_Parameters()
        {
            var reqProc = new UserRequestProcessor<User> 
            { 
                Type = UserType.Show, 
                BaseUrl = "https://api.twitter.com/1.1/",
                UserID = 123ul,
                UserIdList = "1,2",
                ScreenName = "JoeMayo",
                ScreenNameList = "JoeMayo,Linq2Tweeter",
                Page = 1,
                Count = 10,
                Cursor = 456,
                Slug = "myslug",
                Query = "myquery",
                Lang = "en-US",
                SkipStatus = true,
                ImageSize = ProfileImageSize.Bigger,
                IncludeEntities = true
            };

            List<User> users = reqProc.ProcessResults(SingleUserResponse);

            Assert.IsNotNull(users);
            Assert.AreEqual(1, users.Count);
            var user = users.First();
            Assert.AreEqual(123ul, user.UserID);
            Assert.AreEqual("1,2", user.UserIdList);
            Assert.AreEqual("JoeMayo", user.ScreenName);
            Assert.AreEqual("JoeMayo,Linq2Tweeter", user.ScreenNameList);
            Assert.AreEqual(1, user.Page);
            Assert.AreEqual(10, user.Count);
            Assert.AreEqual(456L, user.Cursor);
            Assert.AreEqual("myslug", user.Slug);
            Assert.AreEqual("myquery", user.Query);
            Assert.AreEqual("en-US", user.Lang);
            Assert.IsTrue(user.SkipStatus);
            Assert.AreEqual(ProfileImageSize.Bigger, user.ImageSize);
            Assert.IsTrue(user.IncludeEntities);
        }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:40,代码来源:UserRequestProcessorTests.cs

示例7: ProcessUsersInCategoryResultsTest

 public void ProcessUsersInCategoryResultsTest()
 {
     var statProc = new UserRequestProcessor<User>() { BaseUrl = "http://api.twitter.com/1/" };
     XElement twitterResponse = XElement.Load(new StringReader(m_usersInCategoryResponse));
     var actual = (List<User>)statProc.ProcessResults(twitterResponse);
     Assert.AreEqual(2, actual.Count);
 }
开发者ID:giggio,项目名称:tweetercloud,代码行数:7,代码来源:UserRequestProcessorTest.cs

示例8: ProcessResultsSingleResultTest

        public void ProcessResultsSingleResultTest()
        {
            var statProc = new UserRequestProcessor<User>() { BaseUrl = "http://twitter.com/" };
            XElement twitterResponse = XElement.Load(new StringReader(m_testQueryResponse));
            var actual = statProc.ProcessResults(twitterResponse);
            var actualQuery = actual as IList<User>;

            Assert.IsNotNull(actualQuery);
            Assert.AreEqual(actualQuery.Count(), 1);
        }
开发者ID:giggio,项目名称:tweetercloud,代码行数:10,代码来源:UserRequestProcessorTest.cs

示例9: ProcessResults_Parses_Categories_Response

        public void ProcessResults_Parses_Categories_Response()
        {
            var reqProc = new UserRequestProcessor<User> { Type = UserType.Categories, BaseUrl = "http://api.twitter.com/1.1/" };

            List<User> userList = reqProc.ProcessResults(CategoriesResponse);

            Assert.NotNull(userList);
            Assert.Single(userList);
            var user = userList.Single();
            Assert.NotNull(user);
            var categories = user.Categories;
            Assert.NotNull(categories);
            Assert.NotEmpty(categories);
            var category = categories.First();
            Assert.NotNull(category);
            Assert.Equal(106, category.Size);
            Assert.Equal("Music", category.Name);
            Assert.Equal("music", category.Slug);
        }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:19,代码来源:UserRequestProcessorTests.cs


注:本文中的UserRequestProcessor.ProcessResults方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。