Esempio n. 1
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>()));
        }
Esempio n. 2
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>());
        }