diff --git a/src/Microsoft.AspNet.Mvc.ApiExplorer/ApiDescriptionGroupCollectionProvider.cs b/src/Microsoft.AspNet.Mvc.ApiExplorer/ApiDescriptionGroupCollectionProvider.cs index df756f1390..4cab75274c 100644 --- a/src/Microsoft.AspNet.Mvc.ApiExplorer/ApiDescriptionGroupCollectionProvider.cs +++ b/src/Microsoft.AspNet.Mvc.ApiExplorer/ApiDescriptionGroupCollectionProvider.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Mvc.ApiExplorer /// public class ApiDescriptionGroupCollectionProvider : IApiDescriptionGroupCollectionProvider { - private readonly IActionDescriptorsCollectionProvider _actionDescriptorCollectionProvider; + private readonly IActionDescriptorCollectionProvider _actionDescriptorCollectionProvider; private readonly IApiDescriptionProvider[] _apiDescriptionProviders; private ApiDescriptionGroupCollection _apiDescriptionGroups; @@ -19,13 +19,13 @@ namespace Microsoft.AspNet.Mvc.ApiExplorer /// Creates a new instance of . /// /// - /// The . + /// The . /// /// /// The . /// public ApiDescriptionGroupCollectionProvider( - IActionDescriptorsCollectionProvider actionDescriptorCollectionProvider, + IActionDescriptorCollectionProvider actionDescriptorCollectionProvider, IEnumerable apiDescriptionProviders) { _actionDescriptorCollectionProvider = actionDescriptorCollectionProvider; @@ -47,7 +47,7 @@ namespace Microsoft.AspNet.Mvc.ApiExplorer } } - private ApiDescriptionGroupCollection GetCollection(ActionDescriptorsCollection actionDescriptors) + private ApiDescriptionGroupCollection GetCollection(ActionDescriptorCollection actionDescriptors) { var context = new ApiDescriptionProviderContext(actionDescriptors.Items); diff --git a/src/Microsoft.AspNet.Mvc.Core/DependencyInjection/MvcCoreServiceCollectionExtensions.cs b/src/Microsoft.AspNet.Mvc.Core/DependencyInjection/MvcCoreServiceCollectionExtensions.cs index 04dc0e6344..35cceb894f 100644 --- a/src/Microsoft.AspNet.Mvc.Core/DependencyInjection/MvcCoreServiceCollectionExtensions.cs +++ b/src/Microsoft.AspNet.Mvc.Core/DependencyInjection/MvcCoreServiceCollectionExtensions.cs @@ -84,7 +84,7 @@ namespace Microsoft.Extensions.DependencyInjection ServiceDescriptor.Transient()); services.TryAddEnumerable( ServiceDescriptor.Transient()); - services.TryAddSingleton(); + services.TryAddSingleton(); // // Action Selection diff --git a/src/Microsoft.AspNet.Mvc.Core/Infrastructure/ActionDescriptorsCollection.cs b/src/Microsoft.AspNet.Mvc.Core/Infrastructure/ActionDescriptorCollection.cs similarity index 88% rename from src/Microsoft.AspNet.Mvc.Core/Infrastructure/ActionDescriptorsCollection.cs rename to src/Microsoft.AspNet.Mvc.Core/Infrastructure/ActionDescriptorCollection.cs index d7fc85bfe8..836a8dec03 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Infrastructure/ActionDescriptorsCollection.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Infrastructure/ActionDescriptorCollection.cs @@ -10,14 +10,14 @@ namespace Microsoft.AspNet.Mvc.Infrastructure /// /// A cached collection of . /// - public class ActionDescriptorsCollection + public class ActionDescriptorCollection { /// - /// Initializes a new instance of the . + /// Initializes a new instance of the . /// /// The result of action discovery /// The unique version of discovered actions. - public ActionDescriptorsCollection(IReadOnlyList items, int version) + public ActionDescriptorCollection(IReadOnlyList items, int version) { if (items == null) { diff --git a/src/Microsoft.AspNet.Mvc.Core/Infrastructure/DefaultActionDescriptorsCollectionProvider.cs b/src/Microsoft.AspNet.Mvc.Core/Infrastructure/DefaultActionDescriptorCollectionProvider.cs similarity index 77% rename from src/Microsoft.AspNet.Mvc.Core/Infrastructure/DefaultActionDescriptorsCollectionProvider.cs rename to src/Microsoft.AspNet.Mvc.Core/Infrastructure/DefaultActionDescriptorCollectionProvider.cs index a9c676f611..92d3a5e638 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Infrastructure/DefaultActionDescriptorsCollectionProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Infrastructure/DefaultActionDescriptorCollectionProvider.cs @@ -10,19 +10,19 @@ using Microsoft.Extensions.DependencyInjection; namespace Microsoft.AspNet.Mvc.Infrastructure { /// - /// Default implementation for ActionDescriptors. + /// Default implementation of . /// This implementation caches the results at first call, and is not responsible for updates. /// - public class DefaultActionDescriptorsCollectionProvider : IActionDescriptorsCollectionProvider + public class DefaultActionDescriptorCollectionProvider : IActionDescriptorCollectionProvider { private readonly IServiceProvider _serviceProvider; - private ActionDescriptorsCollection _collection; + private ActionDescriptorCollection _collection; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The application IServiceProvider. - public DefaultActionDescriptorsCollectionProvider(IServiceProvider serviceProvider) + public DefaultActionDescriptorCollectionProvider(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; } @@ -30,7 +30,7 @@ namespace Microsoft.AspNet.Mvc.Infrastructure /// /// Returns a cached collection of . /// - public ActionDescriptorsCollection ActionDescriptors + public ActionDescriptorCollection ActionDescriptors { get { @@ -43,7 +43,7 @@ namespace Microsoft.AspNet.Mvc.Infrastructure } } - private ActionDescriptorsCollection GetCollection() + private ActionDescriptorCollection GetCollection() { var providers = _serviceProvider.GetServices() @@ -62,7 +62,7 @@ namespace Microsoft.AspNet.Mvc.Infrastructure providers[i].OnProvidersExecuted(context); } - return new ActionDescriptorsCollection( + return new ActionDescriptorCollection( new ReadOnlyCollection(context.Results), 0); } } diff --git a/src/Microsoft.AspNet.Mvc.Core/Infrastructure/IActionDescriptorsCollectionProvider.cs b/src/Microsoft.AspNet.Mvc.Core/Infrastructure/IActionDescriptorCollectionProvider.cs similarity index 80% rename from src/Microsoft.AspNet.Mvc.Core/Infrastructure/IActionDescriptorsCollectionProvider.cs rename to src/Microsoft.AspNet.Mvc.Core/Infrastructure/IActionDescriptorCollectionProvider.cs index 8e31c09251..dc25e54a4d 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Infrastructure/IActionDescriptorsCollectionProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Infrastructure/IActionDescriptorCollectionProvider.cs @@ -10,16 +10,16 @@ namespace Microsoft.AspNet.Mvc.Infrastructure /// The default implementation, does not update the cache, it is up to the user /// to create or use an implementation that can update the available actions in /// the application. The implementor is also responsible for updating the - /// in a thread safe way. + /// in a thread safe way. /// /// Default consumers of this service, are aware of the version and will recache /// data as appropriate, but rely on the version being unique. /// - public interface IActionDescriptorsCollectionProvider + public interface IActionDescriptorCollectionProvider { /// - /// Returns the current cached + /// Returns the current cached /// - ActionDescriptorsCollection ActionDescriptors { get; } + ActionDescriptorCollection ActionDescriptors { get; } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.Mvc.Core/Routing/ActionSelectionDecisionTree.cs b/src/Microsoft.AspNet.Mvc.Core/Routing/ActionSelectionDecisionTree.cs index 80ce81af5d..cd3723f14d 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Routing/ActionSelectionDecisionTree.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Routing/ActionSelectionDecisionTree.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; #if NET451 using System.ComponentModel; #endif -using System.Diagnostics; using Microsoft.AspNet.Mvc.Abstractions; using Microsoft.AspNet.Mvc.Infrastructure; using Microsoft.AspNet.Routing; @@ -22,8 +21,8 @@ namespace Microsoft.AspNet.Mvc.Routing /// /// Creates a new . /// - /// The . - public ActionSelectionDecisionTree(ActionDescriptorsCollection actions) + /// The . + public ActionSelectionDecisionTree(ActionDescriptorCollection actions) { Version = actions.Version; diff --git a/src/Microsoft.AspNet.Mvc.Core/Routing/ActionSelectorDecisionTreeProvider.cs b/src/Microsoft.AspNet.Mvc.Core/Routing/ActionSelectorDecisionTreeProvider.cs index e1cb10ec1b..ff70f7c9a7 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Routing/ActionSelectorDecisionTreeProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Routing/ActionSelectorDecisionTreeProvider.cs @@ -10,19 +10,19 @@ namespace Microsoft.AspNet.Mvc.Routing /// public class ActionSelectorDecisionTreeProvider : IActionSelectorDecisionTreeProvider { - private readonly IActionDescriptorsCollectionProvider _actionDescriptorsCollectionProvider; + private readonly IActionDescriptorCollectionProvider _actionDescriptorCollectionProvider; private ActionSelectionDecisionTree _decisionTree; /// /// Creates a new . /// - /// - /// The . + /// + /// The . /// public ActionSelectorDecisionTreeProvider( - IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider) + IActionDescriptorCollectionProvider actionDescriptorCollectionProvider) { - _actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider; + _actionDescriptorCollectionProvider = actionDescriptorCollectionProvider; } /// @@ -30,13 +30,13 @@ namespace Microsoft.AspNet.Mvc.Routing { get { - var descriptors = _actionDescriptorsCollectionProvider.ActionDescriptors; + var descriptors = _actionDescriptorCollectionProvider.ActionDescriptors; if (descriptors == null) { throw new InvalidOperationException( Resources.FormatPropertyOfTypeCannotBeNull( "ActionDescriptors", - _actionDescriptorsCollectionProvider.GetType())); + _actionDescriptorCollectionProvider.GetType())); } if (_decisionTree == null || descriptors.Version != _decisionTree.Version) diff --git a/src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRoute.cs b/src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRoute.cs index ae48e99f6a..491162422d 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRoute.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRoute.cs @@ -21,7 +21,7 @@ namespace Microsoft.AspNet.Mvc.Routing public class AttributeRoute : IRouter { private readonly IRouter _target; - private readonly IActionDescriptorsCollectionProvider _actionDescriptorsCollectionProvider; + private readonly IActionDescriptorCollectionProvider _actionDescriptorCollectionProvider; private readonly IInlineConstraintResolver _constraintResolver; private readonly ObjectPool _contextPool; private readonly UrlEncoder _urlEncoder; @@ -31,7 +31,7 @@ namespace Microsoft.AspNet.Mvc.Routing public AttributeRoute( IRouter target, - IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider, + IActionDescriptorCollectionProvider actionDescriptorCollectionProvider, IInlineConstraintResolver constraintResolver, ObjectPool contextPool, UrlEncoder urlEncoder, @@ -42,9 +42,9 @@ namespace Microsoft.AspNet.Mvc.Routing throw new ArgumentNullException(nameof(target)); } - if (actionDescriptorsCollectionProvider == null) + if (actionDescriptorCollectionProvider == null) { - throw new ArgumentNullException(nameof(actionDescriptorsCollectionProvider)); + throw new ArgumentNullException(nameof(actionDescriptorCollectionProvider)); } if (constraintResolver == null) @@ -68,7 +68,7 @@ namespace Microsoft.AspNet.Mvc.Routing } _target = target; - _actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider; + _actionDescriptorCollectionProvider = actionDescriptorCollectionProvider; _constraintResolver = constraintResolver; _contextPool = contextPool; _urlEncoder = urlEncoder; @@ -91,7 +91,7 @@ namespace Microsoft.AspNet.Mvc.Routing private TreeRouter GetTreeRouter() { - var actions = _actionDescriptorsCollectionProvider.ActionDescriptors; + var actions = _actionDescriptorCollectionProvider.ActionDescriptors; // This is a safe-race. We'll never set router back to null after initializing // it on startup. @@ -103,7 +103,7 @@ namespace Microsoft.AspNet.Mvc.Routing return _router; } - private TreeRouter BuildRoute(ActionDescriptorsCollection actions) + private TreeRouter BuildRoute(ActionDescriptorCollection actions) { var routeBuilder = new TreeRouteBuilder(_target, _loggerFactory); var routeInfos = GetRouteInfos(_constraintResolver, actions.Items); diff --git a/src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRouting.cs b/src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRouting.cs index 5b52c9629f..dfa20786c1 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRouting.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRouting.cs @@ -32,7 +32,7 @@ namespace Microsoft.AspNet.Mvc.Routing throw new ArgumentNullException(nameof(services)); } - var actionDescriptorProvider = services.GetRequiredService(); + var actionDescriptorProvider = services.GetRequiredService(); var inlineConstraintResolver = services.GetRequiredService(); var pool = services.GetRequiredService>(); var urlEncoder = services.GetRequiredService(); diff --git a/src/Microsoft.AspNet.Mvc.Core/Routing/IActionSelectionDecisionTree.cs b/src/Microsoft.AspNet.Mvc.Core/Routing/IActionSelectionDecisionTree.cs index 4236a09850..eab340ffd7 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Routing/IActionSelectionDecisionTree.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Routing/IActionSelectionDecisionTree.cs @@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Mvc.Routing { /// /// Gets the version. The same as the value of - /// . + /// . /// int Version { get; } diff --git a/src/Microsoft.AspNet.Mvc.Core/Routing/IActionSelectorDecisionTreeProvider.cs b/src/Microsoft.AspNet.Mvc.Core/Routing/IActionSelectorDecisionTreeProvider.cs index 07110c28b3..0b67057199 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Routing/IActionSelectorDecisionTreeProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Routing/IActionSelectorDecisionTreeProvider.cs @@ -5,12 +5,12 @@ namespace Microsoft.AspNet.Mvc.Routing { /// /// Stores an for the current value of - /// . + /// . /// public interface IActionSelectorDecisionTreeProvider { /// - /// Gets the . + /// Gets the . /// IActionSelectionDecisionTree DecisionTree { diff --git a/src/Microsoft.AspNet.Mvc.Core/Routing/KnownRouteValueConstraint.cs b/src/Microsoft.AspNet.Mvc.Core/Routing/KnownRouteValueConstraint.cs index 5f165e9ca4..c52ca3b894 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Routing/KnownRouteValueConstraint.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Routing/KnownRouteValueConstraint.cs @@ -64,23 +64,23 @@ namespace Microsoft.AspNet.Mvc.Routing private string[] GetAndCacheAllMatchingValues(string routeKey, HttpContext httpContext) { - var actionDescriptors = GetAndValidateActionDescriptorsCollection(httpContext); + var actionDescriptors = GetAndValidateActionDescriptorCollection(httpContext); var version = actionDescriptors.Version; var valuesCollection = _cachedValuesCollection; if (valuesCollection == null || version != valuesCollection.Version) { - var routeValueCollection = actionDescriptors - .Items - .Select(ad => ad.RouteConstraints - .FirstOrDefault( - c => c.RouteKey == routeKey && - c.KeyHandling == RouteKeyHandling.RequireKey)) - .Where(rc => rc != null) - .Select(rc => rc.RouteValue) - .Distinct() - .ToArray(); + var routeValueCollection = + actionDescriptors + .Items + .Select(ad => ad.RouteConstraints.FirstOrDefault( + c => c.RouteKey == routeKey && + c.KeyHandling == RouteKeyHandling.RequireKey)) + .Where(rc => rc != null) + .Select(rc => rc.RouteValue) + .Distinct() + .ToArray(); valuesCollection = new RouteValuesCollection(version, routeValueCollection); _cachedValuesCollection = valuesCollection; @@ -89,10 +89,10 @@ namespace Microsoft.AspNet.Mvc.Routing return _cachedValuesCollection.Items; } - private static ActionDescriptorsCollection GetAndValidateActionDescriptorsCollection(HttpContext httpContext) + private static ActionDescriptorCollection GetAndValidateActionDescriptorCollection(HttpContext httpContext) { - var provider = httpContext.RequestServices - .GetRequiredService(); + var services = httpContext.RequestServices; + var provider = services.GetRequiredService(); var descriptors = provider.ActionDescriptors; if (descriptors == null) diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/Infrastructure/DefaultActionSelectorTests.cs b/test/Microsoft.AspNet.Mvc.Core.Test/Infrastructure/DefaultActionSelectorTests.cs index 0e63851ffe..779a010f86 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/Infrastructure/DefaultActionSelectorTests.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/Infrastructure/DefaultActionSelectorTests.cs @@ -518,9 +518,9 @@ namespace Microsoft.AspNet.Mvc.Infrastructure serviceContainer.AddSingleton(typeof(IEnumerable), list); - var actionDescriptorsCollectionProvider = new DefaultActionDescriptorsCollectionProvider( + var actionDescriptorCollectionProvider = new DefaultActionDescriptorCollectionProvider( serviceContainer.BuildServiceProvider()); - var decisionTreeProvider = new ActionSelectorDecisionTreeProvider(actionDescriptorsCollectionProvider); + var decisionTreeProvider = new ActionSelectorDecisionTreeProvider(actionDescriptorCollectionProvider); var actionConstraintProviders = new[] { @@ -599,10 +599,10 @@ namespace Microsoft.AspNet.Mvc.Infrastructure { loggerFactory = loggerFactory ?? NullLoggerFactory.Instance; - var actionProvider = new Mock(MockBehavior.Strict); + var actionProvider = new Mock(MockBehavior.Strict); actionProvider - .Setup(p => p.ActionDescriptors).Returns(new ActionDescriptorsCollection(actions, 0)); + .Setup(p => p.ActionDescriptors).Returns(new ActionDescriptorCollection(actions, 0)); var decisionTreeProvider = new ActionSelectorDecisionTreeProvider(actionProvider.Object); diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/Routing/AttributeRouteTest.cs b/test/Microsoft.AspNet.Mvc.Core.Test/Routing/AttributeRouteTest.cs index caf6a46f9e..055aa12454 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/Routing/AttributeRouteTest.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/Routing/AttributeRouteTest.cs @@ -64,17 +64,17 @@ namespace Microsoft.AspNet.Mvc.Routing }, }; - var actionDescriptorsProvider = new Mock(MockBehavior.Strict); - actionDescriptorsProvider + var actionDescriptorProvider = new Mock(MockBehavior.Strict); + actionDescriptorProvider .SetupGet(ad => ad.ActionDescriptors) - .Returns(new ActionDescriptorsCollection(actionDescriptors, version: 1)); + .Returns(new ActionDescriptorCollection(actionDescriptors, version: 1)); var policy = new UriBuilderContextPooledObjectPolicy(new UrlTestEncoder()); var pool = new DefaultObjectPool(policy); var route = new AttributeRoute( handler.Object, - actionDescriptorsProvider.Object, + actionDescriptorProvider.Object, Mock.Of(), pool, new UrlTestEncoder(), @@ -103,9 +103,9 @@ namespace Microsoft.AspNet.Mvc.Routing // Arrange 2 - remove the action and update the collection actionDescriptors.RemoveAt(1); - actionDescriptorsProvider + actionDescriptorProvider .SetupGet(ad => ad.ActionDescriptors) - .Returns(new ActionDescriptorsCollection(actionDescriptors, version: 2)); + .Returns(new ActionDescriptorCollection(actionDescriptors, version: 2)); context = new RouteContext(httpContext); diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/Routing/AttributeRoutingTest.cs b/test/Microsoft.AspNet.Mvc.Core.Test/Routing/AttributeRoutingTest.cs index bcb2560a84..c5398f3923 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/Routing/AttributeRoutingTest.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/Routing/AttributeRoutingTest.cs @@ -180,9 +180,9 @@ namespace Microsoft.AspNet.Mvc.Routing private static IServiceProvider CreateServices(params ActionDescriptor[] actions) { - var collection = new ActionDescriptorsCollection(actions, version: 0); + var collection = new ActionDescriptorCollection(actions, version: 0); - var actionDescriptorProvider = new Mock(); + var actionDescriptorProvider = new Mock(); actionDescriptorProvider .Setup(a => a.ActionDescriptors) .Returns(collection); diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/Routing/KnownRouteValueConstraintTests.cs b/test/Microsoft.AspNet.Mvc.Core.Test/Routing/KnownRouteValueConstraintTests.cs index 92b56c2730..f9052cbd44 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/Routing/KnownRouteValueConstraintTests.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/Routing/KnownRouteValueConstraintTests.cs @@ -130,13 +130,13 @@ namespace Microsoft.AspNet.Mvc.Routing [Theory] [InlineData(RouteDirection.IncomingRequest)] [InlineData(RouteDirection.UrlGeneration)] - public void ActionDescriptorsCollection_SettingNullValue_Throws(RouteDirection direction) + public void ActionDescriptorCollection_SettingNullValue_Throws(RouteDirection direction) { // Arrange - var actionDescriptorCollectionProvider = Mock.Of(); + var actionDescriptorCollectionProvider = Mock.Of(); var httpContext = new Mock(); httpContext - .Setup(o => o.RequestServices.GetService(typeof(IActionDescriptorsCollectionProvider))) + .Setup(o => o.RequestServices.GetService(typeof(IActionDescriptorCollectionProvider))) .Returns(actionDescriptorCollectionProvider); // Act & Assert @@ -175,8 +175,8 @@ namespace Microsoft.AspNet.Mvc.Routing .Returns(new[] { actionProvider.Object }); context.Setup(o => o.RequestServices - .GetService(typeof(IActionDescriptorsCollectionProvider))) - .Returns(new DefaultActionDescriptorsCollectionProvider(context.Object.RequestServices)); + .GetService(typeof(IActionDescriptorCollectionProvider))) + .Returns(new DefaultActionDescriptorCollectionProvider(context.Object.RequestServices)); return context.Object; }