From 17b3c46f6183f6a0c3451e7f26af4e0c7aa23cdb Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sun, 2 Feb 2025 10:21:08 +1100 Subject: [PATCH] remove TerminalOutputDevice ITestApplicationCancellationTokenSource field --- .../OutputDevice/OutputDeviceManager.cs | 4 +--- .../OutputDevice/TerminalOutputDevice.cs | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Platform/Microsoft.Testing.Platform/OutputDevice/OutputDeviceManager.cs b/src/Platform/Microsoft.Testing.Platform/OutputDevice/OutputDeviceManager.cs index 78d4dafb0f..ead675f395 100644 --- a/src/Platform/Microsoft.Testing.Platform/OutputDevice/OutputDeviceManager.cs +++ b/src/Platform/Microsoft.Testing.Platform/OutputDevice/OutputDeviceManager.cs @@ -41,9 +41,7 @@ internal async Task BuildAsync(ServiceProvider serviceProvide } public static TerminalOutputDevice GetDefaultTerminalOutputDevice(ServiceProvider serviceProvider) - => new( - serviceProvider.GetTestApplicationCancellationTokenSource(), - serviceProvider.GetConsole(), + => new(serviceProvider.GetConsole(), serviceProvider.GetTestApplicationModuleInfo(), serviceProvider.GetTestHostControllerInfo(), serviceProvider.GetAsyncMonitorFactory().Create(), diff --git a/src/Platform/Microsoft.Testing.Platform/OutputDevice/TerminalOutputDevice.cs b/src/Platform/Microsoft.Testing.Platform/OutputDevice/TerminalOutputDevice.cs index aef2c5bd24..ebabfee2c5 100644 --- a/src/Platform/Microsoft.Testing.Platform/OutputDevice/TerminalOutputDevice.cs +++ b/src/Platform/Microsoft.Testing.Platform/OutputDevice/TerminalOutputDevice.cs @@ -30,7 +30,6 @@ internal sealed partial class TerminalOutputDevice : IHotReloadPlatformOutputDev private const string TESTINGPLATFORM_CONSOLEOUTPUTDEVICE_SKIP_BANNER = nameof(TESTINGPLATFORM_CONSOLEOUTPUTDEVICE_SKIP_BANNER); #pragma warning restore SA1310 // Field names should not contain underscore - private readonly ITestApplicationCancellationTokenSource _testApplicationCancellationTokenSource; private readonly IConsole _console; private readonly ITestApplicationModuleInfo _testApplicationModuleInfo; private readonly ITestHostControllerInfo _testHostControllerInfo; @@ -64,13 +63,13 @@ internal sealed partial class TerminalOutputDevice : IHotReloadPlatformOutputDev private bool _isServerMode; private ILogger? _logger; - public TerminalOutputDevice(ITestApplicationCancellationTokenSource testApplicationCancellationTokenSource, IConsole console, + public TerminalOutputDevice( + IConsole console, ITestApplicationModuleInfo testApplicationModuleInfo, ITestHostControllerInfo testHostControllerInfo, IAsyncMonitor asyncMonitor, IRuntimeFeature runtimeFeature, IEnvironment environment, IProcessHandler process, IPlatformInformation platformInformation, ICommandLineOptions commandLineOptions, IFileLoggerInformation? fileLoggerInformation, ILoggerFactory loggerFactory, IClock clock, IStopPoliciesService policiesService) { - _testApplicationCancellationTokenSource = testApplicationCancellationTokenSource; _console = console; _testApplicationModuleInfo = testApplicationModuleInfo; _testHostControllerInfo = testHostControllerInfo;