public void BuildFilterUrl_Requires_FollowOrLocationsOrTrack() { var reqProc = new StreamingRequestProcessor<Streaming>() { BaseUrl = "http://stream.twitter.com/1/" }; var parms = new Dictionary<string, string> { { "Type", StreamingType.Filter.ToString() }, { "Count", "10" } }; var ex = Assert.Throws<ArgumentException>(() => reqProc.BuildUrl(parms)); Assert.Equal("FollowOrLocationsOrTrack", ex.ParamName); }
public void BuildFilterUrl_Returns_Url() { var reqProc = new StreamingRequestProcessor<Streaming>() { BaseUrl = "http://stream.twitter.com/1/" }; var parms = new Dictionary<string, string> { { "Type", StreamingType.Filter.ToString() }, { "Track", "LINQ to Twitter" } }; Request req = reqProc.BuildUrl(parms); Assert.Equal("http://stream.twitter.com/1/statuses/filter.json?track=LINQ%20to%20Twitter", req.FullUrl); }
public void BuildLinksUrl_Returns_Url() { var reqProc = new StreamingRequestProcessor<Streaming>() { BaseUrl = "http://stream.twitter.com/1/" }; var parms = new Dictionary<string, string> { { "Type", StreamingType.Links.ToString() }, { "Count", "25" }, { "Delimited", "length" } }; Request req = reqProc.BuildUrl(parms); Assert.Equal("http://stream.twitter.com/1/statuses/links.json?count=25&delimited=length", req.FullUrl); }
public void BuildUrl_Requires_Type() { var reqProc = new StreamingRequestProcessor <Streaming>() { BaseUrl = "https://stream.twitter.com/1.1/" }; var parms = new Dictionary <string, string> { //{ "Type", StreamingType.Sample.ToString() }, }; var ex = Assert.Throws <ArgumentException>(() => reqProc.BuildUrl(parms)); Assert.Equal("Type", ex.ParamName); }
public void BuildFilterUrl_Requires_FollowOrLocationsOrTrack() { var reqProc = new StreamingRequestProcessor <Streaming>() { BaseUrl = "https://stream.twitter.com/1.1/" }; var parms = new Dictionary <string, string> { { "Type", StreamingType.Filter.ToString() }, { "Count", "10" } }; var ex = Assert.Throws <ArgumentException>(() => reqProc.BuildUrl(parms)); Assert.Equal("FollowOrLocationsOrTrack", ex.ParamName); }
public void BuildRetweetUrl_Returns_Url() { var reqProc = new StreamingRequestProcessor <Streaming>() { BaseUrl = "https://stream.twitter.com/1.1/" }; var parms = new Dictionary <string, string> { { "Type", StreamingType.Retweet.ToString() }, { "Delimited", "length" } }; Request req = reqProc.BuildUrl(parms); Assert.Equal("https://stream.twitter.com/1.1/statuses/retweet.json?delimited=length", req.FullUrl); }
public void BuildFilterUrl_Returns_Url() { const string ExpectedUrl = "https://stream.twitter.com/1.1/statuses/filter.json?track=LINQ%20to%20Twitter&stall_warnings=true&language=en%2Cfr"; var reqProc = new StreamingRequestProcessor<Streaming>() { BaseUrl = "https://stream.twitter.com/1.1/" }; var parms = new Dictionary<string, string> { { "Type", StreamingType.Filter.ToString() }, { "Track", "LINQ to Twitter" }, { "StallWarnings", true.ToString() }, { "Language", "en,fr" } }; Request req = reqProc.BuildUrl(parms); Assert.Equal(ExpectedUrl, req.FullUrl); }
public void BuildSampleUrl_Returns_Url() { const string ExpectedUrl = "https://stream.twitter.com/1.1/statuses/sample.json?language=en%2Cfr&stall_warnings=true"; var reqProc = new StreamingRequestProcessor <Streaming>() { BaseUrl = "https://stream.twitter.com/1.1/" }; var parms = new Dictionary <string, string> { { "Type", StreamingType.Sample.ToString() }, { "StallWarnings", true.ToString() }, { "Language", "en,fr" } }; Request req = reqProc.BuildUrl(parms); Assert.Equal(ExpectedUrl, req.FullUrl); }
public void BuildSampleUrl_Only_Adds_Delimited_To_Url() { var reqProc = new StreamingRequestProcessor <Streaming>() { BaseUrl = "https://stream.twitter.com/1.1/" }; var parms = new Dictionary <string, string> { { "Type", StreamingType.Sample.ToString() }, { "Delimited", "length" }, { "Follow", "1,2,3" }, { "Track", "twitter,LINQ to Twitter,Joe Mayo" }, { "Locations", "123,456,789,012" } }; Request req = reqProc.BuildUrl(parms); Assert.Equal("https://stream.twitter.com/1.1/statuses/sample.json?delimited=length", req.FullUrl); }
public void BuildFirehoseUrl_Returns_Url() { const string ExpectedUrl = "https://stream.twitter.com/1.1/statuses/firehose.json?count=25&delimited=length&language=en%2Cfr&stall_warnings=true"; var reqProc = new StreamingRequestProcessor <Streaming>() { BaseUrl = "https://stream.twitter.com/1.1/" }; var parms = new Dictionary <string, string> { { "Type", StreamingType.Firehose.ToString() }, { "Count", "25" }, { "Delimited", "length" }, { "StallWarnings", true.ToString() }, { "Language", "en,fr" } }; Request req = reqProc.BuildUrl(parms); Assert.Equal(ExpectedUrl, req.FullUrl); }
public void BuildUrl_Requires_Type() { var reqProc = new StreamingRequestProcessor<Streaming>() { BaseUrl = "http://stream.twitter.com/1/" }; var parms = new Dictionary<string, string> { //{ "Type", StreamingType.Sample.ToString() }, }; var ex = Assert.Throws<ArgumentException>(() => reqProc.BuildUrl(parms)); Assert.Equal("Type", ex.ParamName); }
public void BuildSampleUrl_Returns_Url() { var reqProc = new StreamingRequestProcessor<Streaming>() { BaseUrl = "http://stream.twitter.com/1/" }; var parms = new Dictionary<string, string> { { "Type", StreamingType.Sample.ToString() } }; Request req = reqProc.BuildUrl(parms); Assert.Equal("http://stream.twitter.com/1/statuses/sample.json", req.FullUrl); }
public void BuildSampleUrl_Only_Adds_Delimited_To_Url() { var reqProc = new StreamingRequestProcessor<Streaming>() { BaseUrl = "http://stream.twitter.com/1/" }; var parms = new Dictionary<string, string> { { "Type", StreamingType.Sample.ToString() }, { "Delimited", "length" }, { "Follow", "1,2,3" }, { "Track", "twitter,LINQ to Twitter,Joe Mayo" }, { "Locations", "123,456,789,012" } }; Request req = reqProc.BuildUrl(parms); Assert.Equal("http://stream.twitter.com/1/statuses/sample.json?delimited=length", req.FullUrl); }
public void BuildFirehoseUrl_Returns_Url() { const string ExpectedUrl = "https://stream.twitter.com/1.1/statuses/firehose.json?count=25&delimited=length&language=en%2Cfr&stall_warnings=true"; var reqProc = new StreamingRequestProcessor<Streaming>() { BaseUrl = "https://stream.twitter.com/1.1/" }; var parms = new Dictionary<string, string> { { "Type", StreamingType.Firehose.ToString() }, { "Count", "25" }, { "Delimited", "length" }, { "StallWarnings", true.ToString() }, { "Language", "en,fr" } }; Request req = reqProc.BuildUrl(parms); Assert.Equal(ExpectedUrl, req.FullUrl); }
public void BuildSampleUrl_Forbids_Count() { var reqProc = new StreamingRequestProcessor<Streaming>() { BaseUrl = "https://stream.twitter.com/1.1/" }; var parms = new Dictionary<string, string> { { "Type", StreamingType.Sample.ToString() }, { "Count", "5" } }; var ex = Assert.Throws<ArgumentException>(() => reqProc.BuildUrl(parms)); Assert.Equal("Count", ex.ParamName); }
public void BuildRetweetUrl_Returns_Url() { var reqProc = new StreamingRequestProcessor<Streaming>() { BaseUrl = "https://stream.twitter.com/1.1/" }; var parms = new Dictionary<string, string> { { "Type", StreamingType.Retweet.ToString() }, { "Delimited", "length" } }; Request req = reqProc.BuildUrl(parms); Assert.Equal("https://stream.twitter.com/1.1/statuses/retweet.json?delimited=length", req.FullUrl); }