更新时间:2023-02-17 12:37:07
我要检查RouteHandler上的RouteData匹配的忽略路径的路由型StopRoutingHandler的;
I would check that the RouteHandler on the RouteData for a route matching the ignored path is of type StopRoutingHandler;
[TestMethod]
public void TestIgnoredRoute()
{
// Arrange
var routes = new RouteCollection();
GlobalApplication.RegisterRoutes(routes);
// Act
var context = new FakeHttpContext("~/some.axd/path");
var routeData = routes.GetRouteData(context);
// Assert
Assert.IsInstanceOfType( routeData.RouteHandler, typeof(StopRoutingHandler) );
}