本文整理汇总了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);
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}