public void RouteWithTooManySegments() { // Arrange var context = new StubHttpContextForRouting(requestUrl: "~/a/b/c/d"); // Act RouteData routeData = _routes.GetRouteData(context); // Assert Assert.IsNull(routeData); }
public void RouteWithController_WithAction_NoId() { // Arrange var context = new StubHttpContextForRouting(requestUrl: "~/en/games/action2"); // Act RouteData routeData = _routes.GetRouteData(context); // Assert Assert.IsNotNull(routeData); Assert.AreEqual("Games", routeData.Values["controller"]); Assert.AreEqual("action2", routeData.Values["action"]); }
public void DefaultRoute() { // Arrange var context = new StubHttpContextForRouting("~/"); // Act RouteData routeData = _routes.GetRouteData(context); // Assert Assert.IsNotNull(routeData); Assert.AreEqual("Games", routeData.Values["controller"]); Assert.AreEqual("Index", routeData.Values["action"]); }
public void RouteForDetails() { // Arrange var context = new StubHttpContextForRouting(requestUrl: "~/en/game/Gta6_ThirdEdition/Details"); // Act RouteData routeData = _routes.GetRouteData(context); // Assert Assert.IsNotNull(routeData); Assert.AreEqual("Comments", routeData.Values["controller"]); Assert.AreEqual("Details", routeData.Values["action"]); Assert.AreEqual("Gta6_ThirdEdition", routeData.Values["key"]); }