public void ConstraintsTreatedAsConstraints()
 {
     var segment = new ParameterSegment("controller", "Home", new RegexConstraint("^[0-9]+$"));
     Assert.IsFalse(segment.MatchPath(null, new PathIterator("/foo")).Success);
     Assert.IsTrue(segment.MatchPath(null, new PathIterator("/1")).Success);
     Assert.AreEqual("1", segment.MatchPath(null, new PathIterator("/1")).Values["controller"]);
 }
 public void EvaluateDefaulted()
 {
     var segment = new ParameterSegment("controller", "Home", null);
     Assert.IsTrue(segment.MatchPath(null, new PathIterator("")).Success);
     Assert.AreEqual("Home", segment.MatchPath(null, new PathIterator("")).Values["controller"]);
 }