// 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.Buffers; using Microsoft.AspNetCore.Mvc.DataAnnotations; using Microsoft.AspNetCore.Mvc.DataAnnotations.Internal; using Microsoft.AspNetCore.Mvc.Formatters.Json.Internal; using Microsoft.AspNetCore.Mvc.Internal; using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.ObjectPool; using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.Mvc.IntegrationTests { public class TestMvcOptions : IOptions { public TestMvcOptions() { Value = new MvcOptions(); MvcCoreMvcOptionsSetup.ConfigureMvc(Value, new TestHttpRequestStreamReaderFactory()); var collection = new ServiceCollection().AddOptions(); collection.AddSingleton(); collection.AddSingleton(); collection.AddSingleton(); MvcDataAnnotationsMvcOptionsSetup.ConfigureMvc( Value, collection.BuildServiceProvider()); var loggerFactory = new LoggerFactory(); var serializerSettings = SerializerSettingsProvider.CreateSerializerSettings(); MvcJsonMvcOptionsSetup.ConfigureMvc( Value, serializerSettings, loggerFactory, ArrayPool.Shared, new DefaultObjectPoolProvider()); } public MvcOptions Value { get; } } }