private async Task <ActionDescriptor> InvokeActionSelector(RouteContext context)
        {
            var controllerTypeInfos = typeof(DefaultActionDiscoveryConventionsActionSelectionTests)
                                      .GetNestedTypes(BindingFlags.NonPublic)
                                      .Select(ct => ct.GetTypeInfo())
                                      .ToArray();

            var conventions = new StaticActionDiscoveryConventions(controllerTypeInfos);

            return(await InvokeActionSelector(context, conventions));
        }
예제 #2
0
        private ControllerActionDescriptorProvider GetActionDescriptorProvider(
            IActionDiscoveryConventions actionDiscoveryConventions = null)
        {
            var assemblyProvider = new StaticAssemblyProvider();

            if (actionDiscoveryConventions == null)
            {
                var controllerTypes = typeof(ActionAttributeTests)
                                      .GetNestedTypes(BindingFlags.NonPublic)
                                      .Select(t => t.GetTypeInfo());

                actionDiscoveryConventions = new StaticActionDiscoveryConventions(controllerTypes.ToArray());
            }

            return(new ControllerActionDescriptorProvider(
                       assemblyProvider,
                       actionDiscoveryConventions,
                       new TestGlobalFilterProvider(),
                       new MockMvcOptionsAccessor()));
        }
예제 #3
0
        private ReflectedActionDescriptorProvider GetActionDescriptorProvider(
            IActionDiscoveryConventions actionDiscoveryConventions = null)
        {
            var controllerAssemblyProvider = new StaticControllerAssemblyProvider();

            if (actionDiscoveryConventions == null)
            {
                var controllerTypes = typeof(ActionAttributeTests)
                                      .GetNestedTypes(BindingFlags.NonPublic)
                                      .Select(t => t.GetTypeInfo());

                actionDiscoveryConventions = new StaticActionDiscoveryConventions(controllerTypes.ToArray());
            }

            return(new ReflectedActionDescriptorProvider(
                       controllerAssemblyProvider,
                       actionDiscoveryConventions,
                       null,
                       new MockMvcOptionsAccessor(),
                       Mock.Of <IInlineConstraintResolver>()));
        }
        private async Task<ActionDescriptor> InvokeActionSelector(RouteContext context)
        {
            var controllerTypeInfos = typeof(DefaultActionDiscoveryConventionsActionSelectionTests)
                .GetNestedTypes(BindingFlags.NonPublic)
                .Select(ct => ct.GetTypeInfo())
                .ToArray();

            var conventions = new StaticActionDiscoveryConventions(controllerTypeInfos);
            return await InvokeActionSelector(context, conventions);
        }
예제 #5
0
        private ReflectedActionDescriptorProvider GetActionDescriptorProvider(
            IActionDiscoveryConventions actionDiscoveryConventions  = null)
        {
            var controllerAssemblyProvider = new StaticControllerAssemblyProvider();

            if (actionDiscoveryConventions == null)
            {
                var controllerTypes = typeof(ActionAttributeTests)
                    .GetNestedTypes(BindingFlags.NonPublic)
                    .Select(t => t.GetTypeInfo());

                actionDiscoveryConventions = new StaticActionDiscoveryConventions(controllerTypes.ToArray());
            }

            return new ReflectedActionDescriptorProvider(
                                        controllerAssemblyProvider,
                                        actionDiscoveryConventions,
                                        null,
                                        new MockMvcOptionsAccessor(),
                                        Mock.Of<IInlineConstraintResolver>());
        }