/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Components/Endpoints/test/RazorComponentsServiceOptionsTest.cs
45 строк
1 KB
Daria Tiurina
Fix API for CacheView (#67776)
14 июл 2026, 18:37
Не верифицирован
14 июл 2026, 18:37
564927c
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace Microsoft.AspNetCore.Components.Endpoints; public class RazorComponentsServiceOptionsTest { [Fact] public void CacheViewSizeLimit_DefaultsTo100MiB() { var options = new RazorComponentsServiceOptions(); Assert.Equal(100 * 1024 * 1024, options.CacheViewSizeLimit); } [Fact] public void CacheViewSizeLimit_PositiveValue_RoundTrips() { var options = new RazorComponentsServiceOptions { CacheViewSizeLimit = 1234, }; Assert.Equal(1234, options.CacheViewSizeLimit); } [Fact] public void CacheViewSizeLimit_Zero_IsAllowed_AndDisablesCaching() { var options = new RazorComponentsServiceOptions { CacheViewSizeLimit = 0, }; Assert.Equal(0, options.CacheViewSizeLimit); } [Fact] public void CacheViewSizeLimit_Negative_Throws() { var options = new RazorComponentsServiceOptions(); Assert.Throws<ArgumentOutOfRangeException>(() => options.CacheViewSizeLimit = -1); } }