本文整理汇总了C#中ListRequestProcessor.BuildUrl方法的典型用法代码示例。如果您正苦于以下问题:C# ListRequestProcessor.BuildUrl方法的具体用法?C# ListRequestProcessor.BuildUrl怎么用?C# ListRequestProcessor.BuildUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListRequestProcessor
的用法示例。
在下文中一共展示了ListRequestProcessor.BuildUrl方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildUrl_Returns_Ownerships_Url
public void BuildUrl_Returns_Ownerships_Url()
{
const string ExpectedUrl = "https://api.twitter.com/1.1/lists/ownerships.json?user_id=789&screen_name=JoeMayo&count=10&cursor=1";
var listReqProc = new ListRequestProcessor<List>() { BaseUrl = "https://api.twitter.com/1.1/" };
var parameters = new Dictionary<string, string>
{
{ "Type", ((int) ListType.Ownerships).ToString() },
{ "UserID", "789" },
{ "ScreenName", "JoeMayo" },
{ "Count", "10" },
{ "Cursor", "1" }
};
Request req = listReqProc.BuildUrl(parameters);
Assert.Equal(ExpectedUrl, req.FullUrl);
}
示例2: BuildIsSubscriberUrl_Requires_UserID_Or_ScreenName
public void BuildIsSubscriberUrl_Requires_UserID_Or_ScreenName()
{
const string ExpectedParamName = "UserIdOrScreenName";
var listReqProc = new ListRequestProcessor<List> { BaseUrl = "https://api.twitter.com/1.1/" };
var parameters = new Dictionary<string, string>
{
{ "Type", ((int) ListType.IsSubscribed).ToString()},
{ "Slug", "test" },
{"OwnerID", "123"},
};
var ex = Assert.Throws<ArgumentException>(() => listReqProc.BuildUrl(parameters));
Assert.Equal(ExpectedParamName, ex.ParamName);
}
示例3: BuildIsSubscriberUrl_Includes_False_Parameters
public void BuildIsSubscriberUrl_Includes_False_Parameters()
{
const string ExpectedUrl = "https://api.twitter.com/1.1/lists/subscribers/show.json?user_id=789&screen_name=JoeMayo&slug=test&owner_id=123&owner_screen_name=JoeMayo&list_id=456&include_entities=false";
var listReqProc = new ListRequestProcessor<List>() { BaseUrl = "https://api.twitter.com/1.1/" };
var parameters = new Dictionary<string, string>
{
{ "Type", ((int) ListType.IsSubscribed).ToString() },
{ "UserID", "789" },
{ "ScreenName", "JoeMayo" },
{ "Slug", "test" },
{ "OwnerID", "123" },
{ "OwnerScreenName", "JoeMayo" },
{ "ListID", "456" },
{ "IncludeEntities", "false" }
};
Request req = listReqProc.BuildUrl(parameters);
Assert.Equal(ExpectedUrl, req.FullUrl);
}
示例4: BuildSubscribersUrl_Requires_Non_Null_And_Not_Empty_ListID_Or_Slug
public void BuildSubscribersUrl_Requires_Non_Null_And_Not_Empty_ListID_Or_Slug()
{
const string ExpectedParamName = "ListIdOrSlug";
var listReqProc = new ListRequestProcessor<List> { BaseUrl = "https://api.twitter.com/1.1/" };
var parameters = new Dictionary<string, string>
{
{ "Type", ((int) ListType.Subscribers).ToString()},
{ "ListID", "" },
{ "Slug", null }
//{"OwnerID", "123"},
};
var ex = Assert.Throws<ArgumentException>(() => listReqProc.BuildUrl(parameters));
Assert.Equal(ExpectedParamName, ex.ParamName);
}
示例5: BuildUrl_Returns_SubscribersUrl
public void BuildUrl_Returns_SubscribersUrl()
{
const string ExpectedUrl = "https://api.twitter.com/1.1/lists/subscribers.json?owner_id=123&owner_screen_name=JoeMayo&slug=test&list_id=456&cursor=789&include_entities=true&skip_status=true";
var listReqProc = new ListRequestProcessor<List>() { BaseUrl = "https://api.twitter.com/1.1/" };
var parameters = new Dictionary<string, string>
{
{ "Type", ((int) ListType.Subscribers).ToString() },
{ "Slug", "test" },
{ "OwnerID", "123" },
{ "OwnerScreenName", "JoeMayo" },
{ "ListID", "456" },
{ "Cursor", "789" },
{ "IncludeEntities", true.ToString() },
{ "SkipStatus", true.ToString() }
};
Request req = listReqProc.BuildUrl(parameters);
Assert.Equal(ExpectedUrl, req.FullUrl);
}
示例6: BuildShowUrl_Returns_Url
public void BuildShowUrl_Returns_Url()
{
const string ExpectedUrl = "https://api.twitter.com/1.1/lists/show.json?slug=test&owner_id=123&owner_screen_name=JoeMayo&list_id=456";
var listReqProc = new ListRequestProcessor<List>() { BaseUrl = "https://api.twitter.com/1.1/" };
var parameters = new Dictionary<string, string>
{
{ "Type", ((int) ListType.Show).ToString() },
{ "OwnerID", "123" },
{ "OwnerScreenName", "JoeMayo" },
{ "Slug", "test" },
{ "ListID", "456" }
};
Request req = listReqProc.BuildUrl(parameters);
Assert.Equal(ExpectedUrl, req.FullUrl);
}
示例7: BuildStatusesUrl_Includes_False_Parameters
public void BuildStatusesUrl_Includes_False_Parameters()
{
const string ExpectedUrl = "https://api.twitter.com/1.1/lists/statuses.json?owner_id=123&owner_screen_name=JoeMayo&slug=test&list_id=456&since_id=789&max_id=234&count=25&per_page=25&page=3&trim_user=false&include_entities=false&include_rts=false";
var listReqProc = new ListRequestProcessor<List>() { BaseUrl = "https://api.twitter.com/1.1/" };
var parameters = new Dictionary<string, string>
{
{ "Type", ((int) ListType.Statuses).ToString() },
{ "OwnerID", "123" },
{ "OwnerScreenName", "JoeMayo" },
{ "Slug", "test" },
{ "ListID", "456" },
{ "SinceID", "789" },
{ "MaxID", "234" },
{ "Count", "25" },
{ "Page", "3" },
{ "TrimUser", "false" },
{ "IncludeEntities", "false" },
{ "IncludeRetweets", "false" }
};
Request req = listReqProc.BuildUrl(parameters);
Assert.Equal(ExpectedUrl, req.FullUrl);
}
示例8: BuildListsUrl_Returns_Url
public void BuildListsUrl_Returns_Url()
{
const string ExpectedUrl = "https://api.twitter.com/1.1/lists/list.json?user_id=123&screen_name=JoeMayo&cursor=456&reverse=true";
var listReqProc = new ListRequestProcessor<List>() { BaseUrl = "https://api.twitter.com/1.1/" };
var parameters = new Dictionary<string, string>
{
{ "Type", ((int) ListType.Lists).ToString() },
{ "UserID", "123" },
{ "ScreenName", "JoeMayo" },
{ "Cursor", "456" },
{ "Reverse", true.ToString() }
};
Request req = listReqProc.BuildUrl(parameters);
Assert.Equal(ExpectedUrl, req.FullUrl);
}
示例9: BuildMembershipsUrl_Does_Not_Add_False_Filter_To_Url
public void BuildMembershipsUrl_Does_Not_Add_False_Filter_To_Url()
{
const string ExpectedUrl = "https://api.twitter.com/1.1/lists/memberships.json?user_id=123&screen_name=JoeMayo&cursor=456";
var listReqProc = new ListRequestProcessor<List>() { BaseUrl = "https://api.twitter.com/1.1/" };
var parameters = new Dictionary<string, string>
{
{ "Type", ((int) ListType.Memberships).ToString() },
{ "UserID", "123" },
{ "ScreenName", "JoeMayo" },
{ "Cursor", "456" },
{ "FilterToOwnedLists", "false" }
};
Request req = listReqProc.BuildUrl(parameters);
Assert.Equal(ExpectedUrl, req.FullUrl);
}
示例10: BuildUrl_Throws_On_Null_Param_List
public void BuildUrl_Throws_On_Null_Param_List()
{
const string ExpectedParamName = "Type";
var listReqProc = new ListRequestProcessor<List> { BaseUrl = "https://api.twitter.com/1.1/" };
var ex = Assert.Throws<ArgumentException>(() => listReqProc.BuildUrl(null));
Assert.Equal<string>(ExpectedParamName, ex.ParamName);
}
示例11: BuildUrl_Throws_On_Missing_ScreenName
public void BuildUrl_Throws_On_Missing_ScreenName()
{
const string ExpectedParamName = "UserIdOrScreenName";
var listReqProc = new ListRequestProcessor<List> { BaseUrl = "https://api.twitter.com/1.1/" };
var parameters =
new Dictionary<string, string>
{
{ "Type", "0" },
};
var ex = Assert.Throws<ArgumentException>(() => listReqProc.BuildUrl(parameters));
Assert.Equal(ExpectedParamName, ex.ParamName);
}
示例12: BuildUrl_Creates_Lists_Url
public void BuildUrl_Creates_Lists_Url()
{
const string ExpectedUrl = "https://api.twitter.com/1.1/lists/list.json?screen_name=JoeMayo";
var listReqProc = new ListRequestProcessor<List> { BaseUrl = "https://api.twitter.com/1.1/" };
var parameters =
new Dictionary<string, string>
{
{ "Type", ((int)ListType.Lists).ToString() },
{ "ScreenName", "JoeMayo" }
};
Request req = listReqProc.BuildUrl(parameters);
Assert.Equal(ExpectedUrl, req.FullUrl);
}
示例13: BuildAllListsUrl_Returns_Url_With_UserID
public void BuildAllListsUrl_Returns_Url_With_UserID()
{
const string ExpectedUrl = "https://api.twitter.com/1.1/lists/all.json?user_id=123";
var listReqProc = new ListRequestProcessor<List> { BaseUrl = "https://api.twitter.com/1.1/" };
var parameters = new Dictionary<string, string>
{
{"Type", ((int) ListType.All).ToString(CultureInfo.InvariantCulture)},
{"UserID", "123"},
};
Request req = listReqProc.BuildUrl(parameters);
Assert.Equal(ExpectedUrl, req.FullUrl);
}
示例14: BuildStatusesUrl_Requires_OwnerID_Or_OwnerScreenName_If_Slug_Used
public void BuildStatusesUrl_Requires_OwnerID_Or_OwnerScreenName_If_Slug_Used()
{
const string ExpectedParamName = "OwnerIdOrOwnerScreenName";
var listReqProc = new ListRequestProcessor<List> { BaseUrl = "https://api.twitter.com/1.1/" };
var parameters = new Dictionary<string, string>
{
{ "Type", ((int) ListType.Statuses).ToString()},
{ "Slug", "test" }
//{"OwnerID", "123"},
};
var ex = L2TAssert.Throws<ArgumentException>(() => listReqProc.BuildUrl(parameters));
Assert.AreEqual(ExpectedParamName, ex.ParamName);
}