Ejemplo n.º 1
0
 public void RouteValuesTest()
 {
     var route = new Route("/blog/{title}", () => null, null, null);
     var match = route.MatchPathToRoute("/blog/hello-world");
     Assert.AreEqual(true, match.Success);
     Assert.AreEqual("hello-world", match.Values["title"]);
 }
Ejemplo n.º 2
0
 public void Register(string path, object defaults = null, object constraints = null)
 {
     var route = new Route(path, () => new TestRouteHandler(), new RouteValueDictionary(defaults), new RouteValueDictionary(constraints));
     Add(route);
 }