public async Task NotExistent_RouteDefinitionMatch_Test() { var httpContext = new DefaultHttpContext(); A.CallTo(() => _routeDefinitionMatcher.MatchAsync( httpContext.Request.Path, httpContext.Request.Method)) .Returns <RouteDefinitionMatch>(null); await _middleware.InvokeAsync(httpContext); Assert.IsNull(httpContext.GetRouteDefinitionMatch()); A.CallTo(() => _next(httpContext)) .MustHaveHappened(); }