/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/VisualStudio/IntegrationTest/Harness/XUnitShared/Threading/ErrorReportingIdeTestRunner.cs
41 строка
2 KB
David Barbet
Shorten file paths to prevent long path issues opening the slnx
10 дек 2025, 22:44
10 дек 2025, 22:44
7830fcf
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. namespace Xunit.Threading { using System; using System.Collections.Generic; using System.Reflection; using System.Threading; using System.Threading.Tasks; using Xunit.Abstractions; using Xunit.Sdk; public class ErrorReportingIdeTestRunner : XunitTestRunner { private readonly Exception _exception; public ErrorReportingIdeTestRunner(Exception exception, ITest test, IMessageBus messageBus, Type testClass, object?[] constructorArguments, MethodInfo testMethod, object?[]? testMethodArguments, string skipReason, IReadOnlyList<BeforeAfterTestAttribute> beforeAfterAttributes, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource) : base(test, messageBus, testClass, constructorArguments, testMethod, testMethodArguments, skipReason, beforeAfterAttributes, aggregator, cancellationTokenSource) { _exception = exception; } protected override Task<decimal> InvokeTestMethodAsync(ExceptionAggregator aggregator) { if (aggregator is null) { throw new ArgumentNullException(nameof(aggregator)); } return aggregator.RunAsync( () => { var tcs = new TaskCompletionSource<decimal>(); tcs.SetException(new InvalidOperationException("Test execution was skipped due to a prior exception in the harness.", _exception)); return tcs.Task; }); } } }