public void BuildSiteUrl_Requires_Follow() { var reqProc = new UserStreamRequestProcessor<UserStream>() { SiteStreamUrl = "http://betastream.twitter.com/2b/" }; var parms = new Dictionary<string, string> { { "Type", UserStreamType.Site.ToString() }, //{ "Follow", "1,2,3" }, }; var ex = Assert.Throws<ArgumentNullException>(() => reqProc.BuildUrl(parms)); Assert.Equal("Follow", ex.ParamName); }
public void BuildSiteUrl_Removes_Spaces_From_Follow() { var reqProc = new UserStreamRequestProcessor<UserStream>() { SiteStreamUrl = "http://betastream.twitter.com/2b/" }; var parms = new Dictionary<string, string> { { "Type", UserStreamType.Site.ToString() }, { "Follow", "1, 2, 3" }, }; Request req = reqProc.BuildUrl(parms); Assert.Equal("http://betastream.twitter.com/2b/site.json?follow=1%2C2%2C3", req.FullUrl); }
public void BuildSiteUrl_Removes_Spaces_From_Follow() { var reqProc = new UserStreamRequestProcessor <UserStream>() { SiteStreamUrl = "https://userstream.twitter.com/1.1/" }; var parms = new Dictionary <string, string> { { "Type", UserStreamType.Site.ToString() }, { "Follow", "1, 2, 3" }, }; Request req = reqProc.BuildUrl(parms); Assert.Equal("https://userstream.twitter.com/1.1/site.json?follow=1%2C2%2C3", req.FullUrl); }
public void BuildSiteUrl_Requires_Follow() { var reqProc = new UserStreamRequestProcessor <UserStream>() { SiteStreamUrl = "https://userstream.twitter.com/1.1/" }; var parms = new Dictionary <string, string> { { "Type", UserStreamType.Site.ToString() }, //{ "Follow", "1,2,3" }, }; var ex = Assert.Throws <ArgumentNullException>(() => reqProc.BuildUrl(parms)); Assert.Equal("Follow", ex.ParamName); }
public void BuildSiteUrl_Returns_Url() { var reqProc = new UserStreamRequestProcessor<UserStream>() { SiteStreamUrl = "http://betastream.twitter.com/2b/" }; var parms = new Dictionary<string, string> { { "Type", UserStreamType.Site.ToString() }, { "Delimited", "length" }, { "Follow", "1,2,3" }, { "With", "Follow" }, { "AllReplies", "True" } }; Request req = reqProc.BuildUrl(parms); Assert.Equal("http://betastream.twitter.com/2b/site.json?delimited=length&follow=1%2C2%2C3&with=follow", req.FullUrl); }
public void BuildSiteUrl_Throws_On_Track() { var reqProc = new UserStreamRequestProcessor <UserStream>() { SiteStreamUrl = "https://userstream.twitter.com/1.1/" }; var parms = new Dictionary <string, string> { { "Type", UserStreamType.Site.ToString() }, { "Delimited", "length" }, { "Follow", "1,2,3" }, { "Track", "LINQ to Twitter" }, { "With", "Follow" }, { "AllReplies", "True" } }; var ex = Assert.Throws <ArgumentException>(() => reqProc.BuildUrl(parms)); Assert.Equal("Track", ex.ParamName); }
public void BuildUserUrl_Returns_Url() { const string ExpectedUrl = "https://userstream.twitter.com/1.1/user.json?delimited=length&language=en%2Cfr&track=LINQ%20to%20Twitter&with=follow&replies=all&stall_warnings=true&locations=3"; var reqProc = new UserStreamRequestProcessor<UserStream>() { UserStreamUrl = "https://userstream.twitter.com/1.1/" }; var parms = new Dictionary<string, string> { { "Type", UserStreamType.User.ToString() }, { "Delimited", "length" }, { "Track", "LINQ to Twitter" }, { "With", "Follow" }, { "AllReplies", true.ToString() }, { "StallWarnings", true.ToString() }, { "Locations", "3" }, { "Language", "en,fr" } }; Request req = reqProc.BuildUrl(parms); Assert.Equal(ExpectedUrl, req.FullUrl); }
public void BuildSiteUrl_Returns_Url() { const string ExpectedUrl = "https://userstream.twitter.com/1.1/site.json?delimited=length&language=en%2Cfr&follow=1%2C2%2C3&with=follow&replies=all&stall_warnings=true"; var reqProc = new UserStreamRequestProcessor <UserStream>() { SiteStreamUrl = "https://userstream.twitter.com/1.1/" }; var parms = new Dictionary <string, string> { { "Type", UserStreamType.Site.ToString() }, { "Delimited", "length" }, { "Follow", "1,2,3" }, { "With", "Follow" }, { "AllReplies", true.ToString() }, { "StallWarnings", true.ToString() }, { "Language", "en,fr" } }; Request req = reqProc.BuildUrl(parms); Assert.Equal(ExpectedUrl, req.FullUrl); }
public void BuildUserUrl_Returns_Url() { const string ExpectedUrl = "https://userstream.twitter.com/1.1/user.json?delimited=length&language=en%2Cfr&track=LINQ%20to%20Twitter&with=follow&replies=all&stall_warnings=true&locations=3"; var reqProc = new UserStreamRequestProcessor <UserStream>() { UserStreamUrl = "https://userstream.twitter.com/1.1/" }; var parms = new Dictionary <string, string> { { "Type", UserStreamType.User.ToString() }, { "Delimited", "length" }, { "Track", "LINQ to Twitter" }, { "With", "Follow" }, { "AllReplies", true.ToString() }, { "StallWarnings", true.ToString() }, { "Locations", "3" }, { "Language", "en,fr" } }; Request req = reqProc.BuildUrl(parms); Assert.Equal(ExpectedUrl, req.FullUrl); }
public void BuildSiteUrl_Returns_Url() { const string ExpectedUrl = "https://userstream.twitter.com/1.1/site.json?delimited=length&language=en%2Cfr&follow=1%2C2%2C3&with=follow&replies=all&stall_warnings=true"; var reqProc = new UserStreamRequestProcessor<UserStream>() { SiteStreamUrl = "https://userstream.twitter.com/1.1/" }; var parms = new Dictionary<string, string> { { "Type", UserStreamType.Site.ToString() }, { "Delimited", "length" }, { "Follow", "1,2,3" }, { "With", "Follow" }, { "AllReplies", true.ToString() }, { "StallWarnings", true.ToString() }, { "Language", "en,fr" } }; Request req = reqProc.BuildUrl(parms); Assert.Equal(ExpectedUrl, req.FullUrl); }
public void BuildSiteUrl_Throws_On_Track() { var reqProc = new UserStreamRequestProcessor<UserStream>() { SiteStreamUrl = "https://userstream.twitter.com/1.1/" }; var parms = new Dictionary<string, string> { { "Type", UserStreamType.Site.ToString() }, { "Delimited", "length" }, { "Follow", "1,2,3" }, { "Track", "LINQ to Twitter" }, { "With", "Follow" }, { "AllReplies", "True" } }; var ex = Assert.Throws<ArgumentException>(() => reqProc.BuildUrl(parms)); Assert.Equal("Track", ex.ParamName); }
public void BuildUserUrl_Returns_Url() { var reqProc = new UserStreamRequestProcessor<UserStream>() { UserStreamUrl = "https://userstream.twitter.com/2/" }; var parms = new Dictionary<string, string> { { "Type", UserStreamType.User.ToString() }, { "Delimited", "length" }, { "Track", "LINQ to Twitter" }, { "With", "Follow" }, { "AllReplies", "True" } }; Request req = reqProc.BuildUrl(parms); Assert.Equal("https://userstream.twitter.com/2/user.json?delimited=length&track=LINQ%20to%20Twitter&with=follow&replies=all", req.FullUrl); }