本文整理汇总了C#中ListRequestProcessor.BuildURL方法的典型用法代码示例。如果您正苦于以下问题:C# ListRequestProcessor.BuildURL方法的具体用法?C# ListRequestProcessor.BuildURL怎么用?C# ListRequestProcessor.BuildURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListRequestProcessor
的用法示例。
在下文中一共展示了ListRequestProcessor.BuildURL方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildURLTestMissingType
public void BuildURLTestMissingType()
{
ListRequestProcessor<List> target = new ListRequestProcessor<List> { BaseUrl = "https://api.twitter.com/1/" };
Dictionary<string, string> parameters =
new Dictionary<string, string>
{
{ "ScreenName", "JoeMayo" }
};
string expected = "https://api.twitter.com/1/JoeMayo/lists.xml";
string actual = target.BuildURL(parameters);
Assert.AreEqual(expected, actual);
}
示例2: NullParametersTest
public void NullParametersTest()
{
ListRequestProcessor<List> target = new ListRequestProcessor<List> { BaseUrl = "https://api.twitter.com/1/" };
Dictionary<string, string> parameters = null;
string actual;
try
{
actual = target.BuildURL(parameters);
Assert.Fail("Expected ArgumentException.");
}
catch (ArgumentException ae)
{
Assert.AreEqual<string>("Type", ae.ParamName);
}
}
示例3: BuildStatusUrlTestWithParameters
public void BuildStatusUrlTestWithParameters()
{
ListRequestProcessor<List> target = new ListRequestProcessor<List>() { BaseUrl = "https://api.twitter.com/1/" };
var parameters = new Dictionary<string, string>
{
{"Type", ((int) ListType.Statuses).ToString()},
{"ScreenName", "JoeMayo"},
{"ListID", "1234567"},
{"MaxID", "9876543"},
{"SinceID", "2345678"},
{"PerPage", "100"},
{"Page", "2"}
};
string expected =
"https://api.twitter.com/1/JoeMayo/lists/1234567/statuses.xml?max_id=9876543&since_id=2345678&per_page=100&page=2";
string actual = target.BuildURL(parameters);
Assert.AreEqual(expected, actual);
}