Create a gist now

Instantly share code, notes, and snippets.

public class AdminRoutingBehaviors
public void When_navigating_to_manage_categories_url_result_is_correct()
const string expectedAction = "categories";
const string expectedController = "Admin";
const string url = "~/admin/categories";
var result = GetRouteData(url);
private static RouteData GetRouteData(string url)
var routes = new RouteCollection();
var httpContextMock = new Mock<HttpContextBase>();
httpContextMock.Setup(c => c.Request.AppRelativeCurrentExecutionFilePath)
return routes.GetRouteData(httpContextMock.Object);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment