public void AddFakeResponse(RestUrlBuilder uri, HttpStatusCode code, string data)
 {
     MockedResponses.Add(
         new Uri(uri.ToString()),
         new HttpResponseMessage(code)
     {
         Content = new ByteArrayContent(GetBytes(data))
     }
         );
 }
        public void GetModelURLTests()
        {
            TestRestRequestUrl trru = new TestRestRequestUrl()
            {
                MiddleName = "michael"
            };

            string expected = "http://www.google.com/george/michael/bluth?show=Arrested%20Development&TimeStamp=1%2F1%2F0001%2012%3A00%3A00%20AM";
            string actual   = new RestUrlBuilder("http://www.google.com/", trru).ToString();

            Assert.AreEqual <string>(expected, actual);
        }
        public void ToStringTests()
        {
            Dictionary <int, string> segments = new Dictionary <int, string>();

            segments.Add(1, "Api");
            segments.Add(2, "news");

            Dictionary <string, string> qstring = new Dictionary <string, string>();

            qstring.Add("sort", "newest");
            qstring.Add("clientid", "reptar");

            RestUrlBuilder actual = new RestUrlBuilder("http://www.slashdot.org", segments, qstring);

            string expected = "http://www.slashdot.org/Api/news?clientid=reptar&sort=newest";

            Assert.AreEqual <string>(expected, actual.ToString());
        }