public void ProcessRequestNoMatch() { var h = new MyUrlRoutingHandler(); Assert.AreEqual(0, h.RouteCollection.Count, "#1"); h.DoProcessRequest(new HttpContextStub("~/foo")); }
public void ProcessRequestForStubContext() { var h = new MyUrlRoutingHandler(); // it results in call to HttpContextBase.get_Request() and thus NIE. h.DoProcessRequest(new HttpContextStub()); }
public void ProcessRequestMatchNoHandler() { var h = new MyUrlRoutingHandler(); var r = new Route("foo", null); h.RouteCollection.Add(r); h.DoProcessRequest(new HttpContextStub("~/foo", String.Empty)); }
public void ProcessRequestMatchStop() { var h = new MyUrlRoutingHandler(); var r = new Route("foo", new StopRoutingHandler()); h.RouteCollection.Add(r); h.DoProcessRequest(new HttpContextStub("~/foo", String.Empty)); // thrown by StopRoutingHandler.GetHttpHandler(). }
public void SetRouteCollectionNull () { var h = new MyUrlRoutingHandler (); RouteTable.Routes.Add (new Route (null, null)); Assert.IsNotNull (h.RouteCollection, "#1"); Assert.AreEqual (RouteTable.Routes, h.RouteCollection, "#1-2"); h.RouteCollection = null; Assert.IsNotNull (h.RouteCollection, "#2"); Assert.AreEqual (RouteTable.Routes, h.RouteCollection, "#2-2"); }
public void ProcessRequestPathInfoNIE() { var h = new MyUrlRoutingHandler(); var r = new Route("foo", null); h.RouteCollection.Add(r); // it internally calls RouteCollection.GetRouteData() // and borks at HttpContextStub.Request.PathInfo NIE. h.DoProcessRequest(new HttpContextStub("~/foo")); }
public void SetRouteCollectionNull() { var h = new MyUrlRoutingHandler(); RouteTable.Routes.Add(new Route(null, null)); Assert.IsNotNull(h.RouteCollection, "#1"); Assert.AreEqual(RouteTable.Routes, h.RouteCollection, "#1-2"); h.RouteCollection = null; Assert.IsNotNull(h.RouteCollection, "#2"); Assert.AreEqual(RouteTable.Routes, h.RouteCollection, "#2-2"); }
public void ProcessRequestMatchError() { var h = new MyUrlRoutingHandler(); var r = new Route("foo", new ErrorRouteHandler()); h.RouteCollection.Add(r); try { h.DoProcessRequest(new HttpContextStub("~/foo", String.Empty)); Assert.Fail("#1"); } catch (ApplicationException ex) { Assert.AreEqual("ErrorRouteHandler", ex.Message, "#2"); } }
public void ProcessRequestNoHandler () { var h = new MyUrlRoutingHandler (); var r = new Route ("foo", null); h.RouteCollection.Add (r); h.DoProcessRequest (new HttpContextStub ("~/foo", String.Empty)); }
public void ProcessRequestPathInfoNIE () { var h = new MyUrlRoutingHandler (); var r = new Route ("foo", null); h.RouteCollection.Add (r); // it internally calls RouteCollection.GetRouteData() // and borks at HttpContextStub.Request.PathInfo NIE. h.DoProcessRequest (new HttpContextStub ("~/foo")); }
public void ProcessRequestNoMatch () { var h = new MyUrlRoutingHandler (); Assert.AreEqual (0, h.RouteCollection.Count, "#1"); h.DoProcessRequest (new HttpContextStub ("~/foo")); }
public void ProcessRequestForStubContext () { var h = new MyUrlRoutingHandler (); // it results in call to HttpContextBase.get_Request() and thus NIE. h.DoProcessRequest (new HttpContextStub ()); }
public void ProcessRequestMatchError () { var h = new MyUrlRoutingHandler (); var r = new Route ("foo", new ErrorRouteHandler ()); h.RouteCollection.Add (r); try { h.DoProcessRequest (new HttpContextStub ("~/foo", String.Empty)); Assert.Fail ("#1"); } catch (ApplicationException ex) { Assert.AreEqual ("ErrorRouteHandler", ex.Message, "#2"); } }
public void ProcessRequestMatchStop () { var h = new MyUrlRoutingHandler (); var r = new Route ("foo", new StopRoutingHandler ()); h.RouteCollection.Add (r); h.DoProcessRequest (new HttpContextStub ("~/foo", String.Empty)); // thrown by StopRoutingHandler.GetHttpHandler(). }