/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Shared/SignalR/FunctionalTestBase.cs
45 строк
1 KB
Brennan
Better support for HTTP/2 in SignalR .NET client (#42817)
22 авг 2022, 19:48
Не верифицирован
22 авг 2022, 19:48
9c8ad73
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.Extensions.Logging.Testing; namespace Microsoft.AspNetCore.SignalR.Tests; public class FunctionalTestBase : VerifiableLoggedTest { private readonly Func<WriteContext, bool> _globalExpectedErrorsFilter; public FunctionalTestBase() { // Suppress errors globally here _globalExpectedErrorsFilter = (writeContext) => false; } private Func<WriteContext, bool> ResolveExpectedErrorsFilter(Func<WriteContext, bool> expectedErrorsFilter) { if (expectedErrorsFilter == null) { return _globalExpectedErrorsFilter; } return (writeContext) => { if (expectedErrorsFilter(writeContext)) { return true; } return _globalExpectedErrorsFilter(writeContext); }; } public Task<InProcessTestServer<T>> StartServer<T>(Func<WriteContext, bool> expectedErrorsFilter = null, Action<KestrelServerOptions> configureKestrelServerOptions = null) where T : class { var disposable = base.StartVerifiableLog(ResolveExpectedErrorsFilter(expectedErrorsFilter)); return InProcessTestServer<T>.StartServer(LoggerFactory, configureKestrelServerOptions, disposable); } }