public void BuildUrl_Generates_Languages_Url() { const string ExpectedUrl = "https://api.twitter.com/1.1/help/languages.json"; var helpReqProc = new HelpRequestProcessor<Help> { BaseUrl = "https://api.twitter.com/1.1/" }; var parameters = new Dictionary<string, string> { {"Type", ((int) HelpType.Languages).ToString()} }; Request req = helpReqProc.BuildUrl(parameters); Assert.AreEqual(ExpectedUrl, req.FullUrl); }
public void BuildUrl_Generates_RateLimits_Url() { const string ExpectedUrl = "https://api.twitter.com/1.1/application/rate_limit_status.json?resources=search%2Cusers"; var helpReqProc = new HelpRequestProcessor<Help> { BaseUrl = "https://api.twitter.com/1.1/" }; var parameters = new Dictionary<string, string> { {"Type", ((int) HelpType.RateLimits).ToString()}, {"Resources", "search,users"} }; Request req = helpReqProc.BuildUrl(parameters); Assert.AreEqual(ExpectedUrl, req.FullUrl); }
public void BuildUrl_Throws_With_No_Type() { var helpReqProc = new HelpRequestProcessor <Help> { BaseUrl = "https://api.twitter.com/1/" }; var parameters = new Dictionary <string, string> { //{"Type", ((int) HelpType.Languages).ToString()} }; var ex = L2TAssert.Throws <ArgumentException>(() => helpReqProc.BuildUrl(parameters)); Assert.AreEqual("Type", ex.ParamName); }
public void BuildUrl_Generates_Languages_Url() { const string ExpectedUrl = "https://api.twitter.com/1.1/help/languages.json"; var helpReqProc = new HelpRequestProcessor <Help> { BaseUrl = "https://api.twitter.com/1.1/" }; var parameters = new Dictionary <string, string> { { "Type", ((int)HelpType.Languages).ToString() } }; Request req = helpReqProc.BuildUrl(parameters); Assert.AreEqual(ExpectedUrl, req.FullUrl); }
public void BuildUrl_Removes_Parameter_Spaces_In_RateLimits_Url() { const string ExpectedUrl = "https://api.twitter.com/1.1/application/rate_limit_status.json?resources=search%2Cusers"; var helpReqProc = new HelpRequestProcessor <Help> { BaseUrl = "https://api.twitter.com/1.1/" }; var parameters = new Dictionary <string, string> { { "Type", ((int)HelpType.RateLimits).ToString() }, { "Resources", "search, users" } }; Request req = helpReqProc.BuildUrl(parameters); Assert.AreEqual(ExpectedUrl, req.FullUrl); }
public void BuildUrl_Throws_With_No_Type() { var helpReqProc = new HelpRequestProcessor<Help> { BaseUrl = "https://api.twitter.com/1/" }; var parameters = new Dictionary<string, string> { //{"Type", ((int) HelpType.Languages).ToString()} }; var ex = L2TAssert.Throws<ArgumentException>(() => helpReqProc.BuildUrl(parameters)); Assert.AreEqual("Type", ex.ParamName); }