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 }
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"); }
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 }
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"); }