public void EvaluateDefaulted() { var segment = new CatchAllParameterSegment("controller", "Home", null); Assert.IsTrue(segment.MatchPath(null, new PathIterator("")).Success); Assert.AreEqual("Home", segment.MatchPath(null, new PathIterator("")).Values["controller"]); }
public void ConstraintsTreatedAsConstraints() { var segment = new CatchAllParameterSegment("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"]); }