示例#1
0
        public void Pipeline3()
        {
            var m = new UrlRoutingModule();

            RouteTable.Routes.Add(new MyRoute("{foo}/{bar}", new MyRouteHandler()));
#if NET_4_0
            var hc = new HttpContextStub5("~/x/y", String.Empty, "apppath");
#else
            var hc = new HttpContextStub2("~/x/y", String.Empty, "apppath");
#endif
            hc.SetResponse(new HttpResponseStub(2));
#if NET_4_0
            Assert.IsNull(m.RouteCollection.GetRouteData(hc), "#0");
#else
            Assert.IsNotNull(m.RouteCollection.GetRouteData(hc), "#0");
            m.PostResolveRequestCache(hc);
            try
            {
                m.PostMapRequestHandler(hc);
                Assert.Fail("#1");
            }
            catch (ApplicationException ex)
            {
                Assert.AreEqual("~/UrlRouting.axd", ex.Message, "#2");
            }
#endif
        }
示例#2
0
        public void Pipeline3()
        {
            var m = new UrlRoutingModule();

            RouteTable.Routes.Add(new MyRoute("{foo}/{bar}", new MyRouteHandler()));
            var hc = new HttpContextStub5("~/x/y", String.Empty, "apppath");

            hc.SetResponse(new HttpResponseStub(2));
            Assert.IsNull(m.RouteCollection.GetRouteData(hc), "#0");
        }
示例#3
0
		public void Pipeline3 ()
		{
			var m = new UrlRoutingModule ();
			RouteTable.Routes.Add (new MyRoute ("{foo}/{bar}", new MyRouteHandler ()));
#if NET_4_0
			var hc = new HttpContextStub5 ("~/x/y", String.Empty, "apppath");
#else
			var hc = new HttpContextStub2 ("~/x/y", String.Empty, "apppath");
#endif
			hc.SetResponse (new HttpResponseStub (2));
#if NET_4_0
			Assert.IsNull (m.RouteCollection.GetRouteData (hc), "#0");
#else
			Assert.IsNotNull (m.RouteCollection.GetRouteData (hc), "#0");
			m.PostResolveRequestCache (hc);
			try {
				m.PostMapRequestHandler (hc);
				Assert.Fail ("#1");
			} catch (ApplicationException ex) {
				Assert.AreEqual ("~/UrlRouting.axd", ex.Message, "#2");
			}
#endif
		}
示例#4
0
		public void Pipeline3 ()
		{
			var m = new UrlRoutingModule ();
			RouteTable.Routes.Add (new MyRoute ("{foo}/{bar}", new MyRouteHandler ()));
			var hc = new HttpContextStub5 ("~/x/y", String.Empty, "apppath");
			hc.SetResponse (new HttpResponseStub (2));
			Assert.IsNull (m.RouteCollection.GetRouteData (hc), "#0");
		}