public void RedwoodRoute_IsMatch_UrlTwoParametersBothRequired_NoMatchWhenOneSpecified() { var route = new RedwoodRoute("Article/{Id}/{Title}", null, null); IDictionary<string, object> parameters; var result = route.IsMatch("Article/15", out parameters); Assert.IsFalse(result); }
public void RedwoodRoute_IsMatch_UrlTwoParametersBothRequired_DifferentPart() { var route = new RedwoodRoute("Article/id_{Id}/{Title}", null, null); IDictionary<string, object> parameters; var result = route.IsMatch("Articles/id_15", out parameters); Assert.IsFalse(result); }
public void RedwoodRoute_IsMatch_EmptyRouteMatchesEmptyUrl() { var route = new RedwoodRoute("", null, null); IDictionary<string, object> parameters; var result = route.IsMatch("", out parameters); Assert.IsTrue(result); }
public void RedwoodRoute_IsMatch_UrlTwoParametersBothRequired_BothSpecified() { var route = new RedwoodRoute("Article/id_{Id}/{Title}", null, null); IDictionary<string, object> parameters; var result = route.IsMatch("Article/id_15/test", out parameters); Assert.IsTrue(result); Assert.AreEqual(2, parameters.Count); Assert.AreEqual("15", parameters["Id"]); Assert.AreEqual("test", parameters["Title"]); }
public void RedwoodRoute_IsMatch_UrlWithoutParametersNoMatch() { var route = new RedwoodRoute("Hello/Test/Page.txt", null, null); IDictionary<string, object> parameters; var result = route.IsMatch("Hello/Test/Page", out parameters); Assert.IsFalse(result); }
public void RedwoodRoute_IsMatch_UrlTwoParametersOneSpecifiedOneDefault() { var route = new RedwoodRoute("Article/{Id}/{Title}", new { Title = "test" }, null); IDictionary<string, object> parameters; var result = route.IsMatch("Article/15", out parameters); Assert.IsTrue(result); Assert.AreEqual(2, parameters.Count); Assert.AreEqual("15", parameters["Id"]); Assert.AreEqual("test", parameters["Title"]); }