public void AreaViewLocationFormats_ContainsExpectedLocations()
        {
            // Arrange
            var services = new ServiceCollection().AddOptions();
            var areaViewLocations = new[]
            {
                "/Areas/{2}/MvcViews/{1}/{0}.cshtml",
                "/Areas/{2}/MvcViews/Shared/{0}.cshtml",
                "/MvcViews/Shared/{0}.cshtml"
            };
            var builder = new MvcBuilder(services, new ApplicationPartManager());
            builder.AddRazorOptions(options =>
            {
                options.AreaViewLocationFormats.Clear();

                foreach (var location in areaViewLocations)
                {
                    options.AreaViewLocationFormats.Add(location);
                }
            });
            var serviceProvider = services.BuildServiceProvider();
            var accessor = serviceProvider.GetRequiredService<IOptions<RazorViewEngineOptions>>();

            // Act
            var formats = accessor.Value.AreaViewLocationFormats;

            // Assert
            Assert.Equal(areaViewLocations, formats, StringComparer.Ordinal);
        }
        public void AddRazorOptions_ConfiguresOptionsAsExpected()
        {
            // Arrange
            var services = new ServiceCollection().AddOptions();
            var fileProvider = new TestFileProvider();

            // Act
            var builder = new MvcBuilder(services, new ApplicationPartManager());
            builder.AddRazorOptions(options =>
            {
                options.FileProviders.Add(fileProvider);
            });
            var serviceProvider = services.BuildServiceProvider();

            // Assert
            var accessor = serviceProvider.GetRequiredService<IOptions<RazorViewEngineOptions>>();
            Assert.Same(fileProvider, accessor.Value.FileProviders[0]);
        }