示例#1
0
        public void TestParams()
        {
            using (var wc = new TimedWebClient())
            {
                var str = wc.DownloadString("http://localhost:5555/param/test");
                Assert.AreEqual("test", str);

                str = wc.DownloadString("http://localhost:5555/param/test2");
                Assert.AreEqual("test2", str);
            }
        }
示例#2
0
        public void TestFallback()
        {
            using (var wc = new TimedWebClient())
            {
                var str = wc.DownloadString("http://localhost:5555/url2/faw");
                Assert.AreEqual("url2fallback1", str);

                str = wc.DownloadString("http://localhost:5555/url2/dgfsdkglj");
                Assert.AreEqual("url2fallback1", str);

                str = wc.DownloadString("http://localhost:5555/urdgfsdkglj");
                Assert.AreEqual("fallback21", str);
            }
        }
示例#3
0
        public void TestDirectRoutes()
        {
            using (var wc = new TimedWebClient())
            {
                var str = wc.DownloadString("http://localhost:5555/url1");
                Assert.AreEqual("url1", str);

                str = wc.DownloadString("http://localhost:5555/url2");
                Assert.AreEqual("url2", str);

                str = wc.DownloadString("http://localhost:5555/url2/url3");
                Assert.AreEqual("url2url3", str);
            }
        }