public void BuildLocationTrendsWithoutWeoIDURLTest()
 {
     TrendRequestProcessor <Trend> target = new TrendRequestProcessor <Trend>()
     {
         BaseUrl = "http://api.twitter.com/1/"
     };
     Dictionary <string, string> parameters =
         new Dictionary <string, string>
     {
         { "Type", ((int)TrendType.Location).ToString() },
     };
     string actual = target.BuildURL(parameters);
 }
        public void BuildAvailableTrendsWithoutLatitudeURLTest()
        {
            TrendRequestProcessor <Trend> target = new TrendRequestProcessor <Trend>()
            {
                BaseUrl = "http://api.twitter.com/1/"
            };
            Dictionary <string, string> parameters =
                new Dictionary <string, string>
            {
                { "Type", ((int)TrendType.Available).ToString() },
                { "Longitude", "-122.40060" }
            };

            target.BuildURL(parameters);
        }
        public void BuildTrendsURLTest()
        {
            TrendRequestProcessor <Trend> target = new TrendRequestProcessor <Trend>()
            {
                BaseUrl = "http://search.twitter.com/"
            };
            Dictionary <string, string> parameters =
                new Dictionary <string, string>
            {
                { "Type", ((int)TrendType.Trend).ToString() }
            };
            string expected = "http://search.twitter.com/trends.json";
            string actual;

            actual = target.BuildURL(parameters);
            Assert.AreEqual(expected, actual);
        }
        public void BuildLocationTrendsURLTest()
        {
            TrendRequestProcessor <Trend> target = new TrendRequestProcessor <Trend>()
            {
                BaseUrl = "http://api.twitter.com/1/"
            };
            Dictionary <string, string> parameters =
                new Dictionary <string, string>
            {
                { "Type", ((int)TrendType.Location).ToString() },
                { "WeoID", "1" }
            };
            string expected = "http://api.twitter.com/1/trends/1.xml";
            string actual;

            actual = target.BuildURL(parameters);
            Assert.AreEqual(expected, actual);
        }
        public void NullParametersTest()
        {
            TrendRequestProcessor <Trend> target = new TrendRequestProcessor <Trend>()
            {
                BaseUrl = "http://search.twitter.com/"
            };
            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);
            }
        }
        public void BuildAvailableTrendsURLTest()
        {
            TrendRequestProcessor <Trend> target = new TrendRequestProcessor <Trend>()
            {
                BaseUrl = "http://api.twitter.com/1/"
            };
            Dictionary <string, string> parameters =
                new Dictionary <string, string>
            {
                { "Type", ((int)TrendType.Available).ToString() },
                { "Latitude", "37.78215" },
                { "Longitude", "-122.40060" }
            };
            string expected = "http://api.twitter.com/1/trends/available.xml?lat=37.78215&long=-122.40060";
            string actual;

            actual = target.BuildURL(parameters);
            Assert.AreEqual(expected, actual);
        }
        public void BuildDailyTrendsURLTest()
        {
            TrendRequestProcessor <Trend> target = new TrendRequestProcessor <Trend>()
            {
                BaseUrl = "http://search.twitter.com/"
            };
            Dictionary <string, string> parameters =
                new Dictionary <string, string>
            {
                { "Type", ((int)TrendType.Daily).ToString() },
                { "Date", "2009-01-01" },
                { "ExcludeHashtags", "true" }
            };
            string expected = "http://search.twitter.com/trends/daily.json?date=2009-01-01&exclude=hashtags";
            string actual;

            actual = target.BuildURL(parameters);
            Assert.AreEqual(expected, actual);
        }
 public void NullParametersTest()
 {
     TrendRequestProcessor<Trend> target = new TrendRequestProcessor<Trend>() { BaseUrl = "http://search.twitter.com/" };
     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);
     }
 }
 public void BuildWeeklyTrendsURLTest()
 {
     TrendRequestProcessor<Trend> target = new TrendRequestProcessor<Trend>() { BaseUrl = "http://search.twitter.com/" };
     Dictionary<string, string> parameters =
         new Dictionary<string, string>
         {
             { "Type", ((int)TrendType.Weekly).ToString() },
             { "Date", "2009-01-01" },
             { "ExcludeHashtags", "true" }
         };
     string expected = "http://search.twitter.com/trends/weekly.json?date=2009-01-01&exclude=hashtags";
     string actual;
     actual = target.BuildURL(parameters);
     Assert.AreEqual(expected, actual);
 }
 public void BuildTrendsURLTest()
 {
     TrendRequestProcessor<Trend> target = new TrendRequestProcessor<Trend>() { BaseUrl = "http://search.twitter.com/" };
     Dictionary<string, string> parameters =
         new Dictionary<string, string>
         {
             { "Type", ((int)TrendType.Trend).ToString() }
         };
     string expected = "http://search.twitter.com/trends.json";
     string actual;
     actual = target.BuildURL(parameters);
     Assert.AreEqual(expected, actual);
 }
 public void BuildLocationTrendsWithoutWeoIDURLTest()
 {
     TrendRequestProcessor<Trend> target = new TrendRequestProcessor<Trend>() { BaseUrl = "http://api.twitter.com/1/" };
     Dictionary<string, string> parameters =
         new Dictionary<string, string>
         {
             { "Type", ((int)TrendType.Location).ToString() },
         };
     string actual = target.BuildURL(parameters);
 }
 public void BuildLocationTrendsURLTest()
 {
     TrendRequestProcessor<Trend> target = new TrendRequestProcessor<Trend>() { BaseUrl = "http://api.twitter.com/1/" };
     Dictionary<string, string> parameters =
         new Dictionary<string, string>
         {
             { "Type", ((int)TrendType.Location).ToString() },
             { "WeoID", "1" }
         };
     string expected = "http://api.twitter.com/1/trends/1.xml";
     string actual;
     actual = target.BuildURL(parameters);
     Assert.AreEqual(expected, actual);
 }
 public void BuildAvailableTrendsWithoutLatitudeURLTest()
 {
     TrendRequestProcessor<Trend> target = new TrendRequestProcessor<Trend>() { BaseUrl = "http://api.twitter.com/1/" };
     Dictionary<string, string> parameters =
         new Dictionary<string, string>
         {
             { "Type", ((int)TrendType.Available).ToString() },
             { "Longitude", "-122.40060" }
         };
     target.BuildURL(parameters);
 }
 public void BuildAvailableTrendsURLTest()
 {
     TrendRequestProcessor<Trend> target = new TrendRequestProcessor<Trend>() { BaseUrl = "http://api.twitter.com/1/" };
     Dictionary<string, string> parameters =
         new Dictionary<string, string>
         {
             { "Type", ((int)TrendType.Available).ToString() },
             { "Latitude", "37.78215" },
             { "Longitude", "-122.40060" }
         };
     string expected = "http://api.twitter.com/1/trends/available.xml?lat=37.78215&long=-122.40060";
     string actual;
     actual = target.BuildURL(parameters);
     Assert.AreEqual(expected, actual);
 }