From e1e7ec0f289e0a468c2cef9b61795755373ecad6 Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Sat, 21 Jul 2018 04:44:13 -0700 Subject: [PATCH 1/4] Enable couple of skipped Dispatching functional tests --- .../DispatchingTests.cs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/DispatchingTests.cs b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/DispatchingTests.cs index 05525fc755..0cee884762 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/DispatchingTests.cs +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/DispatchingTests.cs @@ -18,24 +18,12 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests { } - [Fact(Skip = "Link generation issue in dispatching. Need to fix - https://github.com/aspnet/Routing/issues/590")] - public override Task AttributeRoutedAction_InArea_ExplicitLeaveArea() - { - return Task.CompletedTask; - } - [Fact(Skip = "Link generation issue in dispatching. Need to fix - https://github.com/aspnet/Routing/issues/590")] public override Task AttributeRoutedAction_InArea_StaysInArea_ActionDoesntExist() { return Task.CompletedTask; } - [Fact(Skip = "Link generation issue in dispatching. Need to fix - https://github.com/aspnet/Routing/issues/590")] - public override Task ConventionalRoutedAction_InArea_ExplicitLeaveArea() - { - return Task.CompletedTask; - } - [Fact(Skip = "Link generation issue in dispatching. Need to fix - https://github.com/aspnet/Routing/issues/590")] public override Task ConventionalRoutedAction_InArea_StaysInArea() { From c0ba374549d20825a2a51cc57efd51f7b7f61357 Mon Sep 17 00:00:00 2001 From: "kishan.anem" Date: Sun, 22 Jul 2018 17:55:06 +0530 Subject: [PATCH 2/4] Custom error messages with validation message tag helper #8035 #8035 PR #8087 https://github.com/aspnet/Razor/issues/2497 --- .../ValidationMessageTagHelper.cs | 36 +++++++++---------- .../ValidationMessageTagHelperTest.cs | 7 ++-- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/ValidationMessageTagHelper.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/ValidationMessageTagHelper.cs index 8858623013..85d8d07837 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/ValidationMessageTagHelper.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/ValidationMessageTagHelper.cs @@ -71,11 +71,24 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers }; } + string message = null; + if (!output.IsContentModified) + { + var tagHelperContent = await output.GetChildContentAsync(); + + // We check for whitespace to detect scenarios such as: + // + // + if (!tagHelperContent.IsEmptyOrWhiteSpace) + { + message = tagHelperContent.GetContent(); + } + } var tagBuilder = Generator.GenerateValidationMessage( ViewContext, For.ModelExplorer, For.Name, - message: null, + message: message, tag: null, htmlAttributes: htmlAttributes); @@ -84,27 +97,12 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers output.MergeAttributes(tagBuilder); // Do not update the content if another tag helper targeting this element has already done so. - if (!output.IsContentModified) + if (!output.IsContentModified && tagBuilder.HasInnerHtml) { - // We check for whitespace to detect scenarios such as: - // - // - var childContent = await output.GetChildContentAsync(); - if (childContent.IsEmptyOrWhiteSpace) - { - // Provide default message text (if any) since there was nothing useful in the Razor source. - if (tagBuilder.HasInnerHtml) - { - output.Content.SetHtmlContent(tagBuilder.InnerHtml); - } - } - else - { - output.Content.SetHtmlContent(childContent); - } + output.Content.SetHtmlContent(tagBuilder.InnerHtml); } } } } } -} \ No newline at end of file +} diff --git a/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/ValidationMessageTagHelperTest.cs b/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/ValidationMessageTagHelperTest.cs index 69522655cb..1c919635be 100644 --- a/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/ValidationMessageTagHelperTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/ValidationMessageTagHelperTest.cs @@ -357,10 +357,11 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers } [Theory] - [InlineData("Content of validation message", "Content of validation message")] - [InlineData("\r\n \r\n", "New HTML")] + [InlineData("Content of validation message", "Content of validation message", "New HTML")] + [InlineData("\r\n \r\n", null, "New HTML")] public async Task ProcessAsync_MergesTagBuilderFromGenerateValidationMessage( string childContent, + string expectedMessage, string expectedOutputContent) { // Arrange @@ -375,7 +376,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers It.IsAny(), It.IsAny(), It.IsAny(), - It.IsAny(), + expectedMessage, It.IsAny(), It.IsAny())) .Returns(tagBuilder); From 3c73a98357b12a337c6bea6c26f7d3220ac0eac9 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 22 Jul 2018 12:21:04 -0700 Subject: [PATCH 3/4] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 144 +++++++++++++++++++-------------------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 33521fbe2c..12a0121bad 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -16,87 +16,87 @@ 0.42.1 2.1.0 2.1.0-rc1-final - 2.2.0-preview1-34709 + 2.2.0-preview1-34755 2.2.0-preview1-17099 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-a-preview1-route-pattern-16756 - 2.2.0-a-preview1-route-pattern-16756 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 5.2.6 2.8.0 2.8.0 - 2.2.0-preview1-34709 + 2.2.0-preview1-34755 1.7.0 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 2.1.0 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 2.0.9 2.1.2 2.2.0-preview1-26618-02 - 2.2.0-preview1-34709 - 2.2.0-preview1-34709 + 2.2.0-preview1-34755 + 2.2.0-preview1-34755 15.6.1 4.7.49 2.0.3 From 196e3f109f0ae2a561ba1024bce5b1567e252838 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Sun, 22 Jul 2018 16:34:01 -0700 Subject: [PATCH 4/4] React to Routing branding This is a reaction PR for the branding changes in progress in Routing. This can be merged after the changes to in to Routing. --- build/dependencies.props | 144 +++++++++--------- .../MvcCoreServiceCollectionExtensions.cs | 2 +- .../Internal/MvcEndpointDataSource.cs | 2 +- ...UrlHelper.cs => GlobalRoutingUrlHelper.cs} | 10 +- .../Routing/UrlHelperFactory.cs | 4 +- ...rTest.cs => GlobalRoutingUrlHelperTest.cs} | 6 +- ...=> ConsumesAttributeGlobalRoutingTests.cs} | 4 +- ...spatchingTests.cs => GlobalRoutingTest.cs} | 10 +- ...cs => RequestServicesGlobalRoutingTest.cs} | 4 +- ...est.cs => VersioningGlobalRoutingTests.cs} | 4 +- ...atching.cs => StartupWithGlobalRouting.cs} | 6 +- ...atching.cs => StartupWithGlobalRouting.cs} | 15 +- ...atching.cs => StartupWithGlobalRouting.cs} | 6 +- 13 files changed, 103 insertions(+), 114 deletions(-) rename src/Microsoft.AspNetCore.Mvc.Core/Routing/{DispatcherUrlHelper.cs => GlobalRoutingUrlHelper.cs} (93%) rename test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/{DispatcherUrlHelperTest.cs => GlobalRoutingUrlHelperTest.cs} (97%) rename test/Microsoft.AspNetCore.Mvc.FunctionalTests/{ConsumesAttributeDispatchingTests.cs => ConsumesAttributeGlobalRoutingTests.cs} (54%) rename test/Microsoft.AspNetCore.Mvc.FunctionalTests/{DispatchingTests.cs => GlobalRoutingTest.cs} (77%) rename test/Microsoft.AspNetCore.Mvc.FunctionalTests/{VersioningDispatchingTests.cs => RequestServicesGlobalRoutingTest.cs} (55%) rename test/Microsoft.AspNetCore.Mvc.FunctionalTests/{RequestServicesDispatchingTest.cs => VersioningGlobalRoutingTests.cs} (55%) rename test/WebSites/BasicWebSite/{StartupWithDispatching.cs => StartupWithGlobalRouting.cs} (91%) rename test/WebSites/RoutingWebSite/{StartupWithDispatching.cs => StartupWithGlobalRouting.cs} (77%) rename test/WebSites/VersioningWebSite/{StartupWithDispatching.cs => StartupWithGlobalRouting.cs} (89%) diff --git a/build/dependencies.props b/build/dependencies.props index 12a0121bad..9c0bc2d198 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -16,87 +16,87 @@ 0.42.1 2.1.0 2.1.0-rc1-final - 2.2.0-preview1-34755 + 2.2.0-preview1-34758 2.2.0-preview1-17099 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 5.2.6 2.8.0 2.8.0 - 2.2.0-preview1-34755 + 2.2.0-preview1-34758 1.7.0 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 2.1.0 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 2.0.9 2.1.2 2.2.0-preview1-26618-02 - 2.2.0-preview1-34755 - 2.2.0-preview1-34755 + 2.2.0-preview1-34758 + 2.2.0-preview1-34758 15.6.1 4.7.49 2.0.3 diff --git a/src/Microsoft.AspNetCore.Mvc.Core/DependencyInjection/MvcCoreServiceCollectionExtensions.cs b/src/Microsoft.AspNetCore.Mvc.Core/DependencyInjection/MvcCoreServiceCollectionExtensions.cs index 2f48bbedb0..3d50285d76 100644 --- a/src/Microsoft.AspNetCore.Mvc.Core/DependencyInjection/MvcCoreServiceCollectionExtensions.cs +++ b/src/Microsoft.AspNetCore.Mvc.Core/DependencyInjection/MvcCoreServiceCollectionExtensions.cs @@ -261,7 +261,7 @@ namespace Microsoft.Extensions.DependencyInjection services.TryAddTransient(); // Many per app // - // Dispatching + // Global Routing / Endpoints // services.TryAddEnumerable( ServiceDescriptor.Singleton()); diff --git a/src/Microsoft.AspNetCore.Mvc.Core/Internal/MvcEndpointDataSource.cs b/src/Microsoft.AspNetCore.Mvc.Core/Internal/MvcEndpointDataSource.cs index c8738bb20e..f725da108b 100644 --- a/src/Microsoft.AspNetCore.Mvc.Core/Internal/MvcEndpointDataSource.cs +++ b/src/Microsoft.AspNetCore.Mvc.Core/Internal/MvcEndpointDataSource.cs @@ -79,7 +79,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal // up the endpoints too. // // Start with an order of '1' for conventional routes as attribute routes have a default order of '0'. - // This is for scenarios dealing with migrating existing Routing based code to Dispatcher world. + // This is for scenarios dealing with migrating existing Router based code to Global Routing world. var conventionalRouteOrder = 0; // Check each of the conventional templates to see if the action would be reachable diff --git a/src/Microsoft.AspNetCore.Mvc.Core/Routing/DispatcherUrlHelper.cs b/src/Microsoft.AspNetCore.Mvc.Core/Routing/GlobalRoutingUrlHelper.cs similarity index 93% rename from src/Microsoft.AspNetCore.Mvc.Core/Routing/DispatcherUrlHelper.cs rename to src/Microsoft.AspNetCore.Mvc.Core/Routing/GlobalRoutingUrlHelper.cs index 8b0efc4c38..e77274c3cd 100644 --- a/src/Microsoft.AspNetCore.Mvc.Core/Routing/DispatcherUrlHelper.cs +++ b/src/Microsoft.AspNetCore.Mvc.Core/Routing/GlobalRoutingUrlHelper.cs @@ -12,14 +12,14 @@ namespace Microsoft.AspNetCore.Mvc.Routing /// An implementation of that uses to build URLs /// for ASP.NET MVC within an application. /// - internal class DispatcherUrlHelper : UrlHelperBase + internal class GlobalRoutingUrlHelper : UrlHelperBase { - private readonly ILogger _logger; + private readonly ILogger _logger; private readonly LinkGenerator _linkGenerator; private readonly IEndpointFinder _routeValuesBasedEndpointFinder; /// - /// Initializes a new instance of the class using the specified + /// Initializes a new instance of the class using the specified /// . /// /// The for the current request. @@ -28,11 +28,11 @@ namespace Microsoft.AspNetCore.Mvc.Routing /// /// The used to generate the link. /// The . - public DispatcherUrlHelper( + public GlobalRoutingUrlHelper( ActionContext actionContext, IEndpointFinder routeValuesBasedEndpointFinder, LinkGenerator linkGenerator, - ILogger logger) + ILogger logger) : base(actionContext) { if (linkGenerator == null) diff --git a/src/Microsoft.AspNetCore.Mvc.Core/Routing/UrlHelperFactory.cs b/src/Microsoft.AspNetCore.Mvc.Core/Routing/UrlHelperFactory.cs index 9d464aafa3..6db7f35638 100644 --- a/src/Microsoft.AspNetCore.Mvc.Core/Routing/UrlHelperFactory.cs +++ b/src/Microsoft.AspNetCore.Mvc.Core/Routing/UrlHelperFactory.cs @@ -53,9 +53,9 @@ namespace Microsoft.AspNetCore.Mvc.Routing var services = httpContext.RequestServices; var linkGenerator = services.GetRequiredService(); var routeValuesBasedEndpointFinder = services.GetRequiredService>(); - var logger = services.GetRequiredService>(); + var logger = services.GetRequiredService>(); - urlHelper = new DispatcherUrlHelper( + urlHelper = new GlobalRoutingUrlHelper( context, routeValuesBasedEndpointFinder, linkGenerator, diff --git a/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/DispatcherUrlHelperTest.cs b/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/GlobalRoutingUrlHelperTest.cs similarity index 97% rename from test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/DispatcherUrlHelperTest.cs rename to test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/GlobalRoutingUrlHelperTest.cs index b069feabc6..78c7551c43 100644 --- a/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/DispatcherUrlHelperTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/GlobalRoutingUrlHelperTest.cs @@ -14,7 +14,7 @@ using Xunit; namespace Microsoft.AspNetCore.Mvc.Routing { - public class DispatcherUrlHelperTest : UrlHelperTestBase + public class GlobalRoutingUrlHelperTest : UrlHelperTestBase { protected override IUrlHelper CreateUrlHelper(string appRoot, string host, string protocol) { @@ -60,7 +60,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing var urlHelperFactory = httpContext.RequestServices.GetRequiredService(); var urlHelper = urlHelperFactory.GetUrlHelper(actionContext); - Assert.IsType(urlHelper); + Assert.IsType(urlHelper); return urlHelper; } @@ -136,7 +136,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing } var services = GetCommonServices(); - services.AddDispatcher(); + services.AddRouting(); services.TryAddEnumerable( ServiceDescriptor.Singleton(new DefaultEndpointDataSource(endpoints))); services.TryAddSingleton(); diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/ConsumesAttributeDispatchingTests.cs b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/ConsumesAttributeGlobalRoutingTests.cs similarity index 54% rename from test/Microsoft.AspNetCore.Mvc.FunctionalTests/ConsumesAttributeDispatchingTests.cs rename to test/Microsoft.AspNetCore.Mvc.FunctionalTests/ConsumesAttributeGlobalRoutingTests.cs index ced707f674..889e77e80b 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/ConsumesAttributeDispatchingTests.cs +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/ConsumesAttributeGlobalRoutingTests.cs @@ -3,9 +3,9 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests { - public class ConsumesAttributeDispatchingTests : ConsumesAttributeTestsBase + public class ConsumesAttributeGlobalRoutingTests : ConsumesAttributeTestsBase { - public ConsumesAttributeDispatchingTests(MvcTestFixture fixture) + public ConsumesAttributeGlobalRoutingTests(MvcTestFixture fixture) : base(fixture) { } diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/DispatchingTests.cs b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/GlobalRoutingTest.cs similarity index 77% rename from test/Microsoft.AspNetCore.Mvc.FunctionalTests/DispatchingTests.cs rename to test/Microsoft.AspNetCore.Mvc.FunctionalTests/GlobalRoutingTest.cs index 0cee884762..1ab9950d68 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/DispatchingTests.cs +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/GlobalRoutingTest.cs @@ -4,27 +4,25 @@ using System; using System.Net; using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.Internal; -using Microsoft.AspNetCore.Routing; using Newtonsoft.Json; using Xunit; namespace Microsoft.AspNetCore.Mvc.FunctionalTests { - public class DispatchingTests : RoutingTestsBase + public class GlobalRoutingTest : RoutingTestsBase { - public DispatchingTests(MvcTestFixture fixture) + public GlobalRoutingTest(MvcTestFixture fixture) : base(fixture) { } - [Fact(Skip = "Link generation issue in dispatching. Need to fix - https://github.com/aspnet/Routing/issues/590")] + [Fact(Skip = "Link generation issue in global routing. Need to fix - https://github.com/aspnet/Routing/issues/590")] public override Task AttributeRoutedAction_InArea_StaysInArea_ActionDoesntExist() { return Task.CompletedTask; } - [Fact(Skip = "Link generation issue in dispatching. Need to fix - https://github.com/aspnet/Routing/issues/590")] + [Fact(Skip = "Link generation issue in global routing. Need to fix - https://github.com/aspnet/Routing/issues/590")] public override Task ConventionalRoutedAction_InArea_StaysInArea() { return Task.CompletedTask; diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/VersioningDispatchingTests.cs b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/RequestServicesGlobalRoutingTest.cs similarity index 55% rename from test/Microsoft.AspNetCore.Mvc.FunctionalTests/VersioningDispatchingTests.cs rename to test/Microsoft.AspNetCore.Mvc.FunctionalTests/RequestServicesGlobalRoutingTest.cs index ff0c8e700c..0c1471df03 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/VersioningDispatchingTests.cs +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/RequestServicesGlobalRoutingTest.cs @@ -3,9 +3,9 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests { - public class VersioningDispatchingTests : VersioningTestsBase + public class RequestServicesGlobalRoutingTest : RequestServicesTestBase { - public VersioningDispatchingTests(MvcTestFixture fixture) + public RequestServicesGlobalRoutingTest(MvcTestFixture fixture) : base(fixture) { } diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/RequestServicesDispatchingTest.cs b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/VersioningGlobalRoutingTests.cs similarity index 55% rename from test/Microsoft.AspNetCore.Mvc.FunctionalTests/RequestServicesDispatchingTest.cs rename to test/Microsoft.AspNetCore.Mvc.FunctionalTests/VersioningGlobalRoutingTests.cs index f725d9ed92..8c022a076c 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/RequestServicesDispatchingTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/VersioningGlobalRoutingTests.cs @@ -3,9 +3,9 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests { - public class RequestServicesDispatchingTest : RequestServicesTestBase + public class VersioningGlobalRoutingTests : VersioningTestsBase { - public RequestServicesDispatchingTest(MvcTestFixture fixture) + public VersioningGlobalRoutingTests(MvcTestFixture fixture) : base(fixture) { } diff --git a/test/WebSites/BasicWebSite/StartupWithDispatching.cs b/test/WebSites/BasicWebSite/StartupWithGlobalRouting.cs similarity index 91% rename from test/WebSites/BasicWebSite/StartupWithDispatching.cs rename to test/WebSites/BasicWebSite/StartupWithGlobalRouting.cs index eb122b7290..037a5312f8 100644 --- a/test/WebSites/BasicWebSite/StartupWithDispatching.cs +++ b/test/WebSites/BasicWebSite/StartupWithGlobalRouting.cs @@ -7,12 +7,12 @@ using Microsoft.Extensions.DependencyInjection; namespace BasicWebSite { - public class StartupWithDispatching + public class StartupWithGlobalRouting { // Set up application services public void ConfigureServices(IServiceCollection services) { - services.AddDispatcher(); + services.AddRouting(); services.AddMvc() .SetCompatibilityVersion(CompatibilityVersion.Latest) @@ -29,7 +29,7 @@ namespace BasicWebSite // Initializes the RequestId service for each request app.UseMiddleware(); - app.UseDispatcher(); + app.UseGlobalRouting(); app.UseMvcWithEndpoint(routes => { diff --git a/test/WebSites/RoutingWebSite/StartupWithDispatching.cs b/test/WebSites/RoutingWebSite/StartupWithGlobalRouting.cs similarity index 77% rename from test/WebSites/RoutingWebSite/StartupWithDispatching.cs rename to test/WebSites/RoutingWebSite/StartupWithGlobalRouting.cs index 670ec5497d..abc0abf4fb 100644 --- a/test/WebSites/RoutingWebSite/StartupWithDispatching.cs +++ b/test/WebSites/RoutingWebSite/StartupWithGlobalRouting.cs @@ -1,27 +1,18 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; -using System.IO; -using System.Text; using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc.Infrastructure; -using Microsoft.AspNetCore.Mvc.Internal; -using Microsoft.AspNetCore.Routing; -using Microsoft.AspNetCore.Routing.Matchers; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.DependencyInjection.Extensions; -using Microsoft.Extensions.Logging; namespace RoutingWebSite { - public class StartupWithDispatching + public class StartupWithGlobalRouting { // Set up application services public void ConfigureServices(IServiceCollection services) { - services.AddDispatcher(); + services.AddRouting(); services.AddMvc(); @@ -31,7 +22,7 @@ namespace RoutingWebSite public void Configure(IApplicationBuilder app) { - app.UseDispatcher(); + app.UseGlobalRouting(); app.UseMvcWithEndpoint(routes => { diff --git a/test/WebSites/VersioningWebSite/StartupWithDispatching.cs b/test/WebSites/VersioningWebSite/StartupWithGlobalRouting.cs similarity index 89% rename from test/WebSites/VersioningWebSite/StartupWithDispatching.cs rename to test/WebSites/VersioningWebSite/StartupWithGlobalRouting.cs index 164f86550b..c7ea9739f7 100644 --- a/test/WebSites/VersioningWebSite/StartupWithDispatching.cs +++ b/test/WebSites/VersioningWebSite/StartupWithGlobalRouting.cs @@ -9,11 +9,11 @@ using Microsoft.Extensions.DependencyInjection; namespace VersioningWebSite { - public class StartupWithDispatching + public class StartupWithGlobalRouting { public void ConfigureServices(IServiceCollection services) { - services.AddDispatcher(); + services.AddRouting(); // Add MVC services to the services container services.AddMvc(); @@ -24,7 +24,7 @@ namespace VersioningWebSite public void Configure(IApplicationBuilder app) { - app.UseDispatcher(); + app.UseGlobalRouting(); app.UseMvcWithEndpoint(endpoints => {