private ControllerActionDescriptorProvider GetActionDescriptorProvider() { var assemblyProvider = new StaticAssemblyProvider(); var controllerTypes = typeof(DefaultActionSelectorTests) .GetNestedTypes(BindingFlags.NonPublic) .Select(t => t.GetTypeInfo()); var modelBuilder = new StaticControllerModelBuilder(controllerTypes.ToArray()); return(new ControllerActionDescriptorProvider( assemblyProvider, modelBuilder, new TestGlobalFilterProvider(), new MockMvcOptionsAccessor())); }
private ControllerActionDescriptorProvider GetProvider( ILoggerFactory loggerFactory, params TypeInfo[] controllerTypeInfo) { var modelBuilder = new StaticControllerModelBuilder(controllerTypeInfo); var assemblyProvider = new Mock <IAssemblyProvider>(); assemblyProvider .SetupGet(ap => ap.CandidateAssemblies) .Returns(new Assembly[] { controllerTypeInfo.First().Assembly }); var provider = new ControllerActionDescriptorProvider( assemblyProvider.Object, modelBuilder, new TestGlobalFilterProvider(), new MockMvcOptionsAccessor(), loggerFactory); return(provider); }