/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Mvc/Mvc.Razor.RuntimeCompilation/test/RuntimeCompilationFileProviderTest.cs
30 строк
1 KB
Brennan
Obsolete RazorRuntimeCompilation (#62793)
18 июл 2025, 20:59
Не верифицирован
18 июл 2025, 20:59
223fe49
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation; public class RuntimeCompilationFileProviderTest { [Fact] public void GetFileProvider_ThrowsIfNoConfiguredFileProviders() { // Arrange #pragma warning disable ASPDEPR003 // Type or member is obsolete var expected = $"'{typeof(MvcRazorRuntimeCompilationOptions).FullName}.{nameof(MvcRazorRuntimeCompilationOptions.FileProviders)}' must " + $"not be empty. At least one '{typeof(IFileProvider).FullName}' is required to locate a view for " + "rendering."; var options = Options.Create(new MvcRazorRuntimeCompilationOptions()); #pragma warning restore ASPDEPR003 // Type or member is obsolete var fileProvider = new RuntimeCompilationFileProvider(options); // Act & Assert var exception = Assert.Throws<InvalidOperationException>( () => fileProvider.FileProvider); Assert.Equal(expected, exception.Message); } }