7 types derived from Task
System.Private.CoreLib (7)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
471private sealed class CompletionState : Task
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task_T.cs (1)
59public class Task<TResult> : Task
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (2)
5958private class DelayPromise : Task 6215private sealed class WhenAllPromise : Task, ITaskCompletionAction
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (2)
10internal sealed class ContinuationTaskFromTask : Task 102internal sealed class ContinuationTaskFromResultTask<TAntecedentResult> : Task
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ValueTask.cs (1)
239private sealed class ValueTaskSourceAsTask : Task
37 instantiations of Task
Microsoft.Extensions.Hosting.Testing.Tests (2)
FakeHostTests.cs (2)
98var task = new Task(() => { }); 157var task = new Task(() => { });
Microsoft.TestPlatform.CoreUtilities (1)
Utilities\JobQueue.cs (1)
133_backgroundJobProcessor = new Task(() => BackgroundJobProcessor(_displayName), TaskCreationOptions.LongRunning);
System.Linq.Parallel (6)
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (1)
171Task rootTask = new Task(
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (1)
87Task rootTask = new Task(
System\Linq\Parallel\Scheduling\QueryTask.cs (1)
64Task task = new Task(s_runTaskSynchronouslyDelegate, this, TaskCreationOptions.AttachedToParent);
System\Linq\Parallel\Scheduling\SpoolingTask.cs (3)
40Task rootTask = new Task( 98Task rootTask = new Task( 139Task rootTask = new Task(
System.Private.CoreLib (13)
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncHelpers.CoreCLR.cs (1)
1361Task task = new();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (2)
293processingTask = new Task(thisPair => ((ConcurrentExclusiveSchedulerPair)thisPair!).ProcessExclusiveTasks(), this, 323processingTask = new Task(thisPair => ((ConcurrentExclusiveSchedulerPair)thisPair!).ProcessConcurrentTasks(), this,
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (4)
1301Task t = new Task(action, state, creatingTask, cancellationToken, options, internalOptions | InternalTaskOptions.QueuedByRuntime, scheduler); 5612var task = new Task(); 5639return new Task(true, TaskCreationOptions.None, cancellationToken); 5660var task = new Task();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCompletionSource.cs (2)
34public TaskCompletionSource() => _task = new Task(); 64_task = new Task(state, creationOptions, promiseStyle: true);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (1)
566return new Task(
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory_T.cs (1)
660Task t = new Task(new Action<object>(delegate
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ValueTask.cs (1)
220var task = new Task();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (1)
651var t = new Task((object?)null, TaskCreationOptions.RunContinuationsAsynchronously, true);
System.Threading.Tasks.Dataflow (9)
Blocks\BatchBlock.cs (1)
638_nonGreedyState!.TaskForInputProcessing = new Task(static thisBatchTarget => ((BatchBlockTargetCore)thisBatchTarget!).ProcessMessagesLoopCore(), this,
Blocks\BroadcastBlock.cs (2)
254new Task(static state => ((BroadcastBlock<T>)state!).ConsumeMessagesLoopCore(), this, 831_taskForOutputProcessing = new Task(static thisSourceCore => ((BroadcastingSourceCore<TOutput>)thisSourceCore!).OfferMessagesLoopCore(), this,
Blocks\BufferBlock.cs (1)
255new Task(static state => ((BufferBlock<T>)state!).ConsumeMessagesLoopCore(), this,
Blocks\JoinBlock.cs (1)
1267_taskForInputProcessing = new Task(static thisSharedResources => ((JoinBlockTargetSharedResources)thisSharedResources!).ProcessMessagesLoopCore(), this,
Blocks\WriteOnceBlock.cs (1)
120var taskForOutputProcessing = new Task(static state => ((WriteOnceBlock<T>)state!).OfferToTargetsAndCompleteBlock(), this,
Internal\SourceCore.cs (1)
753_taskForOutputProcessing = new Task(static thisSourceCore => ((SourceCore<TOutput>)thisSourceCore!).OfferMessagesLoopCore(), this,
Internal\SpscTargetCore.cs (1)
166var newConsumer = new Task(
Internal\TargetCore.cs (1)
372var taskForInputProcessing = new Task(static thisTargetCore => ((TargetCore<TInput>)thisTargetCore!).ProcessMessagesLoopCore(), this,
System.Threading.Tasks.Parallel (3)
System\Threading\Tasks\Parallel.cs (1)
340tasks[0] = new Task(actionsCopy[0], parallelOptions.CancellationToken, TaskCreationOptions.None);
System\Threading\Tasks\TaskReplicator.cs (2)
38_pendingTask = new Task(s => ((Replica)s!).Execute(), this); 80_pendingTask = new Task(s => ((Replica)s!).Execute(), this, CancellationToken.None, TaskCreationOptions.None);
testhost (1)
src\vstest\src\testhost.x86\DefaultEngineInvoker.cs (1)
305var task = new Task(
testhost.arm64 (1)
src\vstest\src\testhost.x86\DefaultEngineInvoker.cs (1)
305var task = new Task(
testhost.x86 (1)
DefaultEngineInvoker.cs (1)
305var task = new Task(
31064 references to Task
aspire (575)
Agents\AgentEnvironmentApplicator.cs (3)
11private readonly Func<CancellationToken, Task> _applyCallback; 22Func<CancellationToken, Task> applyCallback, 54public async Task ApplyAsync(CancellationToken cancellationToken)
Agents\AspireSkills\AspireSkillsBundle.cs (1)
54return Task.FromResult<IReadOnlyList<SkillAssetFile>>(files);
Agents\AspireSkills\AspireSkillsInstaller.cs (2)
898await Task.Delay(retryDelay, cancellationToken).ConfigureAwait(false); 961private async Task CleanupStaleCacheEntriesAsync(
Agents\ClaudeCode\ClaudeCodeAgentEnvironmentScanner.cs (2)
47public async Task ScanAsync(AgentEnvironmentScanContext context, CancellationToken cancellationToken) 199private static async Task ApplyAspireMcpConfigurationAsync(
Agents\CopilotCli\CopilotCliAgentEnvironmentScanner.cs (2)
51public async Task ScanAsync(AgentEnvironmentScanContext context, CancellationToken cancellationToken) 191private static async Task ApplyMcpConfigurationAsync(
Agents\DeprecatedMcpCommandScanner.cs (3)
40public Task ScanAsync(AgentEnvironmentScanContext context, CancellationToken cancellationToken) 98return Task.CompletedTask; 198private async Task UpdateConfigAsync(AgentConfigLocation location, string configPath, JsonObject config, CancellationToken cancellationToken)
Agents\Hooks\TelemetryHookConfigurator.cs (1)
379private static async Task WriteJsonAtomicAsync(string path, JsonObject config, CancellationToken cancellationToken)
Agents\Hooks\TelemetryHookInstaller.cs (1)
71private async Task WriteFileIfChangedAsync(string path, string content, CancellationToken cancellationToken)
Agents\IAgentEnvironmentScanner.cs (1)
17Task ScanAsync(AgentEnvironmentScanContext context, CancellationToken cancellationToken);
Agents\OpenCode\OpenCodeAgentEnvironmentScanner.cs (2)
42public async Task ScanAsync(AgentEnvironmentScanContext context, CancellationToken cancellationToken) 184private static async Task ApplyMcpConfigurationAsync(
Agents\VsCode\VsCodeAgentEnvironmentScanner.cs (2)
51public async Task ScanAsync(AgentEnvironmentScanContext context, CancellationToken cancellationToken) 238private static async Task ApplyAspireMcpConfigurationAsync(
Backchannel\AppHostCliBackchannel.cs (21)
17Task RequestStopAsync(CancellationToken cancellationToken); 18Task NotifyAppHostReadyAsync(CancellationToken cancellationToken); 22Task WaitForDisconnectAsync(CancellationToken cancellationToken); 23Task ConnectAsync(string socketPath, int retryCount, CancellationToken cancellationToken); 24Task ConnectAsync(string socketPath, bool autoReconnect, int retryCount, CancellationToken cancellationToken); 27Task CompletePromptResponseAsync(string promptId, PublishingPromptInputAnswer[] answers, CancellationToken cancellationToken); 28Task UpdatePromptResponseAsync(string promptId, PublishingPromptInputAnswer[] answers, CancellationToken cancellationToken); 59public async Task WaitForDisconnectAsync(CancellationToken cancellationToken) 61Task disconnectTask; 70public async Task RequestStopAsync(CancellationToken cancellationToken) 89public async Task NotifyAppHostReadyAsync(CancellationToken cancellationToken) 253private async Task WaitForReconnectionAsync(CancellationToken cancellationToken) 281await Task.Delay(100, cancellationToken).ConfigureAwait(false); 294await Task.Delay(500, cancellationToken).ConfigureAwait(false); 300public Task ConnectAsync(string socketPath, int retryCount, CancellationToken cancellationToken) 303public async Task ConnectAsync(string socketPath, bool autoReconnect, int retryCount, CancellationToken cancellationToken) 406_ = Task.Run(async () => 444private async Task ReconnectInternalAsync() 470await Task.Delay(500, _cancellationToken).ConfigureAwait(false); 508public async Task CompletePromptResponseAsync(string promptId, PublishingPromptInputAnswer[] answers, CancellationToken cancellationToken) 523public async Task UpdatePromptResponseAsync(string promptId, PublishingPromptInputAnswer[] answers, CancellationToken cancellationToken)
Backchannel\AuxiliaryBackchannelMonitor.cs (19)
91_ = Task.Run(async () => 95await Task.WhenAll( 120async Task WatchConnectionChangesAsync(IFileProvider fileProvider, string watchPattern, CancellationToken cancellationToken) 228public Task ScanAsync(CancellationToken cancellationToken = default) 233protected override async Task ExecuteAsync(CancellationToken stoppingToken) 270var fileWatcherTask = Task.WhenAll( 293await Task.WhenAll(disconnectTasks).ConfigureAwait(false); 298private async Task UpdateConnectionsAsync(CancellationToken cancellationToken) 303private async Task<IReadOnlyList<Task>> ProcessDirectoryChangesAsync(CancellationToken cancellationToken) 305var connectTasks = new List<Task>(); 332_ = Task.Run(async () => await DisconnectAsync(connection).ConfigureAwait(false), CancellationToken.None); 361await Task.WhenAll(connectTasks).ConfigureAwait(false); 376private async Task TryConnectToSocketAsync(string socketPath, ConcurrentBag<string> failedSockets, CancellationToken cancellationToken) 431await Task.Delay(delay, _timeProvider, cancellationToken).ConfigureAwait(false); 517_ = Task.Run(async () => await DisconnectAsync(conn).ConfigureAwait(false)); 568private static async Task DisconnectAsync(IAppHostAuxiliaryBackchannel connection) 579await Task.CompletedTask.ConfigureAwait(false); 613private async Task RunFileWatcherLoopAsync(IFileProvider fileProvider, string watchPattern, CancellationToken cancellationToken)
Backchannel\ExtensionBackchannel.cs (41)
23Task ConnectAsync(CancellationToken cancellationToken); 24Task DisplayMessageAsync(string emojiName, string message, CancellationToken cancellationToken); 25Task DisplaySuccessAsync(string message, CancellationToken cancellationToken); 26Task DisplaySubtleMessageAsync(string message, CancellationToken cancellationToken); 27Task DisplayErrorAsync(string error, CancellationToken cancellationToken); 28Task DisplayEmptyLineAsync(CancellationToken cancellationToken); 29Task DisplayIncompatibleVersionErrorAsync(string requiredCapability, string appHostHostingSdkVersion, CancellationToken cancellationToken); 30Task DisplayCancellationMessageAsync(CancellationToken cancellationToken); 31Task DisplayLinesAsync(IEnumerable<DisplayLineState> lines, CancellationToken cancellationToken); 32Task DisplayDashboardUrlsAsync(DashboardUrlsState dashboardUrls, CancellationToken cancellationToken); 33Task ShowStatusAsync(string? status, CancellationToken cancellationToken); 40Task OpenEditorAsync(string path, CancellationToken cancellationToken); 41Task LogMessageAsync(LogLevel logLevel, string message, CancellationToken cancellationToken); 44Task LaunchAppHostAsync(string projectFile, List<string> arguments, List<EnvVar> environment, bool debug, CancellationToken cancellationToken); 45Task NotifyAppHostStartupCompletedAsync(CancellationToken cancellationToken); 46Task StartDebugSessionAsync(string workingDirectory, string? projectFile, bool debug, DebugSessionOptions? options, CancellationToken cancellationToken); 47Task DisplayPlainTextAsync(string text, CancellationToken cancellationToken); 48Task WriteDebugSessionMessageAsync(string message, bool stdout, string? textStyle, CancellationToken cancellationToken); 64private readonly Func<CancellationToken, Task>? _connectCoreAsyncOverride; 75Func<CancellationToken, Task>? connectCoreAsyncOverride) 99public async Task ConnectAsync(CancellationToken cancellationToken) 173await Task.Delay(1000, cancellationToken).ConfigureAwait(false); 229async Task ConnectCoreAsync() 339public async Task DisplayMessageAsync(string emojiName, string message, CancellationToken cancellationToken) 355public async Task DisplaySuccessAsync(string message, CancellationToken cancellationToken) 371public async Task DisplaySubtleMessageAsync(string message, CancellationToken cancellationToken) 387public async Task DisplayErrorAsync(string error, CancellationToken cancellationToken) 403public async Task DisplayEmptyLineAsync(CancellationToken cancellationToken) 419public async Task DisplayIncompatibleVersionErrorAsync(string requiredCapability, string appHostHostingSdkVersion, CancellationToken cancellationToken) 436public async Task DisplayCancellationMessageAsync(CancellationToken cancellationToken) 452public async Task DisplayLinesAsync(IEnumerable<DisplayLineState> lines, CancellationToken cancellationToken) 468public async Task DisplayDashboardUrlsAsync(DashboardUrlsState dashboardUrls, CancellationToken cancellationToken) 484public async Task ShowStatusAsync(string? status, CancellationToken cancellationToken) 654public async Task OpenEditorAsync(string path, CancellationToken cancellationToken) 670public async Task LogMessageAsync(LogLevel logLevel, string message, CancellationToken cancellationToken) 689public async Task DisplayPlainTextAsync(string text, CancellationToken cancellationToken) 705public async Task WriteDebugSessionMessageAsync(string message, bool stdout, string? textStyle, CancellationToken cancellationToken) 745public async Task LaunchAppHostAsync(string projectFile, List<string> arguments, List<EnvVar> environment, bool debug, CancellationToken cancellationToken) 761public async Task NotifyAppHostStartupCompletedAsync(CancellationToken cancellationToken) 777public async Task StartDebugSessionAsync(string workingDirectory, string? projectFile, bool debug, 795public async Task StopDebuggingAsync()
Backchannel\ExtensionRpcTarget.cs (7)
23Task StopCliAsync(); 38return Task.FromResult(executionContext.IdentityVersion); 43return Task.FromResult(ValidationFunction?.Invoke(input)); 46public Task StopCliAsync() 49return Task.CompletedTask; 54return Task.FromResult(configuration[KnownConfigNames.ExtensionDebugSessionId]); 59return Task.FromResult(KnownCapabilities.GetAdvertisedCapabilities());
Backchannel\IAuxiliaryBackchannelMonitor.cs (1)
51Task ScanAsync(CancellationToken cancellationToken = default);
Backchannel\ProfilingJsonRpcExtensions.cs (1)
41public static async Task InvokeWithProfilingAsync(
Backchannel\ResourceSnapshotWatcher.cs (3)
18private readonly Task _watchTask; 36public Task WaitForInitialLoadAsync(CancellationToken cancellationToken = default) 41private async Task WatchAsync(CancellationToken cancellationToken)
Bundles\BundleService.cs (5)
82public async Task EnsureExtractedAsync(CancellationToken cancellationToken = default) 399internal async Task MoveDirectoryWithRetryAsync(string sourcePath, string destinationPath, CancellationToken cancellationToken) 422await Task.Delay(delay, cancellationToken).ConfigureAwait(false); 859internal async Task ExtractPayloadAsync(string destinationPath, CancellationToken cancellationToken) 868internal static async Task ExtractPayloadAsync(Stream payloadStream, string destinationPath, IEnvironment environment, CancellationToken cancellationToken)
Bundles\IBundleService.cs (1)
21Task EnsureExtractedAsync(CancellationToken cancellationToken = default);
Caching\AppHostInfoDiskCache.cs (2)
176public async Task SetAsync(FileInfo projectFile, string expectedCacheKey, AppHostInfoCacheEntry entry, CancellationToken cancellationToken) 411Task SetAsync(FileInfo projectFile, string expectedCacheKey, AppHostInfoCacheEntry entry, CancellationToken cancellationToken);
Caching\DiskCache.cs (3)
78public async Task SetAsync(string key, string content, CancellationToken cancellationToken = default) 131public Task ClearAsync(CancellationToken cancellationToken = default) 154return Task.CompletedTask;
Caching\IDiskCache.cs (2)
9Task SetAsync(string key, string content, CancellationToken cancellationToken = default); 10Task ClearAsync(CancellationToken cancellationToken = default);
Certificates\CertificateGeneration\CertificateProcessRunner.cs (3)
24: Task.FromResult(string.Empty); 27: Task.FromResult(string.Empty); 31Task.WhenAll(
Certificates\CertificateService.cs (1)
134() => Task.FromResult(certificateToolRunner.TrustHttpCertificate()),
Commands\AddCommand.cs (1)
690Action: ct => Task.FromResult(captured)
Commands\AgentInitCommand.cs (1)
482private async Task ConfigureTelemetryHooksAsync(AgentEnvironmentScanContext context, CancellationToken cancellationToken)
Commands\AgentTelemetryCommand.cs (2)
108return Task.FromResult(CommandResult.Success()); 127return Task.FromResult(CommandResult.Success());
Commands\AppHostLauncher.cs (27)
285private async Task StopLaunchedAppHostAsync(LaunchResult result, TimeSpan delay, CancellationToken cancellationToken) 289await Task.Delay(delay, cancellationToken).ConfigureAwait(false); 356private async Task StopExistingInstancesAsync(FileInfo effectiveAppHostFile, CancellationToken cancellationToken) 370await Task.WhenAll(stopTasks).ConfigureAwait(false); 585var timeoutTask = Task.Delay(remainingTimeout, timeProvider, cancellationToken); 587var completedTask = await Task.WhenAny(readinessTask, childExitTask, timeoutTask).ConfigureAwait(false); 645var waitTask = Task.Delay(TimeSpan.FromMilliseconds(500), timeProvider, cancellationToken); 646var completedWaitTask = await Task.WhenAny(childExitTask, waitTask).ConfigureAwait(false); 684private Task RequestGracefulShutdownThenForceKillAsync(IProcessExecution childProcess, DateTimeOffset? childStartedAt) 719Task childExitTask, 738var completedTask = await Task.WhenAny( 740Task.Delay(stabilityWindow, timeProvider, cancellationToken)).ConfigureAwait(false); 748Task childExitTask, 758var timeoutTask = Task.Delay(stabilityWindow, timeProvider, cancellationToken); 769probeTask = Task.FromException<List<ResourceSnapshot>>(ex); 772var completedTask = await Task.WhenAny(probeTask, childExitTask, timeoutTask).ConfigureAwait(false); 800var delayTask = Task.Delay(s_legacyDetachedStartupProbeInterval, timeProvider, cancellationToken); 801completedTask = await Task.WhenAny(delayTask, childExitTask, timeoutTask).ConfigureAwait(false); 817private static void ObserveFaults(Task task)
Commands\BaseCommand.cs (5)
148Task.Delay(200).ContinueWith(_ => stoppingMessageTcs.TrySetResult(), TaskScheduler.Default)); 150var tasksToAwait = new List<Task> { handlerTask, terminationTask, stoppingMessageTcs.Task }; 153var firstCompletedTask = await Task.WhenAny(tasksToAwait); 276private static async Task FlushExtensionInteractionServiceAsync(IInteractionService interactionService)
Commands\CacheCommand.cs (2)
63return Task.FromResult(CommandResult.Success()); 70return Task.FromResult(CommandResult.Failure(CliExitCodes.InvalidCommand));
Commands\CertificatesCleanCommand.cs (3)
34return Task.FromResult(CommandResult.FromExitCode(CliExitCodes.Success)); 40return Task.FromResult(CommandResult.FromExitCode(CliExitCodes.FailedToTrustCertificates)); 46return Task.FromResult(CommandResult.FromExitCode(CliExitCodes.FailedToTrustCertificates));
Commands\ConfigCommand.cs (1)
512return Task.FromResult(CliExitCodes.Success);
Commands\DashboardRunCommand.cs (4)
154if (await Task.WhenAny(layoutTask, Task.Delay(s_bundleStatusDelay, CancellationToken.None)).ConfigureAwait(false) == layoutTask) 416var readyOrFailed = Task.WhenAny(readyTcs.Task, processExitTask); 418var completedTask = await InteractionService.ShowStatusAsync(
Commands\DeployCommand.cs (1)
74return Task.FromResult<string[]>([.. baseArgs]);
Commands\DestroyCommand.cs (1)
74return Task.FromResult<string[]>([.. baseArgs]);
Commands\ExportCommand.cs (3)
250private static async Task AddConsoleLogsAsync( 286private static async Task AddStructuredLogsAsync( 317private static async Task AddTracesAsync(
Commands\ExtensionInternalCommand.cs (1)
23return Task.FromResult(CommandResult.FromExitCode(CliExitCodes.Success));
Commands\InstallationInfoOutput.cs (1)
36var discoveryTask = Task.Run(
Commands\IntegrationPackageSearchService.cs (1)
69await Task.WhenAll(integrationPackagesTask, polyglotIdsTask);
Commands\LsCommand.cs (3)
200var refreshTask = RefreshStatusLoopAsync(updateStatus, statusCancellation.Token); 232async Task RefreshStatusLoopAsync(Action<string> update, CancellationToken refreshToken) 238await Task.Delay(statusRefreshInterval, _timeProvider, refreshToken).ConfigureAwait(false);
Commands\NewCommand.cs (1)
735Action: ct => Task.FromResult((captured.Package, captured.Channel))
Commands\ParentCommand.cs (1)
20return Task.FromResult(CommandResult.DisplayHelp());
Commands\PipelineCommandBase.cs (3)
297var completedTask = await Task.WhenAny(backchannelCompletionSource.Task, pendingRun); 1064private async Task HandlePromptActivityAsync(PublishingActivity activity, IAppHostCliBackchannel backchannel, CancellationToken cancellationToken)
Commands\PsCommand.cs (1)
194_ = Task.Run(async () =>
Commands\PublishCommand.cs (1)
83return Task.FromResult<string[]>([.. baseArgs]);
Commands\RenderCommand.cs (11)
265await Task.Delay(TimeSpan.FromSeconds(2), cancellationToken); 280await Task.Delay(TimeSpan.FromSeconds(2), cancellationToken); 295await Task.Delay(TimeSpan.FromSeconds(2), cancellationToken); 338private async Task TestMixedMethodsAsync(CancellationToken cancellationToken) 356await Task.Delay(TimeSpan.FromSeconds(2), cancellationToken); 412var loggingTask = Task.Run(async () => 419await Task.Delay(200, cts.Token).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing); 423await Task.Delay(500, cancellationToken); // Let a few logs accumulate before starting the prompt 595await Task.CompletedTask; // Async iterator 823protected override Task<string[]> GetRunArgumentsAsync(string? fullyQualifiedOutputPath, string[] unmatchedTokens, string? targetStep, ParseResult parseResult, CancellationToken cancellationToken) => Task.FromResult(Array.Empty<string>());
Commands\ResourceCommand.cs (1)
640private async Task WriteAvailableCommandsAsync(ParseResult parseResult, string resourceName, CancellationToken cancellationToken)
Commands\RootCommand.cs (2)
209return Task.FromResult((int)CliExitCodes.Success); 216return Task.FromResult((int)CliExitCodes.InvalidCommand);
Commands\RunCommand.cs (18)
407var pendingLogCapture = Task.CompletedTask; 556pendingLogCapture = Task.CompletedTask; 724var completedTask = await Task.WhenAny( 726Task.Delay(s_startupFailureObservationWindow, cancellationToken)).ConfigureAwait(false); 765private static void ObserveFaults(Task task) 804if (await Task.WhenAny(happyPathTask, pendingRun).ConfigureAwait(false) == pendingRun) 901var pendingLogCapture = CaptureAppHostLogsAsync(_fileLoggerProvider, backchannel, InteractionService, logCaptureCancellationSource.Token); 936Task PendingLogCapture); 987var delayTask = Task.Delay(delay, cancellationToken); 988var completedTask = await Task.WhenAny(delayTask, pendingRun).ConfigureAwait(false); 1111internal static async Task CaptureAppHostLogsAsync(FileLoggerProvider fileLoggerProvider, IAppHostCliBackchannel backchannel, IInteractionService interactionService, CancellationToken cancellationToken) 1115await Task.Yield(); 1253private async Task CancelAppHostStartupAsync(CancellationTokenSource runCancellationTokenSource, Task<int> pendingRun, CancellationToken cancellationToken) 1278private async Task ObserveAppHostRunFailureAsync(Task<int> pendingRun)
Commands\Sdk\SdkDumpCommand.cs (1)
308var dumpResults = await Task.WhenAll(dumpTasks);
Commands\StopCommand.cs (3)
338var results = await Task.WhenAll(stopTasks).ConfigureAwait(false); 375private async Task WarnIfPersistentResourceCleanupMayBeUnsupportedAsync(FileInfo appHostFile, CancellationToken cancellationToken) 480var results = await Task.WhenAll(stopTasks);
Commands\TerminalCommand.cs (1)
33return Task.FromResult(CommandResult.DisplayHelp());
Commands\UpdateCommand.cs (2)
464private async Task HandlePendingMigrationsAsync(bool applyRequested, FileInfo projectFile, PromptBinding<bool> confirmBinding, CancellationToken cancellationToken) 747private async Task ExtractAndUpdateAsync(string archivePath, string channel, CancellationToken cancellationToken)
Configuration\ConfigurationService.cs (8)
17public async Task SetConfigurationAsync(string key, string value, bool isGlobal = false, CancellationToken cancellationToken = default) 28internal static async Task SetConfigurationInFileAsync(string settingsFilePath, string key, string value, CancellationToken cancellationToken = default) 185private static async Task LoadConfigurationFromFileAsync(string filePath, Dictionary<string, string> config, CancellationToken cancellationToken) 363return Task.FromResult(configuration[configKey]); 385return Task.FromResult<string?>(configFileValue); 395return Task.FromResult<string?>(legacySettingsValue); 417return Task.FromResult<string?>(globalValue); 421return Task.FromResult<string?>(null);
Configuration\IConfigurationService.cs (1)
8Task SetConfigurationAsync(string key, string value, bool isGlobal = false, CancellationToken cancellationToken = default);
ConsoleCancellationManager.cs (8)
80private Task? _startedHandler; 100internal void SetStartedHandler(Task handler) => Volatile.Write(ref _startedHandler, handler); 314private async Task ExpireGracefulThenFinalDrainAsync(int forcedTerminationExitCode) 331await Task.Delay(Timeout.InfiniteTimeSpan, _gracefulToken).ConfigureAwait(false); 342var startedHandler = Volatile.Read(ref _startedHandler); 346var drainTask = Task.Delay(_finalDrainBudget); 348if (await Task.WhenAny(startedHandler, drainTask).ConfigureAwait(false) == startedHandler)
Diagnostics\FileLoggerProvider.cs (3)
25private readonly Task? _writerTask; 83_writerTask = Task.Run(ProcessLogQueueAsync); 106private async Task ProcessLogQueueAsync()
Documentation\ApiDocs\ApiDocsCache.cs (8)
50public Task SetAsync(string key, string content, CancellationToken cancellationToken = default) 68public Task SetETagAsync(string url, string? etag, CancellationToken cancellationToken = default) 76public Task InvalidateAsync(string key, CancellationToken cancellationToken = default) 92public Task SetIndexAsync(ApiReferenceItem[] documents, CancellationToken cancellationToken = default) 108public Task SetIndexSourceFingerprintAsync(string fingerprint, CancellationToken cancellationToken = default) 124public Task SetMemberIndexAsync(ApiReferenceItem[] documents, CancellationToken cancellationToken = default) 140public Task SetMemberIndexSourceFingerprintAsync(string fingerprint, CancellationToken cancellationToken = default) 164public Task SetIndexedMemberContainerIdsAsync(string[] containerIds, CancellationToken cancellationToken = default)
Documentation\ApiDocs\ApiDocsIndexService.cs (1)
822private async Task PersistIndexedMemberItemsAsync(CancellationToken cancellationToken)
Documentation\ApiDocs\IApiDocsCache.cs (5)
19Task SetIndexAsync(ApiReferenceItem[] documents, CancellationToken cancellationToken = default); 29Task SetIndexSourceFingerprintAsync(string fingerprint, CancellationToken cancellationToken = default); 39Task SetMemberIndexAsync(ApiReferenceItem[] documents, CancellationToken cancellationToken = default); 49Task SetMemberIndexSourceFingerprintAsync(string fingerprint, CancellationToken cancellationToken = default); 59Task SetIndexedMemberContainerIdsAsync(string[] containerIds, CancellationToken cancellationToken = default);
Documentation\Docs\DocsCache.cs (9)
44public Task SetAsync(string key, string content, CancellationToken cancellationToken = default) 50public Task SetETagAsync(string url, string? etag, CancellationToken cancellationToken = default) 53public Task InvalidateAsync(string key, CancellationToken cancellationToken = default) 83public async Task SetIndexAsync(LlmsDocument[] documents, CancellationToken cancellationToken = default) 114public async Task SetIndexSourceFingerprintAsync(string fingerprint, CancellationToken cancellationToken = default) 122private async Task MigrateLegacyIndexFingerprintAsync(CancellationToken cancellationToken) 142private async Task ClearLegacyCacheAsync(CancellationToken cancellationToken) 148private async Task ClearLegacySourceCacheAsync(CancellationToken cancellationToken) 159private async Task ClearLegacyIndexCacheAsync(CancellationToken cancellationToken)
Documentation\Docs\DocsFetcher.cs (2)
40private async Task MigrateLegacyCacheAsync(CancellationToken cancellationToken) 74private async Task ClearLegacyCacheAsync(CancellationToken cancellationToken)
Documentation\Docs\IDocsCache.cs (2)
23Task SetIndexAsync(LlmsDocument[] documents, CancellationToken cancellationToken = default); 37Task SetIndexSourceFingerprintAsync(string fingerprint, CancellationToken cancellationToken = default);
Documentation\Docs\LlmsTxtParser.cs (3)
130return Task.FromResult<IReadOnlyList<LlmsDocument>>([]); 147return Task.FromResult<IReadOnlyList<LlmsDocument>>([]); 177return Task.FromResult<IReadOnlyList<LlmsDocument>>(documents);
Documentation\FileBackedDocumentContentCache.cs (8)
59public async Task SetAsync(string key, string content, CancellationToken cancellationToken = default) 104public async Task SetETagAsync(string key, string? etag, CancellationToken cancellationToken = default) 127public Task InvalidateAsync(string key, CancellationToken cancellationToken = default) 134return Task.CompletedTask; 142public Task InvalidateJsonAsync(string key, CancellationToken cancellationToken = default) 149return Task.CompletedTask; 221public async Task SetJsonAsync<T>( 290private async Task WriteTextFileAsync(string filePath, string content, CancellationToken cancellationToken)
Documentation\IDocumentContentCache.cs (3)
25Task SetAsync(string key, string content, CancellationToken cancellationToken = default); 41Task SetETagAsync(string url, string? etag, CancellationToken cancellationToken = default); 48Task InvalidateAsync(string key, CancellationToken cancellationToken = default);
DotNet\DotNetCliRunner.cs (5)
492private async Task StartBackchannelAsync( 562await Task.Delay(1000, cancellationToken).ConfigureAwait(false); 878await Task.Delay(TimeSpan.FromSeconds(attempt + 1), cancellationToken).ConfigureAwait(false); 1141private async Task UninstallTemplateAsync(string packageName, DirectoryInfo workingDirectory, CancellationToken cancellationToken) 1580await Task.Delay(delay, cancellationToken);
DotNet\DotNetSdkInstaller.cs (1)
49await Task.WhenAll(
DotNet\ProcessExecution.cs (10)
255private Task ShutdownOnCancelAsync(Process process) 285private async Task ShutdownLadderAsync(Process process, IProcessTreeGracefulShutdownSignaler? signaler, CancellationToken gracefulToken) 302var signalTask = InvokeSignalerAsync(signaler, GetSafePid(process), gracefulToken); 432private async Task InvokeSignalerAsync(IProcessTreeGracefulShutdownSignaler signaler, int pid, CancellationToken gracefulToken) 443await Task.Yield(); 511private async Task DisposeStartedProcessAsync() 595private async Task DrainOutputAsync(IsolatedProcess process, CancellationToken cancellationToken) 597var drained = Task.WhenAll(process.StandardOutputClosed, process.StandardErrorClosed); 631await Task.Delay(s_drainPollInterval, cancellationToken).ConfigureAwait(false);
Interaction\BannerService.cs (3)
54public async Task DisplayBannerAsync(CancellationToken cancellationToken = default) 111private static async Task DelayAsync(int milliseconds, CancellationToken cancellationToken) 115await Task.Delay(milliseconds, cancellationToken);
Interaction\ConsoleInteractionService.cs (2)
642public async Task DisplayLiveAsync(IRenderable initialRenderable, Func<Action<IRenderable>, Task> callback)
Interaction\ExtensionInteractionService.cs (14)
18Task FlushAsync(CancellationToken cancellationToken = default); 21Task LaunchAppHostAsync(string projectFile, List<string> arguments, List<EnvVar> environment, bool debug); 25Task StartDebugSessionAsync(string workingDirectory, string? projectFile, bool debug, DebugSessionOptions? options = null); 36private readonly Channel<Func<Task>> _extensionTaskChannel; 43internal Task PumpTask { get; } 54_extensionTaskChannel = Channel.CreateUnbounded<Func<Task>>(new UnboundedChannelOptions 62PumpTask = Task.Run(ProcessExtensionTaskChannelAsync, CancellationToken.None); 65public async Task FlushAsync(CancellationToken cancellationToken = default) 74return Task.CompletedTask; 527public Task DisplayLiveAsync(IRenderable initialRenderable, Func<Action<IRenderable>, Task> callback) 538public Task LaunchAppHostAsync(string projectFile, List<string> arguments, List<EnvVar> environment, bool debug) 559public Task StartDebugSessionAsync(string workingDirectory, string? projectFile, bool debug, DebugSessionOptions? options = null) 570private async Task ProcessExtensionTaskChannelAsync()
Interaction\IBannerService.cs (1)
16Task DisplayBannerAsync(CancellationToken cancellationToken = default);
Interaction\IInteractionService.cs (2)
41Task DisplayLiveAsync(IRenderable initialRenderable, Func<Action<IRenderable>, Task> callback);
Mcp\IMcpNotifier.cs (2)
17Task SendNotificationAsync(string method, CancellationToken cancellationToken = default); 19Task SendNotificationAsync<TParams>(string method, TParams parameters, CancellationToken cancellationToken = default);
Mcp\IMcpResourceToolRefreshService.cs (1)
37Task SendToolsListChangedNotificationAsync(CancellationToken cancellationToken);
Mcp\McpResourceToolRefreshService.cs (1)
66public async Task SendToolsListChangedNotificationAsync(CancellationToken cancellationToken)
Mcp\McpServerNotifier.cs (2)
14public Task SendNotificationAsync(string method, CancellationToken cancellationToken = default) 20public Task SendNotificationAsync<TParams>(string method, TParams parameters, CancellationToken cancellationToken = default)
Mcp\Tools\IDashboardInfoProvider.cs (1)
55return Task.FromResult((apiToken, apiBaseUrl, (string?)dashboardUrl));
Mcp\Tools\ListResourcesTool.cs (1)
76await Task.WhenAll(dashboardUrlsTask, snapshotsTask).ConfigureAwait(false);
Migrations\IMigration.cs (1)
68Task ApplyAsync(MigrationContext context, CancellationToken cancellationToken);
Migrations\TypeScriptAppHostMigration.cs (3)
91public async Task ApplyAsync(MigrationContext context, CancellationToken cancellationToken) 108return Task.FromResult(true); 339private async Task RegenerateSdkAsync(FileInfo modernAppHostFile, DirectoryInfo appHostDirectory, CancellationToken cancellationToken)
NuGet\NuGetPackagePrefetcher.cs (7)
16protected override async Task ExecuteAsync(CancellationToken stoppingToken) 31var prefetchTasks = new List<Task>(capacity: 2); 36prefetchTasks.Add(Task.Run(async () => 65prefetchTasks.Add(Task.Run(async () => 92private static async Task PreventOrphanedPrefetchingAsync(List<Task> prefetchTasks, CancellationToken stoppingToken) 96await Task.WhenAll(prefetchTasks);
Packaging\NuGetConfigMerger.cs (6)
33public static async Task CreateOrUpdateAsync(DirectoryInfo targetDirectory, PackageChannel channel, Func<FileInfo, XmlDocument?, XmlDocument, CancellationToken, Task<bool>>? confirmationCallback = null, CancellationToken cancellationToken = default) 51public static async Task CreateOrUpdateAsync( 81private static async Task CreateNewNuGetConfigAsync(DirectoryInfo targetDirectory, PackageMapping[] mappings, bool configureGlobalPackagesFolder, Func<FileInfo, XmlDocument?, XmlDocument, CancellationToken, Task<bool>>? confirmationCallback, CancellationToken cancellationToken) 115private static async Task UpdateExistingNuGetConfigAsync(FileInfo nugetConfigFile, PackageMapping[] mappings, bool configureGlobalPackagesFolder, Func<FileInfo, XmlDocument?, XmlDocument, CancellationToken, Task<bool>>? confirmationCallback, CancellationToken cancellationToken) 799private static async Task SaveConfigAsync(FileInfo nugetConfigFile, XDocument document) 942private static async Task AddGlobalPackagesFolderToConfigAsync(FileInfo configFile)
Packaging\NuGetConfigPrompter.cs (2)
29public async Task PromptToCreateOrUpdateAsync(DirectoryInfo targetDirectory, PackageChannel channel, CancellationToken cancellationToken) 83public async Task CreateOrUpdateWithoutPromptAsync(DirectoryInfo targetDirectory, PackageChannel channel, CancellationToken cancellationToken)
Packaging\PackageChannel.cs (5)
183var packageResults = await Task.WhenAll(tasks); 232var packageResults = await Task.WhenAll(tasks); 401var results = await Task.WhenAll(tasks); 525var packageResults = await Task.WhenAll(tasks); 614var packageResults = await Task.WhenAll(tasks);
Packaging\PackagingService.cs (1)
248return Task.FromResult<IEnumerable<PackageChannel>>(channels);
Packaging\TemporaryNuGetConfig.cs (3)
52public static async Task GenerateAsync(PackageMapping[] mappings, string targetPath) 58private static async Task GenerateNuGetConfigAsync(PackageMapping[] mappings, FileInfo configFile) 128private static async Task AddGlobalPackagesFolderToConfigAsync(FileInfo configFile, string? globalPackagesFolderValue)
Processes\IsolatedProcess.cs (15)
112private Func<CancellationToken, Task>? _waitForExitProvider; 129StandardOutputClosed = Task.CompletedTask; 130StandardErrorClosed = Task.CompletedTask; 183public Task StandardOutputClosed { get; private set; } 186public Task StandardErrorClosed { get; private set; } 246public Task WaitForExitAsync(CancellationToken cancellationToken = default) 354private async Task DisposeAfterStartCompletesAsync() 448Func<CancellationToken, Task>? WaitForExitProvider = null, 479private static async Task ForwardPumpAsync(Task pumpCompletion, TaskCompletionSource tcs) 508private ProcessPump(Task completion) 514public Task Completion { get; } 523var completion = Task.Run(() => RunAsync(reader, onLine)); 527private static async Task RunAsync(TextReader reader, Action<string> onLine)
Processes\IsolatedProcess.Windows.cs (1)
305private static Task WaitForProcessHandleExitAsync(SafeProcessHandle processHandle, CancellationToken cancellationToken)
Processes\LauncherLivenessMonitor.cs (1)
72return Task.CompletedTask;
Processes\ProcessTreeGracefulShutdownService.cs (1)
340await Task.Delay(s_processTerminationPollInterval, timeProvider, cancellationToken).ConfigureAwait(false);
Processes\WindowsProcessInterop.cs (1)
667public static async Task WaitForExitAsync(SafeProcessHandle processHandle, CancellationToken cancellationToken)
Profiling\ProfileCaptureService.cs (3)
267public async Task WaitForDashboardAsync(TimeSpan timeout, TimeSpan pollInterval, CancellationToken cancellationToken) 310await Task.Delay(pollInterval, _timeProvider, linkedCts.Token).ConfigureAwait(false); 436await Task.Delay(_profileDataPollInterval, _timeProvider, linkedCts.Token).ConfigureAwait(false);
Program.cs (2)
808internal static async Task DisplayFirstTimeUseNoticeIfNeededAsync(IServiceProvider serviceProvider, string[] args, CancellationToken cancellationToken = default) 1272var shutdownTelemetryTask = telemetryManager.ShutdownAsync();
Projects\AppHostInfoResolver.cs (1)
75private async Task CompleteSharedFetchAsync((string Path, DateTime LastWriteUtc) key, FileInfo projectFile, TaskCompletionSource<AppHostProjectInfo> completion)
Projects\AppHostRpcClient.cs (4)
118public Task InvokeAsync(string methodName, object?[] parameters, CancellationToken cancellationToken) 201await Task.Delay(100, cancellationToken).ConfigureAwait(false); 205await Task.Delay(100, cancellationToken).ConfigureAwait(false); 233await Task.Delay(100, cancellationToken).ConfigureAwait(false);
Projects\AppHostServerClosureSnapshots.cs (1)
521private static async Task WriteManifestFileAsync(
Projects\AppHostServerSession.cs (6)
54private Task? _runTask; 158public async Task StartAsync() 273private static async Task DriveAsync(IProcessExecution execution, TaskCompletionSource<int> completion, CancellationToken stopToken) 314var completedTask = await Task.WhenAny(connectTask, serverExitTask).ConfigureAwait(false); 446private static void ObserveFaultedTask(Task task)
Projects\DefaultLanguageDiscovery.cs (6)
86return Task.FromResult(s_allLanguages.Where(IsLanguageEnabled)); 95return Task.FromResult(language?.PackageName); 112return Task.FromResult<LanguageId?>(language.LanguageId); 116return Task.FromResult<LanguageId?>(null); 126return Task.FromResult<LanguageId?>(language.LanguageId); 130return Task.FromResult<LanguageId?>(null);
Projects\DotNetAppHostProject.cs (3)
139=> Task.FromResult(s_detectionPatterns); 1622private async Task EnsureDevCertificatesTrustedAsync(AppHostProjectContext context, Dictionary<string, string> env, CancellationToken cancellationToken) 2483var results = await Task.WhenAll(stopTasks);
Projects\ExtensionGuestLauncher.cs (1)
36Func<Task>? afterLaunchAsync,
Projects\GuestAppHostProject.cs (21)
155return Task.FromResult(_resolvedLanguage.DetectionPatterns); 270return Task.FromResult<string?>(config?.GetEffectiveSdkVersion(defaultSdkVersion) ?? defaultSdkVersion); 360return Task.FromResult(new AppHostValidationResult(IsValid: false, IsUnsupported: true)); 367return Task.FromResult(new AppHostValidationResult(IsValid: false)); 376return Task.FromResult(new AppHostValidationResult(IsValid: false)); 382return Task.FromResult(new AppHostValidationResult(IsValid: true)); 663Task StartBackchannelConnectionAfterGuestAppHostLaunchesAsync() 674return Task.CompletedTask; 1198Task StartBackchannelConnectionAfterGuestAppHostLaunchesAsync() 1205return Task.CompletedTask; 1295private async Task StartBackchannelConnectionAsync( 1377await Task.Delay(1000, cancellationToken).ConfigureAwait(false); 1381await Task.Delay(50, cancellationToken).ConfigureAwait(false); 1610var results = await Task.WhenAll(stopTasks); 1617private async Task GenerateCodeViaRpcAsync( 1925internal static async Task PruneObsoleteGeneratedFilesAsync( 2042private async Task EnsureRuntimeCreatedAsync( 2148Func<Task>? afterAppHostLaunchedAsync, 2173Func<Task>? afterAppHostLaunchedAsync, 2193return Task.FromResult<string?>(id); 2199internal async Task ConfigureCertificateBundleEnvironmentAsync(
Projects\GuestRuntime.cs (4)
177Func<Task>? afterAppHostLaunchedAsync = null, 220Func<Task>? afterAppHostLaunchedAsync = null, 540Func<Task>? afterLaunchAsync = null, 579private async Task EnsureMigrationFilesExistAsync(DirectoryInfo directory, CancellationToken cancellationToken)
Projects\IAppHostRpcClient.cs (1)
87Task InvokeAsync(string methodName, object?[] parameters, CancellationToken cancellationToken);
Projects\IAppHostServerSession.cs (1)
53Task StartAsync();
Projects\IGuestProcessLauncher.cs (1)
54Func<Task>? afterLaunchAsync,
Projects\ILanguageService.cs (1)
24Task SetLanguageAsync(IAppHostProject project, bool isGlobal = false, CancellationToken cancellationToken = default);
Projects\JavaAppHostToolchainResolver.cs (1)
391public static async Task EnsureToolchainFilesExistAsync(
Projects\LanguageService.cs (2)
52public async Task SetLanguageAsync(IAppHostProject project, bool isGlobal = false, CancellationToken cancellationToken = default) 57private async Task SetLanguageAsync(string languageId, bool isGlobal, CancellationToken cancellationToken)
Projects\PrebuiltAppHostServer.cs (3)
331internal static Task WriteIfChangedAsync(string path, string content, CancellationToken cancellationToken) 639private static async Task WriteRestoreStampAsync(string restoreDir, string fingerprint, ILogger logger, CancellationToken cancellationToken) 1702private static async Task WriteAppSettingsAsync(string contentRootPath, string appSettingsContent, CancellationToken cancellationToken)
Projects\ProcessGuestLauncher.cs (1)
48Func<Task>? afterLaunchAsync,
Projects\ProjectLocator.cs (4)
199var discoveryTask = CompleteFindAppHostProjectsStreamAsync(searchDirectory, scope, channel.Writer, onDirectoryEnumerated, discoveryCancellationTokenSource.Token); 229private async Task CompleteFindAppHostProjectsStreamAsync( 461async Task AddSettingsAppHostCandidateAsync() 1209private async Task CreateSettingsFileAsync(FileInfo projectFile, bool preserveExistingDefault, CancellationToken cancellationToken)
Projects\ProjectUpdater.cs (22)
282return Task.CompletedTask; 290return Task.CompletedTask; 362private Task AnalyzeAppHostAsync(UpdateContext context, CancellationToken cancellationToken) 370return Task.CompletedTask; 401private async Task AnalyzeAppHostSdkAsync(UpdateContext context, CancellationToken cancellationToken) 538private static async Task RemoveLegacyAppHostPackageReferencesAsync( 569await Task.CompletedTask; 658internal static async Task UpdateSdkVersionInAppHostAsync(FileInfo projectFile, NuGetPackageCli package, IInteractionService interactionService, SdkMigrationInfo migrationInfo) 688internal static async Task UpdateSdkVersionInProjectAppHostAsync(FileInfo projectFile, NuGetPackageCli package) 748await Task.CompletedTask; 868private static async Task UpdateSdkVersionInSingleFileAppHostAsync(FileInfo projectFile, NuGetPackageCli package) 920private static async Task RemoveLegacyAppHostPackageDirectiveAsync(FileInfo projectFile) 931private async Task AnalyzeProjectAsync(FileInfo projectFile, UpdateContext context, CancellationToken cancellationToken) 1043private async Task AnalyzePackageForTraditionalManagementAsync(string packageId, string packageVersion, FileInfo projectFile, UpdateContext context, CancellationToken cancellationToken) 1071private async Task AnalyzePackageForCentralPackageManagementAsync(string packageId, FileInfo projectFile, FileInfo directoryPackagesPropsFile, UpdateContext context, CancellationToken cancellationToken) 1207private static async Task UpdatePackageVersionInDirectoryPackagesProps(string packageId, string newVersion, FileInfo directoryPackagesPropsFile) 1221await Task.CompletedTask; 1224private async Task UpdatePackageReferenceInProject(FileInfo projectFile, NuGetPackageCli package, CancellationToken cancellationToken) 1490internal abstract record UpdateStep(string Description, Func<Task> Callback) 1503Func<Task> Callback, 1521Func<Task> Callback, 1550internal record AnalyzeStep(string Description, Func<Task> Callback);
Projects\RunningInstanceManager.cs (1)
152await Task.Delay(ProcessTerminationPollIntervalMs, cancellationToken).ConfigureAwait(false);
Projects\SolutionLocator.cs (3)
53var slnTask = Task.Run(() => 66var slnxTask = Task.Run(() => 79await Task.WhenAll(slnTask, slnxTask);
Scaffolding\ScaffoldingService.cs (2)
292private async Task AddRootTypeScriptAppHostScriptsAsync(DirectoryInfo rootDirectory, DirectoryInfo appHostDirectory, CancellationToken cancellationToken) 476private async Task GenerateCodeViaRpcAsync(
src\Shared\ChannelExtensions.cs (1)
43await Task.Delay(s, cancellationToken).ConfigureAwait(false);
src\Shared\ContainerRuntimeDetector.cs (1)
127var results = await Task.WhenAll(tasks).ConfigureAwait(false);
src\Shared\IntegrationPackageProbeManifest.cs (1)
123public static Task WriteAsync(
src\Shared\ParentProcessLivenessMonitor.cs (6)
16private readonly Task _monitorTask; 22Func<CancellationToken, Task> onParentExited, 44Func<CancellationToken, Task> onParentExited, 51private static async Task MonitorAsync( 54Func<CancellationToken, Task> onParentExited, 64await Task.Yield();
Telemetry\AspireCliTelemetry.cs (6)
223public Task StartAsync(CancellationToken cancellationToken) 226return Task.CompletedTask; 230public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; 262await Task.WhenAll(new Task[] { macAddressHashTask, deviceIdTask }).ConfigureAwait(false);
Telemetry\DefaultMachineInformationProvider.cs (1)
21public override Task<string?> GetOrCreateDeviceId() => Task.FromResult<string?>(null);
Telemetry\InternalMicrosoftDetector.cs (9)
235var completedTask = await Task.WhenAny(pendingTasks).ConfigureAwait(false); 252return Task.Run(async () => 277private async Task DrainCancelledProbesAsync(IReadOnlyList<Task<InternalMicrosoftDetectionResult?>> probeTasks) 281await Task.WhenAll(probeTasks).WaitAsync(s_cancelledProbeDrainTimeout).ConfigureAwait(false); 330private async Task TryWriteCacheAsync(InternalMicrosoftDetectionResult result, CancellationToken cancellationToken) 373return Task.FromResult(domain is not null 628var completedTask = await Task.WhenAny(candidateTasks).WaitAsync(linkedSource.Token).ConfigureAwait(false); 674private async Task DrainGitHubCandidateTasksAsync(IReadOnlyList<Task<bool>> candidateTasks) 683await Task.WhenAll(candidateTasks).WaitAsync(s_cancelledProbeDrainTimeout).ConfigureAwait(false);
Telemetry\MachineInformationProviderBase.cs (1)
36return Task.Run(() =>
Telemetry\TelemetryManager.cs (6)
187public Task ForceFlushProfilingAsync() 196return Task.Run(() => 210public Task ForceFlushReportedAsync() 214return Task.Run(() => 223public Task ShutdownAsync() 227return Task.Run(() =>
Telemetry\TelemetryTagsSource.cs (2)
29_tagsTask ?? Task.FromResult<IReadOnlyList<KeyValuePair<string, object?>>>(Array.Empty<KeyValuePair<string, object?>>()); 64_tagsTask ??= Task.Run(factory);
Telemetry\WindowsMachineInformationProvider.cs (1)
26return Task.Run<string?>(() =>
Templating\CliTemplateFactory.cs (3)
107return Task.FromResult(GetTemplateDefinitions()); 112return Task.FromResult<IEnumerable<ITemplate>>(Array.Empty<ITemplate>()); 302private async Task CopyTemplateTreeToDiskAsync(string templateRoot, string outputPath, Func<string, string> tokenReplacer, CancellationToken cancellationToken)
Templating\CliTemplateFactory.EmptyTemplate.cs (2)
148private async Task ApplyLocalhostTldToScaffoldedRunProfileAsync(string outputPath, string projectName, CancellationToken cancellationToken) 167private async Task WriteCSharpEmptyAppHostAsync(string? templateVersion, string outputPath, string projectName, bool useLocalhostTld, CancellationToken cancellationToken)
Templating\DotNetTemplateFactory.cs (5)
287private async Task PromptForDevLocalhostTldOptionAsync(ParseResult result, List<string> extraArgs, CancellationToken cancellationToken) 303private async Task PromptForRedisCacheOptionAsync(ParseResult result, List<string> extraArgs, CancellationToken cancellationToken) 319private async Task PromptForTestFrameworkOptionsAsync(ParseResult result, List<string> extraArgs, CancellationToken cancellationToken) 363private async Task PromptForXUnitVersionOptionsAsync(ParseResult result, List<string> extraArgs, CancellationToken cancellationToken) 409return await ApplyTemplateAsync(template, inputs, parseResult, (_, _) => Task.FromResult(Array.Empty<string>()), cancellationToken);
Templating\TemplateNuGetConfigService.cs (2)
37public async Task PromptToCreateOrUpdateNuGetConfigAsync(PackageChannel channel, string outputPath, CancellationToken cancellationToken) 94public async Task PromptToCreateOrUpdateNuGetConfigAsync(string? channelName, string outputPath, CancellationToken cancellationToken)
Templating\TemplateProvider.cs (2)
30var templates = await Task.WhenAll(_factories.Select(f => f.GetTemplatesAsync(cancellationToken))); 36var templates = await Task.WhenAll(_factories.Select(f => f.GetInitTemplatesAsync(cancellationToken)));
Tui\TerminalViewerApp.cs (11)
186opts.OnRoleChanged = (e, _) => { OnRoleChanged(e); return Task.CompletedTask; }; 187opts.OnRemoteResized = (e, _) => { OnRemoteResized(e); return Task.CompletedTask; }; 192return Task.CompletedTask; 198return Task.CompletedTask; 200opts.OnDisconnected = _ => { OnDisconnected(); return Task.CompletedTask; }; 279var disposeTask = _embedded.DisposeAsync().AsTask(); 280var timeout = Task.Delay(TimeSpan.FromSeconds(2), CancellationToken.None); 281await Task.WhenAny(disposeTask, timeout).ConfigureAwait(false); 541private async Task TakeControlAsync(IHmp1ConnectionHandle connection, int availW, int availH) 586_ = Task.Run(async () =>
Utils\ArchiveHelper.cs (2)
18internal static async Task ExtractAsync(string archivePath, string destinationPath, IEnvironment environment, CancellationToken cancellationToken) 71private static async Task ExtractTarGzSafeAsync(string archivePath, string destinationPath, IEnvironment environment, CancellationToken cancellationToken)
Utils\CliDownloader.cs (2)
194private static async Task DownloadFileAsync(string url, string outputPath, int timeoutSeconds, CancellationToken cancellationToken) 206private static async Task ValidateChecksumAsync(string archivePath, string checksumPath, CancellationToken cancellationToken)
Utils\CliUpdateNotifier.cs (2)
16Task CheckForCliUpdatesAsync(DirectoryInfo workingDirectory, CancellationToken cancellationToken); 54public async Task CheckForCliUpdatesAsync(DirectoryInfo workingDirectory, CancellationToken cancellationToken)
Utils\ConfigurationHelper.cs (1)
225internal static async Task WriteSettingsFileAsync(string filePath, JsonObject settings, CancellationToken cancellationToken = default)
Utils\ConsoleActivityLogger.cs (4)
41private Task? _spinnerTask; 119_spinnerTask = Task.Run(async () => 147await Task.Delay(120).ConfigureAwait(false); 212public async Task StopSpinnerAsync()
Utils\EnvironmentChecker\ContainerRuntimeCheck.cs (1)
35var runtimes = await Task.WhenAll(dockerTask, podmanTask);
Utils\EnvironmentChecker\DcpConnectionChecker.cs (3)
323public async Task StopDcpAsync(HttpClient client, DcpKubeconfig kubeconfig, CancellationToken cancellationToken) 381private async Task WaitForKubeconfigFileAsync(CancellationToken cancellationToken) 396await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken).ConfigureAwait(false);
Utils\EnvironmentChecker\DcpConnectionHealthCheck.cs (1)
69var results = await Task.WhenAll(ephemeralCertificateTask, developerCertificateTask).ConfigureAwait(false);
Utils\EnvironmentChecker\DcpKubeconfig.cs (2)
23internal static async Task<DcpKubeconfig> ReadFileWithRetryAsync(string path, Func<TimeSpan, CancellationToken, Task>? delayAsync = null, CancellationToken cancellationToken = default) 25delayAsync ??= Task.Delay;
Utils\EnvironmentChecker\DeprecatedAgentConfigCheck.cs (1)
85return Task.FromResult<IReadOnlyList<EnvironmentCheckResult>>(results);
Utils\EnvironmentChecker\DevCertsCheck.cs (1)
219private async Task AddLinuxOpenSslCertificateCacheWarningsAsync(List<EnvironmentCheckResult> results, IReadOnlyList<DevCertInfo> certInfos, IEnvironment environment, CancellationToken cancellationToken)
Utils\EnvironmentChecker\EnvironmentChecker.cs (1)
64var checkTask = Task.Run(() => check.CheckAsync(checkTimeoutCts.Token), CancellationToken.None);
Utils\EnvironmentChecker\LegacySettingsFileCheck.cs (2)
60return Task.FromResult<IReadOnlyList<EnvironmentCheckResult>>([result]); 66return Task.FromResult<IReadOnlyList<EnvironmentCheckResult>>([]);
Utils\EnvironmentChecker\OperatingSystemCheck.cs (1)
53return Task.FromResult<IReadOnlyList<EnvironmentCheckResult>>([result]);
Utils\EnvironmentChecker\VsCodeExtensionCheck.cs (3)
65return Task.FromResult<IReadOnlyList<EnvironmentCheckResult>>([]); 82return Task.FromResult<IReadOnlyList<EnvironmentCheckResult>>([pass]); 97return Task.FromResult<IReadOnlyList<EnvironmentCheckResult>>([warning]);
Utils\EnvironmentChecker\WslEnvironmentCheck.cs (3)
42return Task.FromResult<IReadOnlyList<EnvironmentCheckResult>>([]); 53return Task.FromResult<IReadOnlyList<EnvironmentCheckResult>>([]); 56return Task.FromResult<IReadOnlyList<EnvironmentCheckResult>>([CreateResult(DetermineWslVersion(procVersion, hasWslEnvironmentSignal))]);
Utils\FileLock.cs (2)
48/// Uses <see cref="Task.Delay(TimeSpan, CancellationToken)"/> between retries to avoid blocking the thread pool. 92await Task.Delay(s_defaultRetryDelay, cancellationToken).ConfigureAwait(false);
Utils\ProcessCaptureRunner.cs (1)
185private static async Task SwallowExitWaitAsync(Process process, TimeSpan bound, ILogger logger)
aspire-managed (17)
NuGet\Commands\LayoutCommand.cs (1)
63return Task.FromResult(ExecuteLayout(assetsPath, outputPath, framework, runtimeIdentifier, verbose));
NuGet\Commands\SearchCommand.cs (1)
150var searchResults = await Task.WhenAll(searchTasks).ConfigureAwait(false);
NuGet\NuGetLogger.cs (4)
34public Task LogAsync(NuGetLogLevel level, string data) { Log(level, data); return Task.CompletedTask; } 35public Task LogAsync(NuGetLogMessage message) { Log(message); return Task.CompletedTask; }
src\Shared\IntegrationPackageProbeManifest.cs (1)
123public static Task WriteAsync(
src\Shared\ParentProcessLivenessMonitor.cs (6)
16private readonly Task _monitorTask; 22Func<CancellationToken, Task> onParentExited, 44Func<CancellationToken, Task> onParentExited, 51private static async Task MonitorAsync( 54Func<CancellationToken, Task> onParentExited, 64await Task.Yield();
src\Shared\ParentProcessWatchdog.cs (4)
93internal static async Task CancelAndForceExitAsync( 101var forceExitTask = ForceExitAfterDelayAsync(stopToken, forceExitGracePeriod, exit); 123private static async Task ForceExitAfterDelayAsync( 128await Task.Delay(forceExitGracePeriod, stopToken).ConfigureAwait(false);
Aspire.Acquisition.Tests (312)
Scripts\Common\FakeArchiveHelper.cs (1)
187private static async Task CreateTarGzAsync(string contentDir, string archivePath)
Scripts\Common\ScriptHostFixture.cs (5)
19private Task? _serverTask; 75_serverTask = Task.Run(() => ServeAsync(_cts!.Token)); 85await Task.CompletedTask; 137private async Task ServeAsync(CancellationToken cancellationToken) 170private async Task HandleRequestAsync(HttpListenerContext ctx)
Scripts\PipedInstallTests.cs (10)
34public async Task CurlPipeToBash_ReleaseScript_HelpWorks() 57public async Task CurlPipeToBash_PRScript_HelpWorks() 77public async Task CurlPipeToBash_ReleaseScript_InvalidQualityFails() 94public async Task CurlPipeToBash_ReleaseScript_ArgsWithSpacesWork() 121public async Task CatPipeToBash_ReleaseScript_HelpWorks() 145public async Task CatPipeToBash_PRScript_HelpWorks() 171public async Task IrmPipeToIex_ReleaseScript_HelpWorks() 196public async Task IrmPipeToIex_PRScript_HelpWorks() 217public async Task IrmPipeToIex_ReleaseScript_InvalidQualityFails() 237public async Task IrmPipeToIex_ReleaseScript_ArgsWithSpacesWork()
Scripts\PRScriptFunctionTests.cs (16)
29public async Task GetRuntimeIdentifier_ExplicitOsAndArch_ReturnsExpectedRid( 46public async Task GetRuntimeIdentifier_UnsupportedArch_Fails() 65public async Task GetCliArchitectureFromArchitecture_NormalizesArchNames(string input, string expected) 85public async Task ExtractVersionSuffix_ValidNupkg_ReturnsVersionSuffix() 108public async Task ExtractVersionSuffix_NoNupkgFiles_Fails() 127public async Task ExtractVersionSuffix_NupkgWithoutPrSuffix_Fails() 149public async Task ExtractVersionSuffix_MultipleNupkgs_UsesFirst() 180public async Task DetectOs_ReturnsKnownPlatform() 203public async Task DetectArchitecture_ReturnsKnownArch() 226public async Task RemoveTempDir_KeepArchive_RetainsDirectory() 246public async Task RemoveTempDir_NoKeepArchive_DeletesDirectory() 266public async Task RemoveTempDir_DryRun_RetainsDirectory() 290public async Task DownloadAspireCli_ZeroArchives_Fails() 314public async Task DownloadAspireCli_MultipleArchives_Fails() 337public async Task DownloadAspireCli_SingleArchive_ReturnsPath() 364public async Task AddToPath_AppendsExportLine()
Scripts\PRScriptInstallE2ETests.cs (1)
23public async Task PRScript_InstallsCliAndWritesRouteSidecar()
Scripts\PRScriptInstallerModeTests.cs (23)
385private static async Task CreateFakeHomebrewArchivesAsync(string root) 392private static async Task CreateFakeWinGetArchivesAsync(string root) 415private static async Task WriteRealAspireWinGetZipAsync(string path, string aspireExeContent) 455public async Task Bash_Help_DescribesInstallerModes() 469public async Task Bash_WinGetMode_PrDryRun_DownloadsManifestAndNativeArchives() 496public async Task Bash_HomebrewMode_PrDryRun_DownloadsCaskAndNativeArchives() 521public async Task Bash_HomebrewMode_LocalDir_DryRun_UsesDogfoodArtifact() 542public async Task Bash_InstallerMode_RejectsHiveOnly() 560public async Task Bash_HomebrewDogfood_FailsWhenVersionCheckFails() 577public async Task Bash_ValidateHomebrewCask_RemovesGeneratedTapTemplateBeforeSyntaxCheck() 596public async Task Bash_PrepareHomebrewCask_FailedVerification_UninstallsCask() 623public async Task Bash_PrepareHomebrewCask_LiveArchives_GeneratesCaskWithArchiveHashesAndDogfood() 665public async Task PowerShell_WinGetMode_WhatIf_DownloadsManifestAndNativeArchives() 692public async Task PowerShell_HomebrewMode_WhatIf_DownloadsCaskAndNativeArchives() 717public async Task PowerShell_WinGetMode_LocalDir_WhatIf_UsesDogfoodArtifact() 738public async Task PowerShell_InstallerMode_RejectsHiveOnly() 756public async Task PowerShell_PrepareWinGetManifest_GenerateOnly_GeneratesManifestsWithArchiveHashesAndDogfood() 790public async Task PowerShell_WinGetDogfood_Force_PassesForceToWingetInstall() 809public async Task PowerShell_WinGetDogfood_FailsWhenVersionCheckFails() 826public async Task PowerShell_WinGetDogfood_ArchiveRoot_ValidatesPristineAndInstallsRewrittenManifest() 862public async Task PowerShell_WinGetDogfood_ArchiveRoot_FailsWhenArchiveBytesChange() 889public async Task PowerShell_PrepareWinGetManifest_NestedInstallerFiles_MatchArchiveContents() 941public async Task PowerShell_WinGetDogfood_ArchiveRoot_FailsWhenNestedInstallerFileMissingFromArchive()
Scripts\PRScriptIntegrationTests.cs (4)
31public async Task ShellScript_WithRealPR_DryRun_Succeeds() 52public async Task PowerShellScript_WithRealPR_WhatIf_Succeeds() 73public async Task ShellScript_WithRealPR_DiscoverRunId_DryRun_Succeeds() 94public async Task PowerShellScript_WithRealPR_DiscoverRunId_WhatIf_Succeeds()
Scripts\PRScriptPowerShellTests.cs (39)
32public async Task GetHelp_WithQuestionMark_ShowsUsage() 47public async Task AllMainParameters_ShownInHelp() 73public async Task MissingPRNumber_ReturnsError() 85public async Task WhatIfWithPRNumber_ShowsSteps() 97public async Task MockGhApiWithoutJqFailsLoudly() 111public async Task MockGhApiGraphQlWithoutJqFailsLoudly() 125public async Task MockGhApiGraphQlWithJqReturnsHeadSha() 139public async Task CustomInstallPath_IsRecognized() 152public async Task RunIdParameter_IsRecognized() 164public async Task WorkflowRunIdOnly_NoHiveLabel_WhatIf_Rejected() 183public async Task LocalDir_WhatIf_UsesLocalDirectoryWithoutGh() 205public async Task LocalDir_WhatIf_AutoDetectsRawBuildOutput() 232public async Task OSOverride_IsRecognized() 244public async Task ArchOverride_IsRecognized() 256public async Task HiveOnlyFlag_IsRecognized() 268public async Task SkipExtensionFlag_IsRecognized() 280public async Task SkipPathFlag_IsRecognized() 292public async Task MultipleFlags_WorkTogether() 313public async Task InvalidPRNumber_NonNumeric_ReturnsError() 324public async Task InvalidPRNumber_Zero_ReturnsError() 335public async Task InvalidPRNumber_Negative_ReturnsError() 346public async Task DryRun_ShowsDefaultInstallPath() 358public async Task AspireRepoEnvVar_IsUsedInDryRun() 371public async Task DryRun_ShowsArtifactNameWithRid() 388public async Task DryRun_ShowsNugetHivePath() 400public async Task HiveOnly_SkipsCLIDownload() 412public async Task LocalDir_WhatIf_WithGitHubRunIdEnvSet_UsesLocalHiveLabel() 445public async Task WhatIf_PRRoute_CliInstallPath_IsUnderDogfoodPrN() 465public async Task WhatIf_PRRoute_DoesNotWriteSidecar_AndAnnouncesPath() 490public async Task WhatIf_PRRoute_PrintsPathHintToStdout() 513public async Task WhatIf_PRRoute_PrintsPathHintWithAbsoluteInstallPath() 546public async Task WhatIf_PRRoute_HiveLocation_IsUnchanged() 563public async Task WhatIf_PRRoute_DoesNotWriteSidecar_AnyContentRegression() 579public async Task WhatIf_PRRoute_DoesNotCreateGlobalAspireConfigJson() 597public async Task WhatIf_LocalDir_DoesNotWriteSidecar() 635public async Task EmptyPRNumber_ReturnsError_AndCreatesNoFiles() 649public async Task VeryLargePRNumber_AboveIntMax_Rejected_AndCreatesNoFiles() 670public async Task SpecialCharsPRNumber_Rejected_AndCreatesNoFiles(string pr) 689public async Task NonPositivePRNumber_Rejected_AndCreatesNoFiles(string pr)
Scripts\PRScriptPSFunctionTests.cs (15)
29public async Task GetRuntimeIdentifier_ExplicitOsAndArch_ReturnsExpectedRid( 46public async Task GetRuntimeIdentifier_UnsupportedArch_Fails() 65public async Task GetCliArchitectureFromArchitecture_NormalizesArchNames(string input, string expected) 81public async Task UpdatePathEnvironment_WhenCurrentPathAlreadyContainsDirectory_StillUpdatesGitHubPath() 112public async Task GetVersionSuffixFromPackages_ValidNupkg_ReturnsVersionSuffix() 135public async Task GetVersionSuffixFromPackages_NoNupkgFiles_Fails() 154public async Task GetVersionSuffixFromPackages_NupkgWithoutPrSuffix_Fails() 176public async Task GetVersionSuffixFromPackages_MultipleNupkgs_UsesFirst() 207public async Task GetOperatingSystem_ReturnsKnownPlatform() 230public async Task GetMachineArchitecture_ReturnsKnownArch() 257public async Task RemoveTempDirectory_KeepArchive_RetainsDirectory() 277public async Task RemoveTempDirectory_NoKeepArchive_DeletesDirectory() 297public async Task RemoveTempDirectory_WhatIf_RetainsDirectory() 321public async Task InstallAspireCliFromDownload_ZeroArchives_Fails() 343public async Task InstallAspireCliFromDownload_MultipleArchives_Fails()
Scripts\PRScriptShellTests.cs (46)
29public async Task HelpFlag_ShowsUsage() 40public async Task AllMainParameters_ShownInHelp() 63public async Task MissingPRNumberAndRunId_ReturnsError() 75public async Task DryRunWithPRNumber_ShowsSteps() 88public async Task MockGhApiWorkflowWithoutJqFailsLoudly() 102public async Task MockGhApiWorkflowWithJqReturnsRunId() 116public async Task CustomInstallPath_IsRecognized() 129public async Task RunIdParameter_IsRecognized() 141public async Task LocalDir_DryRun_UsesLocalDirectoryWithoutGh() 163public async Task LocalDir_DryRun_AutoDetectsRawBuildOutput() 188public async Task RunIdAsFirstArg_DryRun_Succeeds() 204public async Task RunIdOnly_NoHiveLabel_DryRun_Rejected() 223public async Task RunIdWithPRNumber_DryRun_UsesPrHiveLabel() 235public async Task RunIdAsFirstArg_NonNumericValue_ReturnsError() 247public async Task RunIdAsFirstArg_NoValue_ReturnsError() 258public async Task ShortRunIdFlag_AsFirstArg_DryRun_Succeeds() 272public async Task OSOverride_IsRecognized() 284public async Task ArchOverride_IsRecognized() 296public async Task HiveOnlyFlag_IsRecognized() 308public async Task SkipExtensionFlag_IsRecognized() 320public async Task SkipPathFlag_IsRecognized() 335public async Task BooleanFlags_AreAccepted(string flag) 346public async Task MultipleFlags_WorkTogether() 369public async Task InvalidPRNumber_NonNumeric_ReturnsError() 380public async Task InvalidPRNumber_Zero_ReturnsError() 391public async Task InvalidPRNumber_Negative_ReturnsError() 402public async Task UnrecognizedOptionAsFirstArg_ReturnsError() 413public async Task UnknownFlag_ReturnsError() 425public async Task AspireRepoEnvVar_IsUsedInDryRun() 438public async Task DryRun_ShowsArtifactNameWithRid() 452public async Task DryRun_ShowsDefaultInstallPath() 464public async Task DryRun_ShowsNugetHivePath() 476public async Task HiveOnly_SkipsCLIDownload() 488public async Task LocalDir_DryRun_WithGitHubRunIdEnvSet_UsesLocalHiveLabel() 519public async Task DryRun_PRRoute_CliInstallPath_IsUnderDogfoodPrN() 540public async Task DryRun_PRRoute_DoesNotWriteSidecar_AndAnnouncesPath() 562public async Task DryRun_PRRoute_PrintsPathHintToStdout() 578public async Task DryRun_PRRoute_PrintsPathHintWithAbsoluteInstallPath() 609public async Task DryRun_PRRoute_HiveLocation_IsUnchanged() 626public async Task DryRun_PRRoute_DoesNotWriteSidecar_AnyContentRegression() 642public async Task DryRun_PRRoute_DoesNotCreateGlobalAspireConfigJson() 660public async Task DryRun_LocalDir_DoesNotWriteSidecar() 700public async Task EmptyPRNumber_ReturnsError_AndCreatesNoFiles() 717public async Task VeryLargePRNumber_AcceptedByScript_DryRunAnnouncesSidecarPath() 745public async Task SpecialCharsPRNumber_Rejected_AndCreatesNoFiles(string pr) 763public async Task LeadingZeroOrNegativePRNumber_Rejected_AndCreatesNoFiles(string pr)
Scripts\PRScriptToolModeTests.cs (48)
137public async Task Bash_Help_DescribesInstallModeAndForce() 154public async Task Bash_InvalidInstallMode_ReturnsError() 167public async Task Bash_ToolMode_LocalDir_DryRun_SkipsArchiveAndShowsDotnetToolInstall() 193public async Task Bash_ShortInstallModeTool_LocalDir_DryRun_UsesDotnetToolInstall() 213public async Task Bash_ShortInstallPath_RemainsInstallPath() 235public async Task Bash_ToolMode_PrDryRun_SkipsCliNativeArchivesDownload() 260public async Task Bash_ToolMode_RunIdAloneRequiresHiveLabel() 281public async Task Bash_ToolMode_RunIdWithHiveLabel_DryRun_PopulatesHive() 303public async Task Bash_ToolMode_RejectsCrossArchitectureOverride() 322public async Task Bash_ToolMode_ExplicitInstallPathUsesToolPath() 343public async Task Bash_ToolMode_RejectsHiveOnly() 364public async Task Bash_ArchiveMode_RejectsForce() 384public async Task Bash_ToolMode_InstallFailureSuggestsForce() 415public async Task Bash_ToolMode_ForceUpdatesExistingToolWithAllowDowngrade() 452public async Task Bash_ToolMode_ForceUpdateFailureReportsUpdate() 484public async Task Bash_ToolMode_PrInstall_DoesNotWritePRRouteSidecar() 522public async Task Bash_ToolMode_GlobalInstallDoesNotModifyPath() 547public async Task Bash_ToolMode_DryRun_DoesNotSkipExtensionByDefault() 564public async Task Bash_ToolMode_DryRun_SkipExtensionFlagHonored() 580public async Task Bash_ToolMode_ExplicitInstallPathAddsToolPathToPath() 606public async Task Bash_FindAspireCliPackageVersion_ReturnsExactVersion() 626public async Task Bash_FindAspireCliPackageVersion_IgnoresNonPointerPackages() 650public async Task Bash_FindAspireCliPackageVersion_NoMatchFails() 673public async Task Bash_FindAspireCliPackageVersion_MultipleMatchesFails() 695public async Task Bash_InstallOrUpdateAspireCliTool_ForceUsesUpdateWithAllowDowngrade() 720public async Task Ps_Help_DescribesInstallModeAndForce() 735public async Task Ps_InvalidInstallMode_ReturnsError() 749public async Task Ps_ToolMode_LocalDir_WhatIf_ShowsDotnetToolInstall() 774public async Task Ps_ShortInstallModeTool_LocalDir_WhatIf_UsesDotnetToolInstall() 793public async Task Ps_ShortInstallPath_RemainsInstallPath() 814public async Task Ps_ToolMode_PrWhatIf_SkipsCliNativeArchivesDownload() 839public async Task Ps_ToolMode_RunIdAloneRequiresHiveLabel() 857public async Task Ps_ToolMode_RunIdWithHiveLabel_WhatIf_PopulatesHive() 880public async Task Ps_ToolMode_RejectsCrossArchitectureOverride() 899public async Task Ps_ToolMode_ExplicitInstallPathUsesToolPath() 920public async Task Ps_ToolMode_RejectsHiveOnly() 941public async Task Ps_ArchiveMode_RejectsForce() 961public async Task Ps_ToolMode_InstallFailureSuggestsForce() 991public async Task Ps_ToolMode_ForceUpdatesExistingToolWithAllowDowngrade() 1028public async Task Ps_ToolMode_PrInstall_DoesNotWritePRRouteSidecar() 1066public async Task Ps_ToolMode_GlobalInstallDoesNotModifyPath() 1091public async Task Ps_ToolMode_WhatIf_DoesNotSkipExtensionByDefault() 1107public async Task Ps_ToolMode_ExplicitInstallPathAddsToolPathToPath() 1133public async Task Ps_FindAspireCliPackageVersion_ReturnsExactVersion() 1153public async Task Ps_FindAspireCliPackageVersion_IgnoresNonPointerPackages() 1177public async Task Ps_FindAspireCliPackageVersion_NoMatchFails() 1199public async Task Ps_FindAspireCliPackageVersion_MultipleMatchesFails() 1221public async Task Ps_InstallAspireCliTool_ForceUsesUpdateWithAllowDowngrade()
Scripts\PSSourceabilityTests.cs (2)
19public async Task ReleaseScript_CanLoadFunctions_WithoutExecutingMain() 36public async Task PRScript_CanLoadFunctions_WithoutExecutingMain()
Scripts\ReleaseScriptFunctionTests.cs (28)
26public async Task MapQualityToChannel_KnownQualities_ReturnsMappedChannel(string quality, string expectedChannel) 42public async Task MapQualityToChannel_UnknownQuality_ReturnsAsIs() 67public async Task ConstructAspireCliUrl_NoVersion_ReturnsAkaMsUrl( 86public async Task ConstructAspireCliUrl_NoVersionWithChecksum_ReturnsChecksumUrl( 105public async Task ConstructAspireCliUrl_WithStableVersion_ReturnsGitHubReleaseUrl( 124public async Task ConstructAspireCliUrl_WithStableVersionAndChecksum_ReturnsGitHubReleaseChecksumUrl( 144public async Task ConstructAspireCliUrl_WithPrereleaseVersion_ReturnsCiDotNetUrl(string version) 163public async Task ConstructAspireCliUrl_WithPrereleaseVersionAndChecksum_ReturnsCiDotNetChecksumUrl(string version) 182public async Task ConstructAspireCliUrl_UnsupportedQualityNoVersion_ReturnsError() 205public async Task GetDownloadDescriptor_WithSource_ReturnsFriendlyChannelSource(string url, string source, string expectedDescriptor) 229public async Task ValidateContentType_GitHubReleaseRedirectWithHtmlIntermediateResponse_Succeeds() 259public async Task ValidateChecksum_MatchingChecksum_Succeeds() 277public async Task ValidateChecksum_MismatchedChecksum_Fails() 300public async Task InstallArchive_TarGz_ExtractsToDestination() 321public async Task InstallArchive_Zip_ExtractsToDestination() 346public async Task DetectOs_ReturnsKnownPlatform() 369public async Task DetectArchitecture_ReturnsKnownArch() 398public async Task GetCliArchitectureFromArchitecture_NormalizesArchNames(string input, string expected) 414public async Task GetCliArchitectureFromArchitecture_UnsupportedArch_Fails() 434public async Task SetupCliBundle_InvokesSetupAndPropagatesFailure() 467public async Task ConstructAspireExtensionUrl_NoVersion_ReturnsAkaMsUrl(string quality, string expectedUrl) 483public async Task ConstructAspireExtensionUrl_WithVersion_ReturnsCiDotNetUrl() 507public async Task AddToShellProfile_Bash_AddsPathToBashrc() 531public async Task AddToShellProfile_Zsh_AddsPathToZshrc() 555public async Task AddToShellProfile_AlreadyInPath_DoesNotDuplicate() 582public async Task AddToShellProfile_NoConfigFile_DryRunShowsMessage() 606public async Task ValidateContentType_HtmlResponse_Fails() 643public async Task ValidateContentType_BinaryResponse_Succeeds()
Scripts\ReleaseScriptPowerShellTests.cs (23)
21public async Task HelpFlag_ShowsUsage() 36public async Task InvalidQuality_ReturnsError() 47public async Task WhatIf_ShowsActions() 63public async Task WhatIfWithCustomPath_IsRecognized() 75public async Task AllMainParameters_ShownInHelp() 99public async Task VersionParameter_IsRecognized() 110public async Task MultipleParameters_WorkTogether() 128public async Task SkipPathFlag_IsRecognized() 140public async Task OsOverride_IsRecognized() 151public async Task ArchOverride_IsRecognized() 165public async Task QualityVariants_AreRecognized(string quality, string expectedSource) 184public async Task WriteInstallSidecar_PersistsQualityChannel(string quality, string? expectedChannel) 213public async Task WriteInstallSidecar_WithoutFileMoveOverwrite_CreatesOrReplacesSidecar(bool sidecarExists) 244public async Task ExplicitVersionInstall_WritesSourceOnlySidecar() 287public async Task DefaultInstallPath_MentionsAspireDirectory() 298public async Task DryRunWithVersion_ShowsVersionInOutput() 309public async Task VersionAndQualityTogether_ReturnsError() 325public async Task InstallExtensionWithNonDevQuality_ReturnsError(string quality) 336public async Task WhatIfWithExtension_PlansExtensionBeforeBundleSetup() 354public async Task WhatIf_DoesNotCreateGlobalAspireConfigJson(string quality) 373public async Task Install_DryRun_DoesNotWriteGlobalChannelField() 399public async Task WhatIf_DoesNotWriteScriptRouteSidecar_AndAnnouncesPath() 417public async Task WhatIf_DevQuality_DoesNotWriteScriptRouteSidecar()
Scripts\ReleaseScriptPSFunctionTests.cs (22)
26public async Task ConvertToChannelName_KnownQualities_ReturnsMappedChannel(string quality, string expectedChannel) 42public async Task ConvertToChannelName_UnknownQuality_ReturnsAsIs() 67public async Task GetAspireCliUrl_NoVersion_ReturnsAkaMsUrl( 86public async Task GetAspireCliUrl_NoVersionChecksum_ReturnsChecksumUrl( 105public async Task GetAspireCliUrl_WithStableVersion_ReturnsGitHubReleaseUrl( 124public async Task GetAspireCliUrl_WithStableVersionChecksum_ReturnsGitHubReleaseChecksumUrl( 144public async Task GetAspireCliUrl_WithPrereleaseVersion_ReturnsCiDotNetUrl(string version) 163public async Task GetAspireCliUrl_WithPrereleaseVersionChecksum_ReturnsCiDotNetChecksumUrl(string version) 179public async Task GetAspireCliUrl_UnsupportedQualityNoVersion_ReturnsError() 202public async Task GetDownloadDescriptor_WithSource_ReturnsFriendlyChannelSource(string url, string source, string expectedDescriptor) 226public async Task TestFileChecksum_MatchingChecksum_Succeeds() 244public async Task TestFileChecksum_MismatchedChecksum_Fails() 267public async Task ExpandAspireCliArchive_TarGz_ExtractsToDestination() 288public async Task ExpandAspireCliArchive_Zip_ExtractsToDestination() 313public async Task GetOperatingSystem_ReturnsKnownPlatform() 336public async Task GetMachineArchitecture_ReturnsKnownArch() 369public async Task GetCLIArchitectureFromArchitecture_NormalizesArchNames(string input, string expected) 385public async Task GetCLIArchitectureFromArchitecture_UnsupportedArch_Fails() 405public async Task InvokeAspireCliBundleSetup_InvokesSetupAndPropagatesFailure() 443public async Task InvokeAspireCliBundleSetup_UnsupportedHostArchitecture_SkipsSetup() 474public async Task GetAspireExtensionUrl_NoVersion_ReturnsAkaMsUrl(string quality, string expectedUrl) 490public async Task GetAspireExtensionUrl_WithVersion_ReturnsCiDotNetUrl()
Scripts\ReleaseScriptShellTests.cs (20)
22public async Task HelpFlag_ShowsUsage() 34public async Task ShortHelpFlag_ShowsUsage() 45public async Task InvalidQuality_ReturnsError() 56public async Task DryRun_ShowsDownloadAndInstallSteps() 75public async Task DryRunWithCustomPath_ShowsCustomInstallPath() 92public async Task VerboseFlag_ShowsDetailedOutput(string flag) 107public async Task KeepArchiveFlag_IsAccepted(string flag) 120public async Task QualityVariants_AreRecognized(string quality, string expectedSource) 139public async Task WriteInstallSidecar_PersistsQualityChannel(string quality, string? expectedChannel) 166public async Task WriteInstallSidecar_UsesPortableMktempTemplate() 186public async Task ExplicitVersionInstall_WritesSourceOnlySidecar() 223public async Task OsOverride_IsRecognized() 234public async Task ArchOverride_IsRecognized() 245public async Task SkipPathFlag_IsRecognized() 259public async Task InstallExtensionWithNonDevQuality_ReturnsError(string quality) 270public async Task DryRunWithExtension_PlansExtensionBeforeBundleSetup() 288public async Task DryRun_DoesNotCreateGlobalAspireConfigJson(string quality) 307public async Task Install_DryRun_DoesNotWriteGlobalChannelField() 333public async Task DryRun_DoesNotWriteScriptRouteSidecar_AndAnnouncesPath() 353public async Task DryRun_DevQuality_DoesNotWriteScriptRouteSidecar()
Scripts\SourceabilityTests.cs (2)
18public async Task ReleaseScript_CanBeSourced_WithoutExecutingMain() 35public async Task PRScript_CanBeSourced_WithoutExecutingMain()
Scripts\VerifyCliArchivePowerShellTests.cs (3)
22public async Task VerifyCliArchive_AcceptsCleanPerRidArchive() 41public async Task VerifyCliArchive_RejectsArchiveWithStraySidecar() 61public async Task VerifyCliArchive_RejectsStraySidecarWhenBinaryIsNestedUnderSubdirectory()
tests\Shared\TemplatesTesting\ToolCommand.cs (4)
163var waitForExitTask = CurrentProcess.WaitForExitAsync(token); 164var completedTask = await Task.WhenAny(waitForExitTask, Task.Delay(TimeSpan.FromSeconds(5), token)).ConfigureAwait(false);
Aspire.Azure.AI.OpenAI.Tests (4)
AspireAzureOpenAIClientBuilderChatClientExtensionsTests.cs (2)
196public async Task CanConfigurePipelineAsync(bool useKeyed) 221=> Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "Hello from middleware")));
AspireAzureOpenAIClientBuilderEmbeddingGeneratorExtensionsTests.cs (2)
196public async Task CanConfigurePipelineAsync(bool useKeyed) 224return Task.FromResult(new GeneratedEmbeddings<Embedding<float>>(inputs.Select(i => new Embedding<float>(floats))));
Aspire.Azure.Messaging.EventHubs.Tests (2)
tests\Aspire.Azure.Security.KeyVault.Tests\MockTransport.cs (2)
49private Task ProcessCore(HttpMessage message) 67return Task.CompletedTask;
Aspire.Azure.Messaging.WebPubSub.Tests (1)
AspireWebPubSubExtensionsTests.cs (1)
270public async Task AddAzureWebPubSubServiceClient_HealthCheckReportsConnectionFailureDescription(bool useKeyed)
Aspire.Azure.Search.Documents.Tests (1)
AspireAzureSearchExtensionsTests.cs (1)
110public async Task AddAzureSearchClient_HealthCheckReportsConnectionFailureDescription(bool useKeyed)
Aspire.Azure.Security.KeyVault.Tests (2)
MockTransport.cs (2)
49private Task ProcessCore(HttpMessage message) 67return Task.CompletedTask;
Aspire.Cli.EndToEnd.Tests (264)
AgentCommandTests.cs (5)
25public async Task AgentCommands_AllHelpOutputs_AreCorrect() 81public async Task AgentInitCommand_MigratesDeprecatedConfig() 138public async Task DoctorCommand_DetectsDeprecatedAgentConfig() 172public async Task AgentInitCommand_DefaultSelection_InstallsDefaultSkills() 232public async Task AgentInit_NonInteractive_BundleOnlySkillsNotInCatalog()
AgentMcpExcludeFromMcpTests.cs (1)
18public async Task AgentMcpListResources_ExcludesResourceMarkedWithExcludeFromMcp()
AgentMcpLogsTests.cs (4)
18public Task AgentMcpListStructuredLogsReturnsLogsFromStarterApp() 23public Task AgentMcpListStructuredLogsReturnsLogsFromStarterApp_Isolated() 28public Task AgentMcpListStructuredLogsReturnsLogsFromStarterApp_DevLocalhost() 31private async Task AgentMcpListStructuredLogsFromStarterAppCore(bool isolated, bool useDevLocalhost)
AppHostSyntaxErrorOutputTests.cs (7)
20public Task RunReportsSyntaxErrorsForDotNetAppHost() 34public Task RunReportsMissingSdkAsBuildFailureForDotNetAppHost() 48public Task StartReportsSyntaxErrorsForDotNetAppHost() 62public Task RunReportsSyntaxErrorsForTypeScriptAppHost() 76public Task StartReportsSyntaxErrorsForTypeScriptAppHost() 88private async Task RunSyntaxErrorScenarioAsync( 131private static async Task AssertAspireCommandOutputAsync(
BannerTests.cs (3)
18public async Task Banner_DisplayedOnFirstRun() 54public async Task Banner_DisplayedWithExplicitFlag() 81public async Task Banner_NotDisplayedWithNoLogoFlag()
BundleSmokeTests.cs (4)
21public async Task CreateAndRunAspireStarterProjectWithBundle() 45public async Task DotNetRunProjectAppHostUsesAspireCliBundle() 108public async Task DotNetRunProjectAppHostRestoresAndUsesAspireCliThroughDnx() 203public async Task DotNetRunFileBasedAppHostUsesAspireCliBundle()
CentralPackageManagementTests.cs (3)
20public async Task AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps() 113public async Task AspireUpdateRemovesOrphanAppHostPackageVersionWhenSdkAlreadyCurrent() 263public async Task AspireAddPackageVersionToDirectoryPackagesProps()
CertificatesCommandTests.cs (3)
17public async Task CertificatesTrust_WithUntrustedCert_TrustsCertificate() 56public async Task CertificatesClean_RemovesCertificates() 94public async Task CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate()
ChannelUpdateWorkflowTests.cs (7)
43public async Task UpdateToStable_TypeScript_PreviewsStablePkgsAndKeepsChannel() 229public async Task UpdateToStable_CSharpSingleFileInit_KeepsConfigChannel() 272public async Task UpdateToStable_CSharpEmptyAppHost_KeepsConfigChannel() 312public async Task UpdateToStable_TypeScriptSingleFileInit_KeepsConfigChannel() 383private static async Task RunStableChannelUpdateAndAssertChannelPreservedAsync( 409private static async Task PreviewStableUpdateAndDeclineAsync( 431async Task WaitForStableUpdatePreviewAsync(bool allowCliUpdatePrompt)
CliTelemetryTests.cs (1)
21public async Task OtlpExportedSpansContainEnrichmentTags()
ConfigDiscoveryTests.cs (2)
31public async Task RunWithExplicitAlternateAppHost_PreservesExistingDefault() 135public async Task RunFromParentDirectory_UsesExistingConfigNearAppHost()
ConfigHealingTests.cs (1)
24public async Task InvalidAppHostPathWithComments_IsHealedOnRun()
ConfigMigrationTests.cs (7)
109public async Task GlobalSettings_MigratedFromLegacyFormat() 171public async Task GlobalMigration_SkipsWhenNewConfigExists() 216public async Task GlobalMigration_HandlesMalformedLegacyJson() 272public async Task GlobalMigration_HandlesCommentsAndTrailingCommas() 342public async Task ConfigSetGet_CreatesNestedJsonFormat() 422public async Task GlobalMigration_PreservesAllValueTypes() 507public async Task FullUpgrade_LegacyCliToNewCli_MigratesGlobalSettings()
CSharpInitTests.cs (1)
25public async Task InteractiveCSharpInitCreatesExpectedFiles()
CSharpProjectModeInitTests.cs (2)
58public async Task AspireInit_SolutionFile_BuildsAgainstChannelHive(string solutionFileName) 129public async Task AspireInit_ExistingAppHostDir_RecreatesNuGetConfigKeepsFiles()
DashboardRunTests.cs (6)
18public async Task DashboardRunWithOtelTracesReturnsNoTraces() 25public async Task DashboardRunWithOtelTracesReturnsNoTraces_DevLocalhost() 30private async Task DashboardRunWithOtelTracesReturnsNoTracesCore(string frontendUrl, string localhostUrl) 101public Task DashboardRunWithAgentMcpListTracesReturnsNoTraces() 106public Task DashboardRunWithAgentMcpListTracesReturnsNoTraces_DevLocalhost() 109private async Task DashboardRunWithAgentMcpCore(string frontendUrl, string localhostUrl, string toolName, string expectedMarker)
DescribeCommandTests.cs (2)
18public async Task DescribeCommandShowsRunningResources() 81public async Task DescribeCommandResolvesReplicaNames()
DockerDeploymentTests.cs (2)
23public async Task CreateAndDeployToDockerCompose() 123public async Task CreateAndDeployToDockerComposeInteractive()
DocsCommandE2ETests.cs (1)
14public async Task DocsCommand_RendersInteractiveMarkdownFromLocalSource()
DoctorCommandTests.cs (4)
29public async Task DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted() 63public async Task DoctorCommand_WithSslCertDir_ShowsTrustedAndDcpConnectionHealthy() 106public async Task DoctorCommand_WithDebugLogging_DoesNotRenderSpinner() 162public async Task DoctorCommand_TypeScriptAppHostReportsMissingConfiguredToolchain(string toolchain)
DotnetToolSmokeTests.cs (1)
28public async Task CreateAndRunAspireStarterProject()
EmptyAppHostTemplateTests.cs (2)
18public async Task CreateAndRunEmptyAppHostProject() 46public async Task CreateDotNetTemplateWithSourceOverrideDoesNotContactOtherSources()
EmulatedLocalReleaseBuildTests.cs (6)
64public async Task EmulatedLocalReleaseScaffoldsCSharpStarterFromLocalPackages() 132public async Task EmulatedLocalReleaseScaffoldsTypeScriptStarterFromLocalPackages() 210private static async Task InstallLocalHiveWithoutLocalChannelAsync(Hex1bTerminalAutomator auto, SequenceCounter counter) 224private static async Task ApplyEmulatedLocalReleaseIdentityAsync(Hex1bTerminalAutomator auto, SequenceCounter counter, string localStableVersion) 255private static async Task RegisterLocalHiveAsAmbientNuGetSourceAsync(Hex1bTerminalAutomator auto, SequenceCounter counter) 270private static async Task AddIntegrationInteractivelyAsync(Hex1bTerminalAutomator auto, SequenceCounter counter, string filter)
EmulatedReleasedBuildTests.cs (4)
46public async Task EmulatedStableIdentityScaffoldsCSharpStarterWithoutNuGetConfig() 104public async Task EmulatedStableIdentityScaffoldsTypeScriptStarterWithoutNuGetConfig() 156private static async Task ApplyEmulatedStableIdentityAsync(Hex1bTerminalAutomator auto, SequenceCounter counter, string stableVersion) 183private static async Task AddIntegrationInteractivelyAsync(Hex1bTerminalAutomator auto, SequenceCounter counter, string filter)
EmulatedStagingBuildTests.cs (4)
56public async Task EmulatedStagingIdentityScaffoldsCSharpStarterWithDarcFeedNuGetConfig() 117public async Task EmulatedStagingIdentityScaffoldsTypeScriptStarterWithoutNuGetConfig() 187private static async Task ApplyEmulatedStagingIdentityAsync(Hex1bTerminalAutomator auto, SequenceCounter counter, StagingBuildIdentity staging) 215private static async Task AddIntegrationInteractivelyAsync(Hex1bTerminalAutomator auto, SequenceCounter counter, string filter)
EntityFrameworkCoreDeploymentTests.cs (4)
20public async Task DeployMigrationBundleToDockerCompose() 84private static async Task ScaffoldApplicationAsync( 272private static async Task VerifyComposeArtifactsAsync( 291private static async Task VerifyDeploymentAsync(
Helpers\CliE2EAutomatorHelpers.cs (29)
57internal static async Task PrepareDockerEnvironmentAsync( 109internal static Task WaitUntilAppHostStoppedSuccessfullyAsync(this Hex1bTerminalAutomator auto, TimeSpan timeout) 118internal static async Task InstallAspireCliAsync( 193internal static async Task AspireNewCSharpEmptyAppHostAsync( 223internal static async Task AspireNewTypeScriptEmptyAppHostAsync( 270private static async Task WaitForAspireNewEmptyAppHostCompletionAsync( 342private static async Task SelectAppHostLanguageAsync( 369internal static async Task WaitForAspireAddSuccessAsync( 407internal static async Task InstallAspireCliInShellAsync( 469internal static async Task VerifyAspireCliVersionAsync( 566internal static async Task PrepareEnvironmentAsync( 592internal static async Task InstallAspireCliFromPullRequestAsync( 604internal static async Task SourceAspireCliEnvironmentAsync( 616internal static async Task VerifyAspireCliVersionAsync( 641internal static async Task VerifyPullRequestCliVersionAsync( 668internal static async Task SourceAspireBundleEnvironmentAsync( 679internal static async Task SourceDotnetToolEnvironmentAsync( 692internal static async Task ClearScreenAsync( 703internal static Task EnablePolyglotSupportAsync( 709return Task.CompletedTask; 715internal static async Task EnableExperimentalJavaSupportAsync( 727internal static async Task InstallAspireCliVersionAsync( 754internal static async Task AspireStartAsync( 942internal static async Task AspireStopAsync( 959internal static async Task AssertResourcesExistAsync( 1008internal static async Task CaptureAspireDiagnosticsAsync( 1031internal static async Task AspireDestroyAsync( 1043private static async Task CaptureRegisteredWorkspaceDiagnosticsAsync( 1106internal static async Task CallAgentMcpToolAsync(
Helpers\KubernetesDeployTestHelpers.cs (9)
29internal static async Task InstallKindAndHelmAsync( 66internal static async Task CreateKindClusterWithRegistryAsync( 148internal static async Task InstallRadCliAsync( 196internal static async Task InstallRadiusControlPlaneAsync( 225internal static async Task ScaffoldK8sDeployProjectAsync( 355internal static async Task AspireDeployInteractiveAsync( 386internal static async Task VerifyDeploymentAsync( 446internal static async Task CleanupKubernetesDeploymentAsync( 463internal static async Task CleanupKindClusterOutOfBandAsync(string clusterName, ITestOutputHelper output)
Helpers\TerminalRun.cs (2)
16private readonly Task _pendingRun; 22internal TerminalRun(Task pendingRun, Hex1bTerminalAutomator automator, SequenceCounter counter, TemporaryWorkspace workspace, ITestOutputHelper output)
IsolatedInstancesOtelLogsTests.cs (1)
18public async Task TwoIsolatedInstancesProduceDifferentOtelLogs()
JavaCodegenValidationTests.cs (1)
17public async Task RestoreGeneratesSdkFiles()
JavaEmptyAppHostTemplateTests.cs (1)
19public async Task CreateAndRunJavaEmptyAppHostProject()
JavaPolyglotApphostDirectoryTests.cs (1)
27public async Task StopJavaPolyglotAppHostUsingApphostDirectory()
JavaPolyglotTests.cs (1)
17public async Task CreateJavaAppHostWithViteApp()
JavaScriptPublishTests.cs (2)
23public async Task AllPublishMethodsBuildDockerImages() 91public async Task JavaScriptHostingApisRunFromTypeScriptAppHost()
JsReactTemplateTests.cs (1)
19public async Task CreateAndRunJsReactProject()
KubernetesDeployBasicApiServiceTests.cs (1)
19public async Task DeployK8sBasicApiService()
KubernetesDeployTypeScriptTests.cs (1)
20public async Task DeployTypeScriptAppToKubernetes()
KubernetesDeployTypeScriptWithPersistentVolumeTests.cs (1)
31public async Task DeployTypeScriptK8sWithPersistentVolumeSurvivesPodRestart()
KubernetesDeployWithGarnetTests.cs (1)
19public async Task DeployK8sWithGarnet()
KubernetesDeployWithHelmChartTests.cs (1)
21public async Task DeployK8sWithExternalHelmChart()
KubernetesDeployWithMongoDBTests.cs (1)
19public async Task DeployK8sWithMongoDB()
KubernetesDeployWithMySqlTests.cs (1)
19public async Task DeployK8sWithMySql()
KubernetesDeployWithNatsTests.cs (1)
21public async Task DeployK8sWithNats()
KubernetesDeployWithPersistentVolumeTests.cs (4)
25public async Task DeployK8sWithPostgresPersistentVolumeSurvivesPodRestart() 233private static async Task PortForwardServerAsync( 252private static async Task CurlVerifyAsync( 278private static async Task KillBackgroundJobAsync(
KubernetesDeployWithPostgresTests.cs (1)
19public async Task DeployK8sWithPostgres()
KubernetesDeployWithProjectPersistentVolumeTests.cs (4)
26public async Task DeployK8sWithProjectPersistentVolumeSurvivesPodRestart() 206private static async Task PortForwardServerAsync( 221private static async Task CurlVerifyAsync( 238private static async Task KillBackgroundJobAsync(
KubernetesDeployWithRabbitMQTests.cs (1)
19public async Task DeployK8sWithRabbitMQ()
KubernetesDeployWithRedisTests.cs (1)
19public async Task DeployK8sWithRedis()
KubernetesDeployWithSqlServerTests.cs (1)
19public async Task DeployK8sWithSqlServer()
KubernetesDeployWithValkeyTests.cs (1)
19public async Task DeployK8sWithValkey()
KubernetesPublishRequiresExternalEndpointTests.cs (3)
26public async Task IngressWithoutExternalEndpoint_FailsPublishWithGuidance() 41public async Task GatewayWithoutExternalEndpoint_FailsPublishWithGuidance() 51private async Task RunPublishFailureScenarioAsync(string appHostBodyExtension)
KubernetesPublishTests.cs (2)
31public async Task CreateAndPublishToKubernetes() 317public async Task RenderEmbeddedEnvironmentExpressionsWithHelm()
LaunchProfileTests.cs (1)
19public async Task RunStartsAppHostWithSelectedLaunchProfile()
ListStepsTests.cs (1)
17public async Task DoPublishAndDeployListStepsWork()
LocalConfigMigrationTests.cs (4)
38public async Task LegacySettingsMigration_AdjustsRelativeAppHostPath() 93await Task.Delay(TimeSpan.FromSeconds(1), TestContext.Current.CancellationToken); 111public async Task AspireStartUpdatesStaleTypeScriptAppHostPath() 153await Task.Delay(TimeSpan.FromSeconds(1), TestContext.Current.CancellationToken);
LogLevelTests.cs (1)
19public async Task LogLevelTrace_ProducesTraceEntriesInCliLogFile()
LogsCommandTests.cs (1)
18public async Task LogsCommandShowsResourceLogs()
McpDocsE2ETests.cs (11)
59public async Task ListTools_IncludesDocsTools() 72public async Task ListDocs_ReturnsDocumentation() 88public async Task SearchDocs_FindsRelevantContent() 109public async Task SearchDocs_RespectsTopKParameter() 128public async Task SearchDocs_SlugCanBeUsedWithGetDoc() 165public async Task SearchDocs_WithEmptyQuery_ReturnsError() 180public async Task GetDoc_RetrievesDocumentContent() 214public async Task GetDoc_WithInvalidSlug_ReturnsError() 230public async Task GetDoc_WithSection_ReturnsSpecificSection() 265public async Task ListTools_ToolSchemas_AreValid() 287public async Task SearchDocs_ToolDescription_IsInformative()
MultipleAppHostTests.cs (2)
17public async Task DetachFormatJsonProducesValidJson() 74public async Task DetachFormatJsonProducesValidJsonWhenRestartingExistingInstance()
NewChannelNuGetConfigTests.cs (1)
31public async Task AspireNew_CreatesNuGetConfig_BasedOnChannel(string? channel, bool expectNuGetConfig)
NewWithAgentInitTests.cs (1)
32public async Task AspireNew_WithAgentInit_InstallsPlaywrightWithoutErrors()
OllamaIntegrationTests.cs (1)
23public async Task AddOllamaAndStart()
OtelLogsTests.cs (3)
19public Task OtelLogsReturnsStructuredLogsFromStarterApp() 24public Task OtelLogsReturnsStructuredLogsFromStarterAppIsolated() 27private async Task OtelLogsReturnsStructuredLogsFromStarterAppCore(bool isolated, [CallerMemberName] string testName = "")
PersistentContainerEndToEndTests.cs (2)
18public async Task PersistentContainersPreserveDataAcrossAppHostRuns() 157private static async Task VerifyEndpointAsync(Hex1bTerminalAutomator auto, SequenceCounter counter, string path, string marker)
PlaywrightCliInstallTests.cs (2)
27public async Task AgentInit_InstallsPlaywrightCli_AndGeneratesSkillFiles() 86public async Task AgentInit_CwdDiffersFromRoot_PlacesSkillsInWorkspaceRoot()
PodmanDeploymentTests.cs (1)
22public async Task CreateAndDeployToDockerComposeWithPodman()
ProjectReferenceTests.cs (1)
22public async Task TypeScriptAppHostWithProjectReferenceIntegration()
PsCommandTests.cs (2)
18public async Task PsCommandListsRunningAppHost() 80public async Task PsFormatJsonOutputsOnlyJsonToStdout()
PythonReactTemplateTests.cs (1)
18public async Task CreateAndRunPythonReactProject()
RadiusDeployTests.cs (1)
51public async Task DeployRadiusContainerToKind()
RadiusPublishTests.cs (1)
30public async Task PublishWithRadiusEnvironment_EmitsExpectedArtifacts()
ResourceCommandTests.cs (4)
19public async Task ResourceCommand_SetAndDeleteParameterUpdatesDescribeOutput() 112public async Task ResourceCommand_FailsWhenInteractionServiceIsRequired() 212public async Task ResourceCommand_FailedExec_ShowsLogPathAndLogHasEntries() 320public async Task ResourceCommand_JsonResult_WritesOnlyJsonToStdoutAndStatusToStderr()
SecretDotNetAppHostTests.cs (1)
16public async Task SecretCrudOnDotNetAppHost()
SecretTypeScriptAppHostTests.cs (1)
16public async Task SecretCrudOnTypeScriptAppHost()
SelfUpdateChannelPersistenceTests.cs (1)
15public async Task SelfUpdateToStaging_RelaunchedCliUsesStagingForImplicitProjectUpdate()
SingleFileAppHostInitDotnetRunTests.cs (1)
35public async Task AspireInitSingleFileAppHostRunsViaDotnetRunAppHost()
SmokeTests.cs (4)
21public async Task CreateAndRunAspireStarterProject() 69public async Task CreateAndRunPolyglotAppHostWithDevLocalhostUrls() 111public async Task LatestCliCanStartStableChannelAppHost() 147public async Task LatestCliCanStartStableChannelTypeScriptAppHost()
StagingChannelTests.cs (1)
18public async Task StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels()
StartStopTests.cs (7)
23public async Task CreateStartAndStopAspireProject() 70public async Task StopWithNoRunningAppHostExitsSuccessfully() 97public async Task LinkedWorktreeExplicitIsolationAndPrimaryStopLeavesItRunning() 220public async Task StartLaunchesDetachedCliAndAppHostOutsideLauncherProcessGroupAndSession() 310public async Task AddPackageWhileAppHostRunningDetached() 359public async Task AddPackageInteractiveWhileAppHostRunningDetached() 422private static async Task CleanupLinkedWorktreeAppHostsAsync(
StopForceTests.cs (1)
17public async Task StopForceCleansUpPersistentContainer()
StopNonInteractiveTests.cs (4)
20public async Task StopNonInteractiveSingleAppHost() 76public async Task StopAllAppHostsFromAppHostDirectory() 136public async Task StopAllAppHostsFromUnrelatedDirectory() 201public async Task StopNonInteractiveMultipleAppHostsShowsError()
TerminalCommandTests.cs (1)
18public async Task TerminalAttachFrontend_ShowsViteHelpAndDetaches()
tests\Shared\Hex1bAutomatorTestHelpers.cs (14)
21internal static async Task WaitForAnyPromptAsync( 48internal static async Task ExecuteCommandUntilOutputAsync( 222internal static async Task WaitForSuccessPromptAsync( 266internal static async Task RunCommandAsync( 280internal static async Task PrepareBashEnvironmentAsync( 309internal static async Task ExtractLocalHiveArchiveAsync( 323internal static async Task ConfigureLocalHiveAsync( 336internal static async Task SourceAspireEnvironmentAsync( 350internal static async Task LogAspireCliVersionAsync( 363internal static async Task WaitForAspireAddCompletionAsync( 414internal static async Task DeclineAgentInitPromptAsync( 476internal static async Task AspireNewAsync( 643internal static async Task AspireInitAsync( 726internal static async Task WaitForPipelineSuccessAsync(
tests\Shared\TemporaryWorkspace.cs (1)
27public async Task InitializeGitAsync(CancellationToken cancellationToken = default)
TypeScriptBlazorGatewayTests.cs (1)
17public async Task DotnetProjectBlazorGatewayRunsFromTypeScriptAppHost()
TypeScriptCodegenValidationTests.cs (4)
28public async Task RestoreGeneratesSdkFiles_WithConfiguredToolchain(string toolchain) 129public async Task RestoreRefreshesGeneratedSdkAfterAddingIntegration() 254public async Task ProcessCommandCallbackReceivesCliArguments() 336public async Task UnAwaitedChainsCompileWithAutoResolvePromises()
TypeScriptEmptyAppHostTemplateTests.cs (2)
21public async Task CreateAndRunTypeScriptEmptyAppHostProjectWithDevelopmentCertificate() 76public async Task TypeScriptAppHostRunDoesNotDeadlockWhenLazyOptionsInvokeAsyncCallback()
TypeScriptLegacyAppHostTests.cs (1)
29public async Task AspireAddAndStartWorkAgainstLegacyAppHostTs()
TypeScriptMigrateAppHostTests.cs (1)
30public async Task AspireMigrateUpgradesLegacyAppHostTsToMts()
TypeScriptPolyglotApphostDirectoryTests.cs (1)
26public async Task StopTypeScriptPolyglotAppHostUsingApphostDirectory()
TypeScriptPolyglotTests.cs (4)
30public async Task CreateTypeScriptAppHostWithViteApp_UsesConfiguredToolchain(string toolchain) 159public async Task TypeScriptAppHostWithVite_AllowsDifferentGuestPkgManager() 247public async Task GeneratedAspireDevScript_StartsWatchMode_WithConfiguredToolchain(string toolchain) 300public async Task InitTypeScriptAppHost_AugmentsExistingViteRepoInWorkspaceSubdirectory()
TypeScriptPublishTests.cs (4)
21public async Task PublishWithDockerComposeServiceCallbackSucceeds() 101public async Task PublishJavaScriptPatternsGeneratesExpectedDockerComposeArtifacts() 191public async Task PublishWithoutOutputPathUsesAppHostDirectoryDefault() 275public async Task PublishWithConfigureEnvFileUpdatesEnvOutput()
TypeScriptReusablePackageTests.cs (1)
17public async Task RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes()
TypeScriptSqlServerNativeAssetsBundleTests.cs (1)
19public async Task StartAndWaitForTypeScriptSqlServerAppHostWithNativeAssets()
TypeScriptStarterSmokeTests.cs (1)
30public async Task CreateAndRunTypeScriptStarterProject()
TypeScriptStarterTemplateTests.cs (1)
19public async Task CreateAndRunTypeScriptStarterProject()
UpdateChannelNuGetConfigOrderingTests.cs (1)
42public async Task AspireUpdate_AppliesPkgEditsBeforeRestore_OnSourceMapping()
WaitCommandTests.cs (1)
19public async Task CreateStartWaitAndStopAspireProject()
Aspire.Cli.Tests (3921)
Acquisition\InstallationDiscoveryDiscoverAllTests.cs (24)
32public async Task DiscoverAllAsync_PathHit_WithoutSidecar_IsListedAsNotProbed_AndNeverSpawned() 60public async Task DiscoverAllAsync_PathHit_WithUnreadableSidecar_IsListedAsNotProbedWithInvalidSidecarReason() 98public async Task DiscoverAllAsync_PathHit_WithMalformedSidecar_IsListedAsNotProbedWithInvalidSidecarReason() 121public async Task DiscoverAllAsync_TrustedSidecar_IsSpawnedAndDecoratedWithDiscoveredPath() 160public async Task DiscoverAllAsync_PathStatusTracksActiveShadowedAndOffPathInstalls() 215public async Task DiscoverAllAsync_UnknownSidecarSource_WithSuccessfulProbe_ProbesAndSurfacesRawRoute() 246public async Task DiscoverAllAsync_UnknownSidecarSource_WithFailedProbe_ProbesAndSurfacesFailedWithRawRoute() 270public async Task DiscoverAllAsync_PeerProbeFails_RowSurvivesAsFailed_WithRouteIntact() 297public async Task DiscoverAllAsync_UnknownPeerProbeResult_Throws() 319public async Task DiscoverAllAsync_ProbeFailureAndMissingInstallMetadata_SurfaceDistinctStatuses(bool hasInstallMetadata, string expectedStatus) 359public async Task DiscoverAllAsync_PrRoute_DerivesChannelFromDogfoodPathWhenPeerOmits() 393public async Task DiscoverAllAsync_PrRoute_DoesNotOverwritePeerReportedChannel() 425public async Task DiscoverAllAsync_BrewRoute_DerivesPrChannelFromVersionWhenPeerOmits() 464public async Task DiscoverAllAsync_BrewRoute_LeavesChannelNullForStableVersion() 567public async Task DiscoverAllAsync_LogsInstallMetadataRejection_AtDebugLevel() 600public async Task DiscoverAllAsync_LogsDogfoodDirectoryWithoutBinary_AtDebugLevel() 628public async Task DiscoverAllAsync_UnreadableDogfoodRoot_DoesNotFailDiscovery() 671public async Task DiscoverAllAsync_UnreadableDotnetToolStore_DoesNotFailDiscovery() 721public async Task DiscoverAllAsync_RunningCliIsAlwaysFirst() 738public async Task DiscoverAllAsync_RunningCliUsesIdentityChannel() 750public async Task DiscoverAllAsync_HonorsExecutionContextHomeDirectory_WithoutEnvOverride() 787public async Task DiscoverAllAsync_UsesAspireHomeDirectoryForPortableInstallPrefixes() 835public async Task DiscoverAllAsync_OnMacOS_DedupsSelfAgainstPathHit_AcrossFirmlinkBoundary() 912public async Task DiscoverAllAsync_UsesPreResolvedCanonicalHint_WithoutReResolving()
Acquisition\PeerInstallProbeTests.cs (21)
64public async Task ProbeAsync_BinaryNotFound_ReturnsFailed() 76public async Task ProbeAsync_InvokesPeerWithDoctorSelfFormatJson() 98public async Task ProbeAsync_PeerEmitsValidJsonArray_ReturnsOk() 131public async Task ProbeAsync_PeerOmitsPathStatus_DefaultsToNotOnPath() 154public async Task ProbeAsync_PeerEmitsInvalidPathStatus_DefaultsToNotOnPath() 178public async Task ProbeAsync_PeerExitsNonZero_ReturnsFailedWhenVersionAlsoFails() 191public async Task ProbeAsync_PeerExitsNonZero_IncludesCapturedStderr() 202public async Task ProbeAsync_PeerFailureStderr_StripsAnsiEscapes() 214public async Task ProbeAsync_PeerFailureStderr_StripsControlCharactersExceptNewline() 227public async Task ProbeAsync_PeerFailureStderr_ReportsTruncationWhenByteCapIsExceeded() 237public async Task ProbeAsync_PeerExitsNonZero_WithEmptyStderr_KeepsReasonUnchanged() 247public async Task ProbeAsync_PeerExitsNonZero_FallsBackToVersionAndReturnsPartialOk() 270public async Task ProbeAsync_BothInfoAndVersionFail_ReturnsFailed() 290public async Task ProbeAsync_PeerEmitsEmptyArray_FallsBackToVersion() 309public async Task ProbeAsync_PeerEmitsInvalidJson_FallsBackToVersion() 333public async Task ProbeAsync_PeerEmitsArrayWithNonObjectFirstElement_FallsBackToVersion(string doctorStdout, string kind) 357public async Task ProbeAsync_PeerHangs_TimesOutAndReturnsFailed() 386public async Task ProbeAsync_CallerCancels_KillsSpawnedProcess() 440await Task.Delay(20, cancellationToken); 444private static async Task WaitForExitAsync(Process process, CancellationToken cancellationToken) 449await Task.Delay(20, cancellationToken);
Acquisition\WingetRegistryProbeTests.cs (4)
63public async Task Run_ConcurrentInvocations_ProduceSingleValidSidecar() 69var tasks = new Task[16]; 72tasks[i] = Task.Run(() => 85await Task.WhenAll(tasks);
Agents\AgentEnvironmentApplicatorTests.cs (6)
12public async Task ApplyAsync_InvokesCallback() 20return Task.CompletedTask; 29public async Task ApplyAsync_PassesCancellationToken() 38return Task.CompletedTask; 51_ => Task.CompletedTask); 63_ => Task.CompletedTask,
Agents\AgentEnvironmentDetectorTests.cs (10)
12public async Task DetectAsync_WithNoScanners_ReturnsEmptyArray() 28public async Task DetectAsync_WithScanner_RunsScannerWithCorrectContext() 47public async Task DetectAsync_WithScannerThatAddsApplicator_ReturnsApplicator() 54_ => Task.CompletedTask) 70public async Task DetectAsync_WithMultipleScanners_RunsAllScanners() 77_ => Task.CompletedTask) 83_ => Task.CompletedTask) 100public async Task DetectAsync_WithConfigurePlaywrightTrue_PassesContextToScanner() 122public Task ScanAsync(AgentEnvironmentScanContext context, CancellationToken cancellationToken) 132return Task.CompletedTask;
Agents\AspireSkillsBundleTests.cs (28)
30public async Task LoadAsync_ValidatesManifestAndReturnsInstallableFiles() 57public async Task LoadAsync_RetainsInstallableFilesAfterSourceDirectoryIsDeleted() 89public async Task GetSkillDefinitions_ReturnsManifestSkills() 118public async Task LoadAsync_ThrowsWhenHashDoesNotMatch() 140public async Task LoadAsync_ValidatesLegacySha256PerFileHashes() 184public async Task LoadAsync_ThrowsWhenNoPerFileHashSpecified() 226public async Task LoadAsync_ThrowsWhenManifestIsMalformed() 247public async Task LoadAsync_ThrowsWhenManifestContainsNullSkill() 272public async Task LoadAsync_ThrowsWhenManifestContainsNullFile() 305public async Task LoadAsync_ThrowsWhenSkillDescriptionExceedsAgentHostLimit() 328public async Task LoadAsync_ThrowsWhenSkillNamesAreDuplicated() 360public async Task LoadAsync_ThrowsWhenSkillFileDoesNotDeclareFrontmatterName() 389public async Task LoadAsync_ThrowsWhenSkillFileFrontmatterNameDoesNotMatchManifest() 419public async Task LoadAsync_ThrowsWhenSkillNameViolatesAgentSkillsSpecification(string skillName) 460public async Task LoadAsync_ThrowsWhenSkillDoesNotContainSkillFile() 483public async Task LoadAsync_ThrowsWhenSkillFileIsExcludedFromInstallation() 506public async Task LoadAsync_ThrowsWhenFilePathEscapesSkillRoot() 552public async Task LoadAsync_ThrowsWhenFilePathIsNotPortable(string relativePath) 603public async Task CreateAsync_ThrowsWhenArchiveEntryPathIsNotPortable() 633public async Task GetSkillFilesAsync_TreatsMissingOptionalPathArraysAsEmpty() 679public async Task LoadAsync_ThrowsWhenSupportsAreMissing() 723public async Task LoadAsync_ThrowsWhenCurrentCliVersionIsUnsupported() 746public async Task LoadAsync_TreatsCurrentCliPrereleaseAsReleaseForCompatibilityRange() 769public async Task LoadAsync_SkipCompatibilityCheck_AllowsBundleOutsideSupportsRange() 792public async Task LoadAsync_SkipCompatibilityCheck_StillRejectsOtherInvariants() 830private static async Task CreateBundleAsync( 881private static async Task WriteSkillAsync(string bundleDirectory, string skillName, string content) 905private static Task WriteManifestAsync(string bundleDirectory, SkillBundleManifest manifest)
Agents\AspireSkillsInstallerTests.cs (49)
30public async Task InstallAsync_WhenValidBundleIsCached_UsesCacheWithoutNetwork() 78public async Task InstallAsync_WhenRequiredCacheLockExceedsCleanupRetryBudget_WaitsForRelease() 117var completedTask = await Task.WhenAny(cleanupRetryBudgetExceeded.Task, installTask).WaitAsync(TimeSpan.FromSeconds(10)); 134public async Task InstallAsync_WhenGitHubDigestMatchesCachedBundle_UsesCacheWithoutDownloadingAsset() 184public async Task InstallAsync_WhenGitHubDigestMatchesUnverifiedCache_DownloadsAttestsAndReplacesCache() 243public async Task InstallAsync_WhenUnverifiedArchiveContainsAttestationMarker_DoesNotTrustCachedBundle() 298public async Task InstallAsync_WhenGitHubDigestChangesForCachedVersion_DownloadsAndKeepsBothCaches() 364public async Task InstallAsync_WhenEmbeddedArchiveHashChangesForCachedVersion_KeepsBothCaches() 436public async Task InstallAsync_WhenCachedBundleDoesNotHaveArchiveHash_ReplacesLegacyCache() 475public async Task InstallAsync_WhenCachedManifestIsMalformed_ReplacesCache() 510public async Task InstallAsync_WhenCachedBundleLastUsedCannotBeTouched_UsesCacheWithoutNetwork() 543public async Task InstallAsync_WhenStaleCacheLastUsedIsOutOfRange_IgnoresInvalidMarker() 585public async Task InstallAsync_RemovesStaleLegacyCacheForOtherVersion() 630public async Task InstallAsync_RemovesEmptyVersionDirectoryAfterStaleDigestCleanup() 677public async Task InstallAsync_WhenStaleVersionLockIsReleasedDuringBackoff_RechecksLastUsed() 746public async Task InstallAsync_WhenStaleVersionLockExceedsRetryBudget_SkipsLockedVersion() 809public async Task InstallAsync_RemovesOnlyStaleDigestCachesForCurrentVersion() 861public async Task InstallAsync_LeavesVersionLockFileAsStableSynchronizationAnchor() 890public async Task InstallAsync_WhenCacheLockIsContendedAndCancellationWasRequested_ThrowsCancellation() 937public async Task InstallAsync_RemovesOnlyStaleTemporaryCacheDirectories() 977public async Task InstallAsync_WhenStaleTemporaryDirectoryIsActive_DoesNotDeleteIt() 1052public async Task InstallAsync_WhenGitHubReleaseIsUnavailableAndNoCache_ReturnsFailure() 1073public async Task InstallAsync_WhenGitHubReleaseIsUnavailableAndEmbeddedBundleMatches_UsesEmbeddedBundle() 1096public async Task InstallAsync_WhenGitHubResponseEndsEarly_UsesEmbeddedBundle() 1123public async Task InstallAsync_WhenGitHubRequestTimesOut_UsesEmbeddedBundle() 1151public async Task InstallAsync_WhenGitHubRequestIsCanceledByCaller_ThrowsCancellation() 1179public async Task InstallAsync_WhenGitHubIsUnavailable_UsesVerifiedGitHubCache() 1212public async Task InstallAsync_WhenGitHubIsUnavailable_UsesMostRecentCompatibleVerifiedCache() 1261public async Task InstallAsync_WhenGitHubDigestIdentifiesStaleCacheAndAssetIsUnavailable_UsesEmbeddedBundle() 1319public async Task InstallAsync_WhenReleaseDigestCannotIdentifyUnavailableAsset_UsesEmbeddedBundle( 1378public async Task InstallAsync_WhenRemoteFetchFeatureIsDisabled_SkipsGitHubAndUsesEmbedded() 1411public async Task EmbeddedAspireSkillsBundleProvider_CreatesBundle() 1439public async Task EmbeddedAspireSkillsBundleProvider_WhenTemporaryArchiveIsLocked_CanPromoteBundle() 1470public async Task AspireSkillsBundleProvider_WhenValidationFails_RemovesExtractionDirectory() 1500public async Task AspireSkillsBundleProvider_DoesNotUseExistingDestinationFilesToValidateArchive() 1529public async Task EmbeddedAspireSkillsBundleProvider_WhenCancelled_RemovesTemporaryArchive() 1555public async Task InstallAsync_WhenGitHubReleaseDigestIsMissing_DownloadsAndCachesComputedDigests() 1625public async Task InstallAsync_WhenGitHubReleaseDigestDoesNotMatchDownload_UsesEmbeddedBundle() 1673public async Task InstallAsync_WhenDownloadedManifestIsMalformed_DoesNotUseVerifiedOfflineCache() 1728public async Task InstallAsync_WhenGitHubAttestationFails_FallsBackToEmbeddedBundle() 1790public async Task InstallAsync_WhenVersionOverrideDoesNotMatchEmbeddedBundle_DoesNotUseEmbeddedBundle() 1821public async Task InstallAsync_WhenEmbeddedArchiveHashDoesNotMatch_ReturnsFailure() 1856public async Task InstallAsync_WhenEmbeddedBundleSupportsRangeExcludesCurrentCli_StillUsesEmbeddedBundle() 1889public async Task InstallAsync_WhenCachedEmbeddedBundleSupportsRangeExcludesCurrentCli_StillUsesCache() 1925public async Task InstallAsync_WhenCachedGitHubBundleSupportsRangeExcludesCurrentCli_UsesEmbeddedBundle() 2003private static async Task CreateCachedBundleAsync( 2070private static Task WriteLastUsedAsync(string cacheDirectory, DateTimeOffset lastUsed) 2234public Task? VerificationGate { get; init; }
Agents\ClaudeCodeAgentEnvironmentScannerTests.cs (4)
19public async Task ApplyAsync_WithMalformedMcpJson_ThrowsInvalidOperationException() 47public async Task ApplyAsync_WithEmptyMcpJson_ThrowsInvalidOperationException() 72public async Task ApplyAsync_WithMalformedMcpJson_DoesNotOverwriteFile() 133return Task.FromResult(version);
Agents\CommonAgentApplicatorsTests.cs (1)
117public async Task SkillDefinition_StaticInstallableSkillDescriptionsFitAgentHostLimits()
Agents\CopilotCliAgentEnvironmentScannerTests.cs (9)
20public async Task ScanAsync_WhenCopilotCliInstalled_ReturnsApplicator() 36public async Task ApplyAsync_CreatesMcpConfigJsonWithCorrectConfiguration() 94public async Task ApplyAsync_PreservesExistingMcpConfigContent() 134public async Task ScanAsync_WhenAspireAlreadyConfigured_ReturnsPlaywrightCliApplicatorOnly() 166public async Task ScanAsync_WhenInVSCode_ReturnsApplicatorWithoutCallingRunner() 202public async Task ApplyAsync_WithMalformedMcpJson_ThrowsInvalidOperationException() 230public async Task ApplyAsync_WithEmptyMcpJson_ThrowsInvalidOperationException() 255public async Task ApplyAsync_WithMalformedMcpJson_DoesNotOverwriteFile() 293return Task.FromResult(version);
Agents\CopilotCliRunnerTests.cs (1)
12public async Task GetVersionAsync_ChecksForCopilot()
Agents\OpenCodeAgentEnvironmentScannerTests.cs (4)
18public async Task ApplyAsync_WithMalformedOpenCodeJsonc_ThrowsInvalidOperationException() 44public async Task ApplyAsync_WithEmptyOpenCodeJsonc_ThrowsInvalidOperationException() 67public async Task ApplyAsync_WithMalformedOpenCodeJsonc_DoesNotOverwriteFile() 118return Task.FromResult(version);
Agents\PlaywrightCliInstallerTests.cs (25)
26public async Task InstallAsync_WhenNpmResolveReturnsNull_ReturnsErrorMessage() 54public async Task InstallAsync_WhenAlreadyInstalledAtSameVersion_SkipsInstallAndInstallsSkills() 89public async Task InstallAsync_PassesRepositoryRootAsWorkingDirectory() 123public async Task InstallAsync_WhenNewerVersionInstalled_SkipsInstallAndInstallsSkills() 158public async Task InstallAsync_WhenPackFails_ReturnsErrorMessage() 189public async Task InstallAsync_WhenIntegrityCheckPasses_InstallsGlobally() 236public async Task InstallAsync_UsesDownloadedTarballDigestForProvenance() 280public async Task InstallAsync_WhenGlobalInstallFails_ReturnsErrorMessage() 323public async Task InstallAsync_WhenOlderVersionInstalled_PerformsUpgrade() 394public async Task InstallAsync_WorkflowRefValidator_AcceptsBothTagFormats() 432public async Task InstallAsync_WhenProvenanceCheckFails_ReturnsErrorMessage() 465public async Task InstallAsync_WhenValidationDisabled_SkipsAllValidationChecks() 515public async Task InstallAsync_WhenVersionOverrideConfigured_UsesOverrideVersion() 555public async Task InstallAsync_WhenVersionOverrideIsNotStrictSemVer_ReturnsFailed(string invalidVersion) 591public async Task InstallAsync_WhenNoVersionOverride_UsesDefaultRange() 620public async Task InstallAsync_MirrorsSkillFilesToOtherAgentEnvironments() 717public async Task InstallAsync_WhenOnlyStandardSelected_CleansUpUnselectedLocations() 770public async Task InstallAsync_WhenCleaningUp_DoesNotDeletePreExistingDirectories() 818public async Task InstallAsync_WhenCleaningUp_RemovesEmptyParentDirectories() 1016return Task.FromResult(ResolveResult); 1028return Task.FromResult(PackResult); 1034return Task.FromResult(InstallGlobalResult); 1050return Task.FromResult(new ProvenanceVerificationResult 1069=> Task.FromResult(InstalledVersion); 1076return Task.FromResult(InstallSkillsResult);
Agents\SigstoreNpmProvenanceCheckerTests.cs (3)
130public async Task VerifyProvenanceAsync_WithMismatchedSignedSubject_ReturnsMismatch( 144public async Task VerifyProvenanceAsync_WithMatchingSignedSubject_AppliesProvenanceFieldValidation() 1213(_, _, _, _, _) => Task.FromResult((true, (VerificationResult?)verificationResult)));
Agents\TelemetryHookConfiguratorTests.cs (9)
16public async Task ConfigureAsync_WritesCopilotUserHook_WithExpectedShape() 45public async Task ConfigureAsync_HonorsCopilotHomeEnvironmentVariable() 62public async Task ConfigureAsync_WritesClaudeUserHook_WithTimeout() 99public async Task ConfigureAsync_IsIdempotent_ForClaude() 113public async Task ConfigureAsync_PreservesExistingClaudeConfig() 152public async Task ConfigureAsync_SkipsClaude_WhenSettingsAreMalformed() 171public async Task ConfigureAsync_SkipsClaude_WhenHooksShapeIsUnexpected() 188public async Task ConfigureAsync_SkipsClaude_WhenSettingsRootIsNotAnObject() 208public async Task ConfigureAsync_IsNoOp_ForUnsupportedClients()
Agents\TelemetryHookInstallerTests.cs (5)
14public async Task EnsureInstalledAsync_MaterializesBothScriptsUnderAspireHooksDirectory() 30public async Task EnsureInstalledAsync_ShellScriptUsesLfEndingsAndNoBom() 48public async Task EnsureInstalledAsync_IsIdempotent_WhenContentUnchanged() 65public async Task EnsureInstalledAsync_RewritesScript_WhenExistingContentDiffers() 84public async Task EnsureInstalledAsync_SetsExecutableBit_OnNonWindows()
Agents\TelemetryHookScriptTests.cs (24)
30public async Task Bash_SkillInvocation_Copilot_ForwardsSkillName() 47public async Task Bash_McpTool_Claude_ForwardsToolName() 62public async Task Bash_ReferenceFileRead_ForwardsRelativePath() 77public async Task Bash_NonAspireToolOrFile_DoesNotInvokeCli() 89public async Task Bash_OptedOut_DoesNotInvokeCli() 102public async Task Bash_UnrecognizedPayload_DoesNotInvokeCli() 114public async Task Bash_SkillMdRead_ForwardsSkillName() 129public async Task Bash_SkillTool_Claude_StripsAspirePrefix() 145public async Task Bash_McpTool_VsCode_DetectsClient() 165public async Task Bash_SkillInvocation_CopilotStringArgs_ForwardsSkillName() 181public async Task Bash_SkillMdRead_CopilotStringArgs_ForwardsSkillName() 198public async Task Bash_ReferenceFileRead_CopilotStringArgs_ForwardsRelativePath() 212public async Task Pwsh_SkillInvocation_Copilot_ForwardsSkillName() 228public async Task Pwsh_McpTool_Claude_ForwardsToolName() 242public async Task Pwsh_NonAspireTool_DoesNotInvokeCli() 253public async Task Pwsh_OptedOut_DoesNotInvokeCli() 265public async Task Pwsh_MalformedJson_DoesNotInvokeCli() 275public async Task Pwsh_ReferenceFileRead_ForwardsRelativePath() 289public async Task Pwsh_SkillMdRead_ForwardsSkillName() 302public async Task Pwsh_SkillTool_Claude_StripsAspirePrefix() 317public async Task Pwsh_McpTool_VsCode_DetectsClient() 335public async Task Pwsh_SkillInvocation_CopilotStringArgs_ForwardsSkillName() 350public async Task Pwsh_SkillMdRead_CopilotStringArgs_ForwardsSkillName() 366public async Task Pwsh_ReferenceFileRead_CopilotStringArgs_ForwardsRelativePath()
Agents\VsCodeAgentEnvironmentScannerTests.cs (14)
20public async Task ScanAsync_WhenVsCodeFolderExists_ReturnsApplicator() 37public async Task ScanAsync_WhenVsCodeFolderExistsInParent_ReturnsApplicatorForParent() 55public async Task ScanAsync_WhenRepositoryRootReachedBeforeVsCode_AndNoCliAvailable_ReturnsNoApplicator() 71public async Task ScanAsync_WhenNoVsCodeFolder_AndVsCodeCliAvailable_ReturnsApplicator() 87public async Task ScanAsync_WhenNoVsCodeFolder_AndNoCliAvailable_ReturnsNoApplicator() 104public async Task ApplyAsync_CreatesVsCodeFolderIfNotExists() 131public async Task ApplyAsync_CreatesMcpJsonWithCorrectConfiguration() 171public async Task ApplyAsync_PreservesExistingMcpJsonContent() 212public async Task ApplyAsync_UpdatesExistingAspireServerConfig() 259public async Task ScanAsync_AddsPlaywrightCliApplicator() 275public async Task ApplyAsync_WithMalformedMcpJson_ThrowsInvalidOperationException() 303public async Task ApplyAsync_WithEmptyMcpJson_ThrowsInvalidOperationException() 328public async Task ApplyAsync_WithMalformedMcpJson_DoesNotOverwriteFile() 361public Task<SemVersion?> GetVersionAsync(VsCodeRunOptions options, CancellationToken cancellationToken) => Task.FromResult(version);
Backchannel\AppHostAuxiliaryBackchannelTests.cs (8)
19public async Task GetResourceSnapshotsAsync_SendsClientCapabilitiesWithV3() 33public async Task WatchResourceSnapshotsAsync_SendsClientCapabilitiesWithV3() 51public async Task GetTerminalInfoAsync_WhenTerminalsCapabilityMissing_ReturnsUnavailableWithoutCallingRpc() 68public async Task ListTerminalsAsync_WhenTerminalsCapabilityMissing_ReturnsEmptyWithoutCallingRpc() 149return Task.FromResult(new AppHostInformation 161return Task.FromResult(new GetCapabilitiesResponse 172return Task.FromResult(new GetResourcesResponse 182await Task.CompletedTask.WaitAsync(cancellationToken).ConfigureAwait(false);
Backchannel\AppHostCliBackchannelTests.cs (2)
17public async Task UploadFileAsync_ExceedsConfiguredLimit_ThrowsWithConfigHint() 52public async Task UploadFileAsync_FileBelowConfiguredLimit_PassesSizeCheck()
Backchannel\AppHostConnectionResolverTests.cs (12)
21public async Task ResolveConnectionAsync_WithExplicitProjectFile_PreservesFastPath() 61public async Task ResolveConnectionAsync_WithExplicitProjectFile_DeletesDeadPidSocketAndReturnsNotRunning() 108public async Task ResolveConnectionAsync_WithExplicitDirectoryAndMultipleAppHosts_ReturnsDirectorySpecificError() 142public async Task ResolveConnectionAsync_WithExplicitDirectoryAndOnlyUnbuildableAppHosts_ReturnsProjectResolutionError() 179public async Task ResolveConnectionAsync_WithExplicitDirectoryAndNoAppHosts_ReturnsDirectorySpecificError() 213public async Task ResolveConnectionAsync_NonInteractiveWithOnlyOutOfScopeAppHosts_ReturnsNotFoundError() 243public async Task ResolveConnectionAsync_NonInteractiveWithMultipleInScopeAppHosts_ReturnsActionableError() 274public async Task ResolveConnectionAsync_WithSymlinkedProjectPath_ResolvesToCanonicalSocketKey() 328public async Task ResolveConnectionAsync_RestrictedToWorktreeWithAppHostOutsideWorkingDirectory_PromptsForSelection() 369public async Task ResolveConnectionAsync_RestrictedToWorktreeWithAppHostInDifferentWorktree_ReturnsWorktreeSpecificError() 407public async Task ResolveConnectionAsync_UnrestrictedWithAppHostInDifferentWorktree_PromptsForSelection() 440public async Task ResolveConnectionAsync_NonInteractiveRestrictedToWorktree_ReturnsNotFoundError()
Backchannel\ExtensionBackchannelTests.cs (15)
16public async Task ConnectAsync_WhenConnectionSetupFails_PropagatesFailureAndAllowsRetry() 26public async Task ConnectAsync_WhenConnectionSetupFails_PropagatesFailureToConcurrentWaitersAndAllowsRetry() 42var firstConnectTask = backchannel.ConnectAsync(CancellationToken.None); 48await Task.Delay(100).DefaultTimeout(); 52var exceptions = await Task.WhenAll( 62public async Task ConnectAsync_WhenExtensionIsIncompatible_PropagatesFailureToConcurrentWaitersWithoutRetrying() 80var firstConnectTask = backchannel.ConnectAsync(CancellationToken.None); 86await Task.Delay(100).DefaultTimeout(); 90var exceptions = await Task.WhenAll( 101public async Task ConnectAsync_WhenConnectorIsCanceled_ConcurrentWaiterTakesOverSetup() 119await Task.Delay(Timeout.InfiniteTimeSpan, cancellationToken); 128var firstConnectTask = backchannel.ConnectAsync(firstConnectorCts.Token); 134await Task.Delay(100).DefaultTimeout(); 142var waiterExceptions = await Task.WhenAll( 152Func<CancellationToken, Task>? connectCoreAsyncOverride = null)
Backchannel\OrphanedAppHostCollectorTests.cs (7)
196public async Task CollectAsync_ScansThenStopsOnlyOrphans() 227public async Task CollectAsync_SuccessfulStop_DeletesSocketAndCounts() 253public async Task CollectAsync_FailedStop_DoesNotDeleteSocketOrCount() 279public async Task CollectAsync_WhenStopThrows_SwallowsAndContinues() 312public async Task CollectAsync_NoOrphans_ReturnsZeroWithoutStopping() 330public async Task CollectAsync_WhenScanThrows_ReturnsZero() 352public async Task CollectAsync_WhenScanCancelled_Throws()
BundleServiceIntegrationTests.cs (12)
30public async Task ExtractAsync_FreshExtraction_CreatesVersionedLayoutAndLinks() 78public async Task ExtractAsync_AlreadyUpToDate_SkipsExtraction() 109public async Task ExtractAsync_Upgrade_FlipsLinksAndCleansUpOldVersion() 167public async Task ExtractAsync_CleansUpStaleVersionDirectories() 200public async Task ExtractAsync_PayloadWithoutDcpExecutableFailsVerification() 217public async Task MoveDirectoryWithRetryAsync_FileTemporarilyLocked_RetriesUntilReleased() 230var moveTask = service.MoveDirectoryWithRetryAsync( 245public async Task EnsureExtractedAndAcquireLayoutAsync_ReturnsVersionRootedLayoutAndSkipsLeasedCleanup() 340public async Task EnsureExtractedAsync_DotnetToolStorePath_ExtractsToRidDirectory() 388public async Task EnsureExtractedAndAcquireLayoutAsync_SidecarlessInstall_ExtractsToAspireHomeAndAcquiresLayout() 481public async Task ExtractPayloadAsync_Static_ExtractsTarGzWithStripComponents() 506public async Task ExtractAsync_ReplacesReparsePointsOnUpgrade()
Caching\AppHostInfoDiskCacheTests.cs (26)
63public async Task CacheMissThenHit() 89public async Task CacheEntryMissingRunCommandIsTreatedAsMiss() 103public async Task CachePayloadContainsOnlyProjectInspectionMetadata() 142public async Task TouchingProjectFileInvalidatesCacheEntry() 151await Task.Delay(50).DefaultTimeout(); 161public async Task TouchingProjectAssetsJsonInvalidatesCacheEntry() 179public async Task TouchingDirectoryPackagesPropsInvalidatesCacheEntry() 196public async Task DisabledCacheNeverReadsOrWrites() 217public async Task ProcessConfigurationValueDoesNotDisableCache() 233public async Task ConcurrentWritesToSameKeyLeaveReadableCacheEntry() 239await Task.WhenAll(Enumerable.Range(0, 20).Select(i => 259public async Task SetAsync_SkipsWriteWhenProjectKeyChangesAfterEvaluation() 266await Task.Delay(50).DefaultTimeout(); 277public async Task EditingCustomWalkUpImportInvalidatesCacheEntry() 316public async Task UnfingerprintableWalkUpImportNeverReadsOrWrites() 340public async Task EditingExactStaticImportInvalidatesCacheEntry() 385public async Task EditingExactStaticImportWithRedundantSeparatorInvalidatesCacheEntry() 418public async Task WildcardStaticConventionalImportNeverReadsOrWrites() 438public async Task UnresolvableStaticImportNeverReadsOrWrites() 467public async Task EditingAppendedWalkUpImportTargetInvalidatesCacheEntry() 505public async Task WildcardWalkUpImportNeverReadsOrWrites() 527public async Task WrappedWalkUpImportNeverReadsOrWrites() 545public async Task ShadowedAncestorWithUnfingerprintableImportStillCaches() 582public async Task EditingAppendedDirectoryNameWalkUpTargetInvalidatesCacheEntry() 621public async Task NestedSuffixWalkUpImportNeverReadsOrWrites() 644public async Task UnresolvableStaticImportInProjectFileStillCaches()
Caching\DiskCacheTests.cs (7)
27public async Task CacheMissThenHit() 42public async Task ExpiredEntryReturnsNull() 55await Task.Delay(TimeSpan.FromSeconds(2)).DefaultTimeout(); 62public async Task NewerEntrySupersedesOlder() 75await Task.Delay(50); 89public async Task ClearRemovesEntries() 103public async Task OldFilesBeyondMaxAgeAreDeletedOnAccess()
Certificates\CertificateProcessRunnerTests.cs (4)
13public async Task Run_DiscardsRedirectedOutputBeforeWaitingForExit() 17var result = await Task.Run(() => CertificateProcessRunner.Run(startInfo)) 26public async Task RunAndCaptureText_CapturesRedirectedOutputBeforeWaitingForExit() 30var result = await Task.Run(() => CertificateProcessRunner.RunAndCaptureText(startInfo))
Certificates\CertificateServiceTests.cs (15)
23public async Task EnsureCertificatesTrustedAsync_WithFullyTrustedCert_StillRunsTrustToUpdateAspireCache() 50public async Task EnsureCertificatesTrustedAsync_WithNoCertificates_RunsTrustOperation() 77public async Task EnsureCertificatesTrustedAsync_WithPartiallyTrustedCert_ReturnsFailureForInteractiveLinux() 104public async Task EnsureCertificatesTrustedAsync_WithPartiallyTrustedCert_ReturnsSuccessForNonInteractiveLinux() 131public async Task EnsureCertificatesTrustedAsync_TrustOperationFails_ReturnsFailure() 152public async Task EnsureCertificatesTrustedAsync_TrustOperationCancelled_ReturnsWasCancelled() 173public async Task EnsureCertificatesTrustedAsync_NonInteractive_ChecksButDoesNotTrustOnNonLinux() 220public async Task CertificatePemExport_IsExplicitAndUsesAspireHomeDirectory() 332public async Task EnsureCertificatesTrustedAsync_NonInteractive_WarnsWhenUntrustedOnNonLinux() 373public async Task EnsureCertificatesTrustedAsync_NonInteractive_WarnsWhenPartiallyTrustedOnNonLinux() 414public async Task EnsureCertificatesTrustedAsync_NonInteractive_ProceedsOnLinux() 458public async Task EnsureCertificatesTrustedAsync_NonInteractive_GeneratesCertWhenNoneExist() 503public async Task EnsureCertificatesTrustedAsync_NonInteractive_SkipsCertGenerationWhenCertsExist() 541public async Task EnsureCertificatesTrustedAsync_NonInteractive_EnvVarOptOutSuppressesCertGeneration() 587public async Task EnsureCertificatesTrustedAsync_NonInteractive_WarnsOnCertGenerationFailure()
Certificates\UnixCertificateManagerTests.cs (4)
18public async Task GetTrustLevel_WhenCanceled_KillsCertUtilProcessTree() 47var trustTask = Task.Run(() => manager.GetTrustLevel(certificate, cancellationTokenSource.Token)); 70public async Task GetTrustLevel_WhenCertUtilFillsOutputPipes_Completes() 95var trustLevel = await Task.Run(() => manager.GetTrustLevel(certificate))
CliBootstrapTests.cs (3)
70public async Task BuildApplication_RegistersIIdentityChannelReader_AsIdentityChannelReaderInstance() 84public async Task BuildApplication_PopulatesCliExecutionContextChannel_FromIdentityChannelReader() 100public async Task BuildApplication_CliExecutionContextChannel_MatchesAssemblyMetadataAttribute()
CliSmokeTests.cs (2)
21public async Task MainReturnsExpectedExitCode(string[] args, int expectedExitCode) 129using var result = RemoteExecutor.Invoke((Func<Task>)(async () =>
Commands\AddCommandTests.cs (157)
24public async Task AddCommandWithHelpArgumentReturnsZero() 38public async Task IntegrationAddCommandWithHelpArgumentReturnsZero() 52public async Task IntegrationSearchCommandWithJsonOptionDoesNotEmitDiscoveryJson() 83public async Task IntegrationSearchCommandRequiresQuery() 114public async Task IntegrationListCommandFormatJsonReturnsAvailableIntegrationsWithoutPromptingOrAddingPackage() 136return Task.FromResult(new AppHostProjectSearchResult(null, [])); 201public async Task IntegrationDiscoveryCommandFormatJsonReturnsEmptyArrayWhenNoIntegrationsAreAvailable(string commandLine) 233public async Task IntegrationDiscoveryCommandReturnsSearchFailureExitCodeWhenPackageDiscoveryFails() 257public async Task IntegrationSearchCommandFormatJsonFiltersAvailableIntegrationsWithoutAddingPackage() 314public async Task IntegrationSearchCommandFormatJsonUsesFuzzyIntegrationMatching() 358public async Task IntegrationSearchCommandFormatJsonWithTypeScriptAppHostPinnedToChannelAlsoSearchesImplicitChannel() 405return Task.FromResult<IEnumerable<NuGetPackage>>([CreatePackage("Aspire.Hosting.Redis", "1.0.0")]); 413return Task.FromResult<IEnumerable<NuGetPackage>>([CreatePackage("Aspire.Hosting.Redis", "2.0.0")]); 422GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 428services.AddSingleton<IAppHostProjectFactory>(new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true))); 449public async Task IntegrationSearchCommandFormatJsonWithTypeScriptAppHostPinnedToStagingChannelAlsoSearchesImplicitChannel() 476return Task.FromResult<IEnumerable<NuGetPackage>>([CreatePackage("Aspire.Hosting.Redis", "1.0.0")]); 484return Task.FromResult<IEnumerable<NuGetPackage>>([CreatePackage("Aspire.Hosting.Redis", "2.0.0")]); 494GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 500services.AddSingleton<IAppHostProjectFactory>(new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true))); 519public async Task IntegrationSearchCommandFormatJsonWithTypeScriptAppHostPinnedToStableChannelStillSurfacesPrereleaseOnlyPackages() 557return Task.FromResult<IEnumerable<NuGetPackage>>( 571return Task.FromResult<IEnumerable<NuGetPackage>>([CreatePackage("Aspire.Hosting.Redis", "1.0.0")]); 581GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 587services.AddSingleton<IAppHostProjectFactory>(new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true))); 616public async Task IntegrationSearchCommandTypeScriptAppHostPersistedChannelExpandsDiscoveryWithoutChangingPreferredResult(string? configFileChannelJson, bool expectExplicitChannelHit) 659return Task.FromResult<IEnumerable<NuGetPackage>>([CreatePackage("Aspire.Hosting.Redis", "1.0.0")]); 667return Task.FromResult<IEnumerable<NuGetPackage>>([CreatePackage("Aspire.Hosting.Redis", "2.0.0")]); 676GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 682services.AddSingleton<IAppHostProjectFactory>(new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true))); 715public async Task IntegrationSearchCommandFormatJsonWithAppHostOutsideLaunchDirectoryUsesConfiguredStagingChannelWithRealPackagingService() 735GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([CreatePackage("Aspire.Hosting.Redis", "2.0.0")]) 744services.AddSingleton<IAppHostProjectFactory>(new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true))); 760public async Task IntegrationSearchCommandFormatJsonWithUnpinnedAppHostUsesImplicitChannelUnderStagingCli() 774GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([CreatePackage("Aspire.Hosting.Redis", "1.0.0")]) 778GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([CreatePackage("Aspire.Hosting.Redis", "2.0.0")]) 787GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 793services.AddSingleton<IAppHostProjectFactory>(new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true))); 809public async Task IntegrationSearchCommandStagingStampedCliWithPinnedStagingApphostQueriesBothImplicitAndStagingChannelsAndSurfacesPrereleaseOnlyPackages() 860return Task.FromResult<IEnumerable<NuGetPackage>>([CreatePackage("Aspire.Hosting.Foundry", "13.4.0-rc.1")]); 862return Task.FromResult<IEnumerable<NuGetPackage>>([]); 876services.AddSingleton<IAppHostProjectFactory>(new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true))); 903public async Task IntegrationListCommandFormatJsonPrefersImplicitChannelWhenMultipleChannelsContainSameIntegration() 916GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([CreatePackage("Aspire.Hosting.Redis", "1.0.0")]) 920GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([CreatePackage("Aspire.Hosting.Redis", "2.0.0")]) 929GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 950public async Task IntegrationSearchCommandFormatJsonReturnsEmptyArrayWhenNoIntegrationsMatch() 1003public async Task AddCommandInteractiveFlowSmokeTest() 1068public async Task AddCommandDoesNotPromptForIntegrationArgumentIfSpecifiedOnCommandLine() 1144public async Task AddCommandDoesNotPromptForVersionIfSpecifiedOnCommandLine() 1228public async Task AddCommandInteractiveDoesNotPromptForVersionIfSpecifiedOnCommandLine() 1308public async Task AddCommandDoesNotPromptForVersionWhenSpecifiedVersionIsFoundViaExactMatchSearch() 1386public async Task AddCommandInteractiveDoesNotPromptForVersionWhenSpecifiedVersionIsFoundViaExactMatchSearch() 1474public async Task AddCommandInteractiveDoesNotPromptForIntegrationWhenExactMatchIsFound(string integrationName) 1542public async Task AddCommandSearchesEachPackageIdOnceWhenExactMatchFallsBackAcrossSharedChannel() 1615public async Task AddCommandWithoutIntegrationNameDoesNotPromptForVersionWhenSpecifiedVersionIsFoundViaExactMatchSearch() 1689public async Task AddCommandShowsStatusWhenSearchingForSpecifiedVersionAfterPackageSelection() 1760public async Task AddCommandFailsWhenSpecifiedVersionDoesNotExist() 1831public async Task AddCommandInteractiveFailsWhenSpecifiedVersionDoesNotExist() 1909public async Task AddCommandPromptsForDisambiguation() 1995public async Task AddCommandPreservesSourceArgumentInBothCommands() 2061public async Task AddCommand_EmptyPackageList_DisplaysErrorMessage() 2094public async Task AddCommand_NoMatchingPackages_DisplaysNoMatchesMessage() 2190public async Task AddCommandPrompter_FiltersToHighestVersionPerPackageId() 2238public async Task AddCommandPrompter_FiltersToHighestVersionPerChannel() 2286public async Task AddCommandPrompter_ShowsHighestVersionPerChannelWhenMultipleChannels() 2338public async Task AddCommandPrompter_ShowsConfiguredChannelAsFirstChoiceWhenChannelPinned() 2392public async Task AddCommandPrompter_StagingChannelPreservesAllChannelChoices() 2436public async Task AddCommandPrompter_StagingChannelSelectsHighestVersionAcrossPackageQualities( 2445Task.FromResult<IEnumerable<NuGetPackage>>( 2477public async Task AddCommandNonInteractiveSelectsExpectedVersionAcrossLanguageAndChannelMatrix( 2520return Task.FromResult(true); 2555GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>( 2580public async Task AddCommandNonInteractiveTypeScriptAppHostPinnedToDailyPrefersDailyChannelOverImplicitStable() 2609GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([CreatePackage("Aspire.Hosting.Azure.Storage", "13.4.3")]) 2613GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([CreatePackage("Aspire.Hosting.Azure.Storage", "13.5.0-preview.1")]) 2616var tsFactory = new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true)); 2621return Task.FromResult(true); 2630GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 2651public async Task AddCommand_WithoutHives_UsesImplicitChannelWithoutPrompting() 2709public async Task AddCommand_WithHives_PrefersImplicitChannelVersionInNonInteractiveMode() 2776public async Task AddCommand_WithPrHive_PrefersCurrentCliVersion() 2801public async Task AddCommand_WithLocalHive_PrefersCurrentCliVersion() 2826public async Task AddCommand_WithLocalAndPrHives_PrefersHiveMatchingCurrentCliVersion() 2868public async Task AddCommand_WithIdentityPackagesOverrideEmulatingStable_PrefersCurrentCliVersion() 3002public async Task AddCommandPolyglotAppHostRejectsNamedNonPolyglotIntegration() 3015GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>( 3017GetPackagesAsyncCallback = (_, query, _, _, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>( 3021var tsFactory = new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true)); 3025return Task.FromResult(true); 3036GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 3054public async Task AddCommandPolyglotAppHostAddsPolyglotIntegration() 3065GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>( 3067GetPackagesAsyncCallback = (_, query, _, _, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>( 3071var tsFactory = new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true)); 3075return Task.FromResult(true); 3086GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 3104public async Task AddCommandPolyglotAppHostWithAllOptionAddsNonPolyglotIntegration() 3115GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>( 3121var tsFactory = new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true)); 3125return Task.FromResult(true); 3136GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 3154public async Task IntegrationListPolyglotAppHostListsOnlyPolyglotIntegrations() 3169GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>( 3171GetPackagesAsyncCallback = (_, query, _, _, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>( 3182GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 3187services.AddSingleton<IAppHostProjectFactory>(new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true))); 3201public async Task IntegrationListPolyglotAppHostShowsHiddenIntegrationCountMessage() 3217GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>( 3219GetPackagesAsyncCallback = (_, query, _, _, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>( 3230GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 3235services.AddSingleton<IAppHostProjectFactory>(new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true))); 3248public async Task IntegrationListPolyglotAppHostWithNoCompatibleIntegrationsShowsAllHint() 3265GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>( 3267GetPackagesAsyncCallback = (_, _, _, _, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([]) 3277GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 3282services.AddSingleton<IAppHostProjectFactory>(new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true))); 3296public async Task IntegrationSearchPolyglotAppHostWithSearchTermMismatchReportsSearchTermError() 3313GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>( 3315GetPackagesAsyncCallback = (_, query, _, _, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>( 3326GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 3331services.AddSingleton<IAppHostProjectFactory>(new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true))); 3346public async Task AddCommandPolyglotAppHostWithFilterDisabledOffersAllIntegrations() 3365GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>( 3368GetPackagesAsyncCallback = (_, _, _, _, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([]) 3371var tsFactory = new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true)); 3375return Task.FromResult(true); 3384GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 3404public async Task AddCommandPolyglotAppHostWithFilterDisabledDoesNotIssuePolyglotTagSearch() 3416GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>( 3425return Task.FromResult<IEnumerable<NuGetPackage>>([]); 3429var tsFactory = new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true)); 3430tsFactory.Project.AddPackageAsyncCallback = (_, _) => Task.FromResult(true); 3438GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 3456public async Task IntegrationListPolyglotAppHostWithFilterDisabledListsAllIntegrations() 3474GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>( 3476GetPackagesAsyncCallback = (_, _, _, _, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([]) 3484GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([ 3489services.AddSingleton<IAppHostProjectFactory>(new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true))); 3523Task.FromResult<IEnumerable<NuGetPackage>>(prerelease || !isPrerelease ? [package] : []) 3566{ } callback => Task.FromResult(callback(packages)), 3567_ => Task.FromResult(packages.First()) // If no callback is provided just accept the first package. 3575{ } callback => Task.FromResult(callback(packages)), 3576_ => Task.FromResult(packages.First()) // If no callback is provided just accept the first package. 3584public async Task AddCommand_WithStartsWith_FindsMatchUsingFuzzySearch() 3668public async Task AddCommand_NonInteractive_NoExactMatchWithoutVersion_FailsInsteadOfFuzzyAutoPick_Regression17724() 3736public async Task AddCommand_NonInteractive_ExactMatchWithoutVersion_StillSucceeds() 3788public async Task AddCommand_Interactive_SingleFuzzyMatchPromptsBeforeAdding_Regression17724() 3847public async Task AddCommand_Interactive_NoFuzzyMatchSinglePackagePromptsBeforeAdding() 3913public async Task AddCommand_WithVersionAndNonExactPackageName_FailsInsteadOfUsingFuzzySearch() 3965public async Task AddCommand_WithVersionAndNoMatchingPackageName_FailsInNonInteractiveMode() 4017public async Task AddCommand_WithPartialMatch_FiltersUsingFuzzySearch() 4103public async Task AddCommand_WithVersionAndNonExactPackageName_Interactive_UsesFuzzySearch() 4186public async Task AddCommand_WithVersionAndNonExactPackageName_Interactive_FailsWhenSelectedPackageDoesNotContainVersion() 4269public async Task AddCommand_WithVersionAndNoMatches_Interactive_PromptsAllPackagesAndPreservesVersion() 4358public async Task AddCommand_WithVersionAndNoMatches_Interactive_FailsWhenSelectedPackageDoesNotContainVersion() 4445public async Task AddCommand_WithTypo_FindsMatchUsingFuzzySearch()
Commands\AgentInitCommandTests.cs (29)
23public async Task AgentInitCommand_SummarizesNormalizedDisplayPath_WhenInstallingUserLevelSkill() 64public async Task AgentInitCommand_SummarizesDefaultSkillsOnce() 99public async Task AgentInitCommand_IncludesSpecificSkillDirectory_WhenInstallFails() 136public async Task AgentInitCommand_NonInteractive_WithAllLocationsAndSkills_InstallsSkillFiles() 178public async Task AgentInitCommand_InteractiveSkillPrompt_IncludesAllBundleSkills() 217public async Task AgentInitCommand_InteractiveSkillPrompt_EscapesBundleDescriptions() 280public async Task AgentInitCommand_InteractiveSkillPrompt_StripsVerboseBundleDescription() 326public async Task AgentInitCommand_InteractiveSkillPrompt_OrdersSkillsAlphabetically() 371public async Task AgentInitCommand_NonInteractive_WithSpecificBundleSkill_InstallsSkillFiles() 391public async Task AgentInitCommand_NonInteractive_WithCliDefinedSkillDifferentCasing_DoesNotResolveBundle() 418public async Task AgentInitCommand_InteractiveSkillPrompt_CliDefinedSkillsWinBundleNameCollisions() 460public async Task AgentInitCommand_NonInteractive_WithNoneLocations_SucceedsWithNoSkillsInstalled() 480public async Task AgentInitCommand_NonInteractive_WithoutSkillLocations_UsesDefaultLocations() 496public async Task AgentInitCommand_NonInteractive_WithoutSkills_UsesDefaultSkills() 523public async Task AgentInitCommand_NonInteractive_AllBundleSkills_AreInstallableByName() 563public async Task AgentInitCommand_NonInteractive_WithExplicitBundleSkillName_InstallsBundleSkill() 586public async Task AgentInitCommand_NonInteractive_WithInvalidSkillLocations_FailsWithMissingArgument() 602public async Task AgentInitCommand_NonInteractive_WithoutWorkspaceRoot_UsesWorkingDirectory() 626public async Task AgentInitCommand_NonInteractive_WithUnavailableAspireSkillsBundle_SucceedsWithoutWarningOrSelectedAspireSkills() 655public async Task PromptAndChainAsync_WithUnavailableAspireSkillsBundle_SucceedsWithoutWarningOrSelectedAspireSkills() 691public async Task PromptAndChainAsync_WithoutPredicateOverride_PreSelectsBundleDefaultsIncludingAspireify() 722public async Task PromptAndChainAsync_WithExcludeAspireifyPredicate_DoesNotPreSelectAspireify() 755public async Task AgentInitCommand_NonInteractive_WithNoneSkills_SucceedsWithNoSkillsInstalled() 775public async Task AgentInitCommand_NonInteractive_ConfigureMcpDefaultsToFalse() 792public async Task AgentInitCommand_NonInteractive_WithSkillLocationsNone_DoesNotInstallAnySkills() 812public async Task AgentInitCommand_NonInteractive_WithSkillLocationsAndSkills_InstallsOnlySpecifiedSkills() 900public async Task AgentInitCommand_DefaultOn_InstallsTelemetryHook_ForDetectedClient() 922public async Task AgentInitCommand_DoesNotFail_WhenTelemetryHookConfigurationThrows() 967return Task.FromResult(Array.Empty<AgentEnvironmentApplicator>());
Commands\AgentMcpCommandTests.cs (18)
78var serverRunTask = Task.Run(async () => 98public async Task McpServer_ListTools_ReturnsExpectedTools() 131public async Task McpServer_ListTools_IncludesResourceMcpTools() 195public async Task McpServer_CallTool_ResourceMcpTool_ReturnsResult() 239return Task.FromResult(new CallToolResult 270public async Task McpServer_CallTool_ResourceMcpTool_UsesDisplayNameForRouting() 313return Task.FromResult(new CallToolResult 333public async Task McpServer_CallTool_ListAppHosts_ReturnsResult() 353public async Task McpServer_CallTool_RefreshTools_ReturnsResult() 389public async Task McpServer_ListTools_DoesNotSendToolsListChangedNotification() 470public async Task McpServer_ListTools_CachesResourceToolMap_WhenConnectionUnchanged() 487return Task.FromResult(new List<ResourceSnapshot> 530public async Task McpServer_CallTool_UnknownTool_ReturnsError() 543public async Task McpServer_DashboardOnlyMode_ListTools_ReturnsOnlyTelemetryTools() 558public async Task McpServer_DashboardOnlyMode_CallNonTelemetryTool_ReturnsError() 571public async Task McpServer_WithInvalidDashboardUrl_ReturnsInvalidCommand() 601Task serverRunTask,
Commands\AgentTelemetryCommandTests.cs (9)
17public async Task AgentTelemetry_EmitsReportedActivityWithProvidedTags() 49public async Task AgentTelemetry_DoesNotEmitTagsForMissingOptions() 79public async Task AgentTelemetry_DropsOverlongAndUnsafeValues() 112public async Task AgentTelemetry_DropsUnsafeFileReferences(string fileReference) 138public async Task AgentTelemetry_DropsUnknownEventType() 165public async Task AgentTelemetry_EmitsNoActivity_WhenAllValuesInvalid() 190public async Task AgentTelemetry_ExitsZero_WithUnknownToken() 206public async Task AgentTelemetry_ExitsZero_WithNoOptions() 232public async Task AgentTelemetry_RecordsValidRelativeFileReference()
Commands\ApiCommandTests.cs (5)
14public async Task ApiCommand_WithNoSubcommand_ShowsHelp() 31public async Task ApiListCommand_WithScope_ReturnsEntries() 48public async Task ApiSearchCommand_WithLanguageFilter_ReturnsResults() 65public async Task ApiGetCommand_WithValidId_ReturnsContent() 82public async Task ApiGetCommand_WithInvalidId_ReturnsError()
Commands\AppHostLauncherTests.cs (47)
124public async Task WaitForAppHostReadyAsync_ReturnsNullWhenReadinessIsUnavailable() 134public async Task WaitForAppHostReadyAsync_PropagatesReadinessFailures() 147public async Task WaitForLegacyDetachedStartupStabilityAsync_ReturnsFalseWhenChildExitsDuringStabilityWindow() 151Task.CompletedTask, 160public async Task WaitForLegacyDetachedStartupStabilityAsync_ReturnsTrueWhenChildStaysAliveForStabilityWindow() 162var childExitTask = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously).Task; 175public async Task LaunchDetachedAsync_WaitsForReadinessRpcBeforeReportingSuccess() 201Assert.NotSame(launchTask, await Task.WhenAny(launchTask, Task.Delay(TimeSpan.FromMilliseconds(100))).DefaultTimeout()); 221public async Task LaunchDetachedAsync_PropagatesPersistentSelectionOriginToChild( 232WaitForAppHostReadyHandler = _ => Task.FromResult<WaitForAppHostReadyResponse?>(new WaitForAppHostReadyResponse { IsReady = true }) 257public async Task LaunchDetachedAsync_ExplicitFalseFromLinkedWorktree_ForwardsFalse() 265WaitForAppHostReadyHandler = _ => Task.FromResult<WaitForAppHostReadyResponse?>(new WaitForAppHostReadyResponse { IsReady = true }) 286public async Task LaunchDetachedAsync_OmittedFromLinkedWorktree_DoesNotInferIsolation() 294WaitForAppHostReadyHandler = _ => Task.FromResult<WaitForAppHostReadyResponse?>(new WaitForAppHostReadyResponse { IsReady = true }) 315public async Task LaunchDetachedAsync_ExplicitTrue_ForwardsFlag() 322WaitForAppHostReadyHandler = _ => Task.FromResult<WaitForAppHostReadyResponse?>(new WaitForAppHostReadyResponse { IsReady = true }) 343public async Task LaunchDetachedAsync_OmittedFromPrimaryCheckout_DoesNotForwardOption() 350WaitForAppHostReadyHandler = _ => Task.FromResult<WaitForAppHostReadyResponse?>(new WaitForAppHostReadyResponse { IsReady = true }) 371public async Task LaunchDetachedAsync_DeletesDeadPidSocketBeforeStartingChildProcess() 379WaitForAppHostReadyHandler = _ => Task.FromResult<WaitForAppHostReadyResponse?>(new WaitForAppHostReadyResponse { IsReady = true }) 401public async Task LaunchDetachedAsync_ReportsFailureWhenReadinessWaitIsInterruptedByChildExit() 410await Task.Delay(Timeout.InfiniteTimeSpan, ct); 442public async Task LaunchDetachedAsync_UpdatesStatusAndWaitsForChildExitWhenReadinessRpcFails() 479Assert.NotSame(launchTask, await Task.WhenAny(launchTask, Task.Delay(TimeSpan.FromMilliseconds(100))).DefaultTimeout()); 493public async Task WaitForLegacyDetachedStartupStabilityAsync_UsesV2ResourceSnapshotProbeWhenAvailable() 496var childExitTask = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously).Task; 503return Task.FromResult<List<ResourceSnapshot>>([]); 519public async Task WaitForLegacyDetachedStartupStabilityAsync_RetriesV2ProbeUntilChildExits() 551public async Task LaunchDetachedAsync_ReportsSuccessWhenLegacyV2ProbeSucceeds() 563return Task.FromResult<List<ResourceSnapshot>>([]); 588public async Task LaunchDetachedAsync_ReportsFailureWhenLegacyV2ProbeDoesNotSucceedBeforeChildExit() 626public async Task LaunchDetachedAsync_ReportsForkProcessExitCodeWhenChildExitsBeforeMonitorAndStartTimeIsUnavailable() 702public async Task LaunchDetachedAsync_ForwardsCancellationTokenToDetachedLauncher() 741public async Task LaunchDetachedAsync_DisposesExecutionWhenDetachedStartFails() 768public async Task LaunchDetachedAsync_CleansUpChildProcessWhenCancelledAfterStart() 808public async Task LaunchDetachedAsync_UsesSingleUncancelledChildExitObservationWhileWaitingForBackchannel() 813harness.ProcessFactory.StartHandler = (_, _, _, _, _, _) => Task.FromResult<IProcessExecution>(execution); 958public async Task ReadChildLogTail_ReturnsBoundedRelevantNonEmptyTail() 986public async Task ReadChildLogTail_IncludesBuildOutput() 1009public async Task ReadChildLogReplayTail_ReturnsRicherBoundedRelevantTail() 1071public async Task ReadChildLogReplayTail_IncludesBuildOutput() 1192Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile]) 1351return Task.FromResult<IProcessExecution>(new MonitoredProcessExecutionAdapter(StartedProcess)); 1493return Task.FromResult(true); 1559return Task.FromResult(true);
Commands\BaseCommandTests.cs (25)
31public async Task BaseCommand_FormatOption_SetsConsoleOutputCorrectly(string args, bool expectErrorConsole) 51public async Task BaseCommand_IntegrationListFormatJson_SetsConsoleOutputCorrectly() 76public async Task BaseCommand_WithNoUpdateNotification_DoesNotDisplayTrailingBlankLine() 98public async Task BaseCommand_WithUpdateNotification_DoesNotDisplayTrailingBlankLine() 124public async Task BaseCommand_UpdateNotificationValidationFailureEscapesInDebugBuilds() 148public async Task BaseCommand_ExecuteValidationFailureEscapesInDebugBuilds() 200public async Task BaseCommand_UpdateNotification_RespectJsonFormat(string args, bool expectNotifyCalled) 225public async Task BaseCommand_OnFailure_DisplaysLogFilePathOnStderr() 232Task.FromResult(new AppHostProjectSearchResult(null, [])) 256public async Task BaseCommand_OnFailure_DisplaysAppHostLogFilePathOnStderr() 263Task.FromResult(new AppHostProjectSearchResult(null, [])) 298public async Task BaseCommand_OnCancellationWithErrorExitCode_DisplaysCancellationMessageOnStderr() 329public async Task BaseCommand_OnCancellationWithSuccessExitCode_DisplaysCancellationMessageOnStdout() 363public async Task BaseCommand_OnSuccess_DoesNotDisplayLogFilePath() 386public async Task BaseCommand_OnUnexpectedException_ReturnsInvalidCommandExitCode_AndDisplaysError() 421public async Task BaseCommand_OnCancellation_DisplaysStoppingMessageAfterDelay() 440await Task.Delay(500, CancellationToken.None); 473public async Task BaseCommand_OnCancellation_DoesNotDisplayStoppingMessageIfHandlerCompletesQuickly() 520public async Task BaseCommand_MiscasedOption_ReturnsErrorWithSuggestion(string args, string badOption, string correctOption) 541public async Task BaseCommand_CorrectlyCasedOption_DoesNotReturnMiscasedError() 570public async Task BaseCommand_OptionWithEqualsValue_ParsedCorrectlyOrFlaggedAsMiscased(string optionName, string value, bool expectError) 615public async Task BaseCommand_UnrelatedUnmatchedToken_DoesNotReturnMiscasedError() 641public async Task BaseCommand_MiscasedOptionAfterDoubleDash_IsNotFlagged() 667public async Task BaseCommand_MiscasedOptionBeforeDoubleDash_WithSameTokenAfter_IsFlagged() 706public async Task BaseCommand_ResourceCommand_MiscasedOptionBeforeDoubleDash_IsFlagged()
Commands\CacheCommandTests.cs (7)
15public async Task CacheCommand_WithoutSubcommand_ReturnsInvalidCommand() 30public async Task CacheCommandWithHelpArgumentReturnsZero() 44public async Task CacheClear_ClearsPackagesDirectory() 67public async Task CacheClear_ClearsAppHostInfoDiskCache() 89public async Task CacheClear_ClearsStagingNuGetPackagesCache() 121public async Task CacheClear_HandlesMissingStagingNuGetPackagesCache() 144public async Task CacheClear_HandlesNonExistentPackagesDirectory()
Commands\CertificatesCommandTests.cs (4)
20public async Task CertificatesCommand_Help_ShowsCertificatesSubcommand() 35public async Task CertificatesCommand_CleanSubcommand_ShowsInHelp() 50public async Task CertificatesCommand_TrustSubcommand_ShowsInHelp() 65public async Task CertificatesCommand_TrustSubcommand_ReturnsSuccessForNonInteractiveLinuxPartialTrust()
Commands\ConfigCommandTests.cs (42)
67public async Task ConfigCommand_WithExtensionMode_Works() 95public async Task ConfigCommandReturnsInvalidCommandExitCode() 109public async Task ConfigSetCommand_WithFlatKey_CreatesSimpleProperty() 132public async Task DocsSourceUrls_CanBeConfiguredViaAspireConfig() 169public async Task ConfigSetCommand_WithDotNotation_CreatesNestedObject() 194public async Task ConfigSetCommand_WithDeepDotNotation_CreatesDeeplyNestedObject() 222public async Task ConfigSetCommand_ReplacesPrimitiveWithObject() 252public async Task ConfigGetCommand_WithFlatKey_ReturnsValue() 278public async Task ConfigGetCommand_WithDotNotation_ReturnsNestedValue() 303public async Task ConfigGetCommand_WithNonExistentKey_ReturnsError() 317public async Task ConfigDeleteCommand_WithFlatKey_RemovesValue() 342public async Task ConfigDeleteCommand_CleansUpEmptyParentObjects() 371public async Task ConfigListCommand_ShowsFlattenedDotNotationKeys() 399public async Task ConfigListCommand_WithoutAllFlag_ShowsHintInsteadOfFeatures() 425public async Task ConfigListCommand_WithAllFlag_ShowsFeatureDetails() 451public async Task ConfigListCommand_WithoutAllFlag_NoConfig_ShowsHintAboutAllFlag() 473public async Task ConfigListCommand_WithAllFlag_NoConfig_ShowsAvailableFeatures() 495public async Task ConfigListCommand_WithAllFlag_DoesNotListHiddenFeature() 519public async Task ConfigInfoJson_DoesNotAdvertiseHiddenFeature() 564public async Task FeatureFlags_WhenSetToTrue_ReturnsTrue() 586public async Task FeatureFlags_WhenSetToFalse_ReturnsFalse() 604public async Task FeatureFlags_WhenSetToInvalidValue_ReturnsFalse() 642public async Task ShowDeprecatedPackages_CanBeConfiguredViaCommandLine() 677public async Task ConfigSetCommand_WithColonNotation_CreatesNestedObject() 703public async Task ConfigSetCommand_ColonThenDot_NoDuplicateKeys() 734public async Task ConfigSetCommand_DotThenColon_NoDuplicateKeys() 765public async Task ConfigDeleteCommand_WithColonNotation_DeletesNestedValue() 792public async Task ConfigSetCommand_WithCorruptedFile_RecoversDuringLoad() 825public async Task ConfigSetCommand_WithCorruptedFile_PreservesExistingNestedValueOverFlatKey() 859public async Task ConfigSetCommand_LocalAppHostPath_RemainsAllowed(string key) 887public async Task ConfigSetCommand_LocalAppHostPath_MigratesLegacySettingsFile(string key) 918public async Task ConfigSetCommand_GlobalAppHostPath_ReturnsInvalidCommand(string key, string expectedErrorResourceName) 945public async Task ConfigSetCommand_GlobalOverrideStagingFeed_IsReadByPackagingService() 987public async Task ConfigSetCommand_LegacyAppHostPath_ReturnsInvalidCommand() 1005public async Task ConfigSetCommand_AppHostLanguage_RemainsAllowed() 1026public Task SetConfigurationAsync(string key, string value, bool isGlobal = false, CancellationToken cancellationToken = default) 1028return Task.CompletedTask; 1033return Task.FromResult(true); 1038return Task.FromResult(new Dictionary<string, string> 1047return Task.FromResult(new Dictionary<string, string> 1055return Task.FromResult(new Dictionary<string, string>()); 1060return Task.FromResult<string?>(key);
Commands\DashboardRunCommandTests.cs (18)
26public async Task DashboardRunCommand_BundleNotAvailable_DisplaysError() 49public async Task DashboardRunCommand_Help_ReturnsSuccess() 131public async Task DashboardRunCommand_DefaultOptions_DoesNotEmitAllowAnonymous() 151public async Task DashboardRunCommand_BundleAvailableWithinDelay_DoesNotDisplayBundleStatus() 169public async Task DashboardRunCommand_BundleUnavailableAfterDelay_DisplaysBundleStatus() 207public async Task DashboardRunCommand_DefaultOptions_PassesDefaultArgsToProcess() 237public async Task DashboardRunCommand_IndividualOption_PassesCorrectArgToProcess(string cliArgs, string expectedArg) 257public async Task DashboardRunCommand_WithoutAllowAnonymous_SetsBrowserTokenEnvVar() 281public async Task DashboardRunCommand_UnmatchedTokens_ForwardedToProcess() 307public async Task DashboardRunCommand_CombinedOptions_PassesAllArgsToProcess() 334public async Task DashboardRunCommand_ProcessExitsWithError_ReturnsFailure() 352public async Task DashboardRunCommand_ProcessFailsToStart_DisplaysErrorAndReturnsFailure() 367(_, _, _) => Task.FromResult((0, (string?)null)), 388public async Task DashboardRunCommand_WhenCancelled_DisplaysCancellationMessageAndReturnsSuccess(bool slowShutdown) 406new TestProcessExecution("fake", [], null, options, (_, _, _) => Task.FromResult((0, (string?)null)), () => 0) 414await Task.Delay(Timeout.InfiniteTimeSpan, cancellationToken).ConfigureAwait(false); 444var firstCompletedTask = await Task.WhenAny(stoppingMessageDisplayedTcs.Task, pendingRun).DefaultTimeout();
Commands\DeployCommandTests.cs (13)
21public async Task DeployCommandWithHelpArgumentReturnsZero() 36public async Task DeployCommandInExtensionForwardsResolvedAspireHome() 79public async Task PipelineCommands_WhenDelegatingToExtension_CarryAppHostSelectionOrigin( 101return Task.FromResult(new AppHostProjectSearchResult(selectedProjectFile, [selectedProjectFile])); 153public async Task DeployCommandFailsWithInvalidProjectFile() 185public async Task DeployCommandFailsWhenAppHostIsNotCompatible() 219public async Task DeployCommandFailsWhenAppHostBuildFails() 253public async Task DeployCommandSucceedsWithoutOutputPath() 321public async Task DeployCommandSucceedsEndToEnd() 393public async Task DeployCommandIncludesDeployFlagInArguments() 464public async Task DeployCommandReturnsNonZeroExitCodeWhenDeploymentFails() 600{ } callback => Task.FromResult(callback(publishers)), 601_ => Task.FromResult(publishers.First()) // Default to the first publisher if no callback is provided.
Commands\DescribeCommandTests.cs (26)
22public async Task DescribeCommand_Help_Works() 36public async Task DescribeCommand_WhenNoAppHostRunning_ReturnsSuccess() 55public async Task DescribeCommand_FormatOption_IsCaseInsensitive(string format) 73public async Task DescribeCommand_FormatOption_AcceptsTable(string format) 88public async Task DescribeCommand_FormatOption_RejectsInvalidValue() 103public async Task DescribeCommand_FollowOption_CanBeParsed() 118public async Task DescribeCommand_LegacyWatchOption_StillWorks() 133public async Task DescribeCommand_LegacyResourcesAlias_StillWorks() 148public async Task DescribeCommand_FollowAndFormat_CanBeCombined() 163public async Task DescribeCommand_ResourceNameArgument_CanBeParsed() 178public async Task DescribeCommand_AllOptions_CanBeCombined() 261public async Task DescribeCommand_Follow_JsonFormat_DeduplicatesIdenticalSnapshots() 305public async Task DescribeCommand_Follow_TableFormat_DeduplicatesIdenticalSnapshots() 339public async Task DescribeCommand_Follow_WhenBackchannelIsDisposed_ExitsSuccessfully() 369public async Task DescribeCommand_Follow_WhenAppHostHasExited_WritesShutdownMessageToStderr() 393public async Task DescribeCommand_Follow_WhenCanceledAndBackchannelIsDisposed_DoesNotWriteStatusToStderr() 411await Task.Yield(); 422public async Task DescribeCommand_JsonFormat_StripsLoginPathFromDashboardUrl() 450public async Task DescribeCommand_JsonFormat_PreservesObjectProperties() 492public async Task DescribeCommand_Follow_JsonFormat_StripsLoginPathFromDashboardUrl() 523public async Task DescribeCommand_HiddenResources_AreExcludedByDefault() 549public async Task DescribeCommand_IncludeHidden_ShowsHiddenResources() 577public async Task DescribeCommand_SpecificResource_IncludesHiddenWithoutFlag() 602public async Task DescribeCommand_Follow_HiddenResources_AreExcludedByDefault() 630public async Task DescribeCommand_Follow_IncludeHidden_ShowsHiddenResources() 709await Task.Yield();
Commands\DestroyCommandTests.cs (9)
20public async Task DestroyCommandWithHelpArgumentReturnsZero() 35public async Task DestroyCommandFailsWithInvalidProjectFile() 64public async Task DestroyCommandPassesCorrectStepArgument() 125public async Task DestroyCommandFailsFastWhenNonInteractiveWithoutYes(string commandLine) 141return Task.FromResult(0); 165public async Task DestroyCommandForwardsYesFlag(string commandLine) 222public async Task DestroyCommandIncludesOutputPathWhenSpecified() 280public async Task DestroyCommandReturnsNonZeroExitCodeWhenDestroyActivitiesFail() 333await Task.Yield();
Commands\DoCommandTests.cs (31)
21public async Task DoCommandWithHelpArgumentReturnsZero() 36public async Task DoCommand_WhenExtensionStepPromptIsCancelled_DoesNotDisplayError() 64public async Task DoCommandWithStepArgumentSucceeds() 122public async Task DoCommandWithDeployStepSucceeds() 175public async Task DoCommandWithPublishStepSucceeds() 228public async Task DoCommandPassesOutputPathWhenSpecified() 286public async Task DoCommandFailsWithInvalidProjectFile() 324public async Task PipelineCommandWithListStepsUsesInspectOperation(string commandLine, string commandName, string? expectedStep) 361return Task.FromResult(new GetPipelineStepsResponse 427public async Task DoCommandWithListStepsPropagatesAppHostExitCode() 445GetPipelineStepsAsyncCallback = (step, ct) => Task.FromResult(new GetPipelineStepsResponse { Steps = [] }) 462public async Task DoCommandWithListStepsJsonDoesNotWriteTerminalProgressToStandardOutput() 483GetPipelineStepsAsyncCallback = (step, ct) => Task.FromResult(new GetPipelineStepsResponse 517public async Task DoCommandWithListStepsAndStepArgumentReturnsZero() 566public async Task DoCommandWithListStepsDoesNotExecutePipeline() 621public async Task DoCommandWithListStepsReturnsBuildFailureWhenCurrentAppHostExitsBeforeBackchannel() 634Task.FromResult(1) 647public async Task DoCommandWithListStepsReturnsIncompatibleWhenLegacyAppHostRejectsInspectOperation() 662return Task.FromResult(1); 676public async Task DoCommandWithListStepsReturnsIncompatibleWhenLegacyAppHostFailsBackchannelConnection() 709public async Task DoCommandWithListStepsReturnsIncompatibleWithoutLaunchingLegacyAppHost() 724return Task.FromResult(0); 739public async Task DoCommandWithListStepsStopsAppHostWhenCapabilityIsMissing() 757GetCapabilitiesAsyncCallback = _ => Task.FromResult<string[]>(["baseline.v2"]) 775public async Task DoCommandListStepsDisplaysCustomSteps() 801GetPipelineStepsAsyncCallback = (step, ct) => Task.FromResult(new GetPipelineStepsResponse 831public async Task DoCommandWithHelpShowsListStepsOption() 846public async Task DoCommandForwardsFormatWithoutListStepsToAppHost() 888public async Task DoCommandWithListStepsReturnsInvalidCommandForInvalidFormat(string commandLine) 908public async Task DoCommandForwardsPipelineLogLevelAsLogLevelToAppHost() 963public async Task DoCommandDoesNotForwardCliLogLevelToAppHost()
Commands\DocsCommandTests.cs (11)
14public async Task DocsCommand_WithNoSubcommand_ShowsHelp() 32public async Task DocsListCommand_ReturnsDocuments() 49public async Task DocsListCommand_WithJsonFormat_ReturnsJson() 66public async Task DocsSearchCommand_WithQuery_ReturnsResults() 84public async Task DocsSearchCommand_WithLimit_RespectsLimit() 102public async Task DocsSearchCommand_WithJsonFormat_ReturnsJson() 120public async Task DocsGetCommand_WithValidSlug_ReturnsContent() 137public async Task DocsGetCommand_WithSection_ReturnsSection() 154public async Task DocsGetCommand_WithRichMarkdown_PreservesReadableBlockOrder() 236public async Task DocsGetCommand_WithInvalidSlug_ReturnsError() 322return Task.FromResult<DocsSearchResponse?>(new DocsSearchResponse
Commands\DoctorCommandTests.cs (41)
22public async Task DoctorCommand_Help_Works() 38public async Task DoctorCommand_Json_IncludesCliVersionStatus() 46GetVersionStatusAsyncCallback = (_, _) => Task.FromResult(new CliVersionStatus("13.0.0", "13.1.0", "aspire update")) 62public async Task DoctorCommand_Json_IncludesOperatingSystemStatus() 83public async Task DoctorCommand_Json_OnLinux_UsesOsReleaseValues() 118public async Task DoctorCommand_Json_VersionUpdateBanner_IsSuppressed() 163public async Task DoctorCommand_Json_IncludesAppHostVersionWhenAppHostExists() 175GetAspireHostingVersionAsyncCallback = (_, _) => Task.FromResult<string?>("13.0.0") 190public async Task DoctorCommand_Json_IncludesTypeScriptAppHostVersionFromAspireConfig() 214GetAspireHostingVersionAsyncCallback = (_, _) => Task.FromResult<string?>("13.1.0") 239public async Task DoctorCommand_Json_DoesNotDiscoverNestedAppHostWithoutConfig() 255return Task.FromResult<string?>("unexpected"); 266public async Task DoctorCommand_Json_DoesNotShowAppHostVersionForNonAppHostProject() 283return Task.FromResult<string?>("unexpected"); 294public async Task DoctorCommand_Json_DoesNotDiscoverNestedAppHostWhenAnotherProjectExists() 311GetAspireHostingVersionAsyncCallback = (_, _) => Task.FromResult<string?>("13.2.0") 320public async Task DoctorCommand_Json_DoesNotChooseBetweenMultipleDirectAppHostsWithoutConfig() 336return Task.FromResult<string?>("unexpected"); 347public async Task DoctorCommand_Json_PreservesCliVersionWhenAppHostVersionResolutionFails() 378public async Task DoctorCommand_Json_PreservesCliVersionWhenAppHostDiscoveryFails() 401public async Task DoctorCommand_Json_UsesConfiguredAppHostBeyondLanguageDetectionLimit() 422GetAspireHostingVersionAsyncCallback = (_, _) => Task.FromResult<string?>("13.2.0") 439public async Task DoctorCommand_Json_CliVersion_IncludesIdentityChannelFromReader() 450GetVersionStatusAsyncCallback = (_, _) => Task.FromResult(new CliVersionStatus("13.0.0", LatestVersion: null, UpdateCommand: null)) 466public async Task DoctorCommand_Json_CliVersion_OmitsIdentityChannelWhenReaderThrows() 474GetVersionStatusAsyncCallback = (_, _) => Task.FromResult(new CliVersionStatus("13.0.0", LatestVersion: null, UpdateCommand: null)) 492public async Task DoctorCommand_Json_AppHostVersion_IncludesPinnedChannelFromAspireConfig() 511GetAspireHostingVersionAsyncCallback = (_, _) => Task.FromResult<string?>("13.0.0") 522public async Task DoctorCommand_Json_AppHostVersion_IncludesPinnedChannelFromAspireConfigWhenAppHostIsNested() 545GetAspireHostingVersionAsyncCallback = (_, _) => Task.FromResult<string?>("13.0.0") 557public async Task DoctorCommand_Json_AppHostVersion_OmitsPinnedChannelWhenAspireConfigAbsent() 570GetAspireHostingVersionAsyncCallback = (_, _) => Task.FromResult<string?>("13.0.0") 581public async Task DoctorCommand_Json_CliVersion_IncludesLatestVersionChannel_WhenUpdateAvailable() 593GetVersionStatusAsyncCallback = (_, _) => Task.FromResult(new CliVersionStatus( 626public async Task DoctorCommand_Json_IncludesDiscoveredInstallations() 677public async Task DoctorCommand_HumanReadable_Self_RendersOnlyRunningInstallationAndSkipsChecks() 746public async Task DoctorCommand_HumanReadable_AppendsInstallationsAfterSummary() 809public async Task DoctorCommand_HumanReadable_EscapesUnknownPathStatus() 870public async Task DoctorCommand_Json_Self_ReturnsOnlyRunningInstallation() 904public async Task DoctorCommand_Json_WhenInstallDiscoveryFails_StillReturnsDoctorResults() 931public async Task DoctorCommand_HumanReadable_RendersMissingInstallationValuesBasedOnStatus(string status, string expectedPlaceholder)
Commands\DotNetSdkCheckTests.cs (8)
15public async Task CheckAsync_SkipsCheck_WhenNoAppHostFound() 29public async Task CheckAsync_SkipsCheck_WhenNonDotNetAppHostFound() 42public async Task CheckAsync_RunsCheck_WhenDotNetAppHostFound() 51public async Task CheckAsync_ReturnsFail_WhenDotNetAppHostFound_AndSdkNotInstalled() 66public async Task CheckAsync_SkipsCheck_WhenNoSettingsFileExists() 78public async Task CheckAsync_SkipsCheck_WhenLanguageNotRecognized() 97public async Task CheckAsync_FallsBackToFileSystemScan_WhenNoSettingsFile(string relativePath, bool shouldRunCheck) 156GetAppHostFromSettingsAsyncCallback = _ => Task.FromResult(appHostFile)
Commands\ExportCommandTests.cs (14)
24public async Task ExportCommand_WritesZipWithExpectedData() 112public async Task ExportCommand_OutputOption_ConfiguresArchiveOutputLocation() 142public async Task ExportCommand_AppHostOption_UsesSpecifiedAppHost() 176public async Task ExportCommand_SingleInScopeConnection_ExportsCorrectData() 298public async Task ExportCommand_ReplicaResources_GroupsDataByResolvedResourceName() 424public async Task ExportCommand_ResourceFilter_ExportsOnlyFilteredResource() 482public async Task ExportCommand_ResourceFilter_NoTelemetryData_SkipsStructuredLogsAndTraces() 536public async Task ExportCommand_ResourceFilter_ReplicasByDisplayName_ExportsAllReplicas() 601public async Task ExportCommand_HiddenResources_AreExcludedByDefault() 645public async Task ExportCommand_IncludeHidden_ShowsHiddenResources() 689public async Task ExportCommand_SpecificHiddenResource_WorksWithoutFlag() 731public async Task ExportCommand_ResourceFilter_NonExistentResource_ReturnsError() 759public async Task ExportCommand_DashboardUrl_ExportsTelemetryData() 812public async Task ExportCommand_DashboardUnavailable_ExportsResourcesAndConsoleLogs()
Commands\ExtensionInternalCommandTests.cs (20)
30public async Task ExtensionInternalCommand_WithHelpArgument_ReturnsZero() 44public async Task ExtensionInternalCommand_WithNoSubcommand_ReturnsZero() 58public async Task GetAppHostsCommand_WithSingleProject_ReturnsSuccessWithValidJson() 99public async Task GetAppHostsCommand_WithRealDiscovery_ReturnsOnlyJson() 134public async Task GetAppHostsCommand_WithMultipleProjects_ReturnsSuccessWithAllCandidates() 177public async Task GetAppHostsCommand_WithNoProjects_ReturnsFailureExitCode() 195public async Task GetAppHostsCommand_WhenProjectLocatorThrows_ReturnsFailureExitCode() 213public async Task GetAppHostsCommand_WithHelpArgument_ReturnsZero() 244return Task.FromResult(result); 249return Task.FromResult<List<AppHostProjectCandidate>>([new(_projectFile, "test")]); 254return Task.FromResult<List<FileInfo>>([_projectFile]); 262return Task.FromResult<FileInfo?>(_projectFile); 290public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null); 309return Task.FromResult(result); 314return Task.FromResult(_projectFiles.Select(projectFile => new AppHostProjectCandidate(projectFile, "test")).ToList()); 319return Task.FromResult(_projectFiles); 327return Task.FromResult<FileInfo?>(null); 355public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null); 412public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null); 469public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
Commands\InitCommandTests.cs (66)
43Task.FromResult<IEnumerable<NuGetPackageCli>>( 51GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([implicitChannel]) 62public async Task InitCommand_WhenSolutionAndProjectInSameDirectory_CreatesProjectModeAppHost(string projectFileName) 113public async Task InitCommand_WhenSolutionDirectoryHasNoProjectFiles_CreatesProjectModeAppHost() 154public async Task InitCommand_WhenNoSolutionExists_CreatesSingleFileAppHostAndAspireConfig() 175public async Task InitCommand_SingleFileSkeleton_CreatesAppHostRunJsonWithDashboardEnvVars() 231public async Task InitCommand_SingleFileSkeleton_AppHostRunJsonAdoptsPortsFromExistingAspireConfig() 288public async Task InitCommand_SingleFileSkeleton_PreservesUnparseableExistingProfiles() 342public async Task InitCommand_WhenDeprecatedCompatibilityOptionsProvided_SucceedsAndWarns() 369public async Task InitCommand_WhenTypeScriptSelected_CreatesAppHostAndAspireConfig() 406public async Task InitCommand_WhenLegacyTypeScriptAppHostExists_DoesNotCreateMtsAppHost() 433public async Task InitCommand_WhenBrownfieldTypeScriptSelected_DisplaysNestedAppHostPath() 446return Task.FromResult(true); 481public async Task InitCommand_WhenAspireifySkillSelected_PrintsToolSpecificFollowUpCommands() 529public async Task InitCommand_WhenAspireifySkillNotSelected_DoesNotPrintFollowUpCommands() 575public async Task InitCommand_NonInteractive_WithNoneSkills_DoesNotInstallAgentSkills() 597public async Task InitCommand_NonInteractive_WithSkillLocationsNone_DoesNotInstallAgentSkills() 617public async Task InitCommand_NonInteractive_WithSkillLocationsAndSkills_InstallsOnlySpecifiedSkills() 640public async Task InitCommand_WhenNoSolutionExists_SingleFileSkeletonPinsSdkVersion() 666public async Task InitCommand_WhenAspireConfigAlreadyExists_MergesAppHostSection() 696public async Task InitCommand_WhenAspireConfigIsMalformed_FailsCleanly() 715await Task.CompletedTask; 719public async Task InitCommand_WhenAppHostAlreadyExists_DoesNotOverwriteIt() 739public async Task InitCommand_WhenSolutionExistsAndChannelIsImplicit_LeavesNuGetConfigNull() 792public async Task InitCommand_WhenSolutionExistsAndPrHivesPresent_DoesNotWidenToAllChannels() 817Task.FromResult<IEnumerable<NuGetPackageCli>>( 823Task.FromResult<IEnumerable<NuGetPackageCli>>( 837GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([implicitChannel, prHiveChannel]) 869public async Task InitCommand_WhenChannelTemplateSearchFails_DisplaysFriendlyError() 896GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([implicitChannel]) 935public async Task InitCommand_ProjectMode_NoChannelOverride_ResolvesAgainstCliExecutionContextChannel(string contextChannel) 984public async Task InitCommand_ProjectMode_PrBuildResolvesToPrNumberedHive() 1041public async Task InitCommand_SingleFileMode_NoChannelOverride_WiresNuGetConfigToCliExecutionContextChannel(string contextChannel) 1076public async Task InitCommand_SingleFileMode_StableIdentity_DoesNotCreateNuGetConfig() 1112public async Task InitCommand_SingleFileMode_WritesIdentityChannelIntoAspireConfig(string contextChannel) 1150public async Task InitCommand_SingleFileMode_PreservesExistingChannelInAspireConfig() 1184public async Task InitCommand_SingleFileMode_DoesNotPersistChannelWhenIdentityUnregistered() 1216public async Task InitCommand_SingleFileMode_DoesNotPersistChannelWhenIdentityMatchesImplicit() 1229Task.FromResult<IEnumerable<NuGetPackageCli>>([]) 1234GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([implicitChannel]) 1260public async Task InitCommand_PolyglotMode_PassesResolvedNonDefaultChannelToScaffolder() 1286return Task.FromResult(true); 1308public async Task InitCommand_PolyglotMode_DoesNotPassStableChannelToScaffolder() 1334return Task.FromResult(true); 1358public async Task InitCommand_PolyglotMode_PreservesExistingChannelInAspireConfig() 1388return Task.FromResult(true); 1413public async Task InitCommand_PolyglotMode_DoesNotPassChannelWhenIdentityUnregistered() 1440return Task.FromResult(true); 1465public async Task InitCommand_DoesNotConsultGlobalConfigurationServiceForChannelKey() 1544public async Task InitCommand_OnLocalChannelCli_WithNoLocalHive_FallsBackToImplicitChannel() 1573Task.FromResult<IEnumerable<NuGetPackageCli>>( 1579GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([implicitChannel]) 1632public async Task InitCommand_ProjectMode_NoChannelOverride_WiresNuGetConfigInSolutionDirToCliExecutionContextChannel(string contextChannel) 1693public async Task InitCommand_ProjectMode_StableIdentity_DoesNotCreateNuGetConfig() 1740public async Task InitCommand_ProjectMode_RerunWithExistingAppHostDirAndMissingNuGetConfig_CreatesNuGetConfig() 1784public async Task InitCommand_SingleFileMode_RerunWithExistingAppHostFileAndMissingNuGetConfig_CreatesNuGetConfig() 1822public async Task InitCommand_ProjectMode_SolutionInSubdirectory_WritesNuGetConfigNextToSolutionNotInWorkingDirectory() 1873public async Task InitCommand_ProjectMode_WithPreExistingNuGetConfig_PreservesUserSourcesAndAddsChannelSource() 1934public async Task InitCommand_ProjectMode_MultipleExplicitChannels_PicksChannelMatchingIdentity() 1989public async Task InitCommand_ProjectMode_LocalIdentityChannelWithNoLocalChannelRegistered_DoesNotWriteNuGetConfig() 2007Task.FromResult<IEnumerable<NuGetPackageCli>>( 2013GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([implicitChannel]) 2050public async Task InitCommand_ProjectMode_WithSlnxSolutionFile_WiresWorkspaceNuGetConfig() 2125Task.FromResult<IEnumerable<NuGetPackageCli>>( 2139GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>(channels) 2200return Task.FromResult(true);
Commands\InstallationInfoOutputTests.cs (2)
15public async Task DiscoverAllSafelyAsync_TimesOutWhenDiscoveryDoesNotObserveCancellation() 32return Task.FromResult<IReadOnlyList<InstallationInfo>>([self]);
Commands\LogsCommandTests.cs (48)
20public async Task LogsCommand_Help_Works() 122public async Task LogsCommand_WithInvalidTailValue_ReturnsError(int tailValue) 142public async Task LogsCommand_WithValidTailValue_PassesValidation(int tailValue) 159public async Task LogsCommand_WhenNoAppHostRunning_ReturnsSuccess() 179public async Task LogsCommand_FormatOption_IsCaseInsensitive(string format) 198public async Task LogsCommand_FormatOption_AcceptsTable(string format) 213public async Task LogsCommand_FormatOption_RejectsInvalidValue() 229public async Task LogsCommand_FollowOption_CanBeCombinedWithTail() 244public async Task LogsCommand_AllOptions_CanBeCombined() 259public async Task LogsCommand_ShortFormOptions_Work() 374public async Task LogsCommand_JsonOutput_ResolvesResourceNames() 404public async Task LogsCommand_TextOutput_ResolvesResourceNames() 431public async Task LogsCommand_WithResourceName_ValidatesAgainstNameAndDisplayName(string resourceName, bool expectError) 453public async Task LogsCommand_JsonOutput_WithTimestamps_IncludesTimestampField() 491public async Task LogsCommand_JsonOutput_WithoutTimestamps_OmitsTimestampField() 530public async Task LogsCommand_TextOutput_WithTimestamps_IncludesTimestampPrefix() 552public async Task LogsCommand_TextOutput_WithoutTimestamps_NoTimestampPrefix() 575public async Task LogsCommand_TextOutput_StripsAnsiControlSequences_WhenAnsiDisabled() 607public async Task LogsCommand_JsonOutput_PreservesAnsiControlSequences() 642public async Task LogsCommand_HiddenResources_AreExcludedByDefault() 667public async Task LogsCommand_IncludeHidden_ShowsHiddenResourceLogs() 692public async Task LogsCommand_SpecificHiddenResource_WorksWithoutFlag() 715public async Task LogsCommand_NewResourceAfterInitialSnapshot_LogsAreIncluded() 805public async Task LogsCommand_HiddenResourceAfterInitialSnapshot_IsExcludedInFollowMode() 851return Task.FromResult(snapshotsCallCount == 1 903public async Task LogsCommand_Follow_WhenBackchannelIsDisposed_ExitsSuccessfully() 926public async Task LogsCommand_Follow_WhenAppHostHasExited_WritesShutdownMessageToStderr() 948public async Task LogsCommand_Follow_WhenCanceledAndBackchannelIsDisposed_DoesNotWriteStatusToStderr() 964await Task.Yield(); 1036public async Task LogsCommand_WithSearchOption_FiltersLogsByContent() 1068public async Task LogsCommand_WithSearchOption_MatchesAnsiStrippedContent() 1098public async Task LogsCommand_WithSearchOption_NoMatch_ReturnsEmptyLogs() 1125public async Task LogsCommand_WithSearchOption_MultipleWords_MatchesEachFragmentSeparately() 1159public async Task LogsCommand_WithSearchOption_QualifierSyntaxTreatedAsFreeText() 1191public async Task LogsCommand_PassesSnapshotFiltersToConsoleLogsRequest() 1223public async Task LogsCommand_PrefersBatchedConsoleLogsWhenAvailable() 1272public async Task LogsCommand_WithOldAppHost_FallsBackToClientSideSearchAndTail() 1308public async Task LogsCommand_AllResourcesSnapshot_UsesLegacyLogsRpc() 1358public async Task LogsCommand_AllResourcesFollow_UsesLegacyLogsRpc() 1401public async Task LogsCommand_FollowWithTailAndSearch_FiltersTailOutput() 1428public async Task LogsCommand_FollowWithSearch_FiltersExistingAndStreamedLogs() 1494await Task.CompletedTask; 1499Task allowLogs, 1500Task allowExit, 1528await Task.Yield(); 1659await Task.CompletedTask; 1672await Task.CompletedTask; 1685await Task.Yield();
Commands\LsCommandTests.cs (32)
26public async Task LsCommand_Help_Works() 41public async Task LsCommand_WhenNoCandidates_ReturnsSuccess() 59public async Task LsCommand_FormatOption_IsCaseInsensitive(string format) 74public async Task LsCommand_FormatOption_RejectsInvalidValue() 89public async Task LsCommand_JsonFormat_ReturnsCandidateAppHosts() 97FindAppHostProjectsAsyncCallback = (_, _, _) => Task.FromResult(new List<AppHostProjectCandidate> 138public async Task LsCommand_JsonFormat_WhenNoCandidates_ReturnsEmptyArray() 169public async Task LsCommand_JsonFormat_IncludesConfiguredAppHostOutsideWorkingDirectory() 209public async Task LsCommand_JsonFormat_OnlyJsonOnStdout_StatusMessagesOnStderr() 218FindAppHostProjectsAsyncCallback = (_, _, _) => Task.FromResult(new List<AppHostProjectCandidate> 252public async Task LsCommand_JsonFormat_NoResults_OnlyJsonOnStdout_StatusMessagesOnStderr() 284public async Task LsCommand_JsonFormat_Stream_ReturnsNewlineDelimitedCandidates() 335public async Task LsCommand_JsonFormat_Stream_WhenNoCandidates_DoesNotWriteStderr() 361public async Task LsCommand_JsonFormat_Stream_EmitsCandidatesInArrivalOrder() 413public async Task LsCommand_JsonFormat_Stream_FlushesCandidateBeforeDiscoveryCompletes() 460public async Task LsCommand_JsonFormat_Stream_WhenCancelled_DoesNotWriteProtocolEvent() 473await Task.Delay(Timeout.InfiniteTimeSpan, cancellationToken); 496public async Task LsCommand_StreamOption_RequiresJsonFormat() 516public async Task LsCommand_TableFormat_ColorsStatus() 524FindAppHostProjectsAsyncCallback = (_, _, _) => Task.FromResult(new List<AppHostProjectCandidate> 552public async Task LsCommand_TableFormat_InteractiveMode_ShowsSearchStatusAndFinalTable() 601public async Task LsCommand_TableFormat_InteractiveMode_RefreshesSearchStatusWithTimeProvider() 654await Task.Yield(); 667public async Task LsCommand_WhenCancelled_ReturnsSuccessAndDisplaysCancellation() 677return Task.FromCanceled<List<AppHostProjectCandidate>>(cancellationToken); 698public async Task LsCommand_DefaultsToFilteredScope() 707return Task.FromResult(new List<AppHostProjectCandidate>()); 727public async Task LsCommand_AllFlag_PassesAllFilesScope() 736return Task.FromResult(new List<AppHostProjectCandidate>()); 756public async Task LsCommand_EmitsProfilingActivities() 765FindAppHostProjectsAsyncCallback = (_, _, _) => Task.FromResult(new List<AppHostProjectCandidate> 831await Task.Yield();
Commands\McpCommandTests.cs (13)
14public async Task McpCommand_WithoutSubcommand_ReturnsInvalidCommand() 29public async Task McpCommandWithHelpArgumentReturnsZero() 43public async Task McpStartCommandWithHelpArgumentReturnsZero() 57public async Task McpCommandExistsInRootCommand() 71public async Task McpCommandHasStartSubcommand() 87public async Task McpCommandIsVisible() 101public async Task AgentCommand_WithoutSubcommand_ReturnsInvalidCommand() 116public async Task AgentCommandWithHelpArgumentReturnsZero() 130public async Task AgentMcpCommandWithHelpArgumentReturnsZero() 144public async Task AgentInitCommandWithHelpArgumentReturnsZero() 158public async Task AgentCommandExistsInRootCommand() 173public async Task AgentCommandHasMcpSubcommand() 189public async Task AgentCommandHasInitSubcommand()
Commands\NewCommandChannelResolutionTests.cs (31)
38public async Task NewCommand_DoesNotConsultGlobalConfigurationServiceForChannelKey() 81Task.FromResult<IEnumerable<NuGetPackage>>( 87GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([implicitChannel]) 136public async Task NewCommand_NoChannelArg_ResolvesTemplateFromIdentityChannel(string identityChannel, string identityChannelVersion, string? expectedVersion) 156public async Task NewCommand_NoChannelArg_DailyChannelWithoutExactCliVersion_PinsTemplateToCurrentCliVersion() 173public async Task NewCommand_NoChannelArg_PrChannelIdentity_ResolvesTemplateFromPrChannel() 196public async Task NewCommand_NoChannelArg_IdentityChannelNotRegistered_FallsBackToImplicit() 208public async Task NewCommand_CliRuntimeTemplate_LocalIdentityWithoutLocalChannel_Fails() 228public async Task NewCommand_CliRuntimeTemplate_UnqualifiedLocalIdentity_FindsExactVersionBelowNewerPinnedVersion() 244public async Task NewCommand_CliRuntimeTemplate_LocalIdentityWithSourceOverride_UsesSourceVersion() 260public async Task NewCommand_CliRuntimeTemplate_LocalIdentityWithVersionOverride_DefersChannelResolution() 279public async Task NewCommand_NoChannelArg_StagingIdentityWithStagingChannelRegistered_ResolvesTemplateFromStaging() 300public async Task NewCommand_ExplicitChannelArg_OverridesIdentityChannel() 319public async Task NewCommand_ExplicitPrereleaseChannel_PrefersCurrentCliVersionWhenAvailable(string channelName) 344public async Task NewCommand_ExplicitStableChannel_NonStableCliVersion_FallsBackToHighestShippedStable(string identityChannelVersion) 384public async Task NewCommand_DotNetRuntimeTemplate_NoChannelArg_ForwardsIdentityChannelToInputs(string identityChannel, string identityChannelVersion) 408public async Task NewCommand_DotNetRuntimeTemplate_NoChannelArg_StableIdentity_DoesNotForwardChannel() 420public async Task NewCommand_DotNetRuntimeTemplate_UnqualifiedLocalIdentity_DefersChannelResolution() 432public async Task NewCommand_DotNetRuntimeTemplate_LocalIdentityWithVersionOverride_DefersChannelResolution() 446public async Task NewCommand_DotNetRuntimeTemplate_LocalIdentityWithSourceOverride_DefersChannelResolution() 470public async Task NewCommand_DotNetRuntimeTemplate_NoChannelArg_IdentityChannelNotRegistered_FallsBackToNull() 491public async Task NewCommand_DotNetRuntimeTemplate_ExplicitChannelArg_OverridesIdentityChannel() 513public async Task NewCommand_DotNetRuntimeTemplate_VersionOverride_StillForwardsIdentityChannel() 583return Task.FromResult(new TemplateResult(CliExitCodes.Success, outputPath)); 635Task.FromResult<IEnumerable<NuGetPackage>>( 653Task.FromResult<IEnumerable<NuGetPackage>>( 703Task.FromResult<IEnumerable<NuGetPackage>>( 725Task.FromResult<IEnumerable<NuGetPackage>>( 742GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>(channels) 770Task.FromResult<IEnumerable<ITemplate>>([template]); 772Task.FromResult<IEnumerable<ITemplate>>([template]);
Commands\NewCommandTemplateConfigPersistenceTests.cs (12)
128public async Task ChannelPinningTemplate_IdentityNotRegistered_DoesNotPinChannel(string templateId, string _) 156public async Task ChannelPinningTemplate_IdentityMatchesRegisteredChannel_PinsThatChannel(string templateId, string _) 183public async Task ChannelPinningTemplate_ExplicitChannelArg_OverridesIdentityAndPersists(string templateId, string _) 203public async Task ChannelPinningTemplate_StagingIdentityWithRegisteredChannel_PinsStagingChannel(string templateId) 244public async Task NewTemplate_PrDogfoodInstallHiveDiscovered_UsesPrChannel(PrDogfoodNewTemplateCase testCase) 270Task.FromResult<IAppHostServerProject>(new FakeFailingAppHostServerProject(path)) 389Task.FromResult<IAppHostServerProject>(new FakeFailingAppHostServerProject(path)) 419Task.FromResult<IEnumerable<NuGetPackage>>( 427Task.FromResult<IEnumerable<NuGetPackage>>( 453Task.FromResult<IEnumerable<NuGetPackage>>( 470GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>(channels) 497Task.FromResult<IEnumerable<NuGetPackage>>(
Commands\NewCommandTests.cs (131)
32public async Task NewCommandWithHelpArgumentReturnsZero() 103public async Task NewCommand_CSharpEmptyTemplateUnderStagingIdentity_WritesStagingConfiguration() 123Task.FromResult<IEnumerable<NuGetPackage>>( 163public async Task NewCommandInteractiveFlowSmokeTest() 180public async Task NewCommandForwardsLocalizedTestFrameworkSelection(string testFramework, string? expectedTestFramework) 220public async Task NewCommandDerivesProjectNameFromTemplateNameForStarterTemplate() 259public async Task NewCommandDoesNotPromptForProjectNameIfSpecifiedOnCommandLine() 291public async Task NewCommandDoesNotPromptForOutputPathIfSpecifiedOnCommandLine() 323public async Task NewCommandWithChannelOptionUsesSpecifiedChannel() 356return Task.FromResult<IEnumerable<NuGetPackage>>([package]); 364return Task.FromResult<IEnumerable<NuGetPackage>>([package]); 370return Task.FromResult<IEnumerable<PackageChannel>>([stableChannel, dailyChannel]); 404public async Task NewCommandWithChannelOptionAutoSelectsHighestVersion() 442return Task.FromResult<IEnumerable<NuGetPackage>>(packages); 446return Task.FromResult<IEnumerable<PackageChannel>>([stableChannel]); 481public async Task NewCommandWithPrChannelPrefersCurrentCliVersion() 519return Task.FromResult<IEnumerable<NuGetPackage>>(packages); 523return Task.FromResult<IEnumerable<PackageChannel>>([prChannel]); 562public async Task NewCommandDoesNotPromptForTemplateIfSpecifiedOnCommandLine() 594public async Task NewCommandDoesNotPromptForTemplateVersionIfSpecifiedOnCommandLine() 626public async Task NewCommand_EmptyPackageList_DisplaysErrorMessage() 660public async Task NewCommand_WhenCertificateServiceThrows_ReturnsNonZeroExitCode() 699public async Task NewCommandWithExitCode73ShowsUserFriendlyError() 806public async Task NewCommandPromptsForTemplateVersionBeforeTemplateOptions() 871public async Task NewCommandEscapesMarkupInProjectNameAndOutputPath() 925public async Task NewCommandWithoutTemplateCanCreateTypeScriptEmptyTemplate() 967return Task.FromResult(true); 1006public async Task NewCommandWithoutTemplatePromptsWithSingleGenericEmptyTemplate() 1052public async Task NewCommandWithEmptyTemplateOmitsDisabledLanguagesFromLanguagePrompt() 1092public async Task NewCommandWithEmptyTemplatePromptsForEnabledLanguages() 1133return Task.FromResult(true); 1154public async Task NewCommandWithEmptyTemplateIgnoresConfiguredLanguage() 1196return Task.FromResult(true); 1211public async Task NewCommandWithExplicitLanguageAfterEmptyTemplateSubcommandCreatesTypeScriptAppHost() 1224return Task.FromResult(true); 1239public async Task NewCommandWithCSharpEmptyTemplateAndSourceOverrideUsesSourceForTemplateDiscovery() 1269return Task.FromResult<IEnumerable<NuGetPackage>>( 1287GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([channel]) 1304public async Task NewCommandWithCSharpEmptyTemplateAndRelativeLocalSourceOverrideDiscoversTemplatesFromResolvedDirectory() 1332GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([channel]) 1352public async Task NewCommandWithEmptyTemplateAndSourceOverridePersistsSourceForLaterRestore(string language, string? featureFlag, string scaffoldFileName) 1381return Task.FromResult(true); 1400public async Task NewCommandWithCSharpEmptyTemplateAndSourceOverridePersistsSourceForLaterRestore() 1423public async Task NewCommandWithCredentialBearingHttpSourceFailsBeforeCreatingProject(string sourceOverride) 1439return Task.FromResult(true); 1457public async Task NewCommandWithMissingLocalSourceFailsBeforeCreatingProject() 1473return Task.FromResult(true); 1492public async Task NewCommandWithEmptyTemplateWithoutSourceOverrideDoesNotWarn() 1507return Task.FromResult(true); 1524public async Task NewCommandWithExplicitJavaEmptyTemplateCreatesJavaAppHost() 1546return Task.FromResult(true); 1561public async Task NewCommandWithExplicitPythonEmptyTemplateCreatesPythonAppHost() 1582return Task.FromResult(true); 1597public async Task NewCommandWithExplicitCSharpEmptyTemplateCreatesCSharpAppHost() 1613public async Task NewCommandWaitsForBundleExtractionAfterCreatingAppHost() 1651public async Task NewCommandWithCSharpEmptyTemplateEmitsAppHostRunJsonAndAspireConfigJsonWithoutDuplicateProfiles() 1685public async Task NewCommandWithCSharpEmptyTemplateAndLocalhostTldEmitsAppHostRunJsonWithDevLocalhostUrls() 1731public async Task NewCommandWithEmptyTemplateAndCSharpPromptsForLocalhostTldAndUsesConfirmation() 1790public async Task NewCommandWithTypeScriptEmptyTemplateUsesScaffolding() 1802return Task.FromResult(true); 1816public async Task NewCommandWithTypeScriptEmptyTemplatePassesResolvedVersionAndChannelToScaffolding() 1833return Task.FromResult<IEnumerable<NuGetPackage>>([package]); 1837return Task.FromResult<IEnumerable<PackageChannel>>([stableChannel]); 1850return Task.FromResult(true); 1865public async Task NewCommandWithEmptyTemplateNormalizesDefaultOutputPath() 1890return Task.FromResult(true); 1912public async Task NewCommandWithEmptyTemplateAndTypeScriptPromptsForLocalhostTldAndUsesConfirmation() 1989public async Task NewCommandWithTypeScriptStarterGeneratesSdkArtifacts() 2029return Task.FromResult<IEnumerable<NuGetPackage>>([package]); 2034return Task.FromResult<IEnumerable<PackageChannel>>([dailyChannel]); 2049return Task.FromResult(true); 2066public async Task NewCommandWithTypeScriptStarterReturnsFailedToBuildArtifactsWhenSdkGenerationFails() 2104return Task.FromResult<IEnumerable<NuGetPackage>>([package]); 2109return Task.FromResult<IEnumerable<PackageChannel>>([dailyChannel]); 2115services.AddSingleton<IAppHostProjectFactory>(new TestTypeScriptStarterProjectFactory((directory, cancellationToken, _) => Task.FromResult(false))); 2129public async Task NewCommandWithTypeScriptStarterAndSourceOverridePersistsSourceAndPlumbsOverride() 2159return Task.FromResult<IEnumerable<NuGetPackage>>([package]); 2163return Task.FromResult<IEnumerable<PackageChannel>>([dailyChannel]); 2172return Task.FromResult(true); 2192public async Task NewCommandWithDotNetTemplateAndSourceOverridePersistsSourceForLaterRestore() 2236public async Task NewCommandWithTypeScriptStarterAndFailedRestoreDoesNotWarnAboutSourceOverride() 2270return Task.FromResult<IEnumerable<NuGetPackage>>([package]); 2274return Task.FromResult<IEnumerable<PackageChannel>>([dailyChannel]); 2279services.AddSingleton<IAppHostProjectFactory>(new TestTypeScriptStarterProjectFactory((directory, cancellationToken, _) => Task.FromResult(false))); 2295public async Task NewCommandNonInteractiveDoesNotPrompt() 2322public async Task NewCommandNonInteractive_WithSkillLocationsNone_DoesNotInstallAgentSkills() 2347public async Task NewCommandNonInteractive_WithSkillLocationsAndSkills_InstallsOnlySpecifiedSkills() 2375public async Task NewCommandNonInteractiveWithoutTemplate_DisplaysErrorWithAvailableTemplates() 2423public async Task NewCommandNonInteractiveUsesDefaultNameWhenNotProvided() 2467public async Task NewCommandNonInteractiveWithAllOptions_Succeeds() 2513public async Task NewCommandNonInteractiveWithAllOptions_SuppressAgentInitTrue_SkipsAgentInit() 2553public async Task NewCommand_WhenCSharpTemplateApplyFails_DisplaysCreationErrorMessage() 2601public async Task NewCommand_WhenTypeScriptTemplateApplyFails_ReturnsNonZeroExitCode() 2620return Task.FromResult(false); // Simulate failure for TypeScript template 2636public async Task NewCommandInExtensionModeAppendsProjectNameToOutputPath() 2647HasCapabilityAsyncCallback = (c, _) => Task.FromResult(c is "baseline.v1"), 2695public async Task NewCommandInExtensionModeDoesNotDoubleAppendProjectName() 2706HasCapabilityAsyncCallback = (c, _) => Task.FromResult(c is "baseline.v1"), 2754public async Task NewCommandInConsoleModeDoesNotAppendProjectName() 2811public async Task NewCommandInExtensionModeHandlesTrailingDirectorySeparator() 2815async Task AssertOutputPathAsync(Func<string, string> selectedPathFactory, Func<string, string> expectedPathFactory) 2826HasCapabilityAsyncCallback = (c, _) => Task.FromResult(c is "baseline.v1"), 2881public async Task NewCommandInExtensionModeAppendsProjectNameToCliTemplateOutputPath() 2894HasCapabilityAsyncCallback = (c, _) => Task.FromResult(c is "baseline.v1"), 2915return Task.FromResult(true); 2934public async Task NewCommandInExtensionModeValidatesAdjustedCliTemplateOutputPath() 2951HasCapabilityAsyncCallback = (c, _) => Task.FromResult(c is "baseline.v1"), 2978return Task.FromResult(true); 2998public async Task NewCommandInExtensionModeRetriesFolderPickerAfterProjectSubdirectoryCollision() 3014HasCapabilityAsyncCallback = (capability, _) => Task.FromResult( 3019return Task.FromResult(selectedParents.Dequeue()); 3024return Task.CompletedTask; 3079public async Task NewCommandInExtensionModePromptsBeforeFolderPickerForCliTemplateSubdirectory() 3107HasCapabilityAsyncCallback = (c, _) => Task.FromResult(c is "baseline.v1"), 3131return Task.FromResult(true); 3151public async Task NewCommandInExtensionModeUsesSelectedCliTemplateOutputPathWhenSubdirectoryDeclined() 3179HasCapabilityAsyncCallback = (c, _) => Task.FromResult(c is "baseline.v1"), 3200return Task.FromResult(true); 3220public async Task NewCommandInExtensionModeDoesNotDoubleAppendProjectNameToCliTemplateOutputPath() 3233HasCapabilityAsyncCallback = (c, _) => Task.FromResult(c is "baseline.v1"), 3254return Task.FromResult(true); 3273public async Task NewCommandNonInteractive_SuppressAgentInitTrue_SkipsAgentInit() 3299public async Task NewCommandNonInteractive_SuppressAgentInitFalse_RunsAgentInit() 3327public async Task NewCommandNonInteractive_NoSuppressAgentInitOption_DefaultsToRunAgentInit() 3355public async Task NewCommandRejectsExplicitOutputToNonEmptyDirectory() 3386public async Task NewCommandAllowsExplicitOutputToEmptyDirectory() 3404public async Task NewCommandDefaultOutputPathUsesUniqueProjectNameWhenDirectoryExists() 3440public async Task NewCommandRejectsExplicitOutputWithInvalidPathCharacters() 3468public async Task NewCommandCreatesProjectInCurrentDirectoryWithOutputDot() 3524public async Task NewCommandWhenChannelTemplateSearchFailsDisplaysFriendlyError() 3545GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([implicitChannel])
Commands\OperatingSystemCheckTests.cs (2)
12public async Task CheckAsync_ReturnsEnvironmentResultWithMetadata() 35public async Task CheckAsync_ReturnsWarningForUnknownOperatingSystem()
Commands\PsCommandTests.cs (25)
33public async Task PsCommand_Help_Works() 48public async Task PsCommand_WhenNoAppHostRunning_ReturnsSuccess() 67public async Task PsCommand_FormatOption_IsCaseInsensitive(string format) 85public async Task PsCommand_FormatOption_AcceptsTable(string format) 100public async Task PsCommand_FormatOption_RejectsInvalidValue() 115public async Task PsCommand_JsonFormat_ReturnsValidJson() 190public async Task PsCommand_JsonFormat_DisplaysSdkVersionFromV2AppHostInfo(string sdkVersion, string expectedSdkVersion) 222public async Task PsCommand_JsonFormat_UsesNullSdkVersionWhenUnknown() 261public async Task PsCommand_JsonFormat_DoesNotFetchSdkVersionFromV1Connection() 306public async Task PsCommand_JsonFormat_ReturnsAnonymousDashboardUrl() 350public async Task PsCommand_TableFormat_IncludesDashboardLoginTokenInDisplayedUrl() 394public async Task PsCommand_TableFormat_IncludesSdkVersionFromV2AppHostInfo() 427public async Task PsCommand_TableFormat_DisplaysDashWhenSdkVersionIsUnavailable() 467public async Task PsCommand_JsonFormat_NoResults_WritesEmptyArrayToStdout() 491public async Task PsCommand_JsonFormat_DoesNotShowScanningStatus() 527public async Task PsCommand_FollowJsonFormat_ReturnsSuccessWhenOutputCloses() 563public async Task PsCommand_FollowWithoutJsonFormat_ReturnsInvalidCommand() 579public async Task PsCommand_FollowJsonFormat_StreamsStoppedAppHostWhenConnectionIsRemoved() 637public async Task PsCommand_JsonFormat_IncludesLogFilePath() 677public async Task PsCommand_JsonFormat_IncludesLogFilePath_FromV2Override() 724public async Task PsCommand_JsonFormat_OmitsLogFilePath_WhenNull() 815return Task.FromResult(new AppHostInformation 830return Task.FromResult(new GetCapabilitiesResponse 841return Task.FromResult(new GetAppHostInfoResponse 853return Task.FromResult(new DashboardUrlsState
Commands\PublishCommandPromptingIntegrationTests.cs (51)
22public async Task PublishCommand_TextInputPrompt_SendsCorrectKeyPresses() 68public async Task PublishCommand_SecretTextPrompt_SendsCorrectKeyPresses() 114public async Task PublishCommand_ChoicePrompt_SendsCorrectSelection() 167public async Task PublishCommand_BooleanPrompt_SendsCorrectAnswer() 213public async Task PublishCommand_NumberPrompt_SendsCorrectNumericValue() 259public async Task PublishCommand_FilePrompt_RejectsMissingPathAndSendsFileMetadata() 302public async Task PublishCommand_FilePrompt_TreatsOptionalWhitespaceAsEmpty() 333public async Task PublishCommand_MultiplePrompts_HandlesSequentialInteractions() 408public async Task PublishCommand_SinglePromptWithMultipleInputs_HandlesAllInputs() 492public async Task PublishCommand_TextInputWithDefaultValue_UsesDefaultCorrectly() 544public async Task PublishCommand_TextInputWithValidationErrors_UsesValidationErrorsCorrectly() 599public async Task PublishCommand_MarkdownPromptText_ConvertsToSpectreMarkup() 670public async Task PublishCommand_DebugMode_HandlesPromptsWithoutProgressUI() 714public async Task PublishCommand_SingleInputPrompt_ShowsBothStatusTextAndLabel() 757public async Task PublishCommand_SingleInputPrompt_WhenStatusTextEqualsLabel_ShowsOnlyOnce() 798public async Task PublishCommand_FilePrompt_RejectsOversizedFileAndRePrompts() 845public async Task PublishCommand_FilePrompt_RejectsWrongExtensionAndRePrompts() 891public async Task PublishCommand_FilePrompt_SuccessfulUpload() 938public async Task FileInput_CompoundExtension_MatchesFilter() 977public async Task PublishCommand_UnsupportedInputType_FailsWithError() 1027public Task WaitForCompletion() => _completionSource.Task; 1072public Task CompletePromptResponseAsync(string promptId, PublishingPromptInputAnswer[] answers, CancellationToken cancellationToken) 1077public Task UpdatePromptResponseAsync(string promptId, PublishingPromptInputAnswer[] answers, CancellationToken cancellationToken) 1082private Task CompletePromptResponseCoreAsync(string promptId, PublishingPromptInputAnswer[] answers, bool updateResponse) 1091return Task.CompletedTask; 1095public Task RequestStopAsync(CancellationToken cancellationToken) => Task.CompletedTask; 1096public Task NotifyAppHostReadyAsync(CancellationToken cancellationToken) => Task.CompletedTask; 1098Task.FromResult(new DashboardUrlsState 1107await Task.CompletedTask; // Suppress CS1998 1112await Task.CompletedTask; // Suppress CS1998 1115public Task ConnectAsync(string socketPath, int retryCount, CancellationToken cancellationToken) => Task.CompletedTask; 1116public Task ConnectAsync(string socketPath, bool autoReconnect, int retryCount, CancellationToken cancellationToken) => Task.CompletedTask; 1117public Task WaitForDisconnectAsync(CancellationToken cancellationToken) => Task.CompletedTask; 1118public Task<string[]> GetCapabilitiesAsync(CancellationToken cancellationToken) => Task.FromResult(new[] { "baseline.v2" }); 1121Task.FromResult(new GetPipelineStepsResponse { Steps = [] }); 1126return Task.FromResult(new UploadFileResponse { FileId = "testfileid0000000000000000000000" }); 1171return Task.FromResult(response.response); 1174return Task.FromResult(binding?.DefaultValue ?? string.Empty); 1193return Task.FromResult(matchingChoice); 1197return Task.FromResult(choices.First()); 1211return Task.FromResult<IReadOnlyList<T>>(preSelected.ToList()); 1215return Task.FromResult<IReadOnlyList<T>>(choices.ToList()); 1230return Task.FromResult(bool.Parse(response.response)); 1233return Task.FromResult(defaultValue); 1256public Task DisplayLiveAsync(IRenderable initialRenderable, Func<Action<IRenderable>, Task> callback) => callback(_ => { });
Commands\PublishCommandTests.cs (9)
17public async Task PublishCommandWithHelpArgumentReturnsZero() 31public async Task PublishCommandFailsWithInvalidProjectFile() 60public async Task PublishCommandFailsWhenAppHostIsNotCompatible() 91public async Task PublishCommandFailsWhenAppHostBuildFails() 122public async Task PublishCommandFailsWhenAppHostCrashesBeforeBackchannelEstablished() 141await Task.Delay(100, cancellationToken); 165public async Task PublishCommandSucceedsEndToEnd() 242{ } callback => Task.FromResult(callback(publishers)), 243_ => Task.FromResult(publishers.First()) // Default to the first publisher if no callback is provided.
Commands\ResourceCommandHelperTests.cs (6)
16public async Task ExecuteGenericCommandAsync_WithResult_OutputsRawText() 53public async Task ExecuteGenericCommandAsync_WithoutResult_DoesNotCallDisplayMessage() 80public async Task ExecuteGenericCommandAsync_ErrorWithResult_OutputsRawText() 117public async Task ExecuteGenericCommandAsync_WithArguments_PassesArgumentsToBackchannel() 148public async Task ExecuteGenericCommandAsync_WithValidationErrors_DisplaysArgumentErrors() 186public async Task ExecuteGenericCommandAsync_WhenValidationErrorsIsNull_DisplaysCommandError()
Commands\ResourceCommandTests.cs (73)
23public async Task ResourceCommand_Help_Works() 38public async Task ResourceCommand_HelpShowsAvailableResourceCommandsMatchesSnapshot() 71public async Task ResourceCommand_HelpDoesNotPromptForOutOfScopeAppHostsMatchesSnapshot() 102public async Task ResourceCommand_HelpFallsBackToDefaultHelpWhenAvailableCommandsScanFails() 129public async Task ResourceCommand_HelpFallsBackToDefaultHelpWhenAvailableCommandsSnapshotFails() 152public async Task ResourceCommand_HelpWithAppHostDirectoryDoesNotPromptWhenMultipleAppHostsFound() 194public async Task ResourceCommand_HelpWithAppHostDoesNotPromptWhenMultipleRunningAppHostsMatch() 243public async Task ResourceCommand_HelpIncludesHiddenResourceCommandsWhenRequestedMatchesSnapshot() 270public async Task ResourceCommand_RequiresResourceArgument() 289public async Task ResourceCommand_RequiresResourceArgumentWhenCommandOptionsAreProvidedWithoutResource(string arguments) 306public async Task ResourceCommand_RequiresCommandArgument() 326public async Task ResourceCommand_RequiresCommandArgumentWhenCommandOptionsAreProvidedWithoutCommand(string arguments) 343public async Task ResourceCommand_AcceptsBothArguments() 357public async Task ResourceCommand_AcceptsProjectOption() 379public async Task ResourceCommand_AcceptsWellKnownCommandNames(string commandName) 402public async Task ResourceCommand_UsesWellKnownCommandDisplayMetadata(string commandName, string statusMessage, string successMessage) 432public async Task ResourceCommand_RoutesStatusToStderrAndResultToStdout() 475public async Task ResourceCommand_AcceptsProjectOptionWithStart() 489public async Task ResourceCommand_DoesNotUseWellKnownCommandMatchingWithDifferentCase() 515public async Task ResourceCommand_DoesNotBindPositionalArgumentsByName() 551public async Task ResourceCommand_DoesNotSendArgumentsWhenNoneProvided() 579public async Task ResourceCommand_ForwardsOptionEqualsArgumentsByName() 615public async Task ResourceCommand_ForwardsArgumentAfterDoubleDashThatCollidesWithCliOption() 653public async Task ResourceCommand_LegacyParameterCommandName_UsesCurrentCommandMetadata() 688public async Task ResourceCommand_DoesNotBindJsonLookingPositionalArgumentByName() 721public async Task ResourceCommand_DoesNotForwardPositionalArgumentContainingEqualsAsArray() 748public async Task ResourceCommand_DoesNotForwardExtraArgumentsAsArray() 775public async Task ResourceCommand_DoesNotInferOptionLookingArgumentsWithoutMetadata() 802public async Task ResourceCommand_DoesNotInferBareOptionWithoutMetadata() 829public async Task ResourceCommand_RemovesDelimiterWithoutMetadata() 849public async Task ResourceCommand_ForwardsOptionalArgumentsByName() 885public async Task ResourceCommand_DoesNotMatchCommandMetadataUsingDifferentCase() 913public async Task ResourceCommand_ForwardsKebabCaseEqualsAndBareBooleanArgumentsByName() 952public async Task ResourceCommand_ForwardsExplicitBooleanCommandOptionValues(string arguments, string expectedValue) 980public async Task ResourceCommand_ForwardsValidChoiceCommandOption() 1015public async Task ResourceCommand_ReturnsInvalidCommandForInvalidChoiceCommandOption() 1054public async Task ResourceCommand_ReturnsInvalidCommandForUnknownCommandOption() 1083public async Task ResourceCommand_GroupsUnknownCommandOptionValueWhenCommandMetadataIsMissing() 1107public async Task ResourceCommand_ReturnsInvalidCommandForInvalidBooleanCommandOptionValue() 1136public async Task ResourceCommand_ReturnsInvalidCommandForDisabledCommandOption() 1164public async Task ResourceCommand_DisplaysValidationErrorArgumentNamesAsCliOptions() 1207public async Task ResourceCommand_FailedExecution_DisplaysAppHostCliLogFilePath() 1245public async Task ResourceCommand_FailsWhenCommandUsesInteractionService() 1271public async Task ResourceCommand_ForwardsCustomChoiceCommandOptionWhenAllowed() 1307public async Task ResourceCommand_DoesNotSerializeOmittedCommandOptionDefaults() 1340public async Task ResourceCommand_ReturnsInvalidCommandForMissingCommandOptionValue(string arguments, string expectedOptionName) 1372public async Task ResourceCommand_ReturnsInvalidCommandForDuplicateCommandOptionUsingExactAndKebabAliases() 1402public async Task ResourceCommand_ReturnsInvalidCommandForDuplicateCommandOption() 1428public async Task ResourceCommand_ReturnsInvalidCommandForMissingRequiredCommandOption() 1460public async Task ResourceCommand_ReturnsInvalidCommandForMultipleMissingRequiredCommandOptions() 1493public async Task ResourceCommand_ReturnsInvalidCommandForInvalidNumberCommandOption() 1528public async Task ResourceCommand_DoesNotBindMixedNamedAndPositionalArgumentsByName() 1564public async Task ResourceCommand_ForwardsCommandOptionAfterDelimiterWhenNameCollidesWithCliOption() 1599public async Task ResourceCommand_ForwardsCommandOptionsAfterDelimiter() 1628public async Task ResourceCommand_IncludeHiddenExecutesHiddenResourceCommandWithMetadata() 1658public async Task ResourceCommand_DoesNotForwardCommandOptionWithoutDelimiterWhenNameCollidesWithCliOption() 1686public async Task ResourceCommand_ForwardsExactArgumentNameThatStartsWithNo() 1721public async Task ResourceCommand_LoadArgumentsWritesLoadedArgumentInputsAsJson() 1775public async Task ResourceCommand_LoadArgumentsDoesNotWriteJsonWhenArgumentInputsAreMissing() 1812public async Task ResourceCommand_LoadArgumentsReportsFallbackErrorWhenArgumentInputsAndMessageAreMissing() 1845public async Task ResourceCommand_LoadArgumentsAllowsPartialDynamicArguments() 1887public async Task ResourceCommand_ExecuteAllowsDynamicallyEnabledArguments() 1923public async Task ResourceCommand_DoesNotSynthesizeNegatedBooleanArgument() 1958public async Task ResourceCommand_ResourceOnlyHelpUsesDefaultHelp() 1977public async Task ResourceCommand_CommandSpecificHelpShowsArgumentInputs() 2019public async Task ResourceCommand_CommandSpecificHelpBeforeDelimiterShowsHelp() 2051public async Task ResourceCommand_HelpAfterDelimiterIsForwardedToResourceCommand() 2080public async Task ResourceCommand_CommandSpecificHelpShowsDelimiterForArgumentNamesThatCollideWithCliOptions() 2120public async Task ResourceCommand_CommandSpecificHelpShowsVisibleCliOptions() 2154public async Task ResourceCommand_CommandSpecificHelpDoesNotMarkDefaultedRequiredArgumentsAsRequired() 2186public async Task ResourceCommand_CommandSpecificHelpFallsBackToDefaultHelpWhenAppHostIsNotRunning() 2206public async Task ResourceCommand_CommandSpecificHelpFallsBackToDefaultHelpWhenCommandMetadataIsMissing() 2232public async Task ResourceCommand_CommandSpecificHelpForAllArgumentTypesMatchesSnapshot()
Commands\RestoreCommandTests.cs (2)
15public async Task RestoreCommand_WithDotNetAppHost_RunsDotNetRestore() 49public async Task RestoreCommand_WithDotNetAppHostAndMissingSdk_ReturnsSdkNotInstalled()
Commands\RootCommandTests.cs (25)
16public async Task RootCommandVersionOption_PrintsIdentityVersion_WhenIdentityOverridden() 41public async Task RootCommandVersionShortAlias_PrintsIdentityVersion_WhenIdentityOverridden() 64public async Task RootCommandVersionOption_IncludesCommitSha_WhenCommitProvided() 111public async Task RootCommandVersion_ProducesCorrectOutput_AcrossBuildStages( 142public async Task IdentityOverrideNotice_UsesDedicatedNoticePolicyInsteadOfGenericOverrideState(bool noticeRequired) 181public async Task RootCommandWithHelpArgumentReturnsZero() 195public async Task RootCommandWithNoLogoArgumentReturnsZero() 209public async Task CaptureProfileOptions_AreHiddenFromHelp() 303public async Task NoLogoEnvironmentVariable_ParsedCorrectly(string? value, bool expectedNoLogo) 328public async Task FirstTimeUseNotice_BannerDisplayedWhenSentinelDoesNotExist() 351public async Task FirstTimeUseNotice_BannerNotDisplayedWhenSentinelExists() 373public async Task FirstTimeUseNotice_BannerNotDisplayedWithNoLogoArgument() 395public async Task FirstTimeUseNotice_BannerNotDisplayedWithNoLogoEnvironmentVariable() 424public async Task Banner_DisplayedWhenExplicitlyRequested() 450public async Task Banner_CanBeInvokedMultipleTimes() 479public async Task Banner_DisplayedOnFirstRunAndExplicitRequest() 507public async Task Banner_TelemetryNoticeShownOnFirstRun() 530public async Task Banner_TelemetryNoticeNotShownOnSubsequentRuns() 556public async Task InformationalFlag_SuppressesBannerAndDoesNotCreateSentinel(string flag) 578public async Task InformationalFlag_DoesNotCreateSentinel_OnSubsequentFirstRun() 610public async Task MachineReadableCommand_SuppressesBannerAndDoesNotCreateSentinel(params string[] args) 634public async Task ArgumentsAfterDelimiter_DoNotSuppressFirstRunNotice(string appArg) 655public async Task BannerArgumentAfterDelimiter_DoesNotForceBanner() 676public async Task FirstTimeUseNotice_BannerNotDisplayedInNonInteractiveEnvironment() 697public async Task Banner_NotDisplayedWithExplicitBannerFlag_InNonInteractiveEnvironment()
Commands\RunCommandTests.cs (164)
43public async Task RunCommandWithHelpArgumentReturnsZero() 74public async Task RunCommand_RejectsLaunchProfileForUnsupportedAppHostType() 82Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 109public async Task RunCommand_DetachedRejectsLaunchProfileForUnsupportedAppHostBeforeStoppingOrLaunching() 117Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 153public async Task RunCommand_MissingExplicitLaunchProfileFallsBackToDotNet() 180Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 202public async Task RunCommand_ExistingUnsupportedOrMalformedLaunchProfileFallsBackToDotNet(string profile) 226Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 245public async Task RunCommand_PassesSelectedLaunchProfileToProjectContext() 252Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 261return Task.FromResult(42); 281public async Task RunCommand_RejectsInvalidStartupTimeoutEnvironmentVariable() 307public async Task RunCommand_WhenAppHostStartupTimesOut_DisplaysTimeoutGuidance() 321await Task.Delay(Timeout.InfiniteTimeSpan, ct); 325await Task.Delay(50, CancellationToken.None); 363public async Task RunCommand_WhenCancelledDuringStartupTimeout_ExitsWithoutWaitingForFullTimeout() 379Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 391await Task.Delay(TimeSpan.FromSeconds(30), CancellationToken.None); 424public async Task RunCommand_DetachedChild_WhenLauncherDiesBeforeReadiness_CancelsRun() 443Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 457await Task.Delay(Timeout.InfiniteTimeSpan, ct); 506public async Task RunCommand_DetachedChild_WhenLauncherDiesAfterBackchannelEstablished_DoesNotCancelRun() 531Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 617public async Task RunCommand_DetachedChild_WhenSignaledBeforeReadiness_AwaitsAppHostTeardownBeforeExit() 636Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 659await Task.Delay(Timeout.InfiniteTimeSpan, cancellationToken); 713public async Task RunCommand_StartupTimeoutBudgetIncludesBuildAndBackchannelWaits() 729await Task.Delay(Timeout.InfiniteTimeSpan, ct); 764public async Task RunCommand_WhenNoProjectFileFound_ReturnsNonZeroExitCode() 781public async Task RunCommand_WhenMultipleProjectFilesFound_NonInteractive_ReturnsFailedToFindProject() 812public async Task RunCommand_WhenMultipleProjectFilesFound_ReturnsNonZeroExitCode() 829public async Task RunCommand_WhenProjectFileDoesNotExist_ReturnsNonZeroExitCode() 887public async Task RunCommand_WhenExplicitAppHostCannotBeEvaluated_SurfacesMSBuildDiagnosticsAndBuildFailureExitCode() 913public async Task RunCommand_WhenConfiguredAppHostCannotBeEvaluated_SurfacesMSBuildDiagnosticsAndBuildFailureExitCode() 943public async Task RunCommand_WhenAmbientDiscoveryOnlyFindsUnbuildableAppHosts_ReportsProjectResolutionFailure() 976public async Task RunCommand_WhenExplicitAppHostCannotBeEvaluated_TagsRunActivityAsBuildFailure() 1002public async Task RunCommand_WhenUnverifiedAppHostBuildsButIsNotAnAppHost_FailsInsteadOfWaitingForBackchannel() 1043await Task.Delay(Timeout.InfiniteTimeSpan, ct); 1062public async Task RunCommand_WithDetachFlag_DoesNotShowUpdateNotification() 1083public async Task RunCommand_DetachedChild_DoesNotStartCliMetadataPrefetching() 1092Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 1122return Task.CompletedTask; 1156public async Task RunCommand_DetachedChild_PreservesOptionShapedLaunchProfileAndAppHostArguments(string launchProfileOption) 1174Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 1207public async Task RunCommand_WithoutDetachFlag_ShowsUpdateNotification() 1281public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null); 1285public async Task RunCommand_WhenCertificateServiceThrows_ReturnsNonZeroExitCode() 1317public async Task RunCommand_WhenBackchannelDisconnectsDuringStartup_WaitsForAppHostExitAndSurfacesWrappedError() 1334Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 1393public async Task RunCommand_WhenDashboardRpcHandlerFaultsButConnectionStaysAlive_SurfacesImmediatelyWithoutWaiting() 1410Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 1462public async Task RunCommand_WhenAppHostRunFaultsDuringStartup_ReturnsFailureExitCode() 1474Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 1491await Task.Delay(Timeout.InfiniteTimeSpan, ct); 1524public async Task RunCommand_DetachedEarlyExit_PropagatesExitCodeWithoutUnexpectedErrorWrapper() 1536Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 1549GetDashboardUrlsAsyncCallback = _ => Task.FromResult(new DashboardUrlsState { DashboardHealthy = true }) 1554await Task.Delay(50, cancellationToken); 1581public async Task RunCommand_WhenCancelledDuringStartupRpc_CompletesSuccessfully() 1594Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 1608return Task.FromCanceled<DashboardUrlsState>(ct); 1642public async Task RunCommand_WhenStartupRpcThrowsUnrelatedCancellationAfterUserCancellation_DoesNotTreatRunAsSuccessful() 1656Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 1671return Task.FromCanceled<DashboardUrlsState>(unrelatedCts.Token); 1705public async Task RunCommand_WhenAppHostExitsDuringStartup_DisplaysCapturedAppHostOutput() 1717Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 1734await Task.Delay(Timeout.InfiniteTimeSpan, ct); 1768public async Task RunCommand_WhenAppHostExitsBeforeBackchannelConnects_DisplaysCapturedAppHostOutput() 1789Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 1829public async Task RunCommand_WhenBackchannelFailsBeforeConnection_ReportsUnknownExitWithoutSentinel() 1841Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 1891public async Task RunCommand_WhenAppHostExitsDuringStartup_CancelsAndObservesLogCapture() 1903Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 1920await Task.Delay(Timeout.InfiniteTimeSpan, ct); 1957await Task.Delay(Timeout.InfiniteTimeSpan, cancellationToken); 2003public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null); 2028public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null); 2037await Task.Delay(1000, cancellationToken); 2052await Task.Yield(); 2057public async Task RunCommand_CompletesSuccessfully() 2088await Task.Delay(Timeout.InfiniteTimeSpan, ct); 2121public async Task RunCommand_InRemoteExtensionHost_DisplaysDashboardUrlsBeforeLiveEndpointDisplayCompletes() 2146await Task.Delay(Timeout.InfiniteTimeSpan, ct); 2189var completedTask = await Task.WhenAny(dashboardUrlsDisplayed.Task, Task.Delay(TimeSpan.FromSeconds(1))).DefaultTimeout(); 2203public async Task RunCommand_WhenAppHostReturnsCancelled_CompletesSuccessfully() 2215return Task.FromResult(CliExitCodes.Cancelled); 2227GetDashboardUrlsAsyncCallback = _ => Task.FromResult(new DashboardUrlsState 2246public async Task RunCommand_WithCaptureProfile_TreatsRequestedStopAsSuccess() 2277return Task.CompletedTask; 2295public async Task RunCommand_WithCaptureProfile_PreservesExitCodeWhenRunCompletesBeforeStop() 2309return Task.FromResult(123); 2338public async Task RunCommand_WithCaptureProfile_PropagatesFailureExitCodeAfterStop() 2371return Task.CompletedTask; 2389public async Task RunCommand_WithNoResources_CompletesSuccessfully() 2412await Task.Delay(Timeout.InfiniteTimeSpan, ct); 2484public async Task RunCommand_WhenDashboardFailsToStart_ContinuesWithWarning() 2493return Task.FromResult(new DashboardUrlsState 2520await Task.Delay(Timeout.InfiniteTimeSpan, ct); 2564public async Task AppHostHelper_BuildAppHostAsync_IncludesRelativePathInStatusMessage() 2590public async Task RunCommand_SkipsBuild_WhenBuildDotNetUsingCliCapabilityIsAvailable() 2595extensionBackchannel.GetCapabilitiesAsyncCallback = ct => Task.FromResult(new[] { "devkit" }); 2598appHostBackchannel.GetDashboardUrlsAsyncCallback = (ct) => Task.FromResult(new DashboardUrlsState 2623await Task.Delay(Timeout.InfiniteTimeSpan, ct); 2660public async Task RunCommand_SkipsBuild_WhenRunningInExtension_AndNoBuildInCliCapability() 2665extensionBackchannel.GetCapabilitiesAsyncCallback = ct => Task.FromResult(Array.Empty<string>()); 2668appHostBackchannel.GetDashboardUrlsAsyncCallback = (ct) => Task.FromResult(new DashboardUrlsState 2693await Task.Delay(Timeout.InfiniteTimeSpan, ct); 2730public async Task RunCommand_Builds_WhenExtensionHasBuildDotnetUsingCliCapability() 2736extensionBackchannel.GetCapabilitiesAsyncCallback = ct => Task.FromResult(new[] { "build-dotnet-using-cli" }); 2739appHostBackchannel.GetDashboardUrlsAsyncCallback = (ct) => Task.FromResult(new DashboardUrlsState 2762await Task.Delay(Timeout.InfiniteTimeSpan, ct); 2803public async Task RunCommand_WhenExtensionNoDebugBuildFails_DoesNotRunAppHost() 2809extensionBackchannel.HasCapabilityAsyncCallback = (capability, ct) => Task.FromResult(capability == KnownCapabilities.BuildDotnetUsingCli); 2825return Task.FromResult(0); 2857public async Task RunCommand_WhenExtensionBuildFails_WaitsForBuildOutputToFlush() 2865extensionBackchannel.HasCapabilityAsyncCallback = (capability, ct) => Task.FromResult(capability == KnownCapabilities.BuildDotnetUsingCli); 2932public async Task RunCommand_WhenSingleFileAppHostAndDefaultWatchEnabled_DoesNotUseWatchMode() 2953await Task.Delay(100, ct); 2989public async Task RunCommand_WhenDefaultWatchEnabledFeatureFlagIsTrue_UsesWatchMode() 3010await Task.Delay(100, ct); 3048public async Task RunCommand_WhenDefaultWatchEnabledFeatureFlagIsTrueAndBuildFails_ReturnsBuildFailure() 3066return Task.FromResult(0); 3101public async Task RunCommand_WhenDefaultWatchEnabledFeatureFlagIsFalse_DoesNotUseWatchMode() 3122await Task.Delay(100, ct); 3160public async Task RunCommand_WhenDefaultWatchEnabledFeatureFlagNotSet_DefaultsToFalse() 3181await Task.Delay(100, ct); 3219public async Task DotNetCliRunner_RunAsync_WhenWatchIsTrue_IncludesNonInteractiveFlag() 3267public async Task DotNetCliRunner_RunAsync_WhenWatchIsFalse_DoesNotIncludeNonInteractiveFlag() 3311public async Task DotNetCliRunner_RunAsync_WhenWatchIsTrueAndDebugIsTrue_IncludesVerboseFlag() 3359public async Task DotNetCliRunner_RunAsync_WhenWatchIsTrueAndDebugIsFalse_DoesNotIncludeVerboseFlag() 3402public async Task DotNetCliRunner_RunAsync_WhenWatchIsFalseAndDebugIsTrue_DoesNotIncludeVerboseFlag() 3446public async Task DotNetCliRunner_RunAsync_WhenWatchIsTrue_SetsSuppressLaunchBrowserEnvironmentVariable() 3490public async Task DotNetCliRunner_RunAsync_WhenWatchIsFalse_DoesNotSetSuppressLaunchBrowserEnvironmentVariable() 3539return Task.FromResult<List<AppHostProjectCandidate>>([new(appHostFile, "test")]); 3544return Task.FromResult<List<FileInfo>>([new FileInfo("/tmp/apphost.cs")]); 3549return Task.FromResult(new AppHostProjectSearchResult(new FileInfo("/tmp/apphost.cs"), [new FileInfo("/tmp/apphost.cs")])); 3555return Task.FromResult<FileInfo?>(new FileInfo("/tmp/apphost.cs")); 3558public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null); 3567public async Task RunCommand_WithNoBuildOption_SkipsBuildAndPassesNoBuildAndNoRestoreToRunner() 3596await Task.Delay(100, ct); 3628public async Task RunCommand_WithIsolatedOption_SetsRandomizePortsAndIsolatesUserSecrets() 3736public async Task RunCommand_WithNoBuildAndWatchModeEnabled_ReturnsInvalidCommandError() 3784public async Task CaptureAppHostLogsAsync_WritesCategoryWithAppHostPrefix() 3841await Task.CompletedTask; 3846public async Task CaptureAppHostLogsAsync_ConnectionLostException_TreatedAsNormalCompletion() 3880await Task.CompletedTask; 3902public async Task RunCommand_WhenDelegatingToExtension_CarriesAppHostSelectionOrigin(bool explicitAppHost, string expectedOrigin) 3948public async Task RunCommand_WhenRunningInExtension_ForwardsExplicitArgumentsInSemanticOrder() 4015public async Task RunCommand_WhenRunningInExtensionInLinkedWorktree_DoesNotInferIsolation() 4043public async Task RunCommand_WhenRunningInExtension_SynthesizesSeparatorBeforeDelimiterFreeAppHostArguments() 4081public async Task DelegatedCommands_RecordTransferStateOnlyAfterSuccessfulHandoff( 4090public async Task RunCommand_NonInteractive_SkipsExtensionDelegation() 4099extensionBackchannel.GetCapabilitiesAsyncCallback = ct => Task.FromResult(Array.Empty<string>()); 4102appHostBackchannel.GetDashboardUrlsAsyncCallback = (ct) => Task.FromResult(new DashboardUrlsState 4131await Task.Delay(Timeout.InfiniteTimeSpan, ct); 4167public async Task RunCommand_AllowsNoBuildInActiveExtensionDebugSession() 4173extensionBackchannel.GetCapabilitiesAsyncCallback = ct => Task.FromResult(Array.Empty<string>()); 4176appHostBackchannel.GetDashboardUrlsAsyncCallback = (ct) => Task.FromResult(new DashboardUrlsState 4206await Task.Delay(Timeout.InfiniteTimeSpan, ct); 4245public async Task RunCommand_RecordsRunAppHostTelemetryActivity(bool detached, bool isolated) 4292private async Task AssertProfileTransferAsync(
Commands\SdkCommandTests.cs (2)
14public async Task SdkCommand_WithoutSubcommand_ReturnsInvalidCommand() 29public async Task SdkCommandWithHelpArgumentReturnsZero()
Commands\SdkDumpCommandTests.cs (11)
24public async Task SdkDumpWithHelpReturnsZero() 59public async Task SdkDumpWithNonexistentCsprojReturnsFailedToFindProject() 74public async Task SdkDumpWithEmptyPackageNameReturnsInvalidCommand() 89public async Task SdkDumpWithEmptyVersionReturnsInvalidCommand() 104public async Task SdkDumpWithInvalidVersionFormatReturnsInvalidCommand() 119public async Task SdkDumpWithInvalidArgumentFormatReturnsInvalidCommand() 173public async Task SdkDumpWithOutputAndOutputDirectoryReturnsInvalidCommand() 188public async Task SdkDumpWithOutputDirectoryWithoutCiFormatReturnsInvalidCommand() 203public async Task SdkDumpWithOutputDirectoryWithoutIntegrationsReturnsInvalidCommand() 231public async Task SdkDumpWithDoubleAtSignReturnsInvalidCommand() 252using var result = RemoteExecutor.Invoke((Func<string, Task>)(async (baseDirectory) =>
Commands\SdkInstallerTests.cs (6)
15public async Task RunCommand_WhenSdkNotInstalled_ReturnsCorrectExitCode() 53public async Task AddCommand_WhenSdkNotInstalled_ReturnsCorrectExitCode() 78public async Task NewCommand_WhenSdkNotInstalled_OnlyShowsCliTemplates() 102public async Task PublishCommand_WhenSdkNotInstalled_ReturnsCorrectExitCode() 140public async Task DeployCommand_WhenSdkNotInstalled_ReturnsCorrectExitCode() 178public async Task RunCommand_WhenSdkInstalled_ContinuesNormalExecution()
Commands\SecretCommandTests.cs (9)
17public async Task SecretPathCommand_PrintsSecretsPath_ForDotNetAppHost() 43public async Task SecretPathCommand_PrintsSecretsPath_ForGuestAppHost() 90=> Task.FromResult<List<AppHostProjectCandidate>>([new(appHostFile, "test")]); 93=> Task.FromResult<List<FileInfo>>([appHostFile]); 96=> Task.FromResult<FileInfo?>(appHostFile); 99=> Task.FromResult<FileInfo?>(projectFile ?? appHostFile); 102=> Task.FromResult(new AppHostProjectSearchResult(projectFile ?? appHostFile, [projectFile ?? appHostFile])); 125public Task<string[]> GetDetectionPatternsAsync(CancellationToken cancellationToken = default) => Task.FromResult<string[]>([]); 126public Task<string?> GetUserSecretsIdAsync(FileInfo appHostFile, bool autoInit, CancellationToken cancellationToken) => Task.FromResult<string?>(userSecretsId);
Commands\StartCommandTests.cs (24)
26public async Task StartCommand_Help_Works() 41public async Task StartCommand_Help_ShowsStartDebugSessionOptionInExtensionContext() 63public async Task StartCommand_AcceptsNoBuildOption() 77public async Task StartCommand_AcceptsFormatOption() 91public async Task StartCommand_AcceptsIsolatedOption() 122public async Task StartCommand_RejectsLaunchProfileForUnsupportedAppHostBeforeStoppingOrLaunching() 130Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 166public async Task StartCommand_RejectsInvalidStartupTimeoutEnvironmentVariable() 212public async Task StartCommand_DetachedChild_PreservesOptionShapedLaunchProfileAndAppHostArguments(string launchProfileOption) 230Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 262public async Task StartCommand_WhenMultipleProjectFilesFound_NonInteractive_ReturnsNonZeroExitCode() 293public async Task StartCommand_WhenMultipleProjectFilesFound_JsonFormat_ReturnsNonZeroExitCode() 323public async Task StartCommand_LaunchFailure_DisplaysBothLogPaths() 337Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 379public async Task StartCommand_WhenRunningInExtension_ForwardsExplicitArgumentsInSemanticOrder() 449public async Task StartCommand_WhenRunningInExtensionWithoutAppHost_UsesDefaultDiscoverySelectionOrigin() 489public async Task StartCommand_WhenRunningInExtensionWithStartDebugSession_StartsVsCodeDebugSession() 517public async Task StartCommand_WhenRunningInExtensionInLinkedWorktree_DoesNotInferIsolation() 539public async Task StartCommand_WhenRunningInExtensionWithDebugSession_DoesNotStartVsCodeRunSession() 549Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 579public async Task StartCommand_WhenRunningInExtensionWithDetachedOnlyOption_DoesNotStartVsCodeRunSession(string commandTemplate) 589Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 756return Task.FromResult(true); 761return Task.FromResult(ExitCode);
Commands\StopCommandTests.cs (50)
30public async Task StopCommand_Help_Works() 45public async Task StopCommand_RejectsPositionalResourceArgument() 59public async Task StopCommand_WithInvalidExplicitAppHost_ReturnsFailedToFindProject() 81public async Task StopCommand_WithExplicitAppHost_UsesProjectLocatorResolution() 97return Task.FromResult(new AppHostProjectSearchResult(resolvedProjectFile, [resolvedProjectFile])); 117public async Task StopCommand_AllIncludesEachAppHostPathInMessages() 152public async Task StopCommand_AllIncludesProcessIdWhenAppHostPathsCollide() 189public async Task StopCommand_SingleAppHostIncludesIdentifierInStatusAndSuccessMessages() 222public async Task StopCommand_WithoutAppHost_DoesNotStopNestedLinkedWorktreeInstance() 275public async Task StopCommand_WithExplicitAppHostFileDoesNotUseProjectLocatorBeforeSocketLookup() 309public async Task StopCommand_SingleAppHostInDifferentWorktreeWithoutOverrideDoesNotPromptOrStop() 352public async Task StopCommand_SingleAppHostOutsideWorkingDirectoryInSameWorktreePromptsAndStops() 392public async Task StopCommand_AllEmitsProfilingActivities() 444public async Task StopCommand_NoRunningAppHosts_ReturnsSuccess(string commandLine) 469public async Task StopCommand_ForceInvokesDcpCleanupForResolvedAppHost() 503public async Task StopCommand_ForceInvokesDcpCleanupFromDiscoveredLayoutWhenBundleUnavailable() 516Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 535public async Task StopCommand_ForceWithoutAppHostUsesRunningAppHostPathBeforeProjectDiscovery() 559return Task.FromResult(new AppHostProjectSearchResult(discoveredAppHostFile, [discoveredAppHostFile])); 587public async Task StopCommand_ForceWithExplicitAppHostFileCleansUpWithoutProjectValidation() 619public async Task StopCommand_ForceNonInteractiveWithoutRunningAppHostFallsBackToProjectDiscovery() 632Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 654public async Task StopCommand_ForceNonInteractiveWithOnlyOutOfScopeAppHostsFallsBackToProjectDiscovery() 671Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 694public async Task StopCommand_ForceReturnsFailureWhenDcpCleanupFails() 710Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 729public async Task StopCommand_ForceWarnsAndCleansUpForUnsupportedNonBundleAppHost() 742Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 769public async Task StopCommand_ForceWarnsAndCleansUpWhenAppHostVersionCannotBeDetermined() 782Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 809public async Task StopCommand_ForceWarnsAndCleansUpWhenAppHostInfoCannotBeInspected() 822Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 848public async Task StopCommand_ForceSkipsCompatibilityWarningForGuestAppHost() 862Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 894public async Task StopCommand_ForceAllowsUnsupportedVersionWhenAppHostUsesCliBundle() 907Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 931public async Task StopCommand_ForceReturnsCleanupFailureWhenDcpCannotStart() 945(_, _, _) => Task.FromResult((0, (string?)null)), 954Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 976public async Task StopCommand_ForceReturnsCleanupFailureWhenBundleLayoutCannotBeAcquired() 988Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 1014public async Task StopCommand_ForceReturnsCleanupFailureWhenDcpCleanupThrowsUnexpectedException() 1026Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 1052public async Task StopCommand_ForceReturnsFailureWhenDcpIsUnavailable() 1064Task.FromResult(new AppHostProjectSearchResult(appHostFile, [appHostFile])) 1084public async Task StopCommand_ForceReportsUnknownAppHostPathAfterNormalStop() 1098Task.FromResult(new AppHostProjectSearchResult(null, [])) 1120public async Task StopCommand_ForceUsesStoppedConnectionPathForCleanupWhenProjectDiscoveryFails() 1158public async Task StopCommand_ForceAndAllAreMutuallyExclusive() 1180public async Task StopCommand_DeletesSocketFile_AfterSuccessfulStop()
Commands\TelemetryCommandTests.cs (10)
23public async Task TelemetryCommand_WithoutSubcommand_ReturnsInvalidCommand() 270public async Task TelemetryCommand_WithDashboardUrl_InvalidTelemetryApiResponse_DisplaysErrorMessage( 385public async Task ExchangeLoginTokenForApiKeyAsync_ReturnsApiKey_WhenResponseContainsKey() 402public async Task ExchangeLoginTokenForApiKeyAsync_ReturnsNullApiKey_WhenApiKeyIsNull() 419public async Task ExchangeLoginTokenForApiKeyAsync_ReturnsFailed_WhenUnauthorized() 433public async Task ExchangeLoginTokenForApiKeyAsync_ReturnsFailed_WhenNotFound() 447public async Task ExchangeLoginTokenForApiKeyAsync_ReturnsConnectionError_WhenConnectionFails() 460public async Task ExchangeLoginTokenForApiKeyAsync_ReturnsOther_WhenUnexpectedStatusCode() 474public async Task ExchangeLoginTokenForApiKeyAsync_SendsTokenAsJsonBody() 494public async Task ExchangeLoginTokenForApiKeyAsync_CallsCorrectUrl()
Commands\TelemetryLogsCommandTests.cs (17)
23public async Task TelemetryLogsCommand_WhenNoAppHostRunning_ReturnsSuccess() 41public async Task TelemetryLogsCommand_WithInvalidLimitValue_ReturnsInvalidCommand(int limitValue) 56public async Task TelemetryLogsCommand_TableOutput_ResolvesUniqueResourceNames() 88public async Task TelemetryLogsCommand_TableOutput_ResolvesReplicaResourceNames() 123public async Task TelemetryLogsCommand_TableOutput_StripsAnsiControlSequencesFromBody() 183public async Task TelemetryLogsCommand_WithDashboardUrl_FetchesLogsDirectly() 230public async Task TelemetryLogsCommand_WithDashboardUrlAndApiKey_SendsApiKeyHeader() 280public async Task TelemetryLogsCommand_WithDashboardUrlAndAppHost_ReturnsInvalidCommand() 303public async Task TelemetryLogsCommand_WithInvalidDashboardUrl_ReturnsInvalidCommand() 326public async Task TelemetryLogsCommand_WithDashboardUrl_401_DisplaysAuthFailedMessage() 364public async Task TelemetryLogsCommand_WithDashboardUrl_404WithReachableBase_DisplaysApiNotEnabledMessage() 407public async Task TelemetryLogsCommand_WithDashboardUrl_ConnectionRefused_DisplaysConnectionFailedMessage() 446public async Task TelemetryLogsCommand_WithLoginUrl_ConnectionRefused_DisplaysConnectionFailedMessage() 476public async Task TelemetryLogsCommand_WithDashboardUrl_ResourcesEndpoint404_DisplaysApiNotEnabledMessage() 516public async Task TelemetryLogsCommand_WithLoginUrl_NormalizesToBaseUrl() 573public async Task TelemetryLogsCommand_JsonOutput_ProducesExpectedJson() 672public async Task TelemetryLogsCommand_WithSearchOption_PassesSearchToUrl()
Commands\TelemetrySpansCommandTests.cs (11)
22public async Task TelemetrySpansCommand_WhenNoAppHostRunning_ReturnsSuccess() 40public async Task TelemetrySpansCommand_WithInvalidLimitValue_ReturnsInvalidCommand(int limitValue) 55public async Task TelemetrySpansCommand_TableOutput_ResolvesUniqueResourceNames() 87public async Task TelemetrySpansCommand_TableOutput_ResolvesReplicaResourceNames() 156public async Task TelemetrySpansCommand_WithDashboardUrl_FetchesSpansDirectly() 203public async Task TelemetrySpansCommand_WithDashboardUrlAndAppHost_ReturnsInvalidCommand() 226public async Task TelemetrySpansCommand_WithDashboardUrl_401_DisplaysAuthFailedMessage() 264public async Task TelemetrySpansCommand_WithDashboardUrl_ResourcesEndpoint404_DisplaysApiNotEnabledMessage() 304public async Task TelemetrySpansCommand_JsonOutput_ProducesExpectedJson() 411public async Task TelemetrySpansCommand_WithSearchOption_PassesSearchToUrl() 458public async Task TelemetrySpansCommand_WithDurationSearchFilter_PassesDurationFilterInSearchUrl()
Commands\TelemetryTracesCommandTests.cs (13)
24public async Task TelemetryTracesCommand_WhenNoAppHostRunning_ReturnsSuccess() 39public async Task TelemetryTracesCommand_WithDevLocalhostDashboardApiUrl_UsesLocalhost() 148public async Task TelemetryTracesCommand_WithDevLocalhostDashboardUrlArg_PreservesDisplayUrl() 237public async Task TelemetryTracesCommand_WithInvalidLimitValue_ReturnsInvalidCommand(int limitValue) 252public async Task TelemetryTracesCommand_TableOutput_ResolvesUniqueResourceNames() 300public async Task TelemetryTracesCommand_TableOutput_ResolvesReplicaResourceNames() 401public async Task TelemetryTracesCommand_WithDashboardUrl_FetchesTracesDirectly() 448public async Task TelemetryTracesCommand_WithDashboardUrlAndAppHost_ReturnsInvalidCommand() 471public async Task TelemetryTracesCommand_WithDashboardUrl_401_DisplaysAuthFailedMessage() 509public async Task TelemetryTracesCommand_JsonOutput_ProducesExpectedJson() 623public async Task TelemetryTracesCommand_JsonOutput_WithTraceIdAndNoTrace_ReturnsEmptyArray() 677public async Task TelemetryTracesCommand_WithSearchOption_PassesSearchToUrl() 724public async Task TelemetryTracesCommand_WithDurationSearchFilter_PassesDurationFilterInSearchUrl()
Commands\TerminalCommandTests.cs (17)
17public async Task TerminalCommand_Help_Works() 31public async Task TerminalCommand_WhenNoSubcommand_PrintsHelpAndFails() 47public async Task TerminalAttachCommand_WhenNoResourceArgument_FailsParsing() 61public async Task TerminalCommand_WhenNoAppHostRunning_ReturnsSuccess() 76public async Task TerminalCommand_WhenAppHostLacksTerminalsV1Capability_ReturnsAppHostIncompatible() 96public async Task TerminalCommand_WhenResourceNotFound_ReturnsInvalidCommand() 116public async Task TerminalCommand_WhenTerminalNotAvailable_ReturnsInvalidCommand() 141public async Task TerminalCommand_WhenReplicasArrayEmpty_ReturnsInvalidCommand() 166public async Task TerminalCommand_WhenReplicaIndexOutOfRange_ReturnsInvalidCommand() 207public async Task TerminalCommand_DisplayNameMatchesParentResource() 249public async Task TerminalCommand_NonInteractiveMultiReplicaWithoutFlag_ReturnsInvalidCommand() 294public async Task TerminalPsCommand_WhenNoAppHostRunning_ReturnsSuccess() 309public async Task TerminalPsCommand_WhenAppHostLacksTerminalsV1Capability_ReturnsAppHostIncompatible() 332public async Task TerminalPsCommand_WhenNoTerminalsRegistered_ReturnsSuccess() 355public async Task TerminalPsCommand_WhenTerminalsPresent_RendersTableSuccessfully() 401public async Task TerminalPsCommand_JsonFormat_WhenEmpty_EmitsEmptyArray() 447public async Task TerminalPsCommand_JsonFormat_Verbose_WhenPopulated_RoundTripsContract()
Commands\TypeScriptAppHostToolingCheckTests.cs (7)
28public async Task CheckAsync_ReturnsPass_WhenConfiguredToolchainIsAvailable(string packageManagerSpec, string toolchainName) 57public async Task CheckAsync_ReturnsFail_WhenConfiguredToolchainIsMissing( 97public async Task CheckAsync_ReturnsFailOnlyForMissingNpmCommand_WhenTheOtherIsPresent(string missingCommand) 119public async Task CheckAsync_Skips_WhenNoTypeScriptAppHostExists() 130public async Task CheckAsync_ReturnsFail_WhenPackageManagerIsYarnClassic() 151public async Task CheckAsync_ReturnsFail_WhenYarnClassicLockFileIsPresent() 186GetAppHostFromSettingsAsyncCallback = _ => Task.FromResult(appHostFile)
Commands\UpdateCommandTests.cs (169)
32public async Task UpdateCommandWithHelpArgumentReturnsZero() 64public async Task UpdateCommandFailsFastWhenNonInteractiveWithoutYes(string commandLine) 81public async Task UpdateCommand_WhenExplicitAppHostHasUnresolvableSdk_ReachesProjectUpdater() 114return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = true }); 133public async Task UpdateCommand_WhenProjectOptionSpecified_PassesProjectFileToProjectLocator() 147return Task.FromResult<FileInfo?>(projectFile); 159return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = false }); 249public async Task UpdateCommand_WhenNoProjectFound_PromptsForCliSelfUpdate() 295public async Task UpdateCommand_WhenProjectUpdatedSuccessfully_AndChannelSupportsCliDownload_PromptsForCliUpdate() 307return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 327return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = true }); 345return Task.FromResult<IEnumerable<PackageChannel>>(new[] { stableChannel }); 372public async Task UpdateCommand_GuestProject_WhenTargetSdkNewerThanCli_PromptsForCliUpdateBeforeProjectUpdateAndSkipsWhenAccepted() 396UseOrFindAppHostProjectFileAsyncCallback = (_, _, _) => Task.FromResult<FileInfo?>(new FileInfo(appHostPath)) 408return Task.FromResult(new UpdatePackagesResult { UpdatesApplied = true }); 415GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>( 436public async Task UpdateCommand_GuestProject_WhenTargetSdkNewerThanCliAndCliUpdateDeclined_ContinuesProjectUpdate() 448UseOrFindAppHostProjectFileAsyncCallback = (_, _, _) => Task.FromResult<FileInfo?>(new FileInfo(appHostPath)) 460return Task.FromResult(new UpdatePackagesResult { UpdatesApplied = true }); 474GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>( 491public async Task UpdateCommand_GuestProject_WhenChannelCannotDownloadCli_DoesNotPromptBeforeProjectUpdate() 503UseOrFindAppHostProjectFileAsyncCallback = (_, _, _) => Task.FromResult<FileInfo?>(new FileInfo(appHostPath)) 515return Task.FromResult(new UpdatePackagesResult { UpdatesApplied = true }); 529GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>( 546public async Task UpdateCommand_WhenProjectUpdatedSuccessfullyAndRunningAsDotnetTool_DisplaysDotnetToolUpdateCommand() 564return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 575return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = true }); 592return Task.FromResult<IEnumerable<PackageChannel>>(new[] { stableChannel }); 606return Task.FromResult(string.Empty); 623public async Task UpdateCommand_WhenProjectUpdatedSuccessfullyAndRunningAsCustomToolPathDotnetTool_DisplaysToolPathUpdateCommand() 643return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 654return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = true }); 671return Task.FromResult<IEnumerable<PackageChannel>>(new[] { stableChannel }); 685return Task.FromResult(string.Empty); 702public async Task UpdateCommand_WhenProjectUpdatedSuccessfullyAndRunningFromNpm_DisplaysNpmUpdateCommand() 720return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 731return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = true }); 748return Task.FromResult<IEnumerable<PackageChannel>>(new[] { stableChannel }); 762return Task.FromResult(string.Empty); 780public async Task UpdateCommand_WithoutAutoConfirmOption_UsesFalseConfirmationDefault() 793return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 803return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = false }); 823public async Task UpdateCommand_WithYesOption_ResolvesConfirmationFromCli() 836return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 846return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = false }); 866public async Task UpdateCommand_WhenChannelHasNoCliDownloadUrl_DoesNotPromptForCliUpdate() 877return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 896return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = true }); 914return Task.FromResult<IEnumerable<PackageChannel>>(new[] { prChannel }); 939public async Task UpdateCommand_WhenProjectUpdatedSuccessfully_AndMigrationPending_DisplaysAdvisory() 961return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 973return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = true }); 992return Task.FromResult<IEnumerable<PackageChannel>>(new[] { prChannel }); 1019public async Task UpdateCommand_WithMigrateFlagAndYes_AppliesPendingMigration() 1050public async Task UpdateCommand_WithMigrateFlag_WhenDeclined_DoesNotApplyMigration() 1082public async Task UpdateCommand_WithMigrateFlag_AndNothingPending_ReportsNothingToMigrate() 1119return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 1131return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = true }); 1150return Task.FromResult<IEnumerable<PackageChannel>>(new[] { prChannel }); 1160public async Task UpdateCommand_SelfUpdate_WhenRunningAsNativeAotDotnetTool_DisplaysDotnetToolUpdateCommand() 1182public async Task UpdateCommand_SelfUpdate_WhenRunningFromNpm_DisplaysNpmUpdateCommand() 1198return Task.FromResult(string.Empty); 1216public async Task UpdateCommand_SelfUpdate_WhenRunningFromNix_DisplaysNixUpdateGuidance() 1233return Task.FromResult(string.Empty); 1253public async Task UpdateCommand_WhenRunningFromNix_DisplaysNixUpdateGuidanceForSelfUpdateEntryPoints(NixSelfUpdateEntryPoint entryPoint) 1292return Task.FromResult(string.Empty); 1301UseOrFindAppHostProjectFileAsyncCallback = (_, _, _) => Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))) 1308return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = true }); 1313GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>( 1336UseOrFindAppHostProjectFileAsyncCallback = (_, _, _) => Task.FromResult<FileInfo?>(new FileInfo(appHostPath)) 1347return Task.FromResult(new UpdatePackagesResult { UpdatesApplied = true }); 1352GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>( 1379public async Task UpdateCommand_SelfUpdate_WhenRunningAsCustomToolPathDotnetTool_DisplaysToolPathUpdateCommand() 1404public async Task UpdateCommand_WhenNoProjectFoundAndRunningAsDotnetTool_DoesNotPromptForArchiveSelfUpdate() 1442public async Task UpdateCommand_SelfUpdate_WithChannelOption_DoesNotPromptForChannel() 1468return Task.FromResult(archivePath); 1488public async Task UpdateCommand_SelfUpdate_PersistsSelectedChannelInInstallSidecar() 1507DownloadLatestCliAsyncCallback = (_, _) => Task.FromResult(archivePath) 1530public async Task UpdateCommand_SelfUpdate_WhenSidecarUpdateFails_RestoresPreviousExecutable() 1551DownloadLatestCliAsyncCallback = (_, _) => Task.FromResult(archivePath) 1567public async Task UpdateCommand_SelfUpdate_WithQualityOption_DoesNotPromptForQuality() 1593return Task.FromResult(archivePath); 1612public async Task UpdateCommand_SelfUpdate_WithChannelOption_TracksChannelParameter() 1634return Task.FromResult(archivePath); 1653public async Task UpdateCommand_ProjectUpdate_WithChannelOption_DoesNotPromptForChannel() 1666return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 1686return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = true }); 1697return Task.FromResult<IEnumerable<PackageChannel>>(new[] { stableChannel, dailyChannel }); 1718public async Task UpdateCommand_ProjectUpdate_WithQualityOption_DoesNotPromptForChannel() 1731return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 1751return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = true }); 1762return Task.FromResult<IEnumerable<PackageChannel>>(new[] { stableChannel, dailyChannel }); 1783public async Task UpdateCommand_ProjectUpdate_WithInvalidQuality_DisplaysError() 1795return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 1816return Task.FromResult<IEnumerable<PackageChannel>>(new[] { stableChannel, dailyChannel }); 1840public async Task UpdateCommand_ProjectUpdate_ChannelTakesPrecedenceOverQuality() 1853return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 1873return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = true }); 1883return Task.FromResult<IEnumerable<PackageChannel>>(new[] { stableChannel, dailyChannel }); 1904public async Task UpdateCommand_ProjectUpdate_WhenCancelled_DisplaysCancellationMessage() 1930return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 1943return Task.FromResult<IEnumerable<PackageChannel>>(new[] { stableChannel }); 1962public async Task UpdateCommand_WithoutHives_UsesImplicitChannelWithoutPrompting() 1975return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 1995return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = false }); 2005return Task.FromResult<IEnumerable<PackageChannel>>(new[] { implicitChannel }); 2025public async Task UpdateCommand_LocalConfiguredChannel_IsUsed() 2044public async Task UpdateCommand_GlobalConfiguredChannel_IsUsed() 2065public async Task UpdateCommand_ExplicitChannelOverridesConfiguredChannel() 2083public async Task UpdateCommand_LocalConfiguredChannel_OverridesGlobalConfiguredChannel() 2105public async Task UpdateCommand_WithoutHives_ConfiguredChannel_TakesPrecedenceOverImplicitFallback() 2127public async Task UpdateCommand_ConfiguredChannelNotInChannelList_ThrowsChannelNotFound() 2142return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 2157return Task.FromResult<IEnumerable<PackageChannel>>(new[] 2176public async Task UpdateCommand_ChannelStagingRequestedButPackagingServiceReportsUnavailable_SurfacesStagingReason() 2195Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))) 2215return Task.FromResult<IEnumerable<PackageChannel>>(new[] 2241public async Task UpdateCommand_ProjectInOtherDirectory_UsesProjectLocalConfiguredChannel() 2263public async Task UpdateCommand_ProjectInOtherDirectory_UsesNearestParentConfiguredChannelWhenProjectDirectoryHasNoConfig() 2288public async Task UpdateCommand_ProjectInOtherDirectory_PrefersProjectLocalConfigOverCwdConfig() 2315public async Task UpdateCommand_ProjectInOtherDirectory_ProjectLocalConfigWithoutChannel_FallsBackToGlobalConfig() 2345public async Task UpdateCommand_WithHivesAndConfiguredChannel_DoesNotPromptForSelection() 2368public async Task UpdateCommand_WithHivesAndLocallyConfiguredChannel_DoesNotPromptForSelection() 2392public async Task UpdateCommand_WithHives_PromptOffersChannelsInPackagingServiceOrder() 2416return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 2436return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = false }); 2449return Task.FromResult<IEnumerable<PackageChannel>>(new[] { implicitChannel, stableChannel, dailyChannel, hiveChannel }); 2496public async Task UpdateCommand_WhenAppHostSdkVersionUnresolvable_UsesSettingsLookup() 2511return Task.FromResult<FileInfo?>(resolved); 2518return Task.FromResult<FileInfo?>(null); 2561public async Task UpdateCommand_WhenStagingIdentityRegistersChannel_UsesStagingForUnpinnedProject() 2587return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 2608return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = false }); 2626public async Task UpdateCommand_WhenAppHostOutsideLaunchDirectoryConfiguresStaging_UsesStagingFromRealPackagingService() 2645UseOrFindAppHostProjectFileAsyncCallback = (_, _, _) => Task.FromResult<FileInfo?>(appHostFile) 2661return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = false }); 2682public async Task UpdateCommand_WhenIdentityChannelMatchesRegisteredChannel_UsesItWithoutPrompting(string identityChannel, string expectedChannelName) 2703public async Task UpdateCommand_WhenIdentityChannelIsLocal_StillPromptsWhenHivesExist() 2725public async Task UpdateCommand_WhenIdentityChannelHasNoMatchingChannel_FallsThroughToPrompt() 2745public async Task UpdateCommand_ExplicitChannelFlagOverridesIdentityChannel() 2766public async Task UpdateCommand_PerProjectConfigChannelOverridesIdentityChannel() 2828return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(projectDirectory.FullName, "AppHost.csproj"))); 2848return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = false }); 2882return Task.FromResult<IEnumerable<PackageChannel>>(channels); 2897public async Task UpdateCommand_SelfUpdate_WhenCancelled_DisplaysCancellationMessage() 2938public async Task UpdateCommand_SelfUpdate_WhenStagingFeatureFlagDisabled_DoesNotShowStagingChannel() 2961return Task.FromResult(archivePath); 2981public async Task UpdateCommand_SelfUpdate_WhenStagingFeatureFlagEnabled_ShowsStagingChannel() 3006return Task.FromResult(archivePath); 3026public async Task UpdateCommand_SelfUpdate_WhenIdentityChannelIsStaging_ShowsStagingChannel() 3051return Task.FromResult(archivePath); 3071public async Task UpdateCommand_SelfOption_IsAvailableAndParseable() 3084return Task.FromResult(archivePath); 3100public async Task UpdateCommand_NonInteractive_WithYesAndChannel_SucceedsWithoutPrompting() 3115return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 3141return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = false }); 3151return Task.FromResult<IEnumerable<PackageChannel>>([stableChannel, dailyChannel]); 3175public async Task UpdateCommand_SelfUpdate_NonInteractive_WhenIdentityChannelMatchesKnownChannel_UsesItWithoutPrompting(string identityChannel, string expectedChannel) 3187public async Task UpdateCommand_SelfUpdate_NonInteractive_WhenIdentityChannelIsLocal_DefaultsToStable() 3199public async Task UpdateCommand_SelfUpdate_NonInteractive_WhenIdentityChannelIsStalePr_RequiresExplicitChannel() 3215public async Task UpdateCommand_SelfUpdate_ExplicitChannelOverridesIdentityChannel() 3227public async Task UpdateCommand_SelfUpdate_NonInteractive_WhenIdentityChannelIsStalePr_ExplicitChannelSucceeds() 3271return Task.FromResult(archivePath); 3416public async Task UpdateCommand_SelfUpdate_DoesNotWriteChannelToGlobalConfiguration(string commandLine) 3437return Task.FromResult(archivePath); 3466Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>( 3552public Task DisplayLiveAsync(IRenderable initialRenderable, Func<Action<IRenderable>, Task> callback) => _innerService.DisplayLiveAsync(initialRenderable, callback); 3568return Task.FromResult(new ProjectUpdateResult { UpdatedApplied = false });
Commands\VsCodeExtensionCheckTests.cs (3)
13public async Task CheckAsync_ReturnsEmpty_WhenVsCodeNotInstalled() 28public async Task CheckAsync_ReturnsWarning_WhenExtensionMissing() 57public async Task CheckAsync_ReturnsPass_WhenExtensionInstalled()
Commands\WaitCommandTests.cs (14)
16public async Task WaitCommand_Help_Works() 31public async Task WaitCommand_RequiresResourceArgument() 46public async Task WaitCommand_AcceptsResourceArgument() 60public async Task WaitCommand_AcceptsProjectOption() 74public async Task WaitCommand_AcceptsStatusOption() 88public async Task WaitCommand_AcceptsTimeoutOption() 105public async Task WaitCommand_AcceptsAllStatusValues(string status) 122public async Task WaitCommand_StatusIsCaseInsensitive(string status) 136public async Task WaitCommand_ResourceNotFound_ReturnsFailure() 166public async Task WaitCommand_ResourceRunning_WaitForUp_ReturnsSuccess() 191public async Task WaitCommand_ResourceHealthy_WaitForHealthy_ReturnsSuccess() 216public async Task WaitCommand_Timeout_ReturnsTimeoutExitCode() 246public async Task WaitCommand_ResourceExited_WaitForDown_ReturnsSuccess() 271public async Task WaitCommand_ResourceFailedToStart_WaitForUp_ReturnsFailure()
Commands\WslEnvironmentCheckTests.cs (18)
290public async Task CheckAsync_ReportsNothing_WhenNotLinux() 301public async Task CheckAsync_ReportsNothing_WhenLinuxIsNotWsl(string? distroName) 314public async Task CheckAsync_ReportsNothing_WhenWslInteropIsBlank(string wslInterop) 326public async Task CheckAsync_ReportsNothing_WhenOnlyBuildMetadataMentionsWsl(string procVersion) 338public async Task CheckAsync_ReportsNothing_ForUnofficialKernelReleaseSuffixes_WhenWslDistroNameIsNotSet(string procVersion) 348public async Task CheckAsync_ReportsNothing_ForUnofficialKernelReleasePrefixes_WhenWslDistroNameIsNotSet(string procVersion) 357public async Task CheckAsync_ReportsPass_WhenWsl2IsDetected( 370public async Task CheckAsync_ReportsWarning_ForWsl1() 381public async Task CheckAsync_ReportsWarning_ForHistoricalWsl1Banner() 393public async Task CheckAsync_ReportsWarning_ForWsl1Banners_WhenWslDistroNameOrWslInteropIsSet( 411public async Task CheckAsync_ReportsPass_ForUnofficialKernelReleaseSuffixes_WhenWslDistroNameIsSet(string procVersion) 429public async Task CheckAsync_ReportsPass_ForUnofficialKernelReleasePrefixes_WhenWslDistroNameIsSet(string procVersion) 447public async Task CheckAsync_ReportsPass_ForCustomKernelWithoutMarkers_WhenWslDistroNameIsSet(string procVersion) 462public async Task CheckAsync_ReportsPass_ForUnofficialKernelReleaseSuffixes_WhenWslInteropIsSet(string procVersion) 480public async Task CheckAsync_ReportsPass_ForUnofficialKernelReleasePrefixes_WhenWslInteropIsSet(string procVersion) 498public async Task CheckAsync_ReportsPass_ForCustomKernelWithoutMarkers_WhenWslInteropIsSet(string procVersion) 512public async Task CheckAsync_ReportsWarning_WhenBannerIsMissingOrUnreadableAndWslIsDetected( 531public async Task CheckAsync_ReportsPass_ForLegacyMicrosoftWsl2StandardKernel(string? distroName)
Configuration\ConfigurationServiceTests.cs (16)
40public async Task SetConfigurationAsync_WorksWithJsonComments() 63public async Task SetConfigurationAsync_WorksWithTrailingCommas() 85public async Task SetConfigurationAsync_WorksWithCommentsAndTrailingCommas() 107public async Task SetConfigurationAsync_CreatesNewFile_WhenNoneExists() 125public async Task SetConfigurationAsync_HandlesEmptyFile() 138public async Task DeleteConfigurationAsync_WorksWithJsonComments() 161public async Task DeleteConfigurationAsync_ReturnsFalse_WhenFileDoesNotExist() 173public async Task DeleteConfigurationAsync_ReturnsFalse_WhenFileIsEmpty() 185public async Task GetAllConfigurationAsync_ParsesCommentsCorrectly() 208public async Task GetConfigurationFromDirectoryAsync_WithContinueSearchWhenKeyMissing_WalksUpWhenNearestConfigDoesNotContainKey() 239public async Task GetConfigurationFromDirectoryAsync_WhenNearestConfigDoesNotContainKey_DoesNotReadParentConfig() 266public async Task GetConfigurationFromDirectoryAsync_FindsNearestParentConfigWhenStartDirectoryHasNoConfig() 286public async Task SetConfigurationAsync_SetsNestedValues() 300public async Task SetConfigurationAsync_WritesBooleanStringAsJsonString() 322public async Task SetConfigurationAsync_ChannelWithBooleanLikeValue_StaysAsString() 345public async Task SetConfigurationAsync_WritesStringValueAsString()
Configuration\DotNetBasedAppHostServerChannelResolutionTests.cs (5)
26public async Task DotNetBasedAppHostServerProject_CreateProjectFiles_ReturnsNullChannel_WhenNoPerProjectChannelAndOnlyImplicit() 43public async Task DotNetBasedAppHostServerProject_CreateProjectFiles_HonorsAspireConfigJson() 61public async Task DotNetBasedAppHostServerProject_CreateProjectFiles_FallsBackToLegacyAspireSettings_WhenAspireConfigJsonMissing() 83public async Task DotNetBasedAppHostServerProject_CreateProjectFiles_PrefersAspireConfigJsonOverLegacyAspireSettings() 139return Task.FromResult<IEnumerable<PackageChannel>>(channels);
ConsoleCancellationManagerTests.cs (17)
45public async Task FirstSignal_DefaultZeroBudget_ExpiresGracefulImmediately() 61public async Task FirstSignal_NonZeroBudget_DelaysExpireUntilBudgetElapses() 89public async Task SecondSignal_ExpiresGracefulImmediately() 113await Task.Delay(100); 118public async Task AdditionalSignals_AfterSecond_AreIgnored() 134await Task.Delay(100); 139public async Task FirstSignal_HandlerCompletesWithinDrainBudget_DoesNotForceTermination() 144manager.SetStartedHandler(Task.FromResult(0)); 149await Task.Delay(100); 156public async Task FirstSignal_HandlerExceedsDrainBudget_ForcesTermination() 170public async Task FirstSignal_WithNoHandler_ForcesTerminationAfterDrainBudget() 182public async Task GracefulBudgetElapses_ThenDrainBudgetElapses_FiresProcessTermination() 212public async Task ProcessTermination_FiresGracefulExpiration_LaddersUnblock() 218var ladderTask = Task.Run(async () => 222await Task.Delay(TimeSpan.FromMinutes(5), gracefulToken); 353public async Task BeginGracefulWindow_PositiveBudget_FiresTokenAfterBudget() 375public async Task BeginGracefulWindow_SecondCall_DoesNotResetTimer()
DotNet\DotNetCliRunnerTests.cs (66)
42public async Task DotNetCliCorrectlyAppliesNoLaunchProfileArgumentWhenSpecifiedInOptions() 91public async Task RunAsyncAppliesSelectedLaunchProfile(string appHostFileName, bool watch) 130public async Task RunAsyncPreservesApplicationArgumentBoundaries() 164public async Task RunAppHostCommandAsyncUsesNativeCommandWithoutRunDelimiter() 206public async Task RunAppHostCommandAsyncResolvesDotnetMuxerCommand() 247public async Task BuildAsyncDoesNotInjectDotnetCliUseMsBuildServerEnvironmentVariable() 275public async Task BuildAsyncPassesCurrentAspireCliPathToMSBuild() 377public async Task RestoreAsyncRunsDotnetRestoreCommand() 405public async Task BuildAsyncDoesNotInjectConfiguredDotnetCliUseMsBuildServer() 442public async Task BuildAsyncIncludesNoRestoreFlagWhenNoRestoreIsTrue() 471public async Task BuildAsyncDoesNotIncludeNoRestoreFlagWhenNoRestoreIsFalse() 500public async Task BuildAsyncAddsBinlogWhenBinlogDirectoryIsConfigured() 541public async Task NewProjectAsyncDoesNotAddBinlogWhenBinlogDirectoryIsConfigured() 573public async Task RunAsyncDoesNotInjectDotnetCliUseMsBuildServerWhenNoBuildIsFalse() 610public async Task RunAsyncDoesNotInjectDotnetCliUseMsBuildServerWhenNoBuildIsTrue() 651public async Task RunAsyncPreservesExistingEnvironmentVariables() 696public async Task RunAsyncPropagatesProcessProfilingContextToChildEnvironment() 749public async Task RunAsyncParentsBackchannelConnectToRunOperationInsteadOfDotnetProcess() 816public async Task NewProjectAsyncReturnsExitCode73WhenProjectAlreadyExists() 848public async Task RunAsyncSetsVersionCheckDisabledWhenUpdateNotificationsFeatureIsDisabled() 888public async Task RunAsyncDoesNotSetVersionCheckDisabledWhenUpdateNotificationsFeatureIsEnabled() 930public async Task RunAsyncDoesNotOverrideUserProvidedVersionCheckDisabledValue() 977public async Task RunAsyncKeepsExtensionLaunchedAppHostAliveUntilBackchannelDisconnects() 1005HasCapabilityAsyncCallback = (c, _) => Task.FromResult(c is "devkit" or "project"), 1032var completedTask = await Task.WhenAny(runTask, Task.Delay(TimeSpan.FromMilliseconds(100), TestContext.Current.CancellationToken)); 1040public async Task RunAsyncFailsBackchannelWhenExtensionLaunchedAppHostDoesNotConnectBeforeTimeout() 1056HasCapabilityAsyncCallback = (c, _) => Task.FromResult(c is "devkit" or "project"), 1086public async Task RunAsyncFailsBackchannelWhenAppHostExitsWithSuccessBeforeBackchannelConnects() 1128public async Task RunAsyncFailsBackchannelWithExitCodeWhenAppHostExitsUnexpectedlyBeforeBackchannelConnects() 1170public async Task AddPackageAsyncUseFilesSwitchForSingleFileAppHost() 1223public async Task AddPackageAsyncUsesPositionalArgumentForCsprojFile() 1290public async Task AddPackageAsyncUsesPositionalArgumentForCsprojFileWithNoRestore() 1356public async Task AddPackageAsyncWithSourceAndNoRestoreHasArgumentSourceAndNoRestore() 1427public async Task GetSolutionProjectsAsync_ParsesOutputCorrectly() 1475public async Task AddProjectReferenceAsync_ExecutesCorrectCommand() 1509public async Task RunAsyncAppliesNoLaunchProfileForSingleFileAppHost() 1556public async Task RunAsyncDoesNotIncludeNoLaunchProfileForSingleFileAppHostWhenNotSpecified() 1602public async Task RunAsyncSuppressesCliRunHookForProjectAppHost() 1639public async Task RunAsyncSuppressesCliRunHookForSingleFileAppHost() 1676public async Task RunAsyncDoesNotIncludeNoBuildFlagForSingleFileAppHostWhenNoBuildIsTrue() 1717public async Task RunAsyncFiltersOutEmptyAndWhitespaceArguments() 1762public async Task RunAsyncFiltersOutEmptyArgumentsForSingleFileAppHost() 1814public async Task RunAsyncIncludesAllNonEmptyFlagsWhenEnabled() 1863public async Task RunAsyncCorrectlyHandlesWatchWithoutDebug() 1911public async Task GetProjectItemsAndPropertiesAsync_UsesBuild_ForSingleFileAppHost() 1948public async Task GetProjectItemsAndPropertiesAsyncSuppressesCliRunHook() 1983public async Task GetAppHostInformationAsync_UsesAspireHostingAppHostPackageVersion() 2026public async Task GetAppHostInformationAsync_UsesAspireHostingAppHostCentralPackageVersion() 2068public async Task GetProjectItemsAndPropertiesAsync_UsesMsBuild_ForCsProjFile() 2108public async Task GetProjectItemsAndPropertiesAsync_EmitsTargetSwitch_WhenTargetsRequested() 2147public async Task ComputeRunArgumentsPopulatesRunPropertiesForSdkProject() 2193public async Task GetProjectItemsAndPropertiesAsync_OmitsTargetSwitch_WhenNoTargetsRequested() 2229public async Task SearchPackagesAsyncRetriesOnFailureAndSucceedsOnSecondAttempt() 2276public async Task SearchPackagesAsyncRetriesMaxTimesAndReturnsFailure() 2318public async Task SearchPackagesAsyncSucceedsOnFirstAttemptWithoutRetry() 2360public async Task SearchPackagesAsync_WithExactMatch_UsesExactMatchFlagWithoutPaginationArguments() 2411public async Task InstallTemplateAsync_UsesLocalPackagePathForLocalFolderSource() 2484public async Task RunAsyncIncludesNoBuildFlagWhenNoBuildIsTrue() 2522public async Task RunAsyncDoesNotIncludeNoBuildFlagWhenNoBuildIsFalse() 2560public async Task RunAsyncIncludesNoRestoreFlagWhenNoRestoreIsTrueAndNoBuildIsFalse() 2599public async Task RunAsyncDoesNotIncludeNoRestoreFlagWhenNoBuildIsTrue() 2639public async Task RunAsyncSetsCliLogFilePathEnvironmentVariable() 2703return Task.FromResult(true); 2706public Task<int> WaitForExitAsync(CancellationToken cancellationToken) => Task.FromResult(exitCode);
DotNet\ProcessExecutionDetachedTests.cs (24)
29public async Task StartAsync_OnWindows_WithSharedStdoutStderrHandle_Succeeds() 48public async Task StartAsync_OnUnix_InvokesDcpForkProcessWithExpectedContext() 130public async Task StartAsync_OnUnix_ReturnsForkedProcessWhenCancelledAfterDcpStarts() 212public async Task StartAsync_OnUnix_DcpForkProcessStderrDoesNotBlockSuccessfulLaunch() 250public async Task StartAsync_OnUnix_ReturnsMonitorExitCodeWhenForkedProcessAlreadyExited() 302public async Task StartAsync_OnUnix_PassesBundleLeaseEnvironmentToDcp() 358public async Task StartAsync_OnUnix_KeepsBundleLeaseUntilExecutionIsDisposed() 408public async Task DisposeAsync_OnUnix_WaitsForStartResolutionBeforeDisposing() 454var disposeTask = detachedProcess.DisposeAsync().AsTask(); 455await Task.Delay(TimeSpan.FromMilliseconds(200)); 472private static async Task WaitForFileAsync(string path) 476await Task.Delay(TimeSpan.FromMilliseconds(50)); 539public Task EnsureExtractedAsync(CancellationToken cancellationToken = default) 542return Task.CompletedTask; 550return Task.FromResult(BundleExtractResult.AlreadyUpToDate); 558return Task.FromResult<BundleLayoutLease?>(layoutLease); 572public Task EnsureExtractedAsync(CancellationToken cancellationToken = default) 575return Task.CompletedTask; 583return Task.FromResult(BundleExtractResult.AlreadyUpToDate); 590return Task.FromResult<BundleLayoutLease?>(new BundleLayoutLease(layout, versionLease)); 607public Task AcquisitionStarted => _acquisitionStarted.Task; 611public Task EnsureExtractedAsync(CancellationToken cancellationToken = default) 614return Task.CompletedTask; 622return Task.FromResult(BundleExtractResult.AlreadyUpToDate);
DotNet\ProcessExecutionFactoryEnvironmentTests.cs (3)
30public async Task CreateExecution_StripsAppHostSelectionOriginInheritedFromParentEnvironment() 47public async Task CreateExecution_FromStartInfoStripsAppHostSelectionOriginFromAppHostChild() 63public async Task CreateExecution_PreservesAppHostSelectionOriginForwardedToDetachedChildCli()
DotNet\ProcessExecutionTests.cs (15)
21public async Task StartAsync_AfterDispose_ThrowsObjectDisposedException() 36public async Task WaitForExitAsync_AllowsForwardersToDrainBeforeClosingStreams() 50var releaseTask = Task.Run(async () => 54await Task.Delay(TimeSpan.FromMilliseconds(500)); 96public async Task WaitForExitAsync_AllowsBufferedTailOutputAfterLongIdlePeriod() 110var releaseTask = Task.Run(async () => 114await Task.Delay(TimeSpan.FromMilliseconds(6500)); 158public async Task WaitForExitAsync_KillsProcessWhenCanceled() 181public async Task WaitForExitAsync_WithGracefulServices_InvokesSignalerAndThrowsOnCancellation(bool isolateConsole) 191return Task.FromResult(true); 211public async Task WaitForExitAsync_WithGracefulServices_ProcessIgnoresSignal_ExpireEscalatesToKill(bool isolateConsole) 222return Task.FromResult(true); 246public async Task WaitForExitAsync_WithGracefulServices_SignalerThrows_StillEscalatesToKill(bool isolateConsole)
DotNetSdkInstallerTests.cs (12)
19public async Task CheckAsync_WhenDotNetIsAvailable_ReturnsTrue() 30public async Task CheckAsync_UsesResolvedDotNetPath() 52public async Task CheckAsync_WhenCanceled_KillsDotNetProcessTree() 88public async Task CheckAsync_WithMinimumVersion_WhenDotNetIsAvailable_ReturnsTrue() 100public async Task CheckAsync_WithActualMinimumVersion_BehavesCorrectly() 114public async Task CheckAsync_WithHighMinimumVersion_ReturnsFalse() 126public async Task CheckAsync_WithInvalidMinimumVersion_ReturnsFalse() 138public async Task CheckAsync_UsesArchitectureSpecificCommand() 152public async Task CheckAsync_UsesOverrideMinimumSdkVersion_WhenConfigured() 165public async Task CheckAsync_UsesDefaultMinimumSdkVersion_WhenNotConfigured() 177public async Task CheckAsync_UsesMinimumSdkVersion() 189public async Task CheckAsync_UsesOverrideVersion_WhenOverrideConfigured()
Git\GitRepositoryTests.cs (4)
19public async Task GetIncludedFilesAsync_OutsideRepo_ReturnsNull() 32public async Task GetIncludedFilesAsync_InGitRepo_ReturnsTrackedAndUntracked_ExcludingIgnored() 75public async Task GetIncludedFilesAsync_DeletedTrackedFile_StillReturned() 102public async Task GetIncludedFilesAsync_EmitsProfilingActivityForGitProcess()
Interaction\ConsoleInteractionServiceTests.cs (59)
37public async Task PromptForSelectionAsync_EmptyChoices_ThrowsEmptyChoicesException() 49public async Task PromptForSelectionsAsync_EmptyChoices_ThrowsEmptyChoicesException() 263public async Task ShowStatusAsync_InDebugMode_DisplaysSubtleMessageInsteadOfSpinner() 279var statusValue = await interactionService.ShowStatusAsync(statusText, () => Task.FromResult(GetInStatus(interactionService))).DefaultTimeout(); 288public async Task ShowDynamicStatusAsync_InDebugMode_DisplaysSubtleMessagesInsteadOfSpinner() 303return Task.FromResult(GetInStatus(interactionService)); 318public async Task StatusMethods_WithConsoleLogging_DoNotStartSpinner(LogLevel consoleLogLevel) 330var asyncStatusValue = await interactionService.ShowStatusAsync("Working...", () => Task.FromResult(GetInStatus(interactionService))).DefaultTimeout(); 334return Task.FromResult(GetInStatus(interactionService)); 347public async Task ShowStatusAsync_WithConsoleLoggingDisabled_StartsSpinner() 351var statusValue = await interactionService.ShowStatusAsync("Working...", () => Task.FromResult(GetInStatus(interactionService))).DefaultTimeout(); 383public async Task PromptForStringAsync_WhenInteractiveInputNotSupported_ThrowsInvalidOperationException() 395public async Task PromptForSelectionAsync_WhenInteractiveInputNotSupported_ThrowsInvalidOperationException() 408public async Task PromptForSelectionsAsync_WhenInteractiveInputNotSupported_ThrowsInvalidOperationException() 421public async Task ConfirmAsync_WhenInteractiveInputNotSupported_ThrowsInvalidOperationException() 433public async Task ShowStatusAsync_NestedCall_DoesNotThrowException() 454return await interactionService.ShowStatusAsync(innerStatusText, () => Task.FromResult(expectedResult)); 497public async Task ShowStatusAsync_FallbackPath_DoesNotLeaveInStatusFlagSet() 515await interactionService.ShowStatusAsync("Working...", () => Task.FromResult(0)).DefaultTimeout(); 521public async Task ShowStatusAsync_FallbackPathWithEmptyText_DoesNotLeaveInStatusFlagSet() 526await interactionService.ShowStatusAsync(string.Empty, () => Task.FromResult(0)).DefaultTimeout(); 532public async Task ShowDynamicStatusAsync_FallbackPath_DoesNotLeaveInStatusFlagSet() 537await interactionService.ShowDynamicStatusAsync<int>("Working...", _ => Task.FromResult(0)).DefaultTimeout(); 990public async Task ShowStatusAsync_WithMarkupCharacters_AutoEscapesByDefault() 1009interactionService.ShowStatusAsync(statusText, () => Task.FromResult(0))); 1045public async Task ShowStatusAsync_WithAllowMarkupTrue_PassesThroughMarkup() 1064interactionService.ShowStatusAsync(statusText, () => Task.FromResult(0), allowMarkup: true)); 1073public async Task ShowStatusAsync_WithAllowMarkupTrue_UnescapedDynamicContent_Throws() 1093interactionService.ShowStatusAsync(statusText, () => Task.FromResult(0), allowMarkup: true)); 1100public async Task ShowStatusAsync_WithEmojiName_PrependsEmojiAndAutoEscapes() 1119interactionService.ShowStatusAsync(statusText, () => Task.FromResult(0), emoji: KnownEmojis.Rocket)); 1252public async Task ConfirmAsync_DisplaysCapitalizedDefaultChoice(bool defaultValue, string expectedChoiceSuffix) 1270public async Task ConfirmAsync_WhenUserPressesEnter_ReturnsDefaultValue(bool defaultValue) 1289public async Task ConfirmAsync_WhenUserPressesYWithoutEnter_ReturnsTrue(bool defaultValue, string input) 1306public async Task ConfirmAsync_WhenUserPressesNWithoutEnter_ReturnsFalse(bool defaultValue, string input) 1319public async Task PromptForStringAsync_CliProvidedValue_RunsValidator() 1337public async Task PromptForStringAsync_CliProvidedEmptyValue_ThrowsWhenRequired() 1350public async Task PromptForStringAsync_NonInteractive_DefaultValuePassesValidation_ReturnsDefault() 1366public async Task PromptForStringAsync_WhenUserAcceptsEscapedDisplayDefault_ReturnsRawDefault() 1382public async Task ConfirmAsync_NonInteractive_WithoutExplicitDefault_Throws() 1398public async Task ConfirmAsync_NonInteractive_WithExplicitDefault_ReturnsDefault() 1412public async Task ConfirmAsync_NonInteractive_WithSeparateNonInteractiveDefault_ReturnsNonInteractiveDefault() 1429public async Task ConfirmAsync_Interactive_WithSeparateNonInteractiveDefault_UsesInteractiveDefault() 1555public async Task ConfirmAsync_WithNullBinding_DefaultsToTrue() 1568public async Task PromptForSelectionAsync_NonInteractive_CliProvidedInvalidValue_ShowsAvailableChoices() 1590public async Task PromptForSelectionsAsync_NonInteractive_CliProvidedInvalidValue_ShowsAvailableChoices() 1612public async Task PromptForSelectionsAsync_NonInteractive_CliProvidedInvalidValue_OmitsItemsOutsideBindingChoices() 1639public async Task PromptForSelectionsAsync_NonInteractive_CliProvidedInvalidValue_StripsSpectreMarkupFromChoiceLabels() 1673public async Task PromptForSelectionsAsync_NonInteractive_CliProvidedInvalidValue_WithUnescapedClosingBracketInChoiceLabel_DoesNotThrowInvalidOperationException() 1701public async Task PromptForSelectionAsync_NonInteractive_WithDefaultValue_ReturnsMatch() 1719public async Task PromptForSelectionAsync_CliProvidedValidValue_ReturnsMatch() 1737public async Task PromptForSelectionsAsync_CliProvidedCommaSeparated_ReturnsMatches() 1816public async Task PromptForStringAsync_NonInteractive_NoBinding_ThrowsInvalidOperationException() 1828public async Task PromptForSelectionAsync_NonInteractive_WithoutBinding_ThrowsInvalidOperationException() 1843public async Task PromptForSelectionAsync_BindingProvided_DoesNotEchoSelection() 1862public async Task PromptForSelectionsAsync_BindingProvided_DoesNotEchoSelection() 1881public async Task PromptForSelectionAsync_NonInteractiveDefault_DoesNotEchoSelection() 1900public async Task PromptForSelectionsAsync_NonInteractiveDefault_DoesNotEchoSelection() 1992=> Task.FromResult(ReadKey(intercept));
Interaction\ExtensionInteractionServiceTests.cs (15)
20public async Task DisplayMessage_DoesNotRenderTerminalHyperlinksToDebugConsoleCapturedOutput() 64public async Task DisplayCancellationMessage_WithCustomMessage_UsesCancellationBackchannel() 92return Task.CompletedTask; 109public async Task PromptForFilePathAsync_RetriesAfterInvalidSelection() 121HasCapabilityAsyncCallback = (capability, _) => Task.FromResult(capability == KnownCapabilities.FilePickers), 125return Task.FromResult(selections.Dequeue()); 130return Task.CompletedTask; 151public async Task PromptForFilePathAsync_CancelAfterInvalidSelectionThrows() 162HasCapabilityAsyncCallback = (capability, _) => Task.FromResult(capability == KnownCapabilities.FilePickers), 166return Task.FromResult(selections.Dequeue()); 171return Task.CompletedTask; 190public async Task PromptForFilePathAsync_InvalidSelectionWithoutRetryThrows() 195HasCapabilityAsyncCallback = (capability, _) => Task.FromResult(capability == KnownCapabilities.FilePickers), 196PromptForFilePathAsyncCallback = (_, _, _) => Task.FromResult<string?>("invalid") 210public async Task Dispose_StopsBackgroundPump()
Interaction\SpectreConsoleLoggerProviderTests.cs (5)
158public async Task WriteOrBuffer_IsAtomic_NoLogSlipsDuringPromptStart() 169var promptTask = Task.Run(async () => 175await Task.Delay(200); 256public async Task EndScope_DoesNotStealDepthFromConcurrentNewScope()
Layout\LayoutProcessRunnerTests.cs (11)
14public async Task RunAsync_InjectsOrphanDetectionEnvironment() 32public async Task RunAsync_DoesNotOverrideCallerSuppliedOrphanEnvironment() 53public async Task StartAsync_InjectsOrphanDetectionEnvironment() 74public async Task StartAsync_DoesNotOverrideCallerSuppliedOrphanEnvironment() 95public async Task RunAsync_WhenKillOnParentExitRequested_SetsInvocationOption() 115public async Task RunAsync_DefaultsKillOnParentExitToFalse() 134public async Task StartAsync_WhenKillOnParentExitRequested_SetsInvocationOption() 151public async Task StartAsync_PreservesCallerSuppliedKillOnParentExit() 172public async Task StartAsync_WhenKillOnParentExitRequested_DoesNotMutateCallerOptions() 198public async Task RunAsync_WhenKillOnParentExit_DisarmsCooperativeWatchdogOnWindowsOnly() 231public async Task StartAsync_WhenKillOnParentExit_DisarmsCooperativeWatchdogOnWindowsOnly()
Mcp\ApiDocs\ApiDocsCacheTests.cs (3)
20public async Task FetchSitemapAsync_PersistsFriendlySitemapCacheFileNames() 46public async Task FetchPageAsync_PersistsFriendlyPageCacheFileNames() 72public async Task SetIndexAsync_PersistsFriendlyIndexFiles()
Mcp\ApiDocs\ApiDocsFetcherTests.cs (26)
24public async Task FetchSitemapAsync_CachesContentWithFriendlyKey() 50public async Task FetchPageAsync_CachesContentWithFriendlyKey() 76public async Task FetchPageAsync_StripsMemberAnchorFromMarkdownFetchAndCacheKey() 113=> Task.FromResult(_content.TryGetValue(key, out var value) ? value : null); 115public Task SetAsync(string key, string content, CancellationToken cancellationToken = default) 118return Task.CompletedTask; 122=> Task.FromResult(_etags.TryGetValue(url, out var value) ? value : null); 124public Task SetETagAsync(string url, string? etag, CancellationToken cancellationToken = default) 135return Task.CompletedTask; 138public Task InvalidateAsync(string key, CancellationToken cancellationToken = default) 141return Task.CompletedTask; 145=> Task.FromResult(_index); 147public Task SetIndexAsync(ApiReferenceItem[] documents, CancellationToken cancellationToken = default) 150return Task.CompletedTask; 154=> Task.FromResult(_indexFingerprint); 156public Task SetIndexSourceFingerprintAsync(string fingerprint, CancellationToken cancellationToken = default) 159return Task.CompletedTask; 163=> Task.FromResult(_memberIndex); 165public Task SetMemberIndexAsync(ApiReferenceItem[] documents, CancellationToken cancellationToken = default) 168return Task.CompletedTask; 172=> Task.FromResult(_memberIndexFingerprint); 174public Task SetMemberIndexSourceFingerprintAsync(string fingerprint, CancellationToken cancellationToken = default) 177return Task.CompletedTask; 181=> Task.FromResult(_indexedMemberContainerIds); 183public Task SetIndexedMemberContainerIdsAsync(string[] containerIds, CancellationToken cancellationToken = default) 186return Task.CompletedTask;
Mcp\ApiDocs\ApiDocsIndexServiceTests.cs (41)
18public async Task ListAsync_BuildsHierarchyForBothLanguages() 70public async Task SearchAsync_RespectsLanguageFilterAndFindsDirectRouteItems() 84public async Task SearchAsync_FindsMembersParsedFromGroupedMemberLinks() 98public async Task SearchAsync_LoadsMemberIndexWhenBaseRouteHitsExist() 114public async Task SearchAsync_PrefersTypesForBroadIdentifierQueries() 129public async Task SearchAsync_LoadsOnlyNeededMemberContainers() 188public async Task ListAsync_ForMemberGroupScope_ReturnsParsedMembers() 213public async Task GetAsync_ForDirectRouteItem_ReturnsRawMarkdown() 227public async Task GetAsync_ForParsedMember_ReturnsAnchoredUrlAndRawMarkdown() 241public async Task GetAsync_RebasesConfiguredHostForFetchedContentAndReturnedUrl() 285public async Task GetAsync_RewritesBracketedMemberSignatureLinksFromDistributedApplicationPage() 325public async Task GetAsync_ForTypeScriptDirectRouteItem_ReturnsMarkdownFromConfiguredHost() 361public async Task EnsureIndexedAsync_RebuildsCachedIndexWhenSitemapChangesAcrossInstances() 396public async Task EnsureIndexedAsync_UsesCachedIndexWhenSitemapUnavailableAfterInitialLoad() 591=> Task.FromResult<string?>(sitemapContent); 604return Task.FromResult(pageContent.TryGetValue(cachePageUrl, out var content) ? content : pageContent.TryGetValue(markdownUrl, out content) ? content : null); 613=> Task.FromResult(_sitemapContents.Count > 0 ? _sitemapContents.Dequeue() : null); 616=> Task.FromResult<string?>(null); 631=> Task.FromResult(_content.TryGetValue(key, out var value) ? value : null); 633public Task SetAsync(string key, string content, CancellationToken cancellationToken = default) 636return Task.CompletedTask; 640=> Task.FromResult(_etags.TryGetValue(url, out var value) ? value : null); 642public Task SetETagAsync(string url, string? etag, CancellationToken cancellationToken = default) 653return Task.CompletedTask; 656public Task InvalidateAsync(string key, CancellationToken cancellationToken = default) 659return Task.CompletedTask; 663=> Task.FromResult(Index); 665public Task SetIndexAsync(ApiReferenceItem[] documents, CancellationToken cancellationToken = default) 668return Task.CompletedTask; 672=> Task.FromResult(_indexSourceFingerprint); 674public Task SetIndexSourceFingerprintAsync(string fingerprint, CancellationToken cancellationToken = default) 677return Task.CompletedTask; 681=> Task.FromResult(MemberIndex); 683public Task SetMemberIndexAsync(ApiReferenceItem[] documents, CancellationToken cancellationToken = default) 686return Task.CompletedTask; 690=> Task.FromResult(_memberIndexSourceFingerprint); 692public Task SetMemberIndexSourceFingerprintAsync(string fingerprint, CancellationToken cancellationToken = default) 695return Task.CompletedTask; 699=> Task.FromResult(_indexedMemberContainerIds); 701public Task SetIndexedMemberContainerIdsAsync(string[] containerIds, CancellationToken cancellationToken = default) 704return Task.CompletedTask;
Mcp\Docs\DocsCacheTests.cs (2)
19public async Task FetchDocsAsync_PersistsFriendlyLlmsCacheFileName() 47public async Task GetIndexAsync_ClearsLegacyUrlBackedDocsFiles_WhenModernIndexExists()
Mcp\Docs\DocsFetcherTests.cs (32)
24public async Task FetchDocsAsync_SuccessfulRequest_ReturnsContent() 50public async Task FetchDocsAsync_StoresETag_WhenProvided() 71public async Task FetchDocsAsync_CachesContent() 92public async Task FetchDocsAsync_WithCachedETag_SendsIfNoneMatchHeader() 117public async Task FetchDocsAsync_NotModifiedResponse_ReturnsCachedContent() 139public async Task FetchDocsAsync_NotModifiedButCacheEmpty_RetriesWithoutETag() 175public async Task FetchDocsAsync_FailedRequest_ReturnsNull() 193public async Task FetchDocsAsync_NetworkError_ReturnsNull() 206public async Task FetchDocsAsync_Cancellation_ThrowsOperationCanceledException() 221public async Task FetchDocsAsync_EmptyResponse_ReturnsEmptyString() 240public async Task FetchDocsAsync_WhitespaceOnlyResponse_ReturnsWhitespace() 260public async Task FetchDocsAsync_NullContent_ReturnsEmptyString() 284public async Task FetchDocsAsync_ErrorStatusCode_ReturnsNull(HttpStatusCode statusCode) 310public async Task FetchDocsAsync_Exception_ReturnsNull(Exception exception) 323public async Task FetchDocsAsync_CacheReturnsNull_FetchesFromServer() 344public async Task FetchDocsAsync_WithETagButNoCachedContent_ClearsETagAndRetries() 376public async Task FetchDocsAsync_MigratesLegacyUrlCacheEntries() 403return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK) 420return Task.FromResult(value); 423public Task SetAsync(string key, string content, CancellationToken cancellationToken = default) 426return Task.CompletedTask; 432return Task.FromResult(value); 435public Task SetETagAsync(string url, string? etag, CancellationToken cancellationToken = default) 445return Task.CompletedTask; 450return Task.FromResult(_index); 453public Task SetIndexAsync(LlmsDocument[] documents, CancellationToken cancellationToken = default) 456return Task.CompletedTask; 461return Task.FromResult(_indexSourceFingerprint); 464public Task SetIndexSourceFingerprintAsync(string fingerprint, CancellationToken cancellationToken = default) 467return Task.CompletedTask; 470public Task InvalidateAsync(string key, CancellationToken cancellationToken = default) 473return Task.CompletedTask;
Mcp\Docs\DocsIndexServiceTests.cs (92)
27public async Task ListDocumentsAsync_ReturnsAllDocuments() 52public async Task ListDocumentsAsync_WhenFetchFails_ReturnsEmptyList() 63public async Task SearchAsync_FindsDocumentByTitle() 87public async Task SearchAsync_FindsDocumentBySummary() 106public async Task SearchAsync_FindsDocumentBySectionHeading() 130public async Task SearchAsync_TitleMatchScoresHigherThanBodyMatch() 155public async Task SearchAsync_PreFilterHaystack_CoversEveryScorableField() 204public async Task SearchAsync_FindsCodeIdentifiers() 229public async Task SearchAsync_RespectsTopKLimit() 267public async Task SearchAsync_WithEmptyQuery_ReturnsEmptyResults() 283public async Task SearchAsync_WithWhitespaceQuery_ReturnsEmptyResults() 299public async Task SearchAsync_MultiWordQuery_FindsAllTerms() 324public async Task GetDocumentAsync_BySlug_ReturnsDocument() 344public async Task GetDocumentAsync_CaseInsensitive() 363public async Task GetDocumentAsync_UnknownSlug_ReturnsNull() 381public async Task GetDocumentAsync_WithSection_ReturnsOnlySection() 407public async Task GetDocumentAsync_WithPartialSectionName_FindsSection() 427public async Task GetDocumentAsync_ReturnsSectionsList() 456public async Task GetDocumentAsync_NormalizesInlineMarkdownAndRewritesLinks() 488public async Task GetDocumentAsync_KeepsMinifiedSingleLineCodeBlocksOnSingleLine() 513public async Task EnsureIndexedAsync_OnlyFetchesOnce() 531public async Task EnsureIndexedAsync_RevalidatesCachedIndexAcrossInstances() 564public async Task EnsureIndexedAsync_UsesCachedIndexWhenSourceUnavailableAfterInitialLoad() 587public async Task EnsureIndexedAsync_RefreshesCachedIndexWhenSourceContentChanges() 624public async Task GetDocumentAsync_NormalizesMinifiedInlineTables() 645public async Task SearchAsync_OrdersResultsByScore() 678public async Task SearchAsync_WithNullQuery_ReturnsEmptyResults() 696public async Task GetDocumentAsync_WithNullSlug_ReturnsNull() 714public async Task GetDocumentAsync_WithEmptySlug_ReturnsNull() 732public async Task GetDocumentAsync_WithWhitespaceSlug_ReturnsNull() 750public async Task ListDocumentsAsync_WhenFetchReturnsEmpty_ReturnsEmptyList() 761public async Task ListDocumentsAsync_WhenFetchReturnsWhitespace_ReturnsEmptyList() 772public async Task SearchAsync_WhenNoDocsIndexed_ReturnsEmptyResults() 783public async Task GetDocumentAsync_WhenNoDocsIndexed_ReturnsNull() 794public async Task ListDocumentsAsync_WhenFetcherThrows_PropagatesException() 803public async Task SearchAsync_WhenFetcherThrows_PropagatesException() 812public async Task GetDocumentAsync_WhenFetcherThrows_PropagatesException() 821public async Task EnsureIndexedAsync_WhenCancelled_ThrowsOperationCanceledException() 834public async Task EnsureIndexedAsync_WhenFetcherThrows_PropagatesException() 843public async Task SearchAsync_WithSpecialCharactersInQuery_HandlesGracefully() 863public async Task SearchAsync_WithVeryLongQuery_HandlesGracefully() 884public async Task GetDocumentAsync_WithNonExistentSection_ReturnsFullDocument() 907public async Task SearchAsync_WithZeroTopK_ReturnsEmptyResults() 925public async Task SearchAsync_WithNegativeTopK_ReturnsEmptyResults() 943public async Task SearchAsync_SlugExactMatch_RanksHigher() 969public async Task SearchAsync_SlugPhraseMatch_RanksHigher() 996public async Task SearchAsync_TitleAndSlugPhraseMatch_OutranksRepeatedBodyAndCodeMatches() 1023public async Task SearchAsync_CommandTitleAndSlug_OutrankReleaseNotesForCommonTerms() 1049public async Task SearchAsync_TitlePhrase_OutranksRepeatedCommonAzureTerms() 1075public async Task SearchAsync_WhatsNewPenalty_RanksLower() 1102public async Task SearchAsync_PartialSlugMatch_StillRanksReasonably() 1128public async Task SearchAsync_ChangelogPenalty_AppliesCorrectly() 1154public async Task SearchAsync_ReleaseNotesIdentityMatch_RequiresTokenBoundaryMatch() 1179public async Task SearchAsync_MultiWordQuery_MatchesSlugSegments() 1204public async Task SearchAsync_SingleWordQuery_UsesSegmentMatching() 1234public async Task SearchAsync_HyphenatedQuery_MatchesSlugWithExtraSegments() 1260public async Task SearchAsync_ChangelogQuery_DoesNotApplyPenalty() 1290public async Task SearchAsync_WhatsNewQuery_RanksReleaseNotesAboveNoisyMatches(string query) 1328public async Task SearchAsync_ReleaseNotesPenalty_StillAppliesToIncidentalFeatureMatches() 1355public async Task SearchAsync_VersionQuery_MatchesSlugWithCollapsedVersion(string query) 1382return Task.FromResult(content); 1390return Task.FromResult(contentProvider()); 1400return Task.FromResult(_contents.Count > 0 ? _contents.Dequeue() : null); 1693await Task.Delay(delay, cancellationToken); 1700public Task<string?> GetAsync(string key, CancellationToken cancellationToken = default) => Task.FromResult<string?>(null); 1701public Task SetAsync(string key, string content, CancellationToken cancellationToken = default) => Task.CompletedTask; 1702public Task<string?> GetETagAsync(string url, CancellationToken cancellationToken = default) => Task.FromResult<string?>(null); 1703public Task SetETagAsync(string url, string? etag, CancellationToken cancellationToken = default) => Task.CompletedTask; 1704public Task<LlmsDocument[]?> GetIndexAsync(CancellationToken cancellationToken = default) => Task.FromResult<LlmsDocument[]?>(null); 1705public Task SetIndexAsync(LlmsDocument[] documents, CancellationToken cancellationToken = default) => Task.CompletedTask; 1706public Task<string?> GetIndexSourceFingerprintAsync(CancellationToken cancellationToken = default) => Task.FromResult<string?>(null); 1707public Task SetIndexSourceFingerprintAsync(string fingerprint, CancellationToken cancellationToken = default) => Task.CompletedTask; 1708public Task InvalidateAsync(string key, CancellationToken cancellationToken = default) => Task.CompletedTask; 1721return Task.FromResult(value); 1724public Task SetAsync(string key, string content, CancellationToken cancellationToken = default) 1727return Task.CompletedTask; 1733return Task.FromResult(value); 1736public Task SetETagAsync(string url, string? etag, CancellationToken cancellationToken = default) 1747return Task.CompletedTask; 1751=> Task.FromResult(_index); 1753public Task SetIndexAsync(LlmsDocument[] documents, CancellationToken cancellationToken = default) 1756return Task.CompletedTask; 1760=> Task.FromResult(_indexSourceFingerprint); 1762public Task SetIndexSourceFingerprintAsync(string fingerprint, CancellationToken cancellationToken = default) 1765return Task.CompletedTask; 1768public Task InvalidateAsync(string key, CancellationToken cancellationToken = default) 1771return Task.CompletedTask;
Mcp\Docs\DocsSearchServiceTests.cs (33)
27public async Task SearchAsync_ReturnsFormattedResponse() 48public async Task SearchAsync_WithNoResults_ReturnsEmptyResults() 68public async Task FormatAsMarkdown_WithResults_FormatsCorrectly() 92public async Task FormatAsMarkdown_WithScores_IncludesScores() 114public async Task FormatAsMarkdown_NoResults_ReturnsHelpfulMessage() 137public async Task SearchAsync_RespectsTopKLimit() 167public async Task SearchAsync_IncludesMatchedSection() 196public async Task SearchAsync_WithInvalidQuery_ReturnsResponseWithEmptyResults(string? query) 216public async Task SearchAsync_WhenNoDocsAvailable_ReturnsResponseWithEmptyResults() 229public async Task SearchAsync_WhenDocsEmpty_ReturnsResponseWithEmptyResults() 242public async Task FormatAsMarkdown_WithNullTitle_UsesDefaultTitle() 265public async Task FormatAsMarkdown_WithEmptyTitle_UsesEmptyTitle() 290public async Task SearchAsync_WithZeroTopK_ReturnsEmptyResults() 310public async Task SearchAsync_WithNegativeTopK_ReturnsEmptyResults() 330public async Task SearchAsync_WithLargeTopK_ReturnsAllAvailableResults() 355public async Task SearchAsync_WhenIndexerThrows_PropagatesException() 365public async Task SearchAsync_WithSpecialCharactersInQuery_HandlesGracefully() 385public async Task SearchAsync_WithUnicodeCharacters_HandlesGracefully() 408return Task.FromResult(content); 422public Task<string?> GetAsync(string key, CancellationToken cancellationToken = default) => Task.FromResult<string?>(null); 423public Task SetAsync(string key, string content, CancellationToken cancellationToken = default) => Task.CompletedTask; 424public Task<string?> GetETagAsync(string url, CancellationToken cancellationToken = default) => Task.FromResult<string?>(null); 425public Task SetETagAsync(string url, string? etag, CancellationToken cancellationToken = default) => Task.CompletedTask; 426public Task<LlmsDocument[]?> GetIndexAsync(CancellationToken cancellationToken = default) => Task.FromResult<LlmsDocument[]?>(null); 427public Task SetIndexAsync(LlmsDocument[] documents, CancellationToken cancellationToken = default) => Task.CompletedTask; 428public Task<string?> GetIndexSourceFingerprintAsync(CancellationToken cancellationToken = default) => Task.FromResult<string?>(null); 429public Task SetIndexSourceFingerprintAsync(string fingerprint, CancellationToken cancellationToken = default) => Task.CompletedTask; 430public Task InvalidateAsync(string key, CancellationToken cancellationToken = default) => Task.CompletedTask;
Mcp\Docs\LlmsTxtParserTests.cs (40)
12public async Task ParseAsync_WithEmptyString_ReturnsEmptyList() 20public async Task ParseAsync_WithWhitespaceOnly_ReturnsEmptyList() 28public async Task ParseAsync_WithNoH1Headers_ReturnsEmptyList() 42public async Task ParseAsync_WithSingleDocument_ParsesCorrectly() 62public async Task ParseAsync_WithMultipleDocuments_ParsesAll() 88public async Task ParseAsync_WithSections_ParsesSectionsCorrectly() 121public async Task ParseAsync_SectionContent_IncludesNestedHeadings() 149public async Task ParseAsync_WithNoSummary_SummaryIsNull() 164public async Task ParseAsync_SlugGeneration_HandlesSpecialCharacters() 178public async Task ParseAsync_SlugGeneration_HandlesMultipleSpaces() 193public async Task ParseAsync_SlugGeneration_TrimsHyphens() 209public async Task ParseAsync_WithCodeBlocks_PreservesContent() 232public async Task ParseAsync_BashCommentInCodeFence_NotTreatedAsDocumentBoundary() 268public async Task ParseAsync_DuplicateSlugs_AreDisambiguatedWithNumericSuffix() 306public async Task ParseAsync_DuplicateSlugs_SkipsOccupiedNumericSuffixSlug() 334public async Task ParseAsync_H1WithoutSpace_NotRecognizedAsDocument() 348public async Task ParseAsync_H2AtStart_NotRecognizedAsDocument() 361public async Task ParseAsync_WithLeadingWhitespace_StillParsesH1() 375public async Task ParseAsync_PreservesNewlinesInContent() 394public async Task ParseAsync_DocumentBoundariesAreCorrect() 413public async Task ParseAsync_RealWorldExample_ParsesCorrectly() 473public async Task ParseAsync_InlineHeroH1_DoesNotCreateExtraDocument() 502public async Task ParseAsync_WithCancellation_ThrowsOperationCanceledException() 521public async Task ParseAsync_EmptyTitle_SkipsDocument() 538public async Task ParseAsync_MultipleSummaryBlockquotes_UsesFirst() 555public async Task ParseAsync_BlockquoteAfterSection_NotUsedAsSummary() 578public async Task ParseAsync_SlugGeneration_VariousCases(string title, string expectedSlug) 589public async Task ParseAsync_InlineSections_ParsesCorrectly() 611public async Task ParseAsync_CodeBlocksExcluded_DoesNotParseHashesInCode() 640public async Task ParseAsync_SectionTitledMarker_StrippedFromHeading() 654public async Task ParseAsync_AspireDotDevContent_ParsesFourDocuments() 662public async Task ParseAsync_AspireDotDevContent_ParsesDocumentTitlesCorrectly() 674public async Task ParseAsync_AspireDotDevContent_GeneratesCorrectSlugs() 685public async Task ParseAsync_AspireDotDevContent_ParsesSummariesCorrectly() 696public async Task ParseAsync_AspireDotDevContent_ParsesSectionsForCertificatesDoc() 716public async Task ParseAsync_AspireDotDevContent_ParsesSectionsForAppHostConfigDoc() 732public async Task ParseAsync_AspireDotDevContent_ParsesSectionsForDockerComposeDoc() 748public async Task ParseAsync_AspireDotDevContent_ParsesSectionsForEventingDoc() 768public async Task ParseAsync_AspireDotDevContent_ContentContainsCodeBlocks() 789public async Task ParseAsync_AspireDotDevContent_DocumentBoundariesAreCorrect()
Mcp\E2E\McpDocsE2ETests.cs (11)
50public async Task ListTools_IncludesDocsTools() 62public async Task ListDocs_ReturnsDocumentation() 77public async Task SearchDocs_FindsRelevantContent() 96public async Task SearchDocs_RespectsTopKParameter() 113public async Task SearchDocs_SlugCanBeUsedWithGetDoc() 146public async Task SearchDocs_WithEmptyQuery_ReturnsError() 159public async Task GetDoc_RetrievesDocumentContent() 190public async Task GetDoc_WithInvalidSlug_ReturnsError() 204public async Task GetDoc_WithSection_ReturnsSpecificSection() 236public async Task ListTools_ToolSchemas_AreValid() 257public async Task SearchDocs_ToolDescription_IsInformative()
Mcp\ExcludeFromMcpTests.cs (11)
98public async Task ListResourcesTool_ExcludesResourceWithExcludeFromMcp() 138public async Task ListResourcesTool_ReturnsNoResourcesFound_WhenAllExcluded() 170public async Task ListConsoleLogsTool_ReturnsError_WhenResourceIsExcluded() 208public async Task ListConsoleLogsTool_ReturnsLogs_WhenResourceIsNotExcluded() 242public async Task ExecuteResourceCommandTool_ReturnsError_WhenResourceIsExcluded() 280public async Task ListStructuredLogsTool_ReturnsError_WhenSpecificResourceIsExcluded() 300public async Task ListStructuredLogsTool_FiltersExcludedResourceLogs_WhenNoResourceSpecified() 317public async Task ListTracesTool_ReturnsError_WhenSpecificResourceIsExcluded() 337public async Task ListTracesTool_FiltersExcludedResourceSpans_WhenNoResourceSpecified() 354public async Task ListTraceStructuredLogsTool_FiltersExcludedResourceLogs() 375public async Task ListTraceStructuredLogsTool_ReturnsAllLogs_WhenNoResourcesExcluded()
Mcp\ExecuteResourceCommandToolTests.cs (14)
40public async Task ExecuteResourceCommandTool_ThrowsException_WhenNoAppHostRunning() 53public async Task ExecuteResourceCommandTool_ReturnsSuccess_WhenCommandExecutedSuccessfully() 76public async Task ExecuteResourceCommandTool_WithArguments_PassesArgumentsToBackchannel() 97public async Task ExecuteResourceCommandTool_WithPrimitiveArguments_ConvertsArgumentsToStrings() 120public async Task ExecuteResourceCommandTool_ThrowsException_WhenArgumentsIsNotObject() 139public async Task ExecuteResourceCommandTool_ThrowsException_WhenArgumentValueIsObjectOrArray(string argumentsJson) 156public async Task ExecuteResourceCommandTool_ReturnsError_WhenCommandFails() 178public async Task ExecuteResourceCommandTool_ReturnsError_WhenCommandFailsWithNullValidationErrors() 201public async Task ExecuteResourceCommandTool_ReturnsValidationErrors_WhenCommandArgumentsAreInvalid() 233public async Task ExecuteResourceCommandTool_ThrowsException_WhenCommandCanceled() 255public async Task ExecuteResourceCommandTool_WorksWithKnownCommands() 280public async Task ExecuteResourceCommandTool_ThrowsException_WhenMissingArguments() 302public async Task ExecuteResourceCommandTool_ReturnsResult_WhenCommandReturnsResultData() 336public async Task ExecuteResourceCommandTool_NoExtraContent_WhenCommandSucceedsWithoutResult()
Mcp\ListAppHostsToolTests.cs (5)
16public async Task ListAppHostsTool_ReturnsEmptyListWhenNoConnections() 40public async Task ListAppHostsTool_ReturnsInScopeAppHosts() 72public async Task ListAppHostsTool_ReturnsOutOfScopeAppHosts() 104public async Task ListAppHostsTool_SeparatesInScopeAndOutOfScopeAppHosts() 148public async Task ListAppHostsTool_CallsScanAsyncBeforeReturningResults()
Mcp\ListConsoleLogsToolTests.cs (14)
17public async Task ListConsoleLogsTool_ThrowsException_WhenNoAppHostRunning() 35public async Task ListConsoleLogsTool_ThrowsException_WhenResourceNameNotProvided() 50public async Task ListConsoleLogsTool_ReturnsLogs_WhenResourceHasNoLogs() 80public async Task ListConsoleLogsTool_ReturnsLogs_ForSpecificResource() 116public async Task ListConsoleLogsTool_ReturnsPlainTextFormat() 146public async Task ListConsoleLogsTool_StripsTimestamps() 175public async Task ListConsoleLogsTool_StripsAnsiSequences() 204public async Task ListConsoleLogsTool_WithSearch_FiltersLogsByContent() 239public async Task ListConsoleLogsTool_WithSearch_IsCaseInsensitive() 272public async Task ListConsoleLogsTool_WithSearch_NoMatch_ReturnsEmpty() 303public async Task ListConsoleLogsTool_WithSearch_ReturnsSummaryWithFilteredCount() 339public async Task ListConsoleLogsTool_WithNonStringSearchValue_IgnoresSearch() 375public async Task ListConsoleLogsTool_WithSearch_MultipleWords_MatchesEachFragmentSeparately() 414public async Task ListConsoleLogsTool_WithSearch_QualifierSyntaxTreatedAsFreeText()
Mcp\ListDocsToolTests.cs (3)
14public async Task ListDocsTool_CallToolAsync_ReturnsDocumentList() 33public async Task ListDocsTool_CallToolAsync_SendsProgressNotifications_WhenIndexingRequired() 49public async Task ListDocsTool_CallToolAsync_DoesNotSendProgressNotifications_WhenAlreadyIndexed()
Mcp\ListIntegrationsToolTests.cs (3)
48public async Task ListIntegrationsTool_CallToolAsync_ReturnsEmptyJsonArray_WhenNoPackagesFound() 69public async Task ListIntegrationsTool_CallToolAsync_ReturnsJsonWithPackages_WhenPackagesFound() 107public async Task ListIntegrationsTool_UsesDefaultChannelOnly()
Mcp\ListResourcesToolTests.cs (5)
16public async Task ListResourcesTool_ThrowsException_WhenNoAppHostRunning() 29public async Task ListResourcesTool_ReturnsNoResourcesFound_WhenSnapshotsAreEmpty() 51public async Task ListResourcesTool_ReturnsMultipleResources() 97public async Task ListResourcesTool_IncludesEnvironmentVariableNamesButNotValues() 136public async Task ListResourcesTool_ReturnsValidJson()
Mcp\ListStructuredLogsToolTests.cs (6)
25public async Task ListStructuredLogsTool_ThrowsException_WhenNoAppHostRunning() 36public async Task ListStructuredLogsTool_ThrowsException_WhenDashboardNotAvailable() 54public async Task ListStructuredLogsTool_ReturnsFormattedLogs_WhenApiReturnsData() 230public async Task ListStructuredLogsTool_ReturnsEmptyLogs_WhenApiReturnsNoData() 285public async Task ListStructuredLogsTool_ReturnsResourceNotFound_WhenResourceDoesNotExist() 424public async Task ListStructuredLogsTool_WithSearch_PassesSearchToUrl()
Mcp\ListTracesToolTests.cs (5)
23public async Task ListTracesTool_ReturnsFormattedTraces_WhenApiReturnsData() 215public async Task ListTracesTool_ReturnsEmptyTraces_WhenApiReturnsNoData() 270public async Task ListTracesTool_ReturnsResourceNotFound_WhenResourceDoesNotExist() 325public async Task ListTracesTool_FiltersTracesByResource_WhenResourceNameProvided() 466public async Task ListTracesTool_WithSearch_PassesSearchToUrl()
Mcp\MockPackagingService.cs (4)
26Task.FromResult<IEnumerable<NuGetPackageCli>>(packages) 28return Task.FromResult<IEnumerable<PackageChannel>>([PackageChannel.CreateImplicitChannel(cache, new TestFeatures(), NullLogger.Instance)]); 53public Task ScanAsync(CancellationToken cancellationToken = default) => Task.CompletedTask;
Migrations\PendingMigrationsCheckTests.cs (4)
23public async Task CheckAsync_WithNoMigrations_ReturnsEmpty() 33public async Task CheckAsync_WithApplicableMigration_ReturnsWarning() 56public async Task CheckAsync_WithNonApplicableMigration_ReturnsEmpty() 67public async Task CheckAsync_WithFailingMigration_SkipsItAndContinues()
Migrations\TypeScriptAppHostMigrationTests.cs (11)
51public async Task DetectAsync_WithLegacyAppHost_ReturnsDescriptor() 67public async Task DetectAsync_WithModernAppHost_ReturnsNull() 80public async Task DetectAsync_WithBothAppHosts_ReturnsNull() 92public async Task DetectAsync_WithNonTypeScriptAppHost_ReturnsNull() 103public async Task DetectAsync_WithSelectedLegacyAppHostOutsideWorkingDirectory_ReturnsDescriptor() 150private static async Task WriteLegacyLayoutAsync(DirectoryInfo root, string? tsConfigContent = null) 187private static async Task AssertMigratedMetadataAsync(DirectoryInfo root, string[] expectedIncludes) 206public async Task ApplyAsync_WithLegacyAppHost_MigratesToMts() 226public async Task ApplyAsync_WithSelectedLegacyAppHostOutsideWorkingDirectory_MigratesSelectedAppHost() 244public async Task ApplyAsync_WithJsoncTsConfig_RewritesIncludes() 269public async Task ApplyAsync_RunTwice_SecondRunIsNoOp()
Npm\NpmRunnerTests.cs (1)
152public async Task InstallGlobalAsync_UsesPublicRegistryForDependencies()
NuGet\BundleNuGetPackageCacheTests.cs (3)
15public async Task GetPackageVersionsAsync_ExpandsAllVersionsFromExactMatchResult() 67public async Task GetPackageVersionsAsync_RequestsKillOnParentExitForSearchHelper() 116public async Task GetPackageVersionsAsync_ToleratesCredentialProviderOutputAroundPayload()
NuGet\BundleNuGetServiceTests.cs (10)
17public async Task RestorePackagesAsync_UsesWorkspaceAspireDirectoryForRestoreArtifacts() 58public async Task RestorePackagesAsync_UsesDistinctCachePathsForDifferentSources() 92public async Task RestorePackagesAsync_PassesNuGetConfigToRestore() 129public async Task RestorePackagesAsync_UsesCachedManifestWithoutRunningHelper() 173public async Task RestorePackagesAsync_RegeneratesCachedManifestWhenManifestIsInvalid() 226public async Task RestorePackagesAsync_UsesDistinctCachePathsWhenManagedHelperChanges() 260public async Task RestorePackagesAsync_SharesRestoreCacheAcrossAppHostsInSameWorkspace() 305public async Task RestorePackagesAsync_SerializesConcurrentRestoreForSameCachePath() 367var manifests = await Task.WhenAll(firstRestoreTask, secondRestoreTask); 376public async Task RestorePackagesAsync_IgnoresLockedLegacyLibsDirectory()
NuGet\NuGetPackageCacheTests.cs (7)
16public async Task NonAspireCliPackagesWillNotBeConsidered() 49public async Task DeprecatedPackagesAreFilteredByDefault() 88public async Task DeprecatedPackagesAreIncludedWhenShowDeprecatedPackagesEnabled() 130public async Task CustomFilterBypassesDeprecatedPackageFiltering() 174public async Task DeprecatedPackageFilteringIsCaseInsensitive() 209public async Task AnalyzerPackageIsFilteredFromDefaultPackageSearch() 242public async Task GetPackageVersionsAsync_UsesExactMatchSearch()
NuGet\NuGetPackagePrefetcherTests.cs (23)
47public async Task TemplatePackageMetadataConsumptionRequiresPrefetchCapabilityInTests() 67public async Task CachedCliPackageMetadataConsumptionRequiresPrefetchCapabilityInTests() 108public async Task PrefetchingCancellationDueToShutdownLogsCleanMessage() 124_ = Task.Run(async () => 126await Task.WhenAll(templateArrived.Task, cliArrived.Task); 175await Task.WhenAll(templateTcs.Task, cliTcs.Task).DefaultTimeout(); 181public async Task TemplatePrefetchingNonCancellationExceptionLogsExceptionDetails() 233public async Task CommandsStartExpectedPackageMetadataPrefetching(Type commandType, bool expectedTemplatePrefetch, bool expectedCliPrefetch) 247public async Task DisabledUpdateNotificationsOnlyPrefetchRequiredCliPackageMetadata(Type commandType, bool expectedCliPrefetch) 265public async Task GeneratedTemplateCommandStartsBothPackageMetadataPrefetches() 280public async Task NewSourceOverrideSkipsTemplatePackageMetadataPrefetching(bool useTemplateSubcommand) 305public async Task DetachedRunStartsNoPackageMetadataPrefetching() 321public async Task JsonOutputStartsNoCliPackageMetadataPrefetching(Type commandType, string commandLine) 337public async Task CommandSelectedAfterABannerLengthDelayStillDisablesPrefetching() 355return Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>([]); 361GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([channel]) 370return Task.CompletedTask; 397public async Task InFlightPrefetchingCompletesBeforeTheServiceStops() 451await Task.WhenAll(templateEntered.Task, cliEntered.Task).DefaultTimeout(); 478private static async Task AssertPrefetchingAsync( 496return Task.FromResult(Enumerable.Empty<PackageChannel>()); 506return Task.CompletedTask; 549return Task.FromResult(CommandResult.Success());
Packaging\NuGetConfigMergerSnapshotTests.cs (5)
43public async Task Merge_WithSimpleNuGetConfig_ProducesExpectedXml(string channelName) 92public async Task Merge_WithBrokenSdkState_ProducesExpectedXml(string channelName) 154public async Task Merge_WithDailyFeedWithExtraMappingsIsPreserved_ProducesExpectedXml(string channelName) 215public async Task Merge_WithExtraInternalFeedIncorrectlyMapped_ProducesExpectedXml(string channelName) 274public async Task Merge_ExtraPatternOnDailyFeedWhenOnPrFeedGetsConsolidatedWithOtherPatterns_ProducesExpectedXml(string channelName)
Packaging\NuGetConfigMergerTests.cs (24)
32public async Task CreateOrUpdateAsync_CreatesConfigFromMappings_WhenNoExistingConfig() 56public async Task CreateOrUpdateAsync_GeneratesConfigFromMappings_WhenChannelProvided() 84public async Task CreateOrUpdateAsync_AddsMissingSources_WhenUpdatingExistingConfig() 124public async Task CreateOrUpdateAsync_RemapsPatternsAndRemovesEmptySources() 167public async Task CreateOrUpdateAsync_RemapsAspirePackagesFromStagingToStableSource() 211public async Task CreateOrUpdateAsync_CreatesPackageSourceMapping_WhenAbsent() 254public async Task HasMissingSources_ReturnsTrue_WhenPatternMappedToWrongSource() 285public async Task HasMissingSources_ReturnsFalse_WhenAllSourcesAndMappingsPresent() 320public async Task CreateOrUpdateAsync_ReusesExistingSourceKeys_WhenMappingToExistingSourcesByUrl() 369public async Task CreateOrUpdateAsync_PreservesAllExistingSources_WhenCreatingPackageSourceMappingForFirstTime() 432public async Task CreateOrUpdateAsync_AddsSpecificMappings_WhenExistingWildcardMappingPresent() 495public async Task CreateOrUpdateAsync_DoesNotAddWildcardToPrivateSourceWithExistingPatterns() 549public async Task CreateOrUpdateAsync_RemovesUnrequiredSources_InsteadOfAddingWildcardPattern() 627public async Task CreateOrUpdateAsync_RemovesOldPrHive_WhenSwitchingBetweenPrHives() 682public async Task CreateOrUpdateAsync_RemovesOldPrHive_WhenItHasNoMappingElement() 726public async Task CreateOrUpdateAsync_CallbackInvokedForNewConfig() 749return Task.FromResult(true); // Proceed with the update 765public async Task CreateOrUpdateAsync_CallbackCanPreventNewConfigCreation() 782return Task.FromResult(false); // Prevent the update 794public async Task CreateOrUpdateAsync_CallbackInvokedForExistingConfig() 829return Task.FromResult(true); // Proceed with the update 845public async Task CreateOrUpdateAsync_CallbackCanPreventExistingConfigUpdate() 875return Task.FromResult(false); // Prevent the update 888public async Task CreateOrUpdateAsync_WorksWithoutCallback()
Packaging\PackageChannelTests.cs (26)
108public async Task GetTemplatePackagesAsync_PinnedChannelWithMappingsOverride_UsesOverrideSource() 137public async Task GetTemplatePackagesAsync_PinnedChannelWithLocalMappingsOverride_DoesNotFilterToPinnedVersion() 171public async Task GetTemplatePackagesAsync_PinnedLocalChannel_RequiresMatchingPackageFile(bool packageFileExists) 218public async Task GetTemplatePackagesAsync_PinnedRemoteChannelWithLocalMappingsOverride_RequiresMatchingPackageFile(bool packageFileExists) 257public async Task GetTemplatePackagesAsync_UnpinnedChannelWithLocalMappingsOverride_EnumeratesOverrideDirectory() 300public async Task GetTemplatePackagesAsync_ImplicitChannelWithLocalMappingsOverride_EnumeratesOverrideDirectory() 325public async Task GetIntegrationPackagesAsync_WithPinnedLocalSource_ReturnsOnlyPinnedLocalIntegrationPackages() 396public async Task GetPolyglotCompatiblePackageIdsAsync_WithPinnedLocalSource_ReturnsOnlyTaggedIntegrationPackageIds() 427public async Task GetPolyglotCompatiblePackageIdsAsync_LocalFolderSource_UsesConfiguredSdkVersion() 456public async Task GetIntegrationPackagesAsync_AndGetPolyglotCompatiblePackageIdsAsync_WithHierarchicalLocalSource_FindsNestedTaggedPackage() 488public async Task GetIntegrationPackagesAsync_WithStableRemoteSource_QueriesOnlyStablePackages() 500return Task.FromResult<IEnumerable<NuGetPackage>>( 508return Task.FromResult<IEnumerable<NuGetPackage>>( 532public async Task GetIntegrationPackagesAsync_WithPrereleaseRemoteSource_QueriesOnlyPrereleaseAndFiltersStableNoise() 544return Task.FromResult<IEnumerable<NuGetPackage>>([]); 548return Task.FromResult<IEnumerable<NuGetPackage>>( 573public async Task GetIntegrationPackagesAsync_WithBothRemoteSource_ReturnsStableAndPrereleasePackages() 585return Task.FromResult<IEnumerable<NuGetPackage>>( 594return Task.FromResult<IEnumerable<NuGetPackage>>( 635public async Task GetIntegrationPackagesAsync_WithStableLocalSource_ReturnsOnlyStablePackages() 654public async Task GetIntegrationPackagesAsync_WithPrereleaseLocalSource_ReturnsOnlyPrereleasePackages() 673public async Task GetIntegrationPackagesAsync_WithBothLocalSource_ReturnsLatestPackageAcrossQualities() 701public async Task GetIntegrationPackagesAsync_LocalFolderSource_FiltersDeprecatedByDefault() 721public async Task GetIntegrationPackagesAsync_LocalFolderSource_IncludesDeprecatedWhenFlagEnabled() 742public async Task GetIntegrationPackagesAsync_LocalFolderSource_UsesConfiguredSdkVersionInsteadOfStaleChannelPin() 773public async Task GetIntegrationPackagesAsync_LocalFolderSource_BlankConfiguredSdkVersionUsesChannelPin()
Packaging\PackagingServiceTests.cs (67)
22public async Task GetChannelsAsync_WhenStagingChannelDisabled_DoesNotIncludeStagingChannel() 56public async Task GetChannelsAsync_WhenIdentityChannelIsStaging_IncludesStagingChannel() 87public async Task GetChannelsAsync_WhenIdentityChannelIsStagingOnStableShapedCli_DiscoversMixedPackageQualities() 120return Task.FromResult<IEnumerable<NuGetPackage>>( 137return Task.FromResult<IEnumerable<NuGetPackage>>( 189public async Task GetChannelsAsync_WhenIdentityChannelIsStagingPrereleaseShaped_RoutesAspirePackagesToDarcFeed() 230public async Task GetChannelsAsync_WhenIdentityChannelIsStagingStableShaped_RoutesAspirePackagesToDarcFeed() 265public async Task GetChannelsAsync_WhenIdentityChannelIsStagingWithOverrideFeed_UsesOverrideFeed() 295public async Task GetChannelsAsync_WhenStagingIdentityCannotDeriveFeedUrl_OmitsChannelAndWarns() 346public async Task GetChannelsAsync_StagingFeedRoutingDecisionTable( 417public async Task GetChannelsAsync_WhenIdentityOverrideAndVersionOverrideSet_RoutesAspirePackagesToDarcFeed() 451public async Task GetChannelsAsync_WhenVersionOverrideIsStableShaped_UsesBothQuality() 480public async Task GetChannelsAsync_WhenIdentityOverrideIsInvalid_FallsBackToRealIdentity() 506public async Task GetChannelsAsync_WhenOverrideStagingFeedSet_WinsOverVersionOverrideDerivation() 534public async Task GetChannelsAsync_WhenStagingDiagnosticOverridesActive_EmitsWarning() 560public async Task GetChannelsAsync_WhenOnlyVersionOverrideSet_WarnsButSynthesizesNoStagingChannel() 609public async Task GetChannelsAsync_WhenRequestedChannelIsStaging_IncludesStagingChannel() 625public async Task GetChannelsAsync_WhenConfigurationChannelIsStagingOnLocalCli_DoesNotIncludeStagingChannel() 656public async Task GetChannelsAsync_WhenConfigurationChannelIsStagingOnStableCli_IncludesStagingChannelWithSharedFeed() 688public async Task GetChannelsAsync_WhenChannelStagingRequestedOnDailyCli_DoesNotIncludeStagingChannel() 712public async Task GetChannelsAsync_WhenChannelStagingRequestedOnDailyCliWithOverrideFeed_IncludesStagingChannel() 740public async Task GetChannelsAsync_WhenChannelStagingRequestedOnNonReleaseIdentityWithoutOverride_DoesNotIncludeStagingChannel(string identity) 761public async Task GetChannelsAsync_WhenChannelStagingRequestedOnDailyCliWithFeatureFlag_IncludesStagingChannel() 811public async Task GetChannelsAsync_StableChannel_IsExplicitWithAllPackagesMappingToNuGetOrg() 834public async Task GetChannelsAsync_WhenStagingChannelEnabled_IncludesStagingChannelWithOverrideFeed() 877public async Task GetChannelsAsync_WhenStagingChannelEnabledWithOverrideFeed_UsesFullUrl() 909public async Task GetChannelsAsync_WhenStagingChannelEnabledWithAzureDevOpsFeedOverride_UsesFullUrl() 941public async Task GetChannelsAsync_WhenStagingChannelEnabledWithInvalidOverrideFeed_FallsBackToDefault() 972public async Task GetChannelsAsync_WhenStagingChannelEnabledWithQualityOverride_UsesSpecifiedQuality() 1002public async Task GetChannelsAsync_WhenStagingChannelEnabledWithQualityBoth_UsesQualityBoth() 1032public async Task GetChannelsAsync_WhenStagingChannelEnabledWithInvalidQuality_DefaultsToStable() 1062public async Task GetChannelsAsync_WhenStagingChannelEnabledWithoutQualityOverride_DefaultsToStable() 1091public async Task NuGetConfigMerger_WhenChannelRequiresGlobalPackagesFolder_AddsGlobalPackagesFolderConfiguration() 1141public async Task GetChannelsAsync_WhenStagingChannelEnabled_StagingAppearsAfterStableBeforeDaily() 1197public async Task GetChannelsAsync_WhenStagingChannelDisabled_OrderIsDefaultStableDailyPr() 1237public async Task GetChannelsAsync_WhenStagingQualityPrerelease_AndNoFeedOverride_UsesSharedFeed() 1272public async Task GetChannelsAsync_WhenStagingQualityBoth_AndNoFeedOverride_UsesSharedFeed() 1307public async Task GetChannelsAsync_WhenStagingQualityPrerelease_WithFeedOverride_UsesFeedOverride() 1345public async Task NuGetConfigMerger_WhenStagingUsesSharedFeed_DoesNotAddGlobalPackagesFolder() 1388public async Task GetChannelsAsync_WhenStagingPinToCliVersionSet_ChannelHasPinnedVersion() 1420public async Task GetChannelsAsync_WhenStagingPinToCliVersionNotSet_ChannelHasNoPinnedVersion() 1450public async Task GetChannelsAsync_WhenStagingPinToCliVersionSetButNotSharedFeed_ChannelHasNoPinnedVersion() 1481public async Task GetChannelsAsync_WhenLocalHiveContainsProjectTemplatesPackage_ChannelHasPinnedVersion() 1506public async Task GetChannelsAsync_WhenPrIdentityRunsFromDogfoodInstallPrefix_AddsMatchingPrHiveChannel() 1547public async Task GetChannelsAsync_WhenPrIdentityExistsInDefaultHiveAndDogfoodInstallPrefix_UsesDogfoodHiveChannel() 1590public async Task GetChannelsAsync_WhenPrDogfoodHiveHasOnlyMalformedPackageNames_AddsChannelWithoutPinnedVersion() 1626public async Task GetChannelsAsync_WhenPrIdentityDogfoodPackagesDirectoryIsMissing_DoesNotAddPrHiveChannel() 1655public async Task GetChannelsAsync_WhenPrIdentityDoesNotMatchDogfoodDirectory_DoesNotAddPrHiveChannel() 1686public async Task GetChannelsAsync_WhenProcessPathProviderThrows_DoesNotAddPrHiveChannel() 1712public async Task GetChannelsAsync_WhenNonPrIdentityRunsFromDogfoodInstallPrefix_DoesNotAddPrHiveChannel() 1764public async Task LocalHiveChannel_WithPinnedVersion_ReturnsSyntheticTemplatePackage() 1801public async Task StagingChannel_WithPinnedVersion_ReturnsSyntheticTemplatePackage() 1856public async Task StagingChannel_WithPinnedVersion_OverridesIntegrationPackageVersions() 1906public async Task StagingChannel_WithoutPinnedVersion_ReturnsAllPrereleasePackages() 1959public async Task GetChannelsAsync_HiveChannelNameAlwaysMatchesDirectoryName() 1993public async Task GetChannelsAsync_WhenIdentityChannelIsNotLocal_HiveKeepsDirectoryName() 2027public async Task LocalHiveChannel_WithPinnedVersion_ReturnsIntegrationPackagesFromNupkgFiles() 2068public async Task GetChannelsAsync_LocalHive_AspireMappingPointsAtLocalDirectory_NotPublicFeed() 2097public async Task GetChannelsAsync_LocalHive_EmptyDirectory_ReturnsChannelWithNullPinnedVersion() 2136public async Task GetChannelsAsync_LocalHive_EmptyPackagesDirectory_ReturnsChannelWithNullPinnedVersion() 2158public async Task GetChannelsAsync_WhenPackagesOverrideSet_RegistersChannelMappedToOverrideDirectory() 2188public async Task GetChannelsAsync_WhenPackagesOverrideSet_ReplacesSameNamedDiscoveredHive() 2219public async Task GetChannelsAsync_WhenPackagesOverrideHasDuplicateAspireVersions_ThrowsFailFast() 2246public async Task GetChannelsAsync_WhenPackagesOverrideHasNestedDuplicateAspireVersions_ThrowsFailFast() 2276public async Task GetChannelsAsync_WhenPackagesOverrideDirectoryMissing_ThrowsFailFast() 2329return Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>(filtered.ToList()); 2336=> Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>([]);
Packaging\TemporaryNuGetConfigTests.cs (7)
12public async Task CreateAsync_IncludesAllPackageSourceMappings() 52public async Task CreateAsync_WithOnlyAllPackagesMappings_IncludesAllMappings() 87public async Task CreateAsync_WithNoMappings_CreatesValidConfig() 113public async Task CreateAsync_WithConfiguredGlobalPackagesFolder_AddsConfigEntry() 129public async Task CreateAsync_WithExplicitGlobalPackagesFolderOverride_UsesOverrideValue() 151public async Task CreateAsync_WithoutConfiguredGlobalPackagesFolder_IgnoresOverride() 171public async Task CreateAsync_PackageSourceAddKeyMatchesPackageSourceMappingKey(string source)
Processes\IsolatedProcessTests.cs (7)
12public async Task Start_EchoesLine_InvokesOutputCallbackAndCompletesStandardOutputClosed() 38await Task.WhenAll(child.StandardOutputClosed, child.StandardErrorClosed).WaitAsync(TimeSpan.FromSeconds(10)); 46public async Task Start_ExposesFileNameAndArgumentsOnReturnedChild() 70await Task.WhenAll(child.StandardOutputClosed, child.StandardErrorClosed).WaitAsync(TimeSpan.FromSeconds(10)); 75public async Task Start_CallbackThrows_PumpDrainsToEndAndFaultsStandardOutputClosed() 119public async Task DisposeAsync_DoesNotWaitForOutputCallbackToComplete() 162public async Task StartAsync_AfterDispose_ThrowsObjectDisposedException()
Processes\LauncherLivenessMonitorTests.cs (5)
29public async Task LauncherExit_CancelsRun() 50public async Task LauncherAlive_DoesNotCancelRun() 67await Task.Delay(TimeSpan.FromSeconds(3)); 75public async Task Dispose_DisarmsMonitor() 91await Task.Delay(TimeSpan.FromSeconds(3));
Processes\ParentProcessLivenessMonitorTests.cs (11)
14public async Task ParentAlreadyExited_InvokesCallbackWithoutWaitingForFirstTick() 35return Task.CompletedTask; 44public async Task ParentExit_InvokesCallback() 56return Task.CompletedTask; 66public async Task ParentAlive_DoesNotInvokeCallback() 78return Task.CompletedTask; 82await Task.Delay(TimeSpan.FromSeconds(3)); 90public async Task Dispose_DisarmsBeforeParentExit() 102return Task.CompletedTask; 111await Task.Delay(TimeSpan.FromSeconds(3)); 116public async Task ParentExit_CallbackFailureDoesNotFaultDispose()
Processes\ProcessTreeGracefulShutdownServiceTests.cs (8)
21public async Task TryStopProcessTreeWithDcpAsync_UsesDcpStopProcessTreeArguments() 58public async Task TryStopProcessTreeWithDcpAsync_OmitsStartTimeWhenRequested() 83public async Task TryStopProcessTreeWithDcpAsync_UsesLeasedBundleDcpPathWhenAvailable() 144public async Task StopAppHostAsync_PassesRuntimeStartTimeToDcpForLegacyAppHostOnWindows() 200public async Task StopAppHostAsync_CleansUpCliProcessWithoutWaitingForItAsSuccessCondition() 239public async Task StopAppHostAsync_CleansUpCliProcessWithAdjacentRuntimeStartTime() 278public async Task StopAppHostAsync_StopsLegacyAppHostWithAdjacentRuntimeStartTime() 381private static async Task StopProcessAsync(Process process)
Processes\WindowsConsoleProcessJobTests.cs (2)
28public async Task Dispose_KillsAssignedChildProcess() 50public async Task Dispose_KillsAssignedChildProcessWithoutConsoleIsolation()
ProfileCaptureServiceTests.cs (23)
35public async Task StartAsync_LaunchesPrivateDashboardWithConfiguredPortsAndCollectorEnvironment() 87public async Task StartAsync_UsesBundleLayoutManagedPath_WhenOverrideIsAbsent() 114public async Task StartAsync_ThrowsManagedBinaryNotFound_WhenNoManagedBinaryCanBeResolved() 132public async Task StartAsync_WrapsProcessFactoryFailure() 155public async Task StartAsync_WrapsProcessStartFailureAndDisposesExecution() 165process = new TestProcessExecution(fileName, args, env, options, (_, _, _) => Task.FromResult((0, (string?)null)), () => 1) 187public async Task StartAsync_DisposesDashboardProcess_WhenReadinessTimesOut() 216public async Task WaitForDashboardAsync_ReturnsAfterTransientConnectionFailures() 239public async Task WaitForDashboardAsync_ThrowsDashboardExited_WhenProcessExitsBeforeReady() 242var process = CreateStartedProcess((_, _) => Task.FromResult(42)); 255public async Task WaitForDashboardAsync_ThrowsTimeout_WhenDashboardNeverResponds() 275public async Task DisposeAsync_StopsWaitingForExitAfterBoundedTimeout() 286attemptCallback: (_, _, _) => Task.FromResult((0, (string?)null)), 300var disposeTask = session.DisposeAsync().AsTask(); 307await Task.Yield(); 318public async Task ExportAsync_WritesArchiveAfterSessionSpansReachSteadyState() 354public async Task ExportAsync_WritesArchiveWhenDcpSessionSpansUseDcpSessionAttribute() 377public async Task ExportAsync_ReturnsFailure_WhenNoResourceSpansAreExported() 398public async Task ExportAsync_ReturnsFailure_WhenOnlyOtherSessionSpansAreExported() 414public async Task ExportAsync_ThrowsHttpRequestException_WhenTelemetryApiReturnsHtmlFallback() 430public async Task ExportAsync_ThrowsJsonException_WhenTelemetryApiReturnsInvalidJson() 555attemptCallback: (_, _, _) => Task.FromResult((0, (string?)null)), 576(_, _, _) => Task.FromResult((0, (string?)null)),
Projects\AppHostCandidateFinderTests.cs (34)
20public async Task FindCandidateFilesAsync_WithEmptyPatterns_ReturnsEmptyResultAndDoesNotCallGit() 29return Task.FromResult<IReadOnlySet<string>?>(new HashSet<string>()); 43public async Task FindCandidateFilesAsync_DefaultFiltered_UsesGitIncludedFilesAsSource() 60public async Task FindCandidateFilesAsync_DefaultFiltered_PassesSearchDirectoryToGitRepository() 71return Task.FromResult<IReadOnlySet<string>?>(new HashSet<string> 87public async Task FindCandidateFilesAsync_DefaultFiltered_GitMode_AppliesSkipListAndDropsMissingFiles() 104public async Task FindCandidateFilesAsync_DefaultFiltered_GitMode_ExcludesAgentSkillSnippets() 121public async Task FindCandidateFilesAsync_DefaultFiltered_GitMode_ExcludesPathScopedSkillSnippets() 140public async Task FindCandidateFilesAsync_FilesystemFallback_ExcludesPathScopedSkillSnippets() 163public async Task FindCandidateFilesAsync_DefaultFiltered_GitMode_DoesNotPruneWhenSearchRootIsNamedLikeExcludedDirectory() 181public async Task FindCandidateFilesAsync_DefaultFiltered_GitMode_DoesNotApplySkipListToFileName() 198public async Task FindCandidateFilesAsync_DefaultFiltered_GitMode_ExcludesNuGetCachePath() 215public async Task FindCandidateFilesAsync_DefaultFiltered_GitMode_EmitsProfilingActivities() 246public async Task FindCandidateFilesAsync_DefaultFiltered_WhenGitUnavailable_FallsBackToFilesystemWithSkipList() 257return Task.FromResult<IReadOnlySet<string>?>(null); 271public async Task FindCandidateFilesAsync_FilesystemWalk_EmitsProfilingActivities() 284GetIncludedFilesAsyncCallback = (_, _) => Task.FromResult<IReadOnlySet<string>?>(null) 308public async Task FindCandidateFilesAsync_FilesystemFallback_ExcludesNuGetCacheButNotSiblingPrefix() 328public async Task FindCandidateFilesAsync_FilesystemFallback_ExcludesNuGetCacheWithPlatformPathComparison() 350public async Task FindCandidateFilesAsync_AllFilesScope_IncludesSkipListedDirectoriesAndDoesNotCallGit() 361return Task.FromResult<IReadOnlySet<string>?>(new HashSet<string>()); 377public async Task FindCandidateFilesAsync_AllFilesScope_ExcludesNuGetCache() 395public async Task FindCandidateFilesAsync_ExplicitDirectoryScope_AppliesSkipListAndDoesNotCallGit() 406return Task.FromResult<IReadOnlySet<string>?>(new HashSet<string>()); 420public async Task FindCandidateFilesAsync_MaxDepthZero_MatchesOnlySearchDirectoryFiles() 436public async Task FindCandidateFilesAsync_MaxDepthZero_DoesNotMatchDirectoryAwarePatternsBelowSearchDirectory() 450public async Task FindCandidateFilesAsync_DefaultFilteredGitMode_MaxDepthZero_MatchesOnlySearchDirectoryFiles() 467public async Task FindCandidateFilesAsync_ReturnsUniqueFilesAndCountsEveryPattern() 488public async Task FindCandidateFilesAsync_GitMatching_ObservesCancellation() 502public async Task FindCandidateFilesAsync_FilesystemWalk_ObservesCancellation() 515public async Task FindCandidateFilesAsync_PatternWithDirectorySegment_MatchesFromSearchRoot() 530public async Task FindCandidateFilesAsync_DefaultFiltered_WithRealGitRepository_ComposesGitignoreMatchingAndSkipList() 561public async Task FindCandidateFilesAsync_DefaultFiltered_WithRealGitRepository_ScopesSubdirectorySearch() 601GetIncludedFilesAsyncCallback = (_, _) => Task.FromResult<IReadOnlySet<string>?>(includedPaths.ToHashSet())
Projects\AppHostInfoResolverTests.cs (10)
15public async Task GetAppHostInfoAsync_UsesDiskCacheWhenPresent() 56public async Task GetAppHostInfoAsync_CachesSuccessfulMsBuildEvaluationInMemory() 80public async Task GetAppHostInfoAsync_DoesNotCacheFailedMsBuildEvaluationInMemory() 106public async Task GetAppHostInfoAsync_CoalescesConcurrentMsBuildEvaluationInMemory() 130var results = await Task.WhenAll(tasks).DefaultTimeout(); 137public async Task GetAppHostInfoAsync_CallerCancellationDoesNotCancelSharedEvaluation() 171public async Task GetAppHostInfoAsync_RequestsOnlyEvaluationSafeTarget() 239=> Task.FromResult(Entry); 241public Task SetAsync(FileInfo projectFile, string expectedCacheKey, AppHostInfoCacheEntry entry, CancellationToken cancellationToken) 242=> Task.CompletedTask;
Projects\AppHostServerProjectTests.cs (12)
47public async Task CreateProjectFiles_AppSettingsJson_MatchesSnapshot() 71public async Task CreateProjectFiles_ProgramCs_MatchesSnapshot() 93public async Task CreateProjectFiles_GeneratesProgramCs() 114public async Task CreateProjectFiles_GeneratesAppSettingsJson_WithAtsAssemblies() 140public async Task CreateProjectFiles_CopiesAppSettingsToOutput() 163public async Task CreateProjectFiles_SkipsAspireIntegrationAnalyzerReferences() 254public async Task CreateProjectFiles_NuGetConfig_UsesProjectLocalChannel_NotGlobalChannel_MatchesSnapshot() 299return Task.FromResult<IEnumerable<PackageChannel>>(new[] { implicitChannel, prOldChannel, prNewChannel }); 360public async Task CreateProjectFiles_WithPackageSourceOverride_PrependsOverrideToRestoreAdditionalProjectSources() 385GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>(new[] { dailyChannel }) 418public async Task CreateProjectFiles_WithoutPackageSourceOverride_DoesNotInjectExtraSource() 439GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>(new[] { dailyChannel })
Projects\AppHostServerSessionTests.cs (15)
29public async Task Start_DoesNotMutateCallerEnvironmentVariables() 52public async Task Start_PropagatesProfilingContextToServerEnvironment() 89public async Task Start_DoesNotLeaveServerProcessActivityAmbient() 126public async Task GetRpcClientAsync_WhenServerExitsBeforeSocketIsAvailable_FailsWithoutWaitingForConnectionTimeout() 171public async Task Start_CalledTwice_Throws() 184public async Task Start_StopRequested_KillsProcessAndCompletesTask() 209public async Task Start_StopRequested_WithGracefulServices_InvokesGracefulSignalerAndExits() 232return Task.FromResult(true); 258public async Task Start_StopRequested_GracefulIgnored_ExpireEscalatesToTreeKill() 276return Task.FromResult(true); 304public async Task Start_StopRequested_GracefulSignalerThrows_StillEscalatesToKill() 339public async Task DisposeAsync_WithUnconfiguredGracefulService_ForceKillsWithoutSignaling() 378public async Task Start_ProcessExitsNaturally_CompletionReturnsExitCode() 391public async Task Start_ProjectRunThrows_DisposesProjectAndFaultsCompletion() 432static async Task RunScenarioAsync(ThrowingAppHostServerProject project)
Projects\DefaultLanguageDiscoveryTests.cs (6)
13public async Task GetAvailableLanguagesAsync_ReturnsCSharpLanguage() 29public async Task GetAvailableLanguagesAsync_CSharpLanguageHasExpectedDetectionPatterns(string expectedPattern) 40public async Task GetAvailableLanguagesAsync_ReturnsTypeScriptLanguage() 55public async Task GetAvailableLanguagesAsync_ReturnsPythonLanguage() 70public async Task GetAvailableLanguagesAsync_ExcludesExperimentalLanguagesByDefault() 87public async Task GetAvailableLanguagesAsync_IncludesExperimentalLanguageWhenFlagEnabled(string languageId, string featureFlag)
Projects\DotNetAppHostProjectTests.cs (91)
57public async Task ValidateAppHostAsync_OrdinaryMarkerFreeProject_SkipsEvaluation() 74public async Task ValidateAppHostAsync_AppHostConventionalProject_EvaluatesViaResolver() 82GetAppHostInfoAsyncCallback = (_, _) => Task.FromResult(new AppHostProjectInfo( 105public async Task ValidationAndVersionInspectionDoNotAcquireCliBundle() 116return Task.CompletedTask; 121GetAppHostInfoAsyncCallback = (_, _) => Task.FromResult(new AppHostProjectInfo( 149public async Task ValidateAppHostAsync_EvaluatesCleanlyButNotAspireHost_RejectsWithoutPossiblyUnbuildable() 159GetAppHostInfoAsyncCallback = (_, _) => Task.FromResult(new AppHostProjectInfo( 182public async Task ValidateAppHostAsync_LikelyAppHostFailsEvaluation_MarksPossiblyUnbuildable() 191GetAppHostInfoAsyncCallback = (_, _) => Task.FromResult(new AppHostProjectInfo( 315public async Task RunAsync_SingleFileAppHostWithoutRunJsonPassesDevelopmentEnvironmentToRunner() 333return Task.FromResult(0); 349public async Task RunAsync_SingleFileAppHostUsesEnvironmentArgumentWhenProvided() 365return Task.FromResult(0); 382public async Task FindAndStopRunningInstanceAsync_CleansUpDeadPidSocketAndReturnsNoRunningInstance() 399public async Task FindAndStopRunningInstanceAsync_KeepsLivePidSocketAndReportsStopFailureWhenConnectionFails() 416public async Task RunAsync_ProjectAppHostUsingCliBundlePassesBundleEnvironmentToRunner() 461return Task.FromResult(0); 477public async Task RunAsync_ProjectAppHostUsingCliBundlePreservesCallerProvidedRuntimePaths() 510return Task.FromResult(0); 530public async Task RunAsync_ProjectAppHostUsingCliBundlePreservesInheritedRuntimePaths() 569return Task.FromResult(0); 589public async Task RunAsync_ProjectAppHostUsingCliBundleReplacesUnusableRuntimePaths( 632return Task.FromResult(0); 648public async Task RunAsync_ProjectAppHostUsingCliBundleDoesNotInjectInspectionRuntimePaths() 674return Task.FromResult(42); 693public async Task RunAsync_ProjectAppHostUsingCliBundleDoesNotInjectMissingLayoutComponents() 720return Task.FromResult(0); 740public async Task PublishAsync_ProjectAppHostUsingCliBundleDoesNotAcquireOrInjectBundle(bool noBuild) 752return Task.CompletedTask; 777return Task.FromResult(0); 799public async Task RunAsync_ProjectAppHostNotUsingCliBundleStillReceivesTerminalHostEnvironment() 845return Task.FromResult(0); 861public async Task RunAsync_ProjectAppHostNotUsingCliBundleUsesRepoLocalManagedWhenAvailable() 903return Task.FromResult(0); 919public async Task RunAsync_PreservesExplicitTerminalHostEnvironmentVariables() 957return Task.FromResult(0); 976public async Task RunAsync_ProjectAppHostUsesDirectCommandLaunchAndAppliesLaunchSettings() 1056return Task.FromResult(123); 1076public async Task RunAsync_ProjectAppHostDirectLaunchAppliesSelectedLaunchProfile() 1139return Task.FromResult(125); 1160public async Task RunAsync_ProjectAppHostMissingSelectedLaunchProfileFallsBackWithoutSelectingDefault() 1195return Task.FromResult(126); 1212public async Task RunAsync_ProjectAppHostSelectedLaunchProfileWithoutLaunchSettingsFallsBack() 1229return Task.FromResult(127); 1246public async Task RunAsync_ProjectAppHostAmbiguousSelectedLaunchProfileFallsBack() 1271return Task.FromResult(128); 1288public async Task RunAsync_ProjectAppHostSelectedLaunchProfileWithInvalidCommandNameCasingFallsBack() 1312return Task.FromResult(129); 1332public async Task RunAsync_ProjectAppHostSelectedLaunchProfileWithInvalidSdkPropertyFallsBack(string invalidProperty) 1362return Task.FromResult(131); 1379public async Task RunAsync_ProjectAppHostDuplicateSelectedLaunchProfileFallsBack() 1406return Task.FromResult(130); 1423public async Task RunAsync_ProjectAppHostDirectLaunchSetsWorkloadIdAndPreservesLaunchProfileInputs() 1461return Task.FromResult(124); 1477public async Task RunAsync_ProjectAppHostDirectLaunchCanBeDisabledByConfig() 1517return Task.FromResult(77); 1534public async Task RunAsync_ProjectAppHostDirectLaunchFallsBackWhenDotnetExecTargetIsMissing() 1545public async Task RunAsync_ProjectAppHostDirectLaunchFallsBackWhenRuntimeConfigIsMissing() 1558public async Task RunAsync_ProjectAppHostDirectLaunchFallsBackWhenNativeRunCommandIsMissing() 1569public async Task RunAsync_ProjectAppHostDirectLaunchFallsBackForMultiTargetedAppHost() 1580public async Task RunAsync_ProjectAppHostDirectLaunchFallsBackWhenRunCommandIsMissing() 1589public async Task RunAsync_ProjectAppHostDirectLaunchFallsBackWhenDotnetRunArgumentsDoNotUseExec() 1598public async Task RunAsync_ProjectAppHostUsesSdkPathWhenWatchIsEnabled() 1611public async Task RunAsync_ProjectAppHostUsesSdkPathForExtensionHost() 1627public async Task RunAsync_ProjectAppHostDirectLaunchUsesProfileArgsWhenRunCommandHasNoArgs() 1672return Task.FromResult(88); 1688public async Task RunAsync_ProjectAppHostDirectLaunchExpandsLaunchSettingsEnvironmentVariablesAndArgs() 1727return Task.FromResult(88); 1748public async Task RunAsync_ProjectAppHostDirectLaunchPreservesDotnetExecRunArguments() 1781return Task.FromResult(99); 1798public async Task RunAsync_ProjectAppHostDirectLaunchReadsFlatRunJson() 1847return Task.FromResult(101); 1863public async Task RunAsync_VbProjectAppHostDirectLaunchReadsMyProjectLaunchSettings() 1908return Task.FromResult(102); 1924public async Task RunAsync_ProjectAppHostFallsBackToDotnetRunForExecutableLaunchProfile() 1971return Task.FromResult(103); 1989public async Task RunAsync_ProjectAppHostFallsBackToDotnetRunWhenLaunchSettingsProfilesIsNull() 2030return Task.FromResult(104); 2046public async Task RunAsync_ProjectAppHostDirectLaunchSkipsNullLaunchSettingsProfileAndEnvironmentValues() 2096return Task.FromResult(105); 2112public async Task RunAsync_SingleFileAppHostUsingCliBundlePassesBundleEnvironmentToRunner() 2157return Task.FromResult(0); 2173public async Task PublishAsync_SingleFileAppHostStripsRunProfileEnvironmentBeforeInvokingRunner() 2210return Task.FromResult(0); 2225public async Task PublishAsync_SingleFileAppHostUsesEnvironmentArgumentWhenProvided() 2241return Task.FromResult(0); 2256public async Task PublishAsync_SingleFileAppHostUsingCliBundleDoesNotAcquireOrInjectBundle() 2267return Task.CompletedTask; 2289return Task.FromResult(0); 2601return Task.FromResult(77);
Projects\DotNetBasedAppHostServerScaffoldCacheTests.cs (5)
23public async Task CreateProjectFiles_PreservesRestoreArtifacts_WhenScaffoldContentUnchanged() 41public async Task CreateProjectFiles_ClearsRestoreArtifacts_WhenIntegrationSetChanges() 69public async Task CreateProjectFiles_RewritesScaffold_WhenAScaffoldFileWasDeleted() 91public async Task CreateProjectFiles_RewritesScaffold_WhenRestoreArtifactsAreAbsent() 115public async Task CreateProjectFiles_ClearsRestoreArtifacts_WhenProjectReferencePathChanges()
Projects\ExtensionGuestLauncherTests.cs (14)
14public async Task LaunchAsync_PrependsCommandAsFirstArg() 45public async Task LaunchAsync_PassesAppHostFileAsProjectFile() 62public async Task LaunchAsync_PassesDebugFlag() 77public async Task LaunchAsync_PassesEnvironmentAsEnvVars() 101public async Task LaunchAsync_ReturnsZeroExitCodeAndNullOutput() 113public async Task LaunchAsync_WithEmptyArgs_OnlyContainsCommand() 143public Task FlushAsync(CancellationToken cancellationToken = default) => Task.CompletedTask; 145public Task LaunchAppHostAsync(string projectFile, List<string> arguments, List<EnvVar> environment, bool debug) 148return Task.CompletedTask; 157public Task StartDebugSessionAsync(string workingDirectory, string? projectFile, bool debug, DebugSessionOptions? options = null) => throw new NotImplementedException(); 159public Task RequestAppHostAttachAsync(int processId, string projectName) => throw new NotImplementedException(); 186public Task DisplayLiveAsync(Spectre.Console.Rendering.IRenderable initialRenderable, Func<Action<Spectre.Console.Rendering.IRenderable>, Task> callback) => throw new NotImplementedException();
Projects\FallbackProjectParserTests.cs (14)
20public async Task ParseProject_ExtractsAspireAppHostSdk_OldFormat() 42public async Task ParseProject_ExtractsAspireAppHostSdk_NewFormat() 67public async Task ParseProject_ExtractsAspireAppHostSdk_NewFormat_WithMultipleSdks() 92public async Task ParseProject_DoesNotMatchSimilarSdkName() 117public async Task ParseProject_ExtractsPackageReferences() 143public async Task ParseProject_ExtractsProjectReferences() 182public async Task ParseProject_InvalidXml_ThrowsProjectUpdaterException() 204public async Task ParseProject_SingleFileAppHost_ExtractsAspireAppHostSdk() 228public async Task ParseProject_SingleFileAppHost_ExtractsPackageReferences() 258public async Task ParseProject_SingleFileAppHost_NoPackageReferences() 281public async Task ParseProject_SingleFileAppHost_WithWildcardVersion() 305public async Task ParseProject_SingleFileAppHost_NoProjectReferences() 328public async Task ParseProject_SingleFileAppHost_NoSdkDirective() 350public async Task ParseProject_UnsupportedFileType_ThrowsProjectUpdaterException()
Projects\GuestAppHostProjectTests.cs (46)
49public async Task PruneObsoleteGeneratedFilesAsync_RemovesFilesTheGeneratorNoLongerProduces() 77public async Task PruneObsoleteGeneratedFilesAsync_LeavesFilesTheGeneratorNeverWrote() 93public async Task WriteGeneratedFileAsync_WhenContentIsUnchanged_LeavesTimestampAlone() 109public async Task WriteGeneratedFileAsync_WhenContentDiffers_WritesFile() 123public async Task WriteGeneratedFileAsync_WhenFileIsMissing_WritesFile() 134public async Task WriteGeneratedFileAsync_WhenNotPreservingUnchangedFiles_RewritesIdenticalContent() 411public async Task AspireJsonConfiguration_MatchesSnapshot() 723public async Task UpdatePackagesAsync_WhenRegenerationFails_DoesNotMutateConfig() 739Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>( 776public async Task AddPackageAsync_WhenRegenerationFails_DoesNotMutateConfig() 792Task.FromResult<IAppHostServerProject>(new FakeFailingAppHostServerProject(appPath)) 817public async Task FindAndStopRunningInstanceAsync_CleansUpDeadPidSocketAndReturnsNoRunningInstance() 825Task.FromResult<IAppHostServerProject>(new FakeFailingAppHostServerProject(appPath)) 841public async Task UpdatePackagesAsync_ExplicitStableChannel_WhenRegenerationFails_DoesNotMutateConfig() 858Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>( 897public async Task UpdatePackagesAsync_ExplicitStagingChannel_WhenRegenerationFails_DoesNotMutateConfig() 913Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>( 952public async Task UpdatePackagesAsync_ExplicitStableChannel_DoesNotPersistStableChannelWhenProjectIsUpToDate() 969Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>( 1022public async Task RunAsync_DoesNotMutateConfigChannel(string? seededChannel) 1050Task.FromResult<IAppHostServerProject>(new FakeFailingAppHostServerProject(path)) 1077public async Task StartBackchannelConnectionAsync_WhenGuestServerExitsBeforeBackchannelConnects_ReportsExitCodeWhenKnown( 1101public async Task StartBackchannelConnectionAsync_UsesConfiguredBackchannelTimeout() 1136public async Task RunAsync_PassesWorkloadIdToAppHostServerEnvironment() 1146Task.FromResult<IAppHostServerProject>(new FakeSucceedingAppHostServerProject(path)) 1151GetRpcClientAsyncCallback = _ => Task.FromException<IAppHostRpcClient>( 1178public async Task PublishAsync_PassesResolvedAspireHomeToAppHostServerEnvironment() 1187Task.FromResult<IAppHostServerProject>(new FakeSucceedingAppHostServerProject(path)) 1191GetRpcClientAsyncCallback = _ => Task.FromException<IAppHostRpcClient>( 1254public async Task UpdatePackagesAsync_DoesNotEmitStaleVersionSkewWarningDuringUpdate() 1274Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>( 1290Task.FromResult<IAppHostServerProject>(new FakeSucceedingAppHostServerProject(appPath)) 1343public async Task UpdatePackagesAsync_EmitsVersionSkewWarningWhenTargetDiffersFromCli() 1363Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>( 1379Task.FromResult<IAppHostServerProject>(new FakeSucceedingAppHostServerProject(appPath)) 1513public async Task ConfigureCertificateBundleEnvironmentAsync_SetsEnvironmentVariable_WhenExistingValueIsNotUsable(string? existingValue) 1534public async Task ConfigureCertificateBundleEnvironmentAsync_ReusesDevCertificate_WhenAlreadyConfigured() 1556public async Task ConfigureCertificateBundleEnvironmentAsync_UsesCaseInsensitivePathComparisonOnWindows() 1577public async Task ConfigureCertificateBundleEnvironmentAsync_DoesNotAssumeMacOSPathsAreCaseInsensitive() 1611public async Task ConfigureCertificateBundleEnvironmentAsync_DoesNotSet_WhenPemPathIsNull() 1628public async Task ConfigureCertificateBundleEnvironmentAsync_CreatesAndReusesCombinedBundle_WhenAlreadySet() 1704public async Task ConfigureCertificateBundleEnvironmentAsync_PreservesExistingBundle_WhenCombinationFails() 1728private static async Task InvokeStartBackchannelConnectionAsync( 1739var task = Assert.IsAssignableFrom<Task>(method.Invoke(project, [ 1753=> Task.FromResult(true);
Projects\GuestRuntimeTests.cs (50)
118public async Task RunAsync_UsesExecuteSpec() 138public async Task RunAsync_WatchMode_UsesWatchExecuteSpec() 156public async Task RunAsync_WatchModeWithWatchExecute_SkipsPreExecute() 178public async Task RunAsync_RunsPreExecuteBeforeExecute() 200public async Task RunAsync_NoBuildSkipsTypeScriptTscAndRunsAppHost() 224public async Task RunAsync_CallsAfterAppHostLaunchedAfterPreExecute() 250return Task.CompletedTask; 259public async Task RunAsync_ProfilingTelemetryRecordsGuestCommandPhasesAndArgs() 319public async Task RunAsync_WhenPreExecuteFails_DoesNotExecute() 344return Task.CompletedTask; 354public async Task RunAsync_WhenExecuteCommandCannotResolve_DoesNotCallAfterAppHostLaunched() 373return Task.CompletedTask; 381public async Task RunAsync_WatchModeWithoutWatchSpec_FallsBackToExecute() 395public async Task PublishAsync_UsesPublishExecuteSpec() 413public async Task PublishAsync_RunsPreExecuteBeforePublishExecute() 435public async Task PublishAsync_CallsAfterAppHostLaunchedAfterPreExecute() 461return Task.CompletedTask; 471public async Task PublishAsync_NoBuildSkipsTypeScriptTscAndRunsAppHost() 495public async Task PublishAsync_WithoutPublishSpec_FallsBackToExecute() 509public async Task RunAsync_MergesSpecEnvironmentVariables() 530public async Task RunAsync_SpecEnvironmentVariables_TakePrecedence() 550public async Task RunAsync_ReplacesAppHostFilePlaceholder() 569public async Task RunAsync_ReplacesAppHostDirPlaceholder() 587public async Task PublishAsync_AdditionalArgsAppendedWhenNoPlaceholder() 607public async Task RunAsync_EmptyPlaceholderReplacementsAreSkipped() 650public async Task InstallDependenciesAsync_WithNoSpec_ReturnsZero() 662public async Task InstallDependenciesAsync_WhenNpmIsMissing_ReturnsNodeInstallMessage() 689public async Task RunAsync_WhenNpxIsMissing_ReturnsNodeInstallMessage() 723public async Task ProcessGuestLauncher_WritesOutputToLogFile() 773public async Task ProcessGuestLauncher_AnnotatesAmbientGuestProfilingActivity() 826public async Task ProcessGuestLauncher_ClosesChildStdinSoReadsObserveEof() 882public async Task ProcessGuestLauncher_KillsProcessAndReturnsOnCancellation() 920await Task.Delay(500); 944public async Task RunAsync_CreatesMissingMigrationFiles() 987public async Task RunAsync_DoesNotOverwriteExistingMigrationFiles() 1030public async Task RunAsync_NoMigrationFiles_ExecutesNormally() 1048public async Task RunAsync_WhenPreExecuteHasNoStamp_RunsCommandAndWritesStamp() 1063public async Task RunAsync_WhenStampIsNewerThanInputs_SkipsPreExecute() 1083public async Task RunAsync_WhenAnyJavaInputIsNewerThanStamp_RunsPreExecute(string relativeInput) 1101public async Task RunAsync_UpToDateCheckIgnoresFilesOutsideTheDeclaredExtensions() 1127public async Task RunAsync_WhenAJavaInputIsDeleted_RunsPreExecute(string relativeInput) 1149public async Task RunAsync_WhenAnExplicitlyNamedInputChanges_RunsPreExecuteRegardlessOfItsExtension() 1171public async Task RunAsync_WhenTheStagedDependencySetChanges_RunsPreExecute() 1200public async Task RunAsync_WhenAStagedDependencyIsRestagedInPlace_SkipsPreExecute() 1224public async Task RunAsync_UpToDateCheckDoesNotRecurseIntoNonRecursiveInputs() 1265public async Task RunAsync_UpToDateCheckSeesAnEditToANestedPackageUnderTheAppHostDirectory() 1290public async Task RunAsync_UpToDateCheckIgnoresChurnInDirectoriesThatCannotHoldJavaPackages() 1335public async Task RunAsync_UpToDateCheckTreatsAnUnreadableInputTreeAsOutOfDateInsteadOfThrowing() 1378public async Task RunAsync_WhenPreExecuteFails_DoesNotWriteStamp() 1473Func<Task>? afterLaunchAsync,
Projects\JavaAppHostToolchainResolverTests.cs (6)
397public async Task EnsureToolchainFilesExistAsync_ForGradle_WritesTheInitScriptAndOverwritesAStaleOne() 416public async Task EnsureToolchainFilesExistAsync_ForGradle_StagesWithSyncSoUpgradedDependenciesDoNotAccumulate() 432public async Task ClearStagedDependencies_ForMaven_RemovesPreviouslyStagedDependencies() 460public async Task ClearStagedDependencies_ForGradle_LeavesTheDirectoryToTheSyncTask() 480public async Task EnsureToolchainFilesExistAsync_ForANonGradleToolchain_WritesNothing(bool useJavac) 566public async Task EnsureToolchainFilesExistAsync_WithTheConventionalSourceLayout_WritesTheScriptNextToTheBuildFile()
Projects\PrebuiltAppHostServerTests.cs (75)
28public async Task WriteIfChangedAsync_LeavesAnIdenticalFileAlone() 45public async Task WriteIfChangedAsync_WritesWhenContentDiffers() 56public async Task WriteIfChangedAsync_RewritesAFileItCannotRead() 118public async Task ComputeRestoreInputsAsync_FingerprintChangesWhenAReferencedProjectChanges() 136public async Task ComputeRestoreInputsAsync_FingerprintChangesWhenACentrallyManagedVersionChanges() 157public async Task ComputeRestoreInputsAsync_FingerprintChangesWhenATransitivelyReferencedProjectChanges() 177public async Task ComputeRestoreInputsAsync_IsNotEligibleForSkipWhenATransitivelyReferencedProjectFloats() 192public async Task ComputeRestoreInputsAsync_ToleratesAProjectReferenceCycle() 209public async Task ComputeRestoreInputsAsync_FingerprintIsStableForUnchangedInputs() 223public async Task ComputeRestoreInputsAsync_IsNotEligibleForSkipWhenAReferencedProjectFloats() 238public async Task ComputeRestoreInputsAsync_IsEligibleForSkipWhenEveryVersionIsExact() 643public async Task TryCreateTemporaryNuGetConfig_LocalIdentity_LocalRequested_ReturnsNull() 657public async Task TryCreateTemporaryNuGetConfig_LocalIdentity_PrRequested_EmitsConfig() 672public async Task TryCreateTemporaryNuGetConfig_StableIdentity_StableRequested_EmitsConfig() 686public async Task TryCreateTemporaryNuGetConfig_StableIdentity_LocalRequested_ReturnsNull() 701public async Task TryCreateTemporaryNuGetConfig_DailyIdentity_DailyRequested_EmitsConfig() 716public async Task TryCreateTemporaryNuGetConfig_PrIdentity_DifferentPrRequested_EmitsConfig() 730public async Task TryCreateTemporaryNuGetConfig_LocalIdentity_StagingRequested_EmitsConfigWithGlobalPackagesFolder() 785public async Task TryCreateTemporaryNuGetConfig_StagingRequested_FromRealPackagingService_EmitsStableGlobalPackagesFolderOutsideTempDir() 846public async Task TryCreateTemporaryNuGetConfig_LocalRequested_ReturnsNull_RegardlessOfIdentity(string identity) 863public async Task TryCreateTemporaryNuGetConfig_WithPackageSourceOverride_MapsAspireToOverrideAndAddsNuGetOrgFallback() 869GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([]) 885public async Task TryCreateTemporaryNuGetConfig_WithPackageSourceOverrideWithoutRequestedChannel_DoesNotMergeExplicitChannelAspireMappings() 915public async Task TryCreateTemporaryNuGetConfig_WithPackageSourceOverride_PreservesRequestedChannelMappingsAndGlobalPackagesFolder() 965public async Task TryCreateTemporaryNuGetConfig_WithPackageSourceOverride_DropsRequestedChannelAspireMappings() 991public async Task TryCreateTemporaryNuGetConfig_WithPackageSourceOverride_PassesRequestedChannelToPackagingService() 997GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([]) 1011public async Task TryCreateTemporaryNuGetConfig_WithPackageSourceOverride_UsesChannelAllPackagesMappingAsFallback() 1037public async Task TryCreateTemporaryNuGetConfig_WithPackageSourceOverride_WhenChannelLookupFails_StillCreatesOverrideConfigWithFallback() 1059public async Task GetNuGetSources_WithPackageSourceOverrideAndMatchedChannel_OmitsChannelAspireFeedFromSources() 1087public async Task GetNuGetSources_WithPackageSourceOverrideAndMatchedChannelNonAspireMapping_KeepsChannelSourceAndAddsNuGetOrgFallback() 1111public async Task GetNuGetSources_WithPackageSourceOverrideAndMatchedChannelAllPackagesMapping_OmitsNuGetOrgFallback() 1149public async Task TryCreateTemporaryNuGetConfig_StagingRequested_RefusesWhenPackagingServiceReportsUnavailable() 1168public async Task TryCreateTemporaryNuGetConfig_StagingRequestedWithSourceOverride_RefusesWhenPackagingServiceReportsUnavailable() 1183public async Task GetNuGetSources_StagingRequested_RefusesWhenPackagingServiceReportsUnavailable() 1202public async Task GetNuGetSources_NonStagingRequest_NotAffectedByStagingUnavailableReason() 1218GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([dailyChannel]), 1248GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([dailyChannel]), 1324GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([channel]) 1368public async Task ResolveRequestedChannel_UsesProjectLocalAspireConfig() 1387public async Task PrepareAsync_WithNoIntegrations_WritesDefaultAppSettings() 1415public async Task PrepareAsync_WithPackageReferences_SetsOnlyPackageProbeManifest() 1449public async Task PrepareAsync_WithPackageReferences_UsesPackageSourceOverride() 1490public async Task PrepareAsync_WithPackageSourceOverride_AddsNuGetOrgFallbackSource() 1531public async Task PrepareAsync_WithHiveBackedChannel_UsesLocalAspireSourceAsOverride(string channelName) 1552GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([channel]) 1589public async Task PrepareAsync_WithHiveBackedChannelUsingFileUri_UsesLocalAspireSourceAsOverride() 1611GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([channel]) 1648public async Task PrepareAsync_WithExplicitPackageSourceOverride_IgnoresHiveBackedAspireSource() 1675GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([channel]) 1709public async Task PrepareAsync_WithHttpBackedChannel_DoesNotUseExactPackageVersions() 1730GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([channel]) 1763public async Task PrepareAsync_WhenPackagingServiceThrowsDuringAutoDiscovery_DegradesGracefully() 1784GetChannelsAsyncCallback = _ => Task.FromException<IEnumerable<PackageChannel>>( 1817public async Task PrepareAsync_WithHiveBackedChannelPointingAtMissingLocalDirectory_DoesNotApplyOverride() 1845GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([channel]) 1885public async Task PrepareAsync_WithSourceAndChannelHavingAspireMapping_TempConfigDropsChannelAspireMapping() 1914GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([dailyChannel]) 1969public async Task PrepareAsync_RestoreFailure_OutputIncludesSourceAndChannelContext() 2014public async Task PrepareAsync_RestoreFailure_WithManyPackages_TruncatesPackageList() 2056public async Task PrepareAsync_WithProjectReferencesAndExplicitChannelButNoOverride_UsesAdditionalSourcesNotRestoreConfigFile() 2096GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([dailyChannel]) 2138public async Task PrepareAsync_RestoreFailure_WithAutoDiscoveredLocalSource_FooterShowsEffectiveSource() 2164GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([prChannel]) 2208public async Task PrepareAsync_WithProjectReferencesAndPackageSourceOverride_UsesNuGetConfig() 2265public async Task PrepareAsync_WithStagingPinnedProjectOutsideLaunchDirectory_UsesStagingSourcesAndNuGetConfig() 2315GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([stagingChannel]) 2350public async Task PrepareAsync_WithOnlyProjectReferences_SetsOnlyProjectLayout() 2386public async Task PrepareAsync_WithProjectReferences_ReusesProjectLayoutWhenClosureIsUnchanged() 2419public async Task PrepareAsync_WithProjectReferences_WritesPackageProbeManifestAndCopiesOnlyProjectOutputs() 2464public async Task PrepareAsync_WithProjectReferences_WritesPackageResourcesAndNativeAssetsToProbeManifest() 2524public async Task PrepareAsync_WithProjectReferences_CreatesNewProjectLayoutWhenClosureChanges() 2562public async Task PrepareAsync_WithProjectReferences_RecreatesProjectLayoutWhenCachedLayoutIsCorrupt() 2599public async Task PrepareAsync_WithProjectReferences_DoesNotTouchLockedPreviousProjectLayout() 2736public async Task PrepareAsync_WithProjectReferences_ReusesProjectLayoutWhenOnlyPackageTimestampChanges()
Projects\ProcessGuestLauncherTests.cs (13)
30public async Task LaunchAsync_WithIsolatedConsoleForGracefulShutdown_RequestsKillOnParentExit() 51public async Task LaunchAsync_NoOptions_OnCancellation_ForceKillsProcessTreeAndReturns() 74await Task.Delay(500); 88public async Task LaunchAsync_WithGracefulServices_GracefulSucceeds_NoTreeKillEscalation() 113return Task.FromResult(true); 130await Task.Delay(500); 141public async Task LaunchAsync_WithGracefulServices_BlockingSignalerDoesNotConsumeGracefulBudget() 182await Task.Delay(500); 197public async Task LaunchAsync_WithGracefulServices_ProcessIgnoresSignal_ExpireEscalatesToTreeKill() 219return Task.FromResult(true); 265public async Task LaunchAsync_WithGracefulServices_SignalerThrows_StillEscalatesToTreeKill() 296await Task.Delay(500); 390await Task.Delay(50);
Projects\ProjectLocatorTests.cs (140)
59public async Task UseOrFindAppHostProjectFilePreservesExistingDefaultForInvocationScopedSelection(string selectionOrigin) 90public async Task UseOrFindAppHostProjectFilePreservesExistingDefaultForExplicitAppHost() 119public async Task UseOrFindAppHostProjectFilePreservesExistingDefaultForEmptySelectionOrigin() 152public async Task UseOrFindAppHostProjectFileReplacesExistingDefaultForPersistentSelectionOrigin(string selectionOrigin) 185public async Task UseOrFindAppHostProjectFilePersistsSelectionFromExplicitDirectoryPrompt(string? selectionOrigin) 218public async Task UseOrFindAppHostProjectFilePreservesExistingDefaultForSingleAppHostDirectory() 247public async Task UseOrFindAppHostProjectFileEstablishesDefaultForLaunchConfiguration() 271public async Task UseOrFindAppHostProjectFileEstablishesDefaultForExplicitAppHost() 293public async Task ConcurrentLaunchConfigurationsEstablishWorkspaceDefaultOnce() 330var results = await Task.WhenAll(callers).DefaultTimeout(); 366public async Task UseOrFindAppHostProjectFileReplacesDeletedDefaultForInvocationScopedSelection(string selectionOrigin) 397public async Task UseOrFindAppHostProjectFilePreservesInvalidExistingDefaultForLaunchConfiguration() 433public async Task UseOrFindAppHostProjectFileReplacesDeletedDefaultForExplicitAppHost() 483public async Task UseOrFindAppHostProjectFileThrowsIfExplicitProjectFileDoesNotExist() 500public async Task UseOrFindAppHostProjectFileKeepsExplicitAppHostThatCannotBeEvaluated() 533public async Task UseOrFindAppHostProjectFileKeepsConfiguredAppHostThatCannotBeEvaluatedAndIgnoresHealthyDecoy() 583public async Task UseOrFindAppHostProjectFileKeepsConfiguredAppHostOutsideAmbientDiscoveryRoot() 620public async Task UseOrFindAppHostProjectFileThrowsWhenAmbientDiscoveryOnlyFindsUnbuildableAppHosts() 656public async Task UseOrFindAppHostProjectFileThrowsSpecificDiagnosticWhenExplicitFileIsMissing() 687public async Task UseOrFindAppHostProjectFileThrowsSpecificDiagnosticWhenExplicitFileIsDefinitelyNotAnAppHost() 715public async Task UseOrFindAppHostProjectFileUsesCachedSettingsWhenStillValidAmongMultipleAppHosts() 748public async Task UseOrFindAppHostProjectFileUsesAppHostSpecifiedInSettings() 776public async Task UseOrFindAppHostProjectFileUsesAppHostSpecifiedInSettingsWalksTree() 806public async Task UseOrFindAppHostProjectFileFallsBackWhenSettingsFileSpecifiesNonexistentAppHost() 847public async Task UseOrFindAppHostProjectFileFallsBackWhenSettingsFileSpecifiesExistingNonAppHost() 896public async Task UseOrFindAppHostProjectFileFallsBackToSingleFileAppHostWhenLegacySettingsFileSpecifiesMissingAppHostPath() 922public async Task UseOrFindAppHostProjectFileFallsBackToSingleFileAppHostWhenConfigFileSpecifiesMissingAppHostPath() 958public async Task UseOrFindAppHostProjectFileUsesValidSettingsWithoutScanning() 996public async Task UseOrFindAppHostProjectFileUsesValidSettingsWithoutScanningInThrowMode() 1034public async Task UseOrFindAppHostProjectFileUsesValidGuestAppHostSettingsWithoutScanning() 1070public async Task UseOrFindAppHostProjectFileFallsBackToDiscoveryWhenConfiguredAppHostIsUnsupported() 1119public async Task UseOrFindAppHostProjectFileKeepsConfiguredAppHostThatCannotBeEvaluatedWhenListingCandidates() 1175public async Task UseOrFindAppHostProjectFileScansWhenCandidateListingModeHasValidSettings() 1212public async Task UseOrFindAppHostProjectFileIncludesSettingsAppHostInCandidatesWhenOutsideDiscovery() 1252public async Task UseOrFindAppHostProjectFileTreatsSettingsAppHostWithoutProjectHandlerAsUnsupported() 1286public async Task UseOrFindAppHostProjectFileNormalizesForwardSlashesInSettings() 1318public async Task UseOrFindAppHostProjectFilePromptsWhenMultipleFilesFound() 1336public async Task UseOrFindAppHostProjectFileOnlyConsidersValidAppHostProjects() 1364public async Task UseOrFindAppHostProjectFileThrowsIfNoProjectWasFound() 1382public async Task UseOrFindAppHostProjectFileReturnsExplicitProjectIfExistsAndProvided(string projectFileExtension) 1397public async Task UseOrFindAppHostProjectFileResultUsesOnDiskCasingForExplicitPath() 1429public async Task UseOrFindAppHostProjectFileReturnsProjectFileInDirectoryIfNotExplicitlyProvided() 1443public async Task UseOrFindAppHostProjectFileUpdatesStaleConfigForExplicitProjectFile() 1468projectFactory: new TestTypeScriptStarterProjectFactory((_, _, _) => Task.FromResult(true))); 1480public async Task CreateSettingsFileIfNotExistsAsync_UsesForwardSlashPathSeparator() 1519public async Task UseOrFindAppHostProjectFile_UpdatesAppHostAdjacentConfigWhenDiscoveredFromParent() 1586public async Task UseOrFindAppHostProjectFile_UpdatesSelectedAppHostAdjacentConfigWhenMultipleAppHostsFound() 1656public async Task UseOrFindAppHostProjectFile_HealsStaleAppHostPathInAdjacentConfig() 1703public async Task UseOrFindAppHostProjectFile_MigratesLegacySettingsToAspireConfigJson() 1748public async Task FindAppHostProjectFilesAsync_DiscoversSingleFileAppHostInRootDirectory() 1773public async Task FindAppHostProjectFilesAsync_DiscoversSingleFileAppHostInSubdirectory() 1798public async Task FindAppHostProjectFilesAsync_IgnoresSingleFileAppHostWhenSiblingCsprojExists() 1854public async Task FindAppHostProjectFilesAsync_IgnoresSingleFileAppHostWithoutDirective() 1873public async Task FindAppHostProjectFilesAsync_HandlesMixedAppHostAndSingleFile() 1916public async Task FindAppHostProjectFilesAsync_DoesNotDuplicateFilesThatMatchMultiplePatterns() 1943public async Task UseOrFindAppHostProjectFileAsync_AcceptsExplicitSingleFileAppHost() 1966public async Task UseOrFindAppHostProjectFileAsync_RejectsInvalidSingleFileAppHost() 1988public async Task UseOrFindAppHostProjectFileAsync_PreservesSilentDiscoveryWhenInvalidAppHostCsFallsBackToParentDirectory() 2014public async Task UseOrFindAppHostProjectFileAsync_AllowsSingleFileAppHostWithSiblingCsproj() 2040public async Task UseOrFindAppHostProjectFileAsync_RejectsInvalidFileExtension() 2059public async Task UseOrFindAppHostProjectFileAsync_ThrowsMultipleProjectsWhenBothCsprojAndSingleFileFound() 2100public Task SetConfigurationAsync(string key, string value, bool isGlobal = false, CancellationToken cancellationToken = default) 2103return Task.CompletedTask; 2109return Task.FromResult(false); 2114return Task.FromResult(new Dictionary<string, string>()); 2119return Task.FromResult(new Dictionary<string, string>()); 2124return Task.FromResult(new Dictionary<string, string>()); 2130return Task.FromResult<string?>(null); 2135return Task.FromResult<string?>(null); 2152=> Task.FromResult<string?>(null); 2155=> Task.FromResult<LanguageId?>(null); 2158=> Task.FromResult<LanguageId?>(null); 2202=> Task.FromResult<string[]>([supportedFileName]); 2207public Task ScaffoldAsync(DirectoryInfo directory, string? projectName, CancellationToken cancellationToken) 2220=> Task.FromResult(new AppHostValidationResult(IsValid: appHostFile.Name.Equals(supportedFileName, StringComparison.OrdinalIgnoreCase))); 2223=> Task.FromResult<string?>(VersionHelper.GetDefaultTemplateVersion()); 2232=> Task.FromResult(RunningInstanceResult.NoRunningInstance); 2235=> Task.FromResult<string?>(null); 2250public async Task UseOrFindAppHostProjectFileAcceptsDirectoryPathWithSingleProject() 2282public async Task UseOrFindAppHostProjectFileThrowsWhenDirectoryHasNoProjects() 2304public async Task UseOrFindAppHostProjectFileKeepsSingleUnbuildableAppHostInExplicitDirectory() 2333public async Task UseOrFindAppHostProjectFileThrowsWhenExplicitDirectoryHasMultipleUnbuildableAppHosts() 2373public async Task UseOrFindAppHostProjectFileDoesNotSelectUnbuildableConfiguredAppHostOutsideExplicitDirectory() 2416public async Task UseOrFindAppHostProjectFileIgnoresBuildableConfiguredAppHostOutsideExplicitDirectory() 2459public async Task UseOrFindAppHostProjectFileListsOnlyExplicitDirectoryProjectsWhenSelectionIsDisabled() 2504public async Task UseOrFindAppHostProjectFileIgnoresUnsupportedConfiguredAppHostOutsideExplicitDirectory() 2555public async Task UseOrFindAppHostProjectFileKeepsUnbuildableConfiguredAppHostWhenMultipleHealthyAppHostsExist() 2607public async Task UseOrFindAppHostProjectFilePromptsWhenDirectoryHasMultipleProjects() 2644public async Task UseOrFindAppHostProjectFileAcceptsDirectoryPathWithSingleFileAppHost() 2671public async Task UseOrFindAppHostProjectFileAcceptsDirectoryPathWithRecursiveSearch() 2709public async Task FindAppHostProjectFilesAsync_DoesNotDetectAppHostCsWithoutSdkDirective() 2752public async Task FindAppHostProjectFilesAsync_DoesNotDetectAppHostCsWithSiblingCsproj() 2795public async Task FindAppHostProjectFilesAsync_DetectsValidSingleFileAppHost() 2821public async Task FindAppHostProjectFilesAsync_ExcludesDotNetProjectsWhenSdkNotAvailable() 2842public async Task FindAppHostProjectFilesAsync_IncludesDotNetProjectsWhenSdkAvailable() 2864public async Task FindAppHostProjectsAsync_WritesSdkWarningToErrorStreamWhenFindingCandidatesForLs() 2890public async Task FindAppHostProjectFilesAsync_DoesNotCheckSdkWhenNoDotNetProjects() 2915public async Task FindAppHostProjectFilesAsync_ExcludesProjectsInsideNuGetCache() 2952public async Task FindAppHostProjectFilesAsync_FindsProjectsOutsideNuGetCache() 2983public async Task FindAppHostProjectFilesAsync_RespectsCustomNuGetPackagesEnvVar() 3020public async Task FindAppHostProjectFilesAsync_DoesNotExcludeSiblingDirectoriesOfNuGetCache() 3060public async Task UseOrFindAppHostProjectFile_SingleAspireConfigJson_FindsAppHost() 3083public async Task UseOrFindAppHostProjectFile_MultipleAspireConfigJsonFiles_FallsThroughToScan() 3113public async Task UseOrFindAppHostProjectFile_AspireConfigJsonPointsToNonexistentFile_FallsThroughToScan() 3137public async Task UseOrFindAppHostProjectFile_MultipleAppHosts_NoConfig_ThrowBehavior_Throws() 3160public async Task UseOrFindAppHostProjectFile_MultipleAppHosts_NoConfig_ThrowBehavior_CancelsRemainingValidationEarly() 3186await Task.Delay(Timeout.InfiniteTimeSpan, cancellationToken); 3217public async Task UseOrFindAppHostProjectFile_WithSettingsAndMultipleAppHosts_ThrowBehavior_UsesCachedSelection() 3250public async Task UseOrFindAppHostProjectFile_WithSettingsAndMultipleAppHosts_PromptBehavior_UsesCachedSelection() 3285public async Task FindAppHostProjectsAsync_DefaultFiltered_ExcludesNodeModulesByDefault_NonGitRepo() 3314public async Task FindAppHostProjectsAsync_AllFilesScope_IncludesEverything() 3343public async Task FindAppHostProjectFilesAsync_LegacyStringOverload_UsesAllFilesScope() 3372public async Task FindAppHostProjectsAsync_IncludesCandidateStatus() 3410public async Task FindAppHostProjectsAsync_ExplicitDirectoryScope_AppliesSkipListButNotGit() 3433GetIncludedFilesAsyncCallback = (_, _) => Task.FromResult<IReadOnlySet<string>?>(new HashSet<string> 3450public async Task FindAppHostProjectFilesAsync_ExplicitDirectoryScope_DoesNotIncludeParentConfiguredAppHost() 3485public async Task FindAppHostProjectsAsync_DefaultFiltered_GitMode_OnlyIncludesGitListedFiles() 3505GetIncludedFilesAsyncCallback = (_, _) => Task.FromResult<IReadOnlySet<string>?>(new HashSet<string> 3521public async Task FindAppHostProjectsAsync_DefaultFiltered_GitMode_AppliesSkipListEvenWhenGitIncludesPath() 3541GetIncludedFilesAsyncCallback = (_, _) => Task.FromResult<IReadOnlySet<string>?>(new HashSet<string> 3558public async Task FindAppHostProjectsAsync_DefaultFiltered_GitMode_DropsDeletedTrackedFiles() 3576GetIncludedFilesAsyncCallback = (_, _) => Task.FromResult<IReadOnlySet<string>?>(new HashSet<string> 3614public async Task GetAppHostFromSettings_ReturnsConfiguredAppHostEvenWhenValidationWouldFail() 3639ValidateAppHostAsyncCallback = (_, _) => Task.FromResult(new AppHostValidationResult(IsValid: false)) 3652public async Task GetAppHostFromSettings_ReturnsNullWhenConfiguredFileDoesNotExist() 3678public async Task GetAppHostFromSettings_ReturnsNullWhenNoHandlerCanProcessFile() 3709public async Task UseOrFindAppHostProjectFile_RejectsUnbuildableSettingsAppHost() 3735ValidateAppHostAsyncCallback = (_, _) => Task.FromResult(new AppHostValidationResult(IsValid: false)) 3751public async Task GetAppHostFromSettings_LegacyFile_WarningNamesSettingsJsonNotAspireConfigJson() 3790public async Task GetAppHostFromSettings_AspireConfigJson_WithNulByteInPath_ReportsValidationErrorAndDoesNotCrash() 3825public async Task GetAppHostFromSettings_LegacySettings_WithNulByteInPath_ReportsValidationErrorAndDoesNotCrash() 3850public async Task GetAppHostFromSettings_AspireConfigJson_WithEmptyPath_ReportsValidationErrorAndDoesNotCrash() 3878public async Task GetAppHostFromSettings_LegacySettings_WithEmptyPath_ReportsValidationErrorAndDoesNotCrash() 3903public async Task GetAppHostFromSettings_MalformedConfig_SilentProbeLogsWarning() 3932public async Task GetAppHostFromSettings_MalformedLegacySettings_SilentProbeLogsWarning() 3962public async Task GetAppHostFromSettings_LegacySettingsWithNonStringPath_ReportsValidationErrorAndDoesNotCrash() 3989public async Task GetAppHostFromSettings_LegacySettingsWithNonObjectRoot_ReportsValidationErrorAndDoesNotCrash() 4016public async Task FindAppHostProjectsAsync_DeduplicatesSettingsCandidateAcrossSymlink() 4086public async Task FindAppHostProjectsAsync_DeduplicatesAspireConfigCandidateWithDifferentCasing() 4124public async Task FindAppHostProjectsAsync_DefaultFiltered_IncludesSettingsCandidateUnderSkippedDirectory()
Projects\ProjectUpdaterTests.cs (47)
24public async Task UpdateProjectFileAsync_DoesAttemptToUpdateIfNoUpdatesRequired() 134public async Task UpdateProjectFileAsync_CanUpdateFromStableToDaily() 295public async Task UpdateProjectFileAsync_DoesNotCreateAspireConfigJsonWhenAbsent() 405public async Task UpdateProjectFileAsync_CanUpdateFromDailyToStableWhereOnePackageIsUnstableOnly() 577public async Task UpdateProjectFileAsync_PackageNotInChannel_LogsWarningAndContinues() 691public async Task UpdateProjectFileAsync_DiamondDependency_DoesNotDuplicateUpdates() 830public async Task UpdateProjectFileAsync_CentralPackageManagement_UpdatesDirectoryPackagesProps() 966public async Task UpdateProjectFileAsync_CentralPackageManagement_DetectedByDirectoryPackagesProps() 1068public async Task UpdateProjectFileAsync_CentralPackageManagement_PackageNotInDirectoryPackagesProps() 1171public async Task UpdateProjectFileAsync_CpmOrphanAppHostPackageVersion_RemovedEvenWhenSdkAlreadyCurrent() 1296public async Task UpdateProjectFileAsync_StaleAppHostPackageReference_RemovedEvenWhenSdkAlreadyCurrent() 1376public async Task UpdateProjectFileAsync_NoLegacyAppHostReferences_NoChangesWhenSdkAlreadyCurrent() 1450public async Task UpdateProjectFileAsync_LegacyAppHostReferencesWithMixedCasing_StillRemoved() 1547public async Task UpdateProjectAsync_StableChannel_DoesNotCreateNuGetConfigWhenNoneExists() 1567public async Task UpdateProjectAsync_StableChannel_UpdatesExistingNuGetConfig() 1617public async Task UpdateProjectAsync_DailyChannel_CreatesNuGetConfigWhenNoneExists() 1723() => Task.CompletedTask, 1741() => Task.CompletedTask, 1757() => Task.CompletedTask, 1769public async Task UpdateProjectFileAsync_CentralPackageManagement_ResolvesAspireVersionProperty() 1882public async Task UpdateProjectFileAsync_CentralPackageManagement_ResolvesMultipleProperties() 2006public async Task UpdateProjectFileAsync_CentralPackageManagement_PropertyResolutionFailsWithInvalidSemanticVersion() 2120public async Task UpdateProjectFileAsync_CentralPackageManagement_PropertyResolutionFailsWithUnresolvableProperty() 2231public async Task UpdateProject_FallbackMode_WhenSdkUnresolvable() 2325public async Task FallbackMode_PackageReferenceWithoutVersion_CPM() 2427public async Task FallbackMode_InvalidXml_StillFails() 2506public async Task NormalMode_NoFallback() 2588public async Task UpdateProjectFileAsync_SingleFileAppHost_UpdatesSdkDirectiveWithVersion() 2671public async Task UpdateProjectFileAsync_SingleFileAppHost_RemovesLegacyAppHostPackageDirectiveDuringSdkBump() 2770public async Task UpdateProjectFileAsync_SingleFileAppHost_RemovesLegacyAppHostPackageDirectiveWhenSdkAlreadyCurrent() 2851public async Task UpdateProjectFileAsync_SingleFileAppHost_UpdatesSdkDirectiveWithWildcard() 2933public async Task UpdateProjectFileAsync_PackageReferenceWithWildcard_DoesNotFail() 3019public async Task UpdateProjectFileAsync_AppHost_UpdatesSdkAttributeFormat() 3097public async Task UpdateProjectFileAsync_AppHost_UpdatesSdkElementFormat() 3175public async Task UpdateProjectFileAsync_TreatsVersionRangeExpressionsLikeWildcard() 3299public async Task UpdateProjectFileAsync_ManagePackageVersionsCentrallyFalse_UpdatesLocalProjectFile() 3427public async Task UpdateSdkVersionInCsprojAppHostAsync_MigratesFromOldFormatToNewFormat(string projectExtension) 3460public async Task UpdateSdkVersionInCsprojAppHostAsync_UpdatesExistingNewFormat(string projectExtension) 3492public async Task UpdateSdkVersionInCsprojAppHostAsync_RemovesAspireHostingAppHostPackageReference(string projectExtension) 3529public async Task UpdateSdkVersionInCsprojAppHostAsync_RemovesEmptyItemGroupAfterPackageRemoval(string projectExtension) 3565public async Task UpdateSdkVersionInCsprojAppHostAsync_PreservesOtherSdksInAttribute(string projectExtension) 3597public async Task UpdateSdkVersionInCsprojAppHostAsync_DoesNotMatchSimilarSdkName(string projectExtension) 3630public async Task UpdateSdkVersionInCsprojAppHostAsync_RemovesPackageVersionFromDirectoryPackagesPropsForCpm(string projectExtension) 3705public async Task UpdateProjectFileAsync_AppliesAllPackageEditsBeforeFinalRestore() 3819public async Task UpdateProjectFileAsync_StableChannel_DoesNotCreateNuGetConfigWhenNoneExists() 3896public async Task UpdateProjectFileAsync_StableChannel_UpdatesExistingNuGetConfig() 3986public async Task UpdateProjectFileAsync_DailyChannel_CreatesNuGetConfigWhenNoneExists()
Projects\RunningInstanceManagerTests.cs (6)
19public async Task StopRunningInstanceAsync_DeletesSocketFile_WhenStopSucceeds() 86private async Task AcceptConnectionAsync() 138return Task.FromResult(new AppHostInformation 150return Task.FromResult(new GetCapabilitiesResponse 156public Task StopAppHostAsync(CancellationToken cancellationToken = default) 160return Task.CompletedTask;
Scaffolding\ChannelReseedTests.cs (4)
47public async Task ScaffoldAsync_PersistsContextChannelVerbatim(string? contextChannel, string? expectedPersistedChannel) 76public async Task ScaffoldAsync_PassesPackageSourceOverrideToPrepareAsync() 86CreateAsyncCallback = (_, _) => Task.FromResult<IAppHostServerProject>(appHostServerProject) 146return Task.FromResult(new AppHostServerPrepareResult(Success: false, Output: null));
Telemetry\AspireCliTelemetryTests.cs (13)
41public async Task StartDiagnosticActivity_CreatesActivityWithCorrectNameAndDefaultTags() 112public async Task RecordError_AddsActivityEventWithDefaultTags_WhenReportedActivityIsActive() 214public async Task Initialize_AddsMachineInformationTags() 230public async Task Initialize_AddsOsInformationTags() 259public async Task Initialize_DoesNotAddCodingAgentTag_WhenCodingAgentIsNotDetected() 269public async Task Initialize_AddsInternalMicrosoftTag() 293public async Task Initialize_DoesNotAddOptionalInternalMicrosoftTags_WhenValuesAreNotDetected() 319public async Task Initialize_DoesNotRunInternalMicrosoftDetectorWhenReportedTelemetryIsDisabled() 349public async Task Initialize_AddsDefaultTags_WhenInternalMicrosoftDetectorFails() 407public async Task StartReportedActivity_IncludesAllDefaultTags() 431public async Task Initialize_IsIdempotent() 466public async Task Initialize_AddsIdentityTags_WhenExecutionContextProvided() 492public async Task Initialize_OmitsIdentityCommitTag_WhenCommitIsEmpty()
Telemetry\CliTagEnrichmentProcessorTests.cs (3)
42public async Task OnEnd_WhenTagsNotYetResolved_BlocksUntilTagsAvailable() 76var onEndTask = Task.Run(() => processor.OnEnd(activity));
Telemetry\InternalMicrosoftDetectorTests.cs (32)
19public async Task IsInternalMicrosoftMachineAsync_UsesFreshCache() 43return Task.FromResult(InternalMicrosoftProbeResult.NotDetected); 58public async Task IsInternalMicrosoftMachineAsync_RunsProbesWhenCacheIsStaleAndUpdatesCache() 74[new InternalMicrosoftProbe("positive", _ => Task.FromResult(new InternalMicrosoftProbeResult(IsInternalMicrosoft: true, Alias: "stale.alias", Domain: "STALE")))] 93public async Task IsInternalMicrosoftMachineAsync_RunsNextStageOnlyWhenPreviousStageDoesNotDetect() 104return Task.FromResult(InternalMicrosoftProbeResult.NotDetected); 109return Task.FromResult(new InternalMicrosoftProbeResult(IsInternalMicrosoft: true, Alias: "stage.alias", Domain: "STAGE")); 114return Task.FromResult(new InternalMicrosoftProbeResult(IsInternalMicrosoft: true, Alias: "unused.alias", Domain: "UNUSED")); 128public async Task IsInternalMicrosoftMachineAsync_CancelsOtherProbesInStageAfterSuccessfulProbe() 149await Task.Delay(TimeSpan.FromMinutes(5), cancellationToken); 172public async Task IsInternalMicrosoftMachineAsync_ReturnsPositiveResultWhenCancelledProbeFaultsDuringDrain() 192await Task.Delay(TimeSpan.FromMinutes(5), cancellationToken); 213public async Task IsInternalMicrosoftMachineAsync_RunsLaterStagesWhenProbeThrowsUnexpectedException() 221[new InternalMicrosoftProbe("positive", _ => Task.FromResult(new InternalMicrosoftProbeResult(IsInternalMicrosoft: true, Alias: "later.alias", Domain: "LATER")))] 233public async Task CheckWindowsUserDnsDomainAsync_UsesExecutionContextEnvironment() 254public async Task CheckWindowsWorkplaceJoinAsync_UsesExecutionContextEnvironmentAndProcessFactory() 291public async Task CheckWindowsWorkplaceJoinAsync_ReturnsNotDetectedWhenProcessStartTimesOutInternally() 321public async Task CheckGitHubMembershipWithTokenAsync_ReturnsFalseWhenUserRequestFails() 325Task.FromResult(request.RequestUri?.AbsolutePath switch 343public async Task CheckGitHubMembershipWithTokenAsync_ReturnsTrueForActivePrivateMembership() 347Task.FromResult(request.RequestUri?.AbsolutePath switch 366public async Task CheckGitHubMembershipWithTokenAsync_ReturnsTrueForExplicitPublicMembership() 370Task.FromResult(request.RequestUri?.AbsolutePath switch 390public async Task CheckGitHubMembershipWithTokenAsync_ReturnsFalseForNonMember() 394Task.FromResult(request.RequestUri?.AbsolutePath switch 414public async Task CheckCopilotCliAsync_ChecksTokenCandidatesWithoutCopilotCommand() 418Task.FromResult(request.RequestUri?.AbsolutePath switch 443public async Task CheckCopilotCliAsync_LimitsGitHubTokenCandidates() 447Task.FromResult(request.RequestUri?.AbsolutePath switch 470public async Task CheckCopilotCliAsync_UsesOverallGitHubTokenCandidateTimeout() 475await Task.Delay(TimeSpan.FromMinutes(1), cancellationToken); 511public async Task CheckCopilotCliAsync_ProbesGitHubTokenCandidatesConcurrently()
Telemetry\LinuxInformationProviderTests.cs (1)
16public async Task GetOrCreateDeviceId_WorksCorrectly()
Telemetry\MacOSXInformationProviderTests.cs (1)
16public async Task GetOrCreateDeviceId_WorksCorrectly()
Telemetry\TelemetryConfigurationTests.cs (8)
48public async Task AzureMonitor_Enabled_ByDefault() 64public async Task AzureMonitor_Disabled_WhenOptOutSetToTrueValues(string optOutValue) 79public async Task ReportedTelemetry_Disabled_WhenVersionFlagProvided() 110public async Task ReportedTelemetry_Disabled_WhenOptOutSet_DoesNotRunInternalMicrosoftDetector() 146public async Task OtlpExporter_WithoutProfiling_EnablesOnlyDebugDiagnostics_WhenEndpointProvided() 191public async Task OtlpExporter_WithProfiling_EnablesProfilingProviderWhenTelemetryOptedOut() 210public async Task OtlpExporter_WithProfiling_KeepsReportedTelemetryAndProfilingSeparate() 229public async Task DiagnosticProvider_IncludesDiagnosticActivitySource()
Telemetry\TelemetryFixture.cs (4)
114public Task<string?> GetOrCreateDeviceId() => Task.FromResult(DeviceId); 115public Task<string> GetMacAddressHash() => Task.FromResult(MacAddressHash); 155return Task.FromException<InternalMicrosoftDetectionResult>(ExceptionToThrow); 158return Task.FromResult(new InternalMicrosoftDetectionResult(IsInternalMicrosoft, Source, Alias, Domain));
Telemetry\TestTelemetryHelper.cs (3)
61public Task<string?> GetOrCreateDeviceId() => Task.FromResult<string?>("test-device-id"); 62public Task<string> GetMacAddressHash() => Task.FromResult("test-mac-hash"); 78=> Task.FromResult(new InternalMicrosoftDetectionResult(IsInternalMicrosoft: false, Source: null, Alias: null, Domain: null));
Telemetry\WindowsInformationProviderTests.cs (1)
16public async Task GetOrCreateDeviceId_WorksCorrectly()
Templating\DotNetTemplateFactoryTests.cs (19)
37private static async Task WriteNuGetConfigAsync(DirectoryInfo dir, string content) 48public async Task NuGetConfigMerger_InPlaceCreation_WithoutExistingConfig_CreatesInWorkingDirectory() 69public async Task NuGetConfigMerger_InPlaceCreation_WithExistingConfig_UpdatesWorkingDirectoryConfig() 104public async Task NuGetConfigMerger_SubdirectoryCreation_WithParentConfig_IgnoresParentAndCreatesInOutputDirectory() 148public async Task NuGetConfigMerger_SubdirectoryCreation_WithExistingConfigInOutputDirectory_MergesInOutputDirectory() 185public async Task NuGetConfigMerger_SubdirectoryCreation_WithoutAnyConfig_CreatesInOutputDirectory() 215public async Task NuGetConfigMerger_ImplicitChannel_DoesNothing() 236public async Task NuGetConfigMerger_ExplicitChannelWithoutMappings_DoesNothing() 257public async Task GetTemplates_WhenShowAllTemplatesIsEnabled_ReturnsAllTemplates() 276public async Task GetTemplates_WhenShowAllTemplatesIsDisabled_ReturnsOnlyStarterTemplates() 295public async Task GetTemplates_SingleFileAppHostIsNotReturned() 311public async Task GetInitTemplates_IncludesSingleFileAppHostTemplate() 326public async Task GetTemplates_WhenDotNetSdkIsUnavailable_ReturnsNoTemplates() 397public Task ShowStatusAsync(string message, Func<Task> work) 418public Task DisplayLiveAsync(IRenderable initialRenderable, Func<Action<IRenderable>, Task> callback) => callback(_ => { }); 466=> Task.FromResult(0); 472=> Task.FromResult(new EnsureCertificatesTrustedResult
Templating\JavaAppHostTemplateTests.cs (1)
66public async Task JavaStarterAppHost_MatchesTheScaffoldedSource()
Templating\JavaStarterScaffoldTests.cs (3)
32public async Task JavaStarter_ScaffoldsAnExecutableMavenWrapper() 55public async Task JavaStarter_ScaffoldsTheJavaServiceAlongsideTheFrontend() 98Task.FromResult<IAppHostServerProject>(new FakeFailingAppHostServerProject(path))
Templating\TemplateNuGetConfigServiceTests.cs (58)
26public async Task CreateOrUpdateNuGetConfigForSourceOverrideAsync_CreatesSelfContainedConfigWithoutAmbientSources() 71public async Task CreateOrUpdateNuGetConfigForSourceOverrideAsync_PreservesRequestedChannelFallbackMappings() 94return Task.FromResult<IEnumerable<PackageChannel>>([channel]); 110public async Task CreateOrUpdateNuGetConfigForSourceOverrideAsync_UpdatesOnlyProjectLocalConfig() 153public async Task CreateOrUpdateNuGetConfigForSourceOverrideAsync_NullSourceShortCircuits() 171public async Task CreateOrUpdateNuGetConfigForSourceOverrideAsync_CredentialBearingHttpSourceThrows(string sourceOverride) 183public async Task PromptToCreateOrUpdateNuGetConfigAsync_NullChannelName_ShortCircuits() 195public async Task CreateOrUpdateNuGetConfigWithoutPromptAsync_NullChannelName_ShortCircuits() 215public async Task ResolveTemplatePackageAsync_NullRequestedChannel_UsesImplicitChannelOnly() 228GetIntegrationPackagesAsyncCallback = (_, _, _, _) => Task.FromResult(Enumerable.Empty<Aspire.Shared.NuGetPackageCli>()) 230return Task.FromResult<IEnumerable<PackageChannel>>([implicitCh]); 251public async Task ResolveTemplatePackage_RequestedChannel_NotFound_Throws() 263return Task.FromResult<IEnumerable<PackageChannel>>([implicitCh]); 280public async Task ResolveTemplatePackage_RequestedChannel_Matches_ReturnsThatChannel() 296GetTemplatePackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>( 302return Task.FromResult<IEnumerable<PackageChannel>>([implicitCh, stableCh]); 322public async Task ResolveTemplatePackageAsync_RequestedChannelWithSourceOverride_ReplacesAspireSource() 340return Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>( 365return Task.FromResult<IEnumerable<PackageChannel>>([channel]); 379public async Task ResolveTemplatePackageAsync_SourceOverrideWithoutRequestedChannel_UsesImplicitChannelOnly() 398return Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>( 422return Task.FromResult<IEnumerable<PackageChannel>>([implicitChannel, hiveChannel]); 440public async Task ResolveTemplatePackageAsync_LocalSourceOverrideDoesNotFilterToChannelPin() 463GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([channel]) 480public async Task InstallTemplatePackageAsync_SourceOverride_UsesExclusiveSource() 538public async Task ResolveTemplatePackageAsync_NonExistentRequestedChannel_NotLocal_StillThrowsChannelNotFound() 548return Task.FromResult<IEnumerable<PackageChannel>>([implicitCh]); 581public async Task ResolveTemplatePackageAsync_IncludePrHives_RespectsHiveGate( 604GetTemplatePackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>( 617return Task.FromResult<IEnumerable<PackageChannel>>([implicitCh, hiveCh]); 640public async Task ResolveTemplatePackageAsync_UnqualifiedLocalIdentityWithoutMatchingIdentityChannelPackage_ThrowsActionableError() 661GetTemplatePackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>( 695return Task.FromResult<IEnumerable<PackageChannel>>([implicitChannel, stagingChannel, prChannel, localChannel]); 717public async Task ResolveTemplatePackageAsync_LocalIdentityWithExplicitLocalChannel_UsesRequestedChannelVersion() 737GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([localChannel]) 754public async Task ResolveTemplatePackageAsync_InitLocalChannelDoesNotFilterToPinnedVersion() 780GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([localChannel]) 796public async Task ResolveTemplatePackageAsync_ExplicitVersionFindsExactLocalPackageBelowNewerPinnedVersion() 816GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([localChannel]) 832public async Task ResolveTemplatePackageAsync_ExplicitVersionNotFound_ThrowsInsteadOfSelectingAnotherVersion() 851GetChannelsAsyncCallback = _ => Task.FromResult<IEnumerable<PackageChannel>>([localChannel]) 873public async Task ResolveTemplatePackageAsync_UnqualifiedLocalIdentity_PrefersMatchingLocalPackage() 904return Task.FromResult<IEnumerable<PackageChannel>>([stagingChannel, localChannel]); 922public async Task ResolveTemplatePackageAsync_LocalIdentityWithExplicitChannel_UsesRequestedChannel() 942return Task.FromResult<IEnumerable<PackageChannel>>([stagingChannel]); 974public async Task ResolveTemplatePackageAsync_IdentityPackagesOverride_IncludesLocalChannelEvenWhenPrHivesSuppressed() 992GetTemplatePackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<Aspire.Shared.NuGetPackageCli>>( 1005return Task.FromResult<IEnumerable<PackageChannel>>([implicitCh, localStableCh]); 1025public async Task ResolveTemplatePackageAsync_ImplicitDiscovery_FindsHierarchicalTemplateFromFileUriMappedLocalChannel() 1056return Task.FromResult<IEnumerable<PackageChannel>>([implicitCh, localChannel]); 1095public async Task PromptToCreateOrUpdateNuGetConfigAsync_ExplicitChannelRequiringConfig_CreatesConfig() 1114return Task.FromResult<IEnumerable<PackageChannel>>([dailyCh]); 1135public async Task PromptToCreateOrUpdateNuGetConfigAsync_StableChannel_DoesNotCreateConfig() 1152return Task.FromResult<IEnumerable<PackageChannel>>([stableCh]); 1165public async Task PromptToCreateOrUpdateNuGetConfigAsync_StableChannel_UpdatesExistingConfig() 1197return Task.FromResult<IEnumerable<PackageChannel>>([stableCh]); 1220public async Task CreateOrUpdateNuGetConfigWithoutPromptAsync_StableChannel_RespectsExistingConfig(bool hasExistingConfig) 1254return Task.FromResult<IEnumerable<PackageChannel>>([stableCh]);
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
tests\Shared\TemporaryWorkspace.cs (1)
27public async Task InitializeGitAsync(CancellationToken cancellationToken = default)
TestServices\CallbackNuGetPackageCache.cs (4)
18=> Task.FromResult<IEnumerable<NuGetPackage>>([]); 21=> Task.FromResult<IEnumerable<NuGetPackage>>([]); 24=> Task.FromResult<IEnumerable<NuGetPackage>>([]); 27=> Task.FromResult<IEnumerable<NuGetPackage>>([]);
TestServices\FakeAppHostServerSession.cs (7)
26public Func<Task>? StartAsyncCallback { get; init; } 54public async Task StartAsync() 68: Task.FromResult(_rpcClient); 108=> Task.FromResult(new RuntimeSpec 121=> Task.FromResult(new Dictionary<string, string>()); 124=> Task.FromResult(new Dictionary<string, string>()); 135public Task InvokeAsync(string methodName, object?[] parameters, CancellationToken cancellationToken)
TestServices\FakeFailingAppHostServerProject.cs (1)
30Task.FromResult(new AppHostServerPrepareResult(Success: false, Output: null));
TestServices\FakeInstallationDiscovery.cs (1)
46return Task.FromResult(all);
TestServices\FakeNuGetPackageCache.cs (5)
18?? Task.FromResult<IEnumerable<NuGetPackage>>([]); 22?? Task.FromResult<IEnumerable<NuGetPackage>>([]); 26?? Task.FromResult<IEnumerable<NuGetPackage>>([]); 48return Task.FromResult<IEnumerable<NuGetPackage>>([]); 53?? Task.FromResult<IEnumerable<NuGetPackage>>([]);
TestServices\FakePeerInstallProbe.cs (1)
57return Task.FromResult(result);
TestServices\FakePlaywrightServices.cs (7)
22=> Task.FromResult<NpmPackageInfo?>(null); 25=> Task.FromResult<string?>(null); 28=> Task.FromResult(true); 37=> Task.FromResult(new ProvenanceVerificationResult 79private async Task EnsureBundleAsync(CancellationToken cancellationToken) 208=> Task.FromResult<SemVersion?>(null); 211=> Task.FromResult(true);
TestServices\FakeSucceedingAppHostServerProject.cs (1)
27Task.FromResult(new AppHostServerPrepareResult(Success: true, Output: null));
TestServices\NoProjectFileProjectLocator.cs (1)
30public Task<FileInfo?> GetAppHostFromSettingsAsync(CancellationToken cancellationToken = default) => Task.FromResult<FileInfo?>(null);
TestServices\NullDiskCache.cs (8)
15=> Task.FromResult<string?>(null); 17public Task SetAsync(string key, string content, CancellationToken cancellationToken = default) 18=> Task.CompletedTask; 20public Task ClearAsync(CancellationToken cancellationToken = default) 21=> Task.CompletedTask; 33=> Task.FromResult<AppHostInfoCacheEntry?>(null); 35public Task SetAsync(FileInfo projectFile, string expectedCacheKey, AppHostInfoCacheEntry entry, CancellationToken cancellationToken) 36=> Task.CompletedTask;
TestServices\ProcessTestHelpers.cs (1)
32await Task.Delay(20, cancellationToken);
TestServices\RecordingGracefulSignaler.cs (1)
41return _onSignal?.Invoke(pid) ?? Task.FromResult(true);
TestServices\TestApiDocsFetcher.cs (2)
15return Task.FromResult<string?>(null); 20return Task.FromResult<string?>(null);
TestServices\TestAppHostAuxiliaryBackchannel.cs (16)
91return Task.FromResult(DashboardUrlsState); 100return Task.FromResult<GetAppHostInfoResponse?>(AppHostInfoResponse); 105return Task.FromResult<GetAppHostInfoResponse?>(null); 108return Task.FromResult<GetAppHostInfoResponse?>(new GetAppHostInfoResponse 123return Task.FromResult<WaitForAppHostReadyResponse?>(null); 131return Task.FromResult(WaitForAppHostReadyResponse); 144return Task.FromResult(snapshots); 167await Task.CompletedTask; 193await Task.CompletedTask; 252return Task.FromResult(StopAppHostResult); 275return Task.FromResult(ExecuteResourceCommandResult); 289return Task.FromResult(WaitForResourceResult); 303return Task.FromResult(new CallToolResult 316return Task.FromResult(DashboardInfoResponse); 326return Task.FromResult(TerminalInfoResponse); 337return Task.FromResult(ListTerminalsResponse);
TestServices\TestAppHostCliBackchannel.cs (14)
12public Func<Task>? RequestStopAsyncCallback { get; set; } 25public Func<string, CancellationToken, Task>? ConnectAsyncCallback { get; set; } 37public Task RequestStopAsync(CancellationToken cancellationToken) 46return Task.CompletedTask; 50public Task NotifyAppHostReadyAsync(CancellationToken cancellationToken) 53return Task.CompletedTask; 61: Task.FromResult( 107public Task ConnectAsync(string socketPath, int retryCount, CancellationToken cancellationToken) 110public async Task ConnectAsync(string socketPath, bool autoReconnect, int retryCount, CancellationToken cancellationToken) 119public async Task WaitForDisconnectAsync(CancellationToken cancellationToken) 254public Task CompletePromptResponseAsync(string promptId, PublishingPromptInputAnswer[] answers, CancellationToken cancellationToken) 256return Task.CompletedTask; 259public Task UpdatePromptResponseAsync(string promptId, PublishingPromptInputAnswer[] answers, CancellationToken cancellationToken) 261return Task.CompletedTask;
TestServices\TestAppHostProjectFactory.cs (9)
166=> Task.FromResult(_factory.DetectionPatterns ?? s_detectionPatterns); 187public Task ScaffoldAsync(DirectoryInfo directory, string? projectName, CancellationToken cancellationToken) 205return Task.FromResult(new AppHostValidationResult(IsValid: false, IsUnsupported: true)); 215return Task.FromResult(_factory.ValidateAppHostCallback(appHostFile)); 221return Task.FromResult(new AppHostValidationResult(IsValid: IsValidSingleFileAppHost(appHostFile))); 224return Task.FromResult(new AppHostValidationResult(IsValid: true)); 231: Task.FromResult<string?>(VersionHelper.GetDefaultTemplateVersion()); 245=> Task.FromResult(RunningInstanceResult.NoRunningInstance); 248=> Task.FromResult<string?>(null);
TestServices\TestAppHostStopper.cs (1)
48return Task.FromResult(result);
TestServices\TestAuxiliaryBackchannelMonitor.cs (3)
30public Func<CancellationToken, Task>? ScanAsyncCallback { get; set; } 35public Task ScanAsync(CancellationToken cancellationToken = default) 38return ScanAsyncCallback?.Invoke(cancellationToken) ?? Task.CompletedTask;
TestServices\TestBannerService.cs (2)
13public Task DisplayBannerAsync(CancellationToken cancellationToken = default) 17return Task.CompletedTask;
TestServices\TestCertificateService.cs (1)
12return Task.FromResult(new EnsureCertificatesTrustedResult
TestServices\TestCliDownloader.cs (1)
39return Task.FromResult(path);
TestServices\TestCliUpdateNotifier.cs (4)
16public Func<DirectoryInfo, CancellationToken, Task>? CheckForCliUpdatesAsyncCallback { get; set; } 20public Task CheckForCliUpdatesAsync(DirectoryInfo workingDirectory, CancellationToken cancellationToken) 27return Task.CompletedTask; 34: Task.FromResult(new CliVersionStatus("13.0.0", null, null));
TestServices\TestConfigurationService.cs (8)
17public Task SetConfigurationAsync(string key, string value, bool isGlobal = false, CancellationToken cancellationToken = default) 20return Task.CompletedTask; 26return Task.FromResult(true); 31return Task.FromResult(new Dictionary<string, string>()); 36return Task.FromResult(new Dictionary<string, string>()); 41return Task.FromResult(new Dictionary<string, string>()); 47return Task.FromResult(result); 57return Task.FromResult(result);
TestServices\TestDcpConnectionChecker.cs (1)
19return Task.FromResult(CreateResult(useDeveloperCertificate, EnvironmentCheckStatus.Pass, $"DCP useDeveloperCertificate={useDeveloperCertificate} connection succeeded"));
TestServices\TestDocsFetcher.cs (1)
15return Task.FromResult<string?>(null);
TestServices\TestDotNetCliRunner.cs (24)
36? Task.FromResult(AddPackageAsyncCallback(projectFilePath, packageName, packageVersion, nugetSource, noRestore, options, cancellationToken)) 43? Task.FromResult(AddProjectToSolutionAsyncCallback(solutionFile, projectFile, options, cancellationToken)) 44: Task.FromResult(0); // If not overridden, just return success. 50? Task.FromResult(BuildAsyncCallback(projectFilePath, noRestore, options, cancellationToken)) 57? Task.FromResult(RestoreAsyncCallback(projectFilePath, options, cancellationToken)) 58: Task.FromResult(0); // If not overridden, just return success. 66? Task.FromResult(GetAppHostInformationAsyncCallback(projectFile, options, cancellationToken)) 67: Task.FromResult<(int, bool, string?)>((0, true, informationalVersion)); 73? Task.FromResult(GetNuGetConfigPathsAsyncCallback(workingDirectory, options, cancellationToken)) 74: Task.FromResult((0, GetGlobalNuGetPaths())); // If not overridden, return success with no config paths which will blow up. 96return Task.FromResult(GetProjectItemsAndPropertiesAsyncCallbackWithTargets(projectFile, items, properties, targets, options, cancellationToken)); 106return Task.FromResult(GetProjectItemsAndPropertiesAsyncCallback(projectFile, items, properties, options, cancellationToken)); 126return Task.FromResult<(int, JsonDocument?)>((exitCode, JsonDocument.Parse(json))); 141return Task.FromResult<(int, JsonDocument?)>((0, JsonDocument.Parse(defaultJson))); 147? Task.FromResult(InstallTemplateAsyncCallback(packageName, version, nugetConfigFile, nugetSource, force, options, cancellationToken)) 148: Task.FromResult<(int, string?)>((0, version)); // If not overridden, just return success for the version specified. 156? Task.FromResult(NewProjectAsyncCallback(templateName, name, outputPath, options, cancellationToken)) 157: Task.FromResult(0); // If not overridden, just return success. 182? Task.FromResult(SearchPackagesAsyncCallback(workingDirectory, query, exactMatch, prerelease, take, skip, nugetConfigFile, useCache, options, cancellationToken)) 189? Task.FromResult(GetSolutionProjectsAsyncCallback(solutionFile, options, cancellationToken)) 190: Task.FromResult<(int, IReadOnlyList<FileInfo>)>((0, Array.Empty<FileInfo>())); 196? Task.FromResult(AddProjectReferenceAsyncCallback(projectFile, referencedProject, options, cancellationToken)) 197: Task.FromResult(0); 201=> Task.FromResult(0);
TestServices\TestDotNetSdkInstaller.cs (2)
15? Task.FromResult(CheckAsyncCallback(cancellationToken)) 16: Task.FromResult<(bool Success, string? HighestDetectedVersion, string MinimumRequiredVersion)>((true, "9.0.302", "9.0.302")); // Default to SDK available
TestServices\TestExtensionBackchannel.cs (59)
17public Func<string, string, Task>? DisplayMessageAsyncCallback { get; set; } 20public Func<string, Task>? DisplaySuccessAsyncCallback { get; set; } 23public Func<string, Task>? DisplaySubtleMessageAsyncCallback { get; set; } 26public Func<string, Task>? DisplayErrorAsyncCallback { get; set; } 29public Func<Task>? DisplayEmptyLineAsyncCallback { get; set; } 32public Func<string, string, Task>? DisplayIncompatibleVersionErrorAsyncCallback { get; set; } 35public Func<Task>? DisplayCancellationMessageAsyncCallback { get; set; } 38public Func<IEnumerable<DisplayLineState>, Task>? DisplayLinesAsyncCallback { get; set; } 41public Func<DashboardUrlsState, Task>? DisplayDashboardUrlsAsyncCallback { get; set; } 44public Func<string?, Task>? ShowStatusAsyncCallback { get; set; } 63public Func<string, Task>? OpenEditorAsyncCallback { get; set; } 66public Func<LogLevel, string, Task>? LogMessageAsyncCallback { get; set; } 75public Func<string, List<string>, List<EnvVar>, bool, Task>? LaunchAppHostAsyncCallback { get; set; } 80public Func<string, string?, bool, DebugSessionOptions?, Task>? StartDebugSessionAsyncCallback { get; set; } 83public Func<string, Task>? DisplayPlainTextAsyncCallback { get; set; } 86public Func<string, bool, string?, Task>? WriteDebugSessionMessageAsyncCallback { get; set; } 88public Task ConnectAsync(CancellationToken cancellationToken) 92return Task.CompletedTask; 95public Task DisplayMessageAsync(string emojiName, string message, CancellationToken cancellationToken) 98return DisplayMessageAsyncCallback?.Invoke(emojiName, message) ?? Task.CompletedTask; 101public Task DisplaySuccessAsync(string message, CancellationToken cancellationToken) 104return DisplaySuccessAsyncCallback?.Invoke(message) ?? Task.CompletedTask; 107public Task DisplaySubtleMessageAsync(string message, CancellationToken cancellationToken) 110return DisplaySubtleMessageAsyncCallback?.Invoke(message) ?? Task.CompletedTask; 113public Task DisplayErrorAsync(string errorMessage, CancellationToken cancellationToken) 116return DisplayErrorAsyncCallback?.Invoke(errorMessage) ?? Task.CompletedTask; 119public Task DisplayEmptyLineAsync(CancellationToken cancellationToken) 122return DisplayEmptyLineAsyncCallback?.Invoke() ?? Task.CompletedTask; 125public Task DisplayIncompatibleVersionErrorAsync(string appHostHostingVersion, string errorMessage, CancellationToken cancellationToken) 128return DisplayIncompatibleVersionErrorAsyncCallback?.Invoke(appHostHostingVersion, errorMessage) ?? Task.CompletedTask; 131public Task DisplayCancellationMessageAsync(CancellationToken cancellationToken) 134return DisplayCancellationMessageAsyncCallback?.Invoke() ?? Task.CompletedTask; 137public Task DisplayLinesAsync(IEnumerable<DisplayLineState> lines, CancellationToken cancellationToken) 140return DisplayLinesAsyncCallback?.Invoke(lines) ?? Task.CompletedTask; 143public Task DisplayDashboardUrlsAsync(DashboardUrlsState dashboardUrls, CancellationToken cancellationToken) 146return DisplayDashboardUrlsAsyncCallback?.Invoke(dashboardUrls) ?? Task.CompletedTask; 149public Task ShowStatusAsync(string? status, CancellationToken cancellationToken) 152return ShowStatusAsyncCallback?.Invoke(status) ?? Task.CompletedTask; 160: Task.FromResult(defaultValue); 172return Task.FromResult(choices.First()); 184return Task.FromResult<IReadOnlyList<T>>(choices.ToList()); 192: Task.FromResult(true); 200: Task.FromResult(defaultValue ?? string.Empty); 208: Task.FromResult(string.Empty); 211public Task OpenEditorAsync(string projectPath, CancellationToken cancellationToken) 216: Task.CompletedTask; 219public Task LogMessageAsync(LogLevel logLevel, string message, CancellationToken cancellationToken) 224: Task.CompletedTask; 232: Task.FromResult(Array.Empty<string>()); 248public Task LaunchAppHostAsync(string projectPath, List<string> arguments, List<EnvVar> envVars, bool debug, CancellationToken cancellationToken) 253: Task.CompletedTask; 256public Task NotifyAppHostStartupCompletedAsync(CancellationToken cancellationToken) 259return Task.CompletedTask; 262public Task StartDebugSessionAsync(string workingDirectory, string? projectFile, bool debug, 268: Task.CompletedTask; 271public Task DisplayPlainTextAsync(string text, CancellationToken cancellationToken) 276: Task.CompletedTask; 279public Task WriteDebugSessionMessageAsync(string message, bool stdout, string? textStyle, CancellationToken cancellationToken) 284: Task.CompletedTask;
TestServices\TestExtensionInteractionService.cs (18)
29public Func<IRenderable, Func<Action<IRenderable>, Task>, Task>? DisplayLiveAsyncCallback { get; set; } 35public Task FlushAsync(CancellationToken cancellationToken = default) 38return Task.CompletedTask; 63return Task.FromResult(binding?.DefaultValue ?? string.Empty); 85return Task.FromResult(matchingChoice); 89return Task.FromResult(choicesArray.First()); 101return Task.FromResult<IReadOnlyList<T>>(preSelected.ToList()); 104return Task.FromResult<IReadOnlyList<T>>(choices.ToList()); 140public Task StartDebugSessionAsync(string workingDirectory, string? projectFile, bool debug, DebugSessionOptions? options = null) 143return Task.CompletedTask; 162return Task.FromResult(ConfirmCallback?.Invoke(promptText, defaultValue) ?? true); 207public Task DisplayLiveAsync(IRenderable initialRenderable, Func<Action<IRenderable>, Task> callback) 226public Task RequestAppHostAttachAsync(int processId, string projectName) 229return Task.CompletedTask; 239public Task LaunchAppHostAsync(string projectFile, List<string> arguments, List<EnvVar> environment, bool debug) 242return Task.CompletedTask;
TestServices\TestGitRepository.cs (2)
16return GetRootAsyncCallback?.Invoke(cancellationToken) ?? Task.FromResult<DirectoryInfo?>(null); 21return GetIncludedFilesAsyncCallback?.Invoke(searchRoot, cancellationToken) ?? Task.FromResult<IReadOnlySet<string>?>(null);
TestServices\TestInteractionService.cs (17)
122return Task.FromResult(value); 135return Task.FromResult(value); 162return Task.FromResult(response.Response); 165return Task.FromResult(binding?.DefaultValue ?? string.Empty); 177return Task.FromResult(match); 194return Task.FromResult((T)result); 202return Task.FromResult(matchingChoice); 206return Task.FromResult(choices.First()); 224return Task.FromResult<IReadOnlyList<T>>(result.Cast<T>().ToList()); 232return Task.FromResult<IReadOnlyList<T>>(preSelected.ToList()); 235return Task.FromResult<IReadOnlyList<T>>(choices.ToList()); 292return Task.FromResult(value); 305return Task.FromResult(ConfirmCallback(promptText, defaultValue)); 310return Task.FromResult(bool.Parse(response.Response)); 313return Task.FromResult(defaultValue); 377public Task DisplayLiveAsync(IRenderable initialRenderable, Func<Action<IRenderable>, Task> callback)
TestServices\TestLanguageDiscovery.cs (6)
33=> Task.FromResult<IEnumerable<LanguageInfo>>(_allLanguages); 39return Task.FromResult(language?.PackageName); 54return Task.FromResult<LanguageId?>(language.LanguageId); 58return Task.FromResult<LanguageId?>(null); 67return Task.FromResult<LanguageId?>(language.LanguageId); 71return Task.FromResult<LanguageId?>(null);
TestServices\TestLanguageService.cs (6)
11public Func<IAppHostProject, bool, CancellationToken, Task>? SetLanguageAsyncCallback { get; set; } 25: Task.FromResult(DefaultProject); 28public Task SetLanguageAsync(IAppHostProject project, bool isGlobal = false, CancellationToken cancellationToken = default) 32: Task.CompletedTask; 47return Task.FromResult(DefaultProject); 62return Task.FromResult(DefaultProject);
TestServices\TestMcpNotifier.cs (4)
21public Task SendNotificationAsync(string method, CancellationToken cancellationToken = default) 24return Task.CompletedTask; 28public Task SendNotificationAsync<TParams>(string method, TParams parameters, CancellationToken cancellationToken = default) 31return Task.CompletedTask;
TestServices\TestMigration.cs (3)
35return Task.FromResult(descriptor); 38public Task ApplyAsync(MigrationContext context, CancellationToken cancellationToken) 42return Task.CompletedTask;
TestServices\TestNewCommandPrompter.cs (7)
26{ } callback => Task.FromResult(callback(validTemplates)), 27_ => Task.FromResult(validTemplates[0]) // If no callback is provided just accept the first template. 35{ } callback => Task.FromResult(callback(defaultName)), 36_ => Task.FromResult(defaultName) // If no callback is provided just accept the default. 58return Task.FromResult(outputPathResolver?.Invoke(outputPath) ?? outputPath); 65{ } callback => Task.FromResult(callback(candidatePackages)), 66_ => Task.FromResult(candidatePackages.First()) // If no callback is provided just accept the first package.
TestServices\TestPackagingService.cs (1)
33return Task.FromResult<IEnumerable<PackageChannel>>(new[] { testChannel });
TestServices\TestProcessExecutionFactory.cs (4)
108? (attempt, options, _) => Task.FromResult(attemptCallback(attempt, options)) 109: (_, _, _) => Task.FromResult((DefaultExitCode, (string?)null))); 221return Task.FromResult(false); 225return Task.FromResult(true);
TestServices\TestScaffoldingService.cs (1)
19return Task.FromResult(true);
TestServices\TestTypeScriptStarterProjectFactory.cs (5)
62return Task.FromResult<string[]>(["apphost.mts", "apphost.ts"]); 87return Task.FromResult(new AppHostValidationResult(IsValid: CanHandle(appHostFile))); 92return Task.FromResult<string?>(VersionHelper.GetDefaultTemplateVersion()); 109return Task.FromResult(RunningInstanceResult.NoRunningInstance); 114return Task.FromResult<string?>(null);
Utils\AppHostHelperTests.cs (1)
488public async Task CheckAppHostCompatibility_VersionCheck(string aspireVersion, bool expectedCompatible)
Utils\CliTestHelper.cs (9)
787public Task EnsureExtractedAsync(CancellationToken cancellationToken = default) => Task.CompletedTask; 790=> Task.FromResult(BundleExtractResult.NoPayload); 793=> Task.FromResult<BundleLayoutLease?>(null); 819public Func<CancellationToken, Task>? EnsureExtractedAsyncCallback { get; set; } 821public Func<CancellationToken, Task>? EnsureExtractedAndAcquireLayoutAsyncCallback { get; set; } 823public Task EnsureExtractedAsync(CancellationToken cancellationToken = default) 824=> EnsureExtractedAsyncCallback?.Invoke(cancellationToken) ?? Task.CompletedTask; 827=> Task.FromResult(isBundle ? BundleExtractResult.AlreadyUpToDate : BundleExtractResult.NoPayload);
Utils\CliUpdateNotificationServiceTests.cs (19)
19public async Task PrereleaseWillRecommendUpgradeToPrereleaseOnSameVersionFamily() 29var cache = new FakeNuGetPackageCache { GetCliPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([ 66public async Task PrereleaseWillRecommendUpgradeToStableInCurrentVersionFamily() 76var cache = new FakeNuGetPackageCache { GetCliPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([ 110public async Task StableWillOnlyRecommendGoingToNewerStable() 120var cache = new FakeNuGetPackageCache { GetCliPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([ 180public async Task NotifyIfUpdateAvailable_UsesDotnetToolCommandForNativeAotToolStorePath() 191GetCliPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([ 216public async Task NotifyIfUpdateAvailable_UsesToolPathCommandForCustomToolPath() 229GetCliPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([ 254public async Task NotifyIfUpdateAvailable_UsesAspireUpdateCommandForStandaloneArchivePath() 265GetCliPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([ 290public async Task NotifyIfUpdateAvailable_UsesNpmCommandForNpmInstall() 302GetCliPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([ 327public async Task StableWillNotRecommendUpdatingToPreview() 336var cache = new FakeNuGetPackageCache { GetCliPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([ 364public async Task NotifyIfUpdateAvailableAsync_WithNewerStableVersion_DoesNotThrow() 373GetCliPackagesAsyncCallback = (_, _, _, _) => Task.FromResult<IEnumerable<NuGetPackage>>([ 389public async Task NotifyIfUpdateAvailableAsync_WithEmptyPackages_DoesNotThrow()
Utils\ConsoleActivityLoggerTests.cs (5)
455public async Task Spinner_DoesNotPropagate_CursorMoveLeftFailureFromLegacyBackend() 484await Task.Delay(50); 496public async Task Spinner_DoesNotCrash_WhenWriteLineRunsConcurrently() 515var writers = Enumerable.Range(0, 4).Select(threadIndex => Task.Run(() => 523await Task.WhenAll(writers);
Utils\DcpConnectionHealthCheckTests.cs (10)
22public async Task CheckAsync_WhenNoDcpBundleIsDiscovered_ReturnsWarningAndSkipsConnectionTests() 42public async Task CheckAsync_WhenDcpExecutableIsMissing_ReturnsFailure() 60public async Task TestConnectionAsync_WhenStartIsCanceledBeforeProcessStarts_PropagatesCancellationAndDisposesExecution() 74(_, _, _) => Task.FromResult((0, (string?)null)), 103public async Task CheckAsync_WhenDcpConnectionsSucceed_ReturnsSingleSuccessResult() 114return Task.FromResult(TestDcpConnectionChecker.CreateResult(useDeveloperCertificate, EnvironmentCheckStatus.Pass, $"useDeveloperCertificate={useDeveloperCertificate} passed")); 135public async Task CheckAsync_WhenDeveloperCertificateConnectionFails_ReturnsFailureWithFix() 141TestConnectionAsyncCallback = (_, useDeveloperCertificate, _) => Task.FromResult( 186public async Task DcpKubeconfig_ReadFileWithRetryAsync_RetriesWhenInitialContentIsPartial() 193Task DelayAsync(TimeSpan _, CancellationToken cancellationToken)
Utils\DeprecatedWorkloadCheckTests.cs (1)
15public async Task CheckAsync_UsesResolvedDotNetPath()
Utils\DevCertsCheckTests.cs (20)
63AsyncAttemptCallback = (_, _, _) => Task.FromResult((0, (string?)hash)) 326public async Task CheckAsync_LinuxWithoutCertUtil_ReturnsCertUtilWarning() 355public async Task CheckAsync_LinuxWithCertUtil_DoesNotReturnCertUtilWarning() 393public async Task CheckAsync_LinuxWithMatchingOpenSslCertificateCache_DoesNotReturnOpenSslCertificateCacheWarning() 441public async Task CheckAsync_LinuxWithFailedOpenSslHashProbeAndMatchingHashStyleEntry_ReturnsOpenSslCertificateCacheWarning() 473AsyncAttemptCallback = (_, _, _) => Task.FromResult((1, (string?)null)) 492public async Task CheckAsync_LinuxWithOpenSslHashProbeStartFailure_ReturnsOpenSslCertificateCacheWarning() 525new TestProcessExecution(fileName, args, env, options, (_, _, _) => Task.FromResult((0, (string?)"12345678")), () => 1) 547public async Task CheckAsync_LinuxWithMissingOpenSslHashEntry_ReturnsOpenSslCertificateCacheWarning() 596public async Task CheckAsync_LinuxWithCallerCanceledOpenSslHashProbeAndKillFailure_ThrowsOperationCanceledException() 633await Task.Delay(TimeSpan.FromSeconds(30), cancellationToken); 656public async Task CheckAsync_LinuxWithOpenSslHashProbeFailureAndKillFailure_ReturnsOpenSslCertificateCacheWarning() 714public async Task CheckAsync_LinuxWithMissingOpenSslHashEntryAndNoOpenSsl_DoesNotReturnOpenSslCertificateCacheWarning() 756public async Task CheckAsync_LinuxWithMissingOpenSslCertificateCacheDirectory_ReturnsOpenSslCertificateCacheWarning() 800public async Task CheckAsync_LinuxWithMissingOpenSslCertificateCacheEntry_ReturnsOpenSslCertificateCacheWarning() 844public async Task CheckAsync_LinuxWithCorruptOpenSslCertificateCache_ReturnsOpenSslCertificateCacheWarning() 890public async Task CheckAsync_LinuxWithUntrustedCertificateAndCorruptOpenSslCertificateCache_ReturnsOpenSslCertificateCacheWarning() 936public async Task CheckAsync_LinuxWithUnrelatedCorruptOpenSslCertificateCache_DoesNotReturnOpenSslCertificateCacheWarning() 979public async Task CheckAsync_LinuxWithStaleOpenSslCertificateCache_ReturnsOpenSslCertificateCacheWarning() 1025public async Task CheckAsync_NonLinux_DoesNotReadEnvironmentVariablesForCertUtilWarning()
Utils\EmptyAsyncEnumerable.cs (1)
30public ValueTask<bool> MoveNextAsync() => new ValueTask<bool>(Task.FromResult(false));
Utils\EnvironmentCheckerTests.cs (6)
14public async Task CheckAllAsync_TimedOutCheckReportsWarningAndContinues() 33return Task.FromResult<IReadOnlyList<EnvironmentCheckResult>>([]); 35new TestEnvironmentCheck(1, _ => Task.FromResult<IReadOnlyList<EnvironmentCheckResult>>([completedResult])), 68public async Task CheckAllAsync_TotalTimeoutReportsWarningAndStops() 78return Task.FromResult<IReadOnlyList<EnvironmentCheckResult>>([]); 94public async Task CheckAllAsync_CallerCancellationPropagates()
Utils\GitTestHelper.cs (3)
11public static async Task EnsureGitAvailableAsync() 26public static async Task ConfigureGitIdentityAsync(string workingDirectory) 35public static async Task RunGitAsync(string workingDirectory, params string[] arguments)
Utils\LegacySettingsFileCheckTests.cs (6)
12public async Task CheckAsync_WithLegacySettingsFile_ReturnsWarning() 39public async Task CheckAsync_WithModernConfigFile_ReturnsEmpty() 55public async Task CheckAsync_WithBothFiles_ReturnsEmpty() 76public async Task CheckAsync_WithModernConfigBoundary_AndNoLegacyFiles_ReturnsEmpty() 100public async Task CheckAsync_WithLegacyFileInParentDirectory_ReturnsWarning() 124public async Task CheckAsync_WithModernConfigInParent_DoesNotWarnAboutLegacyInGrandparent()
Utils\MockHttpMessageHandler.cs (2)
68return Task.FromResult(_responseFactory(request)); 71return Task.FromResult(_response!);
Utils\OutputCollectorTests.cs (12)
12public async Task OutputCollector_ThreadSafety_MultipleThreadsAddingLines() 18var tasks = new Task[threadCount]; 24tasks[i] = Task.Run(() => 40await Task.WhenAll(tasks).DefaultTimeout(); 76public async Task OutputCollector_ConcurrentReadWrite_ShouldNotCrash() 80var readerTask = Task.Run(async () => 85await Task.Delay(1); 89var writerTask = Task.Run(async () => 94await Task.Delay(1); 99await Task.WhenAll(readerTask, writerTask).DefaultTimeout();
Utils\SdkInstallHelperTests.cs (4)
14public async Task EnsureSdkInstalledAsync_WhenSdkAlreadyInstalled_RecordsAlreadyInstalledTelemetry() 40public async Task EnsureSdkInstalledAsync_WhenSdkMissing_RecordsNotInstalledTelemetry() 66public async Task EnsureSdkInstalledAsync_WhenSdkMissing_DisplaysError() 93public async Task EnsureSdkInstalledAsync_WhenSdkMissing_AndDisplayErrorFalse_DoesNotDisplayError()
Aspire.Components.Common.TestUtilities (2)
ConformanceTests.cs (2)
151public async Task EachKeyedComponentRegistersItsOwnHealthCheck() 387public virtual async Task HealthCheckReportsExpectedStatus(string? key)
Aspire.Confluent.Kafka (1)
MetricsService.cs (1)
17protected override async Task ExecuteAsync(CancellationToken stoppingToken)
Aspire.Confluent.Kafka.Tests (8)
Aspire8MetricsTests.cs (4)
18public async Task ExposesStatisticsAsCountersAndGauge_InitializeCounters(TestVariationData variation) 63await Task.WhenAll( 133public async Task ExposesStatisticsAsCountersAndGauge_AggregateCountersByName(TestVariationData variation) 178await Task.WhenAll(
OtelMetricsTests.cs (1)
31public async Task EnsureMetricsAreProducedAsync(bool useKeyed)
OtelTracesTests.cs (1)
33public async Task EnsureTracesAreProducedAsync(bool useKeyed)
ProducerExtensions.cs (2)
10public static async Task FlushAsync<TKey, TValue>(this IProducer<TKey, TValue> producer) 14await Task.Delay(100);
Aspire.Dashboard (477)
Api\ApiAuthenticationHandler.cs (9)
40return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), Scheme.Name))); 51return Task.FromResult(AuthenticateResult.Fail("API key authentication is enabled but no API key is configured.")); 59return Task.FromResult(AuthenticateResult.Fail("Invalid API key header.")); 65return Task.FromResult(AuthenticateResult.Fail("Invalid API key header.")); 72return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), Scheme.Name))); 80return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), Scheme.Name))); 83return Task.FromResult(AuthenticateResult.Fail("Authentication failed.")); 87return Task.FromResult(AuthenticateResult.Fail($"API key from '{ApiKeyHeaderName}' header is missing.")); 91return Task.FromResult(AuthenticateResult.NoResult());
Api\TelemetryApiService.cs (1)
540return Task.CompletedTask;
artifacts\obj\Aspire.Dashboard\Debug\net8.0\DashboardServiceGrpc.cs (3)
142public virtual global::System.Threading.Tasks.Task WatchResources(global::Aspire.DashboardService.Proto.V1.WatchResourcesRequest request, grpc::IServerStreamWriter<global::Aspire.DashboardService.Proto.V1.WatchResourcesUpdate> responseStream, grpc::ServerCallContext context) 148public virtual global::System.Threading.Tasks.Task WatchResourceConsoleLogs(global::Aspire.DashboardService.Proto.V1.WatchResourceConsoleLogsRequest request, grpc::IServerStreamWriter<global::Aspire.DashboardService.Proto.V1.WatchResourceConsoleLogsUpdate> responseStream, grpc::ServerCallContext context) 160public virtual global::System.Threading.Tasks.Task WatchInteractions(grpc::IAsyncStreamReader<global::Aspire.DashboardService.Proto.V1.WatchInteractionsRequestUpdate> requestStream, grpc::IServerStreamWriter<global::Aspire.DashboardService.Proto.V1.WatchInteractionsResponseUpdate> responseStream, grpc::ServerCallContext context)
Authentication\Connection\ConnectionTypeAuthenticationHandler.cs (3)
22return Task.FromResult(AuthenticateResult.Fail("No type specified on this connection.")); 27return Task.FromResult(AuthenticateResult.Fail($"Connection types '{string.Join(", ", Options.RequiredConnectionTypes)}' are not enabled on this connection.")); 30return Task.FromResult(AuthenticateResult.NoResult());
Authentication\Connection\ConnectionTypeMiddleware.cs (1)
24public async Task OnConnectionAsync(ConnectionContext context)
Authentication\FrontendCompositeAuthenticationHandler.cs (1)
35protected override async Task HandleChallengeAsync(AuthenticationProperties properties)
Authentication\OtlpApiKey\OtlpApiKeyAuthenticationHandler.cs (4)
31return Task.FromResult(AuthenticateResult.Fail($"Multiple '{ApiKeyHeaderName}' headers in request.")); 38return Task.FromResult(AuthenticateResult.Fail($"Incoming API key from '{ApiKeyHeaderName}' header doesn't match configured API key.")); 44return Task.FromResult(AuthenticateResult.Fail($"API key from '{ApiKeyHeaderName}' header is missing.")); 47return Task.FromResult(AuthenticateResult.NoResult());
Authentication\UnsecuredAuthenticationHandler.cs (1)
24return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), Scheme.Name)));
Components\Controls\ApplicationName.razor.cs (1)
28protected override async Task OnInitializedAsync()
Components\Controls\AspireMenu.razor.cs (6)
72protected override async Task OnAfterRenderAsync(bool firstRender) 90public async Task CloseAsync() 95public async Task OpenAsync(int screenWidth, int screenHeight, int clientX, int clientY) 143private async Task HandleItemClicked(MenuButtonItem item) 160private async Task OnOpenChanged(bool open) 165private async Task SetOpenAsync(bool open)
Components\Controls\AspireMenuButton.razor.cs (2)
98private async Task ToggleMenu() 142private async Task OnMenuRenderComplete()
Components\Controls\Chart\ChartBase.cs (4)
70protected override async Task OnAfterRenderAsync(bool firstRender) 118private Task OnInstrumentDataUpdate() 128private async Task UpdateChartAsync(bool tickUpdate, DateTimeOffset inProgressDataTime) 243protected abstract Task OnChartUpdatedAsync(List<ChartTrace> traces, List<DateTimeOffset> xValues, List<ChartExemplar> exemplars, bool tickUpdate, DateTimeOffset inProgressDataTime, CancellationToken cancellationToken);
Components\Controls\Chart\ChartContainer.razor.cs (10)
20private Task? _tickTask; 41public required Func<Pages.Metrics.MetricViewKind, Task> OnViewChangedAsync { get; set; } 65protected override async Task OnInitializedAsync() 71_tickTask = Task.Run(UpdateDataAsync); 91private async Task UpdateDataAsync() 115public async Task DimensionValuesChangedAsync(DimensionFilterViewModel dimensionViewModel) 125private async Task UpdateInstrumentDataAsync(OtlpInstrumentData instrument) 167protected override async Task OnParametersSetAsync() 278private Task OnTabChangeAsync(FluentTab newTab) 286return Task.CompletedTask;
Components\Controls\Chart\ChartFilterPopover.razor.cs (2)
27private async Task OnTagSelectionChangedAsync(DimensionValueViewModel tag, bool isChecked) 34private async Task OnAllValuesSelectionChangedAsync(bool? isChecked)
Components\Controls\Chart\ChartFilters.razor.cs (1)
32return Task.CompletedTask;
Components\Controls\Chart\ChartFilterTags.razor.cs (2)
46private Task OnTagClickedAsync(MouseEventArgs args, DimensionValueViewModel tag) 51private async Task OnTagActivatedAsync(DimensionValueViewModel tag, bool toggleSelection)
Components\Controls\Chart\MetricTable.razor.cs (5)
45protected override async Task OnChartUpdatedAsync(List<ChartTrace> traces, List<DateTimeOffset> xValues, List<ChartExemplar> exemplars, bool tickUpdate, DateTimeOffset inProgressDataTime, CancellationToken cancellationToken) 75await Task.Delay(500, cancellationToken); 99private async Task OpenExemplarsDialogAsync(MetricViewBase metric) 239protected override async Task OnAfterRenderAsync(bool firstRender) 269private Task SettingsChangedAsync() => InvokeAsync(StateHasChanged);
Components\Controls\Chart\PlotlyChart.razor.cs (3)
58protected override async Task OnChartUpdatedAsync(List<ChartTrace> traces, List<DateTimeOffset> xValues, List<ChartExemplar> exemplars, bool tickUpdate, DateTimeOffset inProgressDataTime, CancellationToken cancellationToken) 186protected override async Task OnAfterRenderAsync(bool firstRender) 223public async Task ViewSpan(string traceId, string spanId)
Components\Controls\ClearSignalsButton.razor.cs (1)
27public required Func<ResourceKey?, Task> HandleClearSignal { get; set; }
Components\Controls\FluentIconSwitch.razor.cs (1)
8private async Task OnToggleInternalAsync()
Components\Controls\GridValue.razor.cs (3)
135protected override async Task OnAfterRenderAsync(bool firstRender) 151private async Task ToggleMaskStateAsync() 158private async Task OpenTextVisualizerAsync()
Components\Controls\IconCheckbox.razor.cs (2)
100protected override async Task OnAfterRenderAsync(bool firstRender) 110private async Task HandleClickAsync()
Components\Controls\LogLevelSelect.razor.cs (2)
21public required Func<Task> HandleSelectedLogLevelChangedAsync { get; set; } 29private async Task HandleSelectedLogLevelChangedInternalAsync()
Components\Controls\LogViewer.razor.cs (3)
79public async Task RefreshDataAsync() 88private async Task RefreshVirtualizeAsync() 223protected override async Task OnAfterRenderAsync(bool firstRender)
Components\Controls\MarkdownRenderer.razor.cs (1)
43protected override async Task OnAfterRenderAsync(bool firstRender)
Components\Controls\PauseIncomingDataSwitch.razor.cs (1)
15private async Task OnTogglePauseCoreAsync()
Components\Controls\PropertyGrid.razor.cs (1)
162private async Task OnIsValueMaskedChanged(TItem item, bool isValueMasked)
Components\Controls\PropertyValues\ResourceNameButtonValue.razor.cs (2)
50private Task OnClickAsync() 55return Task.CompletedTask;
Components\Controls\PropertyValues\SpanIdButtonValue.razor.cs (1)
35private async Task OnClickAsync()
Components\Controls\PropertyValues\TraceIdButtonValue.razor.cs (1)
23private async Task OnClickAsync()
Components\Controls\ResourceDetails.razor.cs (7)
228["OnExecuteCommandAsync"] = (Func<ResourceViewModel, CommandViewModel, Task>)ExecuteResourceCommandAsync, 246protected override async Task OnAfterRenderAsync(bool firstRender) 281return Task.CompletedTask; 297return Task.CompletedTask; 318private async Task ExecuteResourceCommandAsync(ResourceViewModel resource, CommandViewModel command) 459public Task OnViewRelationshipAsync(ResourceDetailRelationshipViewModel relationship) 462return Task.CompletedTask;
Components\Controls\ResourceSelect.razor.cs (1)
40private Task SelectedResourceChangedCore()
Components\Controls\SelectResourceOptions.razor.cs (4)
15public required Func<Task> OnAllValuesCheckedChangedAsync { get; set; } 18public required Func<TValue, bool, Task> OnValueVisibilityChangedAsync { get; set; } 23private async Task OnAllValuesCheckedChangedInternalAsync(bool? newAreAllVisible) 29private Task OnValueVisibilityChangedInternalAsync(TValue value, bool isVisible)
Components\Controls\SignalsActionsDisplay.razor.cs (1)
25public required Func<ResourceKey?, Task> HandleClearSignal { get; set; }
Components\Controls\SpanDetails.razor.cs (2)
190protected override async Task OnAfterRenderAsync(bool firstRender) 203public async Task OnViewDetailsAsync(SpanLinkViewModel linkVM)
Components\Controls\SpanTypeSelect.razor.cs (2)
22public required Func<Task> HandleSelectedSpanTypeChangedAsync { get; set; } 33private async Task HandleSelectedSpanTypeChangedInternalAsync()
Components\Controls\StructuredLogDetails.razor.cs (1)
141protected override async Task OnAfterRenderAsync(bool firstRender)
Components\Controls\SummaryDetailsView.razor.cs (7)
98protected override async Task OnParametersSetAsync() 135private async Task RaiseOnResizeAsync() 140private async Task HandleDismissAsync() 145private async Task HandleToggleOrientation() 186private async Task HandleSplitterResize(SplitterResizedEventArgs args) 202private async Task SaveSizeToStorage(float panel1Fraction) 232public async Task OnPageKeyDownAsync(AspireKeyboardShortcut shortcut)
Components\Controls\TerminalView.razor.cs (9)
75protected override async Task OnAfterRenderAsync(bool firstRender) 179private async Task InitializeTerminalAsync(string resourceName, int replicaIndex) 219public async Task ReconnectAsync(string? newResourceName, int newReplicaIndex) 266public Task OnTerminalStateChanged(TerminalToolbarState state) 270return Task.CompletedTask; 303public async Task SetFontSizeAsync(int fontPx) 323public async Task SetSizeModeAsync(string sizeKey) 366public async Task RefreshToolbarStateAsync() 389public async Task RefreshLayoutAsync()
Components\Controls\TextVisualizer.razor.cs (2)
61protected override async Task OnInitializedAsync() 67protected override async Task OnAfterRenderAsync(bool firstRender)
Components\Controls\TreeGenAISelector.razor.cs (1)
13public required Func<Task> HandleSelectedTreeItemChangedAsync { get; set; }
Components\Controls\TreeMetricSelector.razor.cs (1)
13public required Func<Task> HandleSelectedTreeItemChangedAsync { get; set; }
Components\Controls\UserProfile.razor.cs (1)
40protected override async Task OnParametersSetAsync()
Components\Dialogs\ExemplarsDialog.razor.cs (1)
36public async Task OnViewDetailsAsync(ChartExemplar exemplar)
Components\Dialogs\FilterDialog.razor.cs (3)
183private async Task ParameterChangedAsync() 200await Task.Delay(100); 286private async Task OpenDatePickerAsync()
Components\Dialogs\GenAIVisualizerDialog.razor.cs (8)
101private async Task UpdateDialogData() 139private async Task GoBackAsync() 148await Task.Delay(50); 153private async Task ViewToolDefinitionAsync(ToolDefinitionViewModel toolDefinition) 161await Task.Delay(50); 185private Task HandleSelectedTreeItemChangedAsync() 194return Task.CompletedTask; 372public static async Task OpenDialogAsync(DashboardDialogService dialogService,
Components\Dialogs\InteractionsInputDialog.razor.cs (5)
88protected override async Task OnAfterRenderAsync(bool firstRender) 197private async Task SubmitAsync() 210private async Task CancelAsync() 230private async Task OnInputFileChangeAsync(InputViewModel inputModel, InputFileChangeEventArgs args) 268private async Task ToggleSecretTextVisibilityAsync(InputViewModel inputModel)
Components\Dialogs\InteractionsProgressDialog.razor.cs (1)
18private async Task CancelAsync()
Components\Dialogs\ManageDataDialog.razor.cs (8)
64private Task? _resourceSubscriptionTask; 72protected override async Task OnInitializedAsync() 87private async Task OnTelemetryChangedAsync() 151private async Task SubscribeResourcesAsync() 166_resourceSubscriptionTask = Task.Run(async () => 539private async Task RemoveSelectedAsync() 598private async Task OnInputFileCompleted(IEnumerable<FluentInputFileEventArgs> args) 626private async Task ExportSelectedAsync()
Components\Dialogs\NotificationEntryComponent.razor.cs (2)
49private async Task HandleDismiss() 54private async Task HandlePrimaryAction()
Components\Dialogs\SettingsDialog.razor.cs (3)
68private async Task ThemeChangedAsync() 101private async Task LaunchManageDataAsync() 118private async Task OnTimeFormatChanged()
Components\Dialogs\TextVisualizerDialog.razor.cs (3)
44protected override async Task OnInitializedAsync() 150private async Task DownloadAsync() 160private async Task UnmaskContentAsync()
Components\Interactions\InteractionsProvider.cs (11)
46private Task? _dialogDisplayTask; 47private Task? _watchInteractionsTask; 108_dialogDisplayTask = Task.Run(async () => 120_watchInteractionsTask = Task.Run(async () => 133private async Task InteractionsDisplayAsync() 135var waitForInteractionAvailableTask = Task.CompletedTask; 155waitForInteractionAvailableTask = Task.CompletedTask; 378private async Task WatchInteractionsAsync() 471return Task.CompletedTask; 484return Task.CompletedTask;
Components\Layout\AspirePageContentLayout.razor.cs (5)
61public Dictionary<string, Func<Task>> DialogCloseListeners { get; } = new(); 63protected override async Task OnParametersSetAsync() 82public async Task OpenMobileToolbarAsync() 105public async Task CloseMobileToolbarAsync() 117private async Task InvokeListenersAsync()
Components\Layout\MainLayout.razor.cs (11)
83protected override async Task OnInitializedAsync() 134private async Task DisplayUnsecuredEndpointsMessageAsync() 199protected override async Task OnAfterRenderAsync(bool firstRender) 235private Task LaunchHelpAsync() => LaunchHelpAsync(GetDefaultReturnFocusElementId(HelpButtonId)); 237private async Task LaunchHelpAsync(string? returnFocusElementId) 297public async Task LaunchAIAgentsAsync() 322public Task LaunchSettingsAsync() => LaunchSettingsAsync(GetDefaultReturnFocusElementId(SettingsButtonId)); 324private async Task LaunchSettingsAsync(string? returnFocusElementId) 358public async Task LaunchNotificationsAsync() 400public async Task OnPageKeyDownAsync(AspireKeyboardShortcut shortcut) 434private async Task ToggleNavMenuExpandedAsync()
Components\Layout\MobileNavMenu.razor.cs (6)
38private Task NavigateToAsync(string url) 41return Task.CompletedTask; 44protected override async Task OnAfterRenderAsync(bool firstRender) 81public async Task CloseMobileNavMenuFromKeyboardAsync() 88public Task CloseMobileNavMenuFromFocusLossAsync() 91return Task.CompletedTask;
Components\Layout\MobileNavMenuEntry.cs (1)
11Func<Task> OnClick,
Components\Layout\NotificationsHeaderButton.razor.cs (2)
13public required Func<Task> OnClick { get; set; } 28private async Task HandleClick()
Components\Layout\ResourceServiceConnectionProvider.cs (3)
32protected override async Task OnAfterRenderAsync(bool firstRender) 65private async Task UpdateModalStateAsync(DashboardConnectionState state) 88public async Task ReconnectFromJs()
Components\Pages\ConsoleLogs.razor.cs (46)
42public Task? SubscriptionTask { get; set; } 146private Task? _resourceSubscriptionTask; 147private Task? _logEntryChannelReaderTask; 153private Task? _showNoLogsMessageDelayTask; 205protected override async Task OnInitializedAsync() 261async Task TrackResourceSnapshotsAsync() 294_resourceSubscriptionTask = Task.Run(async () => 363private async Task StartLogEntryChannelReaderTask() 422protected override async Task OnParametersSetAsync() 458protected override async Task OnAfterRenderAsync(bool firstRender) 491private async Task SubscribeAsync(bool isAllSelected, string? selectedResourceName, bool resetView) 769return Task.CompletedTask; 790private async Task ToggleTimestampAsync(bool showTimestamp, bool isTimestampUtc) 797private async Task ToggleWrapLogsAsync(bool noWrapLogs) 803private async Task UpdateConsoleLogSettingsAsync() 811private async Task ExecuteResourceCommandAsync(CommandViewModel command) 823private async Task CancelAllSubscriptionsAsync() 846await Task.WhenAll(tasks); 850private async Task SubscribeToAllResourcesAsync() 878private Task SubscribeToSingleResourceAsync(ResourceViewModel resource) 885return Task.CompletedTask; 902return Task.CompletedTask; 919private async Task ShowNoLogsMessageAfterDelayAsync(CancellationToken cancellationToken) 923await Task.Delay(s_noLogsMessageDelay, cancellationToken); 1047var consoleLogsTask = Task.Run(async () => 1139private async Task HandleSelectedOptionChangedAsync() 1144private async Task OnResourceChanged(ResourceViewModelChangeType changeType, ResourceViewModel resource) 1167_ = Task.Run(async () => 1188private async Task DownloadLogsAsync() 1210private async Task ClearConsoleLogs(ResourceKey? key) 1289public Task UpdateViewModelFromQueryAsync(ConsoleLogsViewModel viewModel) 1297return Task.CompletedTask; 1309return Task.CompletedTask; 1344private async Task OnTerminalToolbarStateChangedAsync(Controls.TerminalToolbarState state) 1372private Task HandleViewChangedAsync(string? newView) 1376return Task.CompletedTask; 1385return Task.CompletedTask; 1408return Task.CompletedTask; 1417internal Task HandleViewChangedForTestAsync(string? newView) => HandleViewChangedAsync(newView); 1426private Task TerminalFontMinusAsync() 1430return Task.CompletedTask; 1435private Task TerminalFontPlusAsync() 1439return Task.CompletedTask; 1444private Task TerminalSizeChangedAsync(string? newKey) 1448return Task.CompletedTask;
Components\Pages\IPageWithSessionAndUrlState.cs (4)
39public Task UpdateViewModelFromQueryAsync(TViewModel viewModel); 63public static async Task AfterViewModelChangedAsync<TViewModel, TSerializableViewModel>(this IPageWithSessionAndUrlState<TViewModel, TSerializableViewModel> page, AspirePageContentLayout? layout, bool waitToApplyMobileChange) where TSerializableViewModel : class 76async Task SetStateAndNavigateAsync() 86public static async Task RefreshIfMobileAsync<TViewModel, TSerializableViewModel>(this IPageWithSessionAndUrlState<TViewModel, TSerializableViewModel> page, AspirePageContentLayout? layout) where TSerializableViewModel : class
Components\Pages\Login.razor.cs (3)
43protected override async Task OnInitializedAsync() 68protected override async Task OnAfterRenderAsync(bool firstRender) 78private async Task SubmitAsync()
Components\Pages\Metrics.razor.cs (9)
117protected override async Task OnParametersSetAsync() 140public Task UpdateViewModelFromQueryAsync(MetricsViewModel viewModel) 167return Task.CompletedTask; 199private async Task HandleSelectedResourceChangedAsync() 237private Task ClearMetrics(ResourceKey? key) 240return Task.CompletedTask; 243private Task HandleSelectedDurationChangedAsync() 281private Task HandleSelectedTreeItemChangedAsync() 314private async Task OnViewChangedAsync(MetricViewKind newView)
Components\Pages\Resources.razor.cs (30)
110private Task? _resourceSubscriptionTask; 135private async Task OnAllFilterVisibilityCheckedChangedAsync() 142private async Task OnResourceFilterVisibilityChangedAsync(string resourceType, bool isVisible) 149private async Task HandleSearchFilterChangedAsync() 154private async Task VisibleResourcesChangedAsync() 180protected override async Task OnInitializedAsync() 257async Task SubscribeResourcesAsync() 272_resourceSubscriptionTask = Task.Run(async () => 362protected override async Task OnAfterRenderAsync(bool firstRender) 398private async Task UpdateResourceGraphResourcesAsync() 413public async Task SelectResource(string id) 426public async Task ResourceContextMenu(string id, int screenWidth, int screenHeight, int clientX, int clientY) 561protected override async Task OnParametersSetAsync() 591await Task.Delay(200, _cts.Token); 617private async Task ShowContextMenuAsync(ResourceViewModel resource, int screenWidth, int screenHeight, int clientX, int clientY) 649private async Task ShowResourceDetailsAsync(ResourceViewModel resource, string? focusElementId) 698private async Task ClearSelectedResourceAsync(bool causedByUserAction = false) 746private async Task ExecuteResourceCommandAsync(ResourceViewModel resource, CommandViewModel command) 764private async Task OnToggleCollapse(ResourceGridViewModel viewModel) 784private async Task OnToggleCollapseAll() 811private async Task OnToggleResourceType() 836private Task OnTabChangeAsync(FluentTab newTab) 845return Task.CompletedTask; 851private async Task OnViewChangedAsync(ResourceViewKind newView) 889private async Task UpdateResourceGraphSelectedAsync() 945public Task UpdateViewModelFromQueryAsync(ResourcesViewModel viewModel) 953return Task.CompletedTask; 996private async Task ContextMenuClosedAsync(Microsoft.AspNetCore.Components.Web.MouseEventArgs args) 1001private async Task ContextMenuOpenChangedAsync(bool open) 1012private async Task CloseContextMenuAsync(bool closeMenu)
Components\Pages\StructuredLogs.razor.cs (15)
219protected override async Task OnParametersSetAsync() 238await Task.Delay(200, _cts.Token); 251private Task HandleSelectedResourceChangedAsync() 258private async Task HandleSelectedLogLevelChangedAsync() 284private async Task OnShowPropertiesAsync(OtlpLogEntry entry, string? focusElementId) 303private Task ClearSelectedLogEntryAsync(bool causedByUserAction = false) 314return Task.CompletedTask; 317private async Task OpenFilterAsync(FieldTelemetryFilter? entry) 334private async Task HandleFilterDialog(DialogResult result) 364private async Task HandleAfterFilterBindAsync() 400protected override async Task OnAfterRenderAsync(bool firstRender) 477public async Task UpdateViewModelFromQueryAsync(StructuredLogsPageViewModel viewModel) 526private async Task LaunchGenAIVisualizerAsync(OtlpLogEntry logEntry) 570private Task ClearStructureLogs(ResourceKey? key) 573return Task.CompletedTask;
Components\Pages\TraceDetail.razor.cs (17)
200protected override async Task OnParametersSetAsync() 225await Task.Delay(200, _cts.Token); 231protected override async Task OnAfterRenderAsync(bool firstRender) 298private async Task HandleAfterFilterBindAsync() 306private async Task HandleSelectedSpanTypeChangedAsync() 364private async Task OnToggleCollapse(SpanWaterfallViewModel viewModel) 385private async Task RefreshSpanViewAsync() 398private async Task OnShowPropertiesAsync(SpanWaterfallViewModel viewModel, string? focusElementId) 417private Task ClearSelectedSpanAsync(bool causedByUserAction = false) 428return Task.CompletedTask; 452private async Task CollapseAllSpansAsync() 471private async Task ExpandAllSpansAsync() 491private async Task ToggleSpanLogsAsync(OtlpLogEntry logEntry) 511private async Task OnGenAIClickedAsync(OtlpSpan span) 532private async Task OpenFilterAsync(FieldTelemetryFilter? entry) 549private async Task HandleFilterDialog(DialogResult result) 574private async Task RefreshAfterFilterChangeAsync()
Components\Pages\Traces.razor.cs (11)
187protected override async Task OnParametersSetAsync() 207private Task HandleSelectedResourceChanged() 214private async Task HandleSelectedSpanTypeChangedAsync() 236private async Task HandleAfterFilterBindAsync() 255protected override async Task OnAfterRenderAsync(bool firstRender) 302public async Task UpdateViewModelFromQueryAsync(TracesPageViewModel viewModel) 347private async Task OpenFilterAsync(FieldTelemetryFilter? entry) 364private async Task HandleFilterDialog(DialogResult result) 389private Task ClearTraces(ResourceKey? key) 392return Task.CompletedTask; 419private async Task OnGenAIClickedAsync(OtlpTrace trace)
Components\Resize\BrowserDimensionWatcher.cs (2)
23protected override async Task OnAfterRenderAsync(bool firstRender) 49public async Task OnResizeAsync(ViewportSize viewportSize)
Components\ResourcesGridColumns\LogMessageColumnDisplay.razor.cs (1)
30private Task OnLaunchGenAIVisualizerAsync() => LaunchGenAIVisualizerCallback.InvokeAsync(LogEntry);
DashboardEndpointsBuilder.cs (1)
248private static async Task StreamNdjsonAsync(HttpContext httpContext, IAsyncEnumerable<string> items, CancellationToken cancellationToken)
DashboardWebApplication.cs (6)
425_ = Task.Run(async () => 790return Task.CompletedTask; 807return Task.CompletedTask; 882return Task.CompletedTask; 1042public Task StartAsync(CancellationToken cancellationToken = default) 1048public Task StopAsync(CancellationToken cancellationToken = default)
Extensions\ComponentExtensions.cs (4)
11public static async Task SafeRefreshDataAsync<T>(this FluentDataGrid<T>? dataGrid) 19public static async Task SafeRefreshDataAsync(this LogViewer? logViewer) 27public static async Task ExecuteOnDefault<T>(this FluentDataGridRow<T> row, Func<T, Task> call)
Extensions\JSInteropExtensions.cs (3)
20public static async Task DownloadFileAsync(this IJSRuntime js, string fileName, byte[] content) 32public static Task DownloadFileAsync(this IJSRuntime js, string fileName, string content) 43public static async Task DownloadFileAsync(this IJSRuntime js, string fileName, Stream stream)
Model\BrowserLinkOutgoingPeerResolver.cs (1)
10public IDisposable OnPeerChanges(Func<Task> callback)
Model\BrowserSecurityHeadersMiddleware.cs (1)
63public Task InvokeAsync(HttpContext context)
Model\BrowserStorage\BrowserStorageBase.cs (1)
42public async Task SetAsync<TValue>(string key, TValue value)
Model\BrowserStorage\IBrowserStorage.cs (1)
9Task SetAsync<TValue>(string key, TValue value);
Model\BrowserStorage\ILocalStorage.cs (1)
16Task SetUnprotectedAsync<TValue>(string key, TValue value);
Model\BrowserStorage\LocalBrowserStorage.cs (1)
46public async Task SetUnprotectedAsync<TValue>(string key, TValue value)
Model\CommonMenuItems.cs (1)
42async Task OnToggleShowHiddenResources()
Model\ConsoleLogsFetcher.cs (1)
75var results = await Task.WhenAll(logTasks).ConfigureAwait(false);
Model\ConsoleLogsManager.cs (3)
43public async Task EnsureInitializedAsync() 54public IDisposable OnFiltersChanged(Func<Task> callback) 81public async Task UpdateFiltersAsync(ConsoleLogsFilters filters)
Model\DashboardCommandExecutor.cs (8)
36public async Task ExecuteAsync(ResourceViewModel resource, CommandViewModel command, Func<ResourceViewModel, string> getResourceName) 79await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false); 88public async Task ExecuteAsyncCore(ResourceViewModel resource, CommandViewModel command, Func<ResourceViewModel, string> getResourceName) 278Task RequestCancelAsync() 284return Task.CompletedTask; 307return Task.CompletedTask; 343private static NotificationAction CreateCancelNotificationAction(IStringLocalizer<Dashboard.Resources.Resources> loc, Func<Task> onCancelAsync) 367private static async Task OpenViewResponseDialogAsync(DashboardDialogService dialogService, CommandViewModel command, ResourceCommandResponseViewModel response)
Model\DashboardDialogService.cs (1)
117public EventCallback<DialogResult> CreateDialogCallback(object receiver, Func<DialogResult, Task> callback)
Model\IGlobalKeydownListener.cs (1)
9Task OnPageKeyDownAsync(AspireKeyboardShortcut shortcut);
Model\INotificationService.cs (1)
75public required Func<IServiceProvider, Task> OnClick { get; init; }
Model\InstrumentViewModel.cs (2)
14public List<Func<Task>> DataUpdateSubscriptions { get; } = []; 18public async Task UpdateDataAsync(OtlpInstrumentSummary instrument, List<DimensionScope> matchedDimensions)
Model\Interaction\InteractionsInputsDialogViewModel.cs (3)
17public required Func<WatchInteractionsResponseUpdate, bool, Task> OnSubmitCallback { get; init; } 22public Func<Task>? OnInteractionUpdated { get; set; } 24internal async Task UpdateInteractionAsync(WatchInteractionsResponseUpdate item)
Model\IOutgoingPeerResolver.cs (1)
9IDisposable OnPeerChanges(Func<Task> callback);
Model\MenuButtonItem.cs (1)
27public Func<Task>? OnClick { get; set; }
Model\ModelSubscription.cs (3)
6public sealed class ModelSubscription(Func<Task> callback, Action<ModelSubscription> onDispose) : IDisposable 8private readonly Func<Task> _callback = callback; 12public Task ExecuteAsync() => _callback();
Model\ResourceMenuBuilder.cs (4)
90return Task.CompletedTask; 221return Task.CompletedTask; 234return Task.CompletedTask; 248return Task.CompletedTask;
Model\ResourceOutgoingPeerResolver.cs (4)
30private readonly Task? _watchTask; 39_watchTask = Task.Run(async () => 287public IDisposable OnPeerChanges(Func<Task> callback) 305private async Task RaisePeerChangesAsync()
Model\SpanMenuBuilder.cs (1)
82return Task.CompletedTask;
Model\TelemetryExportService.cs (1)
128private async Task AddConsoleLogsAsync(ExportArchive exportArchive, HashSet<string> resourceNames, CancellationToken cancellationToken)
Model\TelemetryImportService.cs (4)
50public async Task ImportAsync(string fileName, Stream stream, CancellationToken cancellationToken) 60private async Task ImportCoreAsync(string fileName, Stream stream, bool allowZipFile, CancellationToken cancellationToken) 93private async Task ImportZipAsync(Stream stream, CancellationToken cancellationToken) 104private async Task ImportJsonAsync(string fileName, Stream stream, CancellationToken cancellationToken)
Model\ThemeManager.cs (3)
101public async Task EnsureInitializedAsync() 114public IDisposable OnThemeChanged(Func<Task> callback) 132public async Task RaiseThemeChangedAsync(string theme)
Model\TraceLinkHelpers.cs (8)
22Func<Func<Task>, Task> dispatcher, 27(ct) => Task.FromResult(getSpan(traceId, spanId) != null), 39Func<Func<Task>, Task> dispatcher, 66var waitForTraceTask = Task.Run(async () => 80await Task.Delay(TimeSpan.FromSeconds(0.5), cts.Token).ConfigureAwait(false);
Model\TraceMenuBuilder.cs (2)
68return Task.CompletedTask; 80return Task.CompletedTask;
Model\ValidateTokenMiddleware.cs (1)
27public async Task InvokeAsync(HttpContext context)
Otlp\Grpc\OtlpGrpcLogsService.cs (1)
25return Task.FromResult(_logsService.Export(request));
Otlp\Grpc\OtlpGrpcMetricsService.cs (1)
25return Task.FromResult(_metricsService.Export(request));
Otlp\Grpc\OtlpGrpcTraceService.cs (1)
25return Task.FromResult(_traceService.Export(request));
Otlp\Http\OtlpHttpEndpointsBuilder.cs (2)
105private static async Task WriteUnsupportedContentTypeResponse(HttpContext httpContext, ILogger logger) 216public async Task ExecuteAsync(HttpContext httpContext)
Otlp\Storage\Subscription.cs (1)
27public Subscription(string name, ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback, Action unsubscribe, ExecutionContext? executionContext, TelemetryRepository telemetryRepository)
Otlp\Storage\TelemetryRepository.cs (7)
280public Subscription OnNewResources(Func<Task> callback) 285public Subscription OnNewLogs(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback) 290public Subscription OnNewMetrics(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback) 295public Subscription OnNewTraces(ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback) 300private Subscription AddSubscription(string name, ResourceKey? resourceKey, SubscriptionType subscriptionType, Func<Task> callback, List<Subscription> subscriptions) 2160private Task OnPeerChanged() 2184return Task.CompletedTask;
ServiceClient\DashboardClient.cs (19)
90private Task? _connection; 242internal Task ResourceWatchCompleteTask => _resourceWatchCompleteTcs.Task; 243internal Task InteractionWatchCompleteTask => _interactionWatchCompleteTcs.Task; 251public Task ReconnectAsync() 255return Task.CompletedTask; 268return Task.CompletedTask; 327_connection = Task.Run(() => ConnectAndWatchAsync(_clientCancellationToken), _clientCancellationToken); 330async Task ConnectAndWatchAsync(CancellationToken cancellationToken) 339await Task.WhenAll( 340Task.Run(async () => 345Task.Run(async () => 390await Task.Delay(delay, delayCts.Token).ConfigureAwait(false); 449private async Task WatchWithRecoveryAsync(Func<RetryContext, CancellationToken, Task<RetryResult>> action, string actionName, CancellationToken cancellationToken) 481await Task.Delay(delay, delayCts.Token).ConfigureAwait(false); 674_ = Task.Run(async () => 761public async Task SendInteractionRequestAsync(WatchInteractionsRequestUpdate request, CancellationToken cancellationToken) 766public Task WhenConnected 915var readTask = Task.Run(async () =>
ServiceClient\IDashboardClient.cs (3)
16Task WhenConnected { get; } 40Task ReconnectAsync(); 79Task SendInteractionRequestAsync(WatchInteractionsRequestUpdate request, CancellationToken cancellationToken);
ShortcutManager.cs (2)
26public Task OnGlobalKeyDown(AspireKeyboardShortcut shortcut) 33return Task.WhenAll(componentsSubscribedToShortcut.Select(component => component.OnPageKeyDownAsync(shortcut)));
src\Shared\ChannelExtensions.cs (1)
43await Task.Delay(s, cancellationToken).ConfigureAwait(false);
src\Shared\TaskHelpers.cs (6)
10public static Task WaitIgnoreCancelAsync(Task? task) 15public static Task WaitIgnoreCancelAsync(Task? task, ILogger logger, string logMessage) 20private static async Task WaitIgnoreCancelCoreAsync(Task? task, ILogger? logger = null, string? logMessage = null)
Telemetry\DashboardTelemetrySender.cs (5)
18private readonly Channel<(OperationContext, Func<HttpClient, Func<OperationContextProperty, object>, Task>)> _channel; 19private Task? _sendLoopTask; 38_channel = Channel.CreateBounded<(OperationContext, Func<HttpClient, Func<OperationContextProperty, object>, Task>)>(channelOptions); 45_sendLoopTask = Task.Run(async () => 162public void QueueRequest(OperationContext context, Func<HttpClient, Func<OperationContextProperty, object>, Task> requestFunc)
Telemetry\DashboardTelemetryService.cs (1)
52public async Task InitializeAsync()
Telemetry\IDashboardTelemetrySender.cs (1)
12public void QueueRequest(OperationContext context, Func<HttpClient, Func<OperationContextProperty, object>, Task> requestFunc);
Terminal\TerminalWebSocketProxy.cs (9)
92internal static async Task HandleAsync(HttpContext context, 258private static async Task BridgeAsync(WebSocket ws, 282var inbound = Task.Run(async () => 333var outbound = Task.Run(async () => 437var firstCompleted = await Task.WhenAny(inbound, outbound).ConfigureAwait(false); 441try { await Task.WhenAll(inbound, outbound).ConfigureAwait(false); } catch { /* swallow */ }
Utils\CallbackThrottler.cs (5)
14public CallbackThrottler(string name, ILogger logger, TimeSpan minExecuteInterval, Func<Task> callback, ExecutionContext? executionContext) 29private readonly Func<Task> _callback; 53await Task.Delay(s, cancellationToken).ConfigureAwait(false); 92private async Task ExecuteAsync() 127_ = Task.Run(ExecuteAsync);
Utils\CancellationSeries.cs (2)
53public Task ClearAsync() 58private async Task Next(CancellationTokenSource? next)
Utils\DashboardUIHelpers.cs (1)
100return Task.CompletedTask;
Utils\FilterHelpers.cs (3)
25Func<FieldTelemetryFilter?, Task> openFilterAsync, 26Func<Task> afterChangeAsync, 97public static async Task OpenFilterAsync(
Utils\GlobalizationHelpers.cs (1)
149var middleware = new RequestLocalizationMiddleware(c => Task.CompletedTask, Options.Create(new RequestLocalizationOptions
Utils\JSInteropHelpers.cs (1)
10public static async Task SafeDisposeAsync(IJSObjectReference? jsObjectReference)
Utils\RoutingExtensions.cs (2)
24return Task.CompletedTask; 33return Task.CompletedTask;
Aspire.Dashboard.Components.Tests (177)
Controls\AspireMenuButtonTests.cs (4)
38public async Task ItemsProvider_AddsMenuWhenButtonIsClicked() 137public async Task ItemsProvider_ParameterChangeDuringPendingInitialization_UsesLatestItems() 153var clickTask = cut.Find("#pending-items-menu-button").ClickAsync(new()); 164public async Task DisposeAsync_CancelsPendingMenuInitialization()
Controls\AspireMenuTests.cs (3)
37public async Task RemoveAspireMenu_UnregistersFluentMenuFromMenuProvider() 92return Task.CompletedTask; 133return Task.CompletedTask;
Controls\GenAIVisualizerDialogTests.cs (6)
31public async Task Render_NoGenAIAttributes_Success() 59public async Task Render_HasGenAIMessages_Success() 122public async Task Render_HasGenAIMessages_CopyButtonHasAccessibleName() 176public async Task UpdateTelemetry_DifferentTrace_ContentInstanceUnchanged() 251await Task.Delay(100); 259public async Task UpdateTelemetry_SameTrace_ContentInstanceChanged()
Controls\LogViewerTests.cs (1)
283public async Task LogViewer_FilterText_RefreshAfterAppendShowsNewMatchingEntries()
Controls\PlotlyChartTests.cs (1)
54public async Task Render_HasInstrument_InitializeChartInvocation(TimeFormat timeFormat, string expectedTooltipTime, string expectedPlotlyTimeFormat)
Controls\ResourceDetailsTests.cs (8)
28public async Task ClickMaskAllSwitch_UpdatedResource_MaskChanged() 121public async Task ClickMaskAllSwitch_NewResource_MaskChanged() 214public async Task ClickMaskEnvVarSwitch_UpdatedResource_MaskChanged() 298public async Task ClickMaskEnvVarSwitch_NewResource_MaskChanged() 495public async Task Render_HighlightedUnknownProperty_ShowsInDefaultResourceDetailsAndPreservesSensitivity() 727public async Task UnsetParameterResource_RendersValueNotSetButton_AndInvokesSetCommand() 773public async Task UnsetParameterResource_WhenSetCommandIsExecuting_DisablesValueNotSetButton() 850builder.Add(p => p.CommandSelected, EventCallback.Factory.Create<CommandViewModel>(this, _ => Task.CompletedTask));
Controls\TextVisualizerDialogTests.cs (12)
21public async Task Render_TextVisualizerDialog_WithValidJson_FormatsJsonAsync() 56public async Task Render_TextVisualizerDialog_WithValidXml_FormatsXml_CanChangeFormatAsync() 83public async Task Render_TextVisualizerDialog_FormatPicker_UsesFluentSelectAndPreservesSelectionAfterParentRerenderAsync() 136public async Task Render_TextVisualizerDialog_WithValidXml_FormatsXmlWithDoctypeAsync() 157public async Task Render_TextVisualizerDialog_WithInvalidJson_FormatsPlaintextAsync() 173public async Task Render_TextVisualizerDialog_WithPlaintextUrl_RendersClickableLinkAsync() 186public async Task Render_TextVisualizerDialog_WithDifferentThemes_LineClassesChange() 205public async Task Render_TextVisualizerDialog_ResolveTheme_LineClassesChange() 217public async Task Render_TextVisualizerDialog_WithSecret_ShowsWarningFirstOpenAsync() 247public async Task Render_TextVisualizerDialog_WithSecret_DoesNotShowWarningIfSetLocallyFirstOpenAsync() 263public async Task Render_TextVisualizerDialog_WithFixedFormat_UsesFixedFormatAndHidesDropdownAsync() 282public async Task Render_TextVisualizerDialog_WithFixedJsonFormat_UsesJsonFormatAsync()
Dialogs\InteractionsInputDialogTests.cs (6)
21public async Task Render_FileUsesFallbackPlaceholderAndScopedBrowseLabel() 40OnSubmitCallback = (_, _) => Task.CompletedTask 57public async Task Render_SecretRevealButton_IsKeyboardFocusable() 76public async Task Render_MultipleFileSelection_ValidatesMaximumFileCount(int fileCount, bool expectedAccepted) 95OnSubmitCallback = (_, _) => Task.CompletedTask 159OnSubmitCallback = (_, _) => Task.CompletedTask
Dialogs\ManageDataDialogTests.cs (5)
32public async Task Render_SelectionControlsExposeAccessibleNamesCheckboxRoleAndState() 136public async Task IconCheckbox_DoesNotInvokeClickWhenDisabled() 156public async Task Render_ClearedSignals_PrunesSelectionsAndSupportsRemovingEmptyResource() 270private static async Task ExpandResourceRowsAsync(IRenderedComponent<ManageDataDialog> cut, int expectedCount) 350private static Task ClickSelectionCheckboxAsync(IRenderedComponent<ManageDataDialog> cut, string accessibleName, string ariaChecked) =>
Interactions\InteractionsProviderTests.cs (20)
35public async Task Initialize_DashboardClientNotEnabled_ProviderDisabledAsync() 57public async Task Initialize_DashboardClientEnabled_ProviderEnabledAsync() 84public async Task ReceiveData_MessageBoxOpen_OpenDialog() 91var dialogService = new TestDialogService(onShowDialog: (data, parameters) => Task.FromResult<IDialogReference>(dialogReference)); 131public async Task ReceiveData_MessageBoxOpenAndCompletion_OpenAndCloseDialog() 138var dialogService = new TestDialogService(onShowDialog: (data, parameters) => Task.FromResult<IDialogReference>(dialogReference)); 182public async Task ReceiveData_InputDialogOpenAndCancel_OpenDialogAndSendCompletion() 196return Task.FromResult<IDialogReference>(dialogReference); 241public async Task ReceiveData_InputDialogOpenAndSubmit_OpenDialogAndSendCompletion() 257return Task.FromResult<IDialogReference>(dialogReference); 304public async Task ReceiveData_NotificationReceivedTwice_IgnoreReplayedNotification() 316return Task.FromResult(message); 377public async Task ReceiveData_MessageBoxReceivedTwice_IgnoreReplayedNotification() 389return Task.FromResult<IDialogReference>(dialogReference); 455public async Task ReceiveData_InputDialogWithMarkdownMessage_ExpectedResolvedMessage(bool markdownSupported, string message, string expectedMessage) 471return Task.FromResult<IDialogReference>(dialogReference); 513public async Task ReceiveData_ProgressDialogOpenAndCancel_OpenDialogAndSendResult() 527return Task.FromResult<IDialogReference>(dialogReference); 575public async Task ReceiveData_ProgressDialogOpenAndCompletion_OpenAndCloseDialog() 582var dialogService = new TestDialogService(onShowDialog: (data, parameters) => Task.FromResult<IDialogReference>(dialogReference));
Layout\MainLayoutTests.cs (21)
27public async Task OnInitialize_UnsecuredOtlp_NotDismissed_DisplayMessageBar() 41return Task.CompletedTask; 91public async Task OnInitialize_UnsecuredOtlp_Dismissed_NoMessageBar(bool unsecuredTelemetryMessageDismissedKey, bool unsecuredEndpointMessageDismissedKey) 103return Task.CompletedTask; 128var timeoutTask = Task.Delay(100); 129var completedTask = await Task.WhenAny(messageShownTcs.Task, timeoutTask).DefaultTimeout(); 140public async Task OnInitialize_UnsecuredOtlp_SuppressConfigured_NoMessageBar(bool expectMessageBar, bool telemetrySuppressUnsecuredMessage) 155return Task.CompletedTask; 181var timeoutTask = Task.Delay(100); 182var completedTask = await Task.WhenAny(messageShownTcs.Task, timeoutTask).DefaultTimeout(); 199public async Task NavMenuExpanded_RestoresAndPersistsToggledState(bool storedExpanded) 238public async Task HeaderDialogClose_RestoresFocusToLaunchButton(bool isDesktop, string launchButtonId, string expectedDialogId, string expectedFocusId) 245return Task.FromResult<IDialogReference>(new DialogReference(parameters.Id, dialogService!)); 289public async Task HeaderDialogClose_AfterViewportChange_RestoresFocusToVisibleLaunchButton( 301return Task.FromResult<IDialogReference>(new DialogReference(parameters.Id, dialogService!)); 350public async Task HeaderDialogShortcutClose_RestoresFocusToLaunchButton(AspireKeyboardShortcut shortcut, string launchButtonId, string expectedDialogId) 357return Task.FromResult<IDialogReference>(new DialogReference(parameters.Id, dialogService!));
Layout\MobileNavMenuTests.cs (6)
72public async Task CloseMobileNavMenuFromFocusLossAsync_ClosesMenuWithoutRestoringFocus() 84public async Task CloseMobileNavMenuFromKeyboardAsync_ClosesMenuAndRestoresFocus() 115builder.Add(p => p.LaunchHelpAsync, () => Task.CompletedTask); 116builder.Add(p => p.LaunchAIAgentsAsync, () => Task.CompletedTask); 118builder.Add(p => p.LaunchNotificationsAsync, () => Task.CompletedTask); 119builder.Add(p => p.LaunchSettingsAsync, () => Task.CompletedTask);
Pages\ConsoleLogsTerminalTests.cs (11)
41public async Task TerminalResource_Live_Selected_RendersBothViews_DefaultsToTerminal() 89await Task.CompletedTask; 93public async Task TerminalResource_ViewPicker_MarksActiveViewAsChecked() 143public async Task TerminalResource_NotLive_Selected_RendersBothViews_DefaultsToConsole() 185await Task.CompletedTask; 189public async Task TerminalResource_NotLive_Selected_ThenGoesLive_StaysOnConsole() 249public async Task TerminalResource_Live_ManualConsoleSelection_SurvivesFilterChange() 297public async Task SwitchingFromTerminalToNonTerminalResource_TearsDownTerminalView() 355await Task.CompletedTask; 359public async Task SwitchingFromTerminalToNonTerminalResource_RestoresSearchFilter() 433public async Task TerminalResource_ViewToggle_RenderedDisplayStylesMatchActiveView()
Pages\ConsoleLogsTests.cs (10)
36public async Task NoResourceName_SingleResource_RedirectToResource() 86public async Task ResourceName_SubscribeOnLoadAndChange_SubscribeConsoleLogsOnce() 172public async Task ToggleHiddenResources_HiddenResourceVisibilityAndSelection_WorksCorrectly() 329public async Task ResourceName_ViaUrlAndResourceLoaded_LogViewerUpdated() 379public async Task SearchFilter_UpdatesLogViewerFilterAndVisibleLogs(bool isDesktop) 444public async Task ReadingLogs_ErrorDuringRead_SetStatusAndLog() 493public async Task ReadingLogs_ErrorDuringReadAfterDispose_StatusUnchanged() 544public async Task ClearLogEntries_AllResources_LogsFilteredOut() 605public async Task ConsoleLogsManager_ClearLogs_LogsFilteredOutAsync() 725public async Task ExecuteCommand_DelayExecuting_IsExecutingReturnsTrueWhileRunning()
Pages\MetricsTests.cs (1)
52public async Task InitialLoad_SingleResource_RedirectToResource()
Pages\ResourcesTests.cs (3)
224public async Task ResourceGraphContextMenu_MenuCloseCompletesBrowserCallback() 254Task? showContextMenuTask = null; 257showContextMenuTask = (Task)showContextMenuAsync.Invoke(cut.Instance, [resource, 1024, 768, 20, 20])!;
Pages\TraceDetailsTests.cs (9)
152public async Task Render_ChangeTrace_RowsRendered() 220public async Task Render_TraceUpdateWithNewSpans_RowsRendered() 301public async Task Render_UpdateDifferentTrace_TraceNotUpdated() 382public async Task Render_SpansOrderedByStartTime_RowsRenderedInCorrectOrder() 451public async Task Render_DurationFilter_FiltersShortSpans() 569public async Task Render_DurationFilter_LongRoot_DoesNotExposeShortChildren() 793cut.InvokeAsync(() => collapseAllMenuItem!.OnClick?.Invoke() ?? Task.CompletedTask); 868cut.InvokeAsync(() => collapseAllMenuItem!.OnClick?.Invoke() ?? Task.CompletedTask); 881cut.InvokeAsync(() => expandAllMenuItem!.OnClick?.Invoke() ?? Task.CompletedTask);
Shared\TestLocalStorage.cs (8)
19return Task.FromResult(new StorageResult<T>(success: success, value: (T)(value ?? default(T))!)); 21return Task.FromResult(new StorageResult<T>(success: false, value: default)); 29return Task.FromResult(new StorageResult<T>(success: success, value: (T)(value ?? default(T))!)); 31return Task.FromResult(new StorageResult<T>(success: false, value: default)); 34public Task SetAsync<T>(string key, T value) 36return Task.CompletedTask; 39public Task SetUnprotectedAsync<T>(string key, T value) 45return Task.CompletedTask;
Shared\TestMessageService.cs (1)
22public event Func<Task>? OnMessageItemsUpdatedAsync;
Shared\TestThemeResolver.cs (1)
14return Task.FromResult(new ThemeSettings(SelectedTheme: null, EffectiveTheme: EffectiveTheme));
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
tests\Shared\TestDashboardClient.cs (8)
25public Task WhenConnected { get; } 32public Task ReconnectAsync() => Task.CompletedTask; 44Task? whenConnected = null) 48WhenConnected = whenConnected ?? Task.CompletedTask; 80return Task.FromResult(Guid.NewGuid().ToString("N")); 122return Task.FromResult(new ResourceViewModelSubscription(_initialResources?.ToImmutableArray() ?? [], BuildSubscription(channel, cancellationToken))); 153public async Task SendInteractionRequestAsync(WatchInteractionsRequestUpdate request, CancellationToken cancellationToken)
tests\Shared\TestDashboardTelemetrySender.cs (2)
18return Task.FromResult(IsTelemetryEnabled); 21public void QueueRequest(OperationContext context, Func<HttpClient, Func<OperationContextProperty, object>, Task> requestFunc)
tests\Shared\TestDialogService.cs (11)
26public Task CloseAsync(IDialogReference dialog) => throw new NotImplementedException(); 27public Task CloseAsync(IDialogReference dialog, DialogResult result) => throw new NotImplementedException(); 28public EventCallback<DialogResult> CreateDialogCallback(object receiver, Func<DialogResult, Task> callback) => throw new NotImplementedException(); 29public void ShowConfirmation(object receiver, Func<DialogResult, Task> callback, string message, string primaryText = "Yes", string secondaryText = "No", string? title = null) => throw new NotImplementedException(); 30public Task<IDialogReference> ShowConfirmationAsync(object receiver, Func<DialogResult, Task> callback, string message, string primaryText = "Yes", string secondaryText = "No", string? title = null) => throw new NotImplementedException(); 94public void ShowSplashScreen(object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) => throw new NotImplementedException(); 95public void ShowSplashScreen<T>(object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) where T : IDialogContentComponent<SplashScreenContent> => throw new NotImplementedException(); 96public void ShowSplashScreen(Type component, object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) => throw new NotImplementedException(); 97public Task<IDialogReference> ShowSplashScreenAsync(object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) => throw new NotImplementedException(); 99public Task<IDialogReference> ShowSplashScreenAsync<T>(object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) where T : IDialogContentComponent<SplashScreenContent> => throw new NotImplementedException(); 101public Task<IDialogReference> ShowSplashScreenAsync(Type component, object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) => throw new NotImplementedException();
tests\Shared\TestSessionStorage.cs (4)
18return Task.FromResult(new StorageResult<T>(success: success, value: (T)(value ?? default(T))!)); 21return Task.FromResult<StorageResult<T>>(new StorageResult<T>(success: false, value: default)); 24public Task SetAsync<T>(string key, T value) 31return Task.CompletedTask;
Aspire.Dashboard.Tests (417)
BrowserSecurityHeadersMiddlewareTests.cs (5)
18public async Task InvokeAsync_Development_AllowExternalFetch() 33public async Task InvokeAsync_Production_DenyExternalFetch() 50public async Task InvokeAsync_Scheme_ImageSourceChangesOnScheme(string scheme, string expectedContent) 68public async Task InvokeAsync_Otlp_NotAdded(ConnectionType connectionType) 88new BrowserSecurityHeadersMiddleware(c => Task.CompletedTask, new TestHostEnvironment { EnvironmentName = environmentName });
ChannelExtensionsTests.cs (18)
16public async Task GetBatchesAsync_AsyncEnumerable_YieldsFullAndFinalBatches() 33public async Task GetBatchesAsync_AsyncEnumerable_CancellationToken_Exits() 38var readTask = Task.Run(async () => 54public async Task GetBatchesAsync_CancellationToken_Exits() 64var readTask = Task.Run(async () => 78public async Task GetBatchesAsync_WithCancellation_Exits() 88var readTask = Task.Run(async () => 102public async Task GetBatchesAsync_MinReadInterval_WaitForNextRead() 113var readTask = Task.Run(async () => 146public async Task GetBatchesAsync_MinReadInterval_WithCancellation_Exit() 157var readTask = Task.Run(async () => 199await Task.Yield(); 207await Task.Delay(Timeout.InfiniteTimeSpan, cancellationToken);
DashboardOptionsTests.cs (3)
257public async Task OtlpOptions_SuppressUnsecuredMessage_LegacyName() 301public async Task OpenIdConnectOptions_ClaimActions_MapJsonKeyTestAsync() 333public async Task OpenIdConnectOptions_UsesDashboardCookieManager()
GlobalizationHelpersTests.cs (1)
97public async Task ResolveSetCultureToAcceptedCultureAsync_MatchRequestToResult(string requestedLanguage, string acceptLanguage, string? result)
Integration\BlazorWebSocketOriginTests.cs (2)
17public async Task BlazorWebSocket_InvalidOrigin_ReturnsForbidden(string? origin, string path) 32public async Task BlazorWebSocket_SameOrigin_UpgradeSucceeds()
Integration\DashboardClientAuthTests.cs (5)
38public async Task ConnectsToResourceService_Unsecured(bool useHttps) 54public async Task ConnectsToResourceService_ApiKey(bool useHttps) 168return Task.FromResult(new ApplicationInformationResponse() 174public override Task WatchResources( 188return Task.CompletedTask;
Integration\FrontendBrowserTokenAuthTests.cs (13)
28public async Task Get_Unauthenticated_RedirectToLogin() 50public async Task Get_LoginPage_ValidToken_RedirectToApp() 79public async Task Get_LoginPage_ValidToken_HttpEndpointAfterHttpsEndpoint_RedirectToApp() 127public async Task Get_LoginPage_ValidToken_HttpEndpointWithHttpsEndpoint_UsesHttpSpecificCookie() 165public async Task Get_Signout_HttpsEndpointWithHttpAndHttpsCookies_DeletesBothCookies() 215public async Task Get_LoginPage_ValidToken_HttpEndpointWithHttpsEndpoint_RedirectToApp() 247public async Task Get_LoginPage_ValidToken_ForwardedHttps_UsesHttpsCookie() 279public async Task Get_LoginPage_ValidToken_OtlpHttpConnection_Denied() 305public async Task Get_LoginPage_InvalidToken_RedirectToLoginWithoutToken() 330public async Task Post_ValidateTokenApi_AvailableBasedOnOptions(FrontendAuthMode authMode, string requestToken, HttpStatusCode statusCode, bool? result) 357public async Task LogOutput_NoToken_GeneratedTokenLogged() 432public async Task LogOutput_AnyIP_LoginLinkLocalhost(string frontendUrl, string linkHost) 460public async Task LogOutput_InContainer_LoginLinkContainerMessage()
Integration\FrontendOpenIdConnectAuthTests.cs (2)
17public async Task Get_Unauthenticated_RedirectsToAuthority() 60public async Task Get_Unauthenticated_OtlpHttpConnection_Denied()
Integration\HealthTests.cs (2)
14public async Task HealthEndpoint_SendRequest_200Response() 24static async Task MakeRequestAndAssert(string basePath, Version httpVersion)
Integration\OtlpCorsHttpServiceTests.cs (4)
21public async Task ReceivePreflight_OtlpHttpEndPoint_NoCorsConfiguration_NotFound() 42public async Task ReceivePreflight_OtlpHttpEndPoint_ValidCorsOrigin_Success() 83public async Task ReceivePreflight_OtlpHttpEndPoint_InvalidCorsOrigin_NoCorsHeadersReturned() 110public async Task ReceivePreflight_OtlpHttpEndPoint_AnyOrigin_Success()
Integration\OtlpGrpcServiceTests.cs (11)
28public async Task CallService_OtlpGrpcEndPoint_Success() 48public async Task CallService_OtlpGrpcEndPoint_RequiredApiKeyMissing_Failure() 70public async Task CallService_OtlpGrpcEndPoint_RequiredApiKeyWrong_Failure() 97public async Task CallService_OtlpGrpcEndPoint_RequiredApiKeySent_Success() 124public async Task CallService_OtlpGrpcEndPoint_RequiredSecondaryApiKeySent_Success() 155public async Task CallService_OtlpGrpcEndPoint_ExternalFile_FileChanged_UseConfiguredKey(string dashboardConfigFilePathNameKey) 242public async Task CallService_BrowserEndPoint_Failure() 273public async Task CallService_OtlpEndpoint_RequiredClientCertificateMissing_Failure() 299public async Task CallService_OtlpEndpoint_RequiredClientCertificateValid_Success(string? allowedThumbprint) 335public async Task CallService_OtlpEndpoint_RequiredClientCertificateSHA1Thumbprint_Failure() 375public async Task CallService_OtlpEndpoint_RequiredClientCertificateValid_NotInAllowedList_Failure()
Integration\OtlpHttpJsonTests.cs (9)
499public async Task CallService_Traces_JsonContentType_Success() 559public async Task CallService_Logs_JsonContentType_Success() 636public async Task CallService_Events_JsonContentType_Success() 686public async Task CallService_Metrics_JsonContentType_Success() 738public async Task CallService_Metrics_NumericBucketCounts_Success() 823public async Task CallService_JsonContentType_WithApiKey_Success() 851public async Task CallService_JsonContentType_WithoutApiKey_Failure() 874public async Task CallService_JsonContentType_InvalidJson_BadRequest() 892public async Task CallService_JsonContentType_EmptyBody_Success()
Integration\OtlpHttpServiceTests.cs (12)
36public async Task CallService_OtlpHttpEndPoint_BigData_Success() 62public async Task CallService_OtlpHttpEndPoint_ExceedRequestLimit_Failure() 103public async Task CallService_OtlpHttpEndPoint_RequiredApiKeyMissing_Failure() 127public async Task CallService_OtlpHttpEndPoint_RequiredApiKeyWrong_Failure() 155public async Task CallService_OtlpGrpcEndPoint_RequiredApiKeySent_Success() 188public async Task CallService_BrowserEndPoint_Failure() 221public async Task CallService_OtlpHttpEndPoint_UnsupportedContentType_Failure(string? contentType) 249public async Task CallService_OtlpHttpEndPoint_UnsupportedContentType_Logs(string? contentType) 299public async Task CallService_OtlpHttpEndPoint_UnsupportedMethods_Failure(string method) 324public async Task CallService_OtlpHttpEndPoint_Logs_Success() 353public async Task CallService_OtlpHttpEndPoint_Traces_Success() 382public async Task CallService_OtlpHttpEndPoint_Metrics_Success()
Integration\Playwright\AccessibilityTests.cs (15)
76public Task DashboardPage_HasNoSeriousOrCriticalWcagViolations(string relativeUrl, string theme) 89public Task DashboardHomePage_IsAccessibleAcrossViewports(string viewportName, int width, int height) 103public Task DashboardDialog_HasNoSeriousOrCriticalWcagViolations(string surface, string theme) 119public async Task FluentDelegatedInput_ShowsVisibleFocusIndicator(string theme, string controlName, string partName) 168public async Task DarkAccentButtonInteractionStates_MeetWcagAaContrast() 233private static readonly IReadOnlyDictionary<string, (string StartUrl, string Label, Func<IPage, Task> OpenSurfaceAsync)> s_dialogSurfaces = 234new Dictionary<string, (string, string, Func<IPage, Task>)>(StringComparer.Ordinal) 240private static async Task OpenSettingsFlyoutAsync(IPage page) 253private static async Task OpenAddFilterDialogAsync(IPage page) 276public async Task CodeblockSyntaxColors_MeetWcagAaContrast(string theme) 328private async Task AssertNoBlockingWcagViolationsAsync(string relativeUrl, string theme, ViewportSize viewport, string? viewportLabel = null, Func<IPage, Task>? openSurfaceAsync = null, string? surfaceLabel = null) 430private static async Task WaitForComponentsAndFontsAsync(IPage page) 448private static Task WaitForPageContentAsync(IPage page, string relativeUrl) 529private static async Task AssertVisibleFocusIndicatorAsync(ILocator host, string partName)
Integration\Playwright\AppBarTests.cs (3)
23public async Task AppBar_Change_Theme() 34async Task SetAndVerifyTheme(string checkboxText, string? expected) 72public async Task AppBar_AccentColors_UseFluentDesignTokens(string theme, string expectedRest, string expectedHover)
Integration\Playwright\AspireMenuButtonFocusTests.cs (1)
23public async Task MenuButton_ItemSelected_RestoresFocusToMenuButton()
Integration\Playwright\BrowserTokenAuthenticationTests.cs (7)
48public async Task BrowserToken_LoginPage_Success_RedirectToResources() 79public async Task BrowserToken_LoginPage_SuccessWithWhitespaceToken_RedirectToResources() 108public async Task BrowserToken_LoginPage_Failure_DisplayFailureMessage() 135public async Task BrowserToken_QueryStringToken_Success_RestrictToResources() 153public async Task BrowserToken_QueryStringToken_Failure_DisplayLoginPage() 180public async Task BrowserToken_QueryStringToken_HttpsThenHttp_WebKit_Success() 207private async Task RunHttpsThenHttpAsync(IBrowser browser)
Integration\Playwright\DashboardInteractionsTests.cs (4)
31public async Task GridColumn_DoubleClickResizeHandle_AutoFitsColumnWidth() 75public async Task ScrollButtons_ActivateForOverflowingRegion_AndScrollIt() 131public async Task ScrollButtons_RemainInactiveWhenRegionHasNoRoomForControl() 168private static async Task GoToResourcesAndWaitAsync(IPage page)
Integration\Playwright\Infrastructure\MockDashboardClient.cs (7)
42public Task WhenConnected => Task.CompletedTask; 49public Task ReconnectAsync() => Task.CompletedTask; 58return Task.FromResult(new ResourceViewModelSubscription( 66await Task.CompletedTask; 75public Task SendInteractionRequestAsync(WatchInteractionsRequestUpdate request, CancellationToken cancellationToken)
Integration\Playwright\Infrastructure\PlaywrightFixture.cs (1)
29public async Task GoToHomeAndWaitForDataGridLoad(IPage page)
Integration\Playwright\Infrastructure\PlaywrightTestsBase.cs (2)
23public async Task RunTestAsync(Func<IPage, Task> test)
Integration\Playwright\MobileNavMenuTests.cs (2)
24public async Task MobileNavMenuClosesWhenFocusLeavesMenu() 61public async Task MobileNavFocusRemainsVisibleAtHighZoomViewport()
Integration\Playwright\ResourcesTests.cs (5)
25public async Task ViewOptionsMenu_ReportsExpandedState() 46public async Task UrlLink_EnterDoesNotOpenResourceDetails() 67public async Task ResourceViewTabs_RemainVisibleAtNarrowViewport() 87public async Task ResourceViewTabs_RemainVisibleAtNarrowHorizontalViewport() 126private static async Task AssertTabVisibleWithinViewportAsync(ILocator tab, int viewportWidth)
Integration\ResponseCompressionTests.cs (2)
15public async Task Html_Responses_Are_Not_Compressed() 37public async Task Static_Asset_Responses_Are_Compressed(string path)
Integration\ServerRetryHelper.cs (4)
27public static Task BindPortWithRetry(Func<int, Task> retryFunc, ILogger logger) 35public static async Task BindPortsWithRetry(Func<List<int>, Task> retryFunc, ILogger logger, int portCount)
Integration\StartupTests.cs (31)
36public async Task EndPointAccessors_AppStarted_EndPointPortsAssigned() 68public async Task RunAsync_TokenCancelled_ShutsDownAndReturnsZero() 104public async Task EndPointAccessors_AppStarted_IPv4OrIPv6() 141public async Task Configuration_NoExtraConfig_Error() 157public async Task Configuration_EmptyAllowedCertificateRule_Error() 175public async Task Configuration_ConfigFilePathDoesntExist_Error(string dashboardConfigFilePathNameKey) 204public async Task Configuration_FileConfigDirectoryDoesExist_Success(string dashboardFileConfigDirectoryNameKey) 236public async Task Configuration_FileConfigDirectoryReloadsChanges_Success() 283public async Task Configuration_FileConfigDirectoryDoesntExist_Error() 302public async Task Configuration_OptionsMonitor_CanReadConfiguration() 321public async Task Configuration_OptionsMonitor_DebugSession() 352public async Task Configuration_BrowserAndOtlpGrpcEndpointSame_Https_EndPointPortsAssigned() 407public async Task Configuration_BrowserAndOtlpGrpcEndpointSame_NoHttps_Error() 457public async Task Configuration_BrowserAndOtlpHttpEndpointSame_NoHttps_EndPointPortsAssigned() 515public async Task Configuration_NoAuthMode_DefaultAuthModes() 537public async Task Configuration_AllowAnonymous_NoError() 556public async Task Configuration_ResourceClientCertificates() 575public async Task Configuration_Logging_OverrideDefaults() 600public async Task Configuration_Logging_FileConfig_OverrideDefaults(string dashboardConfigFilePathNameKey) 645public async Task LogOutput_DynamicPort_PortResolvedInLogs() 699public async Task LogOutput_NoOtlpEndpoints_NoOtlpLogs() 745public async Task ApiEnabledDisabled_ReturnsExpectedStatusAndWarning(string configKey, bool? value, HttpStatusCode expectedStatusCode, bool expectWarning) 789public async Task LogOutput_LocalhostAddress_LocalhostInLogOutput() 883public async Task Configuration_NoOtlpEndpoints_Success() 905public async Task EndPointAccessors_AppStarted_BrowserGet_Success() 924public async Task Configuration_CorsNoOtlpHttpEndpoint_Error() 942public async Task Configuration_ForwardedHeaders_OverrideDefaults(bool enableForwardedHeaders) 1005public async Task Configuration_DisableResourceGraph_EnsureValueSetOnOptions(bool? value) 1018public async Task ServiceProvider_AppCreated_LoggerProvidersRegistered() 1033public async Task Run_AddressAlreadyInUse_ReturnsExitCodeAddressInUse() 1059public async Task Run_ValidationFailure_ReturnsExitCodeValidationFailure()
Integration\TelemetryApiTests.cs (21)
29public async Task Configuration_ApiAuthModeDefaults_WhenNotConfigured() 51public async Task GetSpans_NoAuth_ReturnsUnauthorized() 76public async Task GetSpans_UnsecuredMode_Returns200() 98public async Task GetSpans_WithApiKey_Returns200() 123public async Task GetSpans_WithWrongApiKey_ReturnsUnauthorized() 148public async Task GetLogs_UnsecuredMode_Returns200() 170public async Task GetLogs_WithTraceIdFilter_Returns200() 192public async Task GetSpans_WithQueryParameters_Returns200() 213public async Task GetSpans_WithUnknownResource_Returns404() 232public async Task GetLogs_WithQueryParameters_Returns200() 253public async Task GetLogs_WithUnknownResource_Returns404() 272public async Task GetSpans_ApiAuthModeUnsecured_AllowsAccessWithoutAuth() 292public async Task GetSpans_ApiAuthModeApiKey_RequiresApiKey() 317public async Task GetSpans_WithSecondaryApiKey_Returns200() 342public async Task GetSpans_StreamingMode_ReturnsNdjsonContentType() 373public async Task GetLogs_StreamingMode_ReturnsNdjsonContentType() 406public async Task GetTraces_UnsecuredMode_Returns200() 428public async Task GetTraces_WithHasErrorFilter_Returns200() 450public async Task GetTraces_WithUnknownResource_Returns404() 469public async Task GetTraceById_NotFound_Returns404() 488public async Task GetTraces_WithApiKey_Returns200()
LocalBrowserStorageTests.cs (4)
21public async Task SetUnprotectedAsync_JSInvokedWithJson(object? value, string result) 46public async Task GetUnprotectedAsync_HasValue_Success() 72public async Task GetUnprotectedAsync_NoValue_Failure() 97public async Task GetUnprotectedAsync_InvalidValue_Failure()
Middleware\ValidateTokenMiddlewareTests.cs (8)
19public async Task ValidateToken_NotBrowserTokenAuth_RedirectedToHomepage() 27public async Task ValidateToken_NotBrowserTokenAuth_RedirectedToReturnUrl() 35public async Task ValidateToken_BrowserTokenAuth_WrongToken_RedirectsToLogin() 43public async Task ValidateToken_BrowserTokenAuth_WrongToken_RedirectsToLogin_WithReturnUrl() 51public async Task ValidateToken_BrowserTokenAuth_RightToken_RedirectsToHome() 59public async Task ValidateToken_BrowserTokenAuth_RightToken_RedirectsToReturnUrl() 72public async Task ValidateToken_NotBrowserTokenAuth_AbsoluteReturnUrl_RedirectsToHomepage(string returnUrl) 85public async Task ValidateToken_BrowserTokenAuth_RightToken_AbsoluteReturnUrl_RedirectsToHomepage(string returnUrl)
Model\DashboardClientTests.cs (47)
45public async Task SubscribeResources_OnCancel_ChannelRemoved() 60var readTask = Task.Run(async () => 75public async Task SubscribeResources_OnDispose_ChannelRemoved() 88var readTask = Task.Run(async () => 103public async Task SubscribeResources_ThrowsIfDisposed() 113public async Task SubscribeResources_IncreasesSubscriberCount() 132public async Task SubscribeResources_HasInitialData_InitialDataReturned() 157public async Task SubscribeInteractions_OnCancel_ChannelRemoved() 171var readTask = Task.Run(async () => 186public async Task SubscribeInteractions_OnDispose_ChannelRemoved() 198var readTask = Task.Run(async () => 213public async Task SubscribeInteractions_ThrowsIfDisposed() 223public async Task SubscribeInteractions_IncreasesSubscriberCount() 241public async Task WhenConnected_InteractionMethodUnimplemented_InteractionWatchCompleted() 252public async Task ConnectionState_InitialState_IsConnecting() 262public async Task ConnectionState_SetConnected_FiresEvent() 278public async Task ConnectionState_DuplicateState_DoesNotFireEvent() 293public async Task ConnectionState_DisconnectedResetsWhenConnected() 312public async Task ReconnectAsync_CancelsDelay() 323public async Task ConnectionState_ConcurrentSetSameState_FiresEventOnce() 332var tasks = Enumerable.Range(0, 10).Select(_ => Task.Run(() => 336await Task.WhenAll(tasks).DefaultTimeout(); 343public async Task WatchWithRecovery_RepeatedFailures_FiresMultipleDisconnectedEvents() 374public async Task ConnectWithRetry_LogsErrorWithTroubleshootingLink() 404public async Task ConnectWithRetry_UnsupportedDashboardVersion_SetsUnsupportedState() 456public async Task ConnectWithRetry_CompatibleMinVersion_SetsConnectedState(string minDashboardVersion) 479public async Task ExecuteResourceCommandAsync_AppHostUnavailable_ReturnsClearFailure() 497public async Task ExecuteResourceCommandAsync_ClientCancellation_ReturnsAppHostDisconnectedFailure() 531Task.FromResult(new Metadata()), 542Task.FromException<ApplicationInformationResponse>(new RpcException(new Status(StatusCode.Unavailable, "Service unavailable"))), 543Task.FromResult(new Metadata()), 550Task.FromResult(new ApplicationInformationResponse 555Task.FromResult(new Metadata()), 567Task.FromResult(new Metadata()), 576Task.FromException<ResourceCommandResponse>(new RpcException(new Status(StatusCode.Unavailable, "Service unavailable"))), 577Task.FromResult(new Metadata()), 584Task.FromResult(new ResourceCommandResponse 588Task.FromResult(new Metadata()), 598await Task.Delay(Timeout.InfiniteTimeSpan, cancellationToken); 616Task.FromResult(new Metadata()), 639return Task.FromResult(false); 647public Task CompleteAsync() 652public Task WriteAsync(T message)
Model\DashboardCommandExecutorTests.cs (6)
24public async Task ExecuteAsyncCore_CancelNotificationAction_CancelsCommandAndUpdatesNotification() 43var executeTask = executor.ExecuteAsyncCore(resource, command, r => r.DisplayName); 71public async Task ExecuteAsyncCore_CancelNotificationAction_IsIdempotent() 88var executeTask = executor.ExecuteAsyncCore(resource, command, r => r.DisplayName); 112public async Task ExecuteAsyncCore_SuccessfulCommandWithoutResult_ClearsCancelToastAction() 129var executeTask = executor.ExecuteAsyncCore(resource, command, r => r.DisplayName);
Model\TelemetryExportServiceTests.cs (4)
625public async Task ExportSelectedAsync_ExportsOnlySelectedDataTypesForSpecificResources() 686public async Task ExportAllAsync_WhenDashboardClientDisabled_ExportsOnlyTelemetry() 728public async Task ExportSelectedAsync_SkipsEmptyResources() 787public async Task ExportSelectedAsync_JapaneseCharactersInLogs_PreservesContent()
Model\TelemetryImportServiceTests.cs (13)
34public async Task ImportAsync_WhenDisabled_ThrowsInvalidOperationException() 49public async Task ImportAsync_JsonFile_WithLogs_ImportsSuccessfully() 74public async Task ImportAsync_JsonFile_WithTraces_ImportsSuccessfully() 97public async Task ImportAsync_JsonFile_WithMetrics_ImportsSuccessfully() 120public async Task ImportAsync_ZipFile_WithMultipleJsonFiles_ImportsAll() 162public async Task ImportAsync_ZipFile_IgnoresNonJsonFiles() 198public async Task ImportAsync_TxtFile_IsIgnored() 215public async Task ImportAsync_EmptyJsonFile_HandlesGracefully() 232public async Task ImportAsync_InvalidJson_HandlesGracefully() 249public async Task ImportAsync_UnsupportedExtension_HandlesGracefully() 266public async Task ImportAsync_RoundTrip_LogsExportAndImport_PreservesData() 317public async Task ImportAsync_RoundTrip_LogsWithAspireLogId_FiltersOutAttribute() 378public async Task ImportAsync_RoundTrip_TracesExportAndImport_PreservesData()
OtlpApiKeyAuthenticationHandlerTests.cs (4)
19public async Task AuthenticateAsync_NoHeader_Failure() 33public async Task AuthenticateAsync_BigApiKeys_NoMatch_Failure() 47public async Task AuthenticateAsync_BigApiKeys_Match_Success() 64public async Task AuthenticateAsync_MatchHeader_Success(string primaryApiKey, string? secondaryApiKey, string otlpApiKeyHeader, bool success)
ResourceOutgoingPeerResolverTests.cs (6)
274public async Task OnPeerChanges_DataUpdates_EventRaised() 582public Task WhenConnected => Task.CompletedTask; 589public Task ReconnectAsync() => Task.CompletedTask; 596public Task SendInteractionRequestAsync(WatchInteractionsRequestUpdate request, CancellationToken cancellationToken) => throw new NotImplementedException();
Telemetry\ComponentTelemetryContextTests.cs (2)
14public async Task ComponentTelemetryContext_TelemetryEnabled_EndToEnd() 64public async Task ComponentTelemetryContext_TelemetryDisabled_EndToEnd()
Telemetry\DashboardTelemetrySenderTests.cs (7)
19public async Task CreateTelemetryService_WithNoDebugSession_ShowsTelemetryUnsupported() 33public async Task CreateTelemetryService_WithDebugSession_Optout_ShowsTelemetryUnsupported() 56public async Task CreateTelemetryService_WithValidDebugSession_DifferentServerResponses_ShowsTelemetrySupported( 85return Task.FromException<HttpResponseMessage>(new InvalidOperationException()); 87return Task.FromResult(new HttpResponseMessage(telemetryEnabledResponseStatusCode.Value) { Content = new StringContent(telemetryEnabledResponseBody ?? string.Empty) }); 93return Task.FromException<HttpResponseMessage>(new InvalidOperationException()); 95return Task.FromResult(new HttpResponseMessage(startTelemetryResponseStatusCode.Value));
Telemetry\DashboardTelemetryServiceTests.cs (9)
23public async Task CreateTelemetryService_WithDebugSession_Optout_ShowsTelemetryUnsupported() 47return Task.FromResult(0); 57public async Task CreateTelemetryService_WithoutValidDebugSession_ShowsTelemetryUnsupported(bool enabled, int expectCount) 77public async Task WriteTelemetry_IntegrationTest_TelemetrySent() 108return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK) 115return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK)); 119return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK)); 123return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK) 133return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK)
Telemetry\TelemetryLoggerProviderTests.cs (1)
14public async Task Log_DifferentCategoryAndEventIds_WriteTelemetryForBlazorUnhandedErrorAsync()
TelemetryApiServiceTests.cs (7)
24public async Task FollowSpansAsync_StreamsAllSpans() 45public async Task FollowLogsAsync_StreamsAllLogs() 83public async Task FollowSpansAsync_WithInvalidResourceName_ReturnsNoSpans() 106public async Task FollowLogsAsync_WithInvalidResourceName_ReturnsNoLogs() 158public async Task FollowSpansAsync_WithTraceIdFilter_MatchesShortenedIds() 805public async Task FollowSpansAsync_WaitsForResourceToAppear_ThenStreams() 827public async Task FollowLogsAsync_WaitsForResourceToAppear_ThenStreams()
TelemetryRepositoryTests\LogTests.cs (13)
276using var subscription = repository.OnNewLogs(resourceKey: null, SubscriptionType.Read, () => Task.CompletedTask); 328using var subscription = repository.OnNewLogs(resourceKey: new ResourceKey("TestService", "1"), SubscriptionType.Read, () => Task.CompletedTask); 381using var subscription = repository.OnNewLogs(resourceKey: null, SubscriptionType.Other, () => Task.CompletedTask); 446public async Task Subscriptions_AddLog() 455return Task.CompletedTask; 493return Task.CompletedTask; 539return Task.CompletedTask; 567public async Task Subscription_RaisedFromDifferentContext_InitialContextPreserved() 579return Task.CompletedTask; 583Task task; 586task = Task.Run(() => 702public async Task Subscription_MultipleUpdates_MinExecuteIntervalApplied() 725await Task.Delay(20);
TelemetryRepositoryTests\TelemetryRepositoryTests.cs (34)
30using var subscription = repository.OnNewLogs(resourceKey: null, SubscriptionType.Other, () => Task.CompletedTask); 151callback: () => Task.CompletedTask, 165public async Task Subscription_ExecuteAfterDispose_LogWithNoExecute() 189callback: () => Task.CompletedTask, 362public async Task WatchSpansAsync_ReturnsExistingSpans_ThenNewSpans() 392var watchTask = Task.Run(async () => 442public async Task WatchSpansAsync_CanBeCancelled() 450var watchTask = Task.Run(async () => 480public async Task WatchLogsAsync_ReturnsExistingLogs_ThenNewLogs() 510var watchTask = Task.Run(async () => 559public async Task WatchLogsAsync_CanBeCancelled() 567var watchTask = Task.Run(async () => 597public async Task WatchSpansAsync_ReturnsExistingSpans_OrderedByStartTime() 687public async Task WatchSpansAsync_ReturnsExistingSpans_OrderedByStartTime_AcrossTracesWithOverlappingTimes() 766public async Task WatchSpansAsync_FiltersById_WhenResourceKeyProvided() 873public async Task WatchSpansAsync_MultipleResourceKeys_FiltersCorrectly() 904public async Task WatchLogsAsync_MultipleResourceKeys_FiltersCorrectly() 935public async Task WatchLogsAsync_FiltersAppliedWhenPushing() 976var watchTask = Task.Run(async () => 1026public async Task WatchLogsAsync_SeverityFilterApplied() 1067var watchTask = Task.Run(async () => 1120public async Task WatchLogsAsync_TextFragmentsFilterApplied() 1150var watchTask = Task.Run(async () => 1204public async Task WatchLogsAsync_DisabledFiltersAreIgnored() 1252var watchTask = Task.Run(async () => 1301public async Task WatchSpansAsync_DisabledFiltersAreIgnored() 1349var watchTask = Task.Run(async () =>
TelemetryRepositoryTests\TestOutgoingPeerResolver.cs (3)
12private readonly List<Func<Task>> _callbacks; 24public IDisposable OnPeerChanges(Func<Task> callback) 30public async Task InvokePeerChanges()
TelemetryRepositoryTests\TraceTests.cs (1)
2138public async Task AddTraces_OnPeerUpdated_HaveUninstrumentedPeers()
Terminal\DefaultTerminalConnectionResolverTests.cs (11)
17public async Task ConnectAsync_WhenClientNotEnabled_ReturnsNull() 28public async Task ConnectAsync_WhenResourceNotFound_ReturnsNull() 42public async Task ConnectAsync_WhenReplicaIndexDoesNotMatch_ReturnsNull() 57public async Task ConnectAsync_WhenSnapshotMissingTerminalEnabledMarker_ReturnsNull() 77public async Task ConnectAsync_WhenSnapshotMissingConsumerUdsPath_ReturnsNull() 97public async Task ConnectAsync_WhenUdsPathDoesNotExist_FailsToConnect() 143public Task WhenConnected => Task.CompletedTask; 150public Task ReconnectAsync() => Task.CompletedTask; 158public Task SendInteractionRequestAsync(WatchInteractionsRequestUpdate request, CancellationToken cancellationToken) => throw new NotImplementedException();
Terminal\TerminalWebSocketProxyEndpointTests.cs (5)
35public async Task TerminalEndpoint_MissingOrigin_Returns403_AndDoesNotCallResolver() 53public async Task TerminalEndpoint_DisallowedOrigin_Returns403_AndDoesNotCallResolver() 73public async Task TerminalEndpoint_SameOrigin_ProceedsToResolver() 175return Task.FromResult<Stream?>(null); 196return Task.FromResult(AuthenticateResult.Success(ticket));
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
tests\Shared\TestDashboardClient.cs (8)
25public Task WhenConnected { get; } 32public Task ReconnectAsync() => Task.CompletedTask; 44Task? whenConnected = null) 48WhenConnected = whenConnected ?? Task.CompletedTask; 80return Task.FromResult(Guid.NewGuid().ToString("N")); 122return Task.FromResult(new ResourceViewModelSubscription(_initialResources?.ToImmutableArray() ?? [], BuildSubscription(channel, cancellationToken))); 153public async Task SendInteractionRequestAsync(WatchInteractionsRequestUpdate request, CancellationToken cancellationToken)
tests\Shared\TestDashboardTelemetrySender.cs (2)
18return Task.FromResult(IsTelemetryEnabled); 21public void QueueRequest(OperationContext context, Func<HttpClient, Func<OperationContextProperty, object>, Task> requestFunc)
tests\Shared\TestDialogService.cs (11)
26public Task CloseAsync(IDialogReference dialog) => throw new NotImplementedException(); 27public Task CloseAsync(IDialogReference dialog, DialogResult result) => throw new NotImplementedException(); 28public EventCallback<DialogResult> CreateDialogCallback(object receiver, Func<DialogResult, Task> callback) => throw new NotImplementedException(); 29public void ShowConfirmation(object receiver, Func<DialogResult, Task> callback, string message, string primaryText = "Yes", string secondaryText = "No", string? title = null) => throw new NotImplementedException(); 30public Task<IDialogReference> ShowConfirmationAsync(object receiver, Func<DialogResult, Task> callback, string message, string primaryText = "Yes", string secondaryText = "No", string? title = null) => throw new NotImplementedException(); 94public void ShowSplashScreen(object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) => throw new NotImplementedException(); 95public void ShowSplashScreen<T>(object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) where T : IDialogContentComponent<SplashScreenContent> => throw new NotImplementedException(); 96public void ShowSplashScreen(Type component, object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) => throw new NotImplementedException(); 97public Task<IDialogReference> ShowSplashScreenAsync(object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) => throw new NotImplementedException(); 99public Task<IDialogReference> ShowSplashScreenAsync<T>(object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) where T : IDialogContentComponent<SplashScreenContent> => throw new NotImplementedException(); 101public Task<IDialogReference> ShowSplashScreenAsync(Type component, object receiver, Func<DialogResult, Task> callback, DialogParameters<SplashScreenContent> parameters) => throw new NotImplementedException();
tests\Shared\TestSessionStorage.cs (4)
18return Task.FromResult(new StorageResult<T>(success: success, value: (T)(value ?? default(T))!)); 21return Task.FromResult<StorageResult<T>>(new StorageResult<T>(success: false, value: default)); 24public Task SetAsync<T>(string key, T value) 31return Task.CompletedTask;
Aspire.Deployment.EndToEnd.Tests (161)
AcaCompactNamingDeploymentTests.cs (5)
25public async Task DeployWithCompactNamingFixesStorageCollision() 39public async Task DeployWithMultipleContainerAppEnvironmentsCreatesDistinctManagedEnvironments() 48private async Task DeployWithCompactNamingFixesStorageCollisionCore(CancellationToken cancellationToken) 202private async Task DeployWithMultipleContainerAppEnvironmentsCreatesDistinctManagedEnvironmentsCore(CancellationToken cancellationToken) 346private async Task CleanupResourceGroupAsync(string resourceGroupName)
AcaCompactNamingUpgradeDeploymentTests.cs (3)
25public async Task UpgradeFromGaToDevDoesNotDuplicateStorageAccounts() 34private async Task UpgradeFromGaToDevDoesNotDuplicateStorageAccountsCore(CancellationToken cancellationToken) 396private async Task CleanupResourceGroupAsync(string resourceGroupName)
AcaCustomRegistryDeploymentTests.cs (2)
21public async Task DeployStarterTemplateWithCustomRegistry() 31private async Task DeployStarterTemplateWithCustomRegistryCore(CancellationToken cancellationToken)
AcaDeploymentErrorOutputTests.cs (2)
28public async Task DeployWithInvalidLocation_ErrorOutputIsClean() 37private async Task DeployWithInvalidLocation_ErrorOutputIsCleanCore(CancellationToken cancellationToken)
AcaExistingRegistryDeploymentTests.cs (2)
20public async Task DeployStarterTemplateWithCrossResourceGroupExistingRegistry() 30private async Task DeployStarterTemplateWithCrossResourceGroupExistingRegistryCore(CancellationToken cancellationToken)
AcaManagedRedisDeploymentTests.cs (2)
22public async Task DeployStarterWithManagedRedisToAzureContainerApps() 32private async Task DeployStarterWithManagedRedisToAzureContainerAppsCore(CancellationToken cancellationToken)
AcaStarterDeploymentTests.cs (2)
20public async Task DeployStarterTemplateToAzureContainerApps() 30private async Task DeployStarterTemplateToAzureContainerAppsCore(CancellationToken cancellationToken)
AcrPurgeTaskDeploymentTests.cs (2)
21public async Task DeployPythonStarterWithPurgeTask() 31private async Task DeployPythonStarterWithPurgeTaskCore(CancellationToken cancellationToken)
AksAzureKubernetesEnvironmentCertManagerDeploymentTests.cs (2)
32public async Task DeployApiWithCertManagerToAzureKubernetesEnvironment() 42private async Task DeployApiWithCertManagerToAzureKubernetesEnvironmentCore(CancellationToken cancellationToken)
AksAzureKubernetesEnvironmentCertManagerTypeScriptDeploymentTests.cs (2)
35public async Task DeployTypeScriptApiWithCertManagerToAzureKubernetesEnvironment() 45private async Task DeployTypeScriptApiWithCertManagerToAzureKubernetesEnvironmentCore(CancellationToken cancellationToken)
AksAzureKubernetesEnvironmentGatewayDeploymentTests.cs (2)
26public async Task DeployApiWithGatewayToAzureKubernetesEnvironment() 36private async Task DeployApiWithGatewayToAzureKubernetesEnvironmentCore(CancellationToken cancellationToken)
AksBlazorRedisDeploymentTests.cs (2)
21public async Task DeployBlazorWithRedisToAksInteractive() 31private async Task DeployBlazorWithRedisToAksInteractiveCore(CancellationToken cancellationToken)
AksMultipleNodePoolsDeploymentTests.cs (2)
21public async Task DeployAksWithMultipleNodePools() 31private async Task DeployAksWithMultipleNodePoolsCore(CancellationToken cancellationToken)
AksPersistentVolumeDeploymentTests.cs (9)
17public async Task DeployAksPersistentVolumeSurvivesRedeploy() 26private async Task DeployAksPersistentVolumeSurvivesRedeployCore(CancellationToken cancellationToken) 324private static async Task WaitForStatefulSetAndManagedDiskAsync( 349private static async Task VerifyFileSystemGroupAsync( 372private static async Task DeployAsync( 394private static async Task StartPortForwardAsync( 405private static async Task StopPortForwardAsync( 414private static async Task VerifyApiResponseAsync( 456private async Task CleanupResourceGroupAsync(string resourceGroupName)
AksStarterDeploymentTests.cs (3)
19public async Task DeployStarterTemplateToAks() 29private async Task DeployStarterTemplateToAksCore(CancellationToken cancellationToken) 368private async Task CleanupResourceGroupAsync(string resourceGroupName)
AksStarterWithRedisHelmDeploymentTests.cs (3)
21public async Task DeployStarterTemplateWithRedisToAks() 31private async Task DeployStarterTemplateWithRedisToAksCore(CancellationToken cancellationToken) 397private async Task CleanupResourceGroupAsync(string resourceGroupName)
AksVnetInfraDeploymentTests.cs (3)
20public async Task DeployAksWithVnetInfrastructure() 30private async Task DeployAksWithVnetInfrastructureCore(CancellationToken cancellationToken) 202private async Task CleanupResourceGroupAsync(string resourceGroupName)
AksVnetWithAzureResourcesDeploymentTests.cs (2)
21public async Task DeployAksVnetWithAzureResources() 31private async Task DeployAksVnetWithAzureResourcesCore(CancellationToken cancellationToken)
AksWithAzureResourcesDeploymentTests.cs (2)
21public async Task DeployAksWithAzureResources() 31private async Task DeployAksWithAzureResourcesCore(CancellationToken cancellationToken)
AksWithHelmChartDeploymentTests.cs (2)
27public async Task DeployAksWithHelmChart() 37private async Task DeployAksWithHelmChartCore(CancellationToken cancellationToken)
AppServicePythonDeploymentTests.cs (2)
21public async Task DeployPythonFastApiTemplateToAzureAppService() 31private async Task DeployPythonFastApiTemplateToAzureAppServiceCore(CancellationToken cancellationToken)
AppServiceReactDeploymentTests.cs (6)
21public async Task DeployReactTemplateToAzureAppServiceWithDelegatedSubnet() 31private async Task DeployReactTemplateToAzureAppServiceWithDelegatedSubnetCore(CancellationToken cancellationToken) 351private static async Task VerifyNoVnetIntegrationAsync( 377private static async Task VerifyVnetIntegrationAsync( 413private static async Task TriggerCleanupResourceGroupAsync(string resourceGroupName, ITestOutputHelper output) 439await Task.WhenAll(process.WaitForExitAsync(), standardOutputTask, standardErrorTask);
AppServiceStoragePrivateEndpointDeploymentTests.cs (4)
18public async Task DeployReactTemplateWithAppServiceVnetAndStoragePrivateEndpoint() 27private async Task DeployReactTemplateWithAppServiceVnetAndStoragePrivateEndpointCore(CancellationToken cancellationToken) 386private static async Task TriggerCleanupResourceGroupAsync(string resourceGroupName, ITestOutputHelper output) 412await Task.WhenAll(process.WaitForExitAsync(), standardOutputTask, standardErrorTask);
AzureAppConfigDeploymentTests.cs (3)
20public async Task DeployAzureAppConfigResource() 30private async Task DeployAzureAppConfigResourceCore(CancellationToken cancellationToken) 178private async Task CleanupResourceGroupAsync(string resourceGroupName)
AzureContainerRegistryDeploymentTests.cs (3)
20public async Task DeployAzureContainerRegistryResource() 30private async Task DeployAzureContainerRegistryResourceCore(CancellationToken cancellationToken) 161private async Task CleanupResourceGroupAsync(string resourceGroupName)
AzureEventHubsDeploymentTests.cs (3)
20public async Task DeployAzureEventHubsResource() 30private async Task DeployAzureEventHubsResourceCore(CancellationToken cancellationToken) 178private async Task CleanupResourceGroupAsync(string resourceGroupName)
AzureKeyVaultDeploymentTests.cs (3)
20public async Task DeployAzureKeyVaultResource() 30private async Task DeployAzureKeyVaultResourceCore(CancellationToken cancellationToken) 178private async Task CleanupResourceGroupAsync(string resourceGroupName)
AzureLogAnalyticsDeploymentTests.cs (3)
20public async Task DeployAzureLogAnalyticsResource() 30private async Task DeployAzureLogAnalyticsResourceCore(CancellationToken cancellationToken) 161private async Task CleanupResourceGroupAsync(string resourceGroupName)
AzureResourceScopeDeploymentTests.cs (3)
19public async Task DeployExistingServiceBusWithResourceGroupAndSubscriptionScope() 29private async Task DeployExistingServiceBusWithResourceGroupAndSubscriptionScopeCore(CancellationToken cancellationToken) 212private async Task CleanupResourceGroupAsync(string resourceGroupName)
AzureRoleAssignmentRunModeTests.cs (3)
31public async Task RoleAssignmentsSucceedForAmbientCredentialInRunMode() 41private async Task RoleAssignmentsSucceedForAmbientCredentialInRunModeCore(CancellationToken cancellationToken) 240private async Task CleanupResourceGroupAsync(string resourceGroupName, string subscriptionId)
AzureServiceBusDeploymentTests.cs (3)
20public async Task DeployAzureServiceBusResource() 30private async Task DeployAzureServiceBusResourceCore(CancellationToken cancellationToken) 180private async Task CleanupResourceGroupAsync(string resourceGroupName)
AzureStorageDeploymentTests.cs (5)
20public async Task DeployAzureStorageResource() 31public async Task DeployStarterWithSharedAzureStorageReferences() 41private async Task DeployAzureStorageResourceCore(CancellationToken cancellationToken) 196private async Task DeployStarterWithSharedAzureStorageReferencesCore(CancellationToken cancellationToken) 355private async Task CleanupResourceGroupAsync(string resourceGroupName)
AzureStorageRunModeTests.cs (3)
19public async Task ResourceCommandReturnsLiveAzureResourceInfo() 29private async Task ResourceCommandReturnsLiveAzureResourceInfoCore(CancellationToken cancellationToken) 223private async Task CleanupResourceGroupAsync(string resourceGroupName, string subscriptionId)
FoundryHostedAgentDeploymentTests.cs (2)
22public async Task DeployFoundryHostedAgentToAzure() 32private async Task DeployFoundryHostedAgentToAzureCore(CancellationToken cancellationToken)
FrontDoorDeploymentTests.cs (2)
21public async Task DeployReactTemplateWithFrontDoor() 31private async Task DeployReactTemplateWithFrontDoorCore(CancellationToken cancellationToken)
Helpers\DeploymentE2EAutomatorHelpers.cs (4)
17internal static async Task PrepareEnvironmentAsync( 28internal static async Task InstallAspireCliAsync( 155internal static async Task SourceAspireCliEnvironmentAsync( 165internal static async Task AspireDestroyAsync(
Helpers\DeploymentE2ETestHelpers.cs (1)
136internal static async Task StopAppHostAsync(string workspacePath, Action<string> log)
KubernetesGatewayTlsDeploymentTests.cs (3)
26public async Task DeployStarterWithGatewayTlsToKubernetes() 36private async Task DeployStarterWithGatewayTlsToKubernetesCore(CancellationToken cancellationToken) 470private async Task CleanupResourceGroupAsync(string resourceGroupName)
KubernetesHelmChartDeploymentTests.cs (3)
21public async Task DeployStarterWithExternalHelmChartToKubernetes() 31private async Task DeployStarterWithExternalHelmChartCore(CancellationToken cancellationToken) 313private async Task CleanupResourceGroupAsync(string resourceGroupName)
NspStorageKeyVaultDeploymentTests.cs (2)
21public async Task DeployReactTemplateWithNspStorageAndKeyVault() 31private async Task DeployReactTemplateWithNspStorageAndKeyVaultCore(CancellationToken cancellationToken)
PythonFastApiDeploymentTests.cs (2)
21public async Task DeployPythonFastApiTemplateToAzureContainerApps() 31private async Task DeployPythonFastApiTemplateToAzureContainerAppsCore(CancellationToken cancellationToken)
RadiusAzureResourcesDeploymentTests.cs (1)
26public async Task PublishWithAzureKeyVaultReferenceDocumentsCurrentRadiusGap()
RadiusStarterDeploymentTests.cs (3)
34public async Task DeployStarterTemplateToRadiusOnAks() 44private async Task DeployStarterTemplateToRadiusOnAksCore(CancellationToken cancellationToken) 633private async Task CleanupResourceGroupAsync(string resourceGroupName)
tests\Shared\Hex1bAutomatorTestHelpers.cs (14)
21internal static async Task WaitForAnyPromptAsync( 48internal static async Task ExecuteCommandUntilOutputAsync( 222internal static async Task WaitForSuccessPromptAsync( 266internal static async Task RunCommandAsync( 280internal static async Task PrepareBashEnvironmentAsync( 309internal static async Task ExtractLocalHiveArchiveAsync( 323internal static async Task ConfigureLocalHiveAsync( 336internal static async Task SourceAspireEnvironmentAsync( 350internal static async Task LogAspireCliVersionAsync( 363internal static async Task WaitForAspireAddCompletionAsync( 414internal static async Task DeclineAgentInitPromptAsync( 476internal static async Task AspireNewAsync( 643internal static async Task AspireInitAsync( 726internal static async Task WaitForPipelineSuccessAsync(
tests\Shared\TemporaryWorkspace.cs (1)
27public async Task InitializeGitAsync(CancellationToken cancellationToken = default)
TypeScriptAzureContainerAppJobDeploymentTests.cs (3)
18public async Task DeployTypeScriptContainerAppJobsToAzureContainerApps() 28private async Task DeployTypeScriptContainerAppJobsToAzureContainerAppsCore(CancellationToken cancellationToken) 112private static async Task AddPackageAsync(Hex1bTerminalAutomator auto, SequenceCounter counter, string packageName)
TypeScriptExpressDeploymentTests.cs (2)
19public async Task DeployTypeScriptExpressTemplateToAzureContainerApps() 29private async Task DeployTypeScriptExpressTemplateToAzureContainerAppsCore(CancellationToken cancellationToken)
TypeScriptJavaScriptHostingDeploymentTests.cs (3)
18public async Task DeployTypeScriptStaticWebsiteWithNodeApiToAzureContainerApps() 28private async Task DeployTypeScriptStaticWebsiteWithNodeApiToAzureContainerAppsCore(CancellationToken cancellationToken) 114private static async Task AddPackageAsync(Hex1bTerminalAutomator auto, SequenceCounter counter, string packageName)
TypeScriptVnetSqlServerInfraDeploymentTests.cs (2)
20public async Task DeployTypeScriptVnetSqlServerInfrastructure() 30private async Task DeployTypeScriptVnetSqlServerInfrastructureCore(CancellationToken cancellationToken)
VnetKeyVaultConnectivityDeploymentTests.cs (2)
19public async Task DeployStarterTemplateWithKeyVaultPrivateEndpoint() 29private async Task DeployStarterTemplateWithKeyVaultPrivateEndpointCore(CancellationToken cancellationToken)
VnetKeyVaultInfraDeploymentTests.cs (3)
19public async Task DeployVnetKeyVaultInfrastructure() 29private async Task DeployVnetKeyVaultInfrastructureCore(CancellationToken cancellationToken) 189private async Task CleanupResourceGroupAsync(string resourceGroupName)
VnetSqlServerConnectivityDeploymentTests.cs (2)
24public async Task DeployStarterTemplateWithSqlServerPrivateEndpoint() 34private async Task DeployStarterTemplateWithSqlServerPrivateEndpointCore(CancellationToken cancellationToken)
VnetSqlServerInfraDeploymentTests.cs (3)
19public async Task DeployVnetSqlServerInfrastructure() 29private async Task DeployVnetSqlServerInfrastructureCore(CancellationToken cancellationToken) 190private async Task CleanupResourceGroupAsync(string resourceGroupName)
VnetStorageBlobConnectivityDeploymentTests.cs (2)
19public async Task DeployStarterTemplateWithStorageBlobPrivateEndpoint() 29private async Task DeployStarterTemplateWithStorageBlobPrivateEndpointCore(CancellationToken cancellationToken)
VnetStorageBlobInfraDeploymentTests.cs (3)
19public async Task DeployVnetStorageBlobInfrastructure() 29private async Task DeployVnetStorageBlobInfrastructureCore(CancellationToken cancellationToken) 191private async Task CleanupResourceGroupAsync(string resourceGroupName)
Aspire.EndToEnd.Tests (32)
IntegrationServicesFixture.cs (2)
91public Task DumpComponentLogsAsync(TestResourceNames resource, ITestOutputHelper? testOutputArg = null) 95return Task.CompletedTask;
IntegrationServicesTests.cs (4)
29public Task VerifyComponentWorks(TestResourceNames resourceName) 51public Task VerifyHealthyOnIntegrationServiceA() 59private async Task RunTestAsync(Func<CancellationToken, Task> test)
tests\Shared\TemplatesTesting\AspireProject.cs (19)
163public async Task StartAppHostAsync(string[]? extraArgs = default, Action<ProcessStartInfo>? configureProcess = null, bool noBuild = true, bool waitForDashboardUrl = true, CancellationToken token = default) 270var tasksToWaitFor = new List<Task> { appRunning.Task, projectsParsed.Task }; 276var successfulStartupTask = Task.WhenAll(tasksToWaitFor); 277var startupTimeoutTask = Task.Delay(TimeSpan.FromSeconds(AppStartupWaitTimeoutSecs), token); 280var resultTask = await Task.WhenAny(successfulStartupTask, AppExited.Task, startupTimeoutTask).ConfigureAwait(false); 299var allOutputCompleteTask = Task.WhenAll(stdoutComplete.Task, stderrComplete.Task); 300var allOutputCompleteTimeoutTask = Task.Delay(TimeSpan.FromSeconds(5), token); 301var completedTask = await Task.WhenAny(allOutputCompleteTask, allOutputCompleteTimeoutTask).ConfigureAwait(false); 399public Task WaitForDashboardToBeAvailableAsync(CancellationToken cancellationToken = default) 409public static async Task WaitForDashboardToBeAvailableAsync(string dashboardUrl, ITestOutputHelper testOutput, CancellationToken token = default) 418public async Task StopAppHostAsync(CancellationToken token = default) 447public async Task DumpDockerInfoAsync(ITestOutputHelper? testOutputArg = null, CancellationToken cancellationToken = default) 464public async Task DumpComponentLogsAsync(string component, ITestOutputHelper? testOutputArg = null)
tests\Shared\TemplatesTesting\ProjectInfo.cs (2)
39public async Task WaitForHealthyStatusAsync(string bindingName, ITestOutputHelper testOutput, CancellationToken cancellationToken = default) 54await Task.Delay(100, cancellationToken);
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
35public async Task EnsureInstalledAsync(BuildEnvironment buildEnvironment)
tests\Shared\TemplatesTesting\ToolCommand.cs (4)
163var waitForExitTask = CurrentProcess.WaitForExitAsync(token); 164var completedTask = await Task.WhenAny(waitForExitTask, Task.Delay(TimeSpan.FromSeconds(5), token)).ConfigureAwait(false);
Aspire.Hosting (712)
ApplicationModel\CertificateTrustConfigurationCallbackAnnotation.cs (2)
13public sealed class CertificateTrustConfigurationCallbackAnnotation(Func<CertificateTrustConfigurationCallbackAnnotationContext, Task> callback) : IResourceAnnotation 18public Func<CertificateTrustConfigurationCallbackAnnotationContext, Task> Callback { get; } = callback ?? throw new ArgumentNullException(nameof(callback));
ApplicationModel\CommandLineArgsCallbackAnnotation.cs (3)
24public CommandLineArgsCallbackAnnotation(Func<CommandLineArgsCallbackContext, Task> callback) 42return Task.CompletedTask; 49public Func<CommandLineArgsCallbackContext, Task> Callback { get; }
ApplicationModel\CommandOptions.cs (1)
56public Func<InputsDialogValidationContext, Task>? ValidateArguments { get; set; }
ApplicationModel\CommandsConfigurationExtensions.cs (5)
237await Task.WhenAll(replicasToStop.Select(name => orchestrator.StopResourceAsync(name, context.CancellationToken))).ConfigureAwait(false); 251var logForwardTask = ForwardLogsAsync(loggerService, rebuilderInstanceName, mainLogger, buildOutput, logCts.Token); 406private static async Task StopLogForwardingAsync(CancellationTokenSource logCts, Task logForwardTask) 438private static async Task ForwardLogsAsync(ResourceLoggerService loggerService, string sourceResourceName, ILogger targetLogger, BuildOutputCollector buildOutput, CancellationToken cancellationToken)
ApplicationModel\ContainerBuildOptionsCallbackAnnotation.cs (3)
15public sealed class ContainerBuildOptionsCallbackAnnotation(Func<ContainerBuildOptionsCallbackContext, Task> callback) : IResourceAnnotation 20public Func<ContainerBuildOptionsCallbackContext, Task> Callback { get; } = callback ?? throw new ArgumentNullException(nameof(callback)); 30return Task.CompletedTask;
ApplicationModel\ContainerImagePushOptionsCallbackAnnotation.cs (4)
15/// or <see cref="ResourceBuilderExtensions.WithImagePushOptions{T}(IResourceBuilder{T}, Func{ContainerImagePushOptionsCallbackContext, Task})"/> 33return Task.CompletedTask; 42public ContainerImagePushOptionsCallbackAnnotation(Func<ContainerImagePushOptionsCallbackContext, Task> callback) 57public Func<ContainerImagePushOptionsCallbackContext, Task> Callback { get; }
ApplicationModel\ContainerRuntimeArgsCallbackAnnotation.cs (3)
18public ContainerRuntimeArgsCallbackAnnotation(Func<ContainerRuntimeArgsCallbackContext, Task> callback) 36return Task.CompletedTask; 43public Func<ContainerRuntimeArgsCallbackContext, Task> Callback { get; }
ApplicationModel\CustomResourceSnapshot.cs (1)
314internal record EventSnapshot(Task EventTask);
ApplicationModel\Docker\DockerfileBuilder.cs (1)
106public async Task WriteAsync(StreamWriter writer, CancellationToken cancellationToken = default)
ApplicationModel\Docker\DockerfileStage.cs (1)
281public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default)
ApplicationModel\Docker\DockerfileStatement.cs (1)
20public abstract Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default);
ApplicationModel\Docker\DockerfileStatements.cs (16)
25public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default) 47public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default) 65public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default) 85public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default) 107public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default) 127public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default) 145public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default) 163public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default) 186public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default) 212public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default) 234public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default) 259public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default) 271public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default) 293public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default) 317public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default) 335public override async Task WriteStatementAsync(StreamWriter writer, CancellationToken cancellationToken = default)
ApplicationModel\DockerfileBuildAnnotation.cs (3)
89public async Task MaterializeDockerfileAsync(DockerfileFactoryContext context, CancellationToken cancellationToken) 137public async Task EmitDockerfileArtifactsAsync(DockerfileFactoryContext context, string? dockerfilePath = null) 164private async Task EmitBuildContextIgnoreAsync(string dockerfilePath, CancellationToken cancellationToken)
ApplicationModel\DockerfileBuilderCallbackAnnotation.cs (4)
14private readonly List<Func<DockerfileBuilderCallbackContext, Task>> _callbacks = []; 27public DockerfileBuilderCallbackAnnotation(Func<DockerfileBuilderCallbackContext, Task> callback) 36public IReadOnlyList<Func<DockerfileBuilderCallbackContext, Task>> Callbacks => _callbacks.AsReadOnly(); 43public void AddCallback(Func<DockerfileBuilderCallbackContext, Task> callback)
ApplicationModel\EnvironmentCallbackAnnotation.cs (5)
34return Task.CompletedTask; 49return Task.CompletedTask; 64return Task.CompletedTask; 72public EnvironmentCallbackAnnotation(Func<EnvironmentCallbackContext, Task> callback) 82public Func<EnvironmentCallbackContext, Task> Callback { get; private set; }
ApplicationModel\ExecutionConfigurationGathererContext.cs (1)
98async Task ResolveArgumentsAsync(IEnumerable<object> arguments, bool areLaunchToolArguments)
ApplicationModel\HttpCommandOptions.cs (1)
61public Func<HttpCommandRequestContext, Task>? PrepareRequest { get; set; }
ApplicationModel\HttpsCertificateConfigurationCallbackAnnotaion.cs (2)
13public sealed class HttpsCertificateConfigurationCallbackAnnotation(Func<HttpsCertificateConfigurationCallbackAnnotationContext, Task> callback) : IResourceAnnotation 18public Func<HttpsCertificateConfigurationCallbackAnnotationContext, Task> Callback { get; } = callback ?? throw new ArgumentNullException(nameof(callback));
ApplicationModel\LaunchToolArgsCallbackAnnotation.cs (2)
54public LaunchToolArgsCallbackAnnotation(Func<CommandLineArgsCallbackContext, Task> callback, string? owningLaunchConfigurationType, bool showInCommandLine) 89public Func<CommandLineArgsCallbackContext, Task> Callback { get; }
ApplicationModel\ManifestPublishingCallbackAnnotation.cs (3)
24return Task.CompletedTask; 33public ManifestPublishingCallbackAnnotation(Func<ManifestPublishingContext, Task>? callback) 41public Func<ManifestPublishingContext, Task>? Callback { get; }
ApplicationModel\ProjectResource.cs (1)
109private async Task BuildProjectImage(PipelineStepContext ctx)
ApplicationModel\ResourceCommandAnnotation.cs (3)
49Func<InputsDialogValidationContext, Task>? validateArguments = null) 67Func<InputsDialogValidationContext, Task>? validateArguments = null, 143public Func<InputsDialogValidationContext, Task>? ValidateArguments { get; }
ApplicationModel\ResourceCommandService.cs (1)
162var results = await Task.WhenAll(tasks).ConfigureAwait(false);
ApplicationModel\ResourceExtensions.cs (2)
566Func<ContainerBuildOptionsCallbackContext, Task> callback) 1608private static async Task GatherDirectDependenciesAsync(
ApplicationModel\ResourceLoggerService.cs (5)
212internal Task WaitForCompletionAsync(string resourceName, CancellationToken cancellationToken) 326var completionTask = Task.Run(async () => 330await Task.WhenAll(readTasks).ConfigureAwait(false); 615public Task WaitForCompletionAsync(CancellationToken cancellationToken)
ApplicationModel\ResourceNotificationService.cs (29)
100/// <returns>A <see cref="Task"/> representing the wait operation.</returns> 103public Task WaitForResourceAsync(string resourceName, string? targetState = null, CancellationToken cancellationToken = default) 142private async Task WaitUntilHealthyAsync(IResource resource, IResource dependency, WaitBehavior waitBehavior, CancellationToken cancellationToken, Func<string, Task>? onDependencyReady = null) 298private async Task WaitUntilCompletionAsync(IResource resource, IResource dependency, int exitCode, CancellationToken cancellationToken, Func<string, Task>? onDependencyReady = null) 304var tasks = new Task[names.Length]; 317await Task.WhenAll(tasks).ConfigureAwait(false); 325async Task Core(string displayName, string resourceId) 372private async Task WaitUntilStateAsync(IResource resource, IResource dependency, WaitBehavior waitBehavior, 373Func<ILogger, string, string, ResourceEvent, Task> postRunningAction, CancellationToken cancellationToken, Func<string, Task>? onDependencyReady = null) 379var tasks = new Task[names.Length]; 387await Task.WhenAll(tasks).ConfigureAwait(false); 389async Task Core(string displayName, string resourceId) 448private async Task WaitUntilStartedAsync(IResource resource, IResource dependency, WaitBehavior waitBehavior, CancellationToken cancellationToken, Func<string, Task>? onDependencyReady = null) 459return Task.CompletedTask; 476public async Task WaitForDependenciesAsync(IResource resource, CancellationToken cancellationToken) 516async Task OnDependencyReadyAsync(string dependencyName) 561await Task.WhenAll(pendingDependencies).ConfigureAwait(false); 597private Task PublishWaitingForDependenciesAsync(IResource resource, IEnumerable<string> dependencyNames) 626private Task ClearWaitingForDependenciesAsync(IResource resource) 828public Task PublishUpdateAsync(IResource resource, string resourceId, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory) 878return Task.CompletedTask; 951return Task.CompletedTask; 1040private static async Task RecordResourceStartupAsync( 1047Task readyEventTask) 1229public async Task PublishUpdateAsync(IResource resource, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory)
ApplicationModel\ResourceUrlsCallbackAnnotation.cs (3)
22return Task.CompletedTask; 30public ResourceUrlsCallbackAnnotation(Func<ResourceUrlsCallbackContext, Task> callback) 40public Func<ResourceUrlsCallbackContext, Task> Callback { get; private set; }
ApplicationModel\ResourceUrlsEditor.cs (2)
22public async Task Add([AspireUnion(typeof(string), typeof(ReferenceExpression))] object url, string? displayText = null) 53public async Task AddForEndpoint(EndpointReference endpoint, [AspireUnion(typeof(string), typeof(ReferenceExpression))] object url, string? displayText = null)
ApplicationModel\ValueSnapshot.cs (2)
57_currentValue = Task.FromResult(value); 75_currentValue = Task.FromException<T>(exception);
artifacts\obj\Aspire.Hosting\Debug\net8.0\Dashboard\proto\DashboardServiceGrpc.cs (3)
142public virtual global::System.Threading.Tasks.Task WatchResources(global::Aspire.DashboardService.Proto.V1.WatchResourcesRequest request, grpc::IServerStreamWriter<global::Aspire.DashboardService.Proto.V1.WatchResourcesUpdate> responseStream, grpc::ServerCallContext context) 148public virtual global::System.Threading.Tasks.Task WatchResourceConsoleLogs(global::Aspire.DashboardService.Proto.V1.WatchResourceConsoleLogsRequest request, grpc::IServerStreamWriter<global::Aspire.DashboardService.Proto.V1.WatchResourceConsoleLogsUpdate> responseStream, grpc::ServerCallContext context) 160public virtual global::System.Threading.Tasks.Task WatchInteractions(grpc::IAsyncStreamReader<global::Aspire.DashboardService.Proto.V1.WatchInteractionsRequestUpdate> requestStream, grpc::IServerStreamWriter<global::Aspire.DashboardService.Proto.V1.WatchInteractionsResponseUpdate> responseStream, grpc::ServerCallContext context)
Ats\AspireExportAttribute.cs (1)
229/// For async exports, this applies to the synchronous invocation path that returns the <see cref="Task"/>,
Ats\BuilderExports.cs (4)
204Func<BeforeStartEvent, Task> callback) 228Func<BeforePublishEvent, Task> callback) 252Func<AfterPublishEvent, Task> callback) 276Func<AfterResourcesCreatedEvent, Task> callback)
Ats\EventingExports.cs (15)
23public static void AddEventingSubscriber(this IDistributedApplicationBuilder builder, Func<EventingSubscriberRegistrationContext, Task> subscribe) 37public static void TryAddEventingSubscriber(this IDistributedApplicationBuilder builder, Func<EventingSubscriberRegistrationContext, Task> subscribe) 72internal static IResourceBuilder<T> OnBeforeResourceStarted<T>(this IResourceBuilder<T> builder, Func<BeforeResourceStartedEvent, Task> callback) 88internal static IResourceBuilder<T> OnResourceStopped<T>(this IResourceBuilder<T> builder, Func<ResourceStoppedEvent, Task> callback) 104internal static IResourceBuilder<T> OnConnectionStringAvailable<T>(this IResourceBuilder<T> builder, Func<ConnectionStringAvailableEvent, Task> callback) 120internal static IResourceBuilder<T> OnInitializeResource<T>(this IResourceBuilder<T> builder, Func<InitializeResourceEvent, Task> callback) 136internal static IResourceBuilder<T> OnResourceEndpointsAllocated<T>(this IResourceBuilder<T> builder, Func<ResourceEndpointsAllocatedEvent, Task> callback) 152internal static IResourceBuilder<T> OnResourceReady<T>(this IResourceBuilder<T> builder, Func<ResourceReadyEvent, Task> callback) 168public static DistributedApplicationEventSubscription OnBeforeStart(this EventingSubscriberRegistrationContext context, Func<BeforeStartEvent, Task> callback) 183public static DistributedApplicationEventSubscription OnBeforePublish(this EventingSubscriberRegistrationContext context, Func<BeforePublishEvent, Task> callback) 198public static DistributedApplicationEventSubscription OnAfterPublish(this EventingSubscriberRegistrationContext context, Func<AfterPublishEvent, Task> callback) 213public static DistributedApplicationEventSubscription OnAfterResourcesCreated(this EventingSubscriberRegistrationContext context, Func<AfterResourcesCreatedEvent, Task> callback) 221private sealed class CallbackEventingSubscriber(Func<EventingSubscriberRegistrationContext, Task> subscribe) : IDistributedApplicationEventingSubscriber 223public bool Matches(Func<EventingSubscriberRegistrationContext, Task> otherSubscribe) 228public Task SubscribeAsync(IDistributedApplicationEventing eventing, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken)
Ats\InteractionExports.cs (3)
376public InteractionInputBuilder WithDynamicLoading(Func<InteractionInputLoadContext, Task> callback, DynamicLoadingOptions? options = null) 742public Func<InputsDialogValidationContext, Task>? ValidationCallback { get; init; } 784public Func<ProgressContext, Task>? Work { get; init; }
Ats\NotificationExports.cs (3)
31public static Task WaitForResourceState( 67public static Task WaitForDependencies( 93public static Task PublishResourceUpdate(
Ats\PipelineExports.cs (8)
28Func<PipelineStepContext, Task> callback, 47Func<PipelineConfigurationContext, Task> callback) 125public static Task CompleteStep(this IReportingStep reportingStep, string completionText, string completionState = "completed", CancellationToken cancellationToken = default) 137public static Task CompleteStepMarkdown(this IReportingStep reportingStep, string markdownString, string completionState = "completed", CancellationToken cancellationToken = default) 149public static Task UpdateTask(this IReportingTask reportingTask, string statusText, CancellationToken cancellationToken = default) 161public static Task UpdateTaskMarkdown(this IReportingTask reportingTask, string markdownString, CancellationToken cancellationToken = default) 173public static Task CompleteTask(this IReportingTask reportingTask, string? completionMessage = null, string completionState = "completed", CancellationToken cancellationToken = default) 184public static Task CompleteTaskMarkdown(this IReportingTask reportingTask, string markdownString, string completionState = "completed", CancellationToken cancellationToken = default)
Ats\UserSecretsExports.cs (1)
38public static Task SaveStateJson(this IUserSecretsManager userSecretsManager, string json, CancellationToken cancellationToken = default)
Backchannel\AppHostRpcTarget.cs (7)
158public Task RequestStopAsync(CancellationToken cancellationToken) 166return Task.CompletedTask; 201public Task NotifyAppHostReadyAsync(CancellationToken cancellationToken) 205return Task.CompletedTask; 230return Task.FromResult(new string[] { 238public async Task CompletePromptResponseAsync(string promptId, PublishingPromptInputAnswer[] answers, CancellationToken cancellationToken = default) 243public async Task UpdatePromptResponseAsync(string promptId, PublishingPromptInputAnswer[] answers, CancellationToken cancellationToken = default)
Backchannel\AppHostStartupState.cs (1)
24public async Task WaitForReadyAsync(CancellationToken cancellationToken)
Backchannel\AuxiliaryBackchannelRpcTarget.cs (14)
51return Task.FromResult(new GetCapabilitiesResponse 480var results = await Task.WhenAll(tasks).ConfigureAwait(false); 893return Task.FromResult(new AppHostInformation 956return Task.FromResult<DashboardMcpConnectionInfo?>(null); 987async Task AddResult(string resourceName) 1579Task? completeWriterTask = null; 1629var tasks = new List<Task>(); 1633var task = Task.Run(async () => 1677completeWriterTask = Task.WhenAll(tasks).ContinueWith(_ => channel.Writer.Complete(), CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default); 1843public Task StopAppHostAsync(CancellationToken cancellationToken = default) 1849_ = Task.Run(async () => 1853await Task.Delay(500, CancellationToken.None).ConfigureAwait(false); 1876return Task.CompletedTask;
Backchannel\AuxiliaryBackchannelService.cs (4)
40internal Task ListeningTask => _listeningTcs.Task; 42protected override async Task ExecuteAsync(CancellationToken stoppingToken) 104_ = Task.Run(async () => await HandleClientConnectionAsync(clientSocket, stoppingToken).ConfigureAwait(false), stoppingToken); 143private async Task HandleClientConnectionAsync(Socket clientSocket, CancellationToken stoppingToken)
Backchannel\BackchannelService.cs (2)
32public Task BackchannelConnected => _backchannelConnectedTcs.Task; 34protected override async Task ExecuteAsync(CancellationToken stoppingToken)
Backchannel\TerminalHostControlClient.cs (1)
79await Task.Delay(s_defaultRetryDelay, cancellationToken).ConfigureAwait(false);
BuiltInDistributedApplicationEventSubscriptionHandlers.cs (11)
16public static Task InitializeDcpAnnotations(BeforeStartEvent beforeStartEvent, CancellationToken _) 42return Task.CompletedTask; 45public static Task ExcludeDashboardFromManifestAsync(BeforeStartEvent beforeStartEvent, CancellationToken _) 53return Task.CompletedTask; 56public static Task MutateHttp2TransportAsync(BeforeStartEvent beforeStartEvent, CancellationToken _) 68return Task.CompletedTask; 71public static Task UpdateContainerRegistryAsync(BeforeStartEvent @event, DistributedApplicationOptions options) 83return Task.CompletedTask; 86public static Task WarnPersistentContainersWithoutUserSecrets(BeforeStartEvent beforeStartEvent, CancellationToken _) 92return Task.CompletedTask; 108return Task.CompletedTask;
Cli\CliOrphanDetector.cs (1)
28protected override async Task ExecuteAsync(CancellationToken stoppingToken)
ConnectionStringBuilderExtensions.cs (1)
49var tasks = new List<Task>();
ContainerRegistryResourceBuilderExtensions.cs (1)
159return Task.CompletedTask;
ContainerResourceBuilderExtensions.cs (9)
536return Task.CompletedTask; 544/// This is intended to pass additional arguments to the underlying container runtime run command to enable advanced features such as exposing GPUs to the container. To pass runtime arguments to the actual container, use the <see cref="ResourceBuilderExtensions.WithArgs{T}(IResourceBuilder{T}, Func{CommandLineArgsCallbackContext, Task})"/> method. 552public static IResourceBuilder<T> WithContainerRuntimeArgs<T>(this IResourceBuilder<T> builder, Func<ContainerRuntimeArgsCallbackContext, Task> callback) where T : ContainerResource 781return builder.WithDockerfileFactory(contextPath, context => Task.FromResult(dockerfileFactory(context)), stage); 1032public static IResourceBuilder<ContainerResource> AddDockerfileBuilder(this IDistributedApplicationBuilder builder, [ResourceName] string name, string contextPath, Func<DockerfileBuilderCallbackContext, Task> callback, string? stage = null) 1398Callback = (_, _) => Task.FromResult(entries), 1513Callback = (_, _) => Task.FromResult(ContainerDirectory.GetFileSystemItemsFromPath(sourceFullPath, searchOptions: SearchOption.AllDirectories)), 1698public static IResourceBuilder<T> WithDockerfileBuilder<T>(this IResourceBuilder<T> builder, string contextPath, Func<DockerfileBuilderCallbackContext, Task> callback, string? stage = null) where T : ContainerResource 1810return Task.CompletedTask;
Dashboard\DashboardEventHandlers.cs (13)
57private Task? _dashboardLogsTask; 61public Task OnBeforeStartAsync(BeforeStartEvent @event, CancellationToken cancellationToken) 85return Task.CompletedTask; 386return Task.CompletedTask; 447return Task.CompletedTask; 505private async Task DashboardStarted(ResourceReadyEvent @event, CancellationToken cancellationToken) 584internal async Task ConfigureEnvironmentVariables(EnvironmentCallbackContext context) 860private async Task WatchDashboardLogsAsync(CancellationToken cancellationToken) 865var dashboardResourceTasks = new Dictionary<string, Task>(); 889await Task.WhenAll(dashboardResourceTasks.Values).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing); 892private static async Task WatchResourceLogsAsync(string dashboardResourceId, 985public Task SubscribeAsync(IDistributedApplicationEventing eventing, DistributedApplicationExecutionContext execContext, CancellationToken cancellationToken) 992return Task.CompletedTask;
Dashboard\DashboardService.cs (10)
53return Task.FromResult(new ApplicationInformationResponse 69public override async Task WatchInteractions(IAsyncStreamReader<WatchInteractionsRequestUpdate> requestStream, IServerStreamWriter<WatchInteractionsResponseUpdate> responseStream, ServerCallContext context) 75async Task WatchInteractionsInternal(CancellationToken cancellationToken) 81_ = Task.Run(async () => 289public override async Task WatchResources( 298async Task WatchResourcesInternal(CancellationToken cancellationToken) 340public override async Task WatchResourceConsoleLogs( 349async Task WatchResourceConsoleLogsInternal(bool suppressFollow, CancellationToken cancellationToken) 477private async Task ExecuteAsync(Func<CancellationToken, Task> execute, ServerCallContext serverCallContext)
Dashboard\DashboardServiceAuth.cs (4)
43return Task.FromResult(AuthenticateResult.Fail($"'{ApiKeyHeaderName}' header not found")); 48return Task.FromResult(AuthenticateResult.Fail($"Expecting only a single '{ApiKeyHeaderName}' header.")); 53return Task.FromResult(AuthenticateResult.Fail($"Invalid '{ApiKeyHeaderName}' header value.")); 57return Task.FromResult(
Dashboard\DashboardServiceData.cs (2)
41Task.Run(async () => 198internal async Task SendInteractionRequestAsync(WatchInteractionsRequestUpdate request, CancellationToken cancellationToken)
Dashboard\DashboardServiceHost.cs (2)
259async Task IHostedService.StartAsync(CancellationToken cancellationToken) 277async Task IHostedService.StopAsync(CancellationToken cancellationToken)
Dcp\AppResource.cs (2)
16Task Initialized { get; } 32public Task Initialized => _initializedTcs.Task;
Dcp\ContainerCreationContext.cs (4)
21Task containerPrerequisitesReady, 22Task containerTunnelPrerequisitesReady, 26public Task ContainerPrerequisitesReady { get; } = containerPrerequisitesReady; 30public Task ContainerTunnelPrerequisitesReady { get; } = containerTunnelPrerequisitesReady;
Dcp\ContainerCreator.cs (9)
257public async Task CreateObjectAsync(RenderedModelResource<Container> cr, ContainerCreationContext cctx, ILogger logger, IDcpObjectFactory factory, CancellationToken cancellationToken) 298private async Task BuildAndCreateContainerAsync(RenderedModelResource<Container> cr, ILogger logger, IDcpObjectFactory factory, CancellationToken cToken) 406async Task IObjectCreator<ContainerExec, EmptyCreationContext>.CreateObjectAsync(RenderedModelResource<ContainerExec> er, EmptyCreationContext context, ILogger _, IDcpObjectFactory factory, CancellationToken cancellationToken) 500internal async Task EnsureHostConnectivityAsync(ImmutableArray<HostResourceWithEndpoints> hostDependencies, ContainerCreationContext cctx, IDcpObjectFactory factory, CancellationToken cancellationToken) 531await Task.WhenAll([cctx.ContainerPrerequisitesReady, cctx.ContainerTunnelPrerequisitesReady]).WaitAsync(cancellationToken).ConfigureAwait(false); 581private async Task WaitForTunnelProxyAsync( 663internal async Task CreateHostDependentContainerAsync(RenderedModelResource<Container> cr, ImmutableArray<HostResourceWithEndpoints> hostDependencies, ContainerCreationContext cctx, IDcpObjectFactory factory, CancellationToken cToken) 674await Task.WhenAll(hostEndpointAllocatedTasks).ConfigureAwait(false); 929private static async Task ApplyBuildArgumentsAsync(Container dcpContainerResource, IResource modelContainerResource, DistributedApplicationExecutionContext executionContext, ILogger logger, CancellationToken cancellationToken)
Dcp\DcpExecutor.cs (34)
140public async Task RunApplicationAsync(CancellationToken ct = default) 196var createServices = Task.Run(() => CreateAllDcpObjectsAsync<Service>(ct), ct); 198var getProxyAddresses = Task.Run(async () => 208var createContainerNetworks = Task.Run(() => CreateAllDcpObjectsAsync<ContainerNetwork>(ct), ct); 210var createWorkloadEndpoints = Task.Run(async () => 212await Task.WhenAll([getProxyAddresses, createContainerNetworks]).WaitAsync(ct).ConfigureAwait(false); 247var createExecutables = Task.Run(async () => 258var createContainers = Task.Run(async () => 266await Task.WhenAll(createExecutables, createContainers).WaitAsync(ct).ConfigureAwait(false); 277public async Task StopAsync(CancellationToken cancellationToken) 386Task IDcpObjectFactory.UpdateWithEffectiveAddressInfo(IEnumerable<Service> services, CancellationToken cancellationToken, TimeSpan? timeout) 472private async Task UpdateWithEffectiveAddressInfo(IEnumerable<Service> services, CancellationToken cancellationToken, TimeSpan? timeout = null) 595private Task CreateAllDcpObjectsAsync<RT>(CancellationToken cancellationToken) where RT : CustomResource, IKubernetesStaticMetadata 601Task IDcpObjectFactory.CreateDcpObjectsAsync<T>(IEnumerable<T> objects, CancellationToken cancellationToken) 617private async Task CreateDcpObjectsAsync<RT>(IEnumerable<RT> objects, CancellationToken cancellationToken) where RT : CustomResource, IKubernetesStaticMetadata 628var tasks = new List<Task>(); 632tasks.Add(Task.Run(async () => 637await Task.WhenAll(tasks).WaitAsync(cancellationToken).ConfigureAwait(false); 883public async Task CreateRenderedResourcesAsync<TDcpResource, TContext>( 902var tasks = new List<Task>(); 908tasks.Add(Task.Run(() => CreateResourceReplicasAsync(groupKey, groupList, creator, context, cancellationToken), cancellationToken)); 910await Task.WhenAll(tasks).WaitAsync(cancellationToken).ConfigureAwait(false); 917private async Task CreateResourceReplicasAsync<TDcpResource, TContext>( 1035async Task CreateReplicaAsync(RenderedModelResource<TDcpResource> er) 1125public async Task StopResourceAsync(IResourceReference resourceReference, CancellationToken cancellationToken) 1194public async Task StartResourceAsync(IResourceReference resourceReference, CancellationToken cancellationToken) 1269private async Task EnsureResourceDeletedAsync<T>(IResourceReference resource, CancellationToken cancellationToken) where T : CustomResource, IKubernetesStaticMetadata 1380private async Task PublishConnectionStringAvailableEventAsync(IResource resource, CancellationToken ct)
Dcp\DcpExecutorEvents.cs (3)
19private readonly ConcurrentDictionary<Type, Func<object, Task>> _eventSubscriptionListLookup = new(); 21public void Subscribe<T>(Func<T, Task> callback) where T : notnull 30public async Task PublishAsync<T>(T context) where T : notnull
Dcp\DcpHost.cs (14)
43private Task? _logProcessorTask; 78public async Task StartAsync(CancellationToken cancellationToken) 86internal async Task EnsureDcpContainerRuntimeAsync(CancellationToken cancellationToken) 113await Task.Delay(TimeSpan.FromSeconds(2), timeoutCancellation.Token).ConfigureAwait(false); 133internal async Task EnsureDevelopmentCertificateTrustAsync(CancellationToken cancellationToken) 181internal async Task PrepareDcpTlsCertificateAsync(CancellationToken cancellationToken) 262public async Task StopAsync() 285_logProcessorTask = Task.Run(() => StartLoggingSocketAsync(loggingSocket)); 446private async Task StartLoggingSocketAsync(Socket socket) 448List<Task> outputLoggers = []; 454outputLoggers.Add(Task.Run(() => LogSocketOutputAsync(acceptedSocket, _shutdownCts.Token))); 462await Task.WhenAll(outputLoggers).ConfigureAwait(false); 466private async Task LogSocketOutputAsync(Socket socket, CancellationToken cancellationToken) 595_ = Task.Run(async () =>
Dcp\DcpResourceWatcher.cs (25)
54private Task? _resourceWatchTask; 66internal Task? GetLogStreamTask(string resourceName) 121var watchResourcesTask = Task.Run(async () => 125await Task.WhenAll( 126Task.Run(() => WatchKubernetesResourceAsync<Executable>((t, r) => ProcessResourceChange(t, r, _resourceState.ExecutablesMap, Model.Dcp.ExecutableKind, (e, s) => _snapshotBuilder.ToSnapshot(e, s)))), 127Task.Run(() => WatchKubernetesResourceAsync<Container>((t, r) => ProcessResourceChange(t, r, _resourceState.ContainersMap, Model.Dcp.ContainerKind, (c, s) => _snapshotBuilder.ToSnapshot(c, s)))), 128Task.Run(() => WatchKubernetesResourceAsync<ContainerExec>((t, r) => ProcessResourceChange(t, r, _resourceState.ContainerExecsMap, Model.Dcp.ContainerExecKind, (c, s) => _snapshotBuilder.ToSnapshot(c, s)))), 129Task.Run(() => WatchKubernetesResourceAsync<Service>(ProcessServiceChange)), 130Task.Run(() => WatchKubernetesResourceAsync<Endpoint>(ProcessEndpointChange))).ConfigureAwait(false); 136var watchSubscribersTask = Task.Run(async () => 148var watchInformationChannelTask = Task.Run(async () => 197_resourceWatchTask = Task.WhenAll(watchResourcesTask, watchSubscribersTask, watchInformationChannelTask); 199async Task WatchKubernetesResourceAsync<T>(Func<WatchEventType, T, Task> handler) where T : CustomResource, IKubernetesStaticMetadata 237public async Task StopAsync(CancellationToken cancellationToken) 239var tasks = new List<Task>(); 253await Task.WhenAll(tasks).WaitAsync(cancellationToken).ConfigureAwait(false); 271private async Task ProcessResourceChange<T>(WatchEventType watchEventType, T resource, ConcurrentDictionary<string, T> resourceByName, string resourceKind, Func<T, CustomResourceSnapshot, CustomResourceSnapshot> snapshotFactory) where T : CustomResource, IKubernetesStaticMetadata 630_ = Task.Run(async () => 854private async Task ProcessEndpointChange(WatchEventType watchEventType, Endpoint endpoint) 872private async Task ProcessServiceChange(WatchEventType watchEventType, Service service) 1034public Task Task => _completion.Task;
Dcp\ExecutableCreator.cs (1)
49public async Task CreateObjectAsync(
Dcp\IDcpExecutor.cs (4)
8Task RunApplicationAsync(CancellationToken cancellationToken); 10Task StopAsync(CancellationToken cancellationToken); 14Task StartResourceAsync(IResourceReference resourceReference, CancellationToken cancellationToken); 16Task StopResourceAsync(IResourceReference resourceReference, CancellationToken cancellationToken);
Dcp\IDcpObjectFactory.cs (3)
19Task CreateRenderedResourcesAsync<TDcpResource, TContext>( 29Task CreateDcpObjectsAsync<TDcpResource>(IEnumerable<TDcpResource> objects, CancellationToken cancellationToken) 42Task UpdateWithEffectiveAddressInfo(IEnumerable<Service> services, CancellationToken cancellationToken, TimeSpan? timeout = null);
Dcp\IObjectCreator.cs (1)
37Task CreateObjectAsync(RenderedModelResource<TDcpResource> resource, TContext context, ILogger logger, IDcpObjectFactory factory, CancellationToken cancellationToken);
Dcp\KubernetesService.cs (6)
77Task StopServerAsync(string resourceCleanup = ResourceCleanup.Full, CancellationToken cancellation = default); 78Task CleanupResourcesAsync(CancellationToken cancellationToken = default); 365public Task StopServerAsync(string resourceCleanup = ResourceCleanup.Full, CancellationToken cancellationToken = default) 389public async Task CleanupResourcesAsync(CancellationToken cancellationToken = default) 462(DcpKubernetesClient kubernetes) => Task.FromResult(operation(kubernetes)), 611await Task.Delay(TimeSpan.FromMilliseconds(dcpOptions.Value.KubernetesConfigReadRetryIntervalMilliseconds), cancellationToken).ConfigureAwait(false);
Dcp\Process\ProcessUtil.cs (4)
143_ = Task.Run(async () => 150await Task.WhenAll(stdoutComplete.Task, stderrComplete.Task).ConfigureAwait(false); 245private readonly Task _processLifetimeTask; 248public ProcessDisposable(System.Diagnostics.Process process, Task processLifetimeTask, bool entireProcessTree)
Dcp\ResourceLogSource.cs (14)
55async Task StreamLogsAsync(Stream stream, bool isError, bool parseDcpLogs) 106var streamTasks = new List<Task>(); 111var startupStdoutStreamTask = Task.Run(() => StreamLogsAsync(startupStdoutStream, isError: false, parseDcpLogs: false), cancellationToken); 114var startupStderrStreamTask = Task.Run(() => StreamLogsAsync(startupStderrStream, isError: false, parseDcpLogs: false), cancellationToken); 120var stdoutStreamTask = Task.Run(() => StreamLogsAsync(stdoutStream, isError: false, parseDcpLogs: false), cancellationToken); 123var stderrStreamTask = Task.Run(() => StreamLogsAsync(stderrStream, isError: true, parseDcpLogs: false), cancellationToken); 128var systemStreamTask = Task.Run(() => StreamLogsAsync(systemStream, isError: false, parseDcpLogs: true), cancellationToken); 132async Task WaitForStreamsToCompleteAsync() 134await Task.WhenAll(streamTasks).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing);
Devcontainers\Codespaces\CodespacesResourceUrlRewriterService.cs (1)
14protected override async Task ExecuteAsync(CancellationToken stoppingToken)
Devcontainers\DevcontainerPortForwardingEventingSubscriber.cs (5)
31public Task OnResourceEndpointsAllocatedAsync(ResourceEndpointsAllocatedEvent @event, CancellationToken cancellationToken) 50return Task.CompletedTask; 53public Task SubscribeAsync(IDistributedApplicationEventing eventing, DistributedApplicationExecutionContext execContext, CancellationToken cancellationToken) 58return Task.CompletedTask; 62return Task.CompletedTask;
Devcontainers\DevcontainerSettingsWriter.cs (7)
33private Task? _processingTask; 63_processingTask = Task.Run(ProcessPortUpdatesAsync, _processingCancellation.Token); 67private async Task ProcessPortUpdatesAsync() 102private async Task WriteSettingsAsync(IReadOnlyList<PortForwardEntry> newPorts, CancellationToken cancellationToken) 193_ = Task.Run(async () => 197await Task.Delay(s_portForwardLogDelay, cancellationToken).ConfigureAwait(false); 243async Task EnsureSettingsFileExists(string path, CancellationToken cancellationToken)
DistributedApplication.cs (7)
447public virtual async Task StartAsync(CancellationToken cancellationToken = default) 481public virtual async Task StopAsync(CancellationToken cancellationToken = default) 498/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 519public virtual async Task RunAsync(CancellationToken cancellationToken = default) 593internal async Task ExecuteBeforeStartHooksAsync(CancellationToken cancellationToken) 797Task IHost.StartAsync(CancellationToken cancellationToken) => StartAsync(cancellationToken); 799Task IHost.StopAsync(CancellationToken cancellationToken) => StopAsync(cancellationToken);
DistributedApplicationEventingExtensions.cs (11)
23public static T OnBeforeStart<T>(this T builder, Func<BeforeStartEvent, CancellationToken, Task> callback) 35public static T OnBeforePublish<T>(this T builder, Func<BeforePublishEvent, CancellationToken, Task> callback) 47public static T OnAfterPublish<T>(this T builder, Func<AfterPublishEvent, CancellationToken, Task> callback) 60public static IResourceBuilder<T> OnBeforeResourceStarted<T>(this IResourceBuilder<T> builder, Func<T, BeforeResourceStartedEvent, CancellationToken, Task> callback) 73public static IResourceBuilder<T> OnResourceStopped<T>(this IResourceBuilder<T> builder, Func<T, ResourceStoppedEvent, CancellationToken, Task> callback) 86public static IResourceBuilder<T> OnConnectionStringAvailable<T>(this IResourceBuilder<T> builder, Func<T, ConnectionStringAvailableEvent, CancellationToken, Task> callback) 99public static IResourceBuilder<T> OnInitializeResource<T>(this IResourceBuilder<T> builder, Func<T, InitializeResourceEvent, CancellationToken, Task> callback) 112public static IResourceBuilder<T> OnResourceEndpointsAllocated<T>(this IResourceBuilder<T> builder, Func<T, ResourceEndpointsAllocatedEvent, CancellationToken, Task> callback) 125public static IResourceBuilder<T> OnResourceReady<T>(this IResourceBuilder<T> builder, Func<T, ResourceReadyEvent, CancellationToken, Task> callback) 129private static T OnApplicationEvent<T, TEvent>(this T builder, Func<TEvent, CancellationToken, Task> callback) 137private static IResourceBuilder<TResource> OnResourceEvent<TResource, TEvent>(this IResourceBuilder<TResource> builder, Func<TResource, TEvent, CancellationToken, Task> callback)
DistributedApplicationLifecycle.cs (12)
21public Task StartAsync(CancellationToken cancellationToken) 23return Task.CompletedTask; 26public Task StartedAsync(CancellationToken cancellationToken) 36return Task.CompletedTask; 39public Task StartingAsync(CancellationToken cancellationToken) 62return Task.CompletedTask; 65public Task StopAsync(CancellationToken cancellationToken) 68return Task.CompletedTask; 71public Task StoppedAsync(CancellationToken cancellationToken) 74return Task.CompletedTask; 77public Task StoppingAsync(CancellationToken cancellationToken) 80return Task.CompletedTask;
DotnetToolResourceExtensions.cs (1)
100async Task BeforeResourceStarted(T resource, BeforeResourceStartedEvent evt, CancellationToken ct)
Eventing\DistributedApplicationEventing.cs (17)
18public Task PublishAsync<T>(T @event, CancellationToken cancellationToken = default) where T : IDistributedApplicationEvent 25public async Task PublishAsync<T>(T @event, EventDispatchBehavior dispatchBehavior, CancellationToken cancellationToken = default) where T : IDistributedApplicationEvent 31var pendingSubscriptionCallbacks = new List<Task>(subscriptions.Count); 34var pendingSubscriptionCallback = InvokeSubscriptionCallbackAsync(subscription, @event, dispatchBehavior, cancellationToken); 41_ = Task.Run(async () => 43await Task.WhenAll(pendingSubscriptionCallbacks).ConfigureAwait(false); 49await Task.WhenAll(pendingSubscriptionCallbacks).ConfigureAwait(false); 57_ = Task.Run(async () => 77private static Task InvokeSubscriptionCallbackAsync<T>( 86var callbackTask = subscription.Callback(@event, cancellationToken); 90return Task.CompletedTask; 102static async Task AwaitSubscriptionCallbackAsync(Task callbackTask, ProfilingTelemetry.ActivityScope activity) 119/// <inheritdoc cref="IDistributedApplicationEventing.Subscribe{T}(Func{T, CancellationToken, Task})" /> 120public DistributedApplicationEventSubscription Subscribe<T>(Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationEvent 158/// <inheritdoc cref="IDistributedApplicationEventing.Subscribe{T}(Func{T, CancellationToken, Task})" /> 159public DistributedApplicationEventSubscription Subscribe<T>(IResource resource, Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationResourceEvent
Eventing\DistributedApplicationEventSubscription.cs (3)
13public class DistributedApplicationEventSubscription(Func<IDistributedApplicationEvent, CancellationToken, Task> callback) 18public Func<IDistributedApplicationEvent, CancellationToken, Task> Callback { get; } = callback; 25public class DistributedApplicationResourceEventSubscription(IResource? resource, Func<IDistributedApplicationResourceEvent, CancellationToken, Task> callback)
Eventing\IDistributedApplicationEventing.cs (4)
20DistributedApplicationEventSubscription Subscribe<T>(Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationEvent; 29DistributedApplicationEventSubscription Subscribe<T>(IResource resource, Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationResourceEvent; 45Task PublishAsync<T>(T @event, CancellationToken cancellationToken = default) where T : IDistributedApplicationEvent; 56Task PublishAsync<T>(T @event, EventDispatchBehavior dispatchBehavior, CancellationToken cancellationToken = default) where T : IDistributedApplicationEvent;
Health\ResourceHealthCheckService.cs (6)
22protected override async Task ExecuteAsync(CancellationToken stoppingToken) 54_ = Task.Run(async () => 115private async Task MonitorResourceHealthAsync(ResourceMonitorState state) 260_ = Task.Run(async () => 267var task = eventing.PublishAsync(resourceReadyEvent, cancellationToken); 368Task delayInterruptedTask;
IInteractionService.cs (5)
140private Task? _currentTask; 192_currentTask = Task.Run(async () => 234public required Func<LoadInputContext, Task> LoadCallback { get; init; } 820public Func<InputsDialogValidationContext, Task>? ValidationCallback { get; set; } 935public Func<ProgressContext, Task>? Work { get; set; }
InteractionService.cs (1)
471internal async Task ProcessInteractionFromClientAsync(int interactionId, Func<Interaction, IServiceProvider, ILogger, InteractionCompletionState> createResult, CancellationToken cancellationToken)
Lifecycle\IDistributedApplicationEventingSubscriber.cs (1)
21Task SubscribeAsync(IDistributedApplicationEventing eventing, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken);
Lifecycle\IDistributedApplicationLifecycleHook.cs (9)
19/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 20Task BeforeStartAsync(DistributedApplicationModel appModel, CancellationToken cancellationToken = default) 22return Task.CompletedTask; 30/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 31Task AfterEndpointsAllocatedAsync(DistributedApplicationModel appModel, CancellationToken cancellationToken = default) 33return Task.CompletedTask; 44/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 45Task AfterResourcesCreatedAsync(DistributedApplicationModel appModel, CancellationToken cancellationToken = default) 47return Task.CompletedTask;
Lifecycle\RequiredCommandValidationEventingSubscriber.cs (3)
24public Task SubscribeAsync(IDistributedApplicationEventing eventing, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken) 28return Task.CompletedTask; 31private async Task ValidateRequiredCommandsAsync(BeforeResourceStartedEvent @event, CancellationToken cancellationToken)
Lifecycle\TerminalHostEventingSubscriber.cs (4)
43public Task SubscribeAsync(IDistributedApplicationEventing eventing, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken) 47return Task.CompletedTask; 50private Task ResolveTerminalHostsAsync(BeforeStartEvent @event, CancellationToken cancellationToken) 113return Task.CompletedTask;
Lifecycle\TerminalHostFailureDiagnosticService.cs (2)
50protected override async Task ExecuteAsync(CancellationToken stoppingToken) 99private async Task SurfaceFailureAsync(TerminalHostResource host, CustomResourceSnapshot snapshot, CancellationToken cancellationToken)
Lifecycle\TerminalHostOrphanCleanupService.cs (12)
23private Task? _cleanupTask; 37internal Task Completion 43return _cleanupTask ?? Task.CompletedTask; 50internal Task SubscribeAsync( 72return Task.CompletedTask; 76return Task.CompletedTask; 102_cleanupTask = Task.Run( 112Task? cleanupTask; 134var cleanupTask = Task.Run(() => 225private static async Task SweepAsync( 514public Task SubscribeAsync(
Orchestrator\ApplicationOrchestrator.cs (24)
82private async Task PublishConnectionStringValue(ConnectionStringAvailableEvent @event, CancellationToken token) 114private async Task WaitForInBeforeResourceStartedEvent(BeforeResourceStartedEvent @event, CancellationToken cancellationToken) 172var waitForDependenciesTask = _notificationService.WaitForDependenciesAsync(@event.Resource, cts.Token); 180var completedTask = await Task.WhenAny(waitForDependenciesTask, waitForNonWaitingStateTask).ConfigureAwait(false); 199private Task OnEndpointsAllocated(OnEndpointsAllocatedContext context) 203return Task.CompletedTask; 206private async Task PublishResourceEndpointUrls(IResource resource, CancellationToken cancellationToken) 234private async Task OnResourceStarting(OnResourceStartingContext context) 283static Task PublishUpdateAsync(ResourceNotificationService notificationService, IResource resource, string? resourceId, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory) 291private async Task OnResourcesPrepared(OnResourcesPreparedContext context) 296private async Task OnConnectionStringAvailable(OnConnectionStringAvailableContext context) 301private async Task ProcessResourceUrlCallbacks(IResource resource, CancellationToken cancellationToken) 573private async Task OnResourceEndpointsAllocated(ResourceEndpointsAllocatedEvent @event, CancellationToken cancellationToken) 578private async Task OnResourceChanged(OnResourceChangedContext context) 611private async Task OnResourceFailedToStart(OnResourceFailedToStartContext context) 632public async Task RunApplicationAsync(CancellationToken cancellationToken = default) 645public async Task StopAsync(CancellationToken cancellationToken) 652public async Task StartResourceAsync(string resourceName, CancellationToken cancellationToken) 681public async Task StopResourceAsync(string resourceName, CancellationToken cancellationToken) 687private async Task SetChildResourceAsync(IResource resource, string? state, DateTime? startTimeStamp, DateTime? stopTimeStamp) 710private async Task PublishResourcesInitialStateAsync(CancellationToken cancellationToken) 753private async Task PublishConnectionStringAvailableEvent(IResource resource, CancellationToken cancellationToken) 779private async Task PublishEventToHierarchy<TEvent>(Func<IResource, TEvent> createEvent, IResource resource, CancellationToken cancellationToken)
Orchestrator\OrchestratorHostService.cs (10)
32public async Task StartAsync(CancellationToken cancellationToken = default) 44public async Task StopAsync(CancellationToken cancellationToken = default) 70public Task StartedAsync(CancellationToken cancellationToken) 72return Task.CompletedTask; 75public Task StartingAsync(CancellationToken cancellationToken) 77return Task.CompletedTask; 80public Task StoppedAsync(CancellationToken cancellationToken) 82return Task.CompletedTask; 85public Task StoppingAsync(CancellationToken cancellationToken) 87return Task.CompletedTask;
Orchestrator\ParameterProcessor.cs (16)
35private Task? _parameterResolutionTask; 52public async Task InitializeParametersAsync(IEnumerable<ParameterResource> parameterResources, bool waitForResolution = false) 68var task = EnsureParameterResolutionTaskRunningAsync(); 77private Task EnsureParameterResolutionTaskRunningAsync() 85_parameterResolutionTask = Task.Run(async () => 111public async Task InitializeParametersAsync(DistributedApplicationModel model, bool waitForResolution = false, CancellationToken cancellationToken = default) 134private async Task CollectDependentParameterResourcesAsync(DistributedApplicationModel model, Dictionary<string, ParameterResource> referencedParameters, CancellationToken cancellationToken) 151private async Task ProcessParameterAsync(ParameterResource parameterResource) 216return Task.CompletedTask; 232return Task.CompletedTask; 332public async Task SetParameterAsync(ParameterResource parameterResource, CancellationToken cancellationToken = default) 377public async Task DeleteParameterAsync(ParameterResource parameterResource, CancellationToken cancellationToken = default) 498private async Task ApplyParameterValueAsync(ParameterResource parameterResource, string inputValue, bool saveToDeploymentState, CancellationToken cancellationToken = default) 548internal async Task HandleUnresolvedParametersAsync(IList<ParameterResource> unresolvedParameters, CancellationToken allParametersResolvedToken) 673private async Task SaveParametersToDeploymentStateAsync(IEnumerable<ParameterResource> parameters, CancellationToken cancellationToken) 701private async Task UpdateParameterStateAsync(ParameterResource parameterResource, string value, ResourceStateSnapshot? state)
Pipelines\DistributedApplicationPipeline.cs (26)
29private readonly List<Func<PipelineConfigurationContext, Task>> _configurationCallbacks = []; 44Action = _ => Task.CompletedTask, 147Action = _ => Task.CompletedTask, 154Action = context => Task.CompletedTask 200await Task.Delay(TimeSpan.FromSeconds(2), timeProvider, waitCts.Token).ConfigureAwait(false); 223Action = _ => Task.CompletedTask 304Action = _ => Task.CompletedTask 311Action = _ => Task.CompletedTask, 321return Task.CompletedTask; 347Action = _ => Task.CompletedTask 357return Task.CompletedTask; 380Action = _ => Task.CompletedTask, 459Func<PipelineStepContext, Task> action, 541public void AddPipelineConfiguration(Func<PipelineConfigurationContext, Task> callback) 573public async Task ExecuteAsync(PipelineContext context) 594internal async Task ExecuteStepSequentiallyAsync( 770private async Task ExecuteConfigurationCallbacksAsync( 775var callbacks = new List<Func<PipelineConfigurationContext, Task>>(); 846private static async Task ExecuteStepsAsTaskDag( 863async Task ExecuteStepWithDependencies(PipelineStep step) 875await Task.WhenAll(depTasks).ConfigureAwait(false); 941var allStepTasks = new Task[steps.Count]; 945allStepTasks[i] = Task.Run(() => ExecuteStepWithDependencies(step)); 951await Task.WhenAll(allStepTasks).ConfigureAwait(false); 990private static async Task ExecuteStepsSequentially( 1132private static async Task ExecuteStepAsync(PipelineStep step, PipelineStepContext stepContext)
Pipelines\DistributedApplicationPipelineExtensions.cs (1)
33return Task.CompletedTask;
Pipelines\IDeploymentStateManager.cs (3)
35Task SaveSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default); 44Task DeleteSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default); 50Task ClearAllStateAsync(CancellationToken cancellationToken = default);
Pipelines\IDistributedApplicationPipeline.cs (3)
24Func<PipelineStepContext, Task> action, 38void AddPipelineConfiguration(Func<PipelineConfigurationContext, Task> callback); 45Task ExecuteAsync(PipelineContext context);
Pipelines\Internal\DeploymentStateManagerBase.cs (6)
55protected abstract Task SaveStateToStorageAsync(JsonObject state, CancellationToken cancellationToken); 101public async Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default) 195public async Task SaveSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 215public async Task DeleteSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 234private async Task EnsureStateAndSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken) 304public async Task ClearAllStateAsync(CancellationToken cancellationToken = default)
Pipelines\Internal\FileDeploymentStateManager.cs (1)
88protected override async Task SaveStateToStorageAsync(JsonObject state, CancellationToken cancellationToken)
Pipelines\Internal\UserSecretsDeploymentStateManager.cs (1)
35protected override async Task SaveStateToStorageAsync(JsonObject state, CancellationToken cancellationToken)
Pipelines\IPipelineActivityReporter.cs (2)
38Task CompletePublishAsync(PublishCompletionOptions? options = null, CancellationToken cancellationToken = default); 47Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default);
Pipelines\IReportingStep.cs (2)
60Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default); 68Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default);
Pipelines\IReportingTask.cs (4)
19Task UpdateAsync(string statusText, CancellationToken cancellationToken = default); 26Task UpdateAsync(MarkdownString statusText, CancellationToken cancellationToken = default); 34Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default); 42Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default);
Pipelines\NullPipelineActivityReporter.cs (19)
20return Task.FromResult<IReportingStep>(new NullPublishingStep()); 24public Task CompletePublishAsync(PublishCompletionOptions? options = null, CancellationToken cancellationToken = default) 26return Task.CompletedTask; 31public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 33return Task.CompletedTask; 42return Task.FromResult<IReportingTask>(new NullPublishingTask()); 47return Task.FromResult<IReportingTask>(new NullPublishingTask()); 67public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 69return Task.CompletedTask; 72public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 74return Task.CompletedTask; 86public Task UpdateAsync(string statusText, CancellationToken cancellationToken = default) 88return Task.CompletedTask; 91public Task UpdateAsync(MarkdownString statusText, CancellationToken cancellationToken = default) 93return Task.CompletedTask; 96public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 98return Task.CompletedTask; 101public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 103return Task.CompletedTask;
Pipelines\PipelineActivityReporter.cs (10)
24private readonly Task _interactionServiceSubscriber; 31_interactionServiceSubscriber = Task.Run(() => SubscribeToInteractionsAsync(_cancellationTokenSource.Token)); 119public async Task CompleteStepAsync(ReportingStep step, string completionText, CompletionState completionState, bool enableMarkdown, CancellationToken cancellationToken) 142public async Task UpdateTaskAsync(ReportingTask task, string statusText, bool enableMarkdown, CancellationToken cancellationToken) 208public async Task CompleteTaskAsync(ReportingTask task, CompletionState completionState, string? completionMessage, bool enableMarkdown, CancellationToken cancellationToken) 249public async Task CompletePublishAsync(PublishCompletionOptions? options = null, CancellationToken cancellationToken = default) 281public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 312private async Task SubscribeToInteractionsAsync(CancellationToken cancellationToken) 327private async Task WriteInteractionUpdateToClientAsync(Interaction interaction, CancellationToken cancellationToken) 405internal async Task CompleteInteractionAsync(string promptId, PublishingPromptInputAnswer[]? responses, bool updateResponse = false, CancellationToken cancellationToken = default)
Pipelines\PipelineConfigurationAnnotation.cs (3)
21public Func<PipelineConfigurationContext, Task> Callback { get; } 27public PipelineConfigurationAnnotation(Func<PipelineConfigurationContext, Task> callback) 43return Task.CompletedTask;
Pipelines\PipelineStep.cs (1)
37public required Func<PipelineStepContext, Task> Action { get; init; }
Pipelines\PipelineStepAnnotation.cs (2)
25_factory = (context) => Task.FromResult<IEnumerable<PipelineStep>>([factory(context)]); 43_factory = (context) => Task.FromResult(factory(context));
Pipelines\PipelineStepFactoryExtensions.cs (2)
107Func<PipelineStepContext, Task> callback, 140Func<PipelineConfigurationContext, Task> callback) where T : IResource
Pipelines\PipelineStepHelpers.cs (3)
29public static async Task PushImageToRegistryAsync(IResource resource, PipelineStepContext context) 63private static async Task TagImageForLocalRegistryAsync(IResource resource, PipelineStepContext context) 106private static async Task PushImageToRemoteRegistryAsync(IResource resource, IContainerRegistry registry, PipelineStepContext context)
Pipelines\ReportingStep.cs (2)
167public async Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 178public async Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Pipelines\ReportingTask.cs (4)
55public async Task UpdateAsync(string statusText, CancellationToken cancellationToken = default) 61public async Task UpdateAsync(MarkdownString statusText, CancellationToken cancellationToken = default) 68public async Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 74public async Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
ProjectResourceBuilderExtensions.cs (5)
436return Task.CompletedTask; 559return Task.CompletedTask; 562return Task.CompletedTask; 569return Task.CompletedTask; 584return Task.CompletedTask;
PublisherDistributedApplicationBuilderExtensions.cs (1)
32return Task.CompletedTask;
Publishing\ContainerRuntimeBase.cs (9)
49public abstract Task BuildImageAsync(string contextPath, string dockerfilePath, ContainerImageBuildOptions? options, Dictionary<string, string?> buildArguments, Dictionary<string, BuildImageSecretValue> buildSecrets, string? stage, CancellationToken cancellationToken); 51public virtual async Task TagImageAsync(string localImageName, string targetImageName, CancellationToken cancellationToken) 64public virtual async Task RemoveImageAsync(string imageName, CancellationToken cancellationToken) 77public virtual async Task PushImageAsync(IResource resource, CancellationToken cancellationToken) 98public virtual async Task LoginToRegistryAsync(string registryServer, string username, string password, CancellationToken cancellationToken) 158protected async Task ExecuteContainerCommandAsync( 342public virtual async Task ComposeUpAsync(ComposeOperationContext context, CancellationToken cancellationToken) 398public virtual async Task ComposeDownAsync(ComposeOperationContext context, CancellationToken cancellationToken) 599protected async Task EnsureRuntimeAvailableAsync()
Publishing\DockerContainerRuntime.cs (3)
22private async Task RunDockerBuildAsync(string contextPath, string dockerfilePath, ContainerImageBuildOptions? options, Dictionary<string, string?> buildArguments, Dictionary<string, BuildImageSecretValue> buildSecrets, string? stage, CancellationToken cancellationToken) 129public override async Task BuildImageAsync(string contextPath, string dockerfilePath, ContainerImageBuildOptions? options, Dictionary<string, string?> buildArguments, Dictionary<string, BuildImageSecretValue> buildSecrets, string? stage, CancellationToken cancellationToken) 194private async Task CreateBuildkitInstanceAsync(string builderName, CancellationToken cancellationToken)
Publishing\IContainerRuntime.cs (7)
37Task BuildImageAsync(string contextPath, string dockerfilePath, ContainerImageBuildOptions? options, Dictionary<string, string?> buildArguments, Dictionary<string, BuildImageSecretValue> buildSecrets, string? stage, CancellationToken cancellationToken); 45Task TagImageAsync(string localImageName, string targetImageName, CancellationToken cancellationToken); 52Task RemoveImageAsync(string imageName, CancellationToken cancellationToken); 59Task PushImageAsync(IResource resource, CancellationToken cancellationToken); 68Task LoginToRegistryAsync(string registryServer, string username, string password, CancellationToken cancellationToken); 76Task ComposeUpAsync(ComposeOperationContext context, CancellationToken cancellationToken); 84Task ComposeDownAsync(ComposeOperationContext context, CancellationToken cancellationToken);
Publishing\IDistributedApplicationPublisher.cs (1)
20public Task PublishAsync(DistributedApplicationModel model, CancellationToken cancellationToken);
Publishing\ManifestPublisher.cs (3)
24public async Task PublishAsync(DistributedApplicationModel model, CancellationToken cancellationToken) 29protected virtual async Task PublishInternalAsync(DistributedApplicationModel model, CancellationToken cancellationToken) 64protected async Task WriteManifestAsync(DistributedApplicationModel model, Utf8JsonWriter jsonWriter, CancellationToken cancellationToken)
Publishing\ManifestPublishingContext.cs (20)
78internal async Task WriteModel(DistributedApplicationModel model, CancellationToken cancellationToken) 111internal async Task WriteResourceAsync(IResource resource) 147async Task WriteResourceObjectAsync<T>(T resource, Func<Task> action) where T : IResource 160private Task WriteErrorAsync() 163return Task.CompletedTask; 166private Task WriteConnectionStringAsync(IResourceWithConnectionString resource) 172return Task.CompletedTask; 175private async Task WriteProjectAsync(ProjectResource project) 210private async Task WriteDeploymentTarget(DeploymentTargetAnnotation deploymentTarget) 254private async Task WriteExecutableAsync(ExecutableResource executable) 275internal Task WriteParameterAsync(ParameterResource parameter) 307return Task.CompletedTask; 315public async Task WriteContainerAsync(ContainerResource container) 368private async Task WriteBuildContextAsync(ContainerResource container) 533public async Task WriteEnvironmentVariablesAsync(IResource resource) 570/// <returns>The <see cref="Task"/> to await for completion.</returns> 571public async Task WriteCommandLineArgumentsAsync(IResource resource) 869private async Task WriteConditionalExpressionsAsync() 909private async Task WriteReferencedResources(DistributedApplicationModel model)
Publishing\PipelineExecutor.cs (1)
30protected override async Task ExecuteAsync(CancellationToken stoppingToken)
Publishing\PodmanContainerRuntime.cs (3)
145private async Task RunPodmanBuildAsync(string contextPath, string dockerfilePath, ContainerImageBuildOptions? options, Dictionary<string, string?> buildArguments, Dictionary<string, BuildImageSecretValue> buildSecrets, string? stage, CancellationToken cancellationToken) 237private async Task RunPodmanSaveAsync(string imageName, ContainerImageBuildOptions options, CancellationToken cancellationToken) 284public override async Task BuildImageAsync(string contextPath, string dockerfilePath, ContainerImageBuildOptions? options, Dictionary<string, string?> buildArguments, Dictionary<string, BuildImageSecretValue> buildSecrets, string? stage, CancellationToken cancellationToken)
Publishing\ResourceContainerImageManager.cs (9)
143Task BuildImageAsync(IResource resource, CancellationToken cancellationToken = default); 151Task BuildImagesAsync(IEnumerable<IResource> resources, CancellationToken cancellationToken = default); 158Task PushImageAsync(IResource resource, CancellationToken cancellationToken); 209public async Task BuildImagesAsync(IEnumerable<IResource> resources, CancellationToken cancellationToken = default) 239public async Task BuildImageAsync(IResource resource, CancellationToken cancellationToken = default) 300private async Task BuildProjectContainerImageAsync(IResource resource, ResolvedContainerBuildOptions options, CancellationToken cancellationToken) 327private async Task ExecuteDotnetPublishAsync(IResource resource, ResolvedContainerBuildOptions options, CancellationToken cancellationToken) 451private async Task BuildContainerImageFromDockerfileAsync(IResource resource, DockerfileBuildAnnotation dockerfileBuildAnnotation, string imageName, ResolvedContainerBuildOptions options, CancellationToken cancellationToken) 542public async Task PushImageAsync(IResource resource, CancellationToken cancellationToken)
ResourceBuilderExtensions.cs (15)
383public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, Func<EnvironmentCallbackContext, Task> callback) where T : IResourceWithEnvironment 729return Task.CompletedTask; 741public static IResourceBuilder<T> WithArgs<T>(this IResourceBuilder<T> builder, Func<CommandLineArgsCallbackContext, Task> callback) where T : IResourceWithArgs 776public static IResourceBuilder<T> WithManifestPublishingCallback<T>(this IResourceBuilder<T> builder, Func<ManifestPublishingContext, Task> callback) where T : IResource 2002public static IResourceBuilder<T> WithUrls<T>(this IResourceBuilder<T> builder, Func<ResourceUrlsCallbackContext, Task> callback) 2829return Task.CompletedTask; 4144public static IResourceBuilder<TResource> WithCertificateTrustConfiguration<TResource>(this IResourceBuilder<TResource> builder, Func<CertificateTrustConfigurationCallbackAnnotationContext, Task> callback) 4279public static IResourceBuilder<TResource> WithHttpsCertificateConfiguration<TResource>(this IResourceBuilder<TResource> builder, Func<HttpsCertificateConfigurationCallbackAnnotationContext, Task> callback) 4356return Task.CompletedTask; 4829return Task.CompletedTask; 4845/// <typeparamref name="TLaunchConfiguration"/> is a <see cref="Task"/> or <see cref="ValueTask"/>. Use an 4866if (typeof(Task).IsAssignableFrom(typeof(TLaunchConfiguration)) || IsValueTask(typeof(TLaunchConfiguration))) 4875(mode, _) => Task.FromResult(launchConfigurationProducer(mode)), 4926/// <see cref="Task.FromResult{TResult}(TResult)"/>. Process execution does not generally require a producer, but 5287Func<ContainerImagePushOptionsCallbackContext, Task> callback)
ResourceLoggerForwarderService.cs (5)
29protected override Task ExecuteAsync(CancellationToken stoppingToken) 35private async Task WatchNotifications(CancellationToken cancellationToken) 40var logWatchTasks = new List<Task>(); 53await Task.WhenAll(logWatchTasks).ConfigureAwait(false); 61private async Task WatchResourceLogs(IResource resource, string resourceId, CancellationToken cancellationToken)
src\Shared\ChannelExtensions.cs (1)
43await Task.Delay(s, cancellationToken).ConfigureAwait(false);
src\Shared\ContainerRuntimeDetector.cs (1)
127var results = await Task.WhenAll(tasks).ConfigureAwait(false);
src\Shared\TaskHelpers.cs (6)
10public static Task WaitIgnoreCancelAsync(Task? task) 15public static Task WaitIgnoreCancelAsync(Task? task, ILogger logger, string logMessage) 20private static async Task WaitIgnoreCancelCoreAsync(Task? task, ILogger? logger = null, string? logMessage = null)
TerminalResourceBuilderExtensions.cs (3)
137private static async Task MaterializeTerminalHostsAsync( 313private static async Task WriteMetadataSidecarAsync( 431return Task.CompletedTask;
UserSecrets\IUserSecretsManager.cs (1)
69Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default);
UserSecrets\NoopUserSecretsManager.cs (2)
46public Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default) 49return Task.CompletedTask;
UserSecrets\UserSecretsManagerFactory.cs (1)
159public async Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default)
Utils\DockerfileHelper.cs (1)
20public static async Task ExecuteDockerfileFactoryAsync(
Utils\HashDigestStream.cs (1)
40public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
VersionChecking\VersionCheckService.cs (2)
53protected override async Task ExecuteAsync(CancellationToken stoppingToken) 82private async Task CheckForLatestAsync(CancellationToken cancellationToken)
Aspire.Hosting.Analyzers.Tests (119)
AppHostAnalyzerTests.cs (1)
11public async Task MissingAspireHostingReference_DoesNotThrow()
AspireExportAnalyzerTests.cs (108)
13public async Task ValidExport_NoDiagnostics() 31public async Task ValidExportWithCamelCase_NoDiagnostics() 49public async Task ValidExportWithDottedOperation_NoDiagnostics() 67public async Task ExportWithDescription_ReportsASPIREEXPORT015() 88public async Task ExportedPropertyWithDescription_ReportsASPIREEXPORT015() 109public async Task InstanceMethod_ReportsASPIREEXPORT001() 130public async Task InstanceMethodOnExportedType_NoDiagnostics() 149public async Task ExtensionBlockMember_NoDiagnostics() 173public async Task StaticMemberInExtensionBlock_NoDiagnostics() 195public async Task DuplicateExportIdAcrossExtensionBlockMembers_ReportsASPIREEXPORT007() 231public async Task ExportNameMatchesMethodName_WithConcreteTarget_ExtensionBlockMember_ReportsASPIREEXPORT009() 267public async Task RedundantExportId_MatchesConvention_ExtensionBlockMember_ReportsASPIREEXPORT011() 295public async Task InvalidIdFormat_WithSlash_ReportsASPIREEXPORT002() 316public async Task InvalidIdFormat_WithAtSymbol_ReportsASPIREEXPORT002() 337public async Task InvalidReturnType_ReportsASPIREEXPORT003() 359public async Task InvalidParameterType_ReportsASPIREEXPORT004() 381public async Task ValidPrimitiveTypes_NoDiagnostics() 399public async Task ValidNullableTypes_NoDiagnostics() 417public async Task ValidTaskReturn_NoDiagnostics() 439public async Task ValidValueTaskReturn_NoDiagnostics() 461public async Task ValidEnumTypes_NoDiagnostics() 481public async Task ValidDelegateParameter_NoDiagnostics() 500public async Task ExportedBuilderMethod_InvokesActionInline_ReportsASPIREEXPORT010() 530public async Task ExportedBuilderMethod_InvokesNullableActionViaInvoke_ReportsASPIREEXPORT010() 560public async Task ExportedBuilderMethod_InvokesSyncFuncInline_ReportsASPIREEXPORT010() 590public async Task ExportedBuilderMethod_PassesActionToHelperThatInvokesInline_ReportsASPIREEXPORT010() 625public async Task ExportedBuilderMethod_PassesActionToTransitiveHelperThatInvokesInline_ReportsASPIREEXPORT010() 665public async Task ExportedBuilderMethod_PassesActionIntoDeferredLambda_NoDiagnostics() 696public async Task ExportedBuilderMethod_PassesActionToHelperThatDefersCallback_NoDiagnostics() 732public async Task ExportedBuilderMethod_InvokesSyncCallbackInsideImmediatelyInvokedLambda_ReportsASPIREEXPORT010() 762public async Task ExportedBuilderMethod_PassesActionIntoDeferredLocalFunction_NoDiagnostics() 794public async Task ExportedBuilderMethod_InvokesSyncCallbackInsideInlineLocalFunction_ReportsASPIREEXPORT010() 829public async Task ExportedBuilderMethod_WithBackgroundThreadOptIn_NoASPIREEXPORT010() 856public async Task ExportedBuilderMethod_WithBackgroundThreadOptInAndTransitiveHelperInvocation_NoASPIREEXPORT010() 888public async Task ExportedBuilderMethod_WithContainingTypeBackgroundThreadOptIn_NoASPIREEXPORT010() 916public async Task ExportedBuilderMethod_InvokesAsyncCallbackInline_NoDiagnostics() 944public async Task ValidBuilderParameter_NoDiagnostics() 962public async Task ValidParamsArray_NoDiagnostics() 980public async Task ValidCollectionTypes_NoDiagnostics() 1005public async Task ValidDateOnlyTimeOnly_NoDiagnostics() 1024public async Task TypeWithAspireExportAttribute_NoDiagnostics() 1051public async Task AssemblyExportedExternalType_NoDiagnostics() 1072public async Task ArrayOfAssemblyExportedExternalType_NoDiagnostics() 1093public async Task ValidObjectType_NoDiagnostics() 1111public async Task ValidArrayTypes_NoDiagnostics() 1129public async Task NonGenericCollectionTypes_NoDiagnostics() 1151public async Task InvalidCollectionElementType_ReportsASPIREEXPORT004() 1176public async Task UnionWithSingleType_ReportsASPIREEXPORT005() 1197public async Task UnionWithEmptyTypes_ReportsASPIREEXPORT005() 1218public async Task ValidUnionWithTwoTypes_NoDiagnostics() 1236public async Task ValidUnionWithMultipleTypes_NoDiagnostics() 1256public async Task UnionWithIncompatibleType_ReportsASPIREEXPORT006() 1278public async Task UnionWithPlainClass_ReportsASPIREEXPORT006() 1301public async Task UnionWithDtoType_NoDiagnostics() 1322public async Task DtoWithGetOnlyMutableCollectionProperties_ReportsASPIREEXPORT015() 1348public async Task DtoWithInitMutableCollectionProperties_NoDiagnostics() 1368public async Task DtoWithIgnoredGetOnlyMutableCollectionProperties_NoDiagnostics() 1388public async Task UnionWithPrimitives_NoDiagnostics() 1408public async Task DuplicateExportIdSameTargetType_ReportsASPIREEXPORT007() 1438public async Task DifferentExportIdsSameTargetType_NoDiagnostics() 1459public async Task SameExportIdDifferentTargetTypes_ReportsASPIREEXPORT013() 1495public async Task NonExtensionMethod_ReportsASPIREEXPORT013() 1522public async Task ExposeMethodsOverloadsLikeKubernetesHelmOptions_ReportASPIREEXPORT013() 1554public async Task ExposeMethodsSpecialRuntimeMethods_NoASPIREEXPORT013() 1584public async Task ExposeMethodsGenericAndNonGenericTypesWithSameName_NoASPIREEXPORT013() 1614public async Task AssemblyExportExposeMethodsOverloads_ReportASPIREEXPORT013() 1644public async Task GeneratedMethodNameAliasesExistingExportName_ReportsASPIREEXPORT014() 1685public async Task GeneratedMethodNameSharedByNonDefaultExports_ReportsASPIREEXPORT014() 1724public async Task GeneratedMethodNameAliasesExposedPropertyName_ReportsASPIREEXPORT014() 1759public async Task GeneratedMethodNameAliasesInheritedExposedPropertyName_ReportsASPIREEXPORT014() 1800public async Task UnionWithIResource_NoDiagnostics() 1819public async Task UnionWithEnum_NoDiagnostics() 1839public async Task UnionWithAspireExportType_NoDiagnostics() 1860public async Task UnionWithMultipleInvalidTypes_ReportsMultipleASPIREEXPORT006() 1889public async Task DuplicateExportIdAcrossClasses_ReportsASPIREEXPORT007() 1922public async Task ThreeOrMoreDuplicates_ReportsAllASPIREEXPORT007() 1959public async Task SingleInvalidType_ReportsBothASPIREEXPORT005AndASPIREEXPORT006() 1987public async Task MissingExportAttribute_OnBuilderExtensionMethod_ReportsASPIREEXPORT008() 2007public async Task MissingExportAttribute_WithIncompatibleParam_ReportsASPIREEXPORT008WithReason() 2028public async Task MissingExportAttribute_WithOutParam_ReportsASPIREEXPORT008WithReason() 2048public async Task MissingExportAttribute_WithAspireExport_NoDiagnostics() 2066public async Task MissingExportAttribute_WithAspireExportIgnore_NoDiagnostics() 2084public async Task MissingExportAttribute_WithContainingTypeAspireExportIgnore_NoDiagnostics() 2102public async Task MissingExportAttribute_ObsoleteMethod_NoDiagnostics() 2121public async Task MissingExportAttribute_NonExtensionMethod_NoDiagnostics() 2138public async Task MissingExportAttribute_NonBuilderExtension_NoDiagnostics() 2155public async Task MissingExportAttribute_OnAspireExportedTypeExtension_ReportsASPIREEXPORT008() 2180public async Task MissingExportAttribute_OnAssemblyExportedTypeExtension_ReportsASPIREEXPORT008() 2206public async Task MissingExportAttribute_OnAssemblyExportedExternalTypeExtension_ReportsASPIREEXPORT008() 2229public async Task MissingExportAttribute_OnImplicitlyExportedResourceTypeExtension_ReportsASPIREEXPORT008() 2262public async Task MissingExportAttribute_OnExportedTypeInternalExtensionMethod_NoDiagnostics() 2286public async Task ExportNameMatchesMethodName_WithConcreteTarget_ReportsASPIREEXPORT009() 2320public async Task ExportNameMatchesMethodName_WithConcreteTarget_ParameterlessAspireExport_ReportsASPIREEXPORT009() 2354public async Task ExportNameIsUnique_WithConcreteTarget_NoDiagnostics() 2385public async Task ExportNameMatchesMethodName_NoConcreteTarget_NoDiagnostics() 2411public async Task ExportNameMatchesMethodName_WithInterfaceTarget_NoDiagnostics() 2434public async Task ExportNameMatchesMethodName_ConcreteFirstParam_NoDiagnostics() 2464public async Task ExportNameMatchesMethodName_AzureResourceSuffix_SuggestsCleanName() 2500public async Task RedundantExportId_MatchesConvention_ReportsASPIREEXPORT011() 2521public async Task NonRedundantExportId_DoesNotMatchConvention_NoDiagnostics() 2539public async Task RedundantExportId_InstanceMethod_CamelCaseOnlyNotMatchingConvention_NoDiagnostics() 2561public async Task RedundantExportId_InstanceMethod_TypePrefixMatchesConvention_ReportsASPIREEXPORT011() 2585public async Task RedundantExportId_InstanceMethod_NoExplicitId_NoDiagnostics() 2606public async Task ExportsWithoutMarker_NoDiagnostics() 2629public async Task ExportsWithMarkerFalse_NoDiagnostics() 2652public async Task NoExportsWithoutMarker_ReportsASPIREEXPORT017() 2676public async Task NoExportsWithMarkerTrue_ReportsASPIREEXPORT017() 2700public async Task NoExportsWithMarkerFalse_NoDiagnostics()
CombinationsAnalyzerTests.cs (2)
14public async Task MethodWithBothResourceAndEndpointNameParametersInvalid(string modelName) 49public async Task AnalyzerIsResilientToParameterWithMutlipleModelNameAttributes(string modelName)
EndpointNameAnalyzerTests.cs (4)
14public async Task EndpointNameInvalid(string endpointName) 35public async Task EndpointNameInvalidMultipleParameters(string endpointName) 74public async Task EndpointNameValid(string endpointName) 90public async Task EndpointNameValidMultipleParameters(string endpointName)
ResourceNameAnalyzerTests.cs (4)
14public async Task ResourceNameInvalid(string resourceName) 34public async Task ResourceNameInvalidMultipleParameters(string resourceName) 69public async Task ResourceNameValid(string resourceName) 84public async Task ResourceNameValidMultipleParameters(string resourceName)
Aspire.Hosting.Azure (127)
AcrLoginService.cs (2)
68public async Task LoginAsync( 113await Task.Delay(s_loginRetryDelay, _timeProvider, cancellationToken).ConfigureAwait(false);
AzureBicepResource.cs (1)
317private static async Task ProvisionAzureBicepResourceAsync(PipelineStepContext context, AzureBicepResource resource)
AzureEnvironmentResource.cs (4)
136Action = _ => Task.CompletedTask, 184private Task PublishAsync(PipelineStepContext context) 198private static async Task ValidateAzureLoginAsync(PipelineStepContext context) 223private static async Task DestroyAzureResourcesAsync(PipelineStepContext context)
AzureEnvironmentResourceExtensions.cs (1)
91private static async Task ProvisionAzureResourcesAsync(AzureEnvironmentResource resource, InitializeResourceEvent @event, CancellationToken cancellationToken)
AzureProvisioningController.cs (57)
382private static async Task LoadTenantArgumentOptionsAsync(LoadInputContext context) 410private static async Task LoadSubscriptionArgumentOptionsAsync(LoadInputContext context) 443private static async Task LoadResourceGroupArgumentOptionsAsync(LoadInputContext context) 471private static async Task LoadLocationArgumentOptionsAsync(LoadInputContext context, string? deploymentStateResourceName = null) 525private static Task ValidateAzureContextCommandArguments(InputsDialogValidationContext validationContext) 536return Task.CompletedTask; 548public async Task ResetStateAsync(DistributedApplicationModel model, CancellationToken cancellationToken = default) 555public async Task ForgetResourceStateAsync(DistributedApplicationModel model, string resourceName, CancellationToken cancellationToken = default) 578public Task EnsureProvisionedAsync(DistributedApplicationModel model, CancellationToken cancellationToken = default) 592public async Task DeleteAzureResourcesAsync(DistributedApplicationModel model, CancellationToken cancellationToken = default) 599public async Task CheckForDriftAsync(DistributedApplicationModel model, CancellationToken cancellationToken = default) 638public async Task CancelResourceAsync(DistributedApplicationModel model, string resourceName, CancellationToken cancellationToken = default) 646public async Task DeleteAzureResourceAsync(DistributedApplicationModel model, string resourceName, CancellationToken cancellationToken = default) 804() => Task.CompletedTask, 905return Task.FromResult(false); 1008private async Task RunOperationAsync(DistributedApplicationModel model, AzureIntent intent, CancellationToken cancellationToken) 1040var afterProvisionTasks = new List<Task>(azureResources.Count); 1070await Task.WhenAll(afterProvisionTasks).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing); 1144private async Task ResetResourcesAsync( 1211private async Task DeleteSectionAsync(string sectionName, CancellationToken cancellationToken) 1427internal Task ProcessQueuedOperationForTesting(QueuedOperationForTesting queuedOperation) 1443_ = Task.Run(async () => 1451await Task.Delay(DriftCheckInterval, _timeProvider, stoppingToken).ConfigureAwait(false); 1471_ = Task.Run(async () => 1486private async Task ProcessOperationLoopAsync(CancellationToken stoppingToken) 1525private async Task ProcessQueuedOperationAsync(QueuedOperation queuedOperation) 1624_ = Task.Run(async () => 1644private async Task PromptForMissingAzureContextAsync(DistributedApplicationModel model, CancellationToken cancellationToken) 2023private async Task CancelResourceCoreAsync(DistributedApplicationModel model, string resourceName, CancellationToken cancellationToken) 2376private static async Task<ExecuteCommandResult> ExecuteCommandAsync(Func<Task> action, string successMessage, Func<Task<CommandResultData>> createResultData, string? failureOperation = null) 2737private async Task ApplyResourceOverridesAsync(IAzureResource azureResource, CancellationToken cancellationToken) 2774private async Task SetResourceLocationOverrideAsync(string resourceName, string location, CancellationToken cancellationToken) 2834private async Task MarkCachedDeploymentCanceledAsync(string sectionName, string deploymentId, CancellationToken cancellationToken) 2869private async Task CancelCachedDeploymentAsync(string deploymentId, ILogger resourceLogger, CancellationToken cancellationToken) 2921private async Task AddDeploymentOperationTargetResourceIdsAsync(AzureBicepResource resource, HashSet<string> resourceIds, CancellationToken cancellationToken) 2946private async Task DeleteAzureResourceIdsAsync(IReadOnlyList<string> resourceIds, string resourceName, string? resourceLocation, string? fallbackResourceLocation, bool allowKeyVaultPurgeTimeout, CancellationToken cancellationToken) 3467private async Task DeleteCachedResourceForLocationChangeAsync( 3573private async Task ClearCachedDeploymentStateAsync( 3632private async Task RefreshCommandStatesAsync(DistributedApplicationModel model, CancellationToken cancellationToken) 3673private async Task PublishUpdateToResourceTreeAsync( 3678async Task PublishAsync(IResource targetResource) 3713private async Task AfterProvisionAsync( 3765private async Task PublishSyntheticProvisioningFailureAsync( 3883private async Task ProvisionAzureResourcesAsync( 3894var tasks = new List<Task>(azureResources.Count); 3901var task = Task.WhenAll(tasks); 3905private async Task ProcessResourceAsync( 4031private static async Task WaitForProvisioningDependenciesAsync( 4061await Task.WhenAll(dependencies 4064.OfType<Task>()).ConfigureAwait(false); 4095private async Task PublishConnectionStringAvailableEventAsync( 4131private async Task PublishAzureEnvironmentStateAsync( 4142private async Task PublishAzureEnvironmentStateAsync( 4154private async Task PublishAzureEnvironmentStateAsync( 4349Func<InputsDialogValidationContext, Task>? ValidateArguments = null); 4362Func<InputsDialogValidationContext, Task>? ValidateArguments = null);
AzurePublishingContext.cs (8)
83public async Task WriteModelAsync(DistributedApplicationModel model, AzureEnvironmentResource environment, CancellationToken cancellationToken = default) 116private async Task WriteAzureArtifactsOutputAsync(IReportingStep step, DistributedApplicationModel model, AzureEnvironmentResource environment, CancellationToken cancellationToken) 450private async Task MapParameterAsync(object candidate, CancellationToken cancellationToken = default) 495private static Task VisitAsync(object? value, Func<object, CancellationToken, Task> visitor, CancellationToken cancellationToken = default) => 498private static async Task VisitAsync(object? value, Func<object, CancellationToken, Task> visitor, HashSet<object> visited, CancellationToken cancellationToken = default) 521private async Task SaveToDiskAsync(string outputDirectoryPath)
AzureResourcePreparer.cs (3)
25internal Task OnBeforeStartAsync(BeforeStartEvent @event, CancellationToken cancellationToken) 30internal async Task PrepareResourcesAsync(DistributedApplicationModel model, CancellationToken cancellationToken) 181private async Task BuildRoleAssignmentAnnotations(DistributedApplicationModel appModel, List<(IResource Resource, IAzureResource AzureResource)> azureResources, CancellationToken cancellationToken)
IAcrLoginService.cs (1)
23Task LoginAsync(
Provisioning\BicepUtilities.cs (3)
40public static async Task SetParametersAsync(JsonObject parameters, AzureBicepResource resource, bool skipKnownValues = false, CancellationToken cancellationToken = default) 76public static async Task SetScopeAsync(JsonObject scope, AzureBicepResource resource, CancellationToken cancellationToken = default) 219private static async Task SetScopeValueAsync(JsonObject scope, string propertyName, object? value, CancellationToken cancellationToken)
Provisioning\Internal\BaseProvisioningContextProvider.cs (2)
205protected async Task SaveProvisioningOptionsAsync(string resourceGroupName, CancellationToken cancellationToken = default) 211private async Task SaveProvisioningOptionsAsync(
Provisioning\Internal\DefaultArmClientProvider.cs (7)
223public async Task DeleteResourceAsync(string resourceId, CancellationToken cancellationToken = default) 237public async Task CancelDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default) 269private static async Task WaitForKeyVaultToBeDeletedAsync(GenericResource keyVault, TimeProvider timeProvider, CancellationToken cancellationToken) 291await Task.Delay(s_keyVaultDeletePollInterval, timeProvider, linkedCts.Token).ConfigureAwait(false); 300private static async Task WaitForDeletedKeyVaultToBePurgedAsync(DeletedKeyVaultResource deletedVault, TimeProvider timeProvider, CancellationToken cancellationToken) 322await Task.Delay(s_keyVaultPurgePollInterval, timeProvider, linkedCts.Token).ConfigureAwait(false); 392var operationGroups = await Task.WhenAll(
Provisioning\Internal\DefaultArmDeploymentCollection.cs (1)
22public async Task CancelAsync(string deploymentName, CancellationToken cancellationToken = default)
Provisioning\Internal\IProvisioningServices.cs (9)
92Task PersistProvisioningOptionsAsync(CancellationToken cancellationToken = default); 118public Task<bool> EnsureProvisioningOptionsAsync(bool forcePrompt, CancellationToken cancellationToken = default) => Task.FromResult(false); 120=> Task.FromResult(new AzureProvisioningOptionsState(null, null, null, null)); 121public Task PersistProvisioningOptionsAsync(CancellationToken cancellationToken = default) => Task.CompletedTask; 123=> Task.FromResult(new AzureProvisioningOptionsState(options.SubscriptionId, options.ResourceGroup, options.Location, options.TenantId)); 186Task DeleteResourceAsync(string resourceId, CancellationToken cancellationToken = default); 204Task CancelDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default); 336Task CancelAsync(string deploymentName, CancellationToken cancellationToken = default);
Provisioning\Internal\PublishModeProvisioningContextProvider.cs (8)
81private async Task RetrieveAzureProvisioningOptions(CancellationToken cancellationToken = default) 115private async Task PromptForTenantAsync(CancellationToken cancellationToken) 203return Task.CompletedTask; 214private async Task PromptForSubscriptionAsync(CancellationToken cancellationToken) 302return Task.CompletedTask; 313private async Task PromptForLocationAndResourceGroupAsync(CancellationToken cancellationToken) 378return Task.CompletedTask; 408private async Task PromptForLocationAsync(CancellationToken cancellationToken)
Provisioning\Internal\RunModeProvisioningContextProvider.cs (3)
141public async Task PersistProvisioningOptionsAsync(CancellationToken cancellationToken = default) 225private async Task RehydrateProvisioningOptionsAsync(CancellationToken cancellationToken) 311return Task.CompletedTask;
Provisioning\Provisioners\AzureProvisioner.cs (1)
14internal Task ProvisionResourcesAsync(DistributedApplicationModel model, CancellationToken cancellationToken = default)
Provisioning\Provisioners\BicepProvisioner.cs (11)
287await Task.Delay(s_deploymentOperationPollingInterval, _timeProvider, cancellationToken).ConfigureAwait(false); 319private async Task PublishCachedRunningDeploymentStateAsync( 439private async Task PersistReconciledProvisioningStateAsync(DeploymentStateSection stateSection, string provisioningState, CancellationToken cancellationToken) 445private async Task PublishReconciledTerminalStateAsync(AzureBicepResource resource, string state) 453private async Task ClearCachedRunningDeploymentStateAsync(DeploymentStateSection stateSection, CancellationToken cancellationToken) 506public async Task GetOrCreateResourceAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken) 705var deploymentOperationTrackingTask = context.ExecutionContext.IsRunMode 707: Task.CompletedTask; 941private async Task TrackDeploymentOperationsAsync( 952await Task.Delay(s_deploymentOperationPollingInterval, _timeProvider, cancellationToken).ConfigureAwait(false); 1034await Task.WhenAll(enrichmentTasks.Select(static enrichment => enrichment.EnrichmentTask)).ConfigureAwait(false);
Provisioning\Provisioners\IBicepProvisioner.cs (1)
35Task GetOrCreateResourceAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken);
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (4)
143_ = Task.Run(async () => 150await Task.WhenAll(stdoutComplete.Task, stderrComplete.Task).ConfigureAwait(false); 245private readonly Task _processLifetimeTask; 248public ProcessDisposable(System.Diagnostics.Process process, Task processLifetimeTask, bool entireProcessTree)
Aspire.Hosting.Azure.AppContainers (10)
AzureContainerAppEnvironmentResource.cs (2)
156private async Task PrintDashboardUrlAsync(PipelineStepContext context) 177private async Task PrepareDeploymentTargetsAsync(PipelineStepContext context)
AzureContainerAppExtensions.cs (3)
73return Task.CompletedTask; 104return Task.CompletedTask; 130return Task.CompletedTask;
AzureContainerAppResource.cs (1)
77Action = _ => Task.CompletedTask,
BaseContainerAppContext.cs (3)
102public async Task ProcessResourceAsync(CancellationToken cancellationToken) 113private async Task ProcessArgumentsAsync(CancellationToken cancellationToken) 129private async Task ProcessEnvironmentAsync(CancellationToken cancellationToken)
src\Shared\CrossScopeAcrPullIdentityPreparer.cs (1)
63return Task.CompletedTask;
Aspire.Hosting.Azure.AppService (10)
AzureAppServiceEnvironmentExtensions.cs (2)
51return Task.CompletedTask; 65return Task.CompletedTask;
AzureAppServiceEnvironmentResource.cs (3)
180private async Task PrepareDeploymentTargetsAsync(PipelineStepContext context) 240private async Task PrintDashboardUrlAsync(PipelineStepContext context) 255private async Task ValidateAppServiceConfigurationAsync(PipelineStepContext context, DistributedApplicationModel model)
AzureAppServiceWebsiteContext.cs (3)
56public async Task ProcessAsync(CancellationToken cancellationToken) 63private async Task ProcessEnvironmentAsync(CancellationToken cancellationToken) 77private async Task ProcessArgumentsAsync(CancellationToken cancellationToken)
AzureAppServiceWebSiteResource.cs (1)
75Action = _ => Task.CompletedTask,
src\Shared\CrossScopeAcrPullIdentityPreparer.cs (1)
63return Task.CompletedTask;
Aspire.Hosting.Azure.ContainerRegistry (2)
AzureContainerRegistryExtensions.cs (1)
74return Task.CompletedTask;
AzureContainerRegistryHelpers.cs (1)
20public static async Task LoginToRegistryAsync(IContainerRegistry registry, PipelineStepContext context)
Aspire.Hosting.Azure.CosmosDB (3)
AzureCosmosDBExtensions.cs (3)
193return Task.CompletedTask; 200return Task.CompletedTask; 562return Task.CompletedTask;
Aspire.Hosting.Azure.EventHubs (2)
AzureEventHubsExtensions.cs (2)
320return Task.FromResult<IEnumerable<ContainerFileSystemItem>>([ 354return Task.FromResult<IEnumerable<ContainerFileSystemItem>>([
Aspire.Hosting.Azure.Functions (1)
AzureFunctionsProjectResourceExtensions.cs (1)
183return Task.CompletedTask;
Aspire.Hosting.Azure.Kubernetes (13)
AzureKubernetesEnvironmentResource.AksPipeline.cs (7)
41private Task PrepareAksEnvironmentAsync(PipelineStepContext context) 48return Task.CompletedTask; 140return Task.CompletedTask; 210private async Task GetAksCredentialsAsync(PipelineStepContext context) 344internal async Task ApplyAlbCrdAsync( 501private static async Task WaitForAzureAlbGatewayClassAsync( 557await Task.Delay(pollInterval, cancellationToken).ConfigureAwait(false);
AzureKubernetesEnvironmentResource.cs (1)
70return Task.FromResult<IEnumerable<PipelineStep>>([prepareStep, getCredentialsStep]);
AzureKubernetesLoadBalancerResource.cs (1)
95return Task.FromResult<IEnumerable<PipelineStep>>([step]);
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (4)
143_ = Task.Run(async () => 150await Task.WhenAll(stdoutComplete.Task, stderrComplete.Task).ConfigureAwait(false); 245private readonly Task _processLifetimeTask; 248public ProcessDisposable(System.Diagnostics.Process process, Task processLifetimeTask, bool entireProcessTree)
Aspire.Hosting.Azure.Kubernetes.Tests (72)
AzureKubernetesEnvironmentExtensionsTests.cs (6)
21public async Task AddAzureKubernetesEnvironment_BasicConfiguration() 117public async Task AddAzureKubernetesEnvironment_AllowsKubernetesServiceCustomizationWithoutVisibleKubernetesEnvironment() 319public async Task ContainerRegistry_FlowsToInnerKubernetesEnvironment() 428public async Task WithSystemNodePool_BicepReflectsCustomVmSize() 440private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken); 443public async Task AddLoadBalancer_BicepEnablesIngressProfileAndUsesPreviewApi()
AzureKubernetesFoundryReferenceTests.cs (1)
19public async Task EndpointReferenceToFoundryHostedAgentIsResolvedAcrossComputeEnvironments()
AzureKubernetesInfrastructureTests.cs (38)
26public async Task NoUserPool_CreatesDefaultWorkloadPool() 53public async Task ExplicitUserPool_NoDefaultCreated() 76public async Task ExplicitAffinity_NotOverridden() 97public async Task ComputeResource_GetsDeploymentTargetFromKubernetesInfrastructure() 121private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken); 124public async Task MultiEnv_ResourcesMatchCorrectEnvironment() 167public async Task KubernetesPipelineStepsFlowThroughAksEnvironment() 199public async Task DeploymentScopeUsesCurrentDeploymentState() 226public async Task DeploymentScopeRequiresSubscription() 251public async Task GetResourceGroupUsesDeploymentStateWithoutQueryingAzure() 264return Task.FromResult(new AzureKubernetesEnvironmentResource.AzCommandResult(0, "unexpected-rg", "")); 272public async Task GetResourceGroupQueryIsScopedToDeploymentSubscription() 286return Task.FromResult(new AzureKubernetesEnvironmentResource.AzCommandResult(0, "queried-rg\n", "")); 296public async Task GetResourceGroupThrowsWhenClusterNameIsAmbiguous() 307(path, arguments) => Task.FromResult( 318public async Task GetResourceGroupThrowsWhenClusterIsNotFound() 327(path, arguments) => Task.FromResult( 337public async Task FetchKubeConfigIsScopedToDeploymentSubscription() 350return Task.FromResult(new AzureKubernetesEnvironmentResource.AzCommandResult(0, "kubeconfig-content", "")); 360public async Task FetchKubeConfigThrowsWhenAzureCliFails() 368(path, arguments) => Task.FromResult( 377public async Task GetCredentialsStepScopesEveryAzureCliCallToDeploymentSubscription() 406return Task.FromResult(arguments.StartsWith("resource list", StringComparison.Ordinal) 473public async Task GetCredentialsStepUsesExistingClusterScopeInsteadOfDeploymentState() 503return Task.FromResult(new AzureKubernetesEnvironmentResource.AzCommandResult(0, "kubeconfig-content", "")); 554public async Task DeploymentScopeFallsBackToDeploymentStateWhenResourcePinsNothing() 568public async Task DeploymentScopeKeepsDeploymentResourceGroupWhenResourcePinsSameSubscription() 582public async Task DeploymentScopeDropsDeploymentResourceGroupWhenResourcePinsAnotherSubscription() 599public async Task DeploymentScopeUsesDeploymentSubscriptionWhenResourcePinsOnlyResourceGroup() 613public async Task DeploymentScopeIgnoresDeploymentStateWhenResourcePinsBothValues() 630public async Task DeploymentScopeResolvesParameterBackedScopeValues() 647public async Task DeploymentScopeThrowsWhenScopeProviderResolvesNull() 666public async Task DeploymentScopeThrowsWhenScopeProviderResolvesEmpty() 685public async Task GetCredentialsStepPrefersExplicitScopeOverExistingResourceAnnotation() 715return Task.FromResult(new AzureKubernetesEnvironmentResource.AzCommandResult(0, "kubeconfig-content", "")); 756public async Task GetCredentialsStepFallsBackToDeploymentStateForSubscriptionScopedResources() 784return Task.FromResult(new AzureKubernetesEnvironmentResource.AzCommandResult(0, "kubeconfig-content", "")); 826public async Task DeploymentScopeThrowsWhenScopeValueIsEmptyString()
AzureKubernetesIngressTests.cs (4)
14public async Task AksAddIngress_WithPath_GeneratesIngressInHelmOutput() 65public async Task WithLoadBalancer_OnGateway_AnnotatesAndDefaultsClass() 88public async Task WithLoadBalancer_OnIngress_AnnotatesAndDefaultsClass() 111public async Task WithLoadBalancer_RespectsExplicitGatewayClass()
AzureKubernetesPersistentVolumeTests.cs (1)
24public async Task AksAddPersistentVolume_GeneratesClaimUsingClusterDefaults()
tests\Shared\InMemoryDeploymentStateManager.cs (8)
32return Task.FromResult(new DeploymentStateSection(sectionName, data, version)); 34return Task.FromResult(new DeploymentStateSection(sectionName, [], 0)); 37public Task SaveSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 41return Task.CompletedTask; 44public Task DeleteSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 48return Task.CompletedTask; 51public Task ClearAllStateAsync(CancellationToken cancellationToken = default) 55return Task.CompletedTask;
tests\Shared\TestPipelineActivityReporter.cs (14)
133public Task CompletePublishAsync(PublishCompletionOptions? options = null, CancellationToken cancellationToken = default) 142return Task.CompletedTask; 147public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 175return Task.FromResult<IReportingStep>(new TestReportingStep(this, title, _testOutputHelper)); 193public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 202return Task.CompletedTask; 213return Task.FromResult<IReportingTask>(new TestReportingTask(_reporter, statusText, _testOutputHelper)); 250public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 272public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 280return Task.CompletedTask; 283public Task UpdateAsync(string statusText, CancellationToken cancellationToken = default) 291return Task.CompletedTask; 294public Task UpdateAsync(MarkdownString statusText, CancellationToken cancellationToken = default) 300public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Azure.Kusto (1)
AzureKustoBuilderExtensions.cs (1)
279private static async Task CreateDatabaseAsync(ICslAdminProvider adminProvider, AzureKustoReadWriteDatabaseResource databaseResource, IServiceProvider serviceProvider, CancellationToken cancellationToken)
Aspire.Hosting.Azure.Kusto.Tests (26)
AddAzureKustoTests.cs (2)
94public async Task RunAsEmulator_RespectsConfigurationCallback() 117public async Task RunAsEmulator_SetsEula()
KustoFunctionalTests.cs (6)
44public async Task KustoEmulator_Starts() 95public async Task KustoEmulator_WithDatabase_CanReadIngestedData() 141static async Task SeedDataAsync(ICslAdminProvider provider) 173public async Task KustoEmulator_WithDatabaseThatAlreadyExists_ErrorIsIgnored() 201public async Task KustoEmulator_WithInvalidDatabase_LogsErrorAndContinues() 234public async Task KustoEmulator_WithBindMount_IsUsedForPersistence()
KustoResiliencePipelinesTests.cs (3)
11public async Task ShouldRetryOnTemporaryExceptions() 30public async Task ShouldNotRetryOnOtherExceptions() 49public async Task ShouldNotRetryOnPermanentExceptions()
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
Aspire.Hosting.Azure.PostgreSQL (1)
AzurePostgresExtensions.cs (1)
320return Task.CompletedTask;
Aspire.Hosting.Azure.Redis (2)
AzureManagedRedisExtensions.cs (1)
152return Task.CompletedTask;
AzureRedisExtensions.cs (1)
216return Task.CompletedTask;
Aspire.Hosting.Azure.ServiceBus (2)
AzureServiceBusExtensions.cs (2)
470return Task.FromResult<IEnumerable<ContainerFileSystemItem>>([ 504return Task.FromResult<IEnumerable<ContainerFileSystemItem>>([
Aspire.Hosting.Azure.Sql (1)
AzureSqlServerResource.cs (1)
590return Task.CompletedTask;
Aspire.Hosting.Azure.Storage (1)
AzureStorageExtensions.cs (1)
373return Task.CompletedTask;
Aspire.Hosting.Azure.Tests (1032)
AcrLoginServiceTests.cs (8)
16public async Task LoginAsync_RetriesTransientExchangeFailures() 25return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK) 49public async Task LoginAsync_DoesNotRetryNonRetryableExchangeFailures() 51var handler = new CallbackHttpMessageHandler((_, _) => Task.FromResult(new HttpResponseMessage(HttpStatusCode.BadRequest) 71public async Task LoginAsync_StopsRetryingAfterMaxAttempts() 73var handler = new CallbackHttpMessageHandler((_, _) => Task.FromResult(new HttpResponseMessage(HttpStatusCode.NotFound) 93public async Task LoginAsync_StopsRetryingAfterTimeBudgetExceeded() 95var handler = new CallbackHttpMessageHandler((_, _) => Task.FromResult(new HttpResponseMessage(HttpStatusCode.NotFound)
AzureAppConfigurationExtensionsTests.cs (2)
14public async Task AddAzureAppConfiguration() 112public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureAppConfigurationResource()
AzureApplicationInsightsExtensionsTests.cs (6)
13public async Task AddApplicationInsightsWithoutExplicitLawGetsGeneratedLaw() 34public async Task AddApplicationInsightsWithoutExplicitLawGetsDefaultLawParameterInRunMode() 62public async Task AddApplicationInsightsWithExplicitLawArgumentDoesntGetDefaultParameter() 84public async Task WithReferenceAppInsightsSetsEnvironmentVariable() 102public async Task WithLogAnalyticsWorkspaceId_UsesProvidedWorkspaceId_VerifyBicep() 119public async Task WithLogAnalyticsWorkspace_UsesWorkspaceResourceId_VerifyBicep()
AzureAppServiceEnvironmentExtensionsTests.cs (5)
31public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureAppServiceEnvironmentResource() 103public async Task CrossResourceGroupRegistry_UsesStandaloneAcrPullIdentityForFinalRegistry() 139public async Task SameScopeExistingRegistry_KeepsInlineAcrPullIdentity() 159public async Task CrossResourceGroupRegistry_PreservesAcrPullIdentityAddedAfterEnvironment() 180public async Task MultipleEnvironments_SharingCrossScopeRegistry_EachGetDistinctStandaloneAcrPullIdentity()
AzureAppServiceTests.cs (45)
24public async Task AddContainerAppEnvironmentAddsDeploymentTargetWithContainerAppToProjectResources() 61public async Task AddContainerAppEnvironmentAddsEnvironmentResource() 82public async Task AddAppServiceWithDelegatedSubnet() 123public async Task AddAppServiceWithDelegatedSubnetWithoutDeploymentSlot() 163public async Task PublishAsAzureAppServiceWebsite_CanOverrideEnvironmentDelegatedSubnet() 194public async Task PublishToAppService_WithDashedConnectionStringName_FailsValidationInPipeline() 235public async Task PublishToAppService_WithDashedConnectionStringName_CanBeIgnored() 268public async Task KeyvaultReferenceHandling() 308public async Task EndpointReferencesAreResolvedAcrossProjects() 343public async Task EndpointReferenceToFoundryHostedAgentIsResolvedAcrossComputeEnvironments() 396public async Task AzureAppServiceSupportBaitAndSwitchResources() 428public async Task AddDockerfileWithAppServiceInfrastructureAddsDeploymentTargetWithAppServiceToContainerResources() 464public async Task UnknownManifestExpressionProviderIsHandledWithAllocateParameter() 511public async Task AzureAppServiceEnvironmentCanReferenceExistingAppServicePlan() 540public async Task AzureAppServiceEnvironmentCanPublishExistingAppServicePlan() 578public async Task AsExisting_WithExplicitContainerRegistry_PublishGeneratesEnvWithExistingPlanAndRegistry() 604public async Task WithAcrPullIdentity_PublishGeneratesEnvWithSuppliedIdentity() 624public async Task WithAcrPullIdentity_AsExisting_PublishGeneratesEnvWithSuppliedIdentity() 657public async Task WithDashboardControlsDashboardUrlPrintStep(bool enableDashboard) 684public async Task PublishAsAzureAppServiceWebsite_ThrowsIfNoEnvironment() 686static async Task RunTest(Action<IDistributedApplicationBuilder> action) 715public async Task ValidateAzureAppService_DoesNotThrowInRunMode() 736public async Task MultipleAzureAppServiceEnvironmentsSupported() 766public async Task ResourceWithProbes() 799public async Task AddAppServiceEnvironmentWithoutDashboardAddsEnvironmentResource() 820public async Task AddAppServiceToEnvironmentWithoutDashboard() 855public async Task AddAppServiceWithArgs() 891public async Task AddAppServiceWithTargetPort() 927public async Task CanPreserveHttpSchemeUsingWithHttpsUpgrade() 965public async Task AddAppServiceWithTargetPortMultipleEndpoints() 1000public async Task AddAppServiceWithMultipleTargetPortsThrowsNotSupportedException() 1025public async Task AddAppServiceWithMixedNullAndExplicitTargetPortsThrowsNotSupportedException() 1046public async Task AddAppServiceProjectWithoutTargetPortUsesContainerPort() 1077public async Task AddAppServiceContainerWithoutTargetPortUsesDefaultPort() 1108public async Task GetHostAddressExpression() 1137public async Task GetEndpointPropertyExpression_ReturnsAppServiceEndpointPropertyExpression(EndpointProperty property, string expected) 1157public async Task AddAppServiceWithApplicationInsightsLocation() 1178public async Task AddAppServiceWithApplicationInsightsDefaultLocation() 1199public async Task AddAppServiceWithApplicationInsightsNormalizesBicepIdentifiers() 1219public async Task AddAppServiceWithApplicationInsightsLocationParam() 1241public async Task AddAppServiceWithExistingApplicationInsights() 1263public async Task AddAppServiceProjectWithApplicationInsightsSetsAppSettings() 1294public async Task AddAppServiceWithDeploymentSlot() 1325public async Task AddAppServiceWithDeploymentSlotParameter() 1357public async Task ConditionalExpressionWithParameterCondition()
AzureBicepProvisionerTests.cs (75)
60public async Task NestedChildResourcesShouldGetUpdated() 119public async Task GetOrCreateResourceAsync_InPublishMode_ThrowsForUnknownPrincipalParameters() 153public async Task GetOrCreateResourceAsync_InRunMode_PopulatesPrincipalTypeFromContext(string principalType) 204public async Task GetOrCreateResourceAsync_WithSubscriptionScope_UsesSubscriptionDeploymentCollection() 239public async Task GetOrCreateResourceAsync_WithTenantScope_UsesTenantDeploymentCollection() 274public async Task GetOrCreateResourceAsync_WithResourceGroupAndSubscriptionScope_UsesScopedResourceGroupDeploymentCollection() 307public async Task GetOrCreateResourceAsync_WithDefaultScope_UsesResourceGroupDeploymentCollection() 337public async Task GetOrCreateResourceAsync_WithSubscriptionScopeInRunMode_UsesSubscriptionDeploymentCollection() 372public async Task GetOrCreateResourceAsync_InPublishMode_DoesNotQueryDeploymentOperationsAfterSuccessfulDeployment() 418public async Task GetOrCreateResourceAsync_InPublishMode_EnrichesDeploymentStartFailures() 462public async Task GetOrCreateResourceAsync_InPublishMode_UsesDeploymentOperationDetailsWhenWaitingFails() 541public async Task GetOrCreateResourceAsync_InPublishMode_EnrichesDeploymentOperationFailuresInParallel() 654public async Task GetOrCreateResourceAsync_UsesEffectiveResourceLocationInSnapshot() 688public async Task GetOrCreateResourceAsync_PublishesPredictedDeploymentIdBeforeDeploymentStarts() 718public async Task GetOrCreateResourceAsync_PublishesSubscriptionScopedPredictedDeploymentIdAndUrlWhileWaiting() 757public async Task ConfigureResourceAsync_DoesNotReuseOverrideOnlyDeploymentState() 787public async Task ConfigureResourceAsync_DoesNotReuseInProgressDeploymentState() 823public async Task ConfigureResourceAsync_PublishesAzureIdentityPropertiesFromDeploymentState() 874public async Task ConfigureResourceAsync_PublishesResourceGroupFromCachedDeploymentId() 920public async Task GetOrCreateResourceAsync_PreservesLocationOverrideInDeploymentState() 954public async Task GetOrCreateResourceAsync_ClearsStaleLocationOverrideWhenEffectiveLocationChanges() 986public async Task GetOrCreateResourceAsync_SavesInProgressDeploymentStateBeforeWaiting() 1019public async Task GetOrCreateResourceAsync_PublishesFailedDeploymentOperationDetailsWhenWaitingFails() 1178public async Task GetOrCreateResourceAsync_ClearsStaleDeploymentOperationDetailsWhenDeploymentStartFails() 1237public async Task GetOrCreateResourceAsync_CancelsStartedDeploymentWhenWaitIsCanceled() 1270public async Task GetOrCreateResourceAsync_CancelsPendingDeploymentWhenStartIsCanceled() 1303public async Task GetOrCreateResourceAsync_PersistsCanceledStateWhenCancelFindsAlreadyInactiveDeployment() 1335public async Task GetOrCreateResourceAsync_AdoptsActiveCachedDeploymentWhenCreateReportsDeploymentActive() 1370public async Task GetOrCreateResourceAsync_DoesNotAdoptActiveDeploymentWhenCachedChecksumDoesNotMatch() 1397public async Task GetOrCreateResourceAsync_SavesTerminalDeploymentStateWhenDeploymentFails() 1428public async Task BicepCliExecutor_CompilesBicepToArm() 1482public async Task TestTokenCredential_ProvidesAccessTokenAsync() 1500public async Task ReconcileDeploymentStateAsync_ConfiguresSucceededDeploymentFromArm() 1532public async Task ReconcileDeploymentStateAsync_WaitsForRunningDeploymentBeforeConfiguring() 1560public async Task ReconcileDeploymentStateAsync_ClearsStaleRunningStateWhenDeploymentIsMissing() 1584public async Task ReconcileDeploymentStateAsync_LeavesRunningStateWhenArmCannotBeQueried() 1611public async Task ReconcileDeploymentStateAsync_LeavesRunningStateWhenArmFailsDuringWait() 1640public async Task ReconcileDeploymentStateAsync_PersistsFailedStateAndThrowsWhenDeploymentFailed() 1665public async Task ReconcileDeploymentStateAsync_PersistsCanceledStateAndThrowsWhenDeploymentCanceled() 1694public async Task ReconcileDeploymentStateAsync_ReturnsFalseWhenSucceededDeploymentChecksumDoesNotMatch() 1768private static async Task SeedRunningDeploymentStateAsync(IDeploymentStateManager deploymentStateManager, AzureBicepResource resource, string deploymentId) 1835return Task.FromResult(CompilationResult); 1878return Task.FromResult(new DeploymentStateSection(sectionName, [], 0)); 1881public Task DeleteSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 1883return Task.CompletedTask; 1886public Task SaveSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 1888return Task.CompletedTask; 1891public Task ClearAllStateAsync(CancellationToken cancellationToken = default) => Task.CompletedTask; 1902Task.FromResult<ArmOperation>(new TestDeleteArmOperation()); 1906await Task.CompletedTask; 1925return Task.FromResult<ArmOperation>(new TestDeleteArmOperation()); 1930await Task.CompletedTask; 1955Task.FromResult<ArmOperation<ArmDeploymentResource>>(new WaitingThrowingArmDeploymentOperation()); 1957public Task CancelAsync(string deploymentName, CancellationToken cancellationToken = default) => Task.CompletedTask; 1998public Task CancelAsync(string deploymentName, CancellationToken cancellationToken = default) => Task.CompletedTask; 2014return Task.FromException<ArmOperation<ArmDeploymentResource>>(new RequestFailedException( 2021public Task CancelAsync(string deploymentName, CancellationToken cancellationToken = default) => Task.CompletedTask; 2031Task.FromException<ArmOperation<ArmDeploymentResource>>(new RequestFailedException( 2037public Task CancelAsync(string deploymentName, CancellationToken cancellationToken = default) => Task.CompletedTask; 2050Task.FromResult<ArmOperation<ArmDeploymentResource>>(new CancelingArmDeploymentOperation()); 2052public Task CancelAsync(string deploymentName, CancellationToken cancellationToken = default) 2056return Task.CompletedTask; 2099Task.FromException<ArmOperation<ArmDeploymentResource>>(new OperationCanceledException(cancellationToken)); 2101public Task CancelAsync(string deploymentName, CancellationToken cancellationToken = default) 2105return Task.CompletedTask; 2118Task.FromResult<ArmOperation<ArmDeploymentResource>>(new CancelingArmDeploymentOperation()); 2120public Task CancelAsync(string deploymentName, CancellationToken cancellationToken = default) 2134Task.FromResult<ArmOperation<ArmDeploymentResource>>(new TestArmOperation<ArmDeploymentResource>( 2137public Task CancelAsync(string deploymentName, CancellationToken cancellationToken = default) => Task.CompletedTask;
AzureBicepResourceTests.cs (2)
173public async Task AssertManifestLayout() 217public async Task BicepResourceHasPipelineStepAnnotationWithCorrectConfiguration()
AzureContainerAppEnvironmentExtensionsTests.cs (21)
34public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureContainerAppEnvironmentResource() 55public async Task WithAzureLogAnalyticsWorkspace_RespectsExistingWorkspaceInDifferentResourceGroup() 142public async Task WithDelegatedSubnet_ConfiguresVnetConfiguration() 160public async Task AsExisting_PublishGeneratesThinModuleReferencingExistingEnvironment() 181public async Task AsExisting_WithExplicitContainerRegistry_PublishGeneratesThinModule() 206public async Task WithAcrPullIdentity_PublishGeneratesEnvWithSuppliedIdentity() 226public async Task WithAcrPullIdentity_AsExisting_PublishGeneratesThinModuleWithSuppliedIdentity() 257public async Task CrossResourceGroupRegistry_UsesStandaloneAcrPullIdentityForFinalRegistry() 292public async Task CrossSubscriptionRegistry_RoleModulePreservesSubscriptionAndResourceGroupScope() 313public async Task CrossResourceGroupRegistry_ThrowsTargetedErrorWhenGeneratedIdentityNameAlreadyExists() 334public async Task CrossResourceGroupRegistry_WithAzdNaming_PreservesIdentityName() 356public async Task CrossResourceGroupRegistry_WithCompactNaming_PreservesDefaultIdentityName() 387public async Task SameScopeExistingRegistry_KeepsInlineAcrPullIdentity() 406public async Task CrossResourceGroupRegistry_PreservesAcrPullIdentityAddedAfterEnvironment() 426public async Task MultipleEnvironments_SharingCrossScopeRegistry_EachGetDistinctStandaloneAcrPullIdentity() 461public async Task AsExisting_ThrowsWhenCombinedWithDelegatedSubnet() 482public async Task AsExisting_ThrowsWhenContainerAppDeclaresVolumeMount() 515public async Task AsExisting_ThrowsWhenCombinedWithAzureLogAnalyticsWorkspace() 539public async Task WithAzureContainerRegistry_PublishSucceeds_WhenDefaultRegistryIsRedundant() 578public async Task RunningTheDeploymentTargetHooksTwiceLeavesOneTargetPerEnvironment() 605private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken);
AzureContainerAppsTests.cs (92)
30public async Task AddContainerAppsInfrastructureAddsDeploymentTargetWithContainerAppToContainerResources() 59public async Task AddDockerfileWithAppsInfrastructureAddsDeploymentTargetWithContainerAppToContainerResources() 93public async Task AddContainerAppEnvironmentAddsDeploymentTargetWithContainerAppToProjectResources() 125public async Task EndpointReferenceToFoundryHostedAgentIsResolvedAcrossComputeEnvironments() 178public async Task AddExecutableResourceWithPublishAsDockerFileWithAppsInfrastructureAddsDeploymentTargetWithContainerAppToContainerResources() 220public async Task CanTweakContainerAppEnvironmentUsingPublishAsContainerAppOnExecutable() 251public async Task AddContainerAppsInfrastructureWithParameterReference() 293public async Task AddContainerAppsEntrypointAndArgs() 323public async Task ProjectWithManyReferenceTypes() 403public async Task ProjectWithManyReferenceTypesAndContainerAppEnvironment() 480public async Task AzureContainerAppsBicepGenerationIsIdempotent() 517public async Task AzureContainerAppsMapsPortsForBaitAndSwitchResources() 548public async Task PublishAsContainerAppInfluencesContainerAppDefinition() 582public async Task ConfigureCustomDomainMutatesIngress() 618public async Task ConfigureDuplicateCustomDomainMutatesIngress() 656public async Task ConfigureMultipleCustomDomainsMutatesIngress() 696public async Task VolumesAndBindMountsAreTranslation() 728public async Task MultipleVolumesHaveUniqueNamesInBicep() 772public async Task KeyVaultReferenceHandling() 812public async Task SecretOutputsThrowNotSupportedExceptionWithContainerAppEnvironmentResource() 864public async Task CanCustomizeWithProvisioningBuildOptions() 912public async Task ExternalEndpointBecomesIngress() 943public async Task FirstHttpEndpointBecomesIngress() 974public async Task EndpointWithHttp2SetsTransportToH2() 1006public async Task ProjectUsesTheTargetPortAsADefaultPortForFirstHttpEndpoint() 1037public async Task RoleAssignmentsWithAsExisting() 1082public async Task RoleAssignmentsWithAsExistingCosmosDB() 1126public async Task RoleAssignmentsWithAsExistingRedis() 1167public async Task NonHttpSchemeWithTcpTransportIsAllowed() 1183public async Task UnsupportedTransportThrows() 1202public async Task MultipleExternalEndpointsAreNotSupported() 1224public async Task ExternalNonHttpEndpointsAreNotSupported() 1244public async Task HttpAndTcpEndpointsCannotHaveTheSameTargetPort() 1265public async Task DefaultHttpIngressUsesPort80EvenWithDifferentDevPort() 1296public async Task DefaultHttpsIngressUsesPort443EvenWithDifferentDevPort() 1327public async Task ContainerWithTcpAndHttpEndpointsPublishesToAzureContainerApps() 1363public async Task CanPreserveHttpSchemeUsingWithHttpsUpgrade() 1394public async Task AddContainerAppEnvironmentDoesNotAddEnvironmentResourceInRunMode() 1412public async Task AddContainerAppEnvironmentAddsEnvironmentResource(bool useAzdNaming) 1446public async Task AddContainerAppEnvironmentWithCompactNamingPreservesUniqueString() 1476public async Task CompactNamingMultipleVolumesHaveUniqueNames() 1506public async Task AddContainerAppEnvironmentWorksWithSqlServer() 1529public async Task ContainerAppEnvironmentWithCustomRegistry() 1580public async Task ContainerAppEnvironmentWithCustomWorkspace() 1631public async Task CanReferenceContainerAppEnvironment() 1658public async Task ContainerAppEnvironmentWithDashboardEnabled() 1680public async Task ContainerAppEnvironmentWithDashboardDisabled() 1702public async Task UnknownManifestExpressionProviderIsHandledWithAllocateParameter() 1754public async Task ContainerAppWithUppercaseName_ShouldUseLowercaseInManifest() 1801public async Task PublishAsAzureContainerApp_ThrowsIfNoEnvironment() 1803static async Task RunTest(Action<IDistributedApplicationBuilder> action) 1845public async Task ValidateAzureContainerApps_DoesNotThrowInRunMode() 1868public async Task MultipleAzureContainerAppEnvironmentsSupported() 1894public async Task MultipleAzureContainerAppEnvironmentsGenerateDistinctManagedEnvironmentNames() 1948public async Task MultipleAzureContainerAppEnvironmentsShareManagedEnvironmentNameByDefault() 1988public async Task MultipleAzureContainerAppEnvironmentsWithCollidingLegacyNamesFailPublish() 2018public async Task ExcludedAzureContainerAppEnvironmentDoesNotParticipateInCollisionValidation() 2040public async Task DirectlyAddedAzureContainerAppEnvironmentDoesNotRequireContainerAppsValidationStep() 2052public async Task WithUniqueResourceNamingPreservesDigitsInManagedEnvironmentName() 2080public async Task WithUniqueResourceNamingComputesNameLikeStandardAzureResourceNaming() 2110public async Task ConfiguredNameResolverWinsOverManagedEnvironmentNameFallback() 2138public async Task ConfiguredNameResolverPreventsFalseLegacyCollision() 2164public async Task UniqueNamingCollisionSuggestsRenamingOrExplicitResolver() 2193public async Task AzdNamingCollisionSuggestsRemovingAzdNamingOrExplicitNames() 2222public async Task MixedAzdAndUniqueNamingDetectsEquivalentPhysicalNames() 2256public async Task WithCompactResourceNamingGeneratesDistinctManagedEnvironmentNames() 2314public async Task PublishAsContainerAppJobInfluencesContainerAppDefinition() 2343public async Task PublishAsContainerAppJob_WorksForProjectResource() 2365public async Task PublishAsContainerAppJob_ThrowsIfBothCustomizationsAreApplied() 2379public async Task PublishAsContainerAppJob_ThrowsForAzureFunctions() 2417public async Task CanMixContainerAppsAndJobsInSameManifest() 2455public async Task PublishAsScheduledAzureContainerAppJobConfiguresScheduleTrigger() 2490public async Task PublishAsAzureContainerAppJobParameterlessConfiguresManualTrigger() 2515public async Task ResourceWithProbes_HttpEndpoint() 2557public async Task ResourceWithProbes_HttpEndpoint_TargetPort() 2597public async Task ResourceWithProbes_HttpsEndpoint_TargetPort_MatchIngress() 2637public async Task BuildOnlyContainerResource_DoesNotGetDeployed() 2675public async Task BindMountNamesWithHyphensAreNormalized() 2710public async Task GetHostAddressExpression() 2739public async Task GetEndpointPropertyExpression_ReturnsContainerAppEndpointPropertyExpression(EndpointProperty property, string expected) 2759public async Task ContainerAppProvisionDependsOnTargetPushStep() 2782public async Task EnvironmentCreatesDefaultAcrWhenNoExplicitRegistry() 2804public async Task DefaultAcrNotAddedToModelWhenExplicitRegistryExists() 2826public async Task EnvironmentDelegatesToAssociatedRegistry() 2844public async Task DefaultContainerRegistryUsesAzdNamingWhenEnvironmentDoes() 2870public async Task MultipleComputeEnvironmentsOnlyProcessTargetedResources() 2945public async Task RedisWithConditionalConnectionString() 2975public async Task RedisWithTlsEnabledConditionalConnectionString() 3006public async Task ConditionalExpressionWithParameterCondition() 3046public async Task ConditionalBranchWithParameterReference() 3087public async Task NestedConditionalExpressions() 3136public async Task WithDashboardControlsDashboardUrlPrintStep(bool enableDashboard)
AzureContainerRegistryTests.cs (13)
19public async Task AddAzureContainerRegistry_AddsResourceAndImplementsIContainerRegistry() 40public async Task WithRegistry_AttachesContainerRegistryReferenceAnnotation() 59public async Task AddAzureContainerRegistry_GeneratesCorrectManifestAndBicep() 72public async Task WithRoleAssignments_GeneratesCorrectRoleAssignmentBicep() 113public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureContainerRegistryResource() 134public async Task AzureContainerRegistryHasLoginStep() 164public async Task LoginStepRequiredByPushPrereq() 193public async Task AzureContainerRegistryHasProvisionStep() 233public async Task WithPurgeTask_GeneratesCorrectBicep() 246public async Task WithPurgeTask_MultipleTasks_GeneratesUniqueNames() 260public async Task WithPurgeTask_CustomTaskName_UsedInBicep() 321public async Task WithPurgeTask_DuplicateTaskName_Throws() 333public async Task WithPurgeTask_WithHoursAndMinutesAgo_FormatsCorrectly()
AzureCosmosDBEmulatorFunctionalTests.cs (5)
25public async Task VerifyWaitForOnCosmosDBEmulatorBlocksDependentResources(bool useClassic) 46var pendingStart = app.StartAsync(cts.Token); 67public async Task VerifyCosmosResource(bool useClassic) 137public async Task WithDataVolumeShouldPersistStateBetweenUsages(bool useClassic) 273public async Task AddAzureCosmosDB_RunAsEmulator_CreatesDatabase()
AzureCosmosDBExtensionsTests.cs (35)
69public async Task AddAzureCosmosDBWithPartitionCountCanOverrideNumberOfPartitions(int partitionCount) 191public async Task AddAzureCosmosDB(bool useAcaInfrastructure) 245public async Task AddAzureCosmosDatabase_WorksWithAccessKeyAuth_ChildResources() 267public async Task AddAzureCosmosDBEmulator() 288public async Task AddAzureCosmosDBClassicEmulator() 309public async Task AddAzureCosmosDB_WithAccessKeyAuthentication_NoKeyVaultWithEmulator() 326public async Task AddAzureCosmosDBViaRunMode_WithAccessKeyAuthentication(string? kvName) 369return Task.FromResult<string?>(null); 372return Task.FromResult<string?>(value); 393public async Task AddAzureCosmosDBViaRunMode_NoAccessKeyAuthentication() 438public async Task AddAzureCosmosDBViaPublishMode_WithAccessKeyAuthentication(string? kvName) 473return Task.FromResult<string?>(null); 476return Task.FromResult<string?>(value); 497public async Task AddAzureCosmosDBViaPublishMode_NoAccessKeyAuthentication() 538public async Task AddAzureCosmosDBViaPublishMode_WithDefaultAzureSku() 588public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureCosmosDBResource() 664public async Task RunAsEmulatorHttpsCertificateCallbackSetsExpectedEnvironmentVariables() 699public async Task RunAsEmulatorCertificateTrustCallbackSetsNodeExtraCaCerts() 731public async Task RunAsEmulatorHttpsCertificateCallbackSetsPasswordWhenProvided() 767public async Task RunAsEmulatorSwitchesEndpointToHttpsWhenCertificateAvailable() 798public async Task RunAsEmulatorKeepsHttpWhenNoCertificateAvailable() 830public async Task WithDataExplorerSwitchesEndpointToHttpsWhenCertificateAvailable() 859public async Task WithDataExplorerKeepsHttpWhenNoCertificateAvailable() 930public async Task WithDataVolumeOnVNextEmulatorUsesDataPathWithoutPersistenceEnvVar() 949public async Task WithDataVolumeOnClassicEmulatorUsesAppDataPathWithPersistenceEnvVar() 989public async Task WithDataExplorerExposesCustomPortAndEnablesExplorer() 1023public async Task RunAsEmulatorDisablesDataExplorerByDefault() 1036public async Task RunAsClassicEmulatorDoesNotSetEnableExplorer() 1087public async Task WithPartitionCountAcceptsBoundaryValues(int count) 1112public async Task RunAsEmulatorResourceReadyThrowsWhenCosmosClientNotInitialized() 1127public async Task RunAsEmulatorConnectionStringAvailableInitializesCosmosClient() 1202public async Task RunAsClassicEmulatorHealthCheckThrowsBeforeCosmosClientInitialized() 1221public async Task RunAsEmulatorMarksHealthEndpointUrlAsDetailsOnly() 1246public async Task WithDataExplorerSetsDataExplorerDisplayText() 1271private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken);
AzureDeployerTests.cs (64)
40public async Task DeployAsync_PromptsViaInteractionService() 53var runTask = Task.Run(app.Run); 134public async Task DeployAsync_WithBuildOnlyContainers() 196public async Task DeployAsync_WithAzureStorageResourcesWorks() 254public async Task DeployAsync_WithContainer_Works() 314public async Task DeployAsync_WithDockerfile_Works() 380public async Task DeployAsync_WithProjectResource_Works() 446public async Task DeployAsync_WithContainerAppExternalEndpoint_IncludesPortalLinksInSummary() 502public async Task DeployAsync_WithAppServiceExternalEndpoint_IncludesPortalLinksInSummary() 565public async Task DeployAsync_WithMultipleComputeEnvironments_Works(string step) 684public async Task Diagnostics_CrossScopeAcrPullRoleModulesPrecedeTargetedWorkloadProvisioning() 738public async Task DeployAsync_WithUnresolvedParameters_PromptsForParameterValues() 751var runTask = Task.Run(app.Run); 778public async Task DeployAsync_WithResolvedParameters_SkipsPrompting() 800public async Task DeployAsync_WithCustomInputGeneratorParameter_RespectsInputGenerator() 822var runTask = Task.Run(app.Run); 853public async Task DeployAsync_WithSingleRedisCache_CallsDeployingComputeResources() 917public async Task DeployAsync_WithOnlyAzureResources_PrintsDashboardUrl() 976public async Task DeployAsync_WithGeneratedParameters_DoesNotPromptsForParameterValues() 996public async Task DeployAsync_WithParametersInEnvironmentVariables_DiscoversAndPromptsForParameters() 1014var runTask = Task.Run(app.Run); 1041public async Task DeployAsync_WithParametersInArguments_DiscoversAndPromptsForParameters() 1059var runTask = Task.Run(app.Run); 1086public async Task DeployAsync_WithAzureFunctionsProject_Works() 1202public async Task DeployAsync_WithAzureResourceDependencies_DoesNotHang(string step) 1272public async Task DeployAsync_WithRedisAccessKeyAuthentication_CreatesCorrectDependencies() 1329public async Task DeployAsync_WithFoundryAndAzureContainerApps_CreatesCorrectDependencies() 1359public async Task DeployAsync_WithPrivateEndpoints_CreatesCorrectDependencies() 1404public async Task DeployAsync_WithAzureResourcesAndNoEnvironment_Fails() 1427public async Task DeployAsync_WithRequestFailedException_DoesNotIncludeVerboseHttpDetails() 1534=> Task.FromResult(new DeploymentStateSection(sectionName, [], 0)); 1536public Task DeleteSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) => Task.CompletedTask; 1538public Task SaveSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) => Task.CompletedTask; 1540public Task ClearAllStateAsync(CancellationToken cancellationToken = default) => Task.CompletedTask; 1547return Task.FromResult(true); 1550public Task GetOrCreateResourceAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken) 1552return Task.CompletedTask; 1557return Task.FromResult(false); 1565return Task.FromResult(false); 1568public Task GetOrCreateResourceAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken) 1582return Task.FromResult(false); 1637public async Task DeployAsync_FirstDeployment_SavesStateToFile() 1678public async Task DeployAsync_WithCachedDeploymentState_LoadsFromCache() 1726public async Task DeployAsync_WithClearCacheFlag_DoesNotSaveState() 1758public async Task DeployAsync_WithStagingEnvironment_UsesStagingStateFile() 1799public async Task DeployAsync_WithSavedParameters_ReloadsAllParameterTypesFromDeploymentState() 1842var runTask = Task.Run(app.Run); 1902var runTask = Task.Run(() => app.RunAsync(cts.Token)); 1905await Task.Delay(TimeSpan.FromSeconds(1)); 1980public async Task DestroyAsync_WithAzureState_DeletesResourceGroup() 2011public async Task DestroyAsync_WithNoAzureState_ReportsNothingToDestroy() 2032public async Task DestroyAsync_NonInteractiveWithoutYes_FailsFast() 2060public async Task DeployAsync_FailingTokenCredential_ShowsLoginMessage() 2085public async Task DeployAsync_ValidTokenCredential_ShowsSuccessMessage()
AzureEnvironmentResourceExtensionsTests.cs (173)
171public async Task ChangeAzureContextCommand_DynamicArgumentsLoadAzureContextOptions() 227public async Task ChangeAzureContextCommand_TenantChangeReloadsSubscriptionOptionsForSelectedTenant() 272public async Task ChangeAzureContextCommand_CustomResourceGroupEnablesLocationChoices() 304public async Task ResetProvisioningStateCommand_ClearsCachedStateAndResetsSnapshots() 393public async Task ResetProvisioningStateCommand_ReentersProvisioningAndPromptsWhenAzureConfigMissing() 434public async Task MissingAzureContextNotification_ReappearsWhenConfigureDialogIsCanceled() 481public async Task EnsureProvisionedAsync_UsesControllerProvisioningFlow() 502public async Task EnsureProvisionedAsync_CompletesExistingPendingProvisioningWaiters() 531public async Task RunModeInitializeResource_ProvisionsAzureResourcesAfterPrepareStep() 575public async Task EnsureProvisioned_UsesCachedStateWhenMissingResourceProbeCannotAuthenticate() 611public async Task EnsureProvisioned_UsesCachedStateWhenMissingResourceProbeFailsTransiently() 640public async Task OnBeforeStartAsync_AddsPerResourceCommandsToDeployableAzureResourcesOnly() 690public async Task ChangeLocationCommand_IsHiddenForKeyVaultResources() 718public async Task ChangeLocationCommand_IsEnabledForResourcesWithImplicitKeyVaultChildren() 766public async Task GetAzureResourceCommand_ReturnsCachedDeploymentStateAndLiveStatus() 878public async Task GetAzureResourceCommand_ReturnsMissingLiveResourceReasonWhenCachedResourceDoesNotExist() 1155public async Task GetAzureResourceCommand_ReturnsMissingResourceIdReasonWhenCachedStateHasNoOutputId() 1211public async Task GetAzureResourceCommand_ReturnsStructuredRequestFailureWhenLiveProbeFails() 1272public async Task GetAzureResourceCommand_ReturnsCredentialUnavailableReasonWhenLiveProbeCannotAuthenticate() 1327public async Task CancelCommand_RetriesStateConflictAndMarksCachedDeploymentCanceled() 1390public async Task CancelCommand_IsEnabledDuringActiveDeploymentOperation() 1413var provisioningTask = controller.EnsureProvisionedAsync(model, CancellationToken.None); 1434public async Task CancelCommand_FastPathCancelsDuringActiveOperation() 1490var provisioningTask = controller.EnsureProvisionedAsync(model, CancellationToken.None); 1524public async Task MutatingResourceCommands_FailFastDuringConflictingActiveOperation() 1582public async Task MutatingResourceCommands_FailFastDuringConflictingQueuedOperation() 1642public async Task CancelCommand_IsHiddenWhenResourceIsNotWaitingForDeployment() 1674public async Task CancelCommand_DoesNotMarkCompletedDeploymentCanceled() 1728public async Task DeleteAzureResourceCommand_DeletesCachedOutputAndDeploymentOperationTargets() 1834public async Task DeleteAzureResourceCommand_SucceedsWhenKeyVaultPurgeTimesOutAfterDelete() 1913public async Task DeleteAzureResourceCommand_UpdatesCommandStatesWhileOperationIsActive() 1989public async Task DeleteAzureResourceCommand_PublishesCanceledWhenOperationIsCanceled() 2067public async Task ForgetStateCommand_ClearsOnlyTargetedResourceStateAndSnapshots() 2146public async Task ReprovisionCommand_ReprovisionsOnlyTargetedResource() 2205public async Task ReprovisionCommand_UpdatesCommandStatesWhileOperationIsActive() 2268public async Task ReprovisionCommand_ReenablesCommandStatesWhenOperationFails() 2326public async Task QueuedOperation_CancelledDuringInitialCommandStateRefreshCompletesAndReenablesCommands() 2347public async Task MutatingResourceCommands_ExecuteSequentiallyWhenInvokedConcurrently() 2407public async Task CancelCommand_FastPathCancelsActiveOperation() 2495public async Task CancelCommand_DoesNotMarkCompletedSiblingsCancelingDuringAllResourceOperation() 2532var provisioningTask = controller.EnsureProvisionedAsync(model, CancellationToken.None); 2569public async Task CancelCommand_FailsWhenNoOperationOrDeploymentIsActive() 2605public async Task CancelCommand_DoesNotCancelUnaffectedActiveOperation() 2679public async Task ChangeLocationCommand_UpdatesCommandStatesWhileOperationIsActive() 2753public async Task ChangeLocationCommand_PersistsOverrideAndReprovisionsTargetedResource() 2808public async Task ChangeLocationCommand_WithArguments_DoesNotPromptAndReturnsJsonResult() 2865public async Task ChangeLocationCommand_ForAnnotatedResource_PersistsOverrideUnderBicepResourceName() 2916public async Task ChangeLocationCommand_UsesPersistedAzureContextForSelectableLocations() 2984public async Task ChangeLocationCommand_RequiresConfirmationBeforeDeletingCachedResource() 3049public async Task ChangeLocationCommand_DeletesCachedResourceBeforeReprovisioningNewLocation() 3110public async Task ChangeLocationCommand_DeletesCachedResourceUsingPersistedLocationWhenSnapshotLocationIsMissing() 3174public async Task ChangeLocationCommand_UsesRequestedLocationWhenChangingExistingOverride() 3239public async Task ChangeLocationCommand_TreatsDeletedCachedResourceAsAlreadyAbsent() 3301public async Task ChangeLocationCommand_DoesNotRequireConfirmationWhenCachedResourceIsAlreadyAbsent() 3366public async Task ReprovisionAllCommand_PreservesAzureContextState() 3423public async Task ChangeAzureContextCommand_WithArguments_PersistsContextAndReturnsJsonResult() 3493public async Task ChangeAzureContextCommand_WithArgumentsWithoutTenant_ClearsPersistedTenant() 3542public async Task ChangeAzureContextCommand_FailsWhenLocationChangeWouldReprovisionKeyVault() 3587public async Task ChangeAzureContextCommand_DoesNotInferResourceLocationOverrides() 3641public async Task ReprovisionAllCommand_NormalizesPersistedLocationOverride() 3682public async Task ReprovisionAllCommand_PreservesLocationOverrideFromPersistedParameters() 3728public async Task ReprovisionResourceCommand_PreservesInMemoryLocationOverrideWhenCachedStateIsMissing() 3787public async Task ForgetResourceStateCommand_ClearsInMemoryLocationParameter() 3825public async Task ReprovisionResourceCommand_FailsWhenProvisioningFails() 3861public async Task ReprovisionResourceCommand_PurgesDeletedKeyVaultAndRetriesWhenSoftDeleteConflictOccurs() 3940public async Task ReprovisionResourceCommand_FailsWithDiagnosticWhenSoftDeleteConflictTombstoneIsNotDiscoverable() 4047public async Task ReprovisionResourceCommand_ProvisionsImplicitKeyVaultBeforePasswordAuthenticatedPostgres() 4099public async Task ChangeLocationCommand_FailsWhenProvisioningFails() 4147public async Task ChangeLocationCommand_FailsForKeyVaultWithoutProvisioning(bool includeLocationArgument) 4189public async Task ReprovisionCommand_ReturnsStructuredProviderFailureDetailsWhenProvisioningFails() 4264public async Task ResourceCommandCancellation_ReturnsCanceledResult() 4299public async Task CheckForDriftAsync_MarksResourceMissingInAzure() 4347public async Task CheckForDriftAsync_LeavesRunningResourcesWhenAzureResourcesStillExist() 4393public async Task CheckForDriftAsync_MarksOnlyMissingResourceWhenOtherAzureResourcesStillExist() 4456public async Task CheckForDriftAsync_SkipsResourcesWithoutCachedResourceIds() 4495public async Task DeleteAzureResourcesCommand_DeletesCurrentResourceGroupAndPreservesAzureContextState() 4551public async Task DeleteAzureResourcesCommand_DoesNotDeleteConfiguredResourceGroupWhenPersistedContextIsMissing() 4596public async Task DeleteAzureResourcesCommand_TreatsMissingResourceGroupAsSuccessAndClearsState() 4642public async Task DeleteAzureResourcesCommand_PublishesFailureWhenResourceGroupDeleteFails() 4692public async Task EnsureProvisioned_WaitsForReferencedAzureResources() 4713var reprovisionTask = controller.EnsureProvisionedAsync(model, CancellationToken.None); 4728public async Task EnsureProvisioned_FaultsDependentsWhenDependencyProvisioningFails() 4759public async Task EnsureProvisioned_PublishesCanceledWhenFastPathCanceledDeploymentFaults() 4801var provisioningTask = controller.EnsureProvisionedAsync(model, CancellationToken.None); 4834public async Task EnsureProvisioned_AddsFailedResourceBreadcrumbsToAzureEnvironment() 5013private static Task LoadInputAsync(IServiceProvider services, InteractionInputCollection inputs, InteractionInput input) 5124private static async Task WaitForSignalBeforeOperationCompletesAsync(Task signalTask, Task operationTask, string completionMessage) 5127Task completedTask; 5131completedTask = await Task.WhenAny(signalTask, operationTask).WaitAsync(watchdog.Token).ConfigureAwait(false); 5153private static async Task WaitForResourceStateAsync(ResourceNotificationService notifications, string resourceName, string expectedState) 5166await Task.Delay(TimeSpan.FromMilliseconds(20), watchdog.Token).ConfigureAwait(false); 5247return Task.FromResult<(ISubscriptionResource, ITenantResource)>((subscription, tenant)); 5253return Task.FromResult(result); 5259return Task.FromResult(result); 5269return Task.FromResult(result); 5277return Task.FromResult<ISubscriptionResource>(subscription); 5282return Task.FromResult<IEnumerable<(string Name, string DisplayName)>>(_locations); 5292return Task.FromResult(result); 5296=> Task.FromResult<IEnumerable<string>>([]); 5304public Task DeleteResourceAsync(string resourceId, CancellationToken cancellationToken = default) 5310public Task CancelDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default) 5318await Task.CompletedTask; 5327await Task.CompletedTask; 5383return Task.FromResult(new DeploymentStateSection(sectionName, data, version: 0)); 5386public Task DeleteSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 5393return Task.CompletedTask; 5396public Task SaveSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 5410return Task.CompletedTask; 5413public Task ClearAllStateAsync(CancellationToken cancellationToken = default) 5420return Task.CompletedTask; 5476return Task.FromResult(false); 5479public Task GetOrCreateResourceAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken) 5491return Task.CompletedTask; 5495=> Task.FromResult(false); 5508return Task.FromResult(true); 5511public Task GetOrCreateResourceAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken) 5514return Task.CompletedTask; 5518=> Task.FromResult(false); 5540return Task.FromResult(_context); 5546public Task<bool> EnsureProvisioningOptionsAsync(bool forcePrompt, CancellationToken cancellationToken = default) => Task.FromResult(true); 5558public Task PersistProvisioningOptionsAsync(CancellationToken cancellationToken = default) => Task.CompletedTask; 5599public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false); 5602=> Task.FromResult(false); 5604public async Task GetOrCreateResourceAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken) 5629public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false); 5632=> Task.FromResult(false); 5634public async Task GetOrCreateResourceAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken) 5649public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false); 5652=> Task.FromResult(false); 5654public async Task GetOrCreateResourceAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken) 5666public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false); 5669=> Task.FromResult(false); 5671public Task GetOrCreateResourceAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken) 5672=> Task.FromException(_exception); 5683public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false); 5686=> Task.FromResult(false); 5688public async Task GetOrCreateResourceAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken) 5709public Task<bool> ConfigureResourceAsync(AzureBicepResource resource, CancellationToken cancellationToken) => Task.FromResult(false); 5712=> Task.FromResult(false); 5714public Task GetOrCreateResourceAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken) 5733return Task.FromException(new AzureProvisioningFailureException(failure, new InvalidOperationException("Key Vault is soft-deleted."))); 5737return Task.CompletedTask; 5766=> Task.FromResult(false); 5769=> Task.FromResult(false); 5771public async Task GetOrCreateResourceAsync(AzureBicepResource resource, ProvisioningContext context, CancellationToken cancellationToken) 5839=> Task.FromResult<IEnumerable<string>>([]); 5847public Task DeleteResourceAsync(string resourceId, CancellationToken cancellationToken = default) 5853public Task CancelDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default) 5861await Task.CompletedTask; 5870await Task.CompletedTask; 5924=> Task.FromResult<IEnumerable<string>>([]); 5930=> Task.FromResult(true); 5932public async Task DeleteResourceAsync(string resourceId, CancellationToken cancellationToken = default) 5944=> Task.FromResult(true); 5946public Task CancelDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default) 5947=> Task.CompletedTask; 5954await Task.CompletedTask; 5963await Task.CompletedTask; 6001=> Task.FromResult<IEnumerable<string>>([]); 6007=> Task.FromException<bool>(new global::Azure.Identity.CredentialUnavailableException("Credential unavailable.")); 6009public Task DeleteResourceAsync(string resourceId, CancellationToken cancellationToken = default) 6015public Task CancelDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default) 6029await Task.CompletedTask; 6075=> Task.FromException<bool>(exception); 6077public Task DeleteResourceAsync(string resourceId, CancellationToken cancellationToken = default) 6083public Task CancelDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default) 6137=> Task.FromResult(string.Equals(resourceId, existingResourceId, StringComparison.OrdinalIgnoreCase)); 6139public Task DeleteResourceAsync(string resourceId, CancellationToken cancellationToken = default) 6141? Task.FromException(deleteException) 6147public Task CancelDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default)
AzureEnvironmentResourceTests.cs (8)
17public async Task WhenUsedWithAzureContainerAppsEnvironment_GeneratesProperBicep() 49public async Task WhenUsedWithAzureContainerAppsEnvironment_RespectsStronglyTypedProperties() 81public async Task PublishAsync_GeneratesMainBicep_WithSnapshots() 130public async Task AzurePublishingContext_CapturesParametersAndOutputsCorrectly_WithSnapshot() 178public async Task AzurePublishingContext_WritesScopedModuleExpressions() 231public async Task AzurePublishingContext_IgnoresAzureBicepResourcesWithIgnoreAnnotation() 266public async Task PublishAsync_WithDockerfileFactory_WritesDockerfileToOutputFolder() 297static async Task RunTest(string workspace)
AzureEventHubsExtensionsTests.cs (10)
25public async Task VerifyWaitForOnEventHubsEmulatorBlocksDependentResources() 46var pendingStart = app.StartAsync(cts.Token); 66public async Task VerifyAzureEventHubsEmulatorResource(bool referenceHub, string? hubName) 116public async Task AzureEventHubsHealthChecksUsesSettingsEventHubName(bool useSettings) 281public async Task CanSetHubAndConsumerGroupName() 305public async Task AzureEventHubsEmulatorResourceInitializesProvisioningModel() 337public async Task AzureEventHubsEmulatorResourceGeneratesConfigJson() 391public async Task AzureEventHubsEmulatorResourceGeneratesConfigJsonWithCustomizations() 449public async Task AzureEventHubsEmulator_WithConfigurationFile() 671public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureEventHubsResource()
AzureFrontDoorTests.cs (6)
61public async Task AddAzureFrontDoorWithSingleOriginGeneratesBicep() 88public async Task AddAzureFrontDoorWithMultipleOriginsGeneratesBicep() 115public async Task AddAzureFrontDoorThrowsWhenOriginHasNoExternalEndpoints() 163public async Task HealthProbePathUsesResourceProbeAnnotation() 187public async Task HealthProbePathDefaultsToSlashWhenNoProbeAnnotation() 210public async Task WithOriginSkipsNonHttpEndpoints()
AzureFunctionsTests.cs (15)
28public async Task AddAzureFunctionsProject_Works() 53public async Task AddAzureFunctionsProject_WiresUpHttpEndpointCorrectly_WhenPortArgumentIsProvided() 74public async Task AddAzureFunctionsProject_WiresUpHttpEndpointCorrectly_WhenPortArgumentIsNotProvided() 159public async Task AddAzureFunctionsProject_RemoveDefaultHostStorageWhenUseHostStorageIsUsed() 186public async Task AddAzureFunctionsProject_WorksWithMultipleProjects() 231public async Task AddAzureFunctionsProject_ConfiguresEnvironmentVariables_WhenInPublishMode() 253public async Task AddAzureFunctionsProject_WiresUpHttpsEndpointCorrectly_WhenOnlyUseHttpsArgumentIsProvided() 284public async Task WithReferenceDispatchesAzureFunctionsSpecificConfiguration() 308public async Task AddAzureFunctionsProject_CanGetStorageManifestSuccessfully() 338public async Task AddAzureFunctionsProject_WorksWithAddAzureContainerAppsInfrastructure() 366public async Task AddAzureFunctionsProject_WorksWithAddAzureContainerAppsInfrastructure_WithHostStorage() 394public async Task AddAzureFunctionsProject_WorksWithAddAzureContainerAppsInfrastructure_WithHostStorage_WithRoleAssignments() 423public async Task MultipleAddAzureFunctionsProject_WorksWithAddAzureContainerAppsInfrastructure_WithHostStorage_WithRoleAssignments() 691public async Task AddAzureFunctionsProject_WithProjectPath_ConfiguresEnvironmentVariables() 744public async Task AddAzureFunctionsProject_WithProjectPath_CanUseCustomHostStorage()
AzureInfrastructureExtensionsTests.cs (3)
13public async Task AddAzureInfrastructureGeneratesCorrectManifestEntry() 33public async Task AssignParameterPopulatesParametersEverywhere() 72public async Task AssignParameterWithSpecifiedNamePopulatesParametersEverywhere()
AzureKeyVaultTests.cs (14)
15public async Task AddKeyVaultViaRunMode() 29public async Task AddKeyVaultViaPublishMode() 49public async Task WithEnvironment_AddsKeyVaultSecretReference() 59return Task.FromResult<string?>("my secret value"); 92public async Task ConsumingAKeyVaultSecretInAnotherBicepModule() 128public async Task ConsumingSecretsFromExistingKeyVaultInAnotherBicepModule_WithParameters() 170public async Task ConsumingSecretsFromExistingKeyVaultInAnotherBicepModule_WithLiterals() 229public async Task AddSecret_WithParameterResource_GeneratesCorrectBicep() 244public async Task AddSecret_WithReferenceExpression_GeneratesCorrectBicep() 273public async Task AddSecret_WithMultipleSecrets_GeneratesCorrectBicep() 370public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureKeyVaultResource() 417public async Task EmulatorSupport_ConnectionStringUsesEmulatorEndpointWhenIsEmulator() 452public async Task ConnectionStringRedirectAnnotation_RedirectsConnectionString() 473public async Task ConnectionStringRedirectAnnotation_TakesPrecedenceOverEmulator()
AzureKustoExtensionsTests.cs (2)
14public async Task AddAzureKustoCluster() 53public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureKustoClusterResource()
AzureLogAnalyticsWorkspaceExtensionsTests.cs (2)
11public async Task AddLogAnalyticsWorkspace() 48public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureLogAnalyticsWorkspaceResource()
AzureManagedRedisExtensionsTests.cs (6)
22public async Task AddAzureManagedRedis(bool useAcaInfrastructure) 47public async Task AddAzureManagedRedisRunAsContainerProducesCorrectConnectionString() 69public async Task AddAzureManagedRedisRunAsContainerProducesCorrectHostAndPassword() 143public async Task AddAzureManagedRedisWithAutoGeneratedPasswordProducesCorrectValues() 205public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureRedisCacheResource() 227public async Task AddAzureManagedRedisWithAccessKeyAuthentication(string? kvName)
AzureManifestUtils.cs (2)
48public static async Task VerifyAllAzureBicep(IDistributedApplicationBuilder builder) 76public static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken);
AzureNatGatewayExtensionsTests.cs (3)
35public async Task AddNatGateway_GeneratesCorrectBicep() 47public async Task AddNatGateway_WithExplicitPublicIP_GeneratesCorrectBicep() 86public async Task AddPublicIPAddress_GeneratesCorrectBicep()
AzureNetworkSecurityGroupExtensionsTests.cs (9)
38public async Task AddNetworkSecurityGroup_GeneratesCorrectBicep() 53public async Task AddNetworkSecurityGroup_WithSecurityRules_GeneratesCorrectBicep() 86public async Task AddNetworkSecurityGroup_WithSecurityRules_GeneratesCorrectNsgModuleBicep() 116public async Task AddSubnet_WithNetworkSecurityGroup_GeneratesCorrectBicep() 142public async Task AddNetworkSecurityGroup_SharedAcrossSubnets_GeneratesCorrectBicep() 218public async Task MultipleNSGs_WithSameRuleName_GeneratesDistinctBicepIdentifiers() 276public async Task AddNetworkSecurityGroup_ExistingWithSecurityRules_GeneratesCorrectBicep() 299public async Task AddNetworkSecurityGroup_WithSourceAddressPrefixReference_GeneratesCorrectBicep() 321public async Task AddNetworkSecurityGroup_WithDestinationAddressPrefixReference_GeneratesCorrectBicep()
AzureNetworkSecurityPerimeterExtensionsTests.cs (6)
38public async Task AddNetworkSecurityPerimeter_GeneratesCorrectBicep() 50public async Task AddNetworkSecurityPerimeter_WithAccessRules_GeneratesCorrectBicep() 74public async Task AddNetworkSecurityPerimeter_WithSubscriptionRule_GeneratesCorrectBicep() 92public async Task AddNetworkSecurityPerimeter_WithParameterBasedAccessRules_GeneratesCorrectBicep() 129public async Task AddNetworkSecurityPerimeter_WithStorageAssociation_GeneratesCorrectBicep() 144public async Task AddNetworkSecurityPerimeter_WithMultipleAssociations_GeneratesCorrectBicep()
AzureOpenAIExtensionsTests.cs (2)
20public async Task AddAzureOpenAI(bool overrideLocalAuthDefault, bool useObsoleteApis) 251public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureOpenAIResource()
AzurePostgresExtensionsTests.cs (13)
21public async Task AddAzurePostgresFlexibleServer(bool publishMode, bool useAcaInfrastructure) 54public async Task AddAzurePostgresFlexibleServer_WithPasswordAuthentication_NoKeyVaultWithContainer() 76public async Task AddAzurePostgresWithPasswordAuth(bool specifyUserName, bool specifyPassword, string? kvName) 108public async Task AddAzurePostgresFlexibleServerRunAsContainerProducesCorrectConnectionString(bool addDbBeforeRunAsContainer) 148public async Task AddAzurePostgresFlexibleServerRunAsContainerProducesCorrectUserNameAndPasswordAndHost(bool addDbBeforeRunAsContainer) 220public async Task WithPasswordAuthenticationBeforeAfterRunAsContainer(bool before) 311public async Task AddAzurePostgresFlexibleServerWithAutoGeneratedParametersProducesCorrectValues() 360public async Task WithPostgresMcpOnAzureDatabaseRunAsContainerAddsMcpResource() 428public async Task AsAzurePostgresFlexibleServerViaRunMode() 471public async Task AsAzurePostgresFlexibleServerViaPublishMode() 514public async Task PublishAsAzurePostgresFlexibleServer() 553public async Task PublishAsAzurePostgresFlexibleServerNoUserPassParams() 632public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzurePostgresFlexibleServerResource()
AzurePrivateEndpointExtensionsTests.cs (4)
68public async Task AddPrivateEndpoint_GeneratesBicep() 85public async Task AddPrivateEndpoint_ForQueues_GeneratesBicep() 148public async Task AddPrivateEndpoint_ReusesDnsZone_ForSameZoneName() 213public async Task AddPrivateEndpoint_CreatesMultipleDnsZones_ForMultiZoneTarget()
AzurePrivateEndpointLockdownTests.cs (14)
13public async Task AddAzureCosmosDB_WithPrivateEndpoint_GeneratesCorrectBicep() 29public async Task AddAzureSqlServer_WithPrivateEndpoint_GeneratesCorrectBicep() 45public async Task AddAzurePostgresFlexibleServer_WithPrivateEndpoint_GeneratesCorrectBicep() 61public async Task AddAzureManagedRedis_WithPrivateEndpoint_GeneratesCorrectBicep() 77public async Task AddAzureServiceBus_WithPrivateEndpoint_GeneratesCorrectBicep() 93public async Task AddAzureEventHubs_WithPrivateEndpoint_GeneratesCorrectBicep() 109public async Task AddAzureKeyVault_WithPrivateEndpoint_GeneratesCorrectBicep() 125public async Task AddAzureAppConfiguration_WithPrivateEndpoint_GeneratesCorrectBicep() 141public async Task AddAzureSearch_WithPrivateEndpoint_GeneratesCorrectBicep() 157public async Task AddAzureSignalR_WithPrivateEndpoint_GeneratesCorrectBicep() 173public async Task AddAzureWebPubSub_WithPrivateEndpoint_GeneratesCorrectBicep() 189public async Task AddAzureOpenAI_WithPrivateEndpoint_GeneratesCorrectBicep() 205public async Task AddFoundry_WithPrivateEndpoint_GeneratesCorrectBicep() 221public async Task AddAzureContainerRegistry_WithPrivateEndpoint_GeneratesCorrectBicep()
AzureProvisioningResourceExtensionsTests.cs (1)
13public async Task AsProvisioningParameterTests()
AzureProvisioningResourceTests.cs (4)
15public async Task PublishAsAzureContainerApp_CreatesAzureContainerAppResource() 49public async Task PublishAsAzureAppServiceWebsite_CreatesAzureWebSiteResource() 83public async Task ContainerResource_WithPublishAsContainerApp_CreatesAzureContainerAppResource() 115private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken);
AzureRedisExtensionsTests.cs (9)
24public async Task AddAzureRedis(bool useAcaInfrastructure) 52public async Task AddAzureRedis_WithAccessKeyAuthentication_NoKeyVaultWithContainer() 68public async Task AddAzureRedisWithAccessKeyAuthentication(string? kvName) 91public async Task AddAzureRedisRunAsContainerProducesCorrectConnectionString() 113public async Task AddAzureRedisRunAsContainerProducesCorrectHostAndPassword() 187public async Task AddAzureRedisWithAutoGeneratedPasswordProducesCorrectValues() 234public async Task PublishAsRedisPublishesRedisAsAzureRedisInfrastructure() 284public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureRedisCacheResource() 335private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken);
AzureResourceOptionsTests.cs (1)
22public async Task AzureResourceOptionsCanBeConfigured()
AzureResourcePreparerTests.cs (23)
41public async Task ThrowsExceptionsIfRoleAssignmentUnsupported(DistributedApplicationOperation operation) 69public async Task AppliesDefaultRoleAssignmentsInRunModeIfReferenced(bool addContainerAppsInfra, DistributedApplicationOperation operation) 115public async Task AppliesRoleAssignmentsInRunMode(DistributedApplicationOperation operation) 164public async Task DoesNotApplyRoleAssignmentsInRunModeForEmulators() 186public async Task FindsAzureReferencesFromArguments() 213public async Task PublishDeploymentTargetIncludesComputedPrerequisitesInReferences() 247public async Task PipelineStepAfterBeforeStartCanInspectRoleAssignmentsForTargetAzureResource() 275return Task.CompletedTask; 304public async Task RoleAssignmentsAreNotDuplicatedWhenBeforeStartRunsBeforePublishPipeline() 332return Task.CompletedTask; 364public async Task GlobalRoleAssignmentsAreNotDuplicatedWhenBeforeStartRunsTwice() 388public async Task NullEnvironmentVariableIsIgnored() 414public async Task NullCommandLineArgIsIgnored() 441public async Task CommandLineArgsCallbackContextHasCorrectExecutionContextDuringPublish() 471public async Task AppliesRoleAssignmentsOnlyToDirectReferences() 503public async Task ViteAppDoesNotGetManagedIdentity() 542public async Task ReferenceRoleAssignmentAnnotation_PublishMode_GrantsRolesOnImpliedTargetToConsumer() 570public async Task ReferenceRoleAssignmentAnnotation_RunMode_AppliesRolesToGlobalRolesResource() 595public async Task ReferenceRoleAssignmentAnnotation_ConsumerNotReferencingFrontingResource_GetsNoRole() 619public async Task ReferenceRoleAssignmentAnnotation_SameTargetFromTwoDependencies_DedupesRoles() 657public async Task ReferenceRoleAssignmentAnnotation_ConsumerWithExplicitRoleAssignment_DoesNotReintroduceSuppressedDefaults() 700public async Task ReferenceRoleAssignmentAnnotation_ConsumerWithDirectReference_KeepsDefaultsAndAddsImpliedRole() 744private static Task ExecutePipelineAsync(DistributedApplication app)
AzureSearchExtensionsTests.cs (2)
15public async Task AddAzureSearch() 115public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureSearchResource()
AzureServiceBusExtensionsTests.cs (17)
23public async Task ResourceNamesCanBeDifferentThanAzureNames() 50public async Task TopicNamesCanBeLongerThan24(bool useObsoleteMethods) 74public async Task VerifyWaitForOnServiceBusEmulatorBlocksDependentResources() 96var pendingStart = app.StartAsync(cts.Token); 117public async Task VerifyAzureServiceBusEmulatorResource(string? queueName) 199public async Task AzureServiceBusEmulatorResourceInitializesProvisioningModel() 311public async Task AzureServiceBusEmulatorResourceGeneratesConfigJson() 452public async Task AzureServiceBusEmulatorResourceGeneratesConfigJsonOnlyChangedProperties() 504public async Task AzureServiceBusEmulatorResourceGeneratesConfigJsonWithCustomizations() 554public async Task AzureServiceBusEmulator_WithConfigurationFile() 727public async Task AddAzureServiceBus(bool useObsoleteMethods) 807public async Task AzureServiceBusEmulator_WithCustomConfig() 943public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureServiceBusResource() 964public async Task AddAsExistingResource_EmitsResourceGroupAndSubscriptionScopeFromParameterAnnotation() 986public async Task AddAsExistingResource_EmitsResourceGroupAndSubscriptionScopeFromStringAnnotation() 1005public async Task AddAsExistingResource_EmitsSubscriptionScopeFromExistingAnnotation() 1026public async Task AddAsExistingResource_EmitsTenantScopeFromExistingAnnotation()
AzureSignalREmulatorFunctionalTest.cs (5)
19public async Task VerifyAzureSignalRConnectionString() 40public async Task VerifyWaitForOnAzureSignalREmulatorBlocksDependentResources() 59var pendingStart = app.StartAsync(cts.Token); 76public async Task VerifyAzureSignalREmulatorResource() 109option.AccessTokenProvider = () => Task.FromResult(negotiationResponse.AccessToken);
AzureSignalRExtensionsTests.cs (3)
14public async Task AddAzureSignalR() 36public async Task AddServerlessAzureSignalR() 85public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureSignalRResource()
AzureSqlDeploymentScriptTests.cs (8)
14public async Task SqlWithPrivateEndpoint_AutoCreatesBothSubnetAndStorage() 34public async Task SqlWithPrivateEndpoint_ExplicitSubnet_AutoCreatesStorage() 56public async Task SqlWithPrivateEndpoint_ExplicitStorage_AutoCreatesSubnet() 79public async Task SqlWithPrivateEndpoint_BothExplicitSubnetAndStorage() 104public async Task SqlWithPrivateEndpoint_StorageBeforePrivateEndpoint() 128public async Task SqlWithPrivateEndpoint_SubnetBeforePrivateEndpoint() 152public async Task SqlWithPrivateEndpoint_ClearDefaultRoleAssignments_RemovesDeploymentScriptInfra() 173public async Task SqlWithPrivateEndpoint_UserDelegatedAdminScriptSubnet_KeepsSingleAciDelegation()
AzureSqlExtensionsTests.cs (7)
18public async Task AddAzureSqlServer(bool publishMode, bool useAcaInfrastructure) 64public async Task AddAzureSqlServerRunAsContainerProducesCorrectConnectionString(bool addDbBeforeRunAsContainer) 113public async Task AddAzureSqlServerRunAsContainerProducesCorrectPasswordAndPort(bool addDbBeforeRunAsContainer) 239public async Task AsAzureSqlDatabaseViaRunMode() 270public async Task AsAzureSqlDatabaseViaPublishMode() 316public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureSqlServerResource() 337private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken);
AzureSqlPrincipalReconciliationTests.cs (11)
30public async Task ReconciliationCreatesThePrincipalWithTheIdentityObjectIdAsItsSid() 46public async Task ReconciliationHandlesPrincipalNamesRequiringEscaping() 65public async Task ReconciliationIsANoOpWhenTheScriptRunsAgain() 85public async Task ReconciliationReplacesThePrincipalWhenTheIdentityObjectIdChanges() 109public async Task ReconciliationLeavesPrincipalsItDidNotCreateIntact() 138public async Task ReconciliationRollsBackWhenTheUserCannotBeRecreated() 161public async Task ReconciliationFailsWithoutDamageWhenThePrincipalOwnsASchema() 260private async Task CreateLoginAsync(string name, Guid objectId) 268private async Task DropLoginAsync(string name) 274private async Task RunReconciliationAsync(string database, string principalName, Guid objectId) 280private static async Task ExecuteAsync(SqlConnection connection, string sql)
AzureStorageEmulatorFunctionalTests.cs (10)
21public async Task VerifyWaitForOnAzureStorageEmulatorForBlobsBlocksDependentResources() 47var pendingStart = app.StartAsync(cts.Token); 70public async Task VerifyWaitForOnAzureStorageEmulatorForBlobContainersBlocksDependentResources() 92var pendingStart = app.StartAsync(cts.Token); 113public async Task VerifyWaitForOnAzureStorageEmulatorForQueueBlocksDependentResources() 135var pendingStart = app.StartAsync(cts.Token); 156public async Task VerifyAzureStorageEmulatorResource() 212public async Task VerifyAzureStorageEmulator_blobcontainer_auto_created() 252public async Task VerifyAzureStorageEmulator_queue_auto_created() 290public Task AzureStorageEmulator_WithPersistentLifetime_ReusesContainersAndPorts()
AzureStorageExtensionsTests.cs (17)
142public async Task AddAzureStorage_WithApiVersionCheck_ShouldSetSkipApiVersionCheck(bool enableApiVersionCheck) 162public async Task AddAzureStorage_RunAsEmulator_SetSkipApiVersionCheck() 174public async Task AddBlobs_ConnectionString_resolved_expected_RunAsEmulator() 195public async Task AddBlobs_ConnectionString_resolved_expected() 222public async Task AddBlobContainer_ConnectionString_resolved_expected_RunAsEmulator() 249public async Task AddBlobContainer_ConnectionString_resolved_expected() 280public async Task AddQueues_ConnectionString_resolved_expected_RunAsEmulator() 301public async Task AddQueues_ConnectionString_resolved_expected() 328public async Task AddQueue_ConnectionString_resolved_expected_RunAsEmulator() 353public async Task AddQueue_ConnectionString_resolved_expected() 385public async Task ResourceNamesBicepValid() 402public async Task AddAzureStorageEmulator() 441public async Task AddAzureStorageViaRunMode() 525public async Task AddAzureStorageViaRunModeAllowSharedKeyAccessOverridesDefaultFalse() 610public async Task AddAzureStorageViaPublishMode() 744public async Task AddAzureStorageViaPublishModeEnableAllowSharedKeyAccessOverridesDefaultFalse() 1025public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureStorageResource()
AzureStoragePrivateEndpointLockdownTests.cs (4)
14public async Task AddAzureStorage_WithPrivateEndpoint_CanOverrideWithConfigureInfrastructure() 39public async Task AddAzureStorage_WithPrivateEndpoint_GeneratesCorrectBicep() 58public async Task AddAzureStorage_WithTablePrivateEndpoint_GeneratesCorrectBicep() 75public async Task AddAzureStorage_WithDataLakePrivateEndpoint_GeneratesCorrectBicep()
AzureUserAssignedIdentityTests.cs (9)
20public async Task AddAzureUserAssignedIdentity_GeneratesExpectedResourcesAndBicep() 41public async Task AddAzureUserAssignedIdentity_PublishAsExisting_Works() 59public async Task AddAzureUserAssignedIdentity_WithRoleAssignments_Works() 102public async Task WithAzureUserAssignedIdentity_Works() 136public async Task WithAzureUserAssignedIdentity_WithRoleAssignments_Works() 194public async Task WithAzureUserAssignedIdentity_WithRoleAssignments_AzureAppService_Works() 252public async Task WithAzureUserAssignedIdentity_NoEnvironment_ThrowsException() 269public async Task WithAzureUserAssignedIdentity_WithRoleAssignments_MultipleProjects_Works() 362public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureUserAssignedIdentityResource()
AzureVirtualNetworkExtensionsTests.cs (5)
54public async Task AddAzureVirtualNetwork_WithParameterResource_GeneratesBicep() 112public async Task AddAzureVirtualNetwork_WithSubnets_GeneratesBicep() 425public async Task AddSubnet_WithParameterResource_GeneratesBicep() 439public async Task AddSubnet_WithNatGateway_GeneratesCorrectBicep() 624public async Task Shorthand_GeneratesCorrectBicep()
AzureWebPubSubExtensionsTests.cs (9)
24public async Task AddWebPubSubHubNameWithSpecialChars() 43public async Task AddAzureWebPubSubHubWorks() 83public async Task AddWebPubSubWithHubConfigure() 114public async Task AddAzureWebPubSubHubWithEventHandlerExpressionWorks() 144public async Task ConfigureConstructOverridesAddEventHandler() 170public async Task AddAzureWebPubSubHubSettings() 267public async Task AddDefaultAzureWebPubSub() 325public async Task AddAzureWebPubSubWithParameters() 369public async Task AddAsExistingResource_RespectsExistingAzureResourceAnnotation_ForAzureWebPubSubResource()
BicepUtilitiesTests.cs (18)
15public async Task SetParametersTranslatesParametersToARMCompatibleJsonParameters() 30public async Task SetParametersTranslatesCompatibleParameterTypes() 93public async Task ResourceWithTheSameBicepTemplateAndParametersHaveTheSameCheckSum() 121public async Task ResourceWithSameTemplateButDifferentParametersHaveDifferentChecksums() 148public async Task ResourceWithDifferentScopeHaveDifferentChecksums() 176public async Task ResourceWithSameScopeHaveSameChecksums() 310public async Task SetParametersAsync_IncludesAllParametersWhenSkipDynamicValuesIsFalse() 332public async Task SetScopeAsync_SetsResourceGroupFromScope() 347public async Task SetScopeAsync_SetsResourceGroupAndSubscriptionFromScope() 363public async Task SetScopeAsync_SetsSubscriptionFromScope() 378public async Task SetScopeAsync_RemovesStaleScopeValues() 397public async Task SetScopeAsync_SetsTenantFromScope() 412public async Task SetScopeAsync_SetsNullWhenNoScope() 426public async Task GetCurrentChecksumAsync_ReturnsNullForMissingParameters() 438public async Task GetCurrentChecksumAsync_ReturnsNullForInvalidJson() 456public async Task GetCurrentChecksumAsync_ReturnsValidChecksumForValidParameters() 481public async Task GetCurrentChecksumAsync_UsesCurrentScopeWhenSavedScopeIsMissing() 519public async Task GetCurrentChecksumAsync_DoesNotOverwriteKnownParameters()
ContainerRegistryTests.cs (5)
18public async Task AzureContainerAppEnvironmentResourceImplementsContainerRegistry() 43public async Task ContainerRegistryInfoFlowsToDeploymentTargetForProjects() 79public async Task ContainerRegistryInfoIsAccessibleFromPublisher() 143public Task PublishAsync(DistributedApplicationModel model, CancellationToken cancellationToken) 169return Task.CompletedTask;
DefaultArmClientProviderTests.cs (17)
30public async Task GetSupportedLocationsAsyncUsesConfiguredArmEnvironment() 60public async Task GetAvailableLocationsAsyncSortsWithAzureLocationComparer() 95public async Task GetDeploymentOperationsAsyncFetchesNestedDeploymentOperationsInParallel() 115public async Task GetDeploymentTargetResourceIdsAsyncReturnsCreatedTargetsOnly() 145public async Task GetDeploymentAsyncReturnsProvisioningStateAndOutputs() 162public async Task DeleteResourceAsyncDeletesKeyVaultAndPurgeDeletedKeyVaultAsyncPurgesDeletedKeyVault() 187public async Task PurgeDeletedKeyVaultAsyncReturnsFalseWhenDeletedKeyVaultIsAbsentFromLocation() 207public async Task DeleteResourceAsyncAndPurgeDeletedKeyVaultAsyncPollWithConfiguredTimeProvider() 217var deleteTask = armClient.DeleteResourceAsync(KeyVaultResourceId, cancellationToken: CancellationToken.None); 245public async Task DeleteResourceAsyncUsesConfiguredTimeProviderForKeyVaultDeleteTimeout() 255var deleteTask = armClient.DeleteResourceAsync(KeyVaultResourceId, cancellationToken: CancellationToken.None); 267public async Task PurgeDeletedKeyVaultAsyncUsesConfiguredTimeProviderForKeyVaultPurgeTimeout() 397public Task WaitForKeyVaultDeletePollAsync() 400public Task WaitForDeletedKeyVaultPurgePollAsync() 562private async Task WaitForConcurrentNestedDeploymentOperationRequestAsync() 767public async Task WaitForTimerAsync(TimeSpan dueTime) 771Task timerCreatedTask;
DefaultAzurePrincipalProviderTests.cs (18)
14public async Task GetPrincipalAsync_ReturnsValidPrincipal() 27public async Task GetPrincipalAsync_ParsesTokenCorrectly() 42public async Task GetPrincipalAsync_ParsesTokenWithEmail() 57public async Task GetPrincipalAsync_DefaultsTypeToUserWhenIdtypMissing() 71public async Task GetPrincipalAsync_DetectsUserPrincipalFromIdtyp() 83public async Task GetPrincipalAsync_DetectsServicePrincipalFromIdtyp() 100public async Task GetPrincipalAsync_TreatsIdtypComparisonCaseInsensitively() 112public async Task GetPrincipalAsync_HandlesCancellation() 124public async Task GetPrincipalAsync_RespectsTokenCredentialProviderDependency() 140public async Task GetPrincipalAsync_ThrowsClearErrorForMalformedToken(string token) 157public async Task GetPrincipalAsync_ThrowsClearErrorWhenOidClaimIsUnusable(string payloadJson) 184public async Task GetPrincipalAsync_IgnoresClaimsNestedInsideOtherClaims(string payloadJson, string expectedPrincipalType) 200public async Task GetPrincipalAsync_IgnoresNameClaimsNestedInsideOtherClaims() 214public async Task GetPrincipalAsync_PrefersUpnOverEmailWhenBothPresent() 230public async Task GetPrincipalAsync_UsesAppDisplayNameForAppOnlyTokens() 262public async Task GetPrincipalAsync_IgnoresAppDisplayNameForUserTokens(string payloadJson, string expectedName) 287public async Task GetPrincipalAsync_FallsBackToObjectIdWhenNoNameClaimIsUsable(string payloadJson) 302public async Task GetPrincipalAsync_IgnoresAppDisplayNameNestedInsideOtherClaims()
DurableTaskResourceExtensionsTests.cs (8)
15public async Task AddDurableTaskScheduler_RunAsEmulator_ResolvedConnectionString() 36public async Task AddDurableTaskScheduler_RunAsExisting_ResolvedConnectionString() 52public async Task AddDurableTaskScheduler_RunAsExisting_ResolvedConnectionStringParameter() 72public async Task AddDurableTaskHub_RunAsExisting_ResolvedConnectionStringParameter(string? taskHubName, string expectedTaskHubName) 185public async Task RunAsEmulator_SetsSingleDtsTaskHubNamesEnvironmentVariable() 199public async Task RunAsEmulator_SetsMultipleDtsTaskHubNamesEnvironmentVariable() 214public async Task RunAsEmulator_DtsTaskHubNamesOnlyIncludesHubsForSameScheduler() 232public async Task WithTaskHubName_Parameter_ResolvedConnectionString()
ExistingAzureResourceTests.cs (33)
14public async Task AddExistingAzureServiceBusInRunMode() 31public async Task RequiresPublishAsExistingInPublishMode() 48public async Task AddExistingAzureServiceBusInPublishMode() 65public async Task SupportsExistingServiceBusWithResourceGroupInPublishMode() 90public async Task SupportsExistingServiceBusWithStaticArguments() 105public async Task SupportsExistingStorageAccountWithResourceGroup() 122public async Task SupportsExistingStorageAccountWithResourceGroupAndStaticArguments() 137public async Task SupportsExistingAppConfigurationWithResourceGroup() 154public async Task SupportsExistingEventHubsWithResourceGroup() 171public async Task SupportsExistingKeyVaultWithResourceGroup() 188public async Task SupportsExistingLogAnalyticsWithResourceGroup() 205public async Task SupportsExistingPostgresSqlWithResourceGroup() 222public async Task SupportsExistingPostgresSqlWithResourceGroupWithPasswordAuth() 243public async Task SupportsExistingAzureSearchWithResourceGroup() 260public async Task SupportsExistingAzureSignalRWithResourceGroup() 277public async Task SupportsExistingAzureWebPubSubWithResourceGroup() 294public async Task SupportsExistingAzureSqlServerWithResourceGroup() 311public async Task SupportsExistingAzureSqlServerInRunMode() 328public async Task SupportsExistingAzureRedisWithResourceGroup() 346public async Task SupportsExistingAzureRedisWithResouceGroupAndAccessKeyAuth() 362public async Task SupportsExistingAzureRedisEnterpriseWithResourceGroup() 378public async Task SupportsExistingAzureRedisEnterpriseWithResourceGroupAndAccessKeyAuth() 393public async Task SupportsExistingAzureApplicationInsightsWithResourceGroup() 410public async Task SupportsExistingAzureOpenAIWithResourceGroup() 433public async Task SupportsExistingAzureCosmosDBWithResourceGroup() 453public async Task SupportsExistingAzureCosmosDBWithResourceGroupAccessKey() 474public async Task SupportsExistingAzureContainerRegistryInRunMode() 490public async Task SupportsExistingAzureContainerRegistryInPublishMode() 507public async Task SupportsExistingServiceBusWithResourceGroupAndSubscriptionInRunMode() 529public async Task SupportsExistingServiceBusWithTenantScopeInRunMode() 549public async Task SupportsExistingServiceBusWithResourceGroupAndSubscriptionInPublishMode() 574public async Task SupportsBicepTemplateWithSubscriptionScopeInPublishMode() 597public async Task SupportsBicepTemplateWithTenantScopeInPublishMode()
FakeAcrLoginService.cs (1)
26public async Task LoginAsync(
FoundryExtensionsTests.cs (10)
72public async Task RunAsFoundryLocal_SetsIsEmulator() 187public async Task AddFoundry_GeneratesValidBicep() 234public async Task AddProject_WithPublishAsExistingFoundry_GeneratesBicepThatReferencesExistingParent() 255public async Task AddProject_GeneratesEndpointFromParentFoundryApiEndpoint() 271public async Task AddFoundry_WithPublishAsExisting_UsesStableDefaultCapabilityHostName() 305public async Task WithComputeEnvironment_ResolvesExternalContainerAppReference() 344public async Task WithComputeEnvironment_DoesNotSetReservedFoundryProjectEndpointEnvironmentVariable() 373public async Task WithComputeEnvironment_ResolvesReferenceExpressionEnvironmentVariable() 414public async Task WithComputeEnvironment_ResolvesEndpointReferenceExpressionEnvironmentVariable() 455public async Task WithComputeEnvironment_ThrowsForInternalContainerAppReference()
ProvisioningContextProviderTests.cs (18)
23public async Task CreateProvisioningContextAsync_ReturnsValidContext() 61public async Task CreateProvisioningContextAsync_ThrowsWhenSubscriptionIdMissing() 90public async Task CreateProvisioningContextAsync_DoesNotReuseStaleInMemoryOptionsAfterReset() 126public async Task CreateProvisioningContextAsync_RehydratesStringBooleanAllowResourceGroupCreation() 162public async Task CreateProvisioningContextAsync_ThrowsWhenLocationMissing() 191public async Task CreateProvisioningContextAsync_GeneratesResourceGroupNameWhenNotProvided() 222public async Task CreateProvisioningContextAsync_UsesProvidedResourceGroupName() 254public async Task CreateProvisioningContextAsync_RetrievesPrincipal() 286public async Task CreateProvisioningContextAsync_SetsCorrectTenant() 318public async Task EnsureProvisioningOptionsAsync_PromptsIfNoOptions() 414public async Task EnsureProvisioningOptionsAsync_Prompt_ValidatesSubAndResourceGroup() 472public async Task EnsureProvisioningOptionsAsync_IncludesTenantWhenSubscriptionIdProvided() 575public async Task PublishMode_CreateProvisioningContextAsync_ReturnsValidContext() 614public async Task CreateProvisioningContextAsync_SubscriptionInputStartsDisabledWhenNotConfigured() 660public async Task CreateProvisioningContextAsync_SubscriptionInputDependsOnTenantWhenNotConfigured() 703public async Task CreateProvisioningContextAsync_SubscriptionInputBecomesEnabledAfterTenantSelection() 760public async Task CreateProvisioningContextAsync_SubscriptionInputHasNoDynamicLoadingWhenConfigured() 804public async Task CreateProvisioningContextAsync_ResourceGroupHasNoDefaultValueInitially()
ProvisioningContextTests.cs (7)
77public async Task ProvisioningContext_TokenCredential_CanGetToken() 91public async Task ProvisioningContext_ArmClient_CanGetSubscriptionAndTenant() 107public async Task ProvisioningContext_ResourceGroup_CanGetArmDeployments() 128public async Task ProvisioningContext_Subscription_CanGetResourceGroups() 177public async Task TestBicepCliExecutor_ReturnsValidJson() 196public async Task TestUserSecretsManager_CanSaveAndLoadSection() 214public async Task TestAzurePrincipalProvider_CanGetPrincipal()
ProvisioningTestHelpers.cs (42)
295return Task.FromResult<(ISubscriptionResource, ITenantResource)>((subscription, tenant)); 304return Task.FromResult<IEnumerable<ITenantResource>>(tenants); 313return Task.FromResult<IEnumerable<ISubscriptionResource>>(subscriptions); 325return Task.FromResult<IEnumerable<ISubscriptionResource>>(subscriptions); 344return Task.FromResult(subscription); 356return Task.FromResult<IEnumerable<(string, string)>>(locations); 367return Task.FromResult<IEnumerable<(string, string)>>(resourceGroups); 392return Task.FromResult(exists); 395public Task DeleteResourceAsync(string resourceId, CancellationToken cancellationToken = default) 399return Task.CompletedTask; 407return Task.FromException<bool>(_purgeDeletedKeyVaultException); 410return Task.FromResult(_purgeDeletedKeyVaultResult); 413public Task CancelDeploymentAsync(string deploymentId, CancellationToken cancellationToken = default) 416return Task.CompletedTask; 426return Task.FromException<AzureDeploymentState?>(GetDeploymentException); 434Exception ex => Task.FromException<AzureDeploymentState?>(ex), 435AzureDeploymentState deployment => Task.FromResult<AzureDeploymentState?>(deployment), 436null => Task.FromResult<AzureDeploymentState?>(null), 444return Task.FromResult(deployment); 447return Task.FromResult<AzureDeploymentState?>(new( 455await Task.CompletedTask; 475await Task.CompletedTask; 592return Task.FromResult(Response.FromValue<IResourceGroupResource>(_resourceGroup, new MockResponse(200))); 604return Task.FromResult(Response.FromValue<IResourceGroupResource>(resourceGroup, new MockResponse(200))); 619return Task.FromResult<ArmOperation<IResourceGroupResource>>(operation); 676return Task.FromException<ArmOperation>(_deleteException); 679return Task.FromResult<ArmOperation>(new TestDeleteArmOperation()); 685await Task.CompletedTask; 713return Task.FromResult<ArmOperation<RoleAssignmentResource>>(new TestArmOperation<RoleAssignmentResource>(default!)); 765return Task.FromResult<ArmOperation<ArmDeploymentResource>>(operation); 774public Task CancelAsync(string deploymentName, CancellationToken cancellationToken = default) => Task.CompletedTask; 1023return Task.FromResult(@"{ 1043return Task.FromResult(new DeploymentStateSection(sectionName, sectionData, 0)); 1046public Task DeleteSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 1048return Task.CompletedTask; 1051public Task SaveSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 1054return Task.CompletedTask; 1057public Task ClearAllStateAsync(CancellationToken cancellationToken = default) => Task.CompletedTask; 1065return Task.FromResult(principal); 1111var resultTask = Task.FromResult(result);
RoleAssignmentTests.cs (20)
25public Task ServiceBusSupport() 38public Task AppConfigurationSupport() 51public Task OpenAISupport() 64public Task AzureFoundrySupport() 77public Task EventHubsSupport() 90public Task KeyVaultSupport() 103public Task SearchSupport() 116public Task SignalRSupport() 129public Task WebPubSubSupport() 142public Task CosmosDBSupport() 156public Task RedisSupport() 169public Task RedisEnterpriseSupport() 182public Task PostgresSupport() 195public Task SqlSupport() 211public Task KustoSupport() 226public async Task ClearDefaultRoleAssignmentsRemovesDefaultAnnotation() 251public async Task ClearDefaultRoleAssignmentsOnMultipleResources() 284public async Task ClearDefaultRoleAssignmentsDoesNotAffectExplicitRoleAssignments() 307public async Task WaitForDoesNotCreateTransitiveRoleAssignments() 336private static async Task RoleAssignmentTest(
tests\Shared\InMemoryDeploymentStateManager.cs (8)
32return Task.FromResult(new DeploymentStateSection(sectionName, data, version)); 34return Task.FromResult(new DeploymentStateSection(sectionName, [], 0)); 37public Task SaveSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 41return Task.CompletedTask; 44public Task DeleteSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 48return Task.CompletedTask; 51public Task ClearAllStateAsync(CancellationToken cancellationToken = default) 55return Task.CompletedTask;
tests\Shared\TestInteractionService.cs (3)
89var workTask = work(progressContext); 92var finished = await Task.WhenAny(workTask, completionTask).ConfigureAwait(false);
tests\Shared\TestPipelineActivityReporter.cs (14)
133public Task CompletePublishAsync(PublishCompletionOptions? options = null, CancellationToken cancellationToken = default) 142return Task.CompletedTask; 147public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 175return Task.FromResult<IReportingStep>(new TestReportingStep(this, title, _testOutputHelper)); 193public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 202return Task.CompletedTask; 213return Task.FromResult<IReportingTask>(new TestReportingTask(_reporter, statusText, _testOutputHelper)); 250public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 272public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 280return Task.CompletedTask; 283public Task UpdateAsync(string statusText, CancellationToken cancellationToken = default) 291return Task.CompletedTask; 294public Task UpdateAsync(MarkdownString statusText, CancellationToken cancellationToken = default) 300public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Blazor (5)
BlazorGatewayExtensions.cs (3)
413_ = Task.Run(() => WatchGatewayStateAsync(gateway.Resource, notificationService, ct), ct); 414return Task.CompletedTask; 418private static async Task WatchGatewayStateAsync<TGateway>(
BrowserDebuggerHelper.cs (1)
288internal static async Task WatchForDebuggerStopAsync(
Manifests\EndpointsManifestTransformer.cs (1)
73public static async Task MergeRuntimeManifestsAsync(
Aspire.Hosting.Blazor.Tests (48)
BlazorHostedExtensionsTests.cs (17)
18public async Task ProxyService_EmitsYarpRoutes() 38public async Task ProxyService_EmitsClientConfigResponse() 61public async Task ProxyTelemetry_EmitsOtlpRoutes() 79public async Task ProxyTelemetry_EmitsOtelServiceNameInConfig() 99public async Task ProxyService_And_ProxyTelemetry_Combined() 128public async Task ProxyService_MultipleServices() 193public async Task ProxyService_WithWasmClient_UsesResolvedClientProjectAsWebRoot() 222public async Task ProxyService_WithoutWasmClient_HidesDebugCommand() 261public async Task ProxyService_WhenClientDiscoveryFails_SurfacesFailure() 283public async Task ProxyService_NoPathPrefix() 303public async Task ProxyService_WithoutProxyTelemetry_NoOtlpInConfig() 346public async Task ProxyService_DifferentApiPrefixPerService() 421public async Task ProxyTelemetry_LogsWarning_WhenOtlpEndpointNotResolvable() 440public async Task ProxyTelemetry_DoesNotLogWarning_WhenOtlpEndpointIsConfigured() 458public async Task WithBlazorClientApp_LogsWarning_WhenOtlpEndpointNotResolvable() 478public async Task WithBlazorClientApp_DoesNotLogWarning_WhenOtlpEndpointIsConfigured() 536private static async Task PublishBeforeStartEventAsync(
BrowserDebuggerHelperTests.cs (8)
18public async Task WatchForDebuggerStopAsync_ResetsSessionForTerminalState(string terminalState) 32var watcherTask = BrowserDebuggerHelper.WatchForDebuggerStopAsync( 50public async Task WatchForDebuggerStopAsync_ResetsSessionWhenStartedResourceReturnsToNotStarted() 65var watcherTask = BrowserDebuggerHelper.WatchForDebuggerStopAsync( 87public async Task WatchForDebuggerStopAsync_IgnoresTerminalSnapshotFromPreviousSession(string terminalState) 103var watcherTask = BrowserDebuggerHelper.WatchForDebuggerStopAsync( 118public async Task WatchForDebuggerStopAsync_CancellationCompletesWithoutResettingSession() 128var watcherTask = BrowserDebuggerHelper.WatchForDebuggerStopAsync(
EndpointsManifestTransformerTests.cs (6)
27public async Task PrefixEndpointsAssetFile_PrefixesAssetPaths() 48public async Task PrefixEndpointsAssetFile_AddsFallbackEndpoint_ForIdentityIndexHtml() 79public async Task PrefixEndpointsAssetFile_SkipsFallback_ForCompressedIndexHtml() 107public async Task PrefixEndpointsAssetFile_PreservesRoutes_Unchanged() 131public async Task MergeRuntimeManifests_MergesMultipleApps() 212public async Task MergeRuntimeManifests_OffsetsContentRootIndices()
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
WithBlazorAppTests.cs (2)
306public async Task WithClient_DebugInBrowserCommandFailsWithoutBrowserDebuggingSupport() 336public async Task WithClient_CreatesBrowserLaunchConfiguration()
Aspire.Hosting.Browsers (72)
BrowserEndpointDiscovery.cs (1)
151public static async Task WriteAsync(BrowserHostIdentity identity, string? profileDirectoryName, Uri endpoint, int processId, CancellationToken cancellationToken)
BrowserHost.cs (9)
35public abstract Task Termination { get; } 86private readonly Task _termination; 109public override Task Termination => _termination; 117return Task.FromResult(_connectionMultiplexer.CreateConnection(eventHandler)); 220private static async Task CompleteWhenProcessOrPipeEndsAsync(Task processTask, Task pipeTask) 225_ = await Task.WhenAny(processTask, pipeTask).ConfigureAwait(false); 270public override Task Termination => _terminationSource.Task;
BrowserHostRegistry.cs (2)
270private async Task DisposeLockAsync() 272Task? lockUsersDrained = null;
BrowserLogsBuilderExtensions.cs (1)
291Task RefreshBrowserLogsResourceAsync(ResourceNotificationService notifications) =>
BrowserLogsCdpConnection.cs (13)
14Task Completion { get; } 26Task EnablePageInstrumentationAsync(string sessionId, CancellationToken cancellationToken); 52private readonly Task _receiveLoop; 62_receiveLoop = Task.Run(ReceiveLoopAsync); 65public Task Completion => _receiveLoop; 165public async Task EnablePageInstrumentationAsync(string sessionId, CancellationToken cancellationToken) 274private async Task ReceiveLoopAsync() 323private async Task HandleFrameAsync(byte[] frame) 393Task ConnectAsync(Uri webSocketUri, CancellationToken cancellationToken); 409public Task ConnectAsync(Uri webSocketUri, CancellationToken cancellationToken) 440Task SendAsync(ReadOnlyMemory<byte> frame, CancellationToken cancellationToken); 450public async Task SendAsync(ReadOnlyMemory<byte> frame, CancellationToken cancellationToken) 527public async Task SendAsync(ReadOnlyMemory<byte> frame, CancellationToken cancellationToken)
BrowserLogsCdpConnectionMultiplexer.cs (10)
34public Task Completion => _innerConnection.Completion; 138private readonly Task _completion = CompleteWhenLeaseOrInnerConnectionCompletesAsync(owner._innerConnection.Completion, subscription.Completion); 141public Task Completion => _completion; 173public Task EnablePageInstrumentationAsync(string sessionId, CancellationToken cancellationToken) 210private static async Task CompleteWhenLeaseOrInnerConnectionCompletesAsync(Task innerCompletion, Task leaseCompletion) 212var completedTask = await Task.WhenAny(innerCompletion, leaseCompletion).ConfigureAwait(false); 225public Task Completion => _completionSource.Task;
BrowserLogsConfigurationManager.cs (6)
75return Task.CompletedTask; 98return Task.CompletedTask; 119return Task.CompletedTask; 271internal Task ValidateInputsAsync(BrowserLogsResource resource, InputsDialogValidationContext context) 319return Task.CompletedTask; 420private Task PublishConfigurationSnapshotAsync(BrowserLogsResource resource, BrowserConfiguration browserConfiguration)
BrowserLogsPipeBrowserProcessLauncher.Unix.cs (1)
128return await Task.Run(() =>
BrowserLogsPipeBrowserProcessLauncher.Windows.cs (1)
217return await Task.Run(() =>
BrowserLogsRunningSession.cs (12)
26Task StartCompletionObserver(Func<int?, Exception?, Task> onCompleted); 30Task StopAsync(CancellationToken cancellationToken); 171public Task StartCompletionObserver(Func<int?, Exception?, Task> onCompleted) 193public async Task StopAsync(CancellationToken cancellationToken) 211private async Task InitializeAsync(CancellationToken cancellationToken) 299private async Task ObserveCompletionAsync(Func<int?, Exception?, Task> onCompleted) 312private async Task CleanupAsync() 332private async Task DisposePageSessionAsync() 346private async Task DisposeBrowserHostLeaseAsync()
BrowserLogsSessionManager.cs (7)
62public async Task StartSessionAsync(BrowserLogsResource resource, BrowserConfiguration configuration, string resourceName, Uri url, CancellationToken cancellationToken) 141var completionObserver = session.StartCompletionObserver(async (exitCode, error) => 257var completionObservers = new List<Task>(); 293await Task.WhenAll(completionObservers).ConfigureAwait(false); 314private async Task HandleSessionCompletedAsync( 370private Task PublishResourceSnapshotAsync( 611Task CompletionObserver);
BrowserPageSession.cs (7)
233private async Task ConnectAsync(bool createTarget, CancellationToken cancellationToken) 336var completedTask = await Task.WhenAny(_host.Termination, connectionSnapshot.Completion, _completionSource.Task).ConfigureAwait(false); 422await Task.Delay(s_connectionRecoveryDelay, _timeProvider, _stopCts.Token).ConfigureAwait(false); 469private async Task DisposeConnectionAsync() 482private async Task DisposeConnectionCoreAsync() 493private sealed record ConnectionSnapshot(Task Completion);
IBrowserHost.cs (1)
30Task Termination { get; }
IBrowserLogsSessionManager.cs (1)
8Task StartSessionAsync(BrowserLogsResource resource, BrowserConfiguration configuration, string resourceName, Uri url, CancellationToken cancellationToken);
Aspire.Hosting.Browsers.Tests (214)
BrowserConnectionDiagnosticsLoggerTests.cs (1)
13public async Task LogsConnectionProblems()
BrowserHostTests.cs (2)
18public async Task OwnedBrowserHost_StartAsync_UsesPipeTransportAndDeletesEndpointMetadata() 143public async Task SendFrameAsync(string frame)
BrowserLogsBuilderExtensionsTests.cs (45)
82public async Task WithBrowserLogs_ConfigureCommandInputsDefaultToCurrentConfiguration() 137public async Task WithBrowserLogs_ConfigureCommandProfileInputDefaultsToCurrentConfigurationBeforeDependenciesLoad() 425public async Task WithBrowserLogs_CommandStartsTrackedSession() 460public async Task WithBrowserLogs_ConfigureCommandSavesResourceScopedBrowserSettingsAndAppliesImmediately() 500public async Task WithBrowserLogs_ConfigureCommandAppliesRuntimeSettingsWhenUserSecretsAreUnavailable() 543public async Task WithBrowserLogs_ConfigureCommandDoesNotOverrideExplicitBuilderSettings() 581public async Task WithBrowserLogs_ConfigureCommandSavesGlobalSettingsAndClearsProfile() 622public async Task WithBrowserLogs_ConfigureCommandDoesNotApplyRuntimeSettingsWhenUserSecretSaveFails() 667public async Task WithBrowserLogs_ConfigureCommandRefreshesAllBrowserLogsResourcesForGlobalSettings() 717public async Task WithBrowserLogs_ConfigureCommandValidatesEffectiveConfigurationBeforeSaving() 755public async Task WithBrowserLogs_CaptureScreenshotCommandReturnsArtifactResult() 818public async Task WithBrowserLogs_CaptureScreenshotCommandReturnsClearFailureWhenNoSessionIsActive() 845public async Task WithBrowserLogs_CaptureScreenshotCommandWritesPngArtifact() 917public async Task WithBrowserLogs_CommandUsesLatestConfiguredSettingsAndRefreshesProperties() 975public async Task WithBrowserLogs_CommandRefreshesBrowserExecutablePropertyWhenRelaunchFails() 1060public async Task WithBrowserLogs_CommandRemovesStaleBrowserExecutablePropertyWhenBrowserCannotBeResolved() 1132public async Task WithBrowserLogs_CommandPublishesFailureDiagnosticsWhenLaunchFailsBeforeAnySession() 1188public async Task WithBrowserLogs_CommandClearsLastErrorAfterSuccessfulLaunch() 1247public async Task WithBrowserLogs_CommandSurfacesAdoptedBrowserDiagnostics() 1297public async Task WithBrowserLogs_CommandFailsWhenEndpointIsMissing() 1325public async Task WithBrowserLogs_CommandBecomesEnabledWhenParentReady() 1371public async Task WithBrowserLogs_CommandTracksMultipleSessionsWithUniqueIds() 1506public async Task WithBrowserLogs_PreservesLastErrorWhenOneOfMultipleSessionsFails() 1574public async Task WithBrowserLogs_DisposeWaitsForCompletionObservers() 1614var disposeTask = app.DisposeAsync().AsTask(); 1633public async Task BrowserEventLogger_LogsSuccessfulNetworkRequests() 1691public async Task BrowserEventLogger_LogsFailedNetworkRequests() 1791public Task StartSessionAsync(BrowserLogsResource resource, BrowserConfiguration configuration, string resourceName, Uri url, CancellationToken cancellationToken) 1794return Task.CompletedTask; 1800return Task.FromResult(ScreenshotResult); 1828return Task.FromException<IBrowserLogsRunningSession>(exception); 1846return Task.FromResult<IBrowserLogsRunningSession>(session); 1860private Task? _completionObserverTask; 1880public Task CompletionObserverStarted => CompletionObserverStartedSource.Task; 1884public Task StartCompletionObserver(Func<int?, Exception?, Task> onCompleted) 1890public Task StopAsync(CancellationToken cancellationToken) 1894return Task.CompletedTask; 1899return Task.FromResult(ScreenshotBytes); 1902public async Task CompleteAsync(int exitCode, Exception? error = null) 1905await (_completionObserverTask ?? Task.CompletedTask); 1919private async Task ObserveCompletionAsync(Func<int?, Exception?, Task> onCompleted) 1978public Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default) => Task.CompletedTask;
BrowserLogsCdpConnectionTests.cs (24)
18public async Task ConnectAsync_DisposesConnectorWhenConnectFails() 36public async Task ConnectAsync_CorrelatesOutOfOrderResponsesAndRoutesEventsWhileCommandIsPending() 113public async Task CaptureScreenshotAsync_SendsPageCaptureScreenshotForTargetSession() 150public async Task CreateWithPipeTransport_UsesNullDelimitedFrames() 202public async Task MultiplexerLeasesShareCommandsAndBroadcastEvents() 248public async Task MultiplexerFaultsOnlyFailingSubscriberWhenEventHandlerThrows() 278public async Task MultiplexerRejectsNewLeasesAfterInnerConnectionCompletes() 366private static Task SendTextAsync(WebSocket socket, string text) 393private static async Task SendNullTerminatedFramesAsync(Stream stream, params string[] frames) 414public Task Completion => _completionSource.Task; 429return Task.FromResult(new BrowserLogsCreateTargetResult { TargetId = "created-target" }); 434return Task.FromResult(new BrowserLogsGetTargetsResult { TargetInfos = [] }); 439return Task.FromResult(new BrowserLogsAttachToTargetResult { SessionId = "attached-session" }); 444return Task.FromResult(BrowserLogsCommandAck.Instance); 449return Task.FromResult(BrowserLogsCommandAck.Instance); 452public Task EnablePageInstrumentationAsync(string sessionId, CancellationToken cancellationToken) 454return Task.CompletedTask; 459return Task.FromResult(new BrowserLogsCaptureScreenshotResult { Data = "image-data" }); 464return Task.FromResult(BrowserLogsCommandAck.Instance); 488public Task ConnectAsync(Uri webSocketUri, CancellationToken cancellationToken) 490return Task.CompletedTask; 515public Task ConnectAsync(Uri webSocketUri, CancellationToken cancellationToken) 517return Task.FromException(connectException); 589public override async Task FlushAsync(CancellationToken cancellationToken)
BrowserLogsPipeBrowserProcessLauncherTests.cs (1)
50public async Task Start_MapsPosixPipeDescriptorsToChildFd3AndFd4()
BrowserLogsRunningSessionTests.cs (7)
18public async Task RunningSessionRoutesPageEventsToResourceLogsAndReleasesHostOnCompletion() 35return Task.FromResult<IBrowserHost>(host); 81var observerTask = session.StartCompletionObserver((exitCode, error) => 84return Task.CompletedTask; 117public Task Termination => _terminationSource.Task; 137return Task.FromResult<IBrowserPageSession>(PageSession); 169return Task.FromResult(new BrowserLogsCaptureScreenshotResult { Data = Convert.ToBase64String([0x89, 0x50, 0x4e, 0x47]) });
BrowserLogsSessionManagerTests.cs (19)
43public async Task BrowserHostLease_ReleasesOnlyOnce() 59public async Task BrowserHostRegistry_ReusesHostUntilFinalLeaseReleasesIt() 76return Task.FromResult<IBrowserHost>(host); 99public async Task BrowserHostRegistry_LateLeaseReleaseAfterRegistryDisposeNoOps() 116return Task.FromResult<IBrowserHost>(host); 134public async Task BrowserHostRegistry_RejectsDifferentProfileForSharedHost() 146createHostAsync: (configuration, identity, _, _) => Task.FromResult<IBrowserHost>(new TestBrowserHost(identity, configuration.Profile))); 168public async Task BrowserHostRegistry_AdoptsValidatedSharedEndpointMetadataWhenAdoptionIsEnabled() 176var browserEndpoint = StartBrowserVersionEndpoint(out var serverTask); 253public async Task BrowserEndpointDiscovery_DeletesStaleMetadataBeforeProfileCompatibilityCheck() 283public async Task BrowserEndpointDiscovery_DoesNotEscapeNonAsciiMetadata() 313public async Task BrowserEndpointDiscovery_DeletesMalformedEndpointMetadata() 346public async Task BrowserEndpointDiscovery_ThrowsForLiveEndpointWithDifferentProfile() 355var browserEndpoint = StartBrowserVersionEndpoint(out var serverTask); 534public async Task StartSessionAsync_ThrowsWhenManagerIsDisposing() 575private static Uri StartBrowserVersionEndpoint(out Task serverTask) 581serverTask = Task.Run(async () => 657public Task Termination { get; } = Task.CompletedTask;
BrowserPageSessionTests.cs (23)
40public async Task StartAsync_ReusesStartupTargetAttachesInstrumentsNavigatesAndRoutesEvents() 102public async Task DisposeAsync_ClosesTrackedTarget() 141public async Task CaptureScreenshotAsync_UsesCurrentTargetSession() 171public async Task CaptureScreenshotAsync_IsCanceledWhenSessionIsDisposed() 195var disposeTask = session.DisposeAsync().AsTask(); 203public async Task MonitorAsync_ReconnectsToExistingTargetAfterConnectionLoss() 271public async Task MonitorAsync_CompletesWithConnectionLostWhenReconnectTimesOut() 289return Task.FromResult<IBrowserLogsCdpConnection>(firstConnection); 315_ = Task.Run(async () => 319await Task.Delay(10); 341return Task.FromResult<IBrowserLogsCdpConnection>(connection); 361public Task Termination => _terminationSource.Task; 406public Task Completion => _completionSource.Task; 408public Task InstrumentationEnabled => _instrumentationEnabled.Task; 413return Task.FromResult(new BrowserLogsCreateTargetResult { TargetId = CreatedTargetId }); 419return Task.FromResult(new BrowserLogsGetTargetsResult { TargetInfos = TargetInfos }); 425return Task.FromResult(new BrowserLogsAttachToTargetResult { SessionId = AttachSessionId }); 431return Task.FromResult(BrowserLogsCommandAck.Instance); 437return Task.FromResult(BrowserLogsCommandAck.Instance); 440public Task EnablePageInstrumentationAsync(string sessionId, CancellationToken cancellationToken) 444return Task.CompletedTask; 450return Task.FromResult(BrowserLogsCommandAck.Instance); 460await Task.Delay(Timeout.InfiniteTimeSpan, cancellationToken);
ConsoleLoggingTestHelpers.cs (2)
18_ = Task.Run(async () => 38return Task.Run(async () =>
src\Aspire.Hosting.Browsers\BrowserEndpointDiscovery.cs (1)
151public static async Task WriteAsync(BrowserHostIdentity identity, string? profileDirectoryName, Uri endpoint, int processId, CancellationToken cancellationToken)
src\Aspire.Hosting.Browsers\BrowserHost.cs (9)
35public abstract Task Termination { get; } 86private readonly Task _termination; 109public override Task Termination => _termination; 117return Task.FromResult(_connectionMultiplexer.CreateConnection(eventHandler)); 220private static async Task CompleteWhenProcessOrPipeEndsAsync(Task processTask, Task pipeTask) 225_ = await Task.WhenAny(processTask, pipeTask).ConfigureAwait(false); 270public override Task Termination => _terminationSource.Task;
src\Aspire.Hosting.Browsers\BrowserHostRegistry.cs (2)
270private async Task DisposeLockAsync() 272Task? lockUsersDrained = null;
src\Aspire.Hosting.Browsers\BrowserLogsBuilderExtensions.cs (1)
291Task RefreshBrowserLogsResourceAsync(ResourceNotificationService notifications) =>
src\Aspire.Hosting.Browsers\BrowserLogsCdpConnection.cs (13)
14Task Completion { get; } 26Task EnablePageInstrumentationAsync(string sessionId, CancellationToken cancellationToken); 52private readonly Task _receiveLoop; 62_receiveLoop = Task.Run(ReceiveLoopAsync); 65public Task Completion => _receiveLoop; 165public async Task EnablePageInstrumentationAsync(string sessionId, CancellationToken cancellationToken) 274private async Task ReceiveLoopAsync() 323private async Task HandleFrameAsync(byte[] frame) 393Task ConnectAsync(Uri webSocketUri, CancellationToken cancellationToken); 409public Task ConnectAsync(Uri webSocketUri, CancellationToken cancellationToken) 440Task SendAsync(ReadOnlyMemory<byte> frame, CancellationToken cancellationToken); 450public async Task SendAsync(ReadOnlyMemory<byte> frame, CancellationToken cancellationToken) 527public async Task SendAsync(ReadOnlyMemory<byte> frame, CancellationToken cancellationToken)
src\Aspire.Hosting.Browsers\BrowserLogsCdpConnectionMultiplexer.cs (10)
34public Task Completion => _innerConnection.Completion; 138private readonly Task _completion = CompleteWhenLeaseOrInnerConnectionCompletesAsync(owner._innerConnection.Completion, subscription.Completion); 141public Task Completion => _completion; 173public Task EnablePageInstrumentationAsync(string sessionId, CancellationToken cancellationToken) 210private static async Task CompleteWhenLeaseOrInnerConnectionCompletesAsync(Task innerCompletion, Task leaseCompletion) 212var completedTask = await Task.WhenAny(innerCompletion, leaseCompletion).ConfigureAwait(false); 225public Task Completion => _completionSource.Task;
src\Aspire.Hosting.Browsers\BrowserLogsConfigurationManager.cs (6)
75return Task.CompletedTask; 98return Task.CompletedTask; 119return Task.CompletedTask; 271internal Task ValidateInputsAsync(BrowserLogsResource resource, InputsDialogValidationContext context) 319return Task.CompletedTask; 420private Task PublishConfigurationSnapshotAsync(BrowserLogsResource resource, BrowserConfiguration browserConfiguration)
src\Aspire.Hosting.Browsers\BrowserLogsPipeBrowserProcessLauncher.Unix.cs (1)
128return await Task.Run(() =>
src\Aspire.Hosting.Browsers\BrowserLogsPipeBrowserProcessLauncher.Windows.cs (1)
217return await Task.Run(() =>
src\Aspire.Hosting.Browsers\BrowserLogsRunningSession.cs (12)
26Task StartCompletionObserver(Func<int?, Exception?, Task> onCompleted); 30Task StopAsync(CancellationToken cancellationToken); 171public Task StartCompletionObserver(Func<int?, Exception?, Task> onCompleted) 193public async Task StopAsync(CancellationToken cancellationToken) 211private async Task InitializeAsync(CancellationToken cancellationToken) 299private async Task ObserveCompletionAsync(Func<int?, Exception?, Task> onCompleted) 312private async Task CleanupAsync() 332private async Task DisposePageSessionAsync() 346private async Task DisposeBrowserHostLeaseAsync()
src\Aspire.Hosting.Browsers\BrowserLogsSessionManager.cs (7)
62public async Task StartSessionAsync(BrowserLogsResource resource, BrowserConfiguration configuration, string resourceName, Uri url, CancellationToken cancellationToken) 141var completionObserver = session.StartCompletionObserver(async (exitCode, error) => 257var completionObservers = new List<Task>(); 293await Task.WhenAll(completionObservers).ConfigureAwait(false); 314private async Task HandleSessionCompletedAsync( 370private Task PublishResourceSnapshotAsync( 611Task CompletionObserver);
src\Aspire.Hosting.Browsers\BrowserPageSession.cs (7)
233private async Task ConnectAsync(bool createTarget, CancellationToken cancellationToken) 336var completedTask = await Task.WhenAny(_host.Termination, connectionSnapshot.Completion, _completionSource.Task).ConfigureAwait(false); 422await Task.Delay(s_connectionRecoveryDelay, _timeProvider, _stopCts.Token).ConfigureAwait(false); 469private async Task DisposeConnectionAsync() 482private async Task DisposeConnectionCoreAsync() 493private sealed record ConnectionSnapshot(Task Completion);
src\Aspire.Hosting.Browsers\IBrowserHost.cs (1)
30Task Termination { get; }
src\Aspire.Hosting.Browsers\IBrowserLogsSessionManager.cs (1)
8Task StartSessionAsync(BrowserLogsResource resource, BrowserConfiguration configuration, string resourceName, Uri url, CancellationToken cancellationToken);
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
tests\Shared\TestInteractionService.cs (3)
89var workTask = work(progressContext); 92var finished = await Task.WhenAny(workTask, completionTask).ConfigureAwait(false);
Aspire.Hosting.CodeGeneration.Go.Tests (18)
AtsGoCodeGeneratorTests.cs (6)
26public async Task GenerateDistributedApplication_WithTestTypes_GeneratesCorrectOutput() 126public async Task Scanner_AddTestRedis_HasCorrectTypeMetadata() 138public async Task Scanner_WithPersistence_HasCorrectExpandedTargets() 150public async Task Scanner_WithOptionalString_HasCorrectExpandedTargets() 162public async Task Scanner_HostingAssembly_AddContainerCapability() 225public async Task TwoPassScanning_GeneratesWithEnvironmentOnTestRedisBuilder()
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (8)
229Func<TestCallbackContext, Task> asyncCallback) 251Func<IResourceBuilder<TestRedisResource>, Task> asyncConfigure) 508Func<TestEnvironmentContext, Task> callback) where T : IResourceWithEnvironment 556Func<TestCallbackContext, Task>? callback = null) where T : IResource 712return Task.FromResult("running"); 722Func<CancellationToken, Task> operation) where T : IResource 737return Task.FromResult(true); 749Func<TestCallbackContext, TestEnvironmentContext, Task> callback)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestTypes.cs (4)
80return Task.FromResult($"{Name}: {Value}"); 86public Task SetValueAsync(string value) 89return Task.CompletedTask; 97return Task.FromResult(!string.IsNullOrEmpty(Name));
Aspire.Hosting.CodeGeneration.Java.Tests (18)
AtsJavaCodeGeneratorTests.cs (6)
28public async Task GenerateDistributedApplication_WithTestTypes_GeneratesCorrectOutput() 156public async Task Scanner_AddTestRedis_HasCorrectTypeMetadata() 168public async Task Scanner_WithPersistence_HasCorrectExpandedTargets() 180public async Task Scanner_WithOptionalString_HasCorrectExpandedTargets() 192public async Task Scanner_HostingAssembly_AddContainerCapability() 290public async Task TwoPassScanning_GeneratesWithEnvironmentOnTestRedisBuilder()
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (8)
229Func<TestCallbackContext, Task> asyncCallback) 251Func<IResourceBuilder<TestRedisResource>, Task> asyncConfigure) 508Func<TestEnvironmentContext, Task> callback) where T : IResourceWithEnvironment 556Func<TestCallbackContext, Task>? callback = null) where T : IResource 712return Task.FromResult("running"); 722Func<CancellationToken, Task> operation) where T : IResource 737return Task.FromResult(true); 749Func<TestCallbackContext, TestEnvironmentContext, Task> callback)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestTypes.cs (4)
80return Task.FromResult($"{Name}: {Value}"); 86public Task SetValueAsync(string value) 89return Task.CompletedTask; 97return Task.FromResult(!string.IsNullOrEmpty(Name));
Aspire.Hosting.CodeGeneration.Python.Tests (18)
AtsPythonCodeGeneratorTests.cs (6)
26public async Task GenerateDistributedApplication_WithTestTypes_GeneratesCorrectOutput() 124public async Task Scanner_AddTestRedis_HasCorrectTypeMetadata() 136public async Task Scanner_WithPersistence_HasCorrectExpandedTargets() 148public async Task Scanner_WithOptionalString_HasCorrectExpandedTargets() 160public async Task Scanner_HostingAssembly_AddContainerCapability() 223public async Task TwoPassScanning_GeneratesWithEnvironmentOnTestRedisBuilder()
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (8)
229Func<TestCallbackContext, Task> asyncCallback) 251Func<IResourceBuilder<TestRedisResource>, Task> asyncConfigure) 508Func<TestEnvironmentContext, Task> callback) where T : IResourceWithEnvironment 556Func<TestCallbackContext, Task>? callback = null) where T : IResource 712return Task.FromResult("running"); 722Func<CancellationToken, Task> operation) where T : IResource 737return Task.FromResult(true); 749Func<TestCallbackContext, TestEnvironmentContext, Task> callback)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestTypes.cs (4)
80return Task.FromResult($"{Name}: {Value}"); 86public Task SetValueAsync(string value) 89return Task.CompletedTask; 97return Task.FromResult(!string.IsNullOrEmpty(Name));
Aspire.Hosting.CodeGeneration.Rust.Tests (19)
AtsRustCodeGeneratorTests.cs (6)
26public async Task GenerateDistributedApplication_WithTestTypes_GeneratesCorrectOutput() 125public async Task Scanner_AddTestRedis_HasCorrectTypeMetadata() 137public async Task Scanner_WithPersistence_HasCorrectExpandedTargets() 149public async Task Scanner_WithOptionalString_HasCorrectExpandedTargets() 161public async Task Scanner_HostingAssembly_AddContainerCapability() 224public async Task TwoPassScanning_GeneratesWithEnvironmentOnTestRedisBuilder()
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestExtensions.cs (8)
229Func<TestCallbackContext, Task> asyncCallback) 251Func<IResourceBuilder<TestRedisResource>, Task> asyncConfigure) 508Func<TestEnvironmentContext, Task> callback) where T : IResourceWithEnvironment 556Func<TestCallbackContext, Task>? callback = null) where T : IResource 712return Task.FromResult("running"); 722Func<CancellationToken, Task> operation) where T : IResource 737return Task.FromResult(true); 749Func<TestCallbackContext, TestEnvironmentContext, Task> callback)
tests\Aspire.Hosting.CodeGeneration.TypeScript.Tests\TestTypes\TestTypes.cs (4)
80return Task.FromResult($"{Name}: {Value}"); 86public Task SetValueAsync(string value) 89return Task.CompletedTask; 97return Task.FromResult(!string.IsNullOrEmpty(Name));
tests\Shared\TemporaryWorkspace.cs (1)
27public async Task InitializeGitAsync(CancellationToken cancellationToken = default)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (22)
AtsTypeScriptCodeGeneratorTests.cs (9)
66public async Task GenerateDistributedApplication_WithTestTypes_GeneratesCorrectOutput() 435public async Task Scanner_AddTestRedis_HasCorrectTypeMetadata() 500public async Task Scanner_WithPersistence_HasCorrectExpandedTargets() 512public async Task Scanner_WithOptionalString_HasCorrectExpandedTargets() 524public async Task Scanner_HostingAssembly_AddContainerCapability() 551public async Task Scanner_HostingAssembly_ContainerResourceCapabilities() 796public async Task Scanner_BaseTypeHierarchy_IsCollected() 1359public async Task TwoPassScanning_GeneratesWithEnvironmentOnTestRedisBuilder() 2206public async Task Generate_SameMethodNameOnDifferentTypes_MergesOptionsInterface()
tests\Shared\TemporaryWorkspace.cs (1)
27public async Task InitializeGitAsync(CancellationToken cancellationToken = default)
TestTypes\TestExtensions.cs (8)
229Func<TestCallbackContext, Task> asyncCallback) 251Func<IResourceBuilder<TestRedisResource>, Task> asyncConfigure) 508Func<TestEnvironmentContext, Task> callback) where T : IResourceWithEnvironment 556Func<TestCallbackContext, Task>? callback = null) where T : IResource 712return Task.FromResult("running"); 722Func<CancellationToken, Task> operation) where T : IResource 737return Task.FromResult(true); 749Func<TestCallbackContext, TestEnvironmentContext, Task> callback)
TestTypes\TestTypes.cs (4)
80return Task.FromResult($"{Name}: {Value}"); 86public Task SetValueAsync(string value) 89return Task.CompletedTask; 97return Task.FromResult(!string.IsNullOrEmpty(Name));
Aspire.Hosting.Containers.Tests (56)
ContainerResourceTests.cs (5)
92public async Task AddContainerWithArgs() 165public async Task EnsureContainerWithEndpointsEmitsContainerPort() 198public async Task EnsureContainerWithCustomEntrypointEmitsEntrypoint() 244public async Task EnsureContainerWithVolumesEmitsVolumes() 286public async Task EnsureContainerWithBindMountsEmitsBindMounts()
DockerSocketBindMountTests.cs (1)
14public async Task WithDockerSocketBindMountAllowsDockerCliInContainer()
ResourceFailureLoggingTests.cs (4)
20public async Task BadContainerRuntimeArg() 43public async Task BadImage() 67public async Task NeedsAuthentication() 91public async Task ContainerExitsImmediatelyAfterStart()
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
WithDockerfileTests.cs (31)
23public async Task WithBuildSecretPopulatesSecretFilesCorrectly() 54public async Task ContainerBuildLogsAreStreamedToAppHost() 95public async Task AddDockerfileUsesLowercaseResourceNameAsImageName(string resourceName) 119public async Task WithDockerfileUsesLowercaseResourceNameAsImageName(string resourceName) 144public async Task WithDockerfileUsesGeneratesDifferentHashForImageTagOnEachCall() 165public async Task WithDockerfileGeneratedImageTagCanBeOverridden() 193public async Task WithDockerfileLaunchesContainerSuccessfully() 228public async Task AddDockerfileLaunchesContainerSuccessfully() 260public async Task WithDockerfileResultsInBuildAttributeBeingAddedToManifest() 310public async Task AddDockerfileResultsInBuildAttributeBeingAddedToManifest() 359public async Task WithDockerfileWithBuildSecretResultsInManifestReferencingSecretParameter() 407public async Task AddDockerfileWithBuildSecretResultsInManifestReferencingSecretParameter() 455public async Task WithDockerfileWithParameterLaunchesContainerSuccessfully() 527public async Task AddDockerfileWithParameterLaunchesContainerSuccessfully() 645public async Task WithDockerfileWithValidContextPathValidDockerfileWithImplicitDefaultNameSucceeds() 662public async Task AddDockerfileWithValidContextPathValidDockerfileWithImplicitDefaultNameSucceeds() 678public async Task WithDockerfileWithValidContextPathValidDockerfileWithExplicitDefaultNameSucceeds() 695public async Task AddDockerfileWithValidContextPathValidDockerfileWithExplicitDefaultNameSucceeds() 711public async Task WithDockerfileWithValidContextPathValidDockerfileWithExplicitNonDefaultNameSucceeds() 728public async Task AddDockerfileWithValidContextPathValidDockerfileWithExplicitNonDefaultNameSucceeds() 744public async Task WithDockerfileWithValidContextPathValidDockerfileWithExplicitAbsoluteDefaultNameSucceeds() 761public async Task AddDockerfileWithValidContextPathValidDockerfileWithExplicitAbsoluteDefaultNameSucceeds() 776private static async Task WaitForResourceAsync(DistributedApplication app, string resourceName, string resourceState, TimeSpan? timeout = null) 784public async Task WithDockerfileFactorySyncFactoryCreatesAnnotationWithFactory() 832public async Task WithDockerfileFactoryAsyncFactoryCreatesAnnotationWithFactory() 844await Task.Delay(1, context.CancellationToken); 865public async Task WithDockerfileFactoryGeneratesFileAtBuildTime() 888public async Task WithDockerfileFactoryWithStageAndBuildArgs() 910public async Task ManifestPublishingWritesDockerfileToResourceSpecificPath() 947public async Task WithDockerfile_AutomaticallyGeneratesBuildStep_WithCorrectDependencies() 988public async Task WithDockerfile_CalledMultipleTimes_OverwritesPreviousBuildStep()
Aspire.Hosting.DevTunnels (29)
DevTunnelCli.cs (6)
244var stdoutTask = Task.CompletedTask; 245var stderrTask = Task.CompletedTask; 290await Task.WhenAll(stdoutTask, stderrTask).ConfigureAwait(false); 380private static async Task PumpAsync(StreamReader reader, Action<string> onLine, CancellationToken cancellationToken = default)
DevTunnelCliClient.cs (2)
149await Task.Delay(_cliRetryOnErrorDelay, cancellationToken).ConfigureAwait(false); 237await Task.Delay(_cliRetryOnErrorDelay, cancellationToken).ConfigureAwait(false);
DevTunnelHealthCheck.cs (1)
69_ = Task.Run(() => _loggedOutNotificationManager.NotifyUserLoggedOutAsync(cancellationToken).ConfigureAwait(false));
DevTunnelLoginManager.cs (2)
23public Task EnsureUserLoggedInAsync(CancellationToken cancellationToken = default) => RunAsync(cancellationToken); 25protected override async Task ExecuteCoreAsync(CancellationToken cancellationToken)
DevTunnelResourceBuilderExtensions.cs (8)
165await Task.WhenAll(tunnelResource.Ports.Select(p => p.TargetEndpoint.GetValueAsync(ct).AsTask())).ConfigureAwait(false); 171var portTasks = new List<Task> { DeleteUnmodeledPortsAsync() }; 173await Task.WhenAll(portTasks).ConfigureAwait(false); 175async Task DeleteUnmodeledPortsAsync() 178var modeledPortNumbers = (await Task.WhenAll(tunnelResource.Ports.Select(p => p.GetTunnelPortAsync(ct).AsTask())).ConfigureAwait(false)).ToHashSet(); 183await Task.WhenAll(unmodeledPorts.Select(p => devTunnelClient.DeletePortAsync(tunnelResource.ResolvedTunnelId, p.PortNumber, logger, ct))).ConfigureAwait(false); 187async Task StartPortAsync(DevTunnelPortResource portResource) 228return Task.CompletedTask;
LoggedOutNotificationManager.cs (2)
10public Task NotifyUserLoggedOutAsync(CancellationToken cancellationToken = default) => RunAsync(cancellationToken); 12protected override async Task ExecuteCoreAsync(CancellationToken cancellationToken)
src\Shared\CoalescingAsyncOperation.cs (8)
15private Task? _runningTask; 22protected abstract Task ExecuteCoreAsync(CancellationToken cancellationToken); 29public async Task RunAsync(CancellationToken cancellationToken = default) 31Task current; 62private async Task ExecuteWrapperAsync(CancellationToken ct) => await ExecuteCoreAsync(ct).ConfigureAwait(false); 64private void ClearCompleted(Task completed) 70private async Task ClearCompletedAsync(Task completed)
Aspire.Hosting.DevTunnels.Tests (43)
DevTunnelCliClientTests.cs (1)
11public async Task CreateTunnelAsync_WhenCreateConflictsAndUpdateIsNotFound_FailsWithoutRetrying()
DevTunnelCliVersionValidationTests.cs (1)
24public async Task ValidateDevTunnelCliVersionAsync_ReturnsInvalidForUnsupportedVersion(string testVersion, bool expectedIsValid)
DevTunnelResourceBuilderExtensionsTests.cs (13)
22public async Task WithReference_InjectsServiceDiscoveryEnvironmentVariablesWhenReferencingOtherResourcesViaTheTunnel() 103public async Task WithReference_UsesTargetPortForDevTunnelPortWhenAvailable() 118public async Task WithReference_UsesAllocatedPortForContainerDevTunnelPort() 137public async Task WithReference_ResolvesDynamicTargetPortForDevTunnelPortWhenAvailable() 157public async Task WithReference_UsesAllocatedPortForDevTunnelPortWhenTargetPortIsUnavailable() 176public async Task AddDevTunnel_WithRegion_UsesResolvedTunnelIdForExecutableArgs() 193public async Task OnBeforeResourceStarted_WithRegion_UsesResolvedTunnelIdForPortOperations() 234public async Task DevTunnelHealthCheck_WithRegion_UsesResolvedTunnelIdForTunnelAndAccessOperations() 410public async Task ShowTunnelUrlsCommand_OpensInteractionWithRelevantUrls() 500public async Task ShowTunnelUrlsCommand_OpensInteractionWithoutLocalEndpointAllocation() 541public async Task ShowTunnelUrlsCommand_UsesTargetEndpointNetworkContext() 589public async Task ResourceReady_PublishesUrlProperties() 654=> Task.FromResult(RequiredCommandValidationResult.Success());
TestDevTunnelCli.cs (1)
74return Task.FromResult(result.ExitCode);
TestDevTunnelClient.cs (9)
27return Task.FromResult(_cliVersion); 33return Task.FromResult(LoginStatus); 39return Task.FromResult(LoginStatus with { Provider = provider }); 45return Task.FromResult(new DevTunnelStatus(tunnelId, HostConnections: 1, ClientConnections: 0, Description: "", Labels: [])); 51return Task.FromResult(PortList); 57return Task.FromResult(new DevTunnelPortStatus(tunnelId, portNumber, options.Protocol ?? "https", ClientConnections: 0)); 63return Task.FromResult(new DevTunnelPortDeleteResult(portNumber.ToString(CultureInfo.InvariantCulture))); 69return Task.FromResult(TunnelStatus); 75return Task.FromResult(AccessStatus);
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
tests\Shared\TestInteractionService.cs (3)
89var workTask = work(progressContext); 92var finished = await Task.WhenAny(workTask, completionTask).ConfigureAwait(false);
Aspire.Hosting.Docker (19)
DockerComposeEnvironmentContext.cs (2)
134private static async Task ProcessEnvironmentVariablesAsync(DockerComposeServiceResource serviceResource, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken) 167private static async Task ProcessArgumentsAsync(DockerComposeServiceResource serviceResource, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken)
DockerComposeEnvironmentExtensions.cs (2)
39return Task.CompletedTask; 53return Task.CompletedTask;
DockerComposeEnvironmentResource.cs (7)
272private Task PublishAsync(PipelineStepContext context) 293private async Task PrepareDeploymentTargetsAsync(PipelineStepContext context) 396return Task.CompletedTask; 401private async Task DockerComposeUpAsync(PipelineStepContext context) 445private async Task DockerComposeDownAsync(PipelineStepContext context) 483private static async Task ConfirmDestroyAsync(PipelineStepContext context, string environmentName) 518private async Task PrepareAsync(PipelineStepContext context)
DockerComposePublishingContext.cs (2)
42internal async Task WriteModelAsync(DistributedApplicationModel model, DockerComposeEnvironmentResource environment) 66private async Task WriteDockerComposeOutputAsync(DistributedApplicationModel model, DockerComposeEnvironmentResource environment)
DockerComposeServiceResource.cs (2)
217private async Task AddEnvironmentVariablesAndCommandLineArgsAsync(Service composeService) 325private async Task PrintEndpointsAsync(PipelineStepContext context, DockerComposeEnvironmentResource environment)
src\Aspire.Hosting\Dcp\Process\ProcessUtil.cs (4)
143_ = Task.Run(async () => 150await Task.WhenAll(stdoutComplete.Task, stderrComplete.Task).ConfigureAwait(false); 245private readonly Task _processLifetimeTask; 248public ProcessDisposable(System.Diagnostics.Process process, Task processLifetimeTask, bool entireProcessTree)
Aspire.Hosting.Docker.Tests (98)
DockerComposePublisherTests.cs (35)
20public async Task PublishAsync_GeneratesValidDockerComposeFile() 110public async Task DockerComposeWithProjectResources() 147public async Task DockerComposeCorrectlyEmitsPortMappings() 200public async Task DockerComposeAppliesServiceCustomizations() 255public async Task DockerComposeDoesNotOverwriteEnvFileOnPublish() 286public async Task DockerComposeAppendsNewKeysToEnvFileOnPublish() 327public async Task DockerComposeMapsPortsProperly() 353public async Task DockerComposeSetsServicePullPolicyFromAnnotation() 382public async Task DockerComposeSetsServicePullPolicyManually() 414public async Task DockerComposeSetsServicePrivilegedManually() 444public async Task PublishAsync_WithDashboardEnabled_IncludesDashboardService() 470public async Task PublishAsync_WithDashboardDisabled_DoesNotIncludeDashboardService() 496public async Task PublishAsync_WithDashboard_UsesCustomConfiguration() 524public async Task PublishAsync_MultipleResourcesWithOtlp_ConfiguresAllForDashboard() 556public async Task PublishAsync_WithDockerfileFactory_WritesDockerfileToOutputFolder() 601public async Task PrepareStep_GeneratesCorrectEnvFileWithDefaultEnvironmentName() 629public async Task PrepareStep_GeneratesCorrectEnvFileWithCustomEnvironmentName() 661public async Task PrepareStep_GeneratesEnvFileWithVariousParameterTypes() 755public async Task PrepareStep_ResolvesArbitraryIValueProviderSource() 782public async Task PrepareStep_SkipsParameterResolutionWhenStaticDefaultIsSet() 813public async Task PrepareStep_ResolvesContainerImageReferenceViaIValueProvider() 841public async Task PublishAsync_BindMounts_ReplacedWithEnvironmentPlaceholders() 869public async Task PublishAsync_DockerSocket_NotReplacedWithPlaceholder() 898public async Task PublishAsync_MixedBindMountsAndVolumes() 927public async Task PublishAsync_ConfigureEnvFile_AllowsMutatingCapturedEnvVars() 966public async Task PublishAsync_ConfigureEnvFile_CanRemoveGeneratedPlaceholder() 1014public async Task PublishAsync_WindowsAbsoluteBindMountPath_ReplacedWithEnvironmentPlaceholders() 1048public async Task PublishAsync_HandlesConditionalReferenceExpression() 1089public async Task PublishAsync_HandlesConditionalReferenceExpressionWithParameterCondition() 1137public Task BuildImageAsync(IResource resource, CancellationToken cancellationToken = default) 1140return Task.CompletedTask; 1143public Task BuildImagesAsync(IEnumerable<IResource> resources, CancellationToken cancellationToken = default) 1146return Task.CompletedTask; 1149public Task PushImageAsync(IResource resource, CancellationToken cancellationToken) 1151return Task.CompletedTask;
DockerComposeTests.cs (41)
29public async Task DockerComposeSetsComputeEnvironment() 68public async Task DockerComposeOnlyExposesExternalEndpoints() 94public async Task PublishAsDockerComposeService_ThrowsIfNoEnvironment() 96static async Task RunTest(Action<IDistributedApplicationBuilder> action) 125public async Task ValidateDockerCompose_DoesNotThrowInRunMode() 145public async Task MultipleDockerComposeEnvironmentsSupported() 171public async Task DashboardWithForwardedHeadersWritesEnvVar() 195public async Task DockerSwarmDeploymentLabelsSerializedCorrectly() 231public async Task DockerSwarmUpdateConfigSerializedCorrectly() 268public async Task GetHostAddressExpression() 289public Task BuildImageAsync(IResource resource, CancellationToken cancellationToken = default) 292return Task.CompletedTask; 295public Task BuildImagesAsync(IEnumerable<IResource> resources, CancellationToken cancellationToken = default) 298return Task.CompletedTask; 301public Task PushImageAsync(IResource resource, CancellationToken cancellationToken) 303return Task.CompletedTask; 309public async Task DockerComposeProjectNameIncludesAppHostShaInArguments() 370public async Task DashboardPrintSummaryStepIsCreatedAndWiredCorrectly() 407public async Task DeployWithDashboard_PrintsDashboardAndServiceEndpoints() 504public async Task FullRemoteImageName_WithNoRegistry_UsesLocalImageName() 528public async Task FullRemoteImageName_WithSingleRegistry_UsesRegistryEndpoint() 552public async Task FullRemoteImageName_WithSingleRegistry_NoWithContainerRegistry_UsesRegistryEndpoint() 575public async Task FullRemoteImageName_WithSingleRegistryNoRepository_UsesRegistryEndpointWithoutRepository() 599public async Task FullRemoteImageName_WithMultipleRegistries_ResourceWithExplicitRegistry() 627public async Task FullRemoteImageName_ContainerResource_WithRegistry() 652public async Task FullRemoteImageName_WithAzureContainerRegistry_UsesRegistryEndpoint() 682public async Task PushImageToRegistry_WithLocalRegistry_OnlyTagsImage() 713public async Task PushImageToRegistry_WithRemoteRegistry_PushesImage() 741public Task BuildImageAsync(IResource resource, CancellationToken cancellationToken = default) 742=> Task.CompletedTask; 744public Task BuildImagesAsync(IEnumerable<IResource> resources, CancellationToken cancellationToken = default) 745=> Task.CompletedTask; 747public Task PushImageAsync(IResource resource, CancellationToken cancellationToken) 752public async Task DockerComposeUp_DependsOnPushSteps_WhenResourcesNeedToBePushed() 800public async Task DockerComposeUp_DependsOnMultiplePushSteps_WhenMultipleResourcesNeedToBePushed() 852public async Task MultipleComputeEnvironmentsOnlyProcessTargetedResources() 919public async Task RunningTheDeploymentTargetHooksTwiceLeavesOneTargetPerEnvironment() 953private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken); 956public async Task DestroyCompose_WithState_RunsComposeDown() 999public async Task DestroyCompose_WithNoState_ReportsNothingToDestroy() 1030public async Task DeployThenDestroy_RoundTrip_UsesPersistedState()
tests\Shared\InMemoryDeploymentStateManager.cs (8)
32return Task.FromResult(new DeploymentStateSection(sectionName, data, version)); 34return Task.FromResult(new DeploymentStateSection(sectionName, [], 0)); 37public Task SaveSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 41return Task.CompletedTask; 44public Task DeleteSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 48return Task.CompletedTask; 51public Task ClearAllStateAsync(CancellationToken cancellationToken = default) 55return Task.CompletedTask;
tests\Shared\TestPipelineActivityReporter.cs (14)
133public Task CompletePublishAsync(PublishCompletionOptions? options = null, CancellationToken cancellationToken = default) 142return Task.CompletedTask; 147public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 175return Task.FromResult<IReportingStep>(new TestReportingStep(this, title, _testOutputHelper)); 193public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 202return Task.CompletedTask; 213return Task.FromResult<IReportingTask>(new TestReportingTask(_reporter, statusText, _testOutputHelper)); 250public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 272public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 280return Task.CompletedTask; 283public Task UpdateAsync(string statusText, CancellationToken cancellationToken = default) 291return Task.CompletedTask; 294public Task UpdateAsync(MarkdownString statusText, CancellationToken cancellationToken = default) 300public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Dotnet (2)
DotnetProjectHostingExtensions.cs (1)
217return Task.CompletedTask;
DotnetProjectResource.cs (1)
66Task.FromException(new DistributedApplicationException(GetUnsupportedPublishMessage(Name))));
Aspire.Hosting.Dotnet.Tests (51)
DotnetProjectResourceTests.cs (36)
39public async Task AddDotnetProject_ProjectFile_ProducesDotnetRunProjectArgs() 57public async Task AddDotnetProject_FileBasedApp_ProducesDotnetRunFileArgs() 113public async Task AddDotnetProject_InPublishMode_ManifestPublishingThrows(string appKind) 136public async Task AddDotnetProject_InPublishMode_PipelineThrows(string step) 151public async Task AddDotnetProject_InPublishMode_ManifestPipelineFailsBeforeCreatingOutput() 170public async Task AddDotnetProject_InPublishMode_BlocksSiblingPublishAndDeployWork(string step) 186return Task.CompletedTask; 200public async Task AddDotnetProject_InDeployMode_BlocksWorkWiredByLaterConfigurationCallback(string workRootStep) 217return Task.CompletedTask; 224Action = _ => Task.CompletedTask, 241public async Task AddDotnetProject_InBuildMode_DoesNotRunPublishValidation() 258return Task.CompletedTask; 271public async Task AddDotnetProject_InPushMode_DoesNotRunPublishValidation() 286return Task.CompletedTask; 299public async Task AddDotnetProject_InRunMode_DoesNotGateSharedBeforeStartWork() 312Action = _ => Task.CompletedTask, 318Action = _ => Task.CompletedTask, 328public async Task DirectlyConstructedDotnetProjectResource_InPublishMode_PipelineThrows() 340public async Task MultipleDotnetProjectResources_WithExplicitOptIns_InPublishMode_PipelineThrows() 361public async Task AddDotnetProject_ExcludedFromManifest_DoesNotFailPublishing() 377public async Task AddDotnetProject_WithManifestPublishingCallback_ProducesCustomManifest() 393public async Task AddDotnetProject_PublishAsDockerFile_ProducesContainerManifest() 472public async Task AddDotnetProject_MaterializesEndpointsFromLaunchProfile() 532public async Task AddDotnetProject_DebugAnnotator_ProducesProjectLaunchConfiguration() 559public async Task AddDotnetProject_LaunchConfiguration_ResolvesEffectiveLaunchProfile() 592public async Task AddDotnetProject_CustomLaunchToolArgs_ReplaceDotnetRunScaffoldingInRunMode() 609public async Task AddDotnetProject_CustomLaunchToolArgs_ReplaceDotnetRunScaffoldingInPublishMode() 629public async Task AddDotnetProject_CustomLaunchToolArgs_PreserveLaunchProfileArguments(bool inDebugSession) 673public async Task AddDotnetProject_InDebugSession_OmitsDotnetRunScaffolding() 700public async Task AddDotnetProject_InDebugSession_KeepsDotnetRunArgs_WhenProjectLaunchUnsupported() 731public async Task AddDotnetProject_InDebugSession_KeepsDotnetRunArgs_WhenActiveCustomDebugSupportDoesNotOwnInvocation() 763public async Task AddDotnetProject_InDebugSession_OmitsDotnetRunScaffolding_WhenActiveCustomDebugSupportOwnsLaunchToolArgs() 793public async Task AddDotnetProject_InDebugSession_OmitsDotnetRunScaffolding_WhenOwnedLaunchToolArgsAreEmpty() 824public async Task AddDotnetProject_InDebugSession_EffectivePersistentLifetimeKeepsDotnetRunProjectArgs(PersistenceMode persistenceMode) 867public async Task AddDotnetProject_FileBasedApp_InDebugSession_PersistentLifetimeKeepsDotnetRunFileArgs() 913private static async Task ExecutePipelineAsync(DistributedApplication app)
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
Aspire.Hosting.DotnetTool.Tests (29)
AddDotnetToolTests.cs (12)
69public async Task AddDotnetToolWithDefaultSettingsGeneratesCorrectArgs() 88public async Task AddDotnetToolWithVersionGeneratesCorrectArgs() 110public async Task AddDotnetToolWithPrereleaseGeneratesCorrectArgs() 131public async Task AddDotnetToolWithCustomSourceGeneratesCorrectArgs() 153public async Task AddDotnetToolWithMultipleSourcesGeneratesCorrectArgs() 178public async Task AddDotnetToolWithIgnoreExistingFeedsUsesSourceInsteadOfAddSource() 201public async Task AddDotnetToolWithIgnoreFailedSourcesGeneratesCorrectArgs() 222public async Task AddDotnetToolWithAdditionalArgsPassedThrough() 244public async Task AddDotnetToolWithComplexConfigurationGeneratesCorrectArgs() 330public async Task RemovingToolAnnotationResultsInNoArgs() 348public async Task AddDotnetToolGeneratesCorrectManifest() 382public async Task CustomLaunchToolArgsReplaceBuiltInInvocationInArgumentsAndManifest()
DotnetToolFunctionalTests.cs.cs (2)
12public async Task VerifyDotnetToolResource() 33public async Task VerifyNonExistentDotnetToolResource()
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
Aspire.Hosting.EntityFrameworkCore (14)
EFCoreOperationExecutor.cs (4)
300var logTask = CaptureLogsAsync(loggerService.WatchAsync(_toolResource), _logger, dataBuilder, logCancellation.Token); 326await Task.Delay(100, _cancellationToken).ConfigureAwait(false); 395internal static async Task CaptureLogsAsync( 426internal static async Task StreamOutputAsync(
EFMigrationResourceBuilderExtensions.cs (5)
43var _ = ExecuteMigrationsAsync(@event.Services, migrationResource, ct); 44return Task.CompletedTask; 49private static async Task ExecuteMigrationsAsync( 320builder.WithDockerfileFactory(buildContext, _ => Task.FromResult(GenerateDockerfile(migrationResource))); 343return Task.CompletedTask;
EFResourceBuilderExtensions.cs (5)
352private static async Task ExecutePublishPipelineOperationAsync( 504var stdoutTask = EFCoreOperationExecutor.StreamOutputAsync( 506var stderrTask = EFCoreOperationExecutor.StreamOutputAsync( 509await Task.WhenAll(stdoutTask, stderrTask).ConfigureAwait(false); 896private static Task UpdateStateAsync(
Aspire.Hosting.EntityFrameworkCore.Tests (25)
AddEFMigrationsTests.cs (1)
231public async Task ToolResourceInheritsConnectionStringFromMigrationReference()
EFCoreOperationExecutorTests.cs (13)
17public async Task CaptureLogsAsync_ErrorPrefixedLinesLoggedAsError() 34public async Task CaptureLogsAsync_InfoPrefixedLinesLoggedAsInformation() 51public async Task CaptureLogsAsync_DataPrefixedLinesGoToDataBuilder() 66public async Task CaptureLogsAsync_StderrLinesLoggedAsError() 82public async Task CaptureLogsAsync_MixedOutputRoutesCorrectly() 103public async Task CaptureLogsAsync_VerbosePrefixedLinesLoggedAsDebug() 119public async Task CaptureLogsAsync_NoErrorsProducesNoErrorLogEntries() 136public async Task UpdateDatabaseAsync_ReturnsFailureWhenStartCommandFails() 141var toolResource = CreateToolResource(_ => Task.FromResult(CommandResults.Failure("tool startup failed"))); 159public async Task UpdateDatabaseAsync_ReturnsFailureWhenStartCommandIsCanceled() 164var toolResource = CreateToolResource(_ => Task.FromResult(CommandResults.Canceled())); 182public async Task GatherToolArgumentsAsync_ReplaysLaunchAndOrdinaryCallbacksForSequentialCommands() 237await Task.CompletedTask;
EFMigrationPipelineTests.cs (11)
18public async Task BundleOnlyProducesGenerateStep() 35public async Task ScriptOnlyProducesScriptStep() 50public async Task ScriptAndBundleProducesAllStepsWithDependencies() 70public async Task NoPublishOptionsProducesNoSteps() 82public async Task MultipleBundlesOnSameProjectAreSerializedByChainingSteps() 105public async Task MultipleMigrationsOnSameProjectChainScriptAndBundleAcrossResources() 136public async Task MigrationsOnDifferentProjectsAreAlsoChained() 161public async Task MixedScriptOnlyAndBundleOnlyMigrationsAreChained() 184public async Task MigrationsWithoutPublishOptionsAreSkippedFromChain() 211public async Task PublishBundleContainerProducesNoStepsInRunMode() 708public async Task PublishBundleContainerMakesBuildStepDependOnGenerateStep()
Aspire.Hosting.Foundry (38)
FoundryExtensions.cs (3)
288=> Task.Run(async () => 348_ = Task.Run(async () => 417return Task.CompletedTask;
FoundryLocalHealthCheck.cs (2)
14return Task.FromResult(HealthCheckResult.Unhealthy("Foundry Local not running")); 17return Task.FromResult(HealthCheckResult.Healthy());
FoundryLocalService.cs (7)
28public static async Task StartAsync(ILogger logger, CancellationToken cancellationToken) 61public static async Task LoadModelAsync(string modelId, CancellationToken cancellationToken) 78public static async Task StopAsync(CancellationToken cancellationToken) 118private static async Task StartCliServiceAsync(ILogger logger, CancellationToken cancellationToken) 370public Task StartAsync(CancellationToken cancellationToken) 372return Task.CompletedTask; 375public Task StopAsync(CancellationToken cancellationToken)
HostedAgent\AzureHostedAgentResource.cs (3)
140private async Task PublishAsync(ManifestPublishingContext ctx) 187private async Task UpdateAgentEndpointProtocolsAsync(AgentAdministrationClient agentsClient, HostedAgentConfiguration configuration, CancellationToken cancellationToken) 239private async Task AssignFoundryRoleToAgentIdentityAsync(
HostedAgent\HostedAgentBuilderExtension.cs (2)
344return Task.CompletedTask; 351return Task.CompletedTask;
Project\ProjectResource.cs (1)
60return Task.CompletedTask;
PromptAgent\AzurePromptAgentResource.cs (11)
100return Task.FromResult<IEnumerable<PipelineStep>>(steps); 176private Task PublishAsync(ManifestPublishingContext ctx) 188return Task.CompletedTask; 291private Task DeployBeforeStartAsync(PipelineStepContext context) 295return Task.CompletedTask; 300return Task.CompletedTask; 308_ = Task.Run(async () => 321private async Task DeployForRunModeAsync( 387private async Task WaitForProjectAndToolsAsync(ResourceNotificationService notificationService, CancellationToken cancellationToken) 408.OfType<Task>(); 410await Task.WhenAll(toolConnectionProvisioningTasks.Select(task => task.WaitAsync(cancellationToken))).ConfigureAwait(false);
ToolResources\AzureFunctionToolResource.cs (1)
110return Task.FromResult<ResponseTool>(new AzureFunctionTool(definition));
ToolResources\BuiltInToolDefinitions.cs (5)
34return Task.FromResult<ResponseTool>(new CodeInterpreterTool(container)); 67return Task.FromResult<ResponseTool>(ResponseTool.CreateFileSearchTool(VectorStoreIds)); 95return Task.FromResult<ResponseTool>(ResponseTool.CreateWebSearchTool()); 118return Task.FromResult<ResponseTool>(new ImageGenerationTool()); 171return Task.FromResult<ResponseTool>(
ToolResources\ConfigOnlyToolDefinitions.cs (2)
50return Task.FromResult<ResponseTool>(new SharepointPreviewTool(options)); 94return Task.FromResult<ResponseTool>(new MicrosoftFabricPreviewTool(options));
ToolResources\FunctionToolResource.cs (1)
71return Task.FromResult<ResponseTool>(
Aspire.Hosting.Foundry.Tests (54)
AddProjectTests.cs (1)
27public async Task AddProject_WithReference_ShouldBindUriConnectionProperty()
HostedAgentExtensionTests.cs (9)
96public async Task AsHostedAgent_InRunMode_SendMessageCommandRejectsWhitespaceMessage() 125public async Task AsHostedAgent_InRunMode_WithInvocationsProtocol_ConfiguresEndpointAndCommand() 158public async Task AsHostedAgent_InRunMode_WithInvocationsProtocol_SendsJsonMessageRequestBody() 355public async Task AsHostedAgent_InPublishMode_AddsProjectReferenceToDeploymentTarget() 408public async Task AsHostedAgent_InPublishMode_IgnoresProjectEndpointTargetPortEnvironment() 558public async Task GetResolvedEnvironmentVariables_DoesNotForwardFoundryReservedTargetEnvironmentVariables() 678public async Task AsHostedAgent_InRunMode_WithProject_ExecutesBeforeStartHooksWithoutContainerRegistry() 693public async Task FoundryProject_DefaultRegistryDoesNotAddGlobalRegistryTargets() 713private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken);
ProjectResourceTests.cs (3)
69public async Task WithAzureContainerRegistry_RemovesDefaultContainerRegistryDuringBeforeStart() 93public async Task AddProject_WithoutHostedAgents_RemovesDefaultContainerRegistryDuringBeforeStart() 239private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken);
ProjectWithReferenceTests.cs (4)
12public async Task WithReference_InjectsFoundryProjectEndpointAsConnectionProperty() 31public async Task WithReference_InjectsApplicationInsightsAsConnectionProperty() 50public async Task WithReference_InjectsStandardConnectionString() 69public async Task WithReference_DeploymentInjectsModelNameAsConnectionProperty()
PromptAgentTests.cs (4)
85public async Task AddPromptAgent_SendMessageCommand_WhenCanceled_ReturnsCanceled() 504public async Task AddPromptAgent_WithReference_ShouldBindConnectionString() 582public async Task AddPromptAgent_RunMode_BeforeStartStepDependsOnPrepareResources() 621public async Task AddPromptAgent_RunMode_BeforeStartPipelineExecutesSuccessfully()
StaticValueProviderTests.cs (4)
9public async Task GetValueAsync_ReturnsSetValue() 19public async Task GetValueAsync_ThrowsIfNotSet() 37public async Task ConstructorWithValue_SetsImmediately() 46public async Task GetValueAsync_WithIntType_ReturnsStringRepresentation()
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
tests\Shared\TestPipelineActivityReporter.cs (14)
133public Task CompletePublishAsync(PublishCompletionOptions? options = null, CancellationToken cancellationToken = default) 142return Task.CompletedTask; 147public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 175return Task.FromResult<IReportingStep>(new TestReportingStep(this, title, _testOutputHelper)); 193public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 202return Task.CompletedTask; 213return Task.FromResult<IReportingTask>(new TestReportingTask(_reporter, statusText, _testOutputHelper)); 250public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 272public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 280return Task.CompletedTask; 283public Task UpdateAsync(string statusText, CancellationToken cancellationToken = default) 291return Task.CompletedTask; 294public Task UpdateAsync(MarkdownString statusText, CancellationToken cancellationToken = default) 300public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Garnet (1)
GarnetBuilderExtensions.cs (1)
174return Task.CompletedTask;
Aspire.Hosting.Garnet.Tests (15)
AddGarnetTests.cs (10)
71public async Task GarnetCreatesConnectionString() 88public async Task VerifyWithoutPasswordManifest() 122public async Task VerifyWithPasswordManifest() 162public async Task VerifyManifestWithPersistence() 248public async Task WithDataVolumeAddsPersistenceAnnotation() 261public async Task WithDataVolumeDoesNotAddPersistenceAnnotationIfIsReadOnly() 272public async Task WithDataBindMountAddsPersistenceAnnotation() 291public async Task WithDataBindMountDoesNotAddPersistenceAnnotationIfIsReadOnly() 302public async Task WithPersistenceReplacesPreviousAnnotationInstances() 331public async Task AddGarnetContainerWithPasswordAnnotationMetadata()
GarnetFunctionalTests.cs (5)
21public async Task VerifyWaitForOnGarnetBlocksDependentResources() 40var pendingStart = app.StartAsync(cts.Token); 59public async Task VerifyGarnetResource() 104public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume) 256public Task Garnet_WithPersistentLifetime_ReusesContainer()
Aspire.Hosting.GitHub.Models.Tests (19)
GitHubModelsExtensionTests.cs (2)
66public async Task WithApiKeySetFromParameter() 144public async Task ConnectionStringExpressionWithOrganizationResolvesCorrectly()
GitHubModelsFunctionalTests.cs (2)
17public async Task DependentResourceWaitsForGitHubModelResourceWithHealthCheckToBeHealthy() 39var pendingStart = app.StartAsync(cts.Token);
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
Aspire.Hosting.Go.Tests (57)
AddGoAppTests.cs (39)
21public async Task VerifyManifest_GoRunDot() 59public async Task VerifyManifest_AddGoApp_PackagePath() 82public async Task VerifyPublish_PackagePath_UsedInDockerfileBuildCommand() 103public async Task VerifyManifest_AddGoApp_BuildTagsParam() 127public async Task VerifyManifest_AddGoApp_LdFlagsParam() 151public async Task VerifyManifest_AddGoApp_GcFlagsParam() 175public async Task VerifyManifest_AddGoApp_RaceDetectorParam() 199public async Task VerifyManifest_AddGoApp_AllBuildParams() 232public async Task VerifyManifest_WithAppArgs() 260public async Task VerifyManifest_WithModTidy_DoesNotAlterMainManifest() 286public async Task VerifyManifest_WithModVendor_DoesNotAlterMainManifest() 311public async Task VerifyManifest_WithModDownload_DoesNotAlterMainManifest() 336public async Task VerifyManifest_WithDelveServer() 363public async Task VerifyManifest_WithDelveServer_EnableAcceptMultiClient() 391public async Task VerifyManifest_WithDelveServer_DisableOnlySameUser() 419public async Task VerifyManifest_WithDelveServer_ContinueOnStart() 447public async Task VerifyManifest_WithDelveServer_EnableLog() 480public async Task WithDelveServer_UsesDelveCommandWhenGoLaunchConfigurationIsSupported() 504public async Task WithVSCodeDebugging_PopulatesGoLaunchConfiguration() 527public async Task WithVSCodeDebugging_OmitsBuildFlagsWhenNoneConfigured() 541public async Task WithVSCodeDebugging_KeepsGoToolArgumentsInTheAppModel() 587public async Task WithVSCodeDebugging_GoToolArgumentsLeadTheCommandLineRegardlessOfCallOrder() 611public async Task WithVSCodeDebugging_DoesNotRemoveGoToolArguments_WhenGoLaunchConfigurationUnsupported() 648public async Task VerifyManifest_WithDelveServer_AndBuildFlags() 680public async Task VerifyManifest_WithDelveServer_AndRaceDetector() 710public async Task VerifyManifest_WithDelveServer_AndGcFlags() 740public async Task VerifyManifest_WithDelveServer_AndAppArgs() 773public async Task VerifyPublish_GeneratesDockerfile_WithGoVersionFromGoMod() 796public async Task VerifyPublish_UsesDefaultGoVersion_WhenGoModAbsent() 813public async Task VerifyPublish_PropagatesBuildFlagsToDockerfile() 835public async Task VerifyPublish_ShellQuote_HandlesEmbeddedSingleQuotes() 874public async Task VerifyPublish_RespectsDockerfileBaseImageAnnotation() 896public async Task VerifyPublish_WithGoPrivate_GeneratesNetrcAndGoprivate() 916public async Task VerifyPublish_WithGoPrivate_CustomTokenSecretId() 972public async Task VerifyPublish_ContainerFiles_GeneratesFromAndCopyInstructions() 1006public async Task VerifyPublish_ContainerFiles_MultipleSourcesAllPresent() 1074public async Task VerifyPublish_RaceDetector_NotPropagatedToDockerfile() 1148public async Task VerifyPublish_RuntimeStage_HasNonRootUser_Alpine() 1167public async Task VerifyPublish_RuntimeStage_HasNonRootUser_NonAlpine()
GoPublicApiTests.cs (18)
101public async Task AddGoAppDefaultArgsAreRunDot() 114public async Task AddGoApp_PackagePath_DefaultsToRunDot() 125public async Task AddGoApp_PackagePath_UsedInRunMode() 136public async Task AddGoApp_PackagePath_UsedInDelveMode() 148public async Task AddGoApp_PackagePath_CombinedWithBuildFlags() 162public async Task AddGoApp_BuildTagsParam_InjectsTagsFlag() 173public async Task AddGoApp_LdFlagsParam_InjectsLdFlagsArg() 184public async Task AddGoApp_GcFlagsParam_InjectsGcFlagsArg() 195public async Task AddGoApp_RaceDetectorParam_InjectsRaceFlag() 206public async Task AddGoApp_AllBuildParams_ProduceCorrectOrdering() 235public async Task WithAppArgsPassesArgsAfterDot() 265public async Task WithAppArgsReplacesOnSecondCall() 429public async Task WithDelveServerNullOptionsUseDefaults() 461public async Task WithDelveServerProducesCorrectArgs() 473public async Task ObsoleteWithDelveServerPortOverloadPreservesBehavior() 487public async Task WithDelveServerOptionsProduceCorrectArgs() 520public async Task WithDelveServerIncludesBuildFlagsWhenPresent() 535public async Task WithDelveServerPassesAppArgsAfterDoubleDash()
Aspire.Hosting.Java (5)
JavaHostingExtensions.cs (5)
586return Task.CompletedTask; 888return Task.CompletedTask; 1571return Task.CompletedTask; 1686private static async Task JavaCertificateTrustCallback(CertificateTrustConfigurationCallbackAnnotationContext ctx) 1731return Task.FromResult(pkcs12Builder.Encode());
Aspire.Hosting.Java.Tests (160)
AddJavaAppPublishTests.cs (59)
22public async Task VerifyPublish_GeneratesAMavenBuildAndJreRuntimePair() 35public async Task VerifyPublish_TheJarSelectionCopiesAnArtifactWhoseNameContainsWhitespace() 72public async Task VerifyPublish_GeneratesAGradleBuild() 89public async Task VerifyPublish_CopiesABuildProducedOtelAgentIntoTheRuntimeImage() 107public async Task VerifyPublish_WithJvmArgs_ComposesWithBuildProducedOtelAgent() 130public async Task VerifyPublish_StripsExactlyOneLeadingDotSlashFromTheOtelAgentPath() 164public async Task VerifyPublish_DoesNotCopyAnAbsoluteOtelAgentPath() 213public async Task VerifyPublish_UsesTheWrapperWhenTheProjectShipsOne() 252public async Task VerifyPublish_ReusesTheArgumentsConfiguredForTheHostBuildStep() 265public async Task VerifyPublish_DetectsTheBuildToolFromDiskWhenOnlyAJarPathWasGiven() 297public async Task PublishingAJarPathContainingWhitespaceQuotesItRatherThanFallingBackToTheGlob() 309public async Task VerifyPublish_CopiesTheExplicitArtifactWhenWithJarArtifactIsUsed() 321public async Task VerifyPublish_FailsTheContainerBuildWhenTheJarIsAmbiguous() 335public async Task VerifyPublish_HonoursWithDockerfileBaseImage() 351public async Task VerifyPublish_RunsAsANonRootUser() 364public async Task VerifyPublish_UsesTheExecFormEntrypointSoTheJvmReceivesSigterm() 376public async Task VerifyPublish_EmitsABuildContextIgnoreThatExcludesBuildOutputDirectories() 387public async Task VerifyPublish_LeavesAnAuthoredDockerignoreAlone() 403public async Task VerifyPublish_LeavesAnAuthoredDockerfileAlone() 420public async Task PublishingAnAuthoredDockerfileRejectsABuildProducedAgent() 454public async Task PublishingAnAuthoredDockerfileAcceptsAnAbsoluteAgentPath() 479public async Task VerifyPublish_ProducesAContainerManifestEntry() 831public async Task ApplicationArgumentsSurvivePublishingWhileLaunchToolArgumentsDoNot() 960public async Task PublishingAJarPathPrefixedWithDotSlashStillResolvesInsideTheContext() 971public async Task PublishingWithAWindowsBatchWrapperUsesThePosixSibling( 1054public async Task PublishingHonoursAWrapperSelectedWithWithWrapperPath() 1072public async Task VerifyPublish_WithAPrebuiltJarAndNoBuildTool_CopiesTheJarWithoutABuildStage() 1090public async Task VerifyPublish_WithAPrebuiltJar_WithJarArtifactHasNoEffect() 1108public async Task PublishingAPrebuiltJarReincludesItAndItsDirectoriesInTheBuildContext() 1126public async Task APrebuiltJarAlongsideAPomIsStillBuiltInTheImage() 1141public async Task VerifyPublish_PrebuiltJarImageBuildsAndRunsWithItsArguments() 1218public async Task VerifyPublish_WrapperBuiltImageBuildsTheProjectAndRunsIt() 1347public async Task VerifyPublish_Quarkus_StagesTheFastJarDirectoryAndRunsQuarkusRunJar() 1360public async Task VerifyPublish_Quarkus_Gradle_StagesFromTheGradleOutputDirectory() 1383public async Task VerifyPublish_Quarkus_FallsBackToASingleRunnerJarForUberJarPackaging() 1394public async Task VerifyPublish_Quarkus_StagesTheDependencyDirectoryForLegacyJarPackaging() 1413public async Task VerifyPublish_Quarkus_StagesEveryPackagingTypeSoTheRunnerCanResolveItsDependencies(string packagingType) 1508public async Task VerifyPublish_Quarkus_WithJarArtifact_StagesThatFileInstead() 1522public async Task VerifyPublish_InstallsUnzipWhenTheMavenWrapperPinsADistributionChecksum() 1546public async Task VerifyPublish_DoesNotInstallUnzipWhenNoChecksumIsPinned() 1559public async Task VerifyPublish_RaisesTheBuildJdkWhenTheProjectTargetsAnOlderRelease() 1573public async Task VerifyPublish_RaisesTheBuildJdkForGradle9() 1587public async Task VerifyPublish_KeepsTheBuildJdkOnTheTargetForAToolThatCannotRunOnANewerJdk() 1639public async Task VerifyPublish_CapsTheBuildJdkAtWhatTheGradleWrapperCanRunOn() 1653public async Task VerifyPublish_AcceptsTheFirstGradleReleaseThatRunsOnTheTargetedJdk() 1663public async Task VerifyPublish_DoesNotApplyTheGradleCeilingToMaven() 1674public async Task VerifyPublish_KeepsTheBuildJdkOnTheTargetWhenItIsNewEnough() 1685public async Task VerifyPublish_BuildsOnTheTargetPlatformWhenMavenSelectsNativeDependenciesByHostArchitecture() 1717public async Task VerifyPublish_BuildsOnTheTargetPlatformWhenGradleUsesTheOsDetectorPlugin() 1756public async Task PublishingAfterChangingTheWorkingDirectoryIsRejected() 1782await Task.CompletedTask; 1809public async Task VerifyPublish_ExplicitCompilerReleaseWinsOverTheSpringBootProperty() 1825public async Task VerifyPublish_CompilerPluginReleaseWinsOverTheSpringBootProperty() 1835public async Task VerifyPublish_SpringBootPropertyStillAppliesWhenItIsTheOnlySignal() 1846public async Task VerifyPublish_SpringBootPropertyResolvesThroughAnUnexpandedReference() 1862public async Task VerifyPublish_UsesTheNamedJarWhenTheBuildRunsInTheImage() 1877public async Task VerifyPublish_NamedJarWindowsSeparatorsBecomePosix() 1958public async Task VerifyPublish_ExplicitJarArtifactWinsOverTheNamedJar() 1969public async Task VerifyPublish_MovingTheWorkingDirectoryAfterwardsFailsWithAnActionableMessage()
AddJavaAppTests.cs (62)
35public async Task AddJavaApp_MavenGoal_LaunchesThroughTheWrapper() 50public async Task AddJavaApp_GradleTask_LaunchesThroughTheWrapper() 63public async Task VerifyManifest_AddJavaAppWithJar() 86public async Task VerifyManifest_AddJavaAppWithJarAndArgs() 164public async Task AddJavaApp_WithoutLaunchMode_ThrowsWhenArgumentsAreGathered() 181public async Task AddJavaAppWithJar_ArgsAreJarAndUserArgs() 193public async Task AddJavaAppWithJar_NoUserArgs_OnlyJarArgs() 235public async Task WithMavenGoal_PassesGoalAsArgument() 249public async Task WithMavenGoal_WithArgs_IncludesGoalAndArgs() 294public async Task WithGradleTask_PassesTaskAsArgument() 308public async Task WithGradleTask_WrapperPathIsResolved() 326public async Task WithMavenGoal_WrapperPathIsResolved() 344public async Task WithGradleTask_FindsTheWrapperAtTheRootOfAMultiProjectBuild() 365public async Task WithMavenGoal_FindsTheWrapperAtTheRootOfAMultiModuleBuild() 385public async Task WithGradleTask_PrefersTheWrapperInTheApplicationDirectory() 433public async Task WithGradleTask_WithArgs_IncludesTaskAndArgs() 541public async Task WithWrapperPath_OverridesMavenDefaultWrapper() 559public async Task WithWrapperPath_OverridesGradleDefaultWrapper() 602public async Task WithJvmArgs_SetsJavaToolOptions() 616public async Task WithJvmArgs_EmptyArgs_DoesNotSetJavaToolOptions() 630public async Task WithJvmArgs_MultipleCalls_MergeValues() 668public async Task AddJavaApp_ConfiguresOtlpExporterWithoutAnAgent() 687public async Task WithOtelAgent_WithAgentPath_SetsJavaAgentInToolOptions() 701public async Task WithOtelAgent_CalledTwice_UsesOnlyTheLastAgent() 718public async Task WithOtelAgent_WithAgentPath_CombinedWithJvmArgs() 733public async Task WithMavenGoal_WithoutAWrapperOnDisk_IsRejectedWhenTheResourceStarts() 755public async Task WithGradleTask_WithoutAWrapperOnDisk_IsRejectedWhenTheResourceStarts() 774public async Task WithWrapperPath_AfterTheBuildTool_WorksWhenTheProjectHasNoDefaultWrapper() 808public async Task WithMavenGoal_WrapperWithoutTheExecutableBit_StillProducesALaunchableCommandLine() 841public async Task WithWrapperPath_PointingAtAMissingFile_IsRejectedWhenTheResourceStarts() 864public async Task WithWrapperPath_IsHonouredEvenWhenNoWrapperExistsOnDisk() 898public async Task AddJavaApp_WithAppendCertificateTrustScope_DoesNotOverrideTheJvmTrustStore() 932public async Task WithOtelAgent_AgentPathContainingSpaces_IsQuotedForTheJvm() 953public async Task WithJvmArgs_ValueContainingSpaces_IsQuotedAfterTheAssignment() 969public async Task WithOtelAgent_RelativeAgentPath_IsMadeAbsoluteInRunMode() 991public async Task WithOtelAgent_RelativeAgentPath_PointsAtContainerPathInPublishMode() 1008public async Task WithOtelAgent_AbsoluteAgentPath_IsLeftUnchangedInPublishMode() 1176public async Task AddJavaApp_WithJarPath_LaunchesTheJar(string jarPath) 1214public async Task WithJvmArgs_IdeDebugLaunchUsesJavaToolOptionsOnly() 1266public async Task WithMavenGoal_ThenWithJvmArgs_SetsBothConfigurations() 1284public async Task WithGradleTask_ThenWithOtelAgent_SetsBothConfigurations() 1302public async Task WithWrapperPath_ThenWithMavenGoal_UsesCustomWrapper() 1322public async Task VerifyManifest_WithMavenGoal() 1339public async Task VerifyManifest_WithGradleTask() 1371public async Task AddSpringBootApp_DebugConfigurationUsesTheDetectedBuildTool(string marker, string expectedBuildTool) 1387public async Task AddQuarkusApp_DebugConfigurationStartsTheFastJarTheBuildProduced(string buildFile, string outputDirectory) 1451public async Task AddJavaApp_WithMavenBuild_SendsNoEntryPointWhenNothingOnDiskNamesOne() 1468public async Task AddJavaApp_WithJar_PutsTheArchiveOnTheClasspathAndLaunchesItsManifestMainClass() 1487public async Task AddJavaApp_WithWindowsStyleJarPath_DebugsTheArchiveOnEveryPlatform() 1502public async Task AddJavaApp_WithJar_ReadsAMainClassThatTheManifestWrappedAcrossLines() 1517public async Task AddJavaApp_WithJar_WithMainClass_PrefersTheExplicitMainClassOverTheManifest() 1533public async Task AddJavaApp_WithJar_ThatIsMissingOrHasNoMainClass_StillSendsTheClasspath() 1556public async Task AddJavaApp_WithoutAJar_LaunchesTheStartClassOfTheRepackagedSpringBootArchive(string tool, string outputDirectory) 1602public async Task AddJavaApp_WithoutAJar_IgnoresTheArchivesABuildLeavesAlongsideTheApplication() 1623public async Task AddJavaApp_WithoutAJar_SendsNoMainClassWhenTheBuildOutputIsAmbiguous() 1641public async Task AddJavaApp_WithoutAJar_SendsNoMainClassWhenTheArchiveOnlyNamesASpringBootLauncher() 1659public async Task AddJavaApp_WithoutAJar_PrefersAnExplicitMainClassOverTheBuildOutput() 1677public async Task AddJavaApp_WithNoResolvableEntryPoint_NamesTheMavenProjectSoTheIdeDoesNotPrompt() 1708public async Task AddJavaApp_WithNoResolvableEntryPoint_NamesTheGradleProjectFromItsSettingsFile() 1725public async Task AddJavaApp_WithNoResolvableEntryPoint_FallsBackToTheDirectoryNameGradleWouldUse() 1741public async Task AddJavaApp_WhenTheProjectDirectoryIsNamedDifferently_DoesNotGuessTheIdeProjectName() 1763public async Task AddJavaApp_WithAnExplicitJar_DoesNotScopeResolutionToAProject()
AddJavaContainerTests.cs (2)
106public async Task AddJavaContainer_ExportsTelemetryToAspire() 124public async Task WithJvmArgs_AppliesToAContainerToo()
AddQuarkusAppTests.cs (9)
86public async Task AddQuarkusApp_MavenProject_LaunchesInDevMode() 105public async Task AddQuarkusApp_GradleProject_LaunchesInDevMode() 166public async Task AddQuarkusApp_SetsTheDevProfileInRunMode() 185public async Task AddQuarkusApp_DoesNotSetTheDevProfileWhenPublishing() 201public async Task AddQuarkusApp_DisablesTheObservabilityDevServiceInRunMode() 220public async Task AddQuarkusApp_MirrorsTheOtlpConfigurationOntoTheNamesQuarkusReads() 242public async Task AddQuarkusApp_DoesNotMirrorTheOtlpConfigurationWhenPublishing() 276public async Task AddQuarkusApp_NoBuildFile_ThrowsWhenTheResourceStarts() 296public async Task AddQuarkusApp_RemainsAJavaAppResource()
AddSpringBootAppTests.cs (14)
13public async Task AddSpringBootApp_MavenProject_LaunchesThroughSpringBootRun() 30public async Task AddSpringBootApp_GradleProject_LaunchesThroughBootRun() 47public async Task AddSpringBootApp_KotlinGradleProject_IsDetectedAsGradle() 67public async Task BuildToolDetection_GradleMarkersAgreeBetweenRunAndPublish(string marker) 103public async Task AddSpringBootApp_ExplicitLaunchGoalOverridesTheDetectedDefault() 126public async Task AddSpringBootApp_ExplicitBuildArgumentsDoNotCreateASeparateBuildResource() 180public async Task AddSpringBootApp_NoBuildFile_ThrowsWhenTheResourceStarts() 200public async Task BuildToolDetection_BothBuildToolsAreRejectedInRunAndPublish() 229public async Task WithOtelAgent_NoPath_ResolvesTheBuildToolsOutputDirectory(string buildFile, string outputDirectory) 253public async Task WithOtelAgent_NoPath_ResolvesTheBuildToolConfiguredAfterIt(string buildFile, string outputDirectory) 284public async Task WithOtelAgent_BuildProducedAgent_AddsABuildTheApplicationWaitsFor(string buildFile, string toolName) 312public async Task WithOtelAgent_AbsoluteAgentPath_AddsNoBuild() 328public async Task WithOtelAgent_NoPath_WithoutABuild_Throws() 347public async Task AddSpringBootApp_RemainsAJavaAppResource()
tests\Shared\TestPipelineActivityReporter.cs (14)
133public Task CompletePublishAsync(PublishCompletionOptions? options = null, CancellationToken cancellationToken = default) 142return Task.CompletedTask; 147public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 175return Task.FromResult<IReportingStep>(new TestReportingStep(this, title, _testOutputHelper)); 193public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 202return Task.CompletedTask; 213return Task.FromResult<IReportingTask>(new TestReportingTask(_reporter, statusText, _testOutputHelper)); 250public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 272public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 280return Task.CompletedTask; 283public Task UpdateAsync(string statusText, CancellationToken cancellationToken = default) 291return Task.CompletedTask; 294public Task UpdateAsync(MarkdownString statusText, CancellationToken cancellationToken = default) 300public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.JavaScript (10)
JavaScriptHostingExtensions.cs (10)
300return Task.CompletedTask; 335return Task.CompletedTask; 366return Task.CompletedTask; 727return Task.CompletedTask; 776return Task.CompletedTask; 1363Task WriteValidatedContainerAsync(ManifestPublishingContext context) 1380return Task.CompletedTask; 1397return Task.CompletedTask; 1732return Task.CompletedTask; 2377return Task.CompletedTask;
Aspire.Hosting.JavaScript.Tests (118)
AddBunAppTests.cs (10)
16public async Task VerifyManifest() 31public async Task VerifyDockerfile(bool includePackageJson) 59public async Task VerifyDockerfileWithCustomBaseImage() 79public async Task VerifyDockerfileEmitsPerDockerfileDockerignore() 110public async Task VerifyDockerfileSkipsDockerignoreWhenUserAuthoredOneExists() 191public async Task WithRunScript_SetsCustomRunCommand() 246public async Task AddBunApp_ConfiguresCertificateTrustForAppendScope() 276public async Task AddBunApp_ConfiguresCertificateTrustForOverrideScope() 361public async Task BunApp_DirectFile_ProducesBunRuntimeExecutable() 377public async Task BunApp_WithRunScriptAndPackageManager_ProducesBunRuntimeExecutable()
AddJavaScriptAppTests.cs (22)
22public async Task VerifyDockerfile() 44public async Task VerifyDockerfileWhenPublishedAsStaticWebsiteWithoutSpaFallback() 64public async Task VerifyDockerfileWhenPublishedAsNodeServer() 84public async Task VerifyDockerfileWhenPublishedAsPackageScript() 106public async Task VerifyPnpmDockerfile(bool hasLockFile) 133public async Task VerifyPnpmDockerfileUsesBootstrapRegistryOnlyForNpm() 167public async Task VerifyPnpmDockerfileWhenPublishedAsPackageScript(bool hasLockFile) 194public async Task PublishWithExistingDockerfileThrowsWhenRunScriptNameIsExplicit() 211public async Task PublishModelWithExistingDockerfileThrowsWhenRunScriptNameIsExplicit() 230public async Task PublishWithExistingDockerfileThrowsWhenWithRunScriptOverridesDefault() 248public async Task PublishPipelineWithExistingDockerfileThrowsFromValidationStepWhenRunScriptNameIsExplicit() 275public async Task PublishWithExistingDockerfileAllowsImplicitDefaultRunScript() 290public async Task PublishWithExistingDockerfileAllowsExplicitEntrypointOverride() 309public async Task PublishWithExistingDockerfileAllowsWithRunScriptMatchingDefault() 327public async Task PublishWithExistingDockerfileThrowsAndIncludesArgsWhenDefaultScriptHasArgs() 345public async Task VerifyPnpmDockerfileCopiesWorkspaceFileBeforeInstall() 376public async Task VerifyPnpmDockerfileUsesPackageManagerVersion() 410public async Task VerifyPnpmDockerfileUsesNodeForPackageManagerIntegrity(string algorithm) 442public async Task VerifyPnpmDockerfileNormalizesPackageManagerIntegrityHash() 471public async Task VerifyPnpmDockerfileUsesValidPackageManagerVersion(string version) 536public async Task VerifyPnpmDockerfileBuildSucceeds() 632public async Task VerifyPnpmDockerfileWhenPublishedAsPackageScriptRunsWithoutNetwork()
AddNodeAppTests.cs (10)
25public async Task VerifyManifest() 96public async Task VerifyDockerfile(bool includePackageJson) 164public async Task VerifyDockerfileWithBuildScript() 211public async Task VerifyDockerfileWithCustomBaseImage() 293public async Task WithRunScript_SetsCustomRunCommand() 317public async Task VerifyNodeAppWithContainerFilesGeneratesCorrectDockerfile() 374public async Task VerifyNodeAppWithContainerFilesFromResourceWithDashesGeneratesCorrectDockerfile() 557public async Task WithReferenceDispatchesNodeAppServiceReference() 595public async Task NodeApp_DirectFile_ProducesNodeRuntimeExecutable() 611public async Task ViteApp_DevServer_ProducesPackageManagerRuntimeExecutable()
AddViteAppTests.cs (30)
22public async Task VerifyDefaultDockerfile() 84public async Task VerifyDockerfileWhenPublishedAsStaticWebsite() 110public async Task VerifyDockerfileWhenPublishedAsStaticWebsiteWithApiProxy() 137public async Task PublishAsStaticWebsiteSetsYarpEnvironmentVariables() 158public async Task PublishAsStaticWebsiteWithApiProxySetsReverseProxyEnvironmentVariables() 188public async Task VerifyDockerfileWhenPublishedAsStaticWebsiteWithCustomOutputPath() 214public async Task VerifyDockerfileWhenPublishedAsNodeServer() 237public async Task VerifyDockerfileWhenPublishedAsNextStandalone() 258public async Task VerifyDockerfileWhenNextJsAppUsesPnpm() 277public async Task VerifyDockerfileWhenPackageScriptUsesPnpm() 297public async Task VerifyDockerfileWhenPackageScriptUsesBun() 317public async Task VerifyDockerfileWithNodeVersionFromNvmrc() 337public async Task VerifyDockerfileWithNodeVersionFromNodeVersion() 357public async Task VerifyDockerfileWithNodeVersionFromToolVersions() 382public async Task VerifyDockerfileWithNodeVersionFromToolVersionsUsingTabs() 407public async Task VerifyDockerfileIgnoresPackageJsonEnginesWhenNoPinnedVersionExists() 433public async Task VerifyDockerfileDefaultsTo22WhenNoVersionFound() 456public async Task VerifyDockerfileHandlesVariousVersionFormats(string versionString, string expectedImage) 474public async Task VerifyCustomBaseImage() 543public async Task AddViteApp_ServerAuthCertConfig_WithExistingConfigArgument_ReplacesConfigPath() 604public async Task AddViteApp_ServerAuthCertConfig_WithoutExistingConfigArgument_DetectsDefaultConfig() 662public async Task AddViteApp_ServerAuthCertConfig_WithMissingConfigFile_DoesNotAddConfigArgument() 709public async Task AddViteApp_ServerAuthCertConfig_WithMissingNodeModules_PreservesConfigArgument() 751public async Task AddViteApp_ServerAuthCertConfig_WithPassword_SetsPasswordEnvironmentVariable() 806public async Task AddViteApp_ServerAuthCertConfig_WritesWrapperToNearestNodeModules() 883public async Task AddViteApp_ServerAuthCertConfig_SharedNodeModules_WritesResourceSpecificWrappers() 946public async Task AddViteApp_ServerAuthCertConfig_SharedNodeModules_WritesAppHostSpecificWrappers() 991public async Task AddViteApp_ServerAuthCertConfig_DetectsAllDefaultConfigFileFormats(string configFileName) 1077public async Task NextJsStandaloneCheckFailsInPipelineWhenMissing() 1135private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken);
BunAppFixture.cs (2)
117private async Task WaitReadyStateAsync(CancellationToken cancellationToken) 121await Task.WhenAll(
BunFunctionalTests.cs (2)
21public async Task VerifyBunAppDirectExecutionWorks() 31public async Task VerifyBunAppPackageScriptWorks()
NodeAppFixture.cs (1)
107private async Task WaitReadyStateAsync(CancellationToken cancellationToken = default)
NodeFunctionalTests.cs (2)
21public async Task VerifyNodeAppWorks() 31public async Task VerifyNpmAppWorks()
PackageInstallationTests.cs (9)
78public async Task WithYarn_CreatesInstallerWhenInstallIsTrue() 117public async Task WithYarn_DoesNotCreateInstallerWhenInstallIsFalse() 147public async Task WithPnpm_CreatesInstallerWhenInstallIsTrue() 186public async Task WithPnpm_DoesNotCreateInstallerWhenInstallIsFalse() 261public async Task WithRunScript_SetsCustomRunCommand() 341public async Task WithNpmInstallWithYarnInstall() 391public async Task WithYarn_DefaultInstallsPackages() 413public async Task WithPnpm_DefaultInstallsPackages() 581private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken);
RequiredCommandTests.cs (15)
24public async Task AddNodeApp_DefaultsToNode() 35public async Task AddNodeApp_WithBun_RequiresNodeAndBun() 48public async Task AddNodeApp_WithNpm_RequiresNodeAndNpm() 60public async Task AddNodeApp_WithRunScript_WithBun_RequiresOnlyBun() 74public async Task AddViteApp_DefaultsToNodeAndNpm() 84public async Task AddViteApp_WithBun_RequiresOnlyBun() 95public async Task AddViteApp_WithNpm_RequiresNodeAndNpm() 106public async Task AddViteApp_WithYarn_RequiresNodeAndYarn() 117public async Task AddViteApp_WithPnpm_RequiresNodeAndPnpm() 128public async Task AddJavaScriptApp_WithBun_RequiresOnlyBun() 139public async Task AddBunApp_RequiresOnlyBun() 149public async Task AddBunApp_WithPackageJson_RequiresOnlyBunWithoutDuplicates() 165public async Task AddBunApp_WithNpm_RequiresBunNodeAndNpm() 177public async Task WithBun_ThenWithNpm_LastSelectionWins() 189public async Task WithNpm_ThenWithBun_LastSelectionWins()
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
Aspire.Hosting.Kafka (1)
KafkaBuilderExtensions.cs (1)
132return Task.CompletedTask;
Aspire.Hosting.Kafka.Tests (26)
AddKafkaTests.cs (6)
57public async Task KafkaCreatesConnectionString() 76public async Task VerifyManifest() 114public async Task WithDataVolumeConfigureCorrectEnvironment() 132public async Task WithDataBindConfigureCorrectEnvironment() 183public async Task KafkaEnvironmentCallbackIsIdempotent() 204public async Task KafkaUIEnvironmentCallbackIsIdempotent()
KafkaFunctionalTests.cs (5)
24public async Task VerifyWaitForOnKafkaBlocksDependentResources() 42var pendingStart = app.StartAsync().DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 62public async Task VerifyKafkaResource() 120public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume) 279public Task Kafka_WithPersistentLifetime_ReusesContainer()
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
Aspire.Hosting.Keycloak (1)
KeycloakResourceBuilderExtensions.cs (1)
108return Task.CompletedTask;
Aspire.Hosting.Keycloak.Tests (5)
KeycloakFunctionalTests.cs (1)
15public Task Keycloak_WithPersistentLifetime_ReusesContainer()
KeycloakPublicApiTests.cs (2)
150public async Task WithRealmImportDirectoryAddsContainerFilesAnnotation() 171public async Task WithRealmImportFileAddsContainerFilesAnnotation()
KeycloakResourceBuilderTests.cs (2)
61public async Task AddKeycloakSwitchesPrimaryEndpointToHttpsWhenCertificateAvailable() 149public async Task VerifyManifest()
Aspire.Hosting.Kubernetes (42)
CertManagerExtensions.cs (4)
383return Task.FromResult<IEnumerable<PipelineStep>>(steps); 415return Task.FromResult<IEnumerable<PipelineStep>>(steps); 418private static async Task ApplyClusterIssuerAsync( 496private static async Task DeleteClusterIssuerAsync(
Deployment\HelmDeploymentEngine.cs (9)
237return Task.FromResult<IReadOnlyList<PipelineStep>>(steps); 240private static async Task PrepareAsync(PipelineStepContext context, KubernetesEnvironmentResource environment) 285internal static async Task ResolveAndWriteDeployValuesAsync( 413private static async Task HelmDeployAsync(PipelineStepContext context, KubernetesEnvironmentResource environment) 507internal static async Task PrintResourceSummaryAsync( 542private static async Task PrintDeploymentInstructionsAsync( 578private static async Task HelmUninstallAsync(PipelineStepContext context, KubernetesEnvironmentResource environment) 585private static async Task HelmUninstallAsync(PipelineStepContext context, KubernetesEnvironmentResource environment, string releaseName, string @namespace) 634private static async Task ConfirmDestroyAsync(PipelineStepContext context, string message)
Deployment\HelmVersionValidator.cs (1)
56public static async Task EnsureMinimumVersionAsync(
KubernetesEnvironmentExtensions.cs (2)
43return Task.CompletedTask; 61return Task.CompletedTask;
KubernetesEnvironmentResource.cs (12)
402private Task PublishAsync(PipelineStepContext context) 420private async Task PrepareDeploymentTargetsAsync(PipelineStepContext context) 576return Task.CompletedTask; 695private async Task ProcessIngressResources(DistributedApplicationModel model, Dictionary<IResource, KubernetesResource> deploymentTargets, ILogger logger, CancellationToken cancellationToken) 908private async Task ProcessGatewayResources(DistributedApplicationModel model, Dictionary<IResource, KubernetesResource> deploymentTargets, ILogger logger, CancellationToken cancellationToken) 935private async Task ProcessPersistentVolumeResources(DistributedApplicationModel model, CancellationToken cancellationToken) 1003private async Task BuildGatewayObjects( 1321private static async Task DiscoverFqdnAndBootstrapTlsAsync( 1476private static async Task EnsureBootstrapTlsSecretAsync( 1775private static async Task CleanupGatewayFieldOwnershipAsync( 1961private static async Task TransferGatewayFieldOwnership( 2079private static async Task BootstrapTlsSecretsAsync(
KubernetesHelmChartExtensions.cs (3)
127return Task.FromResult<IEnumerable<PipelineStep>>(steps); 286private static async Task InstallHelmChartAsync( 388private static async Task UninstallHelmChartAsync(
KubernetesPublishingContext.cs (8)
47internal async Task WriteModelAsync(DistributedApplicationModel model, KubernetesEnvironmentResource environment) 70private async Task WriteKubernetesOutputAsync(DistributedApplicationModel model, KubernetesEnvironmentResource environment) 186private async Task AppendResourceContextToHelmValuesAsync(IResource resource, KubernetesResource resourceContext) 255private async Task AddValuesToHelmSectionAsync( 366private async Task WriteKubernetesTemplatesForResource(IResource resource, IEnumerable<BaseKubernetesResource> templatedItems) 399private async Task WriteKubernetesHelmValuesAsync() 407private async Task WriteKubernetesHelmChartAsync(KubernetesEnvironmentResource environment) 435private async Task ResolveHelmChartMetadataAsync(KubernetesEnvironmentResource environment)
KubernetesResource.cs (3)
219internal async Task ProcessResourceAsync(KubernetesEnvironmentContext context, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken) 363private async Task ProcessArgumentsAsync(KubernetesEnvironmentContext environmentContext, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken) 391private async Task ProcessEnvironmentAsync(KubernetesEnvironmentContext environmentContext, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken)
Aspire.Hosting.Kubernetes.Tests (155)
CertManagerTests.cs (3)
115public async Task BuildClusterIssuerManifest_EmitsExpectedYamlForLetsEncryptHttp01() 164public async Task BuildClusterIssuerManifest_RouteLessGateway_IsNotEmittedAsParentRef() 201public async Task BuildClusterIssuerManifest_RouteLessGateway_WarnsThatChallengesCannotBeSatisfied()
FakeHelmRunner.cs (2)
63return Task.FromResult(VersionExitCode); 71return Task.FromResult(ExitCode);
HelmVersionValidatorTests.cs (7)
32public async Task EnsureMinimumVersionAsync_AtMinimum_Passes() 39public async Task EnsureMinimumVersionAsync_NewerVersion_Passes() 50public async Task EnsureMinimumVersionAsync_TooOld_ThrowsWithDetectedAndRequired(string oldVersion) 64public async Task EnsureMinimumVersionAsync_UnparseableOutput_ThrowsWithRawOutput() 75public async Task EnsureMinimumVersionAsync_NonZeroExitCode_ThrowsWithInstallHint() 90public async Task EnsureMinimumVersionAsync_DoesNotPassClientFlag() 118return Task.FromResult(0);
KubernetesDeployTests.cs (35)
303public async Task HelmDeployStepIsCreatedInDiagnosticsMode() 344public async Task HelmDeployStep_DependsOnPublishStep() 384public async Task HelmDeployStep_DependsOnPushSteps_WhenRegistryConfigured() 425public async Task PrintSummaryStepIsCreated() 465public async Task HelmUninstallStepIsCreated() 500public async Task HelmUninstallStep_RequiredByDestroy() 536public async Task HelmUninstallStep_DependsOnCheckHelmPrereqs() 579public async Task PerChartHelmUninstallStep_DependsOnCheckHelmPrereqs() 617public async Task MultipleContainersGenerateMultiplePrintSummarySteps() 826public async Task WithHelm_PublishThrowsWhenResolvedParameterChartVersionIsInvalid() 846private static Task ExecutePipelineAsync(DistributedApplication app) 860public async Task WithHelm_PublishWritesChartMetadataToChartYaml() 887public async Task WithHelm_PublishResolvesParameterChartMetadata() 918public async Task PublishWritesChartNameTemplateLabelOnResources() 939public async Task ContainerRegistryIsWiredIntoDeploymentTarget() 969public async Task PrepareAsync_ResolvesSecretParameterValues() 1016public async Task PrepareAsync_NoCapturedValues_DoesNotCreateDeployFile() 1036public async Task PrepareAsync_ResolvesMultipleParametersAcrossResources() 1110public async Task PrepareAsync_ResolvesCrossResourceReferences() 1158public async Task PublishCapturesSecretParameterMappings() 1191public async Task PublishCapturesImageReferencesForProjectResources() 1267public async Task PrepareAsync_ResolvesImageReferencesWithRegistryPrefix() 1317public async Task ResolveAndWriteDeployValuesAsync_NoOverrideFileWhenNoCaptures() 1335public async Task CrossResourceSecretResolution_ValuesYamlKeysMatchTemplateReferences() 1405public async Task CrossResourceSecretResolution_ReferenceExpressionWrappedParameter_PreservesValuesKey() 1465public async Task CrossResourceSecretResolution_OverrideFileResolvesAllPaths() 1526public async Task CrossResourceSecretResolution_EndToEnd_PublishAndResolve() 1581public async Task EmbeddedParametersInEnvironmentExpressions_EndToEnd_PublishAndResolve() 1627public async Task ConditionalParameterWithoutDefault_EndToEnd_PublishAndResolve() 1672public async Task DeferredValueProvider_EndToEnd_PublishAndResolve() 1758public async Task Dashboard_OtlpConfigured_ForComputeResources() 1792public async Task Dashboard_Disabled_NoOtlpConfiguration() 1839public async Task DestroyHelm_WithState_RunsHelmUninstall() 1876public async Task DestroyHelm_WithNoState_ReportsNothingToDestroy() 1911public async Task DestroyHelm_WhenUninstallFails_PreservesState()
KubernetesEnvironmentResourceTests.cs (9)
16public async Task PublishingKubernetesEnvironmentPublishesFile() 40public async Task PublishAsKubernetesService_ThrowsIfNoEnvironment() 42static async Task RunTest(Action<IDistributedApplicationBuilder> action) 71public async Task ValidateKubernetes_DoesNotThrowInRunMode() 92public async Task MultipleKubernetesEnvironmentsSupported() 117public async Task GetHostAddressExpression() 135public async Task MultipleComputeEnvironmentsOnlyProcessTargetedResources() 200public async Task RunningTheDeploymentTargetHooksTwiceLeavesOneTargetPerEnvironment() 243private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken);
KubernetesGatewayTests.cs (12)
15public async Task AddGateway_WithRoute_GeneratesGatewayAndHttpRoute() 58public async Task AddGateway_WithHostRoute_GeneratesHostnameInHttpRoute() 85public async Task AddGateway_WithTls_GeneratesHttpsListener() 120public async Task AddGateway_WithTls_DoesNotDuplicateRoutes() 146public async Task AddGateway_MultipleRoutes_GroupsByHost() 181public async Task AddGateway_NoRoutes_DoesNotGenerateYamlOrTlsSteps(bool hasTls, bool hasHostname) 215public async Task AddGateway_NoRoutes_WarnsThatGatewayAndTlsAreSkipped() 269public async Task AddGateway_BackwardCompatible_NoGatewayNoChange() 292public async Task AddGateway_WithTls_NoHostname_GeneratesHttpsListenerWithoutHostname() 338public async Task AddGateway_WithTls_BeforeWithHostname_HostnameStillAppliedToHttpsListener() 426public async Task AddGateway_WithRoute_ExternalEndpoint_Succeeds() 459public async Task AddGateway_WhenDeploymentTargetsArePreparedTwice_DoesNotDuplicateHttpRoutes()
KubernetesHelmChartTests.cs (7)
392public async Task PipelineStepFactory_WithoutDestroy_ProducesOnlyInstallStep() 405public async Task PipelineStepFactory_WithDestroy_ProducesInstallAndUninstallSteps() 428public async Task PipelineStepFactory_InstallStepDescription_UsesLiveResourceState() 445public async Task PipelineStepFactory_UninstallStepDescription_FallsBackToResourceNameForNamespace() 463public async Task PipelineStepFactory_UninstallStepDescription_UsesExplicitNamespace() 480public async Task PipelineStepFactory_RejectsResourceNameThatIsNotValidDnsLabel(string resourceName) 494public async Task PipelineStepFactory_AcceptsInvalidResourceNameWhenOverridesProvided()
KubernetesIngressTests.cs (20)
15public async Task AddIngress_WithPath_GeneratesIngressYaml() 47public async Task AddIngress_WithHostAndPath_GeneratesHostRule() 73public async Task AddIngress_WithIngressClassParameter_GeneratesHelmReferenceAndPlaceholder() 127public async Task AddIngress_WithIngressClassParameter_WithDefaultValue_ResolvesAtPublish() 157public async Task AddIngress_WithTls_GeneratesTlsSection() 184public async Task AddIngress_WithTls_BeforeWithHostname_HostnameIncludedInTlsHosts() 215public async Task AddIngress_WithMultiplePaths_GroupsByHost() 248public async Task AddIngress_WithAnnotations_GeneratesAnnotations() 273public async Task AddIngress_WithExactPathType_GeneratesExactPathType() 297public async Task AddIngress_NoPathsWithTls_DoesNotRegisterTlsBootstrapStep() 324public async Task AddIngress_NoPaths_WarnsThatIngressAndTlsAreSkipped() 355public async Task AddIngress_UnresolvableBackendWithTls_NotEligibleForTlsBootstrap() 398public async Task AddIngress_ResolvableBackendWithTls_EligibleForTlsBootstrap() 429public async Task CollectTlsSecrets_BeforePublish_DoesNotDependOnGeneratedIngress() 464public async Task AddIngress_NoPaths_DoesNotGenerateYaml() 484public async Task AddIngress_BackwardCompatible_NoIngressNoChange() 507public async Task AddIngress_MultipleIngresses_GeneratesSeparateYaml() 549public async Task AddIngress_TlsWithDefaultBackend_AutoGeneratesHostRule() 584public async Task AddIngress_TlsWithExplicitPath_DoesNotDuplicate() 701public async Task AddIngress_WithPath_ExternalEndpoint_Succeeds()
KubernetesPublisherTests.cs (37)
20public async Task PublishAsync_GeneratesValidHelmChart() 88public async Task PublishAppliesServiceCustomizations() 119public async Task PublishAsync_CustomWorkloadAndResourceType() 185public async Task PublishAsync_CustomManifestResource() 251public async Task PublishAsync_HandlesSpecialResourceName() 307public async Task PublishAsync_ResourceWithProbes() 363public async Task PublishAsync_WithDockerfileFactory_WritesDockerfileToOutputFolder() 386public async Task PublishAsync_SupportsProjectedSecretVolumes() 460public async Task PublishAsync_SupportsProjectedConfigMapDownwardApiAndServiceAccountTokenVolumes() 603public async Task KubernetesWithProjectResources() 659public async Task KubernetesMapsPortsForBaitAndSwitchResources() 703public async Task KubernetesTreatsZeroPublicPortAsUnspecified() 719public async Task KubernetesEndpointReferenceUsesServicePortNotTargetPort() 765public async Task KubernetesIngressAndGatewayRouteToServicePortForDistinctPorts() 817public async Task KubernetesProbeUsesContainerTargetPortNotServicePort() 862public async Task PublishAsync_EmbeddedParametersInEnvironmentExpressionsPopulateValues() 909public async Task PublishAsync_ConflictingEmbeddedParameterValuesPathReportsError() 935public async Task PublishAsync_EmbeddedParametersWithSameNormalizedValuesPathReportError() 961public async Task PublishAsync_DistinctEmbeddedParameterSourcesWithSameNameReportError() 985public async Task PublishAsync_DistinctConditionalParameterSourcesWithSameNameReportError() 1021public async Task PublishAsync_CompositeExpressionPreservesExpressionShape() 1064public async Task PublishAsync_SharedEmbeddedParameterIsScopedPerResource() 1110public async Task PublishAsync_HandlesConditionalReferenceExpression() 1171public async Task PublishAsync_ConditionalBranchesCaptureEmbeddedParameters() 1222public async Task PublishAsync_HandlesConditionalReferenceExpressionWithParameterCondition() 1284public async Task PublishAsync_ConditionalWithParameterBranch_UsesIfElseSyntax() 1343public async Task PublishAsync_HandlesScalarEnvironmentVariableTypes() 1397public async Task PublishAsync_WithPvcStorageType_GeneratesValidPersistentVolumeClaim() 1463public async Task PublishAsync_WithHostPathStorageType_EmitsHostPathVolumeOnPodSpec() 1496public async Task PublishAsync_WithFirstClassPersistentVolume_BindsByName_PromotesToStatefulSet() 1555public async Task PublishAsync_WithFirstClassPersistentVolume_OnProject_BindsViaMountPathOverload() 1601public async Task PublishAsync_WithFirstClassPersistentVolume_KubernetesCustomizationOverridesDefaultFsGroup() 1629public async Task PublishAsync_WithFirstClassPersistentVolume_KubernetesCustomizationCanRemoveDefaultSecurityContext() 1666public async Task PublishAsync_WithFirstClassPersistentVolume_FallsThroughForUnboundVolumes() 1705public async Task PublishAsync_WithFirstClassPersistentVolume_ThrowsWhenBoundAcrossEnvironments() 1734public async Task PublishAsync_WithFirstClassPersistentVolume_ReadOnlyFlag_PropagatesToVolumeMountAndPodVolume() 1796public async Task PublishAsync_WithFirstClassPersistentVolume_ParameterOverloads_CaptureValuesInHelmChart()
PipelineStepTestHelpers.cs (1)
44public static async Task RunStepAsync(IServiceProvider services, PipelineStep step)
tests\Shared\InMemoryDeploymentStateManager.cs (8)
32return Task.FromResult(new DeploymentStateSection(sectionName, data, version)); 34return Task.FromResult(new DeploymentStateSection(sectionName, [], 0)); 37public Task SaveSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 41return Task.CompletedTask; 44public Task DeleteSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 48return Task.CompletedTask; 51public Task ClearAllStateAsync(CancellationToken cancellationToken = default) 55return Task.CompletedTask;
tests\Shared\TestPipelineActivityReporter.cs (14)
133public Task CompletePublishAsync(PublishCompletionOptions? options = null, CancellationToken cancellationToken = default) 142return Task.CompletedTask; 147public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 175return Task.FromResult<IReportingStep>(new TestReportingStep(this, title, _testOutputHelper)); 193public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 202return Task.CompletedTask; 213return Task.FromResult<IReportingTask>(new TestReportingTask(_reporter, statusText, _testOutputHelper)); 250public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 272public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 280return Task.CompletedTask; 283public Task UpdateAsync(string statusText, CancellationToken cancellationToken = default) 291return Task.CompletedTask; 294public Task UpdateAsync(MarkdownString statusText, CancellationToken cancellationToken = default) 300public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Maui (26)
Lifecycle\MauiBuildQueueEventSubscriber.cs (10)
41public Task SubscribeAsync(IDistributedApplicationEventing eventing, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken) 44return Task.CompletedTask; 47private async Task OnBeforeResourceStartedAsync(BeforeResourceStartedEvent @event, CancellationToken cancellationToken) 135internal virtual async Task RunBuildAsync(IResource resource, ILogger logger, CancellationToken cancellationToken) 189var stdoutTask = PipeOutputAsync(process.StandardOutput, logger, LogLevel.Information, token); 190var stderrTask = PipeOutputAsync(process.StandardError, logger, LogLevel.Warning, token); 212await Task.WhenAll(stdoutTask, stderrTask).ConfigureAwait(false); 224private static async Task PipeOutputAsync(System.IO.StreamReader reader, ILogger logger, LogLevel level, CancellationToken cancellationToken) 282internal virtual async Task ReleaseSemaphoreAfterLaunchAsync( 393_ = Task.Run(async () =>
Lifecycle\UnsupportedPlatformEventSubscriber.cs (2)
23public Task SubscribeAsync(IDistributedApplicationEventing eventing, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken) 42return Task.CompletedTask;
MauiiOSExtensions.cs (2)
234return Task.CompletedTask; 436return Task.CompletedTask;
MauiOtlpExtensions.cs (4)
132return Task.CompletedTask; 142return Task.CompletedTask; 221private static Task AllocateOtlpStubEndpointAsync( 231return Task.CompletedTask;
MauiPlatformHelper.cs (2)
146return Task.CompletedTask; 191await Task.CompletedTask.ConfigureAwait(false);
Utilities\MauiAndroidEnvironmentAnnotation.cs (3)
47public Task SubscribeAsync(IDistributedApplicationEventing eventing, DistributedApplicationExecutionContext execContext, CancellationToken cancellationToken) 50return Task.CompletedTask; 53private async Task OnBeforeResourceStartedAsync(BeforeResourceStartedEvent @event, CancellationToken cancellationToken)
Utilities\MauiiOSEnvironmentAnnotation.cs (3)
47public Task SubscribeAsync(IDistributedApplicationEventing eventing, DistributedApplicationExecutionContext execContext, CancellationToken cancellationToken) 50return Task.CompletedTask; 53private async Task OnBeforeResourceStartedAsync(BeforeResourceStartedEvent @event, CancellationToken cancellationToken)
Aspire.Hosting.Maui.Tests (126)
MauiBuildQueueTests.cs (91)
49public async Task SingleResource_AcquiresSemaphore() 54var eventTask = Task.Run(() => env.Eventing.PublishAsync( 68public async Task SingleResource_ReleasesSemaphoreAfterBuild() 83public async Task SecondResource_BlocksUntilBuildCompletes() 87var task1 = Task.Run(() => env.Eventing.PublishAsync( 93var queued = WaitForStateAsync(env, env.MacCatalyst, "Queued"); 94var task2 = Task.Run(() => env.Eventing.PublishAsync( 111public async Task SecondResource_ShowsQueuedState() 115var task1 = Task.Run(() => env.Eventing.PublishAsync( 124_ = Task.Run(async () => 136var task2 = Task.Run(() => env.Eventing.PublishAsync( 151public async Task SingleResource_ShowsBuildingState() 158_ = Task.Run(async () => 170var eventTask = Task.Run(() => env.Eventing.PublishAsync( 182public async Task ResourcesFromDifferentProjects_RunConcurrently() 187var task1 = Task.Run(() => env.Eventing.PublishAsync( 191var task2 = Task.Run(() => env.Eventing.PublishAsync( 207await Task.WhenAll(task1, task2).WaitAsync(TimeSpan.FromSeconds(5)); 211public async Task FailedBuild_ReleasesQueueAndThrows() 228public async Task CancelledQueuedResource_DoesNotDeadlock() 232var task1 = Task.Run(() => env.Eventing.PublishAsync( 239var queued = WaitForStateAsync(env, env.MacCatalyst, "Queued"); 240var task2 = Task.Run(() => env.Eventing.PublishAsync( 255var task3 = env.Eventing.PublishAsync( 262public async Task ThreeResources_ExecuteInSequence() 267var task1 = Task.Run(async () => 277var macCatalystQueued = WaitForStateAsync(env, env.MacCatalyst, "Queued"); 278var iosSimulatorQueued = WaitForStateAsync(env, env.IOSSimulator, "Queued"); 280var task2 = Task.Run(async () => 288var task3 = Task.Run(async () => 296await Task.WhenAll(macCatalystQueued, iosSimulatorQueued); 311var macTask = env.Subscriber.WaitForBuildStartedAsync(env.MacCatalyst, TimeSpan.FromSeconds(30)); 312var iosTask = env.Subscriber.WaitForBuildStartedAsync(env.IOSSimulator, TimeSpan.FromSeconds(30)); 313var secondStarted = await Task.WhenAny(macTask, iosTask); 344public async Task NonMauiResource_IsNotAffected() 348var task1 = Task.Run(() => env.Eventing.PublishAsync( 355var parentTask = env.Eventing.PublishAsync( 366public async Task ResourceRestart_CanBuildSameResourceTwice() 390public async Task MissingBuildQueueAnnotation_SkipsQueue() 420public async Task MissingBuildInfoAnnotation_ThrowsAndReleasesSemaphore() 463public async Task UnexpectedException_ReleasesSemaphore() 510public async Task CancelQueuedResource_CompletesGracefullyAndDoesNotAcquireSemaphore() 515var task1 = Task.Run(() => env.Eventing.PublishAsync( 522var queued = WaitForStateAsync(env, env.MacCatalyst, "Queued"); 523var task2 = Task.Run(() => env.Eventing.PublishAsync( 549public async Task StopCommand_QueuedOrBuildingResource_CancelsBuild() 554var eventTask = Task.Run(() => env.Eventing.PublishAsync( 572var exitedSeen = WaitForStateAsync(env, env.Android, KnownResourceStates.Exited); 582public async Task StopCommand_RunningResource_DelegatesToOriginalStopCommand() 606public async Task CancelBuildingResource_ReleasesSemaphore() 611var task1 = Task.Run(() => env.Eventing.PublishAsync( 634public async Task ReleaseSemaphoreAfterLaunchAsync_SkipsReplayStateAndReleasesOnStableState() 649var releaseTask = subscriber.ReleaseSemaphoreAfterLaunchAsync( 668public async Task CancelQueuedResource_NextResourceProceeds() 673var task1 = Task.Run(() => env.Eventing.PublishAsync( 680var macCatalystQueued = WaitForStateAsync(env, env.MacCatalyst, "Queued"); 681var iosSimulatorQueued = WaitForStateAsync(env, env.IOSSimulator, "Queued"); 683var task2 = Task.Run(() => env.Eventing.PublishAsync( 687var task3 = Task.Run(() => env.Eventing.PublishAsync( 691await Task.WhenAll(macCatalystQueued, iosSimulatorQueued); 712public async Task BuildTimeout_ThrowsTimeoutException() 748return Task.FromResult(CommandResults.Success()); 784private static async Task WaitForStateAsync(BuildQueueTestEnvironment env, IResource resource, string state) 818public Task WaitForBuildStartedAsync(IResource resource, TimeSpan? timeout = null) 849internal override async Task RunBuildAsync(IResource resource, ILogger logger, CancellationToken cancellationToken) 884internal override Task ReleaseSemaphoreAfterLaunchAsync(IResource resource, SemaphoreSlim semaphore, string? stateAtCallTime, ILogger logger, CancellationToken cancellationToken) 887return Task.CompletedTask; 910internal override Task ReleaseSemaphoreAfterLaunchAsync(IResource resource, SemaphoreSlim semaphore, string? stateAtCallTime, ILogger logger, CancellationToken cancellationToken) 913return Task.CompletedTask;
MauiiOSValidationTests.cs (6)
18public async Task AddiOSDevice_WithGuidDeviceId_ThrowsOnBeforeStart() 43public async Task AddiOSSimulator_WithNonGuidSimulatorId_ThrowsOnBeforeStart() 68public async Task AddiOSDevice_WithValidDeviceId_DoesNotThrowOnBeforeStart() 88public async Task AddiOSSimulator_WithValidGuidSimulatorId_DoesNotThrowOnBeforeStart() 108public async Task AddiOSDevice_WithNoDeviceId_DoesNotThrowOnBeforeStart() 126public async Task AddiOSSimulator_WithNoSimulatorId_DoesNotThrowOnBeforeStart()
MauiOtlpTemplateTests.cs (3)
22public async Task PlatformResource_OtelServiceName_DoesNotContainDcpPlaceholders(string platform, string tfm) 49public async Task PlatformResource_OtelResourceAttributes_DoesNotContainDcpPlaceholders(string platform, string tfm) 72public async Task PlatformResource_HasOtelExporterEndpoint()
MauiPlatformExtensionsTests.cs (15)
153public async Task AddMauiPlatform_EmitsMauiIdeLaunchConfiguration(PlatformTestConfig config) 272public async Task AddPlatform_WithoutRequiredTfm_ThrowsOnBeforeStartEvent(PlatformTestConfig config) 300public async Task AddAndroidEmulator_WithEnvironment_EnvironmentVariablesAreSet() 349public async Task AddAndroidDevice_WithDeviceId_CreatesResourceWithCorrectName() 372public async Task AddAndroidEmulator_WithEmulatorId_CreatesResourceWithCorrectName() 395public async Task AddiOSDevice_WithDeviceId_CreatesResourceWithCorrectName() 423public async Task AddiOSSimulator_WithSimulatorId_CreatesResourceWithCorrectName() 449public async Task AddiOSSimulator_OptsOutOfProjectIdeLaunchAndKeepsSdkRunArgs() 529public async Task AddiOSSimulator_WithEnvironment_EnvironmentVariablesAreSet() 634public async Task WithOtlpDevTunnel_SetsEndpointWithoutIntermediateEnvironmentVariables(PlatformTestConfig config) 673public async Task WithOtlpDevTunnel_AllocatesStubFromDynamicDashboardOtlpEndpoint() 725public async Task WithOtlpDevTunnel_AllocatesStubFromConfiguredOtlpEndpoint() 756return Task.CompletedTask; 789public async Task WithOtlpDevTunnel_ThrowsWhenDashboardDisabledAndNoConfiguredOtlpEndpoint() 813public async Task WithOtlpDevTunnel_ThrowsWhenDashboardHasNoAllocatedOtlpEndpoint()
MauiWithArgsTests.cs (11)
17public async Task WindowsDevice_Args_ContainRunAndTfm(string windowsTfm) 35public async Task MacCatalystDevice_Args_ContainRunTfmAndOpenArguments() 54public async Task AndroidDevice_DefaultArgs_ContainRunTfmAndAdbTargetDevice() 74public async Task AndroidDevice_WithDeviceId_ContainAdbTargetWithSerial() 91public async Task AndroidEmulator_DefaultArgs_ContainAdbTargetEmulator() 111public async Task AndroidEmulator_WithEmulatorId_ContainAdbTargetWithSerial() 128public async Task iOSDevice_DefaultArgs_ContainRuntimeIdentifier() 147public async Task iOSDevice_WithDeviceId_ContainDeviceName() 164public async Task iOSSimulator_DefaultArgs_DoNotContainDeviceName() 184public async Task iOSSimulator_WithSimulatorId_ContainDeviceNameWithUdidPrefix() 202public async Task AllPlatforms_ArgsStartWithRunAndHaveExpectedTfm()
Aspire.Hosting.Milvus.Tests (7)
AddMilvusTests.cs (3)
76public async Task MilvusCreatesConnectionString() 92public async Task MilvusClientAppWithReferenceContainsConnectionStrings() 129public async Task VerifyManifest()
MilvusFunctionalTests.cs (4)
21public async Task VerifyMilvusResource() 51private static async Task CreateTestDataAsync(MilvusClient milvusClient, CancellationToken token) 71public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume) 209public Task Milvus_WithPersistentLifetime_ReusesContainer()
Aspire.Hosting.MongoDB.Tests (13)
AddMongoDBTests.cs (4)
88public async Task MongoDBCreatesConnectionString() 159public async Task WithMongoExpressUsesContainerHost() 209public async Task VerifyManifest() 307public async Task MongoExpressEnvironmentCallbackIsIdempotent()
ConnectionPropertiesTests.cs (1)
83public async Task VerifyManifestWithConnectionProperties()
MongoDbFunctionalTests.cs (8)
33public async Task VerifyWaitForOnMongoBlocksDependentResources() 52var pendingStart = app.StartAsync(cts.Token); 70public async Task VerifyMongoDBResource() 108public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume) 252public async Task VerifyWithInitBindMount() 359public async Task VerifyWithInitFiles() 447private static async Task CreateTestDataAsync(IMongoDatabase mongoDatabase, CancellationToken token) 465public Task MongoDB_WithPersistentLifetime_ReusesContainer()
Aspire.Hosting.MySql (1)
MySqlBuilderExtensions.cs (1)
149private static async Task CreateDatabaseAsync(MySqlConnection sqlConnection, MySqlDatabaseResource sqlDatabase, IServiceProvider serviceProvider, CancellationToken ct)
Aspire.Hosting.MySql.Tests (38)
AddMySqlTests.cs (9)
37public async Task AddMySqlContainerWithDefaultsAddsAnnotationMetadata() 74public async Task AddMySqlAddsAnnotationMetadata() 113public async Task MySqlCreatesConnectionString() 131public async Task MySqlCreatesConnectionStringWithDatabase() 154public async Task VerifyManifest() 193public async Task VerifyManifestWithPasswordParameter() 233public async Task SingleMySqlInstanceProducesCorrectMySqlHostsVariable() 353public async Task VerifyMySqlServerResourceWithPassword() 371public async Task PhpMyAdminEnvironmentCallbackIsIdempotent()
ConnectionPropertiesTests.cs (1)
78public async Task VerifyManifestWithConnectionProperties()
MySqlFunctionalTests.cs (13)
30public async Task VerifyWaitForOnMySqlBlocksDependentResources() 49var pendingStart = app.StartAsync(cts.Token); 68public async Task VerifyMySqlResource() 118public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume) 302public async Task VerifyWithInitBindMount() 397public async Task VerifyWithInitFiles() 481public async Task VerifyEfMySql() 551public async Task MySql_WithPersistentLifetime_ReusesContainers(bool useMultipleInstances) 624public async Task AddDatabaseCreatesNewDatabaseWithCustomScript(bool addEnvVar) 701public async Task AddDatabaseCreatesDatabaseResiliently() 784public async Task AddDatabaseCreatesMultipleDatabases() 832public async Task AddDatabaseCreatesDatabaseWithSpecialNames() 869public Task MySql_WithPersistentLifetime_ReusesContainerWithDefaults()
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
Aspire.Hosting.Nats.Tests (16)
AddNatsTests.cs (6)
34public async Task AddNatsSetsDefaultUserNameAndPasswordAndIncludesThemInConnectionString() 62public async Task AddNatsSetsUserNameAndPasswordAndIncludesThemInConnection() 91public async Task AddNatsContainerWithDefaultsAddsAnnotationMetadata() 129public async Task AddNatsContainerAddsAnnotationMetadata() 188public async Task VerifyManifest() 221public async Task VerifyManifestWihtParameters()
ConnectionPropertiesTests.cs (1)
50public async Task VerifyManifestWithConnectionProperties()
NatsFunctionalTests.cs (9)
26public async Task VerifyNatsResource() 68public async Task AuthenticationShouldWork(string? user, string? password) 111public async Task AuthenticationShouldFailOnWrongOrMissingCredentials(string? user, string? password) 158public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume) 289private static async Task ConsumeTestData(INatsJSContext jetStream, CancellationToken token) 313private static async Task CreateTestData(INatsJSContext jetStream, CancellationToken token) 328public async Task VerifyWaitForOnNatsBlocksDependentResources() 347var pendingStart = app.StartAsync(cts.Token); 365public Task Nats_WithPersistentLifetime_ReusesContainer()
Aspire.Hosting.OpenAI.Tests (25)
OpenAIExtensionTests.cs (6)
13public async Task DefaultEndpointIsUsedInConnectionString() 33public async Task WithEndpointUpdatesParentAndModelConnectionStrings() 81public async Task AddOpenAIModelUsesCorrectEndpoint() 100public async Task ConnectionStringExpressionIsCorrectlyFormatted() 121public async Task WithApiKeySetFromParameter() 275public async Task ConnectionStringExpressionResolves()
OpenAIFunctionalTests.cs (4)
18public async Task DependentResourceWaitsForOpenAIModelResourceWithHealthCheckToBeHealthy() 41var pendingStart = app.StartAsync(cts.Token); 60public async Task DependentResourceWaitsForOpenAIResourceWithHealthCheckToBeHealthy() 88var pendingStart = app.StartAsync(cts.Token);
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
Aspire.Hosting.Oracle.Tests (15)
AddOracleTests.cs (7)
35public async Task AddOracleWithDefaultsAddsAnnotationMetadata() 72public async Task AddOracleAddsAnnotationMetadata() 111public async Task OracleCreatesConnectionString() 130public async Task OracleCreatesConnectionStringWithDatabase() 153public async Task AddDatabaseToOracleDatabaseAddsAnnotationMetadata() 193public async Task VerifyManifest() 232public async Task VerifyManifestWithPasswordParameter()
ConnectionPropertiesTests.cs (1)
74public async Task VerifyManifestWithConnectionProperties()
OracleFunctionalTests.cs (7)
32public async Task VerifyEfOracle() 76public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume) 253public async Task VerifyWithInitBindMount() 351public async Task VerifyWithInitFiles(bool init) 446public async Task VerifyWaitForOnOracleBlocksDependentResources() 465var pendingStart = app.StartAsync(cts.Token); 483public Task Oracle_WithPersistentLifetime_ReusesContainer()
Aspire.Hosting.Orleans.Tests (3)
OrleansProviderTypeTests.cs (3)
12public async Task ProviderTypeDefaultsToResourceTypeNameWithoutResourceSuffix() 34public async Task WithOrleansProviderTypeOverridesProviderType() 56public async Task WithOrleansProviderTypeReplacesPreviousProviderType()
Aspire.Hosting.PostgreSQL (1)
PostgresBuilderExtensions.cs (1)
729private static async Task CreateDatabaseAsync(NpgsqlConnection npgsqlConnection, PostgresDatabaseResource npgsqlDatabase, IServiceProvider serviceProvider, CancellationToken cancellationToken)
Aspire.Hosting.PostgreSQL.Tests (47)
AddPostgresTests.cs (13)
46public async Task AddPostgresWithDefaultsAddsAnnotationMetadata() 98public async Task AddPostgresAddsAnnotationMetadata() 152public async Task PostgresCreatesConnectionString() 168public async Task PostgresCreatesConnectionStringWithDatabase() 190public async Task WithReferenceDispatchesPostgresDatabaseReference() 213public async Task AddDatabaseToPostgresAddsAnnotationMetadata() 268public async Task VerifyManifest() 310public async Task VerifyManifestWithParameters() 476public async Task WithPostgresProducesValidServersJsonFile() 538public async Task WithPgwebProducesValidBookmarkFiles() 683public async Task VerifyPostgresServerResourceWithPassword() 697public async Task VerifyPostgresServerResourceWithUserName() 713public async Task PostgresEnvironmentCallbackIsIdempotent()
PostgresFunctionalTests.cs (14)
28public async Task VerifyWaitForOnPostgresServerBlocksDependentResources() 51var pendingStart = app.StartAsync(); 76public async Task VerifyPgAdminResource() 99public async Task VerifyPostgresResource() 147public async Task VerifyWithPgWeb() 190public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume) 362public async Task VerifyWithInitBindMount() 458public async Task VerifyWithInitFiles() 542public async Task Postgres_WithPersistentLifetime_ReusesContainers() 599public async Task AddDatabaseCreatesDatabaseWithCustomScript() 651public async Task AddDatabaseCreatesDatabaseWithSpecialNames() 693public async Task AddDatabaseCreatesDatabaseResiliently() 778public async Task AddDatabaseCreatesMultipleDatabases() 825public Task Postgres_WithPersistentLifetime_ReusesContainerWithDefaults()
PostgresMcpBuilderTests.cs (5)
17public async Task WithPostgresMcpOnDatabaseAddsContainerResourceWithMcpEndpointAnnotation() 43public async Task WithPostgresMcpOnDatabaseResolvesEndpointUrl() 71public async Task WithPostgresMcpOnDatabaseSetsDatabaseUriEnvironmentVariable() 99public async Task WithPostgresMcpOnDatabaseCanBeCalledMultipleTimesWithoutDuplicateResources() 116public async Task WithPostgresMcpWithCustomNameCreatesDistinctResourcesPerName()
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
Aspire.Hosting.Python (5)
PythonAppResourceBuilderExtensions.cs (5)
320return Task.CompletedTask; 428return Task.CompletedTask; 504return Task.CompletedTask; 1340return Task.CompletedTask; 1355return Task.CompletedTask;
Aspire.Hosting.Python.Tests (45)
AddPythonAppTests.cs (44)
25public async Task AddPythonAppProducesDockerfileResourceInManifest() 63public async Task AddInstrumentedPythonProjectProducesDockerfileResourceInManifest() 102public async Task PythonResourceFinishesSuccessfully() 124public async Task PythonResourceSupportsWithReference() 147public async Task AddPythonApp_SetsResourcePropertiesCorrectly() 184public async Task AddPythonApp_ObsoleteMethod_StillWorks() 228public async Task AddPythonAppWithScriptArgs_IncludesTheArguments() 403public async Task WithVirtualEnvironment_UpdatesCommandToUseNewVirtualEnvironment() 435public async Task WithVirtualEnvironment_SupportsAbsolutePath() 495public async Task WithVirtualEnvironment_CanBeChainedWithOtherExtensions() 756public async Task WithUv_AddsUvSyncArgument() 776public async Task WithUv_AddsWaitForCompletionRelationship() 975public async Task AddPythonApp_SetsCorrectCommandAndArguments() 1011public async Task AddPythonModule_SetsCorrectCommandAndArguments() 1045public async Task AddPythonExecutable_SetsCorrectCommandAndArguments() 1078public async Task AddPythonModule_WithArgs_AddsArgumentsCorrectly() 1102public async Task AddPythonApp_WithArgs_AddsArgumentsCorrectly() 1124public async Task AddPythonExecutable_WithArgs_AddsArgumentsCorrectly() 1145public async Task WithEntrypoint_ChangesEntrypointTypeAndValue() 1240public async Task WithUv_GeneratesDockerfileInPublishMode() 1311public async Task WithUv_GeneratesDockerfileInPublishMode_WithoutUvLock() 1382public async Task WithDebugSupport_KeepsScriptArgumentInTheAppModelForScriptEntrypoint() 1427public async Task WithDebugSupport_DoesntRemoveScriptArgumentForScriptEntrypoint_WhenResourceTypeNotSupported() 1466public async Task WithDebugSupport_KeepsModuleArgumentsInTheAppModelForModuleEntrypoint() 1511public async Task WithDebugSupport_PopulatesWorkingDirectory_ForScriptEntrypoint() 1532public async Task WithDebugSupport_PopulatesWorkingDirectory_ForModuleEntrypoint() 1556public async Task WithDebugSupport_PopulatesWorkingDirectory_ForExecutableEntrypoint() 1580public async Task WithDebugSupport_PropagatesWorkingDirectoryOverride_ForExecutableEntrypoint() 1607public async Task WithDebugSupport_PropagatesWorkingDirectoryOverride() 1639public async Task WithDebugSupport_DoesntRemoveModuleArgumentsForModuleEntrypoint_WhenResourceTypeNotSupported() 1678public async Task WithDebugSupport_ExecutableTypeDoesNotModifyArgs() 1710public async Task PythonApp_SetsPythonUtf8EnvironmentVariable_OnWindowsInRunMode() 1732public async Task PythonApp_DoesNotSetPythonUtf8EnvironmentVariable_OnNonWindowsPlatforms() 1750public async Task PythonApp_DoesNotSetPythonUtf8EnvironmentVariable_InPublishMode() 1766public async Task WithUv_CustomBaseImages_GeneratesDockerfileWithCustomImages() 1825public async Task FallbackDockerfile_GeneratesDockerfileWithoutUv_WithRequirementsTxt() 1873public async Task FallbackDockerfile_GeneratesDockerfileWithPyprojectToml() 1913public async Task FallbackDockerfile_GeneratesDockerfileWithoutAnyDependencyFiles() 1945public async Task FallbackDockerfile_GeneratesDockerfileForAllEntrypointTypes() 2234public async Task WithPip_CreatesDefaultVenv_And_WaitsForVenvCreation() 2340public async Task MethodOrdering_WithPip_WithVirtualEnvironment_CreateTrue_WithPip_CreatesVenv() 2471public async Task WithPip_InstallFalse_CreatesInstallerWithExplicitStart() 2507public async Task WithUv_InstallFalse_CreatesInstallerWithExplicitStart() 2589private static async Task PublishBeforeStartEventAsync(DistributedApplication app)
AddUvicornAppTests.cs (1)
29public async Task WithUv_GeneratesDockerfileInPublishMode()
Aspire.Hosting.Qdrant.Tests (15)
AddQdrantTests.cs (7)
45public async Task AddQdrantWithDefaultsAddsAnnotationMetadata() 115public async Task AddQdrantAddsAnnotationMetadata() 156public async Task QdrantCreatesConnectionString() 172public async Task QdrantClientAppWithReferenceContainsConnectionStrings() 216public async Task WithReferenceDispatchesQdrantReference() 244public async Task VerifyManifest() 280public async Task VerifyManifestWithParameters()
QdrantFunctionalTests.cs (8)
27public async Task VerifyQdrantResource() 68private static async Task CreateTestDataAsync(QdrantClient qdrantClient, CancellationToken cancellationToken) 92public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume) 228public async Task AddQdrantWithDefaultsAddsUrlAnnotations() 240return Task.CompletedTask; 257public async Task VerifyWaitForOnQdrantBlocksDependentResources() 276var pendingStart = app.StartAsync(cts.Token); 294public Task Qdrant_WithPersistentLifetime_ReusesContainer()
Aspire.Hosting.RabbitMQ.Tests (25)
AddRabbitMQTests.cs (3)
91public async Task RabbitMQCreatesConnectionString() 198public async Task VerifyManifest(bool withManagementPlugin) 244public async Task VerifyManifestWithParameters()
ConnectionPropertiesTests.cs (1)
50public async Task VerifyManifestWithConnectionProperties()
RabbitMQFunctionalTests.cs (6)
23public async Task VerifyWaitForOnRabbitMQBlocksDependentResources() 41var pendingStart = app.StartAsync(); 60public async Task VerifyRabbitMQResource() 98public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume) 240public Task RabbitMQ_WithPersistentLifetime_ReusesContainer() 251public Task RabbitMQ_WithPersistentLifetimeAndRandomizedPorts_ReusesContainer()
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
Aspire.Hosting.Radius (25)
Publishing\RadCredentialRegisterStep.cs (7)
65internal async Task ExecuteAsync(PipelineStepContext context) 124_ => Task.FromResult(("--tenant-id", sp.TenantId)), 125_ => Task.FromResult(("--client-id", sp.ClientId)), 138_ => Task.FromResult(("--client-id", wi.ClientId)), 139_ => Task.FromResult(("--tenant-id", wi.TenantId)), 164_ => Task.FromResult(("--iam-role", irsa.IamRoleArn)), 249private static async Task RunRadAsync(
Publishing\RadiusBicepPublishingContext.cs (1)
50internal async Task ExecuteAsync(PipelineStepContext context)
Publishing\RadiusDeploymentPipelineStep.cs (1)
100internal async Task ExecuteAsync(PipelineStepContext context)
Publishing\RadiusInfrastructureBuilder.cs (2)
1187private async Task ResolveEnvPartsAsync(object? value, IResource owner, List<EnvPart> parts) 1244private async Task ResolveReferenceExpressionPartsAsync(ReferenceExpression expression, IResource owner, List<EnvPart> parts)
Publishing\SealedSecretApplyStep.cs (5)
57internal async Task ExecuteAsync(PipelineStepContext context) 95private static async Task ApplyStoreAsync( 178private static async Task EnsureKubectlAsync(CancellationToken cancellationToken) 260internal static async Task WaitForSealedSecretSyncedAsync( 308await Task.Delay(remaining < interval ? remaining : interval, cancellationToken).ConfigureAwait(false);
RadiusInfrastructure.cs (3)
45internal static Task PrepareDeploymentTargetsAsync( 55return Task.CompletedTask; 120return Task.CompletedTask;
Secrets\RadiusSecretStoreValidation.cs (6)
24internal static Task ValidateAsync(PipelineStepContext context) 30return Task.CompletedTask; 34return Task.CompletedTask; 47internal static Task ValidateHasEnvironmentAsync(PipelineStepContext context) 53return Task.CompletedTask; 57return Task.CompletedTask;
Aspire.Hosting.Radius.Tests (75)
Deployment\RadCliDetectionTests.cs (3)
13public async Task DetectRadCliAsync_ReturnsBoolean() 22public async Task DetectRadCliAsync_ReturnsTrueOrFalse_BasedOnEnvironment() 33public async Task DetectRadCliAsync_SupportsCancellation()
DeploymentE2E\DeployEndToEndTests.cs (4)
24public async Task Deploy_SimpleApp_GeneratesBicepAndInvokesRad() 55public async Task Deploy_GeneratedBicep_ContainsCorrectResourceReferences() 90public async Task Deploy_RadCliAvailability_Detected() 101public async Task Deploy_CleanupViaRadDelete_Supported()
InnerLoop\GracefulDegradationTests.cs (5)
14public async Task AspireRun_Completes_WhenKubernetesUnavailable() 40public async Task AspireRun_Completes_WhenRadCliNotOnPath() 52public async Task PublishMode_AttachesAnnotationsToAllComputeResources() 76public async Task PublishMode_LogsEnvironmentConfiguration() 99private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken);
InnerLoop\MultiEnvironmentTests.cs (4)
30public async Task UntargetedResources_WithMultipleEnvironments_FailFastWithClearError() 53public async Task ExplicitlyTargetedResources_OnlyAnnotatedByOwningEnvironment() 75public async Task DifferentNamespaces_DontCauseNamingCollisions() 103private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken);
InnerLoop\RadiusInfrastructureInitializationTests.cs (7)
19public async Task PrepareDeploymentTargets_AttachesDeploymentTargetAnnotation_ToContainerResources() 37public async Task PrepareDeploymentTargets_AttachesAnnotation_ToAllComputeResources() 57public async Task PrepareDeploymentTargets_DoesNotAnnotate_NonComputeResources() 76public async Task PrepareDeploymentTargets_AnnotationPointsToCorrectEnvironment() 93public async Task PrepareDeploymentTargets_AttachesAnnotation_ToProjectResources() 111public async Task AddRadiusEnvironment_InRunMode_DoesNotRegisterEnvironmentResource() 128private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken);
Publishing\LegacyFallbackEmissionTests.cs (4)
52public Task RedisOnly_EmitsLegacyParentsAndNoUdtResources() 65public Task MixedLegacyAndUdt_EmitsBothParentPairs() 84public Task LegacyAndUdt_ShareResourceNameAndUseDistinctParents() 99public Task UdtOnly_DoesNotEmitLegacyParents()
Publishing\RadCredentialArgumentTests.cs (4)
21public async Task AzureServicePrincipal_EmitsTwoPositionalTokens_NoNameFlag() 44public async Task AzureWorkloadIdentity_EmitsTwoPositionalTokens_NoNameFlag() 65public async Task AwsAccessKey_EmitsTwoPositionalTokens_NoNameFlag() 87public async Task AwsIrsa_EmitsTwoPositionalTokens_NoNameFlag()
Publishing\RadiusDeployParametersTests.cs (2)
45public async Task WriteDeployParametersFile_WritesOwnerOnlyArmParameterFile() 104public async Task WriteDeployParametersFile_ReturnsNull_WhenNoRecipeParameters()
Secrets\SealedSecretApplyStepTests.cs (41)
217public async Task WaitForSealedSecretSynced_TransientStatusProbeFailure_RetriesUntilSynced() 237? Task.FromResult((ExitCode: 1, StdOut: "", StdErr: "Unable to connect to the server: dial tcp 127.0.0.1:6443: connect: connection refused")) 238: Task.FromResult((ExitCode: 0, StdOut: """ 255secretExists: _ => Task.FromResult(true), 262public async Task GetSealedSecretStatus_PermanentFailure_ThrowsImmediately() 277return Task.FromResult((ExitCode: 1, StdOut: "", StdErr: "Error from server (Forbidden): sealedsecrets.bitnami.com \"db-creds\" is forbidden: User cannot get resource")); 285public async Task GetSealedSecretStatus_NotFound_ReturnsEmptyStatusForRetry() 294(_, _) => Task.FromResult((ExitCode: 1, StdOut: "", StdErr: "Error from server (NotFound): sealedsecrets.bitnami.com \"db-creds\" not found"))); 305public async Task GetSealedSecretStatus_TransientFailure_ReturnsEmptyStatusForRetry(string stderr) 312(_, _) => Task.FromResult((ExitCode: 1, StdOut: "", StdErr: stderr))); 319public async Task SecretExists_ExitZero_ReturnsTrue() 326(_, _) => Task.FromResult((ExitCode: 0, StdOut: "{}", StdErr: ""))); 336public async Task SecretExists_NotFoundOrTransientFailure_ReturnsFalseForRetry(string stderr) 346(_, _) => Task.FromResult((ExitCode: 1, StdOut: "", StdErr: stderr))); 355public async Task SecretExists_PermanentFailure_Throws(string stderr) 364(_, _) => Task.FromResult((ExitCode: 1, StdOut: "", StdErr: stderr)))); 389public async Task WaitForSealedSecretSynced_ReturnsOnceObservedGenerationMatchesSyncedTrueAndSecretExists() 401return Task.FromResult(statusCalls == 1 411return Task.FromResult(secretCalls >= 2); 420public async Task WaitForSealedSecretSynced_FailsFastWhenSyncedFalseForAppliedGeneration() 428getStatus: _ => Task.FromResult(new SealedSecretApplyStep.SealedSecretStatusSnapshot( 432secretExists: _ => Task.FromResult(false), 440public async Task WaitForSealedSecretSynced_TimesOutWhenStatusNeverMatches_Throws_ASPIRERADIUS058() 448getStatus: _ => Task.FromResult(new SealedSecretApplyStep.SealedSecretStatusSnapshot(4, 3, [])), 449secretExists: _ => Task.FromResult(false), 459public async Task WaitForSealedSecretSynced_ConcurrentReapplyAdvancesGeneration_SyncsAgainstLiveGeneration() 470getStatus: _ => Task.FromResult(new SealedSecretApplyStep.SealedSecretStatusSnapshot( 474secretExists: _ => Task.FromResult(true), 479public async Task WaitForSealedSecretSynced_StatusMatchesButSecretAbsent_KeepsWaitingThenTimesOut() 495getStatus: _ => Task.FromResult(new SealedSecretApplyStep.SealedSecretStatusSnapshot( 507await Task.Delay(Timeout.Infinite, ct).ConfigureAwait(false); 517public async Task WaitForSealedSecretSynced_HangingProbeTimesOutWith_ASPIRERADIUS058() 528await Task.Delay(Timeout.Infinite, ct); 531secretExists: _ => Task.FromResult(false), 540public async Task WaitForSealedSecretSynced_CancellationDuringPolling_ThrowsOperationCanceledException() 551getStatus: _ => Task.FromResult(new SealedSecretApplyStep.SealedSecretStatusSnapshot(4, null, [])), 552secretExists: _ => Task.FromResult(false), 796public async Task InvokeProbeWithRemainingBudget_HangingApply_CancelledWithin_ASPIRERADIUS066() 803await Task.Delay(Timeout.Infinite, ct); 818public async Task InvokeProbeWithRemainingBudget_CallerCancellation_SurfacesOperationCanceled() 829await Task.Delay(Timeout.Infinite, ct);
Secrets\SecretStoreValidationTests.cs (1)
117public async Task AppScopedStore_WithoutEnvironment_RegistersValidationGate()
Aspire.Hosting.Redis (5)
RedisBuilderExtensions.cs (5)
155return Task.CompletedTask; 162return Task.CompletedTask; 185return Task.CompletedTask; 371return Task.CompletedTask; 385return Task.CompletedTask;
Aspire.Hosting.Redis.Tests (39)
AddRedisTests.cs (24)
125public async Task RedisCreatesConnectionStringWithDefaultPassword() 144public async Task VerifyDefaultManifest() 169public async Task VerifyWithoutPasswordManifest() 193public async Task VerifyWithPasswordManifest() 222public async Task VerifyWithPasswordValueNotProvidedManifest() 270public async Task WithRedisInsightProducesCorrectEnvironmentVariables() 439public async Task VerifyRedisResourceWithPassword(bool withPassword) 479public async Task SingleRedisInstanceWithoutPasswordProducesCorrectRedisHostsVariable() 503public async Task SingleRedisInstanceWithPasswordProducesCorrectRedisHostsVariable() 524public async Task MultipleRedisInstanceProducesCorrectRedisHostsVariable() 600public async Task WithDataVolumeAddsPersistenceAnnotation() 611public async Task WithDataVolumeDoesNotAddPersistenceAnnotationIfIsReadOnly() 622public async Task WithDataBindMountAddsPersistenceAnnotation() 633public async Task WithDataBindMountDoesNotAddPersistenceAnnotationIfIsReadOnly() 644public async Task WithPersistenceReplacesPreviousAnnotationInstances() 660public async Task WithModuleAddsCommandLineArgsForWellKnownModule() 672public async Task WithModuleAddsCommandLineArgsForModulePath() 684public async Task WithModuleAddsCommandLineArgsForMultipleModules() 697public async Task WithModuleDeduplicatesCommandLineArgsForSameModule() 728public async Task AddRedisContainerWithPasswordAnnotationMetadata() 753public async Task RedisInsightEnvironmentCallbackIsIdempotent() 853public async Task RedisWithCertificateHasCorrectConnectionString() 890public async Task RedisWithCertificateUsesTargetPortsForCommandLineArgs() 911public async Task RedisConnectionStringResolvesWithTlsDynamically()
RedisFunctionalTests.cs (15)
32public async Task VerifyWaitForOnRedisBlocksDependentResources() 51var pendingStart = app.StartAsync(cts.Token); 70public async Task VerifyRedisCommanderResource() 100public async Task VerifyRedisResource() 137public async Task WithModuleLoadsNativeModule() 172public async Task VerifyWithRedisInsightImportDatabases() 234public async Task WithDataVolumeShouldPersistStateBetweenUsages() 321public async Task WithDataBindMountShouldPersistStateBetweenUsages() 408public async Task PersistenceIsDisabledByDefault() 482public async Task RedisInsightWithDataShouldPersistStateBetweenUsages(bool useVolume) 594private static async Task EnsureRedisInsightEulaAccepted(HttpClient httpClient, CancellationToken ct) 619static async Task AcceptRedisInsightEula(HttpClient client, CancellationToken ct) 661public async Task WithRedisCommanderShouldWorkWithPassword() 703public Task Redis_WithPersistentLifetime_ReusesContainer() 714public Task Redis_WithPersistentLifetimeAndRandomizedPorts_ReusesContainer()
Aspire.Hosting.RemoteHost (28)
Ats\AtsCallbackProxyFactory.cs (3)
77var isAsync = typeof(Task).IsAssignableFrom(returnType); 258private async Task InvokeAsyncVoid(string callbackId, JsonObject? args, CancellationToken cancellationToken, int ctParamIndex) 264private async Task InvokeAsyncVoidWithDtoWriteback(string callbackId, JsonObject? args, object?[] originalArgs, Type[] argTypes, CancellationToken cancellationToken, int ctParamIndex)
Ats\CapabilityDispatcher.cs (7)
211return Task.FromResult(_marshaller.MarshalToJson(value, capability.ReturnType)); 277return Task.FromResult<JsonNode?>(new JsonObject 635return await Task.Run(() => InvokeMethodCore(method, target, methodArgs)).ConfigureAwait(false); 645if (result is Task task) 661var boxedTask = asTask.Invoke(result, null) as Task 676private static object? GetAsyncResultValue(Task task)
AtsCapabilityScanner.cs (4)
2209else if (returnType == typeof(Task)) 2301else if (funcReturnType == typeof(Task)) 2339if (type == typeof(Task)) 2638if (type == typeof(Task))
ICallbackInvoker.cs (1)
30Task InvokeAsync(string callbackId, JsonNode? args, CancellationToken cancellationToken = default);
JsonRpcCallbackInvoker.cs (1)
55public async Task InvokeAsync(string callbackId, JsonNode? args, CancellationToken cancellationToken = default)
JsonRpcServer.cs (8)
49protected override async Task ExecuteAsync(CancellationToken stoppingToken) 78private async Task StartNamedPipeServerAsync(RemoteHostProfilingTelemetry.ActivityScope listenActivity, CancellationToken cancellationToken) 119_ = Task.Run(() => HandleClientStreamAsync(pipeServer, ownsStream: true, cancellationToken), cancellationToken); 129await Task.Delay(1000, cancellationToken).ConfigureAwait(false); 136private async Task StartUnixSocketServerAsync(RemoteHostProfilingTelemetry.ActivityScope listenActivity, CancellationToken cancellationToken) 181_ = Task.Run(() => HandleClientStreamAsync(stream, ownsStream: true, cancellationToken), cancellationToken); 191await Task.Delay(1000, cancellationToken).ConfigureAwait(false); 198private async Task HandleClientStreamAsync(Stream clientStream, bool ownsStream, CancellationToken cancellationToken)
OrphanDetector.cs (1)
37protected override async Task ExecuteAsync(CancellationToken stoppingToken)
RemoteAppHostService.cs (1)
67_ = Task.Run(() => _clientRpc?.Dispose());
RemoteHostServer.cs (1)
34public static async Task RunAsync(string[] args)
src\Shared\IntegrationPackageProbeManifest.cs (1)
123public static Task WriteAsync(
Aspire.Hosting.RemoteHost.Tests (92)
AtsCapabilityScannerTests.cs (2)
53var result = AtsCapabilityScanner.MapToAtsTypeId(typeof(Task)); 833Func<ContainerResource, ProjectResource, Task> callback)
AtsExportsTests.cs (2)
80public async Task PromptInputs_ResultCarriesSubmittedValuesByName() 120public async Task PromptInputs_ResultCarriesSubmittedFileMetadataByName()
AtsMarshallerTests.cs (5)
736public async Task UnmarshalFromJson_UnmarshalsDtoInitListProperties() 1180public async Task MarshalToJson_ConditionalReferenceExpression_PreservesValueAfterRoundTrip() 1199public async Task MarshalToJson_ConditionalReferenceExpression_FalseConditionRoundTrips() 1271public async Task UnmarshalFromJson_CondExpr_TrueConditionReturnsWhenTrueValue() 1313public async Task UnmarshalFromJson_CondExpr_FalseConditionReturnsWhenFalseValue()
CallbackProxyTests.cs (23)
58public async Task InvokedProxy_CallsCallbackInvoker() 72public async Task InvokedProxy_ReturnsResultFromInvoker() 115public async Task InvokedProxy_PassesStringArgumentAsJson() 132public async Task InvokedProxy_PassesMultipleArgumentsAsJson() 150public async Task InvokedProxy_MarshalsHandleArgumentWithDeclaredType() 175public async Task InvokedProxy_WithResultReturnsCorrectValue() 188public async Task InvokedProxy_WithCancellationToken_IncludesTokenInArgs() 209public async Task InvokedProxy_WithOnlyCancellationToken_UsesPositionalTokenId() 229public async Task InvokedProxy_PropagatesExceptionFromInvoker() 244public async Task InvokedProxy_WithResult_PropagatesExceptionFromInvoker() 259public async Task InvokedProxy_PropagatesOperationCanceledException() 296public async Task InvokedAsyncVoidProxy_AppliesDtoWritebackFromResult() 403public delegate Task TestCallback(string value); 405public delegate Task TestCallbackNoArgs(); 409public delegate Task TestCallbackWithString(string value); 411public delegate Task TestCallbackWithMultipleParams(string name, int count); 413public delegate Task TestCallbackWithHandle(ITestCallbackHandle handle); 417public delegate Task TestCallbackWithCancellation(string value, CancellationToken cancellationToken); 419public delegate Task TestCallbackWithOnlyCancellation(CancellationToken cancellationToken); 423public delegate Task TestAsyncVoidCallbackWithDto(TestCallbackDto dto); 459return Task.FromResult(ResultToReturn is TResult result ? result : default!); 462public Task InvokeAsync(string callbackId, JsonNode? args, CancellationToken cancellationToken = default) 469return Task.CompletedTask;
CapabilityDispatcherTests.cs (28)
18CapabilityHandler handler = (args, handles) => Task.FromResult<JsonNode?>(JsonValue.Create("result")); 37dispatcher.Register("test/cap1@1", (_, _) => Task.FromResult<JsonNode?>(null)); 38dispatcher.Register("test/cap2@1", (_, _) => Task.FromResult<JsonNode?>(null)); 54return Task.FromResult<JsonNode?>(JsonValue.Create("success")); 70return Task.FromResult<JsonNode?>(null); 82dispatcher.Register("test/capability@1", (_, _) => Task.FromResult<JsonNode?>(JsonValue.Create(42))); 109return Task.FromResult<JsonNode?>(null); 128return Task.FromResult<JsonNode?>(null); 146return Task.FromResult<JsonNode?>(null); 161Task.FromException<JsonNode?>( 2127return Task.FromResult(default(TResult)!); 2130public Task InvokeAsync(string callbackId, JsonNode? args, CancellationToken cancellationToken = default) 2135return Task.CompletedTask; 2166public static async Task AsyncVoidMethod(string value) 2168await Task.Delay(1); 2176await Task.Delay(1); 2184await Task.Delay(1); 2192await Task.Delay(1); 2318await Task.Delay(1); 2324await Task.Delay(1); 2359public static void InvokeCallback(Func<Task> callback) 2369public static void InvokeTypedCallback(Func<string, Task> callback) 2412return Task.FromResult(Environment.CurrentManagedThreadId); 2417public static Task NonGenericTaskBackgroundThreadProbe() 2420return Task.CompletedTask; 2440public static Task InvokeSyncCallbackFromAsyncBackgroundThreadProbe(Func<Task> callback) 2445return Task.CompletedTask;
HandleRegistryTests.cs (2)
197public async Task DisposeAsync_DisposesDisposableObjects() 210public async Task DisposeAsync_DisposesAsyncDisposableObjects()
JsonRpcAuthenticationTests.cs (10)
31public async Task Ping_DoesNotRequireAuthentication() 43public async Task ProtectedMethods_RequireAuthentication(string methodName, object?[] arguments) 55public async Task FailedAuthentication_ClosesConnection_AndPreventsFurtherCalls() 69private static async Task AssertRejectedAuthenticationAsync(JsonRpcClientHandle client) 138public static async Task WaitForDisconnectAsync(JsonRpcClientHandle client) 140var completedTask = await Task.WhenAny(client.Completion, Task.Delay(TimeSpan.FromSeconds(5))); 216await Task.Delay(100, cancellationToken); 235public Task Completion => _rpc.Completion;
LayoutCommandTests.cs (7)
16public async Task LayoutCommand_PrefersRuntimeTargetForCurrentRuntime_AndPreservesStructuredAssets() 69public async Task LayoutCommand_PrefersRuntimeSpecificTargetWhenMultipleTargetsExist() 111public async Task LayoutCommand_FallsBackToFrameworkTargetWhenRidTargetIsMissing() 149public async Task ManifestCommand_WritesPackageProbeManifestWithoutCreatingLibsLayout() 214public async Task RestoreAndManifestCommands_WritePackageCacheManifestWithoutCreatingLibsLayout() 365private static async Task CreateTestPackageAsync(string sourcePath) 388private static async Task WriteZipEntryAsync(ZipArchive archive, string entryName, string content)
OrphanDetectorTests.cs (6)
16public async Task CompletesWithoutStoppingWhenNoParentPidConfigured() 31public async Task StopsWhenParentPidNotRunning_PidOnly() 52public async Task StopsWhenParentPidNotRunning_WithStartTimeVerification() 77public async Task StopsWhenStartTimeMismatch_PidReuse() 102public async Task FallsBackToAspireCliStartedWhenRemoteStartedMissing() 127public async Task PrefersStableAspireCliStartedWhenRemoteStartedMissing()
ReferenceExpressionRefTests.cs (2)
126public async Task ToReferenceExpression_WithValueProviders_CreatesExpression() 188public async Task ToReferenceExpression_WithMixedValueProviders_CreatesExpression()
RestoreCommandTests.cs (1)
15public async Task RestoreAndManifestCommands_WritePortableRuntimeAssetsToPackageProbeManifest()
tests\Shared\TemporaryWorkspace.cs (1)
27public async Task InitializeGitAsync(CancellationToken cancellationToken = default)
tests\Shared\TestInteractionService.cs (3)
89var workTask = work(progressContext); 92var finished = await Task.WhenAny(workTask, completionTask).ConfigureAwait(false);
Aspire.Hosting.Rust (7)
RustCargoArgsCallbackAnnotation.cs (3)
12internal sealed class RustCargoArgsCallbackAnnotation(Func<RustCargoArgsCallbackContext, Task> callback) : IResourceAnnotation 22return Task.CompletedTask; 31public Func<RustCargoArgsCallbackContext, Task> Callback { get; } = callback ?? throw new ArgumentNullException(nameof(callback));
RustDockerfileGenerator.cs (1)
58public static async Task WriteAsync(RustAppResource resource, DockerfileBuilderCallbackContext context)
RustHostingExtensions.cs (3)
169return Task.CompletedTask; 225return Task.CompletedTask; 238public static IResourceBuilder<T> WithCargoArgs<T>(this IResourceBuilder<T> builder, Func<RustCargoArgsCallbackContext, Task> callback)
Aspire.Hosting.Rust.Tests (100)
AddRustAppPublishTests.cs (44)
24public async Task VerifyPublish_DefaultsToAMuslBuildAndRuntimePair() 34public async Task VerifyPublish_LeavesAPinnedToolchainToRustupInsideTheImage() 49public async Task VerifyPublish_HonoursWithCargoBinTarget() 59public async Task VerifyPublish_HonoursWithCargoExample() 68public async Task VerifyPublish_HonoursWithCargoProfile() 78public async Task VerifyPublish_HonoursWithCargoReleaseBuild() 86public async Task VerifyPublish_HonoursWithCargoTarget() 106public async Task PublishMapsSupportedCargoTargetsToTheContainerPlatform( 143public async Task PublishRejectsATargetThatNeedsBothCustomImages(string target) 168public async Task PublishRejectsA32BitTargetWithoutACustomBuildImage( 191public async Task PublishRejectsSplitBaseImageCallsForANonMuslTarget() 217public async Task PublishRejectsATargetThatCannotMapToAContainerPlatformEvenWithCustomImages() 243public async Task PublishRejectsAContainerPlatformThatConflictsWithTheCargoTarget() 295public async Task PublishMakesTheRustImageBuildDependOnEachContainerFilesSource() 344Action = static _ => Task.CompletedTask, 352public async Task VerifyPublish_ClearsStaleArtifactsBeforeACustomTargetProfileBuild() 364public async Task VerifyPublish_HonoursWithDockerfileBaseImage() 373public async Task VerifyPublish_ForwardsCargoFeaturesAndRawArgs() 385public async Task VerifyPublish_ShellQuotesArgumentsWithMetacharacters() 397public async Task PublishRejectsCredentialBearingCargoConfigArguments(string argument, string? value) 431public async Task PublishRejectsDockerfileValuesContainingControlCharacters( 477public async Task VerifyPublish_SelectsAWorkspacePackage() 549public async Task PublishingPreservesACallerConfiguredDockerfileFactory() 560_ => Task.FromResult("FROM scratch\n"))); 574public async Task VerifyPublish_KeepsTheManifestPathRelative() 585public async Task PublishUsesTheFilesystemCasingForTheManifestPath() 610public async Task PublishUsesTheStoredUnicodeNormalizationForTheManifestPath() 642public async Task PublishDoesNotEnumerateAncestorsAboveTheBuildContext() 691public async Task VerifyPublish_RewritesWindowsSeparatorsInTheManifestPath() 707public async Task PublishPreservesBackslashesThatAreFilenameCharactersOnUnix() 726public async Task VerifyPublish_CanonicalizesMacOSAliasesWhenValidatingTheManifestPath() 760public async Task PublishPreservesManifestCasingAcrossAMacOSFilesystemAlias() 844public async Task PublishFailsWhenTheManifestIsOutsideTheAppDirectory(string manifestPath) 857public async Task PublishFailsWhenTheManifestPathIsAbsolute() 869public async Task VerifyPublish_AddsLockedWhenTheCrateHasALockFile() 880public async Task VerifyPublish_HonoursOptingOutOfTheLockedAndReleaseDefaults() 890public async Task PublishScopesTheTargetCacheToTheCrateDirectory() 910public async Task PublishReusesTheTargetCacheForTheSameCrateDirectory() 934public async Task PublishIsolatesTheTargetCacheByResourceName() 952public async Task VerifyPublish_DoesNotRepeatLockedWhenTheResourceAlreadyAskedForIt() 961public async Task VerifyPublish_EmitsABuildContextIgnoreThatExcludesTargetDirectories() 980public async Task AnAuthoredDockerignoreTakesOverFromTheDefaults() 1043public async Task PublishBoundsTheLockFileSearchToAnAppDirectoryWithATrailingSeparator(bool lockFileInsideAppDirectory) 1101public async Task PublishCargoArgsCallbackReceivesTheRustResource()
CargoMetadataTests.cs (2)
279public async Task ReadingMetadataDoesNotCompileTheCrate() 320public async Task MissingManifestSurfacesCargosOwnError()
FakeCargoMetadataReader.cs (1)
37public Func<CancellationToken, Task>? OnRead { get; set; }
RustDebugArgsTests.cs (7)
45public async Task DebugSessionKeepsCargoToolArgumentsInTheAppModel() 59public async Task ProgramArgumentsCanStartWithSeparator() 68public async Task CargoBuildOptionsLeadProgramArguments() 83public async Task NoProgramArgumentsStillIncludeCargoSeparator() 91public async Task CargoArgumentsRegisteredAfterProgramArgumentsAreStillApplied() 105public async Task CargoToolArgumentsRemainOwnedWhenRegisteredAfterProgramArguments() 117public async Task RunArgsRetainCargoArgumentsWhenIdeCannotDebugRust()
RustDockerfileShellTests.cs (6)
11public async Task EmptyCandidateSetDoesNotPreventTheCurrentArtifactFromBeingCollected() 35public async Task CargoFailurePreservesItsExitCodeAndStandardError() 60public async Task StaleCandidatesAreRemovedBeforeTheCurrentArtifactIsCollected() 91public async Task MissingArtifactDiagnosticDoesNotExecuteTheTargetName() 116public async Task TheAppAccountIsOnlyCreatedWhenTheRuntimeImageDoesNotAlreadyDefineIt(bool groupExists, bool userExists) 148public async Task AppAccountCreationStillFailsWhenTheRuntimeImageCannotCreateTheUser()
RustPublicApiTests.cs (25)
37public async Task AddRustAppDefaultArgsAreRunWithSeparator() 48public async Task AddRustAppWithCargoAndAppArgsPreservesSeparatorOrdering() 61public async Task WithCargoFeaturesAndTargetSelectionMapToCargoArgs() 74public async Task WithCargoFeaturesAccumulatesAcrossCalls() 87public async Task WithCargoTargetSelectionMethodsMapToCargoArgs() 106public async Task WithCargoExampleMapsToCargoArgs() 120public async Task WithCargoProfileWinsOverWithCargoReleaseBuild() 134public async Task WithCargoLockedMapsToCargoArgs() 146public async Task RunModeDoesNotOptIntoLockedOrRelease() 159public async Task WithCargoArgsCallbackReceivesTheRustResourceInRunMode() 173public async Task WithCargoArgsAsyncCallbackReceivesTheRustResourceInRunMode() 181return Task.CompletedTask; 232public async Task LaunchConfigurationCarriesCargoBuildArguments() 249public async Task LaunchConfigurationCarriesCargoTargetSelectionArguments() 264public async Task LaunchConfigurationReusesResolvedCargoArgumentsInsteadOfRunningCallbacksAgain() 286public async Task LaunchConfigurationCarriesTheExecutableTheBuildWillProduce() 302public async Task LaunchConfigurationUsesResolvedCargoEnvironmentWithoutReevaluatingCallbacks() 338public async Task LaunchConfigurationThrowsWhenCargoArgumentsHaveNotBeenResolved() 353public async Task LaunchConfigurationReadsCurrentRealCargoMetadataForEachRequest() 396public async Task LaunchConfigurationUsesTheResolvedEnvironmentForEachExecutableCreation() 425public async Task LaunchConfigurationQueriesCurrentCargoMetadataOncePerRequest() 454public async Task LaunchConfigurationRetriesCargoMetadataOnTheNextRequest() 469return Task.CompletedTask; 491public async Task LaunchConfigurationCancelsCargoMetadataWhenCancellationIsRequested() 504await Task.Delay(Timeout.Infinite, cancellationToken);
RustReadmeTests.cs (1)
12public async Task ReadmeDocumentsTheFirstPartyIntegration()
tests\Shared\TestPipelineActivityReporter.cs (14)
133public Task CompletePublishAsync(PublishCompletionOptions? options = null, CancellationToken cancellationToken = default) 142return Task.CompletedTask; 147public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 175return Task.FromResult<IReportingStep>(new TestReportingStep(this, title, _testOutputHelper)); 193public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 202return Task.CompletedTask; 213return Task.FromResult<IReportingTask>(new TestReportingTask(_reporter, statusText, _testOutputHelper)); 250public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 272public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 280return Task.CompletedTask; 283public Task UpdateAsync(string statusText, CancellationToken cancellationToken = default) 291return Task.CompletedTask; 294public Task UpdateAsync(MarkdownString statusText, CancellationToken cancellationToken = default) 300public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
Aspire.Hosting.Sdk.Tests (46)
AppHostSdkTargetsTests.cs (45)
33public async Task AddReferenceToDashboardAndDcpIsAddedWhenCliBundleIsDefaulted() 42public async Task AddReferenceToDashboardAndDcpIsSkippedWhenCliBundleIsEnabled() 58public async Task AddReferenceToDashboardAndDcpUsesSdkRidSelectionTask() 74public async Task AddReferenceToDashboardAndDcpFallsBackToRuntimeIdentifierToolForOlderSdks() 99public async Task ComputeRunArgumentsUsesAspireCliWhenCliBundleIsEnabled() 124public async Task ComputeRunArgumentsUsesPinnedDnxAspireCliWhenSelected(string? invocationMode) 163public async Task ComputeRunArgumentsUsesManifestAwareDnxAspireCliWhenSelected(string invocationMode) 193public async Task ComputeRunArgumentsFailsWhenDnxModeIsConfiguredAndDnxIsMissing(string invocationMode) 217public async Task ComputeRunArgumentsSkipsNonExecutableDnxOnUnix() 246public async Task ComputeRunArgumentsNormalizesRelativePathEntries() 266public async Task ComputeRunArgumentsFailsWhenDnxVersionProbeFails() 287public async Task ComputeRunArgumentsUsesConfiguredAspireCliPathWhenCliBundleIsEnabled() 302public async Task ComputeRunArgumentsWrapsConfiguredAspireCommandShimOnWindows(string extension) 321public async Task ComputeRunArgumentsUsesConfiguredAspireCliPathWhenDnxModeIsConfigured(string invocationMode) 346public async Task ComputeRunArgumentsUsesFileBasedAppHostPathWhenCliBundleIsEnabled() 386public async Task ComputeRunArgumentsDoesNotUseAspireCliWhenCliBundleIsDisabled() 401public async Task ComputeRunArgumentsDoesNotUseAspireCliWhenHookIsSuppressed(string suppressionPropertyName, string suppressionValue) 419public async Task DotNetRunUsesAspireCliWhenCliBundleIsEnabled() 456public async Task DotNetRunUsesDnxAspireCliWhenAspireCliIsUnavailable() 497public async Task DotNetRunUsesNativeAspireCliWithoutCmdArgumentReparsingOnWindows() 534public async Task DotNetRunUsesConfiguredAspireCommandShimWhenCliBundleIsEnabled() 576public async Task ComputeRunArgumentsDoesNotUseAspireCliWhenCliVersionIsBelowMinimum(string cliVersion) 592public async Task ComputeRunArgumentsFallsBackToDnxWhenPathAspireCliVersionIsBelowMinimum() 626public async Task ResolveAspireCliBundlePathsUsesDnxBundleWhenDnxModeIsSelected() 671public async Task ResolveAspireCliBundlePathsPreservesUnixShellMetacharactersInAspireCliPath() 698public async Task ResolveAspireCliBundlePathsUsesSelectedAspireCliWhenLaterPathCandidateHasBundleWithWarningsAsErrors() 727public async Task ResolveAspireCliBundlePathsEscapesPercentSignsInNativeAspireCliPathOnWindows() 754public async Task BuildFallsBackToDnxWhenPathAspireCliSetupTimesOut() 778public async Task RunAspireCliCommandKillsCommandShimProcessTreeOnTimeoutInFullFrameworkMsBuild() 851public async Task RunAspireCliCommandReportsWhenProcessDoesNotExitAfterTermination() 881executionTask = Task.Run(task.Execute); 919public async Task BuildUsesEnvironmentAspireHomeWhenMsBuildPropertyDiffers() 944public async Task ComputeRunArgumentsFallsBackToDnxWhenPathAspireCliVersionCannotBeDetermined() 970public async Task ComputeRunArgumentsUsesAspireCliWhenCliVersionIsAtOrAboveMinimum(string cliVersion) 986public async Task ComputeRunArgumentsUsesAspireCliWhenCliVersionWritesLargeStdErr() 1002public async Task ComputeRunArgumentsDoesNotUseAspireCliWhenCliVersionCommandTimesOut() 1018public async Task ComputeRunArgumentsDoesNotUseAspireCliWhenCliVersionOutputIsUnparseable() 1034public async Task ComputeRunArgumentsDoesNotUseAspireCliWhenCliVersionCannotBeDetermined() 1050public async Task ComputeRunArgumentsDoesNotUseAspireCliWhenCliIsUnavailable() 1376private static async Task CreateFakeDnxThatFailsVersionAsync(string fakeCliDirectory) 1429private static async Task CreateFakeAspireCliWithVersionAsync(string fakeCliDirectory, string version) 1457private static async Task CreateFakeAspireCliWithVersionAndLargeStdErrAsync(string fakeCliDirectory, string version) 1491private static async Task CreateFakeAspireCliThatHangsOnVersionAsync(string fakeCliDirectory) 1521private static async Task CreateFakeAspireCliThatHangsOnSetupAsync(string fakeCliDirectory) 1559private static async Task CreateFakeAspireCliThatFailsVersionAsync(string fakeCliDirectory)
tests\Shared\TemporaryWorkspace.cs (1)
27public async Task InitializeGitAsync(CancellationToken cancellationToken = default)
Aspire.Hosting.Seq.Tests (9)
AddSeqTests.cs (5)
70public async Task SeqCreatesConnectionString() 87public async Task VerifyManifest() 229public async Task SeqWithAdminPasswordCreatesConnectionString() 247public async Task VerifyManifestWithAdminPassword() 278public async Task VerifyManifestWithoutAdminPassword()
SeqFunctionalTests.cs (4)
18public async Task VerifySeqResource() 51private static async Task CreateTestDataAsync(HttpClient httpClient, CancellationToken token) 77public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume) 191public Task Seq_WithPersistentLifetime_ReusesContainer()
Aspire.Hosting.SqlServer (2)
SqlServerBuilderExtensions.cs (2)
261private static async Task CreateDatabaseAsync(SqlConnection sqlConnection, SqlServerDatabaseResource sqlDatabase, IServiceProvider serviceProvider, CancellationToken ct) 337async Task ExecuteBatchAsync(string batch, int batchNumber, int executionCount, CancellationToken cancellationToken)
Aspire.Hosting.SqlServer.Tests (15)
AddSqlServerTests.cs (6)
35public async Task AddSqlServerContainerWithDefaultsAddsAnnotationMetadata() 79public async Task SqlServerCreatesConnectionString() 100public async Task SqlServerDatabaseCreatesConnectionString() 123public async Task VerifyManifest() 163public async Task VerifyManifestWithPasswordParameter() 265public async Task VerifySqlServerServerResourceWithPassword()
SqlServerFunctionalTests.cs (9)
25public async Task VerifyWaitForOnSqlServerBlocksDependentResources() 44var pendingStart = app.StartAsync(cts.Token); 63public async Task VerifySqlServerResource() 126public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume) 339public async Task AddDatabaseCreatesDatabaseWithCustomScript() 412public async Task AddDatabaseCreatesDatabaseWithSpecialNames() 462public async Task AddDatabaseCreatesDatabaseResiliently() 546public async Task AddDatabaseCreatesMultipleDatabases() 593public Task SqlServer_WithPersistentLifetime_ReusesContainer()
Aspire.Hosting.Tasks (1)
RunAspireCliCommand.cs (1)
294_ = Task.WaitAll([standardOutputTask, standardErrorTask], ProcessTerminationTimeoutMilliseconds);
Aspire.Hosting.Testing (12)
DistributedApplicationFactory.cs (6)
67/// <returns>A <see cref="Task"/> representing the completion of the operation.</returns> 68public async Task StartAsync(CancellationToken cancellationToken = default) 403private async Task InvokeEntryPoint(Func<string[], CancellationToken, Task<DistributedApplication>> factory) 405await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); 593public async Task StartAsync(CancellationToken cancellationToken = default) 608public async Task StopAsync(CancellationToken cancellationToken = default)
DistributedApplicationTestingBuilder.cs (6)
563public override async Task RunAsync(CancellationToken cancellationToken) 570public override async Task StartAsync(CancellationToken cancellationToken) 577public override async Task StopAsync(CancellationToken cancellationToken) 597public async Task StartAsync(CancellationToken cancellationToken) 602public async Task StopAsync(CancellationToken cancellationToken) 710return Task.FromResult(Build());
Aspire.Hosting.Testing.Tests (107)
DashboardTestingBuilderTests.cs (14)
43public async Task DashboardCanBeEnabledAtBuilderCreation(CreationSurface creationSurface) 57public async Task DashboardTestingDefaultsOverrideCreationConfiguration(CreationSurface creationSurface) 80public async Task DashboardTestingGeneratesAFreshBrowserTokenPerApplication(CreationSurface creationSurface) 99public async Task DashboardTestingDefaultsAreNonInteractiveAndFailFast() 111public async Task DashboardTestingOptionsCannotBeNull() 121public async Task ExistingDefaultCallsRemainUnambiguous() 153public async Task DashboardTestingIsRejectedInPublishMode(CreationSurface creationSurface) 164public async Task DashboardTestingPublishModeFailureStopsAppHostEntryPoint(CreationSurface creationSurface) 176public async Task DashboardEnabledThroughConfigureBuilderKeepsCallerConfiguration() 191public async Task DashboardTestingRestoresTheBrowserTokenAnAppHostCleared( 205public async Task DashboardTestingLeavesTheBrowserTokenToTheCallersBuilder(CreationSurface creationSurface) 220public async Task DashboardTestingRestoresResourceServiceAuthenticationAnAppHostDowngraded( 233public async Task DashboardTestingGeneratesAFreshResourceServiceApiKeyPerApplication(CreationSurface creationSurface) 289private static async Task CreatePublishBuilderAsync(CreationSurface creationSurface, params string[] additionalArgs)
DashboardUrlTests.cs (13)
21public async Task GetDashboardUrlAsyncAuthenticatesDashboardBrowser() 63public async Task GetDashboardUrlAsyncUsesConfiguredLocalhostTld() 83public async Task DashboardDisplaysResourceUpdatesWhileAppHostIsPausedAtBreakpoint() 161public async Task GetDashboardUrlAsyncEncodesCustomBrowserToken() 194public async Task DashboardRejectsWrongCrossApplicationAndBogusLoginTokens() 201await Task.WhenAll(firstApp.StartAsync(), secondApp.StartAsync()).WaitAsync(TestConstants.LongTimeoutTimeSpan); 238public async Task GetDashboardUrlAsyncThrowsWhenDashboardIsDisabled() 252public async Task GetDashboardUrlAsyncReturnsBaseUrlWhenDashboardAllowsAnonymousAccess() 275public async Task GetDashboardUrlAsyncThrowsBeforeApplicationStarts() 287public async Task GetDashboardUrlAsyncThrowsInPublishMode() 300public async Task GetDashboardUrlAsyncPreservesTerminalDashboardFailure() 321public async Task DashboardStartupSummaryDoesNotWriteTheBrowserTokenToAppHostLogs() 341await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationTokenSource.Token);
ResourceLoggerForwarderServiceTests.cs (7)
19public async Task BackgroundServiceIsRegisteredInServiceProvider() 29public async Task ExecuteDoesNotThrowOperationCanceledWhenAppStoppingTokenSignaled() 40var subscriberLoop = Task.Run(async () => 68public async Task ResourceLogsAreForwardedToHostLogging() 79var subscriberLoop = Task.Run(async () =>
TestingBuilderTests.cs (21)
40public async Task CanLoadFromDirectoryOutsideOfAppContextBaseDirectory() 78public async Task ThrowsForAssemblyWithoutAnEntrypoint() 88public async Task CreateAsyncWithOptions(bool genericEntryPoint) 118public async Task CanSetEnvironment() 125public async Task EnvironmentDefaultsToDevelopment() 135public async Task HasEndPoints(bool genericEntryPoint) 159public async Task CanGetResources(bool genericEntryPoint) 177public async Task HttpClientGetTest(bool genericEntryPoint) 203public async Task GetHttpClientBeforeStart(bool genericEntryPoint) 222public async Task ArgsPropagateToAppHostConfiguration(bool genericEntryPoint, bool directArgs) 266public async Task ArgsPropagateToAppHostConfigurationAdHocBuilder(bool directArgs) 308public async Task CanOverrideLaunchProfileViaArgs(string launchProfileName, bool directArgs) 357public async Task CanOverrideLaunchProfileViaArgsAdHocBuilder(string launchProfileName, bool directArgs) 402public async Task SetsCorrectContentRoot(bool genericEntryPoint) 418public async Task SelectsFirstLaunchProfile(bool genericEntryPoint) 455public async Task CrashTests(bool genericEntryPoint, string crashArg) 500public async Task StartAsyncAbandonedAfterCrash() 521public async Task StartAsyncAbandonedAfterHang() 575public async Task DashboardEnabledInTestingBuilderShouldWorkWithDynamicPorts() 600public async Task LoopbackWithDynamicPorts(string endpointUrl, string expectedHost) 626public async Task NonLocalResourceServiceEndpointThrows()
TestingFactoryCrashTests.cs (1)
18public async Task CrashTests(string crashArg)
TestingFactoryTests.cs (3)
30public async Task CanGetConnectionStringFromAddConnectionString() 49public async Task HttpClientGetTest() 72public async Task SelectsFirstLaunchProfile()
TestingPublicApiTests.cs (17)
87public async Task GetConnectionStringThrowsWhenResourceNameIsNullOrEmpty(bool isNull) 147public async Task GetConnectionStringAsyncThrowsWhenDistributedApplicationIsNull() 161public async Task GetConnectionStringAsyncWithResourceNameThrowsWhenResourceNameIsNullOrEmpty(bool isNull) 203public async Task DefaultEndpointSelectionPrefersHttpsOverHttp() 224public async Task CreateAsyncWithEntryPointThrowsWhenEntryPointIsNull() 235public async Task CreateAsyncWithArgsThrowsWhenArgsIsNull() 248public async Task CreateAsyncWithArgsThrowsWhenArgsContainsIsNullOrEmpty(bool isNull) 265public async Task CreateAsyncWithEntryPointAndArgsThrowsWhenEntryPointIsNull() 277public async Task CreateAsyncWithEntryPointAndArgsThrowsWhenArgsIsNull() 291public async Task CreateAsyncWithEntryPointAndArgsThrowsWhenArgsContainsIsNullOrEmpty(bool isNull) 309public async Task CreateAsyncWithArgsAndConfigureBuilderThrowsWhenArgsIsNull() 321public async Task CreateAsyncWithArgsAndConfigureBuilderThrowsWhenConfigureBuilderIsNull() 335public async Task CreateAsyncWithArgsAndConfigureBuilderThrowsWhenArgsContainsIsNullOrEmpty(bool isNull) 353public async Task CreateAsyncWithEntryPointAndArgsAndConfigureBuilderThrowsWhenEntryPointIsNull() 366public async Task CreateAsyncWithEntryPointAndArgsAndConfigureBuilderThrowsWhenArgsIsNull() 379public async Task CreateAsyncWithEntryPointAndArgsAndConfigureBuilderThrowsWhenConfigureBuilderIsNull() 394public async Task CreateAsyncWithEntryPointAndArgsAndConfigureBuilderThrowsWhenArgsContainsIsNullOrEmpty(bool isNull)
tests\Aspire.Hosting.TestUtilities\Utils\LoggerNotificationExtensions.cs (10)
23public static Task WaitForTextAsync(this DistributedApplication app, string logText, string? resourceName = null, CancellationToken cancellationToken = default) 31public static async Task WaitForHealthyAsync<T>(this DistributedApplication app, IResourceBuilder<T> resource, CancellationToken cancellationToken = default) where T : IResource 47public static Task WaitForTextAsync(this DistributedApplication app, IEnumerable<string> logTexts, string? resourceName = null, CancellationToken cancellationToken = default) 62public static Task WaitForTextAsync(this DistributedApplication app, Predicate<string> predicate, CancellationToken cancellationToken = default) 73public static Task WaitForTextAsync(this DistributedApplication app, Predicate<string> predicate, string? resourceName = null, CancellationToken cancellationToken = default) 84_ = Task.Run(() => WatchNotifications(app, resourceName, predicate, tcs, watchCts), watchCts.Token); 97public static async Task WaitForAllTextAsync(this DistributedApplication app, IEnumerable<string> logTexts, string? resourceName = null, CancellationToken cancellationToken = default) 122private static async Task WatchNotifications(DistributedApplication app, string? resourceName, Predicate<string> predicate, TaskCompletionSource tcs, CancellationTokenSource cancellationTokenSource) 128var logWatchTasks = new List<Task>(); 160private static async Task WatchResourceLogs(TaskCompletionSource tcs, string resourceId, Predicate<string> predicate, ResourceLoggerService resourceLoggerService, CancellationTokenSource cancellationTokenSource)
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (3)
15_ = Task.Run(async () => 41return Task.Run(async () => 58return Task.Run(async () =>
tests\Shared\DistributedApplicationTestingBuilderExtensions.cs (3)
114public Task StartAsync(CancellationToken cancellationToken) => Task.CompletedTask; 116public async Task StopAsync(CancellationToken cancellationToken)
Aspire.Hosting.Tests (2311)
AddConnectionStringTests.cs (1)
15public async Task AddConnectionStringExpressionIsAValueInTheManifest()
AddParameterTests.cs (11)
73public async Task ParametersWithDefaultValueStringOverloadUsedRegardlessOfConfigurationValue(bool useCallback, bool hasConfig) 125public async Task ParametersWithDefaultValueGetPublishedIfPublishFlagIsPassed(bool useCallback, bool hasConfig) 211public async Task ParametersWithDefaultValueObjectOverloadUseConfigurationValueWhenPresent(bool hasConfig) 283public async Task ParametersCanGetValueFromNonDefaultConfigurationKeys() 321public async Task AddConnectionStringParameterIsASecretParameterInTheManifest() 462LoadCallback = _ => Task.CompletedTask 559LoadCallback = _ => Task.CompletedTask 715public async Task ParameterWithDashInName_CanBeResolvedWithUnderscoreInConfiguration() 738public async Task ParameterWithDashInName_PrefersDashConfigurationOverUnderscore() 762public async Task ParameterWithoutDash_DoesNotFallbackToUnderscore() 788public async Task ParameterWithCustomConfigurationKey_UsesFallback()
AppHostSmokeTests.cs (13)
37static async Task RunTest(string loc, string expectedLocaleError, string expectedCulture, string envVar) 101public Task StartAsync(CancellationToken cancellationToken) 103return Task.CompletedTask; 106public Task StartedAsync(CancellationToken cancellationToken) 108return Task.CompletedTask; 111public Task StartingAsync(CancellationToken cancellationToken) 114return Task.CompletedTask; 117public Task StopAsync(CancellationToken cancellationToken) 119return Task.CompletedTask; 122public Task StoppedAsync(CancellationToken cancellationToken) 124return Task.CompletedTask; 127public Task StoppingAsync(CancellationToken cancellationToken) 129return Task.CompletedTask;
ApplicationModel\Docker\DockerfileBuildAnnotationTests.cs (11)
70public async Task MaterializeDockerfileAsync_NoFactory_DoesNothing() 100public async Task MaterializeDockerfileAsync_WithFactory_WritesDockerfile() 107DockerfileFactory = _ => Task.FromResult(expectedContent) 136public async Task MaterializeDockerfileAsync_CalledTwice_WritesOnlyOnce() 146return Task.FromResult("FROM alpine:latest"); 176public async Task MaterializeDockerfileAsync_ConcurrentCalls_InvokesFactoryOnlyOnce() 186await Task.Delay(10); // Simulate async work 203await Task.WhenAll(tasks); 219public async Task EmitDockerfileArtifactsAsync_SkipsCopyWhenOutputPathCasingDiffersOnCaseInsensitiveFileSystem() 239public async Task EmitDockerfileArtifactsAsync_RemovesAspireOwnedPerDockerfileIgnoreWhenContextRootIgnoreExists() 269public async Task EmitDockerfileArtifactsAsync_PreservesUserPerDockerfileIgnoreWhenContextRootIgnoreExists()
ApplicationModel\Docker\DockerfileBuilderCallbackAnnotationTests.cs (24)
18Func<DockerfileBuilderCallbackContext, Task> callback = context => Task.CompletedTask; 40public async Task DockerfileBuilderCallbackAnnotation_CallbackCanBeInvoked() 46Func<DockerfileBuilderCallbackContext, Task> callback = context => 50return Task.CompletedTask; 68public async Task DockerfileBuilderCallbackAnnotation_CallbackWithAsyncOperation() 74Func<DockerfileBuilderCallbackContext, Task> callback = async context => 76await Task.Delay(delay); 93public async Task DockerfileBuilderCallbackAnnotation_CallbackCanModifyDockerfileBuilder() 98Func<DockerfileBuilderCallbackContext, Task> callback = context => 104return Task.CompletedTask; 122public async Task DockerfileBuilderCallbackAnnotation_CallbackCanAccessServices() 128Func<DockerfileBuilderCallbackContext, Task> callback = context => 132return Task.CompletedTask; 154Func<DockerfileBuilderCallbackContext, Task> callback1 = context => Task.CompletedTask; 155Func<DockerfileBuilderCallbackContext, Task> callback2 = context => Task.CompletedTask; 166public async Task DockerfileBuilderCallbackAnnotation_MultipleCallbacks_AllInvoked() 176return Task.CompletedTask; 181return Task.CompletedTask; 200public async Task DockerfileBuilderCallbackAnnotation_MultipleCallbacks_BuildInSequence() 209return Task.CompletedTask; 216return Task.CompletedTask;
ApplicationModel\Docker\DockerfileBuilderEdgeCasesTests.cs (7)
16public async Task EmptyDockerfile_WritesNothing() 32public async Task SingleStageWithOnlyFrom_WritesOnlyFromStatement() 63public async Task EnvStatement_WithEmptyStringValue_WritesCorrectly() 88public async Task CmdStatement_WithComplexCommand_SerializesCorrectly() 113public async Task StageOrdering_PreservesSequence() 166public async Task RunStatement_WithMultiLineCommand_PreservesFormatting() 211public async Task WriteAsync_WithLargeDockerfile_HandlesCorrectly()
ApplicationModel\Docker\DockerfileBuilderIntegrationTests.cs (2)
15public async Task ExampleFromProblemStatement_ProducesCorrectDockerfile() 84public async Task MultipleStagesWithComplexCommands_ProducesCorrectOutput()
ApplicationModel\Docker\DockerfileBuilderTests.cs (4)
113public async Task WriteAsync_WithSingleStage_WritesCorrectContent() 144public async Task WriteAsync_WithMultipleStages_WritesCorrectContent() 190public async Task WriteAsync_WithNullStream_ThrowsArgumentNullException() 201public async Task WriteAsync_WithEmptyBuilder_WritesNothing()
ApplicationModel\Docker\DockerfileStageTests.cs (7)
310public async Task Comment_WithSingleLineComment_WritesCorrectly() 339public async Task Comment_WithMultiLineComment_SplitsCorrectly() 375public async Task Comment_WithEmptyLinesInMultiLineComment_PreservesEmptyLines() 411public async Task Comment_WithEmptyString_WritesCommentPrefix() 451public async Task Comment_MultipleComments_WritesSequentially() 504public async Task Comment_WithComplexMultiLineComment_FormatsCorrectly() 544public async Task Comment_AsDockerfileHeader_WorksCorrectly()
ApplicationModel\Docker\DockerfileStatementsTests.cs (16)
15public async Task FromStatement_WithoutStage_WritesCorrectFormat() 34public async Task FromStatement_WithStage_WritesCorrectFormat() 53public async Task WorkDirStatement_WritesCorrectFormat() 72public async Task RunStatement_WritesCorrectFormat() 91public async Task RunStatement_WithComplexCommand_WritesCorrectFormat() 111public async Task CopyStatement_WritesCorrectFormat() 130public async Task CopyFromStatement_WritesCorrectFormat() 149public async Task EnvStatement_WritesCorrectFormat() 168public async Task EnvStatement_WithEmptyValue_WritesCorrectFormat() 187public async Task ExposeStatement_WritesCorrectFormat() 206public async Task CmdStatement_WritesCorrectFormat() 225public async Task CmdStatement_WithSingleCommand_WritesCorrectFormat() 244public async Task CmdStatement_WithComplexCommand_WritesCorrectFormat() 263public async Task UserStatement_WritesCorrectFormat() 282public async Task UserStatement_WithUID_WritesCorrectFormat() 301public async Task UserStatement_WithUIDAndGID_WritesCorrectFormat()
ApplicationModel\Docker\WithDockerfileBuilderTests.cs (11)
76public async Task WithDockerfileBuilder_GeneratesDockerfileFromCallback() 114public async Task WithDockerfileBuilder_MultipleCallbacks_BuildsComposedDockerfile() 166public async Task WithDockerfileBuilder_AsyncCallback_Works() 174await Task.Delay(10); // Simulate async work 198public async Task WithDockerfileBuilder_ContextProvidesServices() 231public async Task WithDockerfileBuilder_MultiStageDockerfile() 282await Task.Delay(10); 317public async Task AddDockerfileBuilder_WithAsyncCallback_GeneratesDockerfile() 324await Task.Delay(10); 357public async Task AddDockerfileBuilder_WithSyncCallback_GeneratesDockerfile() 411public async Task AddDockerfileBuilder_WithMultiStage_GeneratesCorrectDockerfile()
ApplicationModel\EndpointHostHelpersTests.cs (3)
214public async Task GetUrlWithTargetHostAsync_UsesTargetHostOnlyForLocalhostTld(string targetHost, string expectedUrl) 238public async Task GetUrlWithTargetHostAsync_KeepsAddressResolvedForANonLocalNetworkContext() 268public async Task GetUrlWithTargetHostAsync_ThrowsForNullEndpoint()
ApplicationModel\McpServerEndpointAnnotationTests.cs (13)
18public async Task Constructor_WithCustomResolver_UsesProvidedResolver() 21var annotation = new McpServerEndpointAnnotation((resource, ct) => Task.FromResult<Uri?>(expectedUri)); 30public async Task Constructor_WithCustomResolver_CanReturnNull() 32var annotation = new McpServerEndpointAnnotation((resource, ct) => Task.FromResult<Uri?>(null)); 59public async Task FromEndpoint_ReturnsNull_WhenEndpointDoesNotExist() 70public async Task FromEndpoint_ReturnsUrlWithDefaultPath_WhenEndpointExists() 85public async Task FromEndpoint_ReturnsUrlWithCustomPath_WhenPathSpecified() 100public async Task FromEndpoint_ReturnsBaseUrl_WhenPathIsNull() 116public async Task FromEndpoint_ReturnsBaseUrl_WhenPathIsEmpty() 132public async Task FromEndpoint_NormalizesPathWithoutLeadingSlash() 147public async Task FromEndpoint_HandlesTrailingSlashInBaseUrl() 162public async Task FromEndpoint_WaitsForEndpointAllocation() 179public async Task FromEndpoint_WorksWithHttpsEndpoint()
ApplicationModel\ResourceAnnotationCollectionTests.cs (8)
173public async Task ConcurrentEnumeration_WhileAddingAndRemoving_DoesNotThrow() 189var modifierTask = Task.Run(async () => 205await Task.Yield(); 218var enumeratorTasks = Enumerable.Range(0, 4).Select(i => Task.Run(async () => 237await Task.Yield(); 250await Task.Delay(500); 254await Task.WhenAll(enumeratorTasks);
AtsEventingExportsTests.cs (2)
42var completedTask = Expression.Property(null, typeof(Task).GetProperty(nameof(Task.CompletedTask))!);
AtsHealthCheckExportsTests.cs (2)
15public async Task AddHealthCheck_RegistersCallback() 19builder.AddHealthCheck("custom_check", () => Task.FromResult(new AtsHealthCheckResult
AtsInteractionExportsTests.cs (4)
15public async Task PromptProgress_TitleInOptions_MappedToProgressInteractionOptions() 26Work = _ => Task.CompletedTask 45public async Task PromptProgress_NoTitleInOptions_LeavesTitleUnset() 53Work = _ => Task.CompletedTask
Backchannel\AppHostBackchannelTests.cs (5)
18public async Task CanConnectToBackchannel() 26return Task.CompletedTask; 32return Task.CompletedTask; 54public async Task CanStreamResourceStates() 70return Task.CompletedTask;
Backchannel\AppHostRpcTargetCancellationTests.cs (22)
22public async Task GetAppHostLogEntriesAsync_WhenOuterTokenAlreadyCancelled_StreamCompletesWithoutException() 42public async Task GetAppHostLogEntriesAsync_WhenOuterTokenCancelledDuringIteration_StreamCompletesWithoutException() 53var iterationTask = Task.Run(async () => 69public async Task GetAppHostLogEntriesAsync_WhenShutdownCtsCancelled_StreamCompletesWithoutException() 77var iterationTask = Task.Run(async () => 97public async Task GetPublishingActivitiesAsync_WhenOuterTokenAlreadyCancelled_StreamCompletesWithoutException() 116public async Task GetPublishingActivitiesAsync_WhenOuterTokenCancelledDuringIteration_StreamCompletesWithoutException() 126var iterationTask = Task.Run(async () => 141public async Task GetPublishingActivitiesAsync_WhenShutdownCtsCancelled_StreamCompletesWithoutException() 149var iterationTask = Task.Run(async () => 168public async Task GetResourceStatesAsync_WhenOuterTokenAlreadyCancelled_StreamCompletesWithoutException() 187public async Task GetResourceStatesAsync_WhenOuterTokenCancelledDuringIteration_StreamCompletesWithoutException() 197var iterationTask = Task.Run(async () => 212public async Task GetResourceStatesAsync_WhenShutdownCtsCancelled_StreamCompletesWithoutException() 220var iterationTask = Task.Run(async () => 239public async Task BackchannelService_WhenStoppingTokenFiredWhileWaitingForConnection_AppStopsCleanly()
Backchannel\AppHostRpcTargetUploadTests.cs (6)
14public async Task UploadFileAsync_ValidRequest_StoresAndCompletesUpload() 49public async Task UploadFileAsync_MaliciousFileName_UsesRandomDiskName(string fileName, string expectedFileName) 75public async Task UploadFileAsync_ExceedsInputFileCountLimit_Throws() 101public async Task UploadFileAsync_InvalidOwnership_Throws(int interactionId, string inputName, string expectedMessage) 119public async Task UploadFileAsync_ExceedsConfiguredLimit_Throws() 138public async Task UploadFileAsync_WriteCanceled_RemovesEntry()
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (70)
23public async Task GetAppHostInfoAsync_ReturnsAssemblyDisplayVersion() 87public async Task WaitForAppHostReadyAsync_CompletesWhenStartupStateIsReady() 117public async Task GetResourceSnapshotsAsync_EnumeratesResources() 168public async Task GetResourceSnapshotsAsync_MapsSnapshotData() 232LoadCallback = _ => Task.CompletedTask 334public async Task GetResourceSnapshotsAsync_RedactsSecretParameterValuesInEnvironmentVariables() 379public async Task GetResourceSnapshotsAsync_RedactsSecretParameterReferencedByOwningResourceEnvironment() 431public async Task GetResourceSnapshotsAsync_RedactsDistinctSecretParametersWithSameName() 478public async Task GetResourceSnapshotsAsync_RedactsNewlyReferencedSecret_AfterRestartRepointsResource() 563public async Task GetResourceSnapshotsAsync_RetainsPreviouslyReferencedSecret_AfterRestartRepointsResource() 637public async Task GetResourceSnapshotsAsync_RetainsPreviousSecretValue_AfterParameterValueIsReplaced() 708public async Task GetResourceSnapshotsAsync_RetainsPreviousSecretValue_AcrossSeparateConnections() 784public async Task GetResourceSnapshotsAsync_RedactsSecretResolvedDuringAnotherResourceMcpDiscoveryWindow() 802return Task.FromResult<Uri?>(null); 851public async Task GetResourceSnapshotsAsync_RedactsSecretReplacedBeforeFirstConnection() 905public async Task GetResourceSnapshotsAsync_DoesNotInvokeUncachedResourceCallback_AndLeavesItEvaluable() 950public async Task GetResourceSnapshotsAsync_DoesNotInvokeOrPoisonCallbackCache_WhenDescribeIsCanceled() 1010public async Task GetResourceSnapshotsAsync_DoesNotBlockOnUnresolvedSecretParameter() 1063public async Task WatchResourceSnapshotsAsync_RedactsSecretResolvedAfterWatchStarted() 1138public async Task GetResourceSnapshotsAsync_RedactsNonSecretEnvVarThatCoincidentallyMatchesSecretValue() 1199private static async Task PrimeEnvironmentCallbackCacheAsync(IResource resource, IServiceProvider services) 1211public async Task WaitForResourceAsync_ReturnsFailureWhenResourceHasErrorStateStyle() 1247public async Task GetResourceSnapshotsAsync_MapsNonStringPropertiesAsStringsForLegacyCallers() 1286public async Task GetResourcesAsync_MapsNonStringPropertiesAsJsonForV3Callers() 1340public async Task GetResourceSnapshotsAsync_StampsTerminalPropertiesForTerminalEnabledResource() 1381public async Task GetResourceSnapshotsAsync_DoesNotStampTerminalPropertiesForNonTerminalResource() 1411public async Task WaitForResourceAsync_AcceptsResourceId() 1450public async Task WaitForResourceAsync_ResolvesLogicalResourceNameViaAppModel() 1489public async Task WaitForResourceAsync_CancelledSingleInstanceResolvedName_UsesLogicalDisplayName() 1523public async Task WaitForResourceAsync_CancelledReplicaResolvedName_UsesReplicaDisplayName() 1558public async Task WaitForResourceAsync_ReturnsAmbiguousErrorForReplicatedLogicalName() 1636public async Task GetResourceLogsAsync_ReturnsLogs_ForSingleResource() 1676public async Task GetResourceLogsAsync_ReturnsEmpty_WhenResourceNotFound() 1702public async Task GetResourceLogsAsync_ReturnsLogsFromAllResources_WhenNoResourceNameSpecified() 1749public async Task GetConsoleLogsAsync_AppliesSearchAndTailForSingleResource() 1795public async Task GetConsoleLogsAsync_AppliesSearchAfterStrippingAnsiControlSequences() 1837public async Task GetConsoleLogBatchesAsync_AppliesSearchAndTailForSingleResource() 1883public async Task GetConsoleLogsAsync_DoesNotApplyTailAcrossMultipleResources() 1929public async Task GetConsoleLogsAsync_ExcludesHiddenResourcesWhenRequested() 1981public async Task GetResourceLogsAsync_ReturnsLogsFromReplicas() 2041public async Task GetResourceLogsAsync_ReturnsLogsForSingleReplica_WhenResolvedInstanceNameIsPassed() 2094public async Task GetResourceLogsAsync_FollowMode_StreamsLogs() 2115var collectTask = Task.Run(async () => 2146public async Task GetDashboardUrlsAsync_ReturnsBaseUrl_WhenDashboardAllowsAnonymousAccess() 2171ResourceReadyEvent = new EventSnapshot(Task.CompletedTask) 2246public async Task ExecuteResourceCommandAsync_MapsJsonArgumentsToInteractionInputs() 2258return Task.FromResult(CommandResults.Success()); 2311public async Task ExecuteResourceCommandAsync_UnknownJsonArgument_ReturnsFailure() 2323return Task.FromResult(CommandResults.Success()); 2362public async Task ExecuteResourceCommandAsync_MapsJsonArrayArgumentsToInteractionInputsByOrder() 2374return Task.FromResult(CommandResults.Success()); 2424public async Task ExecuteResourceCommandAsync_ReturnsLoadedArgumentInputsWhenRequested() 2432executeCommand: _ => Task.FromResult(CommandResults.Success()), 2460return Task.CompletedTask; 2493public async Task ExecuteResourceCommandAsync_AllowsArgumentsEnabledByDynamicLoading() 2505return Task.FromResult(CommandResults.Success()); 2537return Task.CompletedTask; 2568public async Task ExecuteResourceCommandAsync_TooManyJsonArrayArguments_ReturnsFailure() 2580return Task.FromResult(CommandResults.Success()); 2616public async Task ExecuteResourceCommandAsync_ValidateOnlyWithInvalidArguments_ReturnsValidationErrors() 2628return Task.FromResult(CommandResults.Success()); 2645return Task.CompletedTask; 2677public async Task ExecuteResourceCommandAsync_ValidateOnlyWithMissingResource_ReturnsNotFound() 2702public async Task ExecuteResourceCommandAsync_ValidateOnlyWithMissingCommand_ReturnsNotFound() 2729public async Task GetDashboardUrlsAsync_ReturnsUnhealthy_WhenDashboardResourceIsAbsent() 2753public async Task WaitForResourceAsync_ReturnsNotFound_WhenResourceDoesNotExist() 2781public async Task WaitForResourceAsync_ReturnsNotFound_ForBadInstanceName() 2814public async Task GetAppHostInformationAsync_ReturnsCliLogFilePath_WhenConfigured() 2854public async Task GetAppHostInfoAsync_IncludesCliLogFilePath()
Backchannel\AuxiliaryBackchannelTests.cs (19)
23public async Task CanStartAuxiliaryBackchannelService() 31return Task.CompletedTask; 59public async Task CanConnectMultipleClientsToAuxiliaryBackchannel() 71return Task.CompletedTask; 95await Task.Delay(1000); 110public async Task CanInvokeRpcMethodOnAuxiliaryBackchannel() 145public async Task GetAppHostInformationAsyncReturnsAppHostPath() 185public async Task MultipleClientsCanInvokeRpcMethodsConcurrently() 221var results = await Task.WhenAll(tasks).DefaultTimeout(); 229public async Task GetAppHostInformationAsyncReturnsFilePathWithExtension() 275public async Task SocketPathUsesCompactFormat() 307public async Task CallResourceMcpToolAsyncThrowsWhenResourceNotFound() 348public async Task CallResourceMcpToolAsyncThrowsWhenResourceHasNoMcpAnnotation() 388public async Task StopAppHostAsyncInitiatesShutdown() 425await Task.Delay(Timeout.Infinite, lifetime.ApplicationStopping).WaitAsync(cts.Token); 437public async Task GetCapabilitiesAsyncReturnsCurrentCapabilities() 478public async Task GetAppHostInfoAsyncV2ReturnsAppHostInfo() 518public async Task GetResourcesAsyncV2ReturnsResources() 561public async Task AbruptClientDisconnectDoesNotLogError()
Backchannel\BackchannelLoggerProviderTests.cs (1)
77public async Task ConcurrentSubscribers_ReceiveSameEntries()
Backchannel\GetTerminalInfoAsyncTests.cs (14)
23public async Task ReturnsUnavailable_WhenResourceDoesNotExist() 37public async Task ReturnsUnavailable_WhenResourceHasNoTerminalAnnotation() 54public async Task ReturnsAvailableWithDegradedReplicas_WhenAllControlSocketsAreUnreachable() 82public async Task ReturnsPerReplicaInfo_WhenAllHostsReachable() 166public async Task DegradedReplicaReportedWhenSomeHostsUnreachable() 198public async Task ListTerminalsAsync_AllUnreachable_KeepsDegradedReplicaShape() 227public async Task ListTerminalsAsync_MixedReachability_ReturnsAllReplicas() 260public async Task GetCapabilities_AdvertisesTerminalsV1() 380private Task? _acceptLoop; 385public Task StartAsync() 399_acceptLoop = Task.Run(() => AcceptLoopAsync(_cts.Token)); 400return Task.CompletedTask; 403private async Task AcceptLoopAsync(CancellationToken ct) 417_ = Task.Run(async () =>
BuildOnlyContainerValidationTests.cs (6)
18public async Task PublishPrereq_WithUnconsumedBuildOnlyContainer_Throws() 39public async Task DeployPrereq_WithUnconsumedBuildOnlyContainer_Throws() 58public async Task PublishPrereq_WithConsumedBuildOnlyContainer_DoesNotThrow() 72public async Task PublishPrereq_WithValidationDisabled_DoesNotThrow() 81return Task.CompletedTask; 102private static Task ExecutePipelineAsync(DistributedApplication app)
Cli\CliOrphanDetectorTests.cs (11)
19public async Task CliOrphanDetectorCompletesWhenNoPidEnvironmentVariablePresent() 34public async Task CliOrphanDetectorCallsStopIfEnvironmentVariablePresentAndProcessNotRunning() 55public async Task CliOrphanDetectorUsesTimestampDetectionWhenStartTimeProvided() 79public async Task CliOrphanDetectorPrefersStableTimestampDetectionWhenProvided() 110public async Task CliOrphanDetectorFallsBackToPidOnlyWhenStartTimeInvalid() 132public async Task CliOrphanDetectorContinuesRunningWhenProcessAliveWithCorrectStartTime() 178public async Task CliOrphanDetectorStopsWhenProcessHasDifferentStartTime() 208public async Task CliOrphanDetectorAfterTheProcessWasRunningForAWhileThenStops() 257public async Task AppHostExitsWhenCliProcessPidDies() 271return Task.CompletedTask; 275var pendingRun = app.RunAsync();
Codespaces\CodespacesUrlRewriterTests.cs (2)
14public async Task VerifyUrlsRewriterStopsWhenNotInCodespaces() 55public async Task VerifyUrlsRewrittenWhenInCodespaces()
ComputeEnvironmentEndpointResolverTests.cs (2)
13public async Task OwningResourceInDifferentEnvironment_DelegatesToOwningEnvironment() 33public async Task EndpointReferenceOverload_DelegatesToOwningEnvironment()
ComputeEnvironmentValidationTests.cs (4)
14public async Task MultipleComputeEnvironments_WithUnboundComputeResource_Throws() 34public async Task MultipleComputeEnvironments_WithAllResourcesBound_DoesNotThrow() 49public async Task SingleComputeEnvironment_AutoBindsUnboundResources() 72public async Task GetEndpointPropertyExpression_ReturnsDefaultEndpointPropertyExpression(EndpointProperty property, string expected)
ConditionalReferenceExpressionTests.cs (6)
11public async Task GetValueAsync_ReturnsTrueValue_WhenConditionIsTrue() 24public async Task GetValueAsync_ReturnsFalseValue_WhenConditionIsFalse() 50public async Task ConditionalReferenceExpression_WorksInReferenceExpressionBuilder() 123public async Task TlsEnabled_ReturnsFalseString_WhenTlsNotEnabled() 137public async Task TlsEnabled_ReturnsTrueString_WhenTlsEnabled() 167public async Task TlsEnabled_ResolvesLazilyFromCurrentState()
ContainerImagePushOptionsTests.cs (11)
12public async Task GetFullRemoteImageNameAsync_SimpleImageName_UsesRegistryEndpoint() 31public async Task GetFullRemoteImageNameAsync_SimpleImageName_WithRepository_UsesRegistryEndpointAndRepository() 50public async Task GetFullRemoteImageNameAsync_ImageNameWithRepository_OverridesRegistryRepository() 70public async Task GetFullRemoteImageNameAsync_FullPathWithHost_OverridesRegistryEndpoint() 90public async Task GetFullRemoteImageNameAsync_LocalhostWithPort_OverridesRegistryEndpoint() 109public async Task GetFullRemoteImageNameAsync_Localhost_OverridesRegistryEndpoint() 128public async Task GetFullRemoteImageNameAsync_DefaultsToLatestTag() 147public async Task GetFullRemoteImageNameAsync_EmptyTagDefaultsToLatest() 166public async Task GetFullRemoteImageNameAsync_ThrowsWhenRemoteImageNameIsNull() 182public async Task GetFullRemoteImageNameAsync_ThrowsWhenRemoteImageNameIsEmpty() 198public async Task GetFullRemoteImageNameAsync_ThrowsWhenRegistryIsNull()
ContainerRegistryResourceTests.cs (21)
194public async Task ContainerRegistryEndpointExpressionResolves() 208public async Task ContainerRegistryRepositoryExpressionResolves() 223public async Task ContainerRegistryNameExpressionResolves() 237public async Task ContainerRegistryWithParameterEndpointResolves() 253public async Task ContainerRegistryWithParameterRepositoryResolves() 367public async Task ProjectResourcePushStepHasPushContainerImageTag() 391public async Task ContainerWithDockerfilePushStepHasPushContainerImageTag() 415public async Task ContainerWithoutDockerfileHasNoPushStep() 439public async Task ProjectResourcePushStepDependsOnBuildStep() 508public async Task RegistryTargetAnnotationIsAddedToResourcesOnBeforeStartEvent() 531public async Task MultipleRegistriesAddMultipleRegistryTargetAnnotations() 556public async Task GetContainerRegistryReturnsRegistryFromRegistryTargetAnnotation() 576public async Task GetContainerRegistryPrefersContainerRegistryReferenceAnnotationOverRegistryTargetAnnotation() 599public async Task GetContainerRegistryThrowsWhenMultipleRegistryTargetAnnotationsAndNoExplicitSelection() 635public async Task RegistryTargetAnnotationIsAddedToAllResourcesInModel() 658public async Task WithContainerRegistryOverridesDefaultRegistryTargetAnnotation() 688public async Task AzureContainerRegistry_RegistryTargetAnnotationIsAddedToResourcesOnBeforeStartEvent() 711public async Task AzureContainerRegistry_RegistryTargetAnnotationIsAddedToAllResourcesInModel() 732public async Task AzureContainerRegistry_GetContainerRegistryReturnsRegistryFromRegistryTargetAnnotation() 752public async Task AzureContainerRegistry_GetContainerRegistryPrefersContainerRegistryReferenceAnnotation() 773public async Task AzureContainerRegistryAndContainerRegistry_MultipleRegistriesAddMultipleRegistryTargetAnnotations()
ContainerTunnelTests.cs (4)
17public async Task ContainerTunnelWorksWithYarp() 48public async Task ProxylessEndpointWorksWithContainerTunnel() 87public async Task WaitingContainersCanUseTunnel() 123public async Task HostResourceCanWaitForTunnelDependentContainers()
Dashboard\DashboardEventHandlersTests.cs (12)
31public async Task WatchDashboardLogs_WrittenToHostLoggerFactory(DateTime? timestamp, string logMessage, string expectedMessage, string expectedCategory, LogLevel expectedLevel) 79public async Task WatchDashboardLogs_AspireDashboardWarningsShown_ThirdPartyWarningsSuppressed( 182public async Task BeforeStartAsync_ExcludeLifecycleCommands_CommandsNotAddedToDashboard() 206public async Task BeforeStartAsync_DashboardContainsDebugSessionInfo(string? debugSessionPort, int? expectedDebugSessionPort, string? debugSessionToken, string? debugSessionCert, string? dcpInstanceIdPrefix, string? expectedDcpInstanceId, bool? telemetryEnabled) 276public async Task ConfigureEnvironmentVariables_HasAspireDashboardEnvVars_CopiedToDashboard() 315public async Task ResourceReadyEvent_LogsDashboardUrlFromAllocatedEndpoint(string configuredUrl, string expectedHost, int allocatedPort, string expectedScheme, string expectedOtlpHost) 400public async Task ResourceReadyEvent_LogsConfiguredOtlpUrlsWhenConfigured() 460public async Task AddDashboardResource_CreatesExecutableResourceWithCustomRuntimeConfig() 550public async Task AddDashboardResource_WithExecutablePath_CreatesCorrectArguments() 619public async Task AddDashboardResource_WithUnixExecutablePath_CreatesCorrectArguments() 688public async Task AddDashboardResource_WithDirectDllPath_CreatesCorrectArguments() 905return Task.FromResult("http://localhost:1010");
Dashboard\DashboardResourceTests.cs (23)
26public async Task DashboardIsAutomaticallyAddedAsHiddenResource(string showDashboardResourcesKey) 66public async Task DashboardIsAddedFirst() 89public async Task DashboardDoesNotAddResource_ConfiguresExistingDashboard(string dashboardOtlpGrpcEndpointUrlKey) 185public async Task DashboardWithBlankOtlpEndpoint_AutoConfiguresDynamicOtlpPorts(string dashboardOtlpGrpcEndpointUrlKey) 220public async Task DashboardWithBlankOtlpEndpointAndUnsecuredTransport_UsesHttpScheme() 256public async Task DashboardWithDashboardUrls_OtlpEndpointsInheritTargetHost(string dashboardUrls, bool? allowUnsecuredTransport, string expectedTargetHost) 292public async Task DashboardWithNoApplicationUrl_UsesDynamicFrontendEndpointWithExpectedScheme(bool allowUnsecuredTransport, string expectedEndpointName) 318public async Task DashboardWithDllPathLaunchesDotnet() 353public async Task DashboardAuthConfigured_EnvVarsPresent(string dashboardOtlpGrpcEndpointUrlKey) 394public async Task DashboardAuthRemoved_EnvVarsUnsecured(string dashboardOtlpGrpcEndpointUrlKey) 431public async Task DashboardResourceServiceUriIsSet(string dashboardOtlpGrpcEndpointUrlKey) 466public async Task DashboardResource_OtlpHttpEndpoint_CorsEnvVarSet(string? explicitCorsAllowedOrigins, string otlpHttpEndpointUrlKey, string corsAllowedOriginsKey) 514public async Task DashboardResource_DynamicOtlpHttpEndpoint_CorsEnvVarSet(string? explicitCorsAllowedOrigins, string corsAllowedOriginsKey) 561public async Task DashboardResource_OtlpGrpcEndpoint_CorsEnvVarNotSet(string? explicitCorsAllowedOrigins, string otlpGrpcEndpointUrlKey, string corsAllowedOriginsKey) 598public async Task DashboardResource_HttpsEndpoint_ConfiguresKestrelCertificateCallback() 625public async Task DashboardIsNotAddedInPublishMode() 645public async Task DashboardIsNotAddedIfDisabled() 683public async Task DashboardLifecycleEventsWatchesLogs(LogLevel logLevel) 707var watchForLogSubs = Task.Run(async () => 764public async Task DashboardIsExcludedFromManifestInPublishModeEvenIfAddedExplicitly() 791public async Task DashboardResource_UrlsIncludeTokenQuerystringWhenConfigured(string? browserToken, string expectedHttpUrl, string expectedHttpsUrl) 927return Task.FromResult("http://localhost:5000");
Dashboard\DashboardServiceDataTerminalTests.cs (5)
30public async Task Snapshot_WithoutTerminalAnnotation_HasNoTerminalProperties() 43public async Task Snapshot_WithTerminal_SingleReplica_StampsAllFourPropertiesAndMarksUdsPathSensitive() 73public async Task Snapshot_WithTerminal_MultiReplica_PicksMatchingInstanceIndex() 99public async Task Snapshot_WithTerminal_NoDcpInstancesAnnotation_FallsBackToIndexZero() 121public async Task Snapshot_WithTerminal_ResourceIdNotInInstances_FallsBackToIndexZero()
Dashboard\DashboardServiceTests.cs (48)
35public async Task WatchResourceConsoleLogs_NoFollow_ResultsEnd() 63var task = dashboardService.WatchResourceConsoleLogs( 94public async Task WatchResourceConsoleLogs_LargePendingData_BatchResults() 116var task = dashboardService.WatchResourceConsoleLogs( 140public async Task WatchResources_ResourceHasCommands_CommandsSentWithResponse() 162executeCommand: c => Task.FromResult(CommandResults.Success()), 189executeCommand: c => Task.FromResult(CommandResults.Success()), 198executeCommand: c => Task.FromResult(CommandResults.Success()), 222var task = dashboardService.WatchResources( 229var completedTask = await Task.WhenAny(task, readUpdateTask).DefaultTimeout(); 273public async Task ExecuteResourceCommand_WithArguments_PassesArgumentsToCommand() 290return Task.FromResult(CommandResults.Success()); 336public async Task ExecuteResourceCommand_WithUnknownArgument_ReturnsFailure() 353return Task.FromResult(CommandResults.Success()); 393public async Task ExecuteResourceCommand_WithInvalidArguments_ReturnsValidationErrors() 410return Task.FromResult(CommandResults.Success()); 428return Task.CompletedTask; 459public async Task WatchInteractions_PromptMessageBoxAsync_CompleteOnResponse(bool? result) 485var task = dashboardService.WatchInteractions( 530public async Task WatchInteractions_NoExplicitLabel_LabelIsName() 556var task = dashboardService.WatchInteractions( 578public async Task WatchInteractions_PromptInputAsync_CompleteOnCancelResponse() 604var task = dashboardService.WatchInteractions( 638public async Task WatchInteractions_ReaderError_CompleteWithError() 664var task = dashboardService.WatchInteractions( 676public async Task WatchInteractions_WriterError_CompleteWithError() 702var task = dashboardService.WatchInteractions( 726executeCommand: c => Task.FromResult(CommandResults.Success())); 733public async Task GetApplicationInformation_ReadsFromConfiguration() 762public async Task GetApplicationInformation_FallsBackToEnvironmentApplicationName() 786public async Task GetApplicationInformation_StripsAppHostSuffix() 832public async Task UploadFile_WithinSizeLimit_Succeeds() 867public async Task UploadFile_MaliciousFileName_UsesRandomDiskName(string fileName, string expectedFileName) 889public async Task UploadFile_ExceedsInputFileCountLimit_ThrowsFailedPrecondition() 914public async Task UploadFile_ExceedsConfiguredSizeLimit_ThrowsResourceExhausted() 946public async Task UploadFile_ExceedsLimitAcrossMultipleChunks_ThrowsResourceExhausted() 976public async Task UploadFile_ConfiguredSizeLimit_AllowsWithinLimitUploads() 1005public async Task UploadFile_EmptyStream_ThrowsInvalidArgument() 1025public async Task UploadFile_FirstChunkMissingRequiredMetadata_ThrowsInvalidArgument( 1049public async Task UploadFile_UnknownInteraction_RejectsUpload() 1068public async Task SendInteractionRequestAsync_ClientFileTypeForTextInput_DoesNotAttachFile() 1106public async Task SendInteractionRequestAsync_UsesAuthoritativeFilesAndDisposeDeletesUploads() 1167Task ReadAllBytesAfterDisposeAsync() => file.ReadAllBytesAsync(); 1171public async Task SendInteractionRequestAsync_MismatchedFiles_Throws() 1207public async Task UploadFile_ThenResolveFiles_ResolvesCorrectly() 1325private static async Task CancelTokenAndAwaitTask(CancellationTokenSource cts, Task task)
Dashboard\ResourcePublisherTests.cs (9)
33public async Task ProducesExpectedSnapshotAndUpdates() 57var task = Task.Run(async () => 86public async Task SupportsMultipleSubscribers() 133public async Task MergesResourcesInSnapshot() 154public async Task DeletesRemoveFromSnapshot() 174public async Task CancelledSubscriptionIsCleanedUp() 182var task = Task.Run(async () =>
Dcp\DcpExecutorTests.cs (263)
46public async Task ContainersArePassedOtelServiceName() 68public async Task DockerfileContainerBuildSpecIncludesPlatform() 93public async Task DockerfileContainerBuildSpec_RunMode_DefaultsToHostPlatform() 115public async Task ResourceStarted_ProjectHasReplicas_EventRaisedOnce() 135return Task.CompletedTask; 159var watchResourceTask = Task.Run(async () => 180public async Task CreateExecutable_LaunchProfileHasCommandLineArgs_AnnotationsAdded(string executionType, bool addAppHostArgs, string[]? expectedArgs, string[]? expectedAnnotations) 235public async Task CreateExecutable_ToolHasCommandLineArgs_AnnotationsAdded(params string[] toolArgs) 272public async Task DotnetToolResource_ExtensionMode_OwnedLaunchToolArgsAreWithheldAndRespectCommandLineVisibility(bool showInCommandLine) 326public async Task DotnetToolResource_ProcessMode_LaunchToolArgsReplaceBuiltInInvocation(bool showInCommandLine) 363public async Task CreateExecutable_ProjectArgsResolvedInSnapshot_UsesEffectiveArgsFromCreatorIndexes() 404public async Task CreateContainer_ArgsResolvedInSnapshot_UsesEffectiveArgsFromCreatorIndexes() 452public async Task RunApplicationAsync_ThrowsWhenContainerResourceNameConflictsWithContainerTunnelName(string containerName) 473public async Task RunApplicationAsync_ThrowsWhenExplicitContainerNameConflictsWithContainerTunnelName(string containerName) 495public async Task RunApplicationAsync_ThrowsWhenNetworkAliasConflictsWithContainerTunnelName(string alias) 515public async Task RunApplicationAsync_AllowsContainerNameMatchingContainerTunnelNameWhenContainerTunnelDisabled() 540public async Task ResourceRestarted_EnvironmentCallbacksApplied() 573return Task.CompletedTask; 615public async Task EndpointPortsExecutableNotReplicatedProxiedNoPortNoTargetPort() 646public async Task EndpointPortsExecutableNotReplicatedProxiedPortSetNoTargetPort() 678public async Task EndpointPortsExecutableNotReplicatedProxiedNoPortTargetPortSet() 710public async Task EndpointPortsExecutableNotReplicatedProxiedPortAndTargetPortSet() 747public async Task UnsupportedEndpointPortsExecutableNotReplicatedProxied() 765public async Task EndpointPortsExecutableWithEndpointProxySupportUsesProxylessEndpoint() 794public async Task EndpointPortsExecutableWithEndpointProxySupportOverridesExplicitProxiedEndpoint() 823public async Task EndpointPortsPersistentExecutableDefaultsToProxylessEndpoint() 858public async Task EndpointPortsPersistentExecutableDefaultsToProxiedEndpointWhenPortsAreRandomized() 896public async Task EndpointPortsPersistentExecutableExplicitProxylessStaysProxylessWhenPortsAreRandomized() 932public async Task EndpointPortsExecutableNotReplicatedProxylessPortSetNoTargetPort() 963public async Task EndpointPortsExecutableNotReplicatedProxylessNoPortTargetPortSet() 995public async Task EndpointPortsExecutableNotReplicatedProxylessPortAndTargetPortSet() 1026public async Task EndpointPortsExecutableNotReplicatedProxylessNoPortNoTargetPortAllocated() 1055public async Task ProxylessPortAllocatorExcludesFixedPublicPorts() 1093public async Task PersistentProxylessExecutableWithUnspecifiedPortPersistsAllocatedPort(int? port) 1130public async Task PersistentProxylessContainerWithUnspecifiedPortPersistsAllocatedPort(int? port) 1169public async Task PersistentProxylessWithoutPortLogsWarningButStillAllocatesWhenPersistenceFails() 1213public async Task ProxylessExecutableAllocatedPortIsStableOnResourceRestart() 1250public async Task ProxylessContainerAllocatedHostPortIsStableOnResourceRestart() 1288public async Task PersistedProxylessEndpointPortIsReusedAndExcludedFromDynamicAllocation() 1334public async Task UnsupportedEndpointPortsExecutableNotReplicatedProxyless() 1372public async Task EndpointOtelServiceName(int replicaCount, string expectedName) 1399public async Task ResourceLogging_MultipleStreams_StreamedOverTime() 1492public async Task ResourceLogging_ReplayBacklog_SentInBatch() 1571public async Task ResourceLogging_LateSubscriberReceivesFailedToStartLogsWithoutWatchReplay() 1610return Task.CompletedTask; 1647public async Task ResourceLogging_ActiveSubscriberReceivesFailedToStartLogsAfterSnapshot() 1729public async Task ResourceLogging_TerminalStateFollowsLogsBeforeNotification() 1774return Task.CompletedTask; 1804public async Task ResourceLogging_TerminalLogFlushTimeoutDoesNotBlockOtherResourceNotifications() 1864return Task.CompletedTask; 1903public async Task ResourceLogging_ActiveSubscriberContinuesAfterTerminalFlushTimeout() 1990public async Task ResourceLogging_FollowStreamDeduplicatesOnlyPendingTerminalFlush() 2076public async Task ResourceLogging_CompletedFollowStreamIsRemovedAndCanRestartWithExistingSubscriber() 2135var firstLogStreamTask = appExecutor.ResourceWatcher.GetLogStreamTask(container.Metadata.Name); 2158public async Task ResourceLogging_OverlappingSameUidStreamCannotClearNewDeduplicationState() 2225return Task.CompletedTask; 2251var previousLogStreamTask = appExecutor.ResourceWatcher.GetLogStreamTask(dcpResourceName); 2276var currentLogStreamTask = appExecutor.ResourceWatcher.GetLogStreamTask(dcpResourceName); 2318public async Task ResourceLogging_CanceledSameUidStreamCannotClearHandedOffDeduplicationState() 2381return Task.CompletedTask; 2407var previousLogStreamTask = appExecutor.ResourceWatcher.GetLogStreamTask(dcpResourceName); 2432var currentLogStreamTask = appExecutor.ResourceWatcher.GetLogStreamTask(dcpResourceName); 2470public async Task ResourceWatch_ResourceWithoutResourceVersionIsAlwaysProcessed() 2493return Task.CompletedTask; 2523public async Task ResourceWatch_UnchangedResourceNotificationIsIgnored() 2546return Task.CompletedTask; 2579public async Task ResourceWatch_RecreatedResourceWithPreviouslySeenVersionIsProcessed() 2602return Task.CompletedTask; 2633public async Task ResourceWatch_RecreatedResourceAfterMissedDeleteIsProcessedAndResetsLogState() 2699return Task.CompletedTask; 2738var previousLogStreamTask = appExecutor.ResourceWatcher.GetLogStreamTask(dcpResourceName); 2768var replacementLogStreamTask = appExecutor.ResourceWatcher.GetLogStreamTask(dcpResourceName); 2797public async Task ResourceWatch_WatchRestartDoesNotRepublishUnchangedResources() 2820return Task.CompletedTask; 2855public async Task ResourceWatch_FailedToStartLogsAreRetriedForEachChangedTerminalNotification() 2894return Task.CompletedTask; 2925public async Task ResourceWatch_TerminalLogsAreFlushedOnlyOncePerTerminalPeriod() 2979return Task.CompletedTask; 3043public async Task ResourceLogging_SystemStream_FormatsWithSysPrefix() 3109public async Task ResourceLogging_CarriageReturnProgressOutput_NormalizesOverwrittenLines() 3169public async Task ResourceLogging_SystemStreamWithCarriageReturnInMessage_ParsesCorrectly() 3279public async Task EndpointPortsProjectNoPortNoTargetPort() 3326public async Task EndpointPortsProjectPortSetNoTargetPort() 3367public async Task EndpointPortsProjectWithEndpointProxySupportUsesProxylessEndpoint() 3398public async Task EndpointPortsPersistentProjectDefaultsToProxylessEndpoint() 3435public async Task EndpointPortsPersistentProjectDefaultsToProxiedEndpointWhenPortsAreRandomized() 3475public async Task EndpointPortsConainerProxiedNoPortTargetPortSet() 3509public async Task EndpointPortsContainerProxiedPortAndTargetPortSet() 3547public async Task UnsupportedEndpointPortsContainer() 3594public async Task EndpointPortsContainerProxylessPortSetNoTargetPort() 3627public async Task EndpointPortsContainerProxylessNoPortTargetPortSet() 3659public async Task EndpointPortsContainerProxylessNoPortTargetPortSetPublishesAllocatedEndpoint() 3683return Task.CompletedTask; 3694return Task.CompletedTask; 3703return Task.CompletedTask; 3733public async Task EndpointPortsContainerProxylessNoPortTargetPortSetAllocatesHostPortAndInjectsTargetPortForContainerSelfReference() 3752return Task.CompletedTask; 3781public async Task EndpointPortsContainerProxylessNoPortTargetPortSetAllocatesHostPortAndInjectsTargetHostAndPortForContainerSelfReference() 3810public async Task EndpointPortsContainerProxylessNoPortTargetPortSetCanBeResolvedWhileDependentResourceIsStarting() 3857public async Task EndpointPortsContainerProxylessNoPortTargetPortSetCanBeResolvedWithoutCallerWhileDependentResourceIsStarting() 3899public async Task ResourceEndpointsAllocatedEventSubscribersBlockDcpStartup() 3923var runTask = appExecutor.RunApplicationAsync(); 3934public async Task EndpointPortsContainerProxylessPortAndTargetPortSet() 3968public async Task EndpointPortsContainerWithEndpointProxySupportOverridesExplicitProxiedEndpoint() 4000public async Task EndpointPortsContainerProxylessProtocolSet() 4034public async Task ErrorIfResourceNotDeletedBeforeRestart() 4047return Task.CompletedTask; 4069public async Task AddsDefaultsCommandsToResources() 4088public async Task ContainersArePassedExpectedImagePullPolicy() 4134public async Task ServiceProducerHasCorrectAddress(string bindingAddress, string serviceAddress) 4165public async Task ProjectLaunchConfiguration_Populated_WhenLaunchProfileSpecified_InDebugSession() 4201public async Task ProjectLaunchConfiguration_RespectsDebugSessionRunMode(string runMode, string expectedMode) 4232public async Task ProjectLaunchConfiguration_UsesProjectDebugSupportProducer_InDebugSession() 4276public async Task ProjectLaunchConfiguration_Disabled_WhenLaunchProfileExcluded_InDebugSession() 4311public async Task ProjectLaunchConfiguration_DefaultLaunchProfileAnnotationFallsBack_WhenProfileMissing_InDebugSession() 4353public async Task ProjectLaunchConfiguration_DefaultLaunchProfileAnnotationSelectsExisting_InDebugSession() 4384public async Task ProjectLaunchConfiguration_ExplicitLaunchProfileOverridesDefault_InDebugSession() 4415public async Task ProjectLaunchConfiguration_DefaultIgnoredWhenExcluded_InDebugSession() 4445public async Task ProjectLaunchConfiguration_NoProfiles_NoLaunchProfileSelected_InDebugSession() 4475public async Task ProjectLaunchConfiguration_FallbackToFirstProfileInsertionOrder_InDebugSession() 4503public async Task PlainExecutable_LaunchConfigurationProducerReceivesResolvedEnvironmentVariables() 4529return Task.FromResult(new ExecutableLaunchConfiguration("test") 4570public async Task PlainExecutable_ExtensionMode_SupportedDebugMode_RunsInIde() 4626public async Task PersistentPlainExecutable_ExtensionMode_RunsInProcess() 4661public async Task ProjectResource_WithLaunchToolArgs_ReplacesDotnetRunScaffolding_InProcessMode() 4693public async Task ProjectResource_WithDotnetToolRunLaunchArgs_DoesNotInjectProjectLaunchOptions_InProcessMode() 4730public async Task ProjectResource_EmptyLaunchToolArgs_KeepsDotnetRunScaffolding_InProcessMode() 4751public async Task ProjectResource_WithLaunchToolArgsDebugSupport_WithholdsOwnedPrefix_InDebugSession() 4794public async Task ProjectResource_EmptyOwnedLaunchToolArgs_DoesNotConfigureRuntimeFallback() 4835public async Task ProjectResource_CustomIdeLaunchWithoutProcessInvocation_UsesApplicationArgumentsOnly() 4879public async Task ProjectResource_CustomIdeLaunchWithoutProcessInvocation_DoesNotAddDotnetArgumentSeparator() 4926public async Task ProjectResource_EmptyOwnedLaunchToolArgs_LaunchConfigurationFailureFailsResource() 4951return Task.CompletedTask; 4979public async Task ProjectResource_WithoutLaunchToolArgs_DoesNotConfigureRuntimeFallback_InDebugSession() 5008public async Task PersistentDcpResourcesDoNotIncludeMonitorProcessByDefault() 5054public async Task PersistentProjectWithReplicasThrows() 5072public async Task PersistentPlainExecutableWithReplicasThrows() 5090public async Task PersistentContainerWithOtlpExporterUsesStableServiceInstanceId() 5110public async Task PersistentExecutableWithOtlpExporterUsesStableServiceInstanceId() 5159public async Task ExplicitParentProcessLifetimeIncludesMonitorProcess() 5209public async Task PersistentPlainExecutable_UsesStableCertificateOutputPath() 5251public async Task PersistentPlainExecutable_WritesCustomBundleDirectoryOwnerOnly() 5269ctx.EnvironmentVariables["TEST_BUNDLE"] = ctx.CreateCustomBundle(static (_, _) => Task.FromResult(new byte[] { 1, 2, 3 })); 5270return Task.CompletedTask; 5407public async Task PlainExecutableCertificateDirectoriesPath_IgnoresResourceSslCertDirForAppend() 5420public async Task SessionScopedExplicitStartPlainExecutable_DefersDcpObjectCreationUntilManualStart() 5444public async Task PlainExecutable_MultipleLaunchRecipes_ReportsLaunchPlanFailure() 5458return Task.CompletedTask; 5489public async Task PlainExecutable_ExtensionMode_UnsupportedDebugMode_RunsInProcess() 5525public async Task PlainExecutable_NoExtensionMode_RunInProcess() 5567public async Task CustomExecutable_NoDebugSessionInfo_RunInProcess() 5603public async Task CustomExecutable_InvalidDebugSessionInfo_RunInProcess() 5639public async Task CustomExecutable_DebugSessionInfoWithNullSupportedLaunchConfigurations_RunInProcess() 5681public async Task CustomExecutable_DebugSessionInfoNotContainingType_RunInProcess() 5723public async Task CustomExecutable_DebugSessionInfoContainsType_RunInIde() 5765public async Task ProjectExecutable_NoDebugSessionInfo_DefaultsToProjectSupport() 5798public async Task Project_WithTerminal_RunsAsProcess_InDebugSessionWhenDebugSupportIsAddedLater() 5842public async Task Project_WithTerminal_RunsAsProcess_NoDebugSessionInfo() 5878public async Task ProjectExecutable_InvalidDebugSessionInfo_DefaultsToProjectSupport() 5911public async Task ProjectExecutable_DebugSessionInfoWithNullSupportedLaunchConfigurations_DefaultsToProjectSupport() 5950public async Task ProjectExecutable_DebugSessionInfoWithoutProject_SelectsProcess() 5991public async Task ProjectWithNonProjectAnnotation_DebugSessionWithoutInfo_UsesProjectIdeExecution() 6032public async Task ProjectWithNonProjectAnnotation_VSCodeExplicitlyUnsupported_RunsInProcess() 6085public async Task ProjectWithNonProjectAnnotationAndExecutableAnnotation_VSCodeExplicitlyUnsupported_RunsInProcessWithResourceArgs(string launchConfigurationType, string[] resourceArgs) 6145public async Task ProjectWithNonProjectAnnotationAndExecutableAnnotation_NoDebugSessionInfo_RunsInProcessWithResourceArgs(string launchConfigurationType, string[] resourceArgs) 6197public async Task ProjectWithNonProjectAnnotationAndExecutableAnnotation_NoDebugSession_RunsInProcessWithResourceArgs(string launchConfigurationType, string[] resourceArgs) 6241public async Task MauiProjectWithExecutableAnnotationAndSupportedLaunchConfiguration_RunsInIdeWithLaunchMetadata() 6324public async Task MauiProjectWithLaunchArgsOverrideAndSupportedLaunchConfiguration_PreservesProjectMetadataAndAppliesMauiLaunchConfiguration(bool useContextOverload) 6352return Task.FromResult(CreateMauiLaunchConfiguration(context.Mode)); 6457public async Task MauiProjectWithLaunchArgsOverride_LaunchConfigurationProducerThrows_RemainsInProcessExecution(bool useContextOverload) 6486await Task.Yield(); 6530return Task.CompletedTask; 6587public async Task ProjectResource_CustomIdeLaunch_OwnedDotnetToolRunArgsPreserveLaunchProfileArgs() 6649public async Task ProjectResource_CustomIdeLaunch_ExecutableAnnotatedProjectPreservesLaunchProfileArgs( 6778public async Task ProjectResource_CustomIdeLaunch_PreservesOpaqueDotnetApplicationArguments( 6847public async Task ProjectResource_CustomIdeLaunch_ExecutableAnnotatedDotnetApplicationDoesNotConfigureRuntimeFallback( 6892public async Task ProjectWithNonProjectAnnotationAndExecutableAnnotation_LaunchProfileArgsStayAfterDotnetRunArgs() 6956public async Task ProjectWithNonProjectAnnotation_NoDebugSession_RunsInProcess() 6982public async Task ProjectWithNonProjectAnnotation_VSCodeWithMatchingSupport_RunsInIde() 7024public async Task StandardAndCustomProjects_VSScenario_BothRunInIde() 7072public async Task StandardAndCustomProjects_VSCodeScenario_BothRunInIde() 7126public async Task ProjectWithNonProjectAnnotation_VSCompatibilityLaunch_UsesApplicationArgumentsOnly() 7165public async Task ContainerNetworkAliases(params string[]? aliases) 7200public async Task ProjectExecutable_NoSupportsDebuggingAnnotation_InDebugSession_RunsInIdeMode() 7247public async Task FileBasedProjectResource_InDebugSession_UsesIdeWithoutProcessFallback() 7281public async Task ProjectExecutable_AsyncLaunchConfigurationProducer_IsAwaitedDuringCreate() 7295await Task.Yield(); 7325public async Task PlainExecutable_AsyncLaunchConfigurationProducer_IsAwaitedDuringCreate() 7336await Task.Yield(); 7366public async Task PlainExecutable_AsyncLaunchConfigurationProducerFaults_FailsResource() 7375await Task.Yield(); 7394return Task.CompletedTask; 7411public async Task ProjectExecutable_WithLaunchArgsOverride_InDebugSession_RunsInProcessMode() 7452public async Task ProjectExecutable_WithLaunchArgsOverride_AndExecutableAnnotatedSdkRunArgs_DoesNotMutateRunArgs() 7494public async Task ProjectExecutable_WithLaunchArgsOverride_AndLeadingResourceArgumentToRemove_DropsRunBeforeExecuting() 7529public async Task ProjectExecutable_WithLaunchArgsOverride_EmptyLaunchToolArgsKeepOverride() 7564public async Task ProjectExecutable_WithLaunchArgsOverride_NonEmptyLaunchToolArgsReplaceOverride() 7610public async Task ProjectExecutable_WithLaunchArgsOverride_AndPersistentLifetime_RunsOverrideInProcessMode() 7651public async Task ProjectExecutable_NoSupportsDebuggingAnnotation_NoDebugSession_RunsInProcessMode() 7679public async Task ProjectExecutable_NoAnnotation_ExecutableLaunchProfile_InDebugSession_RunsInIdeMode() 7721public async Task ProjectExecutable_NoAnnotation_ProjectLaunchProfile_InDebugSession_RunsInIdeMode() 7755public async Task DotnetProjectExecutable_InDebugSession_GetsIdeExecutionWithProjectLaunchConfig() 7821public async Task DotnetProjectExecutable_ProjectLaunchUnsupported_RunsInProcess() 7853public async Task DotnetProjectExecutable_PersistentLifetime_InDebugSession_RunsInProcessWithoutProjectLaunchConfig() 7886public async Task DotnetProjectExecutable_ProjectLaunchConfigurationFailure_FailsResource() 7910return Task.CompletedTask; 7942public async Task PlainExecutable_ExtensionMode_LaunchToolArgsDebugSupport_WithholdsOwnedPrefix() 7995public async Task PlainExecutable_ExtensionMode_OwnedLaunchToolArgsCanBeHiddenFromCommandLine() 8040public async Task PlainExecutable_ExtensionMode_CertificateCallbackCannotShiftLaunchToolPrefixBoundary() 8060return Task.CompletedTask; 8104public async Task PlainExecutable_ExtensionMode_EmptyLaunchToolArgs_DoesNotConfigureRuntimeFallback() 8139public async Task PlainExecutable_UnownedLaunchToolArgs_AreExecutedButCanBeHiddenFromTheCommandLine() 8178public async Task PlainExecutable_ExtensionMode_UnownedLaunchToolArgs_AreNotWithheldFromTheLaunchedProgram() 8216public async Task PlainExecutable_ExtensionMode_LaunchToolArgsDebugSupport_LaunchConfigFailure_FailsResource() 8242return Task.CompletedTask; 8261public async Task PlainExecutable_ExtensionMode_RestartLaunchConfigCancellationIsPropagated() 8279return Task.FromResult(new ExecutableLaunchConfiguration("test") { Mode = mode }); 8311public async Task PlainExecutable_ExtensionMode_NullLaunchToolArgument_DoesNotOmitApplicationArgument() 8347public async Task DotnetProjectExecutable_EmptyOwnedLaunchToolArgs_UsesApplicationArgumentsOnly() 8384public async Task DotnetProjectExecutable_EmptyOwnedLaunchToolArgs_LaunchConfigFailureDoesNotRunBrokenProcessCommand() 8412return Task.CompletedTask; 8451public async Task DotnetProjectExecutable_EmptyOwnedLaunchToolArgs_LaunchConfigFailureOnRestartPropagatesFailureAndRetainsDiagnostic() 8488return Task.CompletedTask; 8533public async Task PlainExecutable_ExtensionMode_LaunchToolArgumentsAreRecomputedOnRestart() 8598public async Task PlainExecutable_ExtensionMode_LaunchConfigurationFailureDoesNotReusePriorPlanOnRestart() 8659public async Task PlainExecutable_ProjectDebugSupportWithoutProjectMetadata_FailsToStart() 8683return Task.CompletedTask; 8702public async Task DotnetProjectExecutable_RespectsDebugSessionRunMode(string runMode, string expectedMode) 8738public async Task EndpointsAllocatedCorrectly(bool useTunnel, string? containerHostName, string expectedContainerHost) 8848public async Task ContainerHostUrlWithoutMatchingHostEndpointUsesContainerHostBridge() 8877public async Task ContainerHostUrlMatchingHostEndpointUsesTunnelPort() 8896return Task.CompletedTask; 8922public async Task EnvironmentCallbacksInvokedOnceOnContainer() 8955public async Task EnvironmentCallbacksInvokedAfterBeforeResourceStartEvent() 8984return Task.CompletedTask; 8997public async Task ArgsCallbacksInvokedOnceOnContainer() 9033public async Task ExecutionConfigurationCallbacksDeferredForExplicitStartExecutableUntilManualStart() 9078public async Task ExecutionConfigurationCallbacksDeferredForExplicitStartContainerUntilManualStart() 9123public async Task ExecutionConfigurationCallbacksNotReevaluatedWhenStartingCreatedExplicitStartPersistentExecutable() 9176public async Task ExecutionConfigurationCallbacksNotDeferredForExplicitStartPersistentContainer() 9231public async Task ArgsCallbacksInvokedAfterBeforeResourceStartEvent() 9261return Task.CompletedTask; 9273public async Task TunnelDependentAndIndependentContainersCanStartTogether() 9307public async Task WaitingTunnelDependentContainersDoNotBlockTunnelCreation() 9338await Task.Delay(10, context.CancellationToken).ConfigureAwait(false); 9373public async Task HostResourceCanWaitForTunnelDependentContainer() 9399await Task.Delay(10, context.CancellationToken).ConfigureAwait(false); 9407await Task.Delay(10, context.CancellationToken).ConfigureAwait(false); 9446public async Task EnvironmentCallbackThrows_OtherResourcesStillStart() 9467return Task.CompletedTask; 9483public async Task ArgsCallbackThrows_OtherResourcesStillStart() 9504return Task.CompletedTask; 9555public async Task PlainExecutable_LaunchConfigurationProducerThrows_FailsResource() 9585return Task.CompletedTask; 9602public async Task Project_NonProjectLaunchConfig_ExtensionMode_RunsInIde() 9647public async Task Project_NonProjectLaunchConfig_AnnotatorThrows_FailsResource() 9676return Task.CompletedTask; 9694public async Task Project_NonProjectLaunchConfig_UnsupportedByExtension_RunsInProcess() 9752public async Task Project_WithTerminal_PopulatesPerReplicaTerminalSpec() 9808public async Task Project_WithoutTerminal_HasNullTerminalSpec() 9825public async Task PlainExecutable_WithTerminal_PopulatesTerminalSpec() 9873public async Task Container_WithTerminal_PopulatesTerminalSpec()
Dcp\DcpHostNotificationTests.cs (21)
69public async Task DcpHost_WithUnhealthyContainerRuntime_ShowsNotification() 122public async Task DcpHost_WithUntrustedDeveloperCertificate_ShowsNotificationAndLogsWarning() 166public async Task DcpHost_WithHealthyContainerRuntime_DoesNotShowNotification() 225public async Task DcpHost_WithDashboardDisabled_DoesNotShowNotification() 284public async Task DcpHost_WithPodmanUnhealthy_ShowsCorrectMessage() 338public async Task DcpHost_WithUnhealthyContainerRuntime_NotificationCancelledWhenRuntimeBecomesHealthy() 405await Assert.ThrowsAsync<TaskCanceledException>(() => Task.Delay(-1, linkedCts.Token)); 410public async Task DcpHost_WithContainerRuntimeNotInstalled_ShowsNotificationWithoutPolling() 465await Task.Delay(TimeSpan.FromMilliseconds(100)); 486public async Task CreateDcpProcessSpec_WithDcpDeveloperCertificateDefault_IncludesDeveloperCertificateArguments() 532public async Task CreateDcpProcessSpec_WithDcpDeveloperCertificateDisabled_DoesNotIncludeThumbprintArgument() 752public async Task DcpHost_WithNoHttpsResources_DoesNotShowCertificateWarning() 802public async Task DcpHost_WithNoResources_DoesNotShowCertificateWarning() 852public async Task DcpHost_WithHttpsCertificateConfigCallback_ShowsCertificateWarning() 867resource.Annotations.Add(new HttpsCertificateConfigurationCallbackAnnotation(_ => Task.CompletedTask)); 903public async Task DcpHost_WithHttpsCertificateConfigCallbackDisabledByWithoutHttpsCertificate_DoesNotShowCertificateWarning() 918resource.Annotations.Add(new HttpsCertificateConfigurationCallbackAnnotation(_ => Task.CompletedTask)); 963public async Task DcpHost_WithHttpsCertificateAnnotationOnly_DoesNotShowCertificateWarning() 1021public async Task DcpHost_WithHttpsCertificateConfigCallbackAndDevCert_ShowsCertificateWarning() 1037resource.Annotations.Add(new HttpsCertificateConfigurationCallbackAnnotation(_ => Task.CompletedTask)); 1092return Task.FromResult(DcpInfoResult);
Dcp\ExecutableLaunchPlanTests.cs (11)
18public async Task OwnedLaunchToolArgumentsAreSeparatedFromIdeArguments() 22static _ => Task.CompletedTask, 28static _ => Task.FromResult(new ExecutableLaunchConfiguration("test")))); 65public async Task UnsupportedIdeCapabilitySelectsCompleteProcessPlan() 69static _ => Task.CompletedTask, 75static _ => Task.FromResult(new ExecutableLaunchConfiguration("test")))); 98public async Task LegacyProjectRecipeProducesCompleteProcessInvocation() 123public async Task CompatibilityProjectLaunchDoesNotWithholdInactiveOwnedToolArguments() 128static _ => Task.CompletedTask, 134static _ => Task.FromResult(new ExecutableLaunchConfiguration("custom")))); 214public async Task ResolverRejectsMultipleLaunchRecipes()
Dcp\GatedLogger.cs (1)
14public Task Blocked => _blocked.Task;
Dcp\GatedReadStream.cs (1)
14public Task ReadStarted => _readStarted.Task;
Dcp\KubernetesServiceTests.cs (4)
24public async Task ExecuteWithRetry_EstablishesConnection_WhenKubeconfigInitiallyMissing() 37await Task.Delay(300, cts.Token); 50public async Task ExecuteWithRetry_EstablishesConnection_WhenKubeconfigInitiallyPartiallyWritten() 64await Task.Delay(300, cts.Token);
Dcp\ProcessUtilTests.cs (8)
14public async Task Run_WaitsForOutputCallbacksToFinishBeforeCompleting() 32await Task.Delay(200); 44public async Task Run_IncludesCapturedOutputInNonZeroExitException() 60public async Task Run_ReturnsCapturedOutputInProcessResult_WhenRetentionEnabled() 86public async Task Run_PassesArgumentListToProcess() 108public async Task Run_IncludesArgumentListInNonZeroExitException() 133public async Task Run_ResolvesExecutableNameFromPathBeforeStartingProcess() 184public async Task Run_TruncatesCapturedOutputToLast50LinesInNonZeroExitException()
Dcp\ResourceSnapshotBuilderTests.cs (1)
97_ => Task.FromResult(new object())));
Dcp\TestKubernetesService.cs (9)
65return Task.FromResult(res); 122return Task.FromResult(res); 278return Task.FromResult(res.ToList()); 328return Task.FromResult(_startStream(obj, logStreamType, follow)); 418return Task.FromResult(res); 422return Task.FromResult(obj); 425public Task StopServerAsync(string resourceCleanup = "Full", CancellationToken cancellation = default) 437return Task.CompletedTask; 440public Task CleanupResourcesAsync(CancellationToken cancellationToken = default)
DebugSupportExtensionsTests.cs (18)
67public async Task CreateLaunchConfigurationInspectionOverloadCreatesResourceBoundContext() 84return Task.FromResult(new TestGoLaunchConfiguration { Mode = context.Mode }); 99public async Task CreateLaunchConfigurationResolvesTheLaunchProfileForProjectResources() 113public async Task CreateLaunchConfigurationDisablesTheLaunchProfileWhenTheResourceExcludesIt() 139public async Task CreateLaunchConfigurationReturnsTheProducerOutputForACustomProjectProducer() 160public async Task CreateLaunchConfigurationReturnsTheProducerOutputForNonProjectLaunchTypes() 174public async Task CreateLaunchConfigurationAwaitsAnAsynchronousProducer() 182await Task.Yield(); 193public async Task CreateLaunchConfigurationPropagatesTheCancellationTokenToTheProducer() 203return Task.FromResult(new TestGoLaunchConfiguration { Mode = mode }); 212public async Task CreateLaunchConfigurationPublicOverloadInvokesContextProducerWithLegacyInputs() 222return Task.FromResult(new TestGoLaunchConfiguration 242public async Task CreateLaunchConfigurationPublicOverloadValidatesMode() 253public async Task CreateLaunchConfigurationWithContextUsesResolvedEnvironmentAndCancellation() 263return Task.FromResult(new TestGoLaunchConfiguration 286public async Task CreateLaunchConfigurationThrowsWhenTheResourceHasNoDebugSupport() 297public async Task CreateLaunchConfigurationThrowsWhenTheResourceHasNoProjectMetadata() 313public async Task CreateLaunchConfigurationThrowsWhenTheProducerReturnsNull()
DeveloperCertificateServiceTests.cs (4)
12public async Task GetKeyMaterialAsync_WithRsaUserCertificate_ReturnsKeyAndPfx() 29public async Task GetKeyMaterialAsync_WithEcdsaUserCertificate_ReturnsKeyAndPfx() 46public async Task GetKeyMaterialAsync_WithEcdsaUserCertificate_WithPassword_ProducesEncryptedPem() 63public async Task GetKeyMaterialAsync_WithCertificateWithoutPrivateKey_Throws()
DistributedApplicationTests.cs (84)
58public async Task RegisteredLifecycleHookIsExecutedWhenRunAsynchronously() 86public async Task MultipleRegisteredLifecycleHooksAreExecuted() 101return Task.CompletedTask; 133public async Task RunAsync_RecordsAppHostStartActivityForBeforeStartFailure() 165public async Task DistributedApplicationLifecycle_StopAsyncDisposesHostStartupActivityWhenStartupDoesNotComplete() 189public async Task StartResourceForcesStart() 207var startTask = app.StartAsync(token); 220var restartResourceTask = orchestrator.StartResourceAsync(resourceEvent.ResourceId, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); 233public async Task ExplicitStart_StartExecutable() 252var startTask = app.StartAsync(token); 305public async Task BeforeResourceStartedEvent_NotFiredForExplicitStartOnInitialCreation() 317return Task.CompletedTask; 325return Task.CompletedTask; 333return Task.CompletedTask; 365public async Task BeforeResourceStartedEvent_FiredWhenExplicitStartResourceIsManuallyStarted() 376return Task.CompletedTask; 387var startTask = app.StartAsync(token); 412public async Task BeforeResourceStartedEvent_FiredForNormalResourcesOnInitialStartup() 424return Task.CompletedTask; 437public async Task StartAsync_ThrowsWhenCancelled() 446return Task.CompletedTask; 458public async Task StartAsync_ThrowsWhenStopped() 466return Task.CompletedTask; 478public async Task RunAsync_ThrowsWhenCancelled() 487return Task.CompletedTask; 499public async Task RunAsync_DoesNotThrowWhenStopped() 508return Task.CompletedTask; 518public async Task ExplicitStart_StartContainer() 541var startTask = app.StartAsync(token); 601public async Task ExplicitStart_StartPersistentContainer() 628var startTask = app.StartAsync(token); 736public async Task AfterEndpointsAllocatedLifecycleHookIsNotCalled() 755public Task AfterEndpointsAllocatedAsync(DistributedApplicationModel appModel, CancellationToken cancellationToken = default) 759return Task.CompletedTask; 765public async Task TestServicesWithMultipleReplicas() 783await Task.WhenAll(clientA.GetStringAsync("/pid"), clientC.GetStringAsync("/pid")).DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout); 812await Task.Delay(100); 820public async Task VerifyContainerArgs() 848public async Task VerifyContainerCreateFile() 913public async Task VerifyRedisWithCertificateKeyPair() 971public async Task VerifyContainerIncludesExpectedDevCertificateConfiguration(bool? implicitTrust, bool? explicitTrust, bool expectDevCert, bool overridePaths, CertificateTrustScope trustScope) 1084public async Task VerifyContainerSucceedsWithCreateFileContinueOnError() 1114public async Task VerifyEnvironmentVariablesAvailableInCertificateTrustConfigCallback() 1132return Task.CompletedTask; 1159public async Task VerifyEnvironmentVariablesAppliedWithoutCertificateTrustConfig() 1172return Task.CompletedTask; 1198public async Task VerifyContainerStopStartWorks() 1248public async Task VerifyExecutableStopStartWorks() 1283public async Task SpecifyingEnvPortInEndpointFlowsToEnv() 1337public async Task StartAsync_DashboardUrls_DisplayPropertiesSet() 1367public async Task StartAsync_DashboardAuthConfig_PassedToDashboardProcess(string tokenEnvVarName) 1405public async Task StartAsync_UnsecuredAllowAnonymous_PassedToDashboardProcess() 1438public async Task StartAsync_ResourceServiceEndpointUrl_PassedToDashboardServiceHost() 1468public async Task StartAsync_ResourceServiceEndpointUrl_RandomizePortsIgnoresConfiguredPort(string host, string expectedHost) 1501public async Task VerifyDockerWithEntrypointWorks() 1528public async Task VerifyDockerWithBindMountWorksWithAbsolutePaths() 1557public async Task VerifyDockerWithBindMountWorksWithRelativePaths() 1586public async Task VerifyDockerWithVolumeWorksWithName() 1614public async Task KubernetesHasResourceNameForContainersAndExes() 1670public async Task ReplicasAndProxylessEndpointThrows() 1686public async Task ProxylessEndpointWithoutPortIsAllocated() 1708public async Task ProxylessEndpointWorks() 1745public async Task ProxylessAndProxiedEndpointBothWorkOnSameResource() 1786await Task.Delay(100, token); 1808await Task.Delay(100, token); 1816public async Task ProxylessContainerCanBeReferenced() 1895public async Task WithEndpointProxySupportDisablesProxies() 1973public async Task ProxylessContainerWithoutPortThrows() 1993public async Task PersistentNetworkCreatedIfPersistentContainers(bool createPersistentContainer) 2025public async Task ParentProcessLifetimeScopesExecutableAndContainerToParentProcess() 2074public async Task ParentProcessLifetimeReusesResourcesAcrossAppRestartsAndStopsWhenParentExits() 2108await Task.WhenAll( 2177static async Task StopAndDisposeAppAsync(DistributedApplication app, CancellationToken cancellationToken) 2192public async Task AfterResourcesCreatedLifecycleHookWorks() 2218public async Task LogStreamOptionsWork() 2287public async Task ContainerExitsImmediatelyAfterStart(int exitCode) 2302var startTask = app.StartAsync(cts.Token); 2311private static async Task EnsureLogLines(Stream stream, CancellationToken ct, long nlines, Func<long, bool>? validateLineNumber = default) 2385private static async Task KillProcessAsync(Process process, CancellationToken cancellationToken) 2406public Task HooksCompleted => _tcs.Task; 2408public Task AfterEndpointsAllocatedAsync(DistributedApplicationModel appModel, CancellationToken cancellationToken) 2411return Task.CompletedTask; 2414public Task AfterResourcesCreatedAsync(DistributedApplicationModel appModel, CancellationToken cancellationToken) 2417return Task.CompletedTask;
DockerUtilsTests.cs (1)
18(_, _) => Task.FromException<ContainerRuntimeInfo?>(expectedException));
EndpointReferenceTests.cs (16)
13public async Task GetValueAsync_WaitsForEndpointAllocation() 31public async Task GetUrlPropertyValueAsync_WaitsForEndpointAllocation() 50public async Task GetValueAsync_ReturnsImmediatelyWhenAlreadyAllocated() 65public async Task GetValueAsync_Host_WaitsForAllocation() 84public async Task GetValueAsync_Port_WaitsForAllocation() 103public async Task GetValueAsync_Scheme_ReturnsImmediately() 117public async Task GetValueAsync_IPV4Host_ReturnsImmediately() 131public async Task GetValueAsync_TargetPort_WithStaticPort_ReturnsImmediately() 145public async Task GetValueAsync_TargetPort_WithExpression_WaitsForAllocation() 164public async Task GetValueAsync_SupportsCancellation() 182public async Task GetValueAsync_MultipleWaiters_AllCompleteWhenAllocated() 330public async Task PropertyResolutionTest(EndpointProperty property, ResourceKind sourceKind, ResourceKind destinationKind, object expectedResult) 382public async Task WaitingForAllocatedEndpointWorks() 395await Task.WhenAll 397Task.Run(async() => 403Task.Run(async () =>
Eventing\DistributedApplicationBuilderEventingTests.cs (39)
19public async Task EventsCanBePublishedBlockSequential() 37return Task.CompletedTask; 40var pendingPublish = builder.Eventing.PublishAsync(new DummyEvent(), EventDispatchBehavior.BlockingSequential); 50public async Task EventsCanBePublishedBlockConcurrent() 73var pendingPublish = builder.Eventing.PublishAsync(new DummyEvent(), EventDispatchBehavior.BlockingConcurrent); 75await Task.WhenAll(blockAssertionSub1.Task, blockAssertionSub2.Task).DefaultTimeout(); 82public async Task EventsCanBePublishedNonBlockingConcurrent() 108await Task.WhenAll(blockAssertionSub1.Task, blockAssertionSub2.Task).DefaultTimeout(); 113public async Task EventsCanBePublishedNonBlockingSequential() 137return Task.CompletedTask; 150await Task.Delay(1000); 178public async Task ResourceEventsForContainersFireForSpecificResources() 189return Task.CompletedTask; 202public async Task ResourceEventsForContainersFireForAllResources() 216return Task.CompletedTask; 229public async Task LifeycleHookAnalogousEventsFire() 241return Task.CompletedTask; 249return Task.CompletedTask; 257return Task.CompletedTask; 274public async Task ObsoleteAfterEndpointsAllocatedEventSubscriptionLogsWarning() 281builder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((e, ct) => Task.CompletedTask); 298public async Task ResourceStoppedEventCanBeSubscribedTo() 313return Task.CompletedTask; 340public async Task ResourceStoppedEventFiresWhenResourceStops() 352return Task.CompletedTask; 368public async Task OnBeforeStartSubscribesToBeforeStartEvent() 378return Task.CompletedTask; 391public async Task OnAfterResourcesCreatedSubscribesToAfterResourcesCreatedEvent() 401return Task.CompletedTask; 414public async Task OnBeforePublishSubscribesToBeforePublishEvent() 423return Task.CompletedTask; 437public async Task OnAfterPublishSubscribesToAfterPublishEvent() 446return Task.CompletedTask; 463var result = builder.OnBeforeStart((e, ct) => Task.CompletedTask); 472var result = builder.OnBeforePublish((e, ct) => Task.CompletedTask); 481var result = builder.OnAfterPublish((e, ct) => Task.CompletedTask); 492builder.Eventing.Subscribe<IDistributedApplicationEvent>((_, _) => Task.CompletedTask)); 504builder.Eventing.Subscribe<AbstractDummyEvent>((_, _) => Task.CompletedTask)); 517builder.Eventing.Subscribe<IDistributedApplicationResourceEvent>(resource.Resource, (_, _) => Task.CompletedTask));
ExecutableResourceBuilderExtensionTests.cs (11)
91public async Task WithDebugSupportAddsAnnotationInRunMode() 124public async Task WithDebugSupportAsynchronousProducerProducesTheSameAnnotationAsTheSynchronousOne() 132await Task.Yield(); 159() => executable.WithDebugSupport(mode => Task.FromResult(new ExecutableLaunchConfiguration("go") { Mode = mode }), "go")); 179public async Task WithLaunchToolArgsLeadTheCommandLine() 198public async Task ProcessArgumentValuesAsyncIncludesLaunchToolArgsForExecutables() 224public async Task WithLaunchToolArgsAreOrderIndependent(bool launchToolArgsFirst) 263public async Task WithLaunchToolArgsSurviveAnArgsCallbackThatClearsTheList() 287public async Task WithLaunchToolArgsRemainInTheAppModelDuringADebugSession() 350public async Task WithLaunchToolArgsAreRegisteredInPublishMode() 371public async Task WithLaunchToolArgsAreNotCarriedIntoAPublishedContainer()
ExecutableResourceTests.cs (1)
14public async Task AddExecutableWithArgs()
ExecutionConfigurationGathererTests.cs (41)
25public async Task ArgumentsExecutionConfigurationGatherer_WithCommandLineArgsCallback_GathersArguments() 47public async Task ArgumentsExecutionConfigurationGatherer_WithMultipleCallbacks_GathersAllArguments() 70public async Task ArgumentsExecutionConfigurationGatherer_NoArgsAnnotations_DoesNothing() 88public async Task ArgumentsExecutionConfigurationGatherer_AsyncCallback_ExecutesCorrectly() 95await Task.Delay(1); 117public async Task EnvironmentVariablesExecutionConfigurationGatherer_WithEnvironmentCallback_GathersEnvironmentVariables() 140public async Task EnvironmentVariablesExecutionConfigurationGatherer_WithMultipleCallbacks_GathersAllVariables() 163public async Task EnvironmentVariablesExecutionConfigurationGatherer_NoEnvironmentAnnotations_DoesNothing() 181public async Task EnvironmentVariablesExecutionConfigurationGatherer_AsyncCallback_ExecutesCorrectly() 188await Task.Delay(1); 207public async Task ResolveAsync_FailingEnvironmentVariable_LogsErrorAndCollectsException() 242public async Task ResolveAsync_FailingArgument_LogsErrorAndCollectsException() 278public async Task CertificateTrustExecutionConfigurationGatherer_WithCertificateAuthorityCollection_SetsEnvironmentVariables() 305public async Task CertificateTrustExecutionConfigurationGatherer_WithSystemScope_IncludesSystemCertificates() 335public async Task CertificateTrustExecutionConfigurationGatherer_WithOverrideScope_SetsCorrectEnvironmentVariables() 363public async Task CertificateTrustExecutionConfigurationGatherer_WithNoneScope_DoesNotSetEnvironmentVariables() 391public async Task CertificateTrustExecutionConfigurationGatherer_NoCertificateAnnotation_DoesNothing() 411public async Task CertificateTrustExecutionConfigurationGatherer_WithAppendScope_DoesNotSetSSL_CERT_FILE() 441public async Task CreateCustomBundle_RegistersBundleFactory() 452Task.FromResult(new byte[] { 1, 2, 3 })); 454return Task.CompletedTask; 471public async Task CreateCustomBundle_ReturnsReferenceExpressionWithBundlePath() 483Task.FromResult(new byte[] { 1, 2, 3 })); 484return Task.CompletedTask; 504public async Task CreateCustomBundle_MultipleBundles_AllRegistered() 515Task.FromResult(new byte[] { 1 })); 517Task.FromResult(new byte[] { 2 })); 520return Task.CompletedTask; 541public async Task CreateCustomBundle_Pkcs12BundleFactory_ProducesValidPkcs12() 576return Task.FromResult(pkcs12Builder.Encode()); 580return Task.CompletedTask; 631public async Task CreateCustomBundle_FactoryReceivesCertificatesAndCancellationToken() 642Task.FromResult(Array.Empty<byte>())); 643return Task.CompletedTask; 671public async Task HttpsCertificateExecutionConfigurationGatherer_WithCertificate_ConfiguresMetadata() 699public async Task HttpsCertificateExecutionConfigurationGatherer_WithPassword_StoresPassword() 729public async Task HttpsCertificateExecutionConfigurationGatherer_WithUseDeveloperCertificate_UsesDeveloperCert() 759public async Task HttpsCertificateExecutionConfigurationGatherer_NoCertificateAnnotation_DoesNothing() 778public async Task HttpsCertificateExecutionConfigurationGatherer_TracksReferenceUsage() 816public async Task HttpsCertificateExecutionConfigurationGatherer_WithCallback_ExecutesCallback() 828return Task.CompletedTask;
ExpressionResolverTests.cs (8)
17public async Task ResolveInternalAsync_ResolvesCorrectly(ExpressionResolverTestData testData, Type? exceptionType, (string Value, bool IsSensitive)? expectedValue) 84public async Task ExpressionResolverGeneratesCorrectEndpointStrings(string exprName, bool sourceIsContainer, bool targetIsContainer, string expectedConnectionString) 161public async Task HostUrlPropertyGetsResolved(bool targetIsContainer, bool withTunnel, string hostUrlVal, string expectedValue) 187public async Task ContainerHostUrlIgnoresMatchingNonHostEndpoint() 228public async Task HostUrlPropertyGetsResolvedInOtlpExporterEndpoint(bool container, bool withTunnel, string expectedValue) 249public async Task ContainerToContainerEndpointShouldResolve() 276public async Task ContainerToContainerEndpointWithLocalhostNetworkIdentifierShouldResolve() 295public async Task ExpressionResolutionShouldWaitOnMissingAllocatedEndpoint()
ExternalServiceTests.cs (15)
107public async Task ExternalServiceWithHttpsCanBeReferenced() 124public async Task ExternalServiceWithHttpCanBeReferenced() 141public async Task ExternalServiceWithParameterCanBeReferencedInRunMode() 160public async Task ExternalServiceWithParameterCanBeReferencedInPublishMode() 182public async Task ExternalServiceWithInvalidParameterThrowsInRunMode() 202public async Task ExternalServiceEnvironmentWithInvalidParameterThrowsInRunMode() 326public async Task ExternalServiceWithParameterGetValueAsyncErrorMarksAsFailedToStart() 337var appStartTask = app.StartAsync(); 353public async Task ExternalServiceWithParameterInvalidUrlMarksAsFailedToStart() 364var appStartTask = app.StartAsync(); 380public async Task ExternalServiceWithValidParameterMarksAsRunning() 391var appStartTask = app.StartAsync(); 450public async Task ExternalServiceWithParameterHttpHealthCheckResolvesUrlAsync() 479public async Task ExternalServiceWithParameterPublishManifest() 551public async Task ExternalServiceWithPathCanBeReferenced()
Health\FriendlyHealthCheckErrorMessagesTests.cs (4)
18public async Task StaticUriHealthCheck_ReturnsTimeoutMessage() 58public async Task ParameterUriHealthCheck_ReturnsTimeoutMessage() 98public async Task ParameterUriHealthCheck_InvalidUrlReturnsMessage() 133public async Task StaticUriHealthCheck_ReturnsStatusCodeMessage()
Health\ResourceHealthCheckServiceTests.cs (29)
20public async Task ResourcesWithoutHealthCheck_HealthyWhenRunning() 55public async Task ResourcesWithHealthCheck_NotHealthyUntilCheckSucceeds() 99public async Task ResourcesWithHealthCheck_CreationErrorIsReported() 139public async Task ResourcesWithHealthCheck_StopsAndRestartsMonitoringWithResource() 154return Task.CompletedTask; 206public async Task HealthCheckIntervalSlowsAfterSteadyHealthyState() 246public async Task HealthCheckIntervalIncreasesAfterNonHealthyState() 289public async Task HealthCheckIntervalDoesNotSlowBeforeSteadyHealthyState() 334public async Task ResourcesWithoutHealthCheckAnnotationsGetReadyEventFired() 343return Task.CompletedTask; 347var pendingStart = app.StartAsync(); 362public async Task PoorlyImplementedHealthChecksDontCauseMonitoringLoopToCrashout() 378var pendingStart = app.StartAsync().DefaultTimeout(); 391await Task.Delay(100); 399public async Task ResourceHealthCheckServiceDoesNotRunHealthChecksUnlessResourceIsRunning() 420return Task.CompletedTask; 424var pendingStart = app.StartAsync().DefaultTimeout(TestConstants.LongTimeoutDuration); 434await Task.Delay(100); 449await Task.WhenAll([resourceReadyEventFired.Task]).DefaultTimeout(); 457public async Task ResourceHealthCheckServiceOnlyRaisesResourceReadyOnce() 478return Task.CompletedTask; 482var pendingStart = app.StartAsync().DefaultTimeout(); 501await Task.Delay(100); 511public async Task VerifyThatChildResourceWillBecomeHealthyOnceParentBecomesHealthy() 523return Task.CompletedTask; 531return Task.CompletedTask; 535var pendingStart = app.StartAsync(); 562public async Task ResourceNotHealthyIfResourceReadyEventIsRunning() 610public async Task ResourceRemainsUnhealthyIfResourceReadyEventFails()
HealthCheckTests.cs (4)
80public async Task WithHttpHealthCheckResolvesUriFromEndpointDuringCheck() 113public async Task VerifyWithHttpHealthCheckBlocksDependentResources() 133var pendingStart = app.StartAsync(); 153public async Task BuildThrowsOnMissingHealthCheckRegistration()
InteractionServiceTests.cs (51)
21public async Task PromptConfirmationAsync_CompleteResult_ReturnResult() 45public async Task PromptConfirmationAsync_Cancellation_ReturnResult() 70public async Task PromptConfirmationAsync_MultipleCompleteResult_ReturnResult() 121public async Task SubscribeInteractionUpdates_MultipleCompleteResult_ReturnResult() 127var readTask = Task.Run(async () => 164public async Task PublicApis_DashboardDisabled_ThrowErrors() 296public async Task IsAvailable_NonInteractiveScope_FlowsAcrossAsyncCalls() 306await Task.Yield(); 358public async Task PromptInputAsync_ValidationCallbackInvalidData_ReturnErrors() 372return Task.CompletedTask; 395public async Task PromptInputsAsync_MissingRequiredData_ReturnErrors() 418public async Task PromptInputsAsync_ChoiceHasNonOptionValue_ReturnErrors() 441public async Task PromptInputsAsync_ChoiceHasNonOptionValueWithAllowCustomChoice_ReturnValue() 462public async Task PromptInputsAsync_NumberHasNonNumberValue_ReturnErrors() 485public async Task PromptInputsAsync_BooleanHasNonBooleanValue_ReturnErrors() 513public async Task PromptInputsAsync_TextExceedsLimit_ReturnErrors(InputType inputType, int? maxLength) 518static async Task TextExceedsLimitCoreAsync(InputType inputType, int? maxLength, bool success) 850public async Task PromptInputsAsync_WithNamedInputs_ReturnsNamedCollection() 893public async Task PromptInputsAsync_WithDynamicInput_NotDependant_LoadOnPrompt() 900var readTask = Task.Run(async () => 946public async Task PromptInputsAsync_WithDynamicInput_Dependant_LoadOnDependantChange() 953var readTask = Task.Run(async () => 1012public async Task ValidationContext_WithNamedInputs_AllowsNameAccess() 1039return Task.CompletedTask; 1064public async Task DependsOn_DoesNotExist_Error() 1079LoadCallback = c => Task.FromResult<IReadOnlyList<KeyValuePair<string, string>>>(new Dictionary<string, string> 1097public async Task DependsOn_LaterInput_Error() 1112LoadCallback = c => Task.FromResult<IReadOnlyList<KeyValuePair<string, string>>>(new Dictionary<string, string> 1130public async Task PromptProgressAsync_WithWork_CompletesSuccessfully() 1140await Task.Delay(10, ctx.CancellationToken); 1152public async Task PromptProgressAsync_WithWork_CancelledViaButton_ReturnsCanceled() 1165await Task.Delay(Timeout.Infinite, ctx.CancellationToken); 1182public async Task PromptProgressAsync_WithWorkThatHandlesCancellation_CancelledViaButton_ReturnsCanceled() 1199await Task.Delay(Timeout.Infinite, ctx.CancellationToken); 1218public async Task PromptProgressAsync_WithWorkThatHandlesCancellation_ExternallyCancelled_ReturnsCanceled() 1232await Task.Delay(Timeout.Infinite, ctx.CancellationToken); 1252public async Task PromptProgressAsync_WithoutWork_Cancellation_ClosesDialog() 1272public async Task PromptProgressAsync_WithoutWork_ButtonClick_ReturnsCanceled() 1293public async Task PromptProgressAsync_WithoutTitle_CreatesInteraction() 1309private static async Task CompleteInteractionAsync(InteractionService interactionService, int interactionId, InteractionCompletionState state, List<DashboardServiceData.InputDto>? inputs = null) 1347public async Task PromptInputsAsync_FileWithValue_PassesValidation() 1376public async Task PromptInputsAsync_Canceled_CancelsFileUploads() 1400public async Task PromptInputsAsync_FileInputCancellationToken_CancelsFileUploadsBeforeCompletion() 1420public async Task PromptInputsAsync_TextInputComplete_DoesNotUseFileUploadStore() 1444public async Task PromptInputsAsync_TextInputCanceled_DoesNotUseFileUploadStore() 1468public async Task PromptInputsAsync_FileRequiredEmpty_ReturnErrors() 1491public async Task PromptInputsAsync_FileOptionalEmpty_PassesValidation() 1515public async Task PromptInputsAsync_FileCount_ValidatesLimit(bool allowMultipleFiles, int fileCount, bool expectedValid)
KestrelConfigTests.cs (7)
15public async Task SingleKestrelHttpEndpointIsNamedHttpAndOverridesProfile() 51public async Task KestrelHttpEndpointsAreIgnoredWhenFlagIsSet() 132public async Task ExplicitEndpointsResultInKestrelOverridesAtRuntime() 173public async Task VerifyKestrelEndpointManifestGeneration() 209public async Task VerifyMultipleKestrelEndpointsManifestGeneration() 274public async Task VerifyKestrelEnvVariablesGetOmittedFromManifestIfExcluded() 303public async Task VerifyEndpointLevelKestrelProtocol()
Lifecycle\TerminalHostFailureDiagnosticServiceTests.cs (8)
16public async Task FailedToStart_UnhidesHostAndWritesDiagnostic() 57public async Task ExitedWithNonZeroExitCode_UnhidesHostAndWritesDiagnostic() 91public async Task ExitedWithZeroExitCode_DoesNotSurfaceAsFailure() 112await Task.Delay(200, stopCts.Token); 128public async Task NonBundleHostPath_DoesNotSuggestAspireUpdate() 167public async Task RepeatedFailureEvents_OnlyDiagnoseOnce() 205await Task.Delay(150, stopCts.Token); 248private static async Task WaitForUnhideAsync(ResourceNotificationService notifications, IResource host)
ManifestGenerationTests.cs (5)
93public async Task WithContainerRegistryUpdatesContainerImageAnnotationsDuringPublish() 505public async Task ParameterInputDefaultValuesGenerateCorrectly() 552public async Task ContainerFilesAreWrittenToManifest() 594public async Task ContainerFilesWithMultipleSourcesAreWrittenToManifest() 638public async Task ContainerFilesWithMultipleDestinationsAreWrittenToManifest()
MSBuildTests.cs (12)
78public async Task ValidateMetadataSources() 353public async Task CliBundleOptInResolvesExplicitBundlePath() 375public async Task CliBundleOptInResolvesNewestVersionedBundlePath() 399public async Task CliBundleOptInIgnoresTemporaryVersionedBundleDirectories() 445public async Task CliBundleOptInResolvesAspireHomeBundleForSidecarlessCli() 469public async Task CliBundleOptInPreparesMissingBundleBesidePathCli() 585public async Task CliBundleOptInPreservesLiteralPercentCharactersInWindowsCommandShimPath() 649public async Task CliBundleOptInResolvesAspireHomeBundleWithoutCliOnPath() 672public async Task CliBundleOptInResolvesDotNetToolStoreBundleFromShimPath() 708public async Task CliBundleOptInPrefersExistingRepoPathsOverBundlePath() 834public async Task CliBundleDefaultsToFalseForNonCSharpAppHostProject() 867public async Task CliBundleOptInKeepsSdkProjectReferenceMutation()
OperationModesTests.cs (8)
17public async Task VerifyBackwardsCompatibleRunModeInvocation() 28return Task.CompletedTask; 44public async Task VerifyExplicitRunModeInvocation() 57return Task.CompletedTask; 73public async Task VerifyExplicitRunModeWithPublisherInvocation() 86return Task.CompletedTask; 102public async Task VerifyBackwardsCompatiblePublishModeInvocation() 117return Task.CompletedTask;
Orchestrator\ApplicationOrchestratorTests.cs (73)
28public async Task ParentPropertySetOnChildResource() 47var watchResourceTask = Task.Run(async () => 75public async Task ParentAnnotationOnChildResource() 95var watchResourceTask = Task.Run(async () => 123public async Task InitializeResourceEventPublished() 143return Task.CompletedTask; 150return Task.CompletedTask; 170public async Task WithParentRelationshipSetsParentPropertyCorrectly() 195var watchResourceTask = Task.Run(async () => 236public async Task LastWithParentRelationshipWins() 261var watchResourceTask = Task.Run(async () => 294public async Task WithParentRelationshipWorksWithProjects() 313var watchResourceTask = Task.Run(async () => 360public async Task GrandChildResourceWithConnectionString() 390return Task.CompletedTask; 395return Task.CompletedTask; 400return Task.CompletedTask; 411public async Task ConnectionStringAvailableEventPublishesBeforeBeforeResourceStartedEvent() 429return Task.CompletedTask; 434return Task.CompletedTask; 450public async Task ConnectionStringAvailableEventPublishesConnectionStringAndResolvableProperties() 473var watchResourceTask = Task.Run(async () => 513public async Task OnResourceFailedToStart_WithErrorMessage_SetsErrorStyleOnState() 542public async Task OnResourceFailedToStart_WithoutErrorMessage_DoesNotSetErrorStyle() 570public async Task OnResourceStarting_ToolResourceType_TransitionsToStarting() 593public async Task SelfDrivenResourceWaitsForDependencyBeforeStarting() 630public async Task ResourceWaitingOnSelfDrivenResourceWaitsForItToStart() 656var startingTask = events.PublishAsync(new OnResourceStartingContext( 671public async Task WaitIsNotReleasedByAnotherReplicaLeavingWaitingState() 705var startingTask = events.PublishAsync(new OnResourceStartingContext( 722await Task.Delay(TimeSpan.FromMilliseconds(250), TestContext.Current.CancellationToken); 731public async Task WaitingUpdateDoesNotDisturbNotStartedReplicas() 763var startingTask = events.PublishAsync(new OnResourceStartingContext( 780public async Task StartingNotStartedReplicaIsForwardedToDcpWhileSiblingWaits() 814var startingTask = events.PublishAsync(new OnResourceStartingContext( 833public async Task ForceStartingOneReplicaDoesNotReleaseAnotherReplicasWait() 868var startingFirstReplicaTask = events.PublishAsync(new OnResourceStartingContext( 876var startingSecondReplicaTask = events.PublishAsync(new OnResourceStartingContext( 895await Task.Delay(TimeSpan.FromMilliseconds(250), TestContext.Current.CancellationToken); 904public async Task ResourceForcedOutOfWaitingStopsWaitingForItsDependency() 941public async Task ResourceForcedOutOfWaitingImmediatelyStopsWaitingForItsDependency() 972var forceStartTask = Task.Run(async () => 987await Task.Yield(); 1007public async Task ConnectionStringResourceWaitsForReferencedResourceBeforeBecomingAvailable() 1040public async Task ExplicitStartResourceWithoutDcpInstancesReportsWaitingForItsDependency() 1086private static async Task PublishReplicaStatesAsync(ResourceNotificationService notificationService, IResource resource, string state) 1101private static IResourceBuilder<CustomResourceWithWaitSupport> AddSelfDrivenResource(IDistributedApplicationBuilder builder, string name, Task? gate = null) 1126ResourceReadyEvent = new EventSnapshot(Task.CompletedTask) 1188return Task.FromResult(new DeploymentStateSection(sectionName, [], 0)); 1191public Task SaveSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 1193return Task.CompletedTask; 1196public Task ClearAllStateAsync(CancellationToken cancellationToken = default) => Task.CompletedTask; 1198public Task DeleteSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 1200return Task.CompletedTask; 1300public async Task ContainerChildResourcesWithOwnLifetimeDoNotReceiveParentStateChanges() 1347public async Task ProjectChildResourcesWithOwnLifetimeDoNotReceiveParentStateChanges() 1394public async Task WithChildRelationshipUsingResourceBuilderSetsParentPropertyCorrectly() 1418var watchResourceTask = Task.Run(async () => 1451public async Task WithChildRelationshipUsingResourceSetsParentPropertyCorrectly() 1475var watchResourceTask = Task.Run(async () => 1508public async Task WithChildRelationshipWorksWithProjects() 1529var watchResourceTask = Task.Run(async () =>
Orchestrator\ParameterProcessorTests.cs (76)
28public async Task InitializeParametersAsync_WithValidParameters_SetsRunningState() 53public async Task InitializeParametersAsync_WithValidParametersAndDashboardEnabled_SetsRunningState() 79public async Task InitializeParametersAsync_WithSecretParameter_MarksAsSecret() 87var watchTask = Task.Run(async () => 109public async Task InitializeParametersAsync_WithMissingParameterValue_AddsToUnresolvedWhenInteractionAvailable() 125public async Task InitializeParametersAsync_WithMissingParameterValue_SetsExceptionWhenInteractionNotAvailable() 143public async Task InitializeParametersAsync_WithMissingParameterValueAndDashboardEnabled_LeavesUnresolved() 159public async Task InitializeParametersAsync_WithNonMissingParameterException_SetsException() 176public async Task HandleUnresolvedParametersAsync_WithMultipleUnresolvedParameters_CreatesInteractions() 201var handleTask = parameterProcessor.HandleUnresolvedParametersAsync(parameters, CancellationToken.None); 276public async Task InitializeParametersAsync_WhenUserDismissesNotification_WaitsWithoutShowingNotificationAgain() 294var initializeTask = parameterProcessor.InitializeParametersAsync([parameterWithMissingValue], waitForResolution: true); 315public async Task InitializeParametersAsync_WithEmptyParameterList_CompletesSuccessfully() 325public async Task InitializeParametersAsync_WithMissingParameterValue_LogsWarningWithoutException() 352public async Task InitializeParametersAsync_WithNonMissingParameterException_LogsErrorWithException() 376public async Task HandleUnresolvedParametersAsync_WithResolvedParameter_LogsResolutionViaInteraction() 394var handleTask = parameterProcessor.HandleUnresolvedParametersAsync([parameter], CancellationToken.None); 419public async Task HandleUnresolvedParametersAsync_WithParameterDescriptions_CreatesInputsWithDescriptions() 470public async Task HandleUnresolvedParametersAsync_WithSecretParameterWithDescription_CreatesSecretInput() 507public async Task HandleUnresolvedParametersAsync_WhenUserSecretsNotAvailable_ShowsDisabledSaveCheckbox() 546public async Task HandleUnresolvedParametersAsync_WhenUserSecretsAvailable_ShowsEnabledSaveCheckbox() 585public async Task InitializeParametersAsync_WithDistributedApplicationModel_CollectsAndInitializesAllParameters() 617public async Task InitializeParametersAsync_WithDistributedApplicationModel_EmptyModel_CompletesSuccessfully() 631public async Task InitializeParametersAsync_WithDistributedApplicationModel_NoParameterReferences_InitializesExplicitOnly() 658public async Task InitializeParametersAsync_WithDistributedApplicationModel_WithEnvironmentVariableReferences() 684public async Task InitializeParametersAsync_WithDistributedApplicationModel_WaitForResolution_True() 706public async Task InitializeParametersAsync_WithDistributedApplicationModel_WaitForResolution_False() 728public async Task InitializeParametersAsync_WithDistributedApplicationModel_WithMissingParameterValues_HandlesCorrectly() 753public async Task InitializeParametersAsync_WithDistributedApplicationModel_HandlesCircularReferences() 788public async Task InitializeParametersAsync_UsesExecutionContextOptions_DoesNotThrow() 824public async Task InitializeParametersAsync_SkipsResourcesExcludedFromPublish() 864public async Task ProcessParameterAsync_WithInteractionServiceAvailable_AddsSetParameterCommand() 884public async Task ProcessParameterAsync_WithInteractionServiceAvailable_AddsSetParameterValueArgument() 918public async Task ProcessParameterAsync_WithExistingValue_LoadsSetParameterValueArgumentOnStart() 943public async Task ProcessParameterAsync_WithExistingInputValue_DoesNotOverwriteSetParameterValueArgumentOnStart() 969public async Task ProcessParameterAsync_WithSavedState_DefaultsSaveArgumentToTrue() 1011public async Task ProcessParameterAsync_WithoutSavedState_DisablesDeleteParameterUserSecretsArgumentOnStart() 1040public async Task ProcessParameterAsync_WithSavedState_EnablesDeleteParameterUserSecretsArgumentOnStart() 1072public async Task ProcessParameterAsync_WithInteractionServiceNotAvailable_DoesNotAddSetParameterCommand() 1089public async Task SetParameterCoreAsync_WithUserInput_UpdatesParameterValue() 1106public async Task SetParameterCoreAsync_WithMissingInput_ParameterValueUnchanged() 1122public async Task SetParameterCoreAsync_ResolvingLastParameter_CancelsPromptNotification() 1142public async Task SetParameterCoreAsync_CalledTwice_UpdatesPreviousValueAndSavedState() 1163public async Task SetParameterAsync_WithUserInput_UpdatesParameterValueAndSavedState() 1174var setParameterTask = parameterProcessor.SetParameterAsync(parameter, CancellationToken.None); 1190public async Task InitializeParametersAsync_RecordsResolvedSecretValues_ForRedaction() 1210public async Task SetParameterCoreAsync_RecordsReplacedSecretValue_ForRedaction() 1306return Task.FromResult(new DeploymentStateSection(sectionName, [], 0)); 1309public Task SaveSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 1311return Task.CompletedTask; 1314public Task ClearAllStateAsync(CancellationToken cancellationToken = default) => Task.CompletedTask; 1316public Task DeleteSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 1318return Task.CompletedTask; 1353public async Task InitializeParametersAsync_WithGenerateParameterDefaultInPublishMode_DoesNotThrowWhenValueExists() 1390public async Task ConnectionStringParameterStateIsSavedWithCorrectKey() 1410var handleTask = parameterProcessor.HandleUnresolvedParametersAsync(parameters, CancellationToken.None); 1431public async Task RegularParameterStateIsSavedWithCorrectKey() 1451var handleTask = parameterProcessor.HandleUnresolvedParametersAsync(parameters, CancellationToken.None); 1472public async Task CustomConfigurationKeyParameterStateIsSavedWithCorrectKey() 1495var handleTask = parameterProcessor.HandleUnresolvedParametersAsync(parameters, CancellationToken.None); 1516public async Task DeleteParameterCoreAsync_DeletesFromDeploymentState() 1535public async Task DeleteParameterCoreAsync_WithoutDeleteFromUserSecrets_DoesNotDeleteDeploymentState() 1552public async Task DeleteParameterCoreAsync_WhenDeploymentStateDeleteFails_ReturnsFailure() 1570public async Task DeleteParameterCoreAsync_AddsParameterBackToUnresolvedAndStartsResolutionTask() 1599public async Task DeleteParameterAsync_DeletesFromDeploymentState() 1610var setParameterTask = parameterProcessor.SetParameterAsync(parameter, CancellationToken.None); 1620var deleteParameterTask = parameterProcessor.DeleteParameterAsync(parameter, CancellationToken.None); 1665return Task.FromResult(new DeploymentStateSection(sectionName, sectionData, 0)); 1668public Task SaveSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 1679return Task.CompletedTask; 1682public Task ClearAllStateAsync(CancellationToken cancellationToken = default) => Task.CompletedTask; 1684public Task DeleteSectionAsync(DeploymentStateSection section, CancellationToken cancellationToken = default) 1700return Task.CompletedTask;
PersistentContainerWarningTests.cs (3)
18public async Task PersistentContainerWithoutUserSecrets_LogsWarning() 42public async Task PersistentContainerWithUserSecrets_DoesNotLogWarning() 66public async Task SessionContainerWithoutUserSecrets_DoesNotLogWarning()
Pipelines\DistributedApplicationPipelineTests.cs (199)
30public async Task ExecuteAsync_WithNoSteps_CompletesSuccessfully() 40public async Task ExecuteAsync_WithSingleStep_ExecutesStep() 49await Task.CompletedTask; 59public async Task ExecuteAsync_WithMultipleIndependentSteps_ExecutesAllSteps() 68await Task.CompletedTask; 74await Task.CompletedTask; 80await Task.CompletedTask; 93public async Task ExecuteAsync_WithDependsOn_ExecutesInOrder() 102await Task.CompletedTask; 108await Task.CompletedTask; 114await Task.CompletedTask; 124public async Task ExecuteAsync_WithRequiredBy_ExecutesInCorrectOrder() 133await Task.CompletedTask; 139await Task.CompletedTask; 145await Task.CompletedTask; 155public async Task ExecuteAsync_WithMixedDependsOnAndRequiredBy_ExecutesInCorrectOrder() 164await Task.CompletedTask; 170await Task.CompletedTask; 176await Task.CompletedTask; 192public async Task ExecuteAsync_WithMultipleLevels_ExecutesLevelsInOrder() 203await Task.Delay(10); 209await Task.Delay(10); 215return Task.CompletedTask; 221return Task.CompletedTask; 227return Task.CompletedTask; 249public async Task ExecuteAsync_WithPipelineStepFactoryAnnotation_ExecutesAnnotatedSteps() 261await Task.CompletedTask; 269await Task.CompletedTask; 281public async Task ExecuteAsync_WithMultiplePipelineStepAnnotations_ExecutesAllAnnotatedSteps() 295await Task.CompletedTask; 304await Task.CompletedTask; 324pipeline.AddStep("step1", async (context) => await Task.CompletedTask); 326var ex = Assert.Throws<InvalidOperationException>(() => pipeline.AddStep("step1", async (context) => await Task.CompletedTask)); 332public async Task ExecuteAsync_WithUnknownDependency_ThrowsInvalidOperationException() 337pipeline.AddStep("step1", async (context) => await Task.CompletedTask, dependsOn: "unknown-step"); 347public async Task ExecuteAsync_WithUnknownRequiredBy_ThrowsInvalidOperationException() 352pipeline.AddStep("step1", async (context) => await Task.CompletedTask, requiredBy: "unknown-step"); 362public async Task ExecuteAsync_WithCircularDependency_ThrowsInvalidOperationException() 370Action = async (context) => await Task.CompletedTask 377Action = async (context) => await Task.CompletedTask 393public async Task ExecuteAsync_WhenStepThrows_WrapsExceptionWithStepName() 401await Task.CompletedTask; 415public async Task ExecuteAsync_WithComplexDependencyGraph_ExecutesInCorrectOrder() 425await Task.CompletedTask; 431await Task.CompletedTask; 437await Task.CompletedTask; 443await Task.CompletedTask; 449await Task.CompletedTask; 471public async Task ExecuteAsync_WithMultipleDependencies_ExecutesInCorrectOrder() 480await Task.CompletedTask; 486await Task.CompletedTask; 492await Task.CompletedTask; 507public async Task ExecuteAsync_WithMultipleRequiredBy_ExecutesInCorrectOrder() 516await Task.CompletedTask; 522await Task.CompletedTask; 528await Task.CompletedTask; 543public async Task ExecuteAsync_WithUnknownRequiredByStep_ThrowsInvalidOperationException() 550await Task.CompletedTask; 559public async Task ExecuteAsync_WithUnknownRequiredByStepInList_ThrowsInvalidOperationException() 566await Task.CompletedTask; 571await Task.CompletedTask; 585pipeline.AddStep("step1", async (context) => await Task.CompletedTask, dependsOn: 123)); 596pipeline.AddStep("step1", async (context) => await Task.CompletedTask, requiredBy: 123)); 606pipeline.AddStep("step1", async (context) => await Task.CompletedTask); 609pipeline.AddStep("step1", async (context) => await Task.CompletedTask)); 615public async Task ExecuteAsync_WithDuplicateAnnotationStepNames_ThrowsInvalidOperationException() 623Action = async (ctx) => await Task.CompletedTask 630Action = async (ctx) => await Task.CompletedTask 645public async Task ExecuteAsync_WithFailingStep_PreservesOriginalStackTrace() 652await Task.CompletedTask; 670public async Task ExecuteAsync_WithDependencyFailure_ReportsFailedDependency() 680await Task.CompletedTask; 688await Task.CompletedTask; 704public async Task ExecuteAsync_WithCircularDependencyInComplex_ThrowsInvalidOperationException() 713Action = async (context) => await Task.CompletedTask 720Action = async (context) => await Task.CompletedTask 727Action = async (context) => await Task.CompletedTask 745public async Task ExecuteAsync_WithFailure_PreventsOtherStepsFromStarting() 756await Task.Delay(50); 764await Task.CompletedTask; 776public async Task ExecuteAsync_IndependentStepContinuesWhenSiblingFails() 807public async Task ExecuteAsync_IndependentStepIsNotCancelledWhenSiblingFails() 838public async Task ExecuteAsync_DependentStepSkippedButIndependentContinues() 858await Task.CompletedTask; 877public async Task ExecuteAsync_WhenStepThrows_ReportsFailureToActivityReporter() 886await Task.CompletedTask; 907public async Task ExecuteAsync_WhenStepThrowsProcessFailedException_RethrowsWithoutWrapping() 914pipeline.AddStep("failing-step", _ => Task.FromException(expected)); 926public async Task ExecuteAsync_WithDiamondDependency_ExecutesCorrectly() 939await Task.Delay(10); 945await Task.Delay(10); 951await Task.Delay(10); 957await Task.CompletedTask; 992public async Task ExecuteAsync_WithPipelineStepFactoryAnnotation_FactoryReceivesPipelineContextAndResource() 1012await Task.CompletedTask; 1029public async Task WithPipelineStepFactory_SyncOverload_ExecutesStep() 1041await Task.CompletedTask; 1053public async Task WithPipelineStepFactory_AsyncOverload_ExecutesStep() 1061await Task.CompletedTask; 1068await Task.CompletedTask; 1081public async Task WithPipelineStepFactory_MultipleStepsSyncOverload_ExecutesAllSteps() 1095await Task.CompletedTask; 1104await Task.CompletedTask; 1118public async Task WithPipelineStepFactory_MultipleStepsAsyncOverload_ExecutesAllSteps() 1126await Task.CompletedTask; 1135await Task.CompletedTask; 1144await Task.CompletedTask; 1159public async Task ExecuteAsync_WithPipelineLoggerProvider_LogsToStepLogger() 1174return Task.CompletedTask; 1190public async Task ExecuteAsync_PipelineLoggerProvider_IsolatesLoggingBetweenSteps() 1208await Task.CompletedTask; 1220return Task.CompletedTask; 1247public async Task ExecuteAsync_WhenStepFails_PipelineLoggerIsCleanedUp() 1283public async Task ExecuteAsync_PipelineLoggerProvider_PreservesLoggerAfterStepCompletion() 1306return Task.CompletedTask; 1347public async Task ExecuteAsync_PipelineLoggerProvider_RespectsPipelineLogLevelConfiguration( 1379return Task.CompletedTask; 1403public async Task PipelineStep_WithTags_StoresTagsCorrectly() 1408Action = async (ctx) => await Task.CompletedTask, 1418public async Task ExecuteAsync_WithConfigurationCallback_ExecutesCallback() 1426pipeline.AddStep("step1", async (context) => await Task.CompletedTask); 1427pipeline.AddStep("step2", async (context) => await Task.CompletedTask); 1433return Task.CompletedTask; 1461public async Task ExecuteAsync_ConfigurationCallback_CanModifyDependencies() 1471await Task.CompletedTask; 1477await Task.CompletedTask; 1485return Task.CompletedTask; 1495public async Task PipelineConfigurationContext_GetStepsByTag_ReturnsCorrectSteps() 1505Action = async (ctx) => await Task.CompletedTask, 1512Action = async (ctx) => await Task.CompletedTask, 1519Action = async (ctx) => await Task.CompletedTask, 1526return Task.CompletedTask; 1539public async Task PipelineConfigurationContext_GetStepsByResource_ReturnsCorrectSteps() 1552Action = async (ctx) => await Task.CompletedTask 1557Action = async (ctx) => await Task.CompletedTask 1568Action = async (ctx) => await Task.CompletedTask 1589public async Task PipelineConfigurationContext_GetStepsByResourceAndTag_ReturnsCorrectSteps() 1601Action = async (ctx) => await Task.CompletedTask, 1607Action = async (ctx) => await Task.CompletedTask, 1629public async Task WithPipelineConfiguration_AsyncOverload_ExecutesCallback() 1638await Task.CompletedTask; 1650public async Task WithPipelineConfiguration_SyncOverload_ExecutesCallback() 1670public async Task ConfigurationCallback_CanAccessModel() 1691public async Task ConfigurationCallback_ExecutesAfterStepCollection() 1701Action = async (ctx) => await Task.CompletedTask 1711pipeline.AddStep("direct-step", async (context) => await Task.CompletedTask); 1728public async Task ConfigurationCallback_CanCreateComplexDependencyRelationships() 1741await Task.CompletedTask; 1752await Task.CompletedTask; 1763await Task.CompletedTask; 1774await Task.CompletedTask; 1801return Task.CompletedTask; 1818public async Task ExecuteAsync_WithNonExistentStepFilter_ThrowsInvalidOperationExceptionWithAvailableSteps() 1824pipeline.AddStep("step1", async (context) => await Task.CompletedTask); 1825pipeline.AddStep("step2", async (context) => await Task.CompletedTask); 1826pipeline.AddStep("step3", async (context) => await Task.CompletedTask); 1839public async Task ExecuteAsync_WithStepFilterAndComplexDependencies_ExecutesTransitiveClosure() 1850await Task.CompletedTask; 1856await Task.CompletedTask; 1862await Task.CompletedTask; 1868await Task.CompletedTask; 1874await Task.CompletedTask; 1880await Task.CompletedTask; 1907public async Task ExecuteAsync_WithStepFilterForIndependentStep_ExecutesOnlyThatStep() 1918await Task.CompletedTask; 1924await Task.CompletedTask; 1930await Task.CompletedTask; 1943public async Task FilterStepsForExecution_WithRequiredBy_IncludesTransitiveDependencies() 1964return Task.CompletedTask; 1973return Task.CompletedTask; 1982return Task.CompletedTask; 1991return Task.CompletedTask; 2008public async Task ProcessParametersStep_ValidatesBehavior() 2043return Task.CompletedTask; 2078public async Task ExecuteAsync_PassesStepHierarchyMetadataToActivityReporter() 2084pipeline.AddStep("root", _ => Task.CompletedTask); 2085pipeline.AddStep("child", _ => Task.CompletedTask, dependsOn: "root"); 2086pipeline.AddStep("grandchild", _ => Task.CompletedTask, dependsOn: "child"); 2098public async Task PushPrereq_SkipsRegistryCheckForNonDockerImageFormat() 2123public async Task PushPrereq_ThrowsForDockerImageFormatWithoutRegistry() 2150public async Task PushPrereq_ThrowsForDefaultImageFormatWithoutRegistry() 2171public async Task PushPrereq_ThrowsForArchiveDestinationWithoutOutputPath() 2199public async Task PushPrereq_SkipsExcludedFromManifestResources() 2234public async Task ResolveStepsAsync_ReturnsAllSteps() 2239pipeline.AddStep("custom-step", _ => Task.CompletedTask); 2251public async Task ResolveStepsAsync_NormalizesRequiredByToDependsOn() 2259Action = _ => Task.CompletedTask, 2273public async Task ResolveStepsAsync_PreservesTags() 2281Action = _ => Task.CompletedTask, 2294public async Task ResolveStepsAsync_DoesNotExecuteStepActions() 2303return Task.CompletedTask; 2317new() { Name = "deploy", Action = _ => Task.CompletedTask, DependsOnSteps = { "build" } }, 2318new() { Name = "build", Action = _ => Task.CompletedTask, DependsOnSteps = { "init" } }, 2319new() { Name = "init", Action = _ => Task.CompletedTask } 2337new() { Name = "c-step", Action = _ => Task.CompletedTask }, 2338new() { Name = "a-step", Action = _ => Task.CompletedTask }, 2339new() { Name = "b-step", Action = _ => Task.CompletedTask } 2377public async Task Clone_ResolveStepsOnClone_DoesNotMutateOriginalPipeline() 2392Action = _ => Task.CompletedTask,
Pipelines\PipelineLoggerProviderTests.cs (9)
85public async Task CurrentLogger_IsAsyncLocal_IsolatedBetweenTasks() 94var task1 = Task.Run(async () => 102var task2 = Task.Run(async () => 110await Task.WhenAll(task1, task2); 141public Task CompleteAsync(string statusText, CompletionState completionState, CancellationToken cancellationToken = default) 146public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 151public Task FailAsync(string errorText, CancellationToken cancellationToken = default)
ProjectResourceBuilderExtensionTests.cs (3)
143public async Task WithProjectDefaultsAddsHttpsCertificateConfigurationForTlsEndpoints() 172public async Task WithProjectDefaultsRemovesStaleKestrelCertificatePassword() 197public async Task WithProjectDefaultsDoesNotAddHttpsCertificateConfigurationWithoutTlsEndpoints()
ProjectResourceTests.cs (16)
33public async Task AddProjectWithTrailingCommasInLaunchSettingsDoesNotThrow() 77public async Task AddProjectWithInvalidLaunchSettingsShouldThrowSpecificError() 119public async Task AddProjectAddsEnvironmentVariablesAndServiceMetadata(string dashboardOtlpGrpcEndpointUrlKey) 230public async Task AddProjectAddsEnvironmentVariablesAndServiceMetadata_OtlpAuthDisabledSetting(string? value, bool hasHeader) 358public async Task AspNetCoreUrlsNotInjectedInPublishMode() 381public async Task ExcludeLaunchProfileAddsHttpOrHttpsEndpointAddsToEnv() 425public async Task ExcludeLaunchProfileAddsHttpOrHttpsEndpointAddsToEnvWithEndpointNameFilter() 468public async Task NoEndpointsDoesNotAddAspNetCoreUrls() 489public async Task ProjectWithLaunchProfileAddsHttpOrHttpsEndpointAddsToEnv() 514public async Task ProjectWithMultipleLaunchProfileAppUrlsGetsAllUrls() 562public async Task VerifyManifest(bool disableForwardedHeaders) 613public async Task VerifyManifestWithArgs() 662public async Task AddProjectWithArgs() 702public async Task AddProjectWithWildcardUrlInLaunchSettings(bool isProxied) 819public async Task ProjectResource_AutomaticallyGeneratesBuildStep_WithCorrectDependencies() 885public async Task ProjectResourceWithContainerFilesDestinationAnnotationWorks()
PublishAsConnectionStringTests.cs (1)
13public async Task PublishAsConnectionStringConfiguresManifestAsParameter()
PublishAsDockerfileTests.cs (7)
15public async Task PublishAsDockerFileConfiguresManifestWithoutBuildArgs() 53public async Task PublishAsDockerFileConfiguresManifestWithBuildArgs() 106public async Task PublishAsDockerFileConfiguresManifestWithBuildArgsThatHaveNoValue() 151public async Task PublishAsDockerFileConfigureContainer() 213public async Task PublishProjectAsDockerFile() 493public async Task ManifestPublishingProjectWithoutMetadataIncludesResourceName() 503public async Task ManifestPublishingContainerWithoutImageNameIncludesResourceName()
Publishing\ContainerRuntimeBaseTests.cs (4)
17public async Task ExecuteContainerCommandAsync_IncludesCapturedOutputInFailureMessage() 38return Task.FromResult(true); 41public override Task BuildImageAsync(string contextPath, string dockerfilePath, ContainerImageBuildOptions? options, Dictionary<string, string?> buildArguments, Dictionary<string, BuildImageSecretValue> buildSecrets, string? stage, CancellationToken cancellationToken) 46public Task RunFailingCommandAsync(CancellationToken cancellationToken = default)
Publishing\ContainerRuntimeResolverTests.cs (4)
30public async Task ResolveAsync_ReturnsSameInstance_OnSubsequentCalls() 41public async Task ResolveAsync_ReturnsSameTask_WhenCached() 53public async Task ResolveAsync_ConfiguredRuntime_ReturnsKeyedService() 63public async Task ResolveAsync_AfterCancellation_RetriesWithNewToken()
Publishing\DeploymentStateManagerTests.cs (20)
24public async Task AcquireSectionAsync_ReturnsEmptySection_WhenStateIsNew() 38public async Task SaveSectionAsync_IncrementsVersion_AfterSave() 55public async Task SaveSectionAsync_ThrowsException_WhenVersionConflictDetected() 85public async Task MultipleSections_CanBeModified_Independently() 108public async Task ConcurrentSaves_ToDifferentSections_AreSerializedToStorage() 112var tasks = new List<Task>(); 118tasks.Add(Task.Run(async () => 126await Task.WhenAll(tasks); 138public async Task AcquireSectionAsync_UsesExclusiveLock_OnFirstLoad() 158public async Task DataPersists_AcrossSessions_ButVersionsAreInstanceSpecific() 194public async Task StateSection_Dispose_ReleasesLock() 206public async Task BackwardCompatibility_LoadsStateWithoutMetadata() 224public async Task AcquireSectionAsync_WithNestedPath_ReturnsCorrectSection() 241public async Task SaveSectionAsync_WithNestedPath_CreatesIntermediateObjects() 258public async Task NestedSections_CanBeModified_Independently() 279public async Task NestedSections_CanBeModified_UsingSetValue() 295public async Task NestedSection_VersionConflict_ThrowsException() 321public async Task AcquireSectionAsync_WithNonexistentNestedPath_ReturnsEmptySection() 335public async Task MixedTopLevelAndNestedSections_WorkCorrectly() 356public async Task SaveStateAsync_CreatesDirectory_WithUserOnlyPermissions()
Publishing\PipelineActivityReporterTests.cs (52)
24public async Task CreateStepAsync_CreatesStepAndEmitsActivity() 55public async Task CreateStepAsync_WithHierarchyMetadata_EmitsMetadataOnCreateAndComplete() 81public async Task CreateStepAsync_WithParentStepTitle_ResolvesParentStepId() 103public async Task CreateTaskAsync_CreatesTaskAndEmitsActivity() 142public async Task CreateTaskAsync_ThrowsWhenStepDoesNotExist() 156public async Task CreateTaskAsync_ThrowsWhenStepIsComplete() 176public async Task CompleteStepAsync_CompletesStepWithCorrectErrorStateAndEmitsActivity(bool isError, string completionText, bool expectedIsError) 206public async Task UpdateTaskAsync_UpdatesTaskAndEmitsActivity() 238public async Task UpdateTaskAsync_ThrowsWhenParentStepDoesNotExist() 260public async Task UpdateTaskAsync_ThrowsWhenParentStepIsComplete() 278public async Task CompleteTaskAsync_CompletesTaskWithCorrectStateAndEmitsActivity() 314public async Task CompleteTaskAsync_ThrowsWhenParentStepIsComplete() 335public async Task CompletePublishAsync_EmitsCorrectActivity(CompletionState completionState, string expectedStatusText, bool expectedIsError) 355public async Task CompletePublishAsync_EmitsCorrectActivity_WithCompletionMessage() 375public async Task CompletePublishAsync_AggregatesStateFromSteps() 413public async Task CompleteTaskAsync_WithNullCompletionMessage_SetsEmptyString() 430public async Task CompleteTaskAsync_IdempotentWhenCompletedWithSameState() 455public async Task CompleteTaskAsync_IdempotentWhenCompletedWithDifferentState() 480public async Task CompleteStepAsync_IdempotentWhenCompletedWithSameState() 505public async Task CompleteStepAsync_IdempotentWhenCompletedWithDifferentState() 530public async Task CompleteStepAsync_KeepsStepInDictionaryForAggregation() 563public async Task HandleInteractionUpdateAsync_AllowsInteractionWhenStepsInProgress() 590public async Task CompleteInteractionAsync_WithName_ProcessesUserResponsesCorrectly() 619public async Task CompleteInteractionAsync_WithoutName_ProcessesUserResponsesCorrectly() 648public async Task CompleteInteractionAsync_MatchingFileResponse_UsesAuthoritativeMetadata() 688public async Task CompleteInteractionAsync_OmittedFileResponse_Throws() 712public async Task PromptNotificationAsync_EmitsCorrectActivityAndHandlesCompletion() 752public async Task CalculateAggregatedState_WithNoTasks_ReturnsCompleted() 767public async Task DisposeAsync_StepWithNoTasks_CompletesWithSuccessState() 795public async Task DisposeAsync_StepWithCompletedTasks_CompletesWithSuccessState() 829public async Task DisposeAsync_StepAlreadyCompleted_DoesNotCompleteAgain() 852public async Task CompleteWithWarningAsync_CompletesTaskWithWarningAndEmitsActivity() 887public async Task FailAsync_CompletesTaskWithErrorAndEmitsActivity() 925public async Task CompletePublishAsync_WithDeployFlag_EmitsCorrectActivity(CompletionState completionState, string expectedStatusText, bool expectedIsError) 945public async Task CompletePublishAsync_WithDeployFlag_EmitsCorrectActivity_WithCompletionMessage() 965public async Task CompletePublishAsync_WithPipelineSummary_IncludesSummaryInActivity() 999public async Task CompletePublishAsync_WithNullPipelineSummary_OmitsSummaryFromActivity() 1016public async Task CreateStepAsync_WithMarkdownText_PreservesMarkdown() 1038public async Task CreateTaskAsync_WithMarkdownText_PreservesMarkdown() 1063public async Task Log_LogsMessageAndEmitsActivity() 1095public async Task Log_DoesNothingWhenStepIsComplete() 1115public async Task CompleteTaskAsync_WithMarkdownCompletionMessage_PreservesMarkdown() 1143public async Task CreateTaskAsync_WithMarkdownString_SetsEnableMarkdownTrue() 1163public async Task UpdateTaskAsync_WithMarkdownString_SetsEnableMarkdownTrue() 1183public async Task CompleteTaskAsync_WithMarkdownString_SetsEnableMarkdownTrue() 1203public async Task CompleteStepAsync_WithMarkdownString_SetsEnableMarkdownTrue() 1222public async Task CompleteTaskAsync_IdempotentWithWarning() 1247public async Task CompleteTaskAsync_IdempotentWithError() 1272public async Task CompleteStepAsync_IdempotentWithWarning() 1296public async Task CompleteStepAsync_IdempotentWithError() 1326public async Task CompleteTaskAsync_IdempotentWhenTransitioningBetweenTerminalStates(CompletionState firstState, CompletionState secondState) 1357public async Task CompleteStepAsync_IdempotentWhenTransitioningBetweenTerminalStates(CompletionState firstState, CompletionState secondState)
Publishing\PipelineExecutorTests.cs (6)
18public async Task ListStepsDoesNotRunLifecycleCallbacksOrExecutePipeline() 31return Task.CompletedTask; 39return Task.CompletedTask; 47return Task.CompletedTask; 64public Task BeforeStartAsync(DistributedApplicationModel appModel, CancellationToken cancellationToken = default) 67return Task.CompletedTask;
Publishing\PodmanSaveArgumentsTests.cs (7)
88public async Task BuildSaveArguments_ArchivePathMatchesContainerImageReference() 153public async Task BuildImageAsync_OciFormatWithoutOutputPath_ThrowsBeforeBuild(string? outputPath) 174public async Task BuildImageAsync_WithoutOutputPath_DoesNotSave(string? outputPath) 194public async Task BuildImageAsync_WithOutputPath_BuildsThenSaves() 217public async Task BuildImageAsync_WhenBuildFails_DoesNotSave() 238public async Task BuildImageAsync_WhenSaveFails_ThrowsProcessFailedException() 265private static Task BuildImageAsync(PodmanContainerRuntime runtime, ContainerImageBuildOptions options)
Publishing\PublishingExtensionsTests.cs (6)
19public async Task PublishingStepExtensions_CreateTask_WorksCorrectly() 38public async Task PublishingStepExtensions_Succeed_WorksCorrectly() 56public async Task PublishingTaskExtensions_UpdateStatus_WorksCorrectly() 75public async Task PublishingTaskExtensions_Succeed_WorksCorrectly() 93public async Task PublishingTaskExtensions_Warn_WorksCorrectly() 111public async Task PublishingTaskExtensions_Fail_WorksCorrectly()
Publishing\ResourceContainerImageManagerTests.cs (40)
23public async Task CanBuildImageFromProjectResource() 52public async Task CanBuildImageFromProjectResourceWithCustomBaseImage() 85public async Task CanBuildImageFromDockerfileResource() 119public async Task CanBuildImageFromProjectResourceWithOptions() 158public async Task CanBuildImageFromProjectResource_WithDockerImageFormat() 188public async Task CanBuildImageFromProjectResource_WithLinuxArm64Platform() 218public async Task CanBuildImageFromDockerfileResource_WithCustomOutputPath() 260public async Task CanBuildImageFromDockerfileResource_WithAllOptionsSet() 307public async Task CanBuildImageFromProjectResource_WithDifferentImageFormats(ContainerImageFormat imageFormat) 339public async Task CanBuildImageFromProjectResource_WithDifferentTargetPlatforms(ContainerTargetPlatform targetPlatform) 369public async Task BuildImageAsync_WithNullOptions_UsesDefaults() 415public async Task CanBuildImageFromDockerfileResource_WithTrailingSlashContextPath() 452public async Task PushImageAsync_CallsContainerRuntimePushImage() 476public async Task PushImageAsync_ThrowsWhenContainerRuntimeFails() 499public async Task BuildImagesAsync_WithOnlyProjectResourcesAndOci_DoesNotNeedContainerRuntime() 534public async Task BuildImagesAsync_WithDockerfileResources_ChecksContainerRuntimeHealth() 565public async Task BuildImageAsync_NormalizesContextPathWithTrailingSlashes() 607public async Task BuildImageAsync_ThrowsInvalidOperationException_WhenDockerRuntimeNotAvailable() 642public async Task BuildImageAsync_ProjectBuildFailureIncludesResourceName() 677public async Task BuildImageAsync_ProjectBuildPassesResolvedContainerRuntimeAsLocalRegistry() 717public async Task CanBuildImageFromDockerfileWithBuildArgsSecretsAndStage() 779public async Task CanResolveBuildArgumentsWithDifferentValueTypes() 869public async Task ResolveValue_FormatsDecimalWithInvariantCulture() 889public async Task CanResolveBuildSecretsWithDifferentValueTypes() 936public async Task CanResolveBuildSecretsWithFileType() 1042public async Task MultipleAnnotations_AppliedInOrder() 1079public async Task LaterAnnotation_OverridesEarlierAnnotation() 1118public async Task ProjectResource_HasDefaultAnnotation() 1144public async Task DockerfileResource_HasDefaultAnnotation() 1179public async Task DockerfileResource_RunMode_DefaultLeavesPlatformUnset() 1208public async Task DockerfileResource_WithCustomImageName_UsesCustomValues() 1254public async Task ContainerBuildOptionsCallbackAnnotation_AsyncCallback_IsSupported() 1267await Task.Delay(1); 1285public async Task ContainerBuildOptionsContext_HasCorrectResourceAndServices() 1320public async Task BuildImagesAsync_WithArchiveDestinationOnlyResources_DoesNotCheckContainerRuntime() 1372public async Task BuildImagesAsync_WithRegistryDestination_ChecksContainerRuntime() 1408public async Task BuildImageAsync_DockerfileResource_RequiresContainerRuntime() 1443public async Task BuildImagesAsync_MixedDestinations_ChecksRuntimeWhenAnyResourceNeedsIt() 1486public async Task BuildImagesAsync_NoDestinationSet_ChecksContainerRuntime() 1520public async Task ContainerBuildFailureIncludesProcessOutputInException()
ReferenceExpressionTests.cs (4)
75public async Task ReferenceExpressionWithBracketsAndInterpolation() 86public async Task ReferenceExpressionWithEscapedBracketsAndInterpolation() 97public async Task ReferenceExpressionIsUrlEncoded() 107public async Task ReferenceExpressionBuilderSupportsNullFormat()
RequiredCommandAnnotationTests.cs (25)
44ctx => Task.FromResult(RequiredCommandValidationResult.Success()); 89ctx => Task.FromResult(RequiredCommandValidationResult.Success()); 132public async Task RequiredCommandValidationEventingSubscriber_IsRegistered() 143public async Task RequiredCommandValidationEventingSubscriber_ValidatesExistingCommand() 160public async Task RequiredCommandValidationEventingSubscriber_LogsWarningForMissingCommand() 177public async Task RequiredCommandValidationEventingSubscriber_IncludesHelpLinkInWarning() 195public async Task RequiredCommandValidationEventingSubscriber_CallsValidationCallback() 205return Task.FromResult(RequiredCommandValidationResult.Success()); 220public async Task RequiredCommandValidationEventingSubscriber_CallsValidationCallbackWithContext() 232return Task.FromResult(RequiredCommandValidationResult.Success()); 248public async Task RequiredCommandValidationEventingSubscriber_LogsWarningOnFailedValidationCallback() 256return Task.FromResult(RequiredCommandValidationResult.Failure("Custom validation failed")); 271public async Task RequiredCommandValidationEventingSubscriber_ValidatesMultipleAnnotations() 292public async Task RequiredCommandValidationEventingSubscriber_CoalescesNotificationsForSameCommand() 314public async Task RequiredCommandValidationEventingSubscriber_CachesSuccessfulValidation() 323return Task.FromResult(RequiredCommandValidationResult.Success()); 347public async Task RequiredCommandValidationLifecycleHook_DoesNotCacheAcrossDifferentValidationCallbacks() 357return Task.FromResult(RequiredCommandValidationResult.Success()); 364return Task.FromResult(RequiredCommandValidationResult.Success()); 382public async Task RequiredCommandValidationEventingSubscriber_CallsInteractionServiceForMissingCommand() 400var publishTask = eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 414public async Task RequiredCommandValidationEventingSubscriber_DoesNotCallInteractionServiceWhenUnavailable() 438public async Task RequiredCommandValidationEventingSubscriber_CoalescesInteractionServiceCalls() 458var publishTask1 = eventing.PublishAsync(new BeforeResourceStartedEvent(resource1, app.Services)); 498private static async Task SubscribeHooksAsync(DistributedApplication app)
ResourceCommandServiceTests.cs (91)
29public async Task ExecuteCommandAsync_NoMatchingResource_Failure() 48public async Task ExecuteCommandAsync_ResourceNameMultipleMatches_Failure() 71public async Task ExecuteCommandAsync_NoMatchingCommand_Failure() 90public async Task ExecuteCommandAsync_NoMatchingCommand_SingleInstance_MessageUsesDisplayName() 109public async Task ExecuteCommandAsync_NoMatchingCommand_HasReplicas_MessageUsesResourceId() 131public async Task ExecuteCommandAsync_ResourceNameMultipleMatches_Success() 168public async Task ExecuteCommandAsync_HasReplicas_Success_CalledPerReplica() 210public async Task ExecuteCommandAsync_HasReplicas_Failure_CalledPerReplica() 224return Task.FromResult(new ExecuteCommandResult { Success = false, Message = "Failure!" }); 249public async Task ExecuteCommandAsync_Canceled_Success() 259return Task.FromResult(CommandResults.Canceled()); 275public async Task ExecuteCommandAsync_HasReplicas_Canceled_CalledPerReplica() 289return Task.FromResult(CommandResults.Canceled()); 305public async Task ExecuteCommandAsync_HasReplicas_MixedFailureAndCanceled_OnlyFailuresInErrorMessage() 322return Task.FromResult(count switch 360public async Task ExecuteCommandAsync_OperationCanceledException_Canceled() 386public async Task ExecuteCommandAsync_CommandException_Failure() 408public async Task ExecuteCommandAsync_LegacyCommandName_FallsBackToCurrentName() 416executeCommand: _ => Task.FromResult(new ExecuteCommandResult { Success = true })); 429public async Task ExecuteCommandAsync_LegacyCommandName_ById_FallsBackToCurrentName() 437executeCommand: _ => Task.FromResult(new ExecuteCommandResult { Success = true })); 452public async Task ExecuteCommandAsync_LegacyParameterCommandName_FallsBackToCurrentName(string currentCommandName, string legacyCommandName) 459executeCommand: _ => Task.FromResult(new ExecuteCommandResult { Success = true })); 470public async Task ExecuteCommandAsync_SuccessWithResult_ReturnsResultData() 477executeCommand: _ => Task.FromResult(CommandResults.Success("Generated token.", "{\"token\": \"abc123\"}", CommandResultFormat.Json))); 491public async Task ExecuteCommandAsync_SuccessWithoutResult_ReturnsNoResultData() 498executeCommand: _ => Task.FromResult(CommandResults.Success())); 510public async Task ExecuteCommandAsync_WithArgumentCollection_PassesArgumentsToCommand() 521return Task.FromResult(CommandResults.Success()); 568public async Task ExecuteCommandAsync_WithArgumentValuesAndResource_PassesArgumentsToCommand() 579return Task.FromResult(CommandResults.Success()); 609public async Task ExecuteCommandAsync_WithArgumentValuesAndResource_DoesNotRequirePublishedResourceState() 620return Task.FromResult(CommandResults.Success()); 649public async Task ExecuteCommandAsync_SecretTextArgument_PreservesWhitespace() 660return Task.FromResult(CommandResults.Success()); 696public async Task CreateCommandArguments_WithOrderedArgumentValues_MapsArgumentsByOrder() 703executeCommand: _ => Task.FromResult(CommandResults.Success()), 741public async Task CreateCommandArguments_TooManyOrderedArgumentValues_ReturnsError() 748executeCommand: _ => Task.FromResult(CommandResults.Success()), 772public async Task CreateCommandArguments_UnknownNamedArgumentValues_ReturnsError() 779executeCommand: _ => Task.FromResult(CommandResults.Success()), 803public async Task CreateCommandArguments_DisabledNamedArgumentValues_ReturnsError() 810executeCommand: _ => Task.FromResult(CommandResults.Success()), 835public async Task CreateCommandArguments_DynamicDisabledNamedArgumentValues_DoesNotReturnError() 842executeCommand: _ => Task.FromResult(CommandResults.Success()), 858return Task.CompletedTask; 876public async Task CreateCommandArguments_DisabledOrderedArgumentValues_ReturnsError() 883executeCommand: _ => Task.FromResult(CommandResults.Success()), 908public async Task ExecuteCommandAsync_NoArguments_PassesEmptyArgumentsToCommand() 919return Task.FromResult(CommandResults.Success()); 933public async Task ExecuteCommandAsync_InvalidBuiltInArgumentValidation_DoesNotExecuteCommand() 944return Task.FromResult(CommandResults.Success()); 975public async Task ExecuteCommandAsync_LoadsDependentChoiceOptionsBeforeBuiltInValidation() 987return Task.FromResult(CommandResults.Success()); 1014return Task.CompletedTask; 1049public async Task ExecuteCommandAsync_SubmittedDynamicArgumentStillDisabledAfterLoading_ReturnsDisabledValidationError() 1060return Task.FromResult(CommandResults.Success()); 1087return Task.CompletedTask; 1104return Task.CompletedTask; 1141public async Task ExecuteCommandAsync_LoadedDynamicArgumentStillDisabledWithDefaultValue_DoesNotReturnDisabledValidationError() 1152return Task.FromResult(CommandResults.Success()); 1179return Task.CompletedTask; 1211public async Task ExecuteCommandAsync_UnknownNamedArgumentValues_DoesNotExecuteCommand() 1222return Task.FromResult(CommandResults.Success()); 1258public async Task ExecuteCommandAsync_InteractiveWithoutArguments_PromptsForArguments() 1272return Task.FromResult(CommandResults.Success()); 1314public async Task ExecuteCommandAsync_InteractiveDisabledDynamicArgumentWithDefaultValue_Succeeds() 1329return Task.FromResult(CommandResults.Success()); 1354return Task.CompletedTask; 1386public async Task ExecuteCommandAsync_NonInteractiveWithoutArguments_DoesNotPrompt() 1400return Task.FromResult(CommandResults.Success()); 1435public async Task ExecuteCommandAsync_NonInteractive_IsAvailableReturnsFalse() 1447return Task.FromResult(CommandResults.Success()); 1465public async Task ExecuteCommandAsync_Interactive_IsAvailableNotAffectedByScope() 1477return Task.FromResult(CommandResults.Success()); 1501public async Task ExecuteCommandAsync_PartialArgumentCollection_ValidatesMissingDeclaredArguments() 1512return Task.FromResult(CommandResults.Success()); 1557public async Task ExecuteCommandAsync_InvalidCustomArgumentValidation_DoesNotExecuteCommand() 1568return Task.FromResult(CommandResults.Success()); 1587return Task.CompletedTask; 1605public async Task ExecuteCommandAsync_HasReplicas_SuccessWithResult_ReturnsFirstResultData() 1620return Task.FromResult(CommandResults.Success("Generated token.", $"token-{count}", CommandResultFormat.Text)); 1635public async Task ExecuteCommandAsync_RebuildCommand_ReturnsBuildOutput() 1725public async Task ExecuteCommandAsync_WithProgressOptions_CancelsCommandWhenProgressCanceled() 1739await Task.Delay(Timeout.Infinite, e.CancellationToken); 1770public async Task ExecuteCommandAsync_WithProgressOptions_ReturnsCanceledWhenCommandHandlesProgressCancellation() 1787await Task.Delay(Timeout.Infinite, e.CancellationToken); 1820public async Task ExecuteCommandAsync_WithProgressOptions_SkipsProgressWhenNotAvailable() 1835return Task.FromResult(CommandResults.Success("Done")); 1854public async Task ExecuteCommandAsync_WithProgressOptions_SuccessPathPropagatesResult() 1866return Task.FromResult(CommandResults.Success("Operation completed successfully."));
ResourceDependencyTests.cs (53)
15public async Task DirectReferenceViaWithReferenceIsIncluded() 30public async Task EndpointReferenceViaWithEnvironmentIsIncluded() 47public async Task EndpointPropertyReferenceIsIncluded() 64public async Task HostUrlDependencyOnlyIncludesMatchingHostEndpoint() 104public async Task ConnectionStringReferenceIsIncluded() 122public async Task ConnectionStringRedirectIsIncluded() 141public async Task ParentRelationshipIsIncluded() 155public async Task WaitForDependencyIsIncluded() 170public async Task WaitForCompletionDependencyIsIncluded() 185public async Task ParameterInEnvironmentIsIncluded() 200public async Task ParameterInArgsIsIncluded() 217public async Task ParameterInLaunchToolArgsIsIncluded(bool cacheAnnotationCallbackResults) 238public async Task PeekCachedCallbackResultsOnly_OnlySeesCachedResultsAndNeverInvokesCallback() 277public async Task OnlyLastLaunchToolArgsAnnotationContributesDependencies() 296public async Task LaunchToolArgsOnContainerDoNotContributeDependencies() 313public async Task ReferenceExpressionWithMultipleResourcesIncludesAll() 333public async Task TransitiveDependenciesAreIncluded() 352public async Task TransitiveDependenciesUsingArgsAreInclude() 371public async Task TransitiveDependenciesUsingEnvironmentAreIncluded() 392public async Task DiamondDependenciesAreDeduplicatedAndIncludeAll() 414public async Task DeepChainDependenciesAreIncluded() 435public async Task CircularReferencesAreHandled() 457public async Task MixedReferenceTypesToSameResourceIsDeduplicatedAndIncluded() 477public async Task WaitForChildAlsoIncludesParent() 495public async Task UnrelatedResourceIsNotIncluded() 511public async Task InputResourceIsExcludedFromOwnDependencies() 524public async Task ResourceThatDependsOnInputIsNotIncluded() 540public async Task SiblingResourceUnderSameParentIsNotIncluded() 556public async Task ResourceOnlyReferencedByThirdResourceIsNotIncluded() 575public async Task ResourceWithZeroDependenciesReturnsEmptySet() 588public async Task MultipleWaitAnnotationsForSameTargetAreDeduplicatedAndIncluded() 605public async Task DirectOnlyExcludesTransitiveDependencies() 625public async Task TransitiveClosureIncludesAllDependencies() 645public async Task DirectOnlyWithDeepChainOnlyIncludesDirectDependency() 671public async Task DirectOnlyIncludesReferencedResourcesFromConnectionString() 691public async Task DirectOnlyDoesNotIncludeWaitForDependenciesFromReferencedResources() 716public async Task DefaultOverloadUsesTransitiveClosure() 740public async Task MultiResourceIndependentResourcesDependenciesAreMerged() 762public async Task MultiResourceOverlappingDependenciesAreDeduplicatedAndCombined() 781public async Task MultiResourceInputResourceExcludedEvenIfOtherInputDependsOnIt() 802public async Task MultiResourceTransitiveDependencyThroughInputIsStillIncluded() 826public async Task MultiResourceEmptyInputReturnsEmptySet() 836public async Task MultiResourceAllInputsHaveNoDependenciesReturnsEmptySet() 852public async Task MultiResourceDiamondWithMultipleInputsHandledCorrectly() 882public async Task MultiResourceDirectOnlyModeWithMultipleResources() 917public async Task MultiResourceCircularReferenceAmongInputsHandledCorrectly() 949public async Task MultiResourceParentChildBothAsInputsExcludesBoth() 970public async Task MultiResourceCombinesDependenciesFromDifferentSourceTypes() 998public async Task MultiResourceSingleResourceBehavesLikeSingleResourceMethod() 1026public async Task ConditionalReferenceExpressionIncludesBothBranchDependencies() 1050public async Task ConditionalReferenceExpressionWithEndpointReferencesIncludesAll() 1078public async Task NestedConditionalReferenceExpressionIncludesAllTransitiveDependencies() 1114public async Task DuplicateConditionalExpressionDependenciesAreDeduplicatedAndIncluded()
ResourceExtensionsTests.cs (9)
209public async Task GetEnvironmentVariableValuesAsyncReturnCorrectVariablesInRunMode() 245public async Task GetEnvironmentVariableValuesAsyncReturnCorrectVariablesUsingValueProviderInRunMode() 280public async Task GetEnvironmentVariableValuesAsyncReturnCorrectVariablesUsingManifestExpressionProviderInPublishMode() 315public async Task GetArgumentValuesAsync_ReturnsCorrectValuesForSpecialCases() 346public async Task WithImagePushOptions_AddsImagePushOptionsCallbackAnnotation() 396public async Task WithImagePushOptions_CanBeCalledMultipleTimes() 446public async Task WithImagePushOptions_WithAsyncCallback_AddsCorrectAnnotation() 451await Task.Delay(1); 503public async Task WithContainerFilesSource_Works()
ResourceFailureLoggingTests.cs (2)
19public async Task ExecutableExitsImmediately() 46public async Task ExecutableDoesNotExist()
ResourceLoggerServiceTests.cs (40)
17public async Task AddingResourceLoggerAnnotationAllowsLogging() 23var subsLoop = WatchForSubscribers(service); 60public async Task StreamingLogsCancelledAfterComplete() 66var subsLoop = WatchForSubscribers(service); 99public async Task SecondSubscriberGetsBacklog() 105var subsLoop = WatchForSubscribers(service); 152public async Task InMemoryLogsPreservedBetweenWatches() 161var subsLoop = WatchForSubscribers(service); 217public async Task MultipleInstancesLogsToAll() 225var subsLoop = WatchForSubscribers(service); 258public async Task MultipleInstancesGetLogForAll() 311public async Task AddLogEntries_OverlappingSnapshotAndFollow_DedupesByOccurrence() 313await Task.Run(() => 346public async Task AddLogEntries_RepeatedIdenticalLines_ArePreservedWhenDedupingOverlap() 348await Task.Run(() => 380public async Task Subscribe_DeliversBacklogBeforeLiveLogs_WithContinuousLineNumbers() 398var subscribeTask = Task.Run(() => 437public async Task WaitForCompletionAsync_CompletesWhenResourceLogStreamCompletes() 442var completionTask = service.WaitForCompletionAsync(resourceName, CancellationToken.None); 452public async Task HasActiveSubscribers_ReturnsFalseAfterCompletion() 454await Task.Run(() => 472public async Task GetAllAsync_DoesNotReplayNonInMemoryEntries() 501public async Task Subscribe_ConcurrentAddLogEntries_DeliversEachEntryOnceWithUniqueLineNumbers() 534await Task.WhenAll(producerTasks).DefaultTimeout(); 545public async Task AddLogEntries_ConcurrentOverlappingBatches_DedupesByOccurrence() 578await Task.WhenAll(producerTasks).DefaultTimeout(); 590public async Task SubscribeAndDispose_ConcurrentWithLogging_DoesNotThrowOrDeadlock() 634await Task.Yield(); 665await Task.WhenAll(subscriberTasks.Concat(producerTasks)).DefaultTimeout(); 672public async Task WatchAsyncCompletesOnDispose() 678var subsLoop = WatchForSubscribers(service); 681var watchTask = Task.Run(async () => 708public async Task WatchAsyncCompletesOnDisposeForNonexistentResource() 712var subsLoop = WatchForSubscribers(service); 715var watchTask = Task.Run(async () => 738public async Task WatchAnySubscribersAsyncCompletesOnDispose() 746var watchTask = Task.Run(async () => 808private static Task WatchForSubscribers(ResourceLoggerService service) 810return Task.Run(async () =>
ResourceNotificationTests.cs (74)
60public async Task InitialSnapshotResourceTypeMatchesKnownResourceTypes(Type resourceType, string expectedResourceType) 78var watchTask = Task.Run(async () => 96public async Task ResourceUpdatesAreQueued() 148public async Task PublishedHealthReportsUpdateHealthStatus() 173public async Task WatchingAllResourcesNotifiesOfAnyResourceChange() 233public async Task WaitingOnResourceReturnsWhenResourceReachesTargetState() 239var waitTask = notificationService.WaitForResourceAsync("myResource1", "SomeState"); 248public async Task WaitingOnResourceReturnsWhenResourceReachesTargetStateWithDifferentCasing() 255var waitTask = notificationService.WaitForResourceAsync("MYreSouRCe1", "sOmeSTAtE", cts.Token); 264public async Task WaitingOnResourceReturnsImmediatelyWhenResourceIsInTargetStateAlready() 273var waitTask = notificationService.WaitForResourceAsync("myResource1", "SomeState"); 279public async Task WaitingOnResourceReturnsWhenResourceReachesRunningStateIfNoTargetStateSupplied() 285var waitTask = notificationService.WaitForResourceAsync("myResource1", targetState: null); 294public async Task WaitingOnResourceReturnsCorrectStateWhenResourceReachesOneOfTargetStatesBeforeCancellation() 309public async Task WaitingOnResourceReturnsCorrectStateWhenResourceReachesOneOfTargetStates() 324public async Task WaitingOnResourceReturnsItReachesStateAfterApplicationStoppingCancellationTokenSignaled() 331var waitTask = notificationService.WaitForResourceAsync("myResource1", "SomeState"); 342public async Task WaitingOnResourceThrowsOperationCanceledExceptionIfResourceDoesntReachStateBeforeCancellationTokenSignaled() 347var waitTask = notificationService.WaitForResourceAsync("myResource1", "SomeState", cts.Token); 358public async Task WaitForDependenciesPublishesAndUpdatesWaitingForDependencies() 369var waitTask = notificationService.WaitForDependenciesAsync(resource, cts.Token); 404public async Task WaitForDependenciesPublishesAndUpdatesWaitingForHealthyDependencies() 417var waitTask = notificationService.WaitForDependenciesAsync(resource, cts.Token); 431ResourceReadyEvent = new EventSnapshot(Task.CompletedTask) 449ResourceReadyEvent = new EventSnapshot(Task.CompletedTask) 462public async Task WaitForDependenciesPublishesAndUpdatesWaitingForCompletionDependencies() 473var waitTask = notificationService.WaitForDependenciesAsync(resource, cts.Token); 510public async Task WaitForDependenciesTransitionsNotStartedResourceToWaiting() 527var waitTask = notificationService.WaitForDependenciesAsync(resource, cts.Token); 552public async Task WaitForDependenciesDoesNotTransitionActiveOrTerminalResourceToWaiting(string state) 567var waitTask = notificationService.WaitForDependenciesAsync(resource, cts.Token); 581public async Task WaitForDependenciesDoesNotTransitionNotStartedReplicaToWaiting() 607var waitTask = notificationService.WaitForDependenciesAsync(resource, cts.Token); 629public async Task WaitForDependenciesDoesNotTransitionNotStartedExplicitStartResourceToWaiting() 645var waitTask = notificationService.WaitForDependenciesAsync(resource, cts.Token); 659public async Task WaitForDependenciesTransitionsNotStartedExplicitStartResourceWithoutDcpInstancesToWaiting() 678var waitTask = notificationService.WaitForDependenciesAsync(resource, cts.Token); 696public async Task WaitForDependenciesTransitionsNotStartedInstanceWithoutExplicitStartToWaiting() 717var waitTask = notificationService.WaitForDependenciesAsync(resource, cts.Token); 735public async Task WaitForDependenciesPublishesResolvedWaitingForDependenciesForReplicas() 749var waitTask = notificationService.WaitForDependenciesAsync(resource, cts.Token); 784public async Task PublishUpdateClearsWaitingForDependenciesWhenResourceLeavesWaiting() 808public async Task CancellationMessageIncludesWaitingForDependencies() 826var waitTask = notificationService.WaitForResourceAsync(resource.Name, KnownResourceStates.Running, cts.Token); 839public async Task WaitForDependenciesCancellationMessageIncludesWaitingForDependencies() 853var waitTask = notificationService.WaitForDependenciesAsync(resource, cts.Token); 874public async Task WaitingOnResourceThrowsOperationCanceledExceptionIfResourceDoesntReachStateBeforeServiceIsDisposed() 878var waitTask = notificationService.WaitForResourceAsync("myResource1", "SomeState"); 889public async Task WaitingOnResourceThrowsOperationCanceledExceptionIfResourceDoesntReachStateBeforeCancellationTokenSignalledWhenApplicationStoppingTokenExists() 895var waitTask = notificationService.WaitForResourceAsync("myResource1", "SomeState", cts.Token); 906public async Task PublishLogsStateTextChangesCorrectly() 974public async Task PublishLogsTraceStateDetailsCorrectly() 1028public async Task UpdateIcons_DoesNotOverwriteExistingIconValues() 1088public async Task UpdateIcons_UsesLastAnnotationWhenNoIconSet() 1125public async Task UpdateIcons_SetsIconValuesWhenNotAlreadySet() 1161public async Task WithHidden_AlwaysHidden() 1175public async Task WithHiddenOnCompletion_HidesOnSuccessfulCompletion() 1193public async Task WithHiddenOnCompletion_HidesOnSuccessfulCompletionWithCustomExitCodes() 1211public async Task WithHiddenOnCompletion_WithCustomExitCode_HidesOnMatchingCode() 1225public async Task WithHiddenOnCompletion_WithCustomExitCodes_HidesOnAnyMatchingCode() 1239public async Task WithHiddenOnCompletion_BecomesVisibleOnRestart() 1264public async Task WaitForResourceHealthyAsyncWaitsForResourceReadyEvent() 1310public async Task WaitForResourceHealthyAsyncWaitsForResourceReadyEventWithException() 1338public async Task WaitForResourceHealthyAsyncWorksWithoutResourceReadyEvent() 1359ResourceReadyEvent = new EventSnapshot(Task.CompletedTask) 1375public async Task WaitForResourceHealthyAsync_StopOnResourceUnavailable_ThrowsIfResourceNotInModel() 1393public async Task WaitForResourceHealthyAsync_WaitOnResourceUnavailable_DoesNotThrowForNonexistentResource() 1453public async Task PublishUpdateAsyncSkipsSnapshotsThatDidNotChange() 1475public async Task PublishUpdateAsyncSkipsUnchangedSnapshotsWithRebuiltCollections() 1547public async Task PublishUpdateAsyncIgnoresVersionOnlyChanges() 1567public async Task PublishUpdateAsyncPublishesEverySnapshotContentChange(string propertyName) 1589public async Task PublishUpdateAsyncPublishesEveryResourcePropertyContentChange(string propertyName) 1804if (type == typeof(Task)) 1806return Task.CompletedTask;
SlimTestProgramTests.cs (4)
23public async Task TestProjectStartsAndStopsCleanly() 33private static async Task EnsureServicesAreRunning(TestProgram testProgram, CancellationToken cancellationToken) 48public async Task TestPortOnEndpointAnnotationAndAllocatedEndpointAnnotationMatch() 67public async Task TestPortOnEndpointAnnotationAndAllocatedEndpointAnnotationMatchForReplicatedServices()
TestProgramFixture.cs (2)
24public abstract Task WaitReadyStateAsync(CancellationToken cancellationToken = default); 64public override async Task WaitReadyStateAsync(CancellationToken cancellationToken = default)
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (3)
15_ = Task.Run(async () => 41return Task.Run(async () => 58return Task.Run(async () =>
tests\Shared\TestInteractionService.cs (3)
89var workTask = work(progressContext); 92var finished = await Task.WhenAny(workTask, completionTask).ConfigureAwait(false);
tests\Shared\TestPipelineActivityReporter.cs (14)
133public Task CompletePublishAsync(PublishCompletionOptions? options = null, CancellationToken cancellationToken = default) 142return Task.CompletedTask; 147public Task CompletePublishAsync(string? completionMessage = null, CompletionState? completionState = null, CancellationToken cancellationToken = default) 175return Task.FromResult<IReportingStep>(new TestReportingStep(this, title, _testOutputHelper)); 193public Task CompleteAsync(string completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 202return Task.CompletedTask; 213return Task.FromResult<IReportingTask>(new TestReportingTask(_reporter, statusText, _testOutputHelper)); 250public Task CompleteAsync(MarkdownString completionText, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 272public Task CompleteAsync(string? completionMessage = null, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default) 280return Task.CompletedTask; 283public Task UpdateAsync(string statusText, CancellationToken cancellationToken = default) 291return Task.CompletedTask; 294public Task UpdateAsync(MarkdownString statusText, CancellationToken cancellationToken = default) 300public Task CompleteAsync(MarkdownString completionMessage, CompletionState completionState = CompletionState.Completed, CancellationToken cancellationToken = default)
UserSecretsParameterDefaultTests.cs (13)
93public async Task TrySetUserSecret_ConcurrentWrites_PreservesAllSecrets() 118tasks.Add(Task.Run(() => 125var results = await Task.WhenAll(tasks); 142public async Task TrySetUserSecret_SqlServerAndRabbitMQ_BothSecretsPreserved() 155var sqlTask = Task.Run(() => 160var rabbitTask = Task.Run(() => 166var results = await Task.WhenAll(sqlTask, rabbitTask); 204public async Task TrySetUserSecret_ConcurrentWritesSameKey_LastWriteWins() 220tasks.Add(Task.Run(() => 227var results = await Task.WhenAll(tasks); 307public async Task UserSecretsParameterDefault_WithCustomFactory_ConcurrentAccess() 324tasks.Add(Task.Run(() => 332var values = await Task.WhenAll(tasks);
Utils\PeriodicRestartAsyncEnumerableTests.cs (5)
13public async Task CancellingMainTokenCancelsEnumerable() 21var innerFactory = (int? lastValue, CancellationToken cancellationToken) => Task.FromResult(CountingAsyncEnumerable(0, TimeSpan.FromMilliseconds(50), cancellationToken)); 37public async Task EnumerableIsRecreatedPeriodically() 44var innerFactory = (int? lastValue, CancellationToken cancellationToken) => Task.FromResult(RefCountingAsyncEnumerable(0, TimeSpan.FromMilliseconds(10), cancellationToken)); 65await Task.Delay(delay, cancellationToken).ConfigureAwait(false);
ValueSnapshotTests.cs (10)
10public async Task GetValueAsync_WaitsForFirstValue() 24public async Task GetValueAsync_ReturnsImmediatelyAfterValueSet() 39public async Task SetValue_UpdatesValue() 54public async Task SetValue_CompletesAllWaiters() 74public async Task SetException_ThrowsException() 86public async Task SetException_CompletesAllWaiters() 104public async Task SetException_CanBeReplacedWithValue() 119public async Task SetValue_CanBeReplacedWithException() 177public async Task GetValueAsync_SupportsCancellation() 189public async Task GetValueAsync_CancellationDoesNotAffectOtherWaiters()
VersionChecking\VersionCheckServiceTests.cs (11)
24public async Task ExecuteAsync_NewerVersion_DisplayMessage() 49public async Task ExecuteAsync_DisabledInConfiguration_NoFetch() 72public async Task ExecuteAsync_InsideLastCheckInterval_NoFetch() 107public async Task ExecuteAsync_InsideLastCheckIntervalHasLastKnown_NoFetchAndDisplayMessage() 147public async Task ExecuteAsync_InsideLastCheckIntervalHasLastKnownPrerelease_NoFetchAndMaybeDisplayMessage(string currentVersion, string lastKnownVersion, bool displayNotification) 192public async Task ExecuteAsync_OlderVersion_NoMessage() 223public async Task ExecuteAsync_IgnoredVersion_NoMessage() 258public async Task ExecuteAsync_IgnoredWildcardVersion_IgnoresPrereleasesOnly(string latestVersion, bool shouldBeIgnored) 299public async Task ExecuteAsync_IgnorePrerelease_StoresWildcardPattern() 329public async Task ExecuteAsync_IgnoreStableVersion_StoresExactVersion() 360public async Task ExecuteAsync_IgnoreVersion_LogsWarningOnlyWhenUserSecretsUnavailable(bool isAvailable, bool canSetSecret, bool expectWarning)
WaitForTests.cs (34)
20public async Task ResourceThatFailsToStartDueToExceptionDoesNotCauseStartAsyncToThrow() 85public async Task WaitingForParameterResourceCompletesImmediately() 105var startTask = app.StartAsync(startupCts.Token); 123public async Task WaitingForConnectionStringResourceWaitsForReferencedResources() 136var startTask = app.StartAsync(startupCts.Token); 153public async Task EnsureDependentResourceMovesIntoWaitingState() 169var startTask = app.StartAsync(startupCts.Token); 201public async Task WaitForBehaviorStopOnResourceUnavailable(string status) 213var startTask = app.StartAsync(startupCts.Token); 231public async Task WhenWaitBehaviorIsStopOnResourceUnavailableWaitForResourceHealthyAsyncShouldThrowWhenResourceFailsToStart() 255public async Task WhenWaitBehaviorIsWaitOnResourceUnavailableWaitForResourceHealthyAsyncShouldThrowWhenResourceFailsToStart() 281public async Task WhenWaitBehaviorIsMissingWaitForResourceHealthyAsyncShouldUseDefaultWaitBehavior(WaitBehavior defaultWaitBehavior, Type exceptionType, string exceptionMessage) 312public async Task WaitForBehaviorStopOnDependencyIsDefaultWithNoDashboardFailure(string status) 324var startTask = app.StartAsync(startupCts.Token); 346public async Task WaitForBehaviorWaitOnResourceUnavailable(string status) 358var startTask = app.StartAsync(startupCts.Token); 388public async Task WaitForBehaviorWaitOnResourceUnavailableViaOptions(string status) 405var startTask = app.StartAsync(startupCts.Token); 431public async Task WaitForCompletionWaitsForTerminalStateOfDependencyResource() 447var startTask = app.StartAsync(startupCts.Token); 478public async Task WaitForThrowsIfResourceMovesToTerminalStateBeforeRunning() 494var startTask = app.StartAsync(startupCts.Token); 525public async Task WaitForObservedResultOfResourceReadyEvent() 549var startTask = app.StartAsync(startupCts.Token); 587public async Task EnsureDependencyResourceThatReturnsNonMatchingExitCodeResultsInDependentResourceFailingToStart() 603var startTask = app.StartAsync(startupCts.Token); 633public async Task DependencyWithGreaterThan1ReplicaAnnotationWaitsForAll() 654var startTask = app.StartAsync(startupCts.Token); 686public async Task DependencyWithGreaterThan1ReplicaAnnotationWaitsForAllToComplete() 707var startTask = app.StartAsync(startupCts.Token); 739public async Task WaitForCompletionSucceedsIfDependentResourceEntersTerminalStateWithoutAnExitCode() 756var startTask = app.StartAsync(startupCts.Token); 849public async Task WaitForStartOnlyWaitsForRunningState() 871var startTask = app.StartAsync(startupCts.Token);
WithCertificateAuthorityCollection.cs (2)
12public Task AddingCertificateAuthorityCollectionsIsIdempotent() 37return Task.CompletedTask;
WithEndpointTests.cs (17)
397public async Task CanAddEndpointsWithContainerPortAndEnv() 444public async Task VerifyManifestWithBothDifferentPortAndTargetPort() 472public async Task VerifyManifestWithHttpPortWithTargetPort() 499public async Task VerifyManifestWithHttpsAndTargetPort() 526public async Task VerifyManifestContainerWithHttpEndpointAndNoPortsAllocatesPort() 553public async Task VerifyManifestContainerWithHttpsEndpointAllocatesPort() 580public async Task VerifyManifestWithHttpEndpointAndPortOnlySetsTargetPort() 607public async Task VerifyManifestWithTcpEndpointAndNoPortAllocatesPort() 634public async Task VerifyManifestProjectWithDefaultHttpEndpointsDoesNotAllocatePort() 694public async Task VerifyManifestProjectWithEndpointsSetsPortsEnvVariables() 728public async Task VerifyManifestPortAllocationIsGlobal() 795public async Task LocalhostTopLevelDomainSetsAnnotationValues() 806return Task.CompletedTask; 829public async Task TopLevelDomainSetsAnnotationValues(string host, EndpointBindingMode endpointBindingMode) 840return Task.CompletedTask; 861public async Task VerifyManifestProjectWithExplicitPortAndNoLaunchProfile() 1009public async Task WithHttpEndpointUpdateReplacesEnvVar()
WithEnvironmentTests.cs (17)
15public async Task BuiltApplicationHasAccessToIServiceProviderViaEnvironmentCallbackContext() 41public async Task EnvironmentReferencingEndpointPopulatesWithBindingUrl() 69public async Task SimpleEnvironmentWithNameAndValue() 82public async Task SimpleEnvironmentWithNameAndReferenceExpressionValue() 98public async Task EnvironmentCallbackPopulatesValueWhenCalled() 114public async Task EnvironmentCallbackPopulatesValueWhenParameterResourceProvided() 139public async Task EnvironmentCallbackPopulatesWithExpressionPlaceholderWhenPublishingManifest() 155public async Task EnvironmentCallbackThrowsWhenParameterValueMissingInDcpMode() 175public async Task ComplexEnvironmentCallbackPopulatesValueWhenCalled() 197public async Task ComplexAsyncEnvironmentCallbackPopulatesValueWhenCalled() 205await Task.Yield(); 221public async Task EnvironmentVariableExpressions() 300public async Task EnvironmentVariableWithDynamicTargetPort() 331public async Task EnvironmentWithConnectionStringSetsProperEnvironmentVariable() 368public async Task GenericWithEnvironmentWorksWithValueAndManifestProvider() 394public async Task GenericWithEnvironmentHandlesResourceReferences() 440public async Task GenericWithEnvironmentWorksWithEndpointProperty()
WithHttpCommandTests.cs (28)
48public async Task GetDefaultHttpCommandResultAsync_WithoutOptIn_DoesNotReturnResponseBody() 63public async Task GetDefaultHttpCommandResultAsync_WithResultModeJson_ReturnsResponseBody() 82public async Task GetDefaultHttpCommandResultAsync_WithResultModeAuto_ReturnsErrorBodyUsingInferredFormat() 122public async Task WithHttpCommand_WithoutNamedHttpClient_HasNoTimeout() 137return Task.CompletedTask; 325public async Task WithHttpCommandExport_UsesPrepareRequestCallbackProperty() 347return Task.FromResult(new HttpCommandRequestExportData 440public async Task WithHttpCommand_ResultsInExpectedResultForStatusCode(int statusCode, bool expectSuccess) 465public async Task WithHttpCommand_WhenHttpSendObservesCanceledToken_ReturnsCanceled() 494public async Task WithHttpCommand_ResultsInExpectedResultForHttpMethod(string? httpMethod, bool expectSuccess) 522public async Task WithHttpCommand_UsesNamedHttpClient() 539return Task.CompletedTask; 601public async Task WithHttpCommand_UsesEndpointSelector() 644public async Task WithHttpCommand_CallsPrepareRequestCallback_BeforeSendingRequest() 670return Task.CompletedTask; 688public async Task WithHttpCommand_CallsGetResponseCallback_AfterSendingRequest() 714return Task.FromResult(CommandResults.Failure("A test error message")); 733public async Task WithHttpCommand_PassesArgumentsToRequestAndResultCallbacks() 764return Task.CompletedTask; 769return Task.FromResult(CommandResults.Success(resultContext.Arguments.GetString("message")!)); 799public async Task WithHttpCommand_WithoutOptIn_DoesNotReturnJsonResponseBody() 825public async Task WithHttpCommand_WithResultModeJson_ReturnsJsonResponseBody() 852public async Task WithHttpCommand_WithResultModeText_ReturnsTextResponseBody() 880public async Task WithHttpCommand_WithResultModeAuto_ReturnsJsonResponseBody() 907public async Task WithHttpCommand_WithResultModeAuto_ReturnsTextResponseBody() 935public async Task WithHttpCommand_EnablesCommandOnceResourceIsRunning() 979public async Task WithHttpCommand_EnablesCommandUsingCustomUpdateStateCallback() 1057private static async Task MoveResourceToRunningStateAsync(DistributedApplication app, IResource resource, string commandName = "mycommand")
WithMcpServerTests.cs (6)
22public async Task WithMcpServer_AddsMcpServerEndpointAnnotation() 40public async Task WithMcpServer_DefaultsToHttpsEndpoint() 66public async Task WithMcpServer_FallsBackToHttpEndpoint() 91public async Task WithMcpServer_ResolvesDefaultMcpPath() 116public async Task WithMcpServer_ResolvesCustomPath() 141public async Task WithMcpServer_ResolvesNullPath()
WithOtlpExporterTests.cs (8)
23public async Task OtlpEndpointSet(OtlpProtocol? protocol, string? grpcEndpoint, string? httpEndpoint, string expectedUrl, string expectedProtocol) 57public async Task RequiredHttpOtlpThrowsExceptionIfNotRegistered(OtlpProtocol protocol) 82public async Task OtlpEndpointResolvesFromDashboardEndpoint(OtlpProtocol? protocol, string configKey, string endpointName, string? transport, int allocatedPort, string expectedProtocol) 120public async Task OtlpEndpointPrefersGrpcWhenBothEndpointsExist() 153public async Task OtlpEndpointFallsBackToConfigWhenNoDashboardResource() 176public async Task OtlpEndpointResolvesFromDashboardForExecutableResource() 205public async Task OtlpEndpointCanBeOverriddenToPointToAnotherResource() 241return Task.CompletedTask;
WithProcessCommandTests.cs (47)
85public async Task WithProcessCommandExport_AddsResourceCommandAnnotationAndRunsProcess() 140public async Task WithProcessCommandExport_CreateProcessSpecReceivesExecutionContextAndArguments() 158return Task.FromResult(new ProcessCommandSpecExportData 203public async Task WithProcessCommandFactoryExport_ProcessFactoryReceivesExecutionContextAndArguments() 219return Task.FromResult(new ProcessCommandSpecExportData 291public async Task WithProcessCommandFactoryExport_SuccessExitCodes_TreatsConfiguredExitCodeAsSuccess() 301_ => Task.FromResult(new ProcessCommandSpecExportData 320public async Task WithProcessCommandFactoryExport_NullProcessSpecFactoryResult_ReturnsFailure() 329_ => Task.FromResult<ProcessCommandSpecExportData>(null!)); 342public async Task WithProcessCommand_ProcessFactoryReceivesExecutionContextAndArguments() 400public async Task WithProcessCommand_BackchannelNamedArgumentsFlowToProcessFactoryAndResultContext() 429return Task.FromResult(CommandResults.Success("received argument", resultContext.Arguments.GetString("message")!)); 464public async Task WithProcessCommand_AwaitsAsyncProcessFactory() 473await Task.Yield(); 498public async Task WithProcessCommand_ExecutesFreshProcessForEachInvocation() 547public async Task WithProcessCommand_ReturnsBoundedOutput() 580public async Task WithProcessCommand_DisplayImmediately_CanBeDisabled() 608public async Task WithProcessCommand_SuccessWithoutOutput_ReturnsNoResultData() 630public async Task WithProcessCommand_NonZeroExitWithoutOutput_ReturnsFailureWithoutResultData() 654public async Task WithProcessCommand_SuccessExitCodes_TreatsConfiguredExitCodeAsSuccess() 692public async Task WithProcessCommand_NonZeroExitWithOutput_HonorsDisplayImmediatelyOption() 720public async Task WithProcessCommand_StreamsStdoutAndStderrToResourceLoggerAndResult() 750public async Task WithProcessCommand_GetCommandResult_CanCustomizeResultFromProcessOutput() 775return Task.FromResult(new ExecuteCommandResult 812public async Task WithProcessCommand_ReturnsOutputInRunnerObservedOrder() 843public async Task WithProcessCommand_NonZeroExit_ReturnsFailureWithBoundedOutput() 875public async Task WithProcessCommand_PreservesArgumentValues() 907public async Task WithProcessCommand_StandardInputContent_FlowsToProcessSpec() 930public async Task WithProcessCommand_EnablesExecutablePathResolution() 954public async Task WithProcessCommand_WorkingDirectory_FlowsToProcessSpec() 977public async Task WithProcessCommand_EnvironmentVariables_FlowToProcessSpec() 1005public async Task WithProcessCommand_InvalidEnvironmentVariableName_ReturnsFailureWithoutCreatingProcess() 1031public async Task WithProcessCommand_NullEnvironmentVariableValue_ReturnsFailureWithoutCreatingProcess() 1057public async Task WithProcessCommandExport_ProcessOptionsFlowToProcessSpec() 1106public async Task WithProcessCommandExport_SuccessExitCodes_TreatsConfiguredExitCodeAsSuccess() 1132public async Task WithProcessCommandExport_UnspecifiedBooleanOptionsUseProcessCommandSpecDefaults() 1160public async Task WithProcessCommandExport_InvalidProcessOptions_ReturnsFailureWithoutCreatingProcess() 1241public async Task WithProcessCommandExport_EmptySuccessExitCodesUseDefault() 1267public async Task WithProcessCommand_CanDisableEnvironmentInheritance() 1292public async Task WithProcessCommand_ProcessStartFailure_ReturnsFailure() 1316public async Task WithProcessCommand_ProcessTaskFailure_ReturnsFailureAndDisposesProcess() 1319processRunner.EnqueuePending(Task.FromException<ProcessResult>(new InvalidOperationException("process failed after start"))); 1340public async Task WithProcessCommand_NullProcessSpecFactoryResult_ReturnsFailure() 1361public async Task WithProcessCommand_ProcessSpecFactoryException_ReturnsFailureWithoutCreatingProcess() 1388public async Task WithProcessCommand_NullArgument_ReturnsFailure() 1411public async Task WithProcessCommand_ValidationFailure_DoesNotCreateProcess() 1455public async Task WithProcessCommand_Cancellation_ReturnsCanceledResultAndDisposesProcess()
WithReferenceTests.cs (37)
16public async Task ResourceWithSingleEndpointProducesSimplifiedEnvironmentVariables(string endpointName) 41public async Task ResourceNamesWithDashesAreEncodedInEnvironmentVariables() 61public async Task OverriddenServiceNamesAreEncodedInEnvironmentVariables() 87public async Task ResourceWithEndpointRespectsCustomEnvironmentVariableNaming(ReferenceEnvironmentInjectionFlags flags) 134public async Task ResourceWithConflictingEndpointsProducesFullyScopedEnvironmentVariables() 161public async Task ResourceWithNonConflictingEndpointsProducesAllVariantsOfEnvironmentVariables() 189public async Task ResourceWithConflictingEndpointsProducesAllEnvironmentVariables() 220public async Task ResourceWithEndpointsProducesAllEnvironmentVariables() 249public async Task InternalWithReferenceAddsConnectionStringAndServiceDiscoveryWhenResourceSupportsBoth() 271public async Task InternalWithReferenceKeepsDefaultServiceDiscoveryNameWhenOnlyConnectionNameIsProvided() 294public async Task ConnectionStringResourceThrowsWhenMissingConnectionString() 313public async Task ConnectionStringResourceOptionalWithMissingConnectionString() 329public async Task ParameterAsConnectionStringResourceThrowsWhenConnectionStringSectionMissing() 349public async Task ParameterAsConnectionStringResourceInjectsConnectionStringWhenPresent() 367public async Task ParameterAsConnectionStringResourceInjectsExpressionWhenPublishingManifest() 383public async Task ParameterAsConnectionStringResourceInjectsCorrectEnvWhenPublishingManifest() 399public async Task ConnectionStringResourceWithConnectionString() 422public async Task ConnectionStringResourceWithExpressionConnectionString(bool useFormat) 477public async Task ConnectionStringResourceWithExpressionConnectionStringBuilder() 502public async Task ConnectionStringResourceWithConnectionStringOverwriteName() 532public async Task WithReferenceHttpUriWithPathProducesEnvironmentVariables() 549public async Task WithReferenceHttpProduceEnvironmentVariables() 566public async Task ProjectResourceWithReferenceGetsConnectionStringAndProperties() 591public async Task ExecutableResourceWithReferenceGetsConnectionStringAndProperties() 616public async Task JavaScriptAppAppResourceWithReferenceGetsConnectionStringAndProperties() 641public async Task PythonAppResourceWithReferenceGetsConnectionStringAndProperties() 668public async Task ContainerResourceWithReferenceGetsOnlyConnectionString() 693public async Task ResourceWithConnectionPropertiesExtensionRespectsFlags() 720public async Task ResourceWithConnectionPropertiesExtensionOverridesDefault() 749public async Task ConnectionStringResourceWithConnectionPropertiesOverwriteName() 771public async Task ConnectionPropertiesWithDashedNamesAreEncoded() 814public async Task ExcludedReferenceEndpointExcludedFromUseAllEndpoints() 843public async Task ExcludedReferenceEndpointCanBeReferencedExplicitly() 872public async Task CombinedWithReferenceAndExplicitEndpointIncludesBoth() 943public async Task HttpEndpointWithTlsUsesActualSchemeAsKey() 962public async Task MultipleEndpointsWithDifferentNamesProduceDistinctKeys() 982public async Task PerEndpointNameOverridesServiceName()
WithTerminalTests.cs (37)
37public async Task WithTerminalAddsTerminalAnnotation() 132public async Task WithTerminalCreatesPerReplicaHiddenTerminalHostResources() 151public async Task WithTerminalLinksAnnotationToHostResources() 166public async Task WithTerminalAddsWaitAnnotationForEachTerminalHost() 194public async Task WithTerminalWorksOnContainerResources() 212public async Task TerminalHostResourcesAreExcludedFromManifest() 234public async Task TerminalHostsAreHiddenByDefault() 252public async Task ShowTerminalHostOptionMakesTerminalHostsVisible() 278public async Task WithTerminalCleansUpPerReplicaFilesOnApplicationStopped() 357public async Task WithTerminalWritesMetadataSidecarWithExpectedShape() 422public async Task WithTerminalSweepsOrphanedFilesFromDeadAppHost() 479public async Task WithTerminalDoesNotSweepFilesFromLiveAppHost() 536public async Task WithTerminalSweepReclaimsFilesFromReusedProcessId() 568public async Task WithTerminalSweepDoesNotTrustReplicaIdFromMetadata() 608public async Task WithTerminalSweepPreservesRecentMalformedMetadata() 634public async Task WithTerminalSweepPreservesExpiredMalformedMetadataWithSockets() 656public async Task WithTerminalSweepReclaimsExpiredMalformedMetadataWithoutSockets() 672public async Task WithTerminalSweepReclaimsOnlyExpiredMetadataTemporaryFiles() 701public async Task WithTerminalSweepIgnoresInvalidReplicaIdFilename() 733public async Task WithTerminalSweepIgnoresUnknownMetadataSchema() 766public async Task WithTerminalSweepPreservesUnscopedSchemaV1Sidecar() 792public async Task WithTerminalSweepPreservesUnscopedSchemaV2Sidecar() 818public async Task WithTerminalSweepPreservesSidecarFromAnotherProcessScope() 845public async Task WithTerminalSweepReclaimsSidecarFromPreviousBoot() 901public async Task WithTerminalStartsOneBackgroundSweepPerAppHost() 917public async Task WithTerminalDoesNotMaterializeRuntimeArtifactsInPublishMode() 933private async Task RunStartupSweepAsync() 1055public async Task WithTerminalDefaultsToOneTerminalHost() 1073public async Task WithTerminalAfterWithReplicasCreatesOneTerminalHostPerReplica() 1099public async Task WithReplicasAfterWithTerminalCreatesOneTerminalHostPerReplica() 1124public async Task TerminalHostLayoutPathsAreUnderTheSameTrmnlDirectoryWithDistinctReplicaIds() 1157public async Task TerminalHostLayoutUsesANewReplicaIdForEachAppHostRun() 1175public async Task TerminalHostWatchesTheOwningAppHostProcess() 1197public async Task TerminalHostHasCommandLineArgsForLayoutPaths() 1239public async Task TerminalHostResourcesHaveUnresolvedCommandUntilTerminalHostPathIsConfigured() 1267private static async Task PublishBeforeStartAsync(IDistributedApplicationTestingBuilder builder) 1331private static async Task WaitForSweepAsync(DistributedApplication app)
WithUrlsTests.cs (49)
22Func<ResourceUrlsCallbackContext, Task> callback = c => Task.CompletedTask; 48public async Task WithUrlsCallsCallbackAfterBeforeResourceStartedEvent() 61return Task.CompletedTask; 68return Task.CompletedTask; 80public async Task WithUrlsProvidesLoggerInstanceOnCallbackContextAllocated() 91return Task.CompletedTask; 106public async Task WithUrlsProvidesServiceProviderInstanceOnCallbackContextAllocated() 135public async Task WithUrlsAddsUrlAnnotations() 145return Task.CompletedTask; 159public async Task WithUrlAddsUrlAnnotation() 169return Task.CompletedTask; 183public async Task WithUrlInterpolatedStringAddsUrlAnnotation() 195return Task.CompletedTask; 213public async Task EndpointsResultInUrls() 223return Task.CompletedTask; 241public async Task EndpointsGetDevLocalhostUrlsWhenDashboardHasDevLocalhostUrl(string dashboardHost, string expectedHostSuffix) 256return Task.CompletedTask; 290public async Task ProjectLaunchProfileRelativeLaunchUrlIsAddedToEndpointUrl() 299return Task.CompletedTask; 313public async Task ProjectLaunchProfileAbsoluteLaunchUrlIsUsedAsEndpointUrl() 322return Task.CompletedTask; 336public async Task WithUrlForEndpointUpdatesUrlForEndpoint() 353return Task.CompletedTask; 372public async Task EndpointUrlsAreInitiallyInactive() 397public async Task MultipleUrlsForSingleEndpointAreIncludedInUrlSnapshot() 426public async Task ExpectedNumberOfUrlsForReplicatedResource() 461public async Task ProjectResourceUrlsTransitionThroughExpectedLifecycleStates() 476var watchTask = Task.Run(async () => 537public async Task CustomResourceUrlsTransitionThroughExpectedLifecycleStates() 592var watchTask = Task.Run(async () => 653public async Task UrlsAreMarkedAsInternalDependingOnDisplayLocation() 686public async Task WithUrlForEndpointUpdateDoesNotThrowOrCallCallbackIfEndpointNotFound() 701return Task.CompletedTask; 714public async Task WithUrlForEndpointAddDoesNotThrowOrCallCallbackIfEndpointNotFound() 730return Task.CompletedTask; 743public async Task WithUrlWithRelativeUrlAppliesPathToExpectedUrls() 758return Task.CompletedTask; 794public async Task WithUrlForEndpointUpdateTurnsRelativeUrlIntoAbsoluteUrl(bool useHttps) 819return Task.CompletedTask; 837public async Task WithUrlForEndpointSupportsMultipleRelativeUrlsOnLaunchProfileEndpoint() 858return Task.CompletedTask; 885public async Task WithUrlForEndpointAddTurnsRelativeUrlIntoAbsoluteUrl() 899return Task.CompletedTask; 915public async Task WithUrlsTurnsRelativeEndpointUrlsIntoAbsoluteUrls() 929return Task.CompletedTask; 945public async Task WithUrlCanAddUrlFromAnotherResourcesEndpoint()
Aspire.Hosting.TestUtilities (69)
Dcp\ApplicationOrchestratorProxy.cs (2)
17public Task StartResourceAsync(string resourceName, CancellationToken cancellationToken) => _orchestrator.StartResourceAsync(resourceName, cancellationToken); 19public Task StopResourceAsync(string resourceName, CancellationToken cancellationToken) => _orchestrator.StopResourceAsync(resourceName, cancellationToken);
Dcp\TestDcpDependencyCheckService.cs (1)
22return Task.FromResult((DcpInfo?)dcpInfo);
Helpers\CallbackLifecycleHook.cs (4)
12private readonly Func<DistributedApplicationModel, CancellationToken, Task> _beforeStartCallback; 14public CallbackLifecycleHook(Func<DistributedApplicationModel, CancellationToken, Task> beforeStartCallback) 19public Task BeforeStartAsync(DistributedApplicationModel appModel, CancellationToken cancellationToken = default) 26return Task.CompletedTask;
Helpers\JsonDocumentManifestPublisher.cs (1)
23protected override async Task PublishInternalAsync(DistributedApplicationModel model, CancellationToken cancellationToken)
Helpers\NoopPublisher.cs (2)
11public Task PublishAsync(DistributedApplicationModel model, CancellationToken cancellationToken) 13return Task.CompletedTask;
MockImageBuilder.cs (6)
23public Task BuildImageAsync(IResource resource, CancellationToken cancellationToken = default) 27return Task.CompletedTask; 30public Task BuildImagesAsync(IEnumerable<IResource> resources, CancellationToken cancellationToken = default) 37return Task.CompletedTask; 40public Task PushImageAsync(IResource resource, CancellationToken cancellationToken) 44return Task.CompletedTask;
Publishing\FakeContainerRuntime.cs (17)
34public Func<string, string, ContainerImageBuildOptions?, Dictionary<string, string?>, Dictionary<string, BuildImageSecretValue>, string?, CancellationToken, Task>? BuildImageAsyncCallback { get; set; } 40return Task.FromResult(isRunning && !shouldFail); 43public Task TagImageAsync(string localImageName, string targetImageName, CancellationToken cancellationToken) 51return Task.CompletedTask; 54public Task RemoveImageAsync(string imageName, CancellationToken cancellationToken) 62return Task.CompletedTask; 65public Task PushImageAsync(IResource resource, CancellationToken cancellationToken) 73return Task.CompletedTask; 76public async Task BuildImageAsync(string contextPath, string dockerfilePath, ContainerImageBuildOptions? options, Dictionary<string, string?> buildArguments, Dictionary<string, BuildImageSecretValue> buildSecrets, string? stage, CancellationToken cancellationToken) 98public Task LoginToRegistryAsync(string registryServer, string username, string password, CancellationToken cancellationToken) 106return Task.CompletedTask; 109public Task ComposeUpAsync(ComposeOperationContext context, CancellationToken cancellationToken) 115return Task.CompletedTask; 118public Task ComposeDownAsync(ComposeOperationContext context, CancellationToken cancellationToken) 126return Task.CompletedTask; 131return Task.FromResult<IReadOnlyList<ComposeServiceInfo>?>(null); 136return Task.FromResult<IContainerRuntime>(this);
tests\Shared\DistributedApplicationTestingBuilderExtensions.cs (3)
114public Task StartAsync(CancellationToken cancellationToken) => Task.CompletedTask; 116public async Task StopAsync(CancellationToken cancellationToken)
tests\Shared\TemporaryWorkspace.cs (1)
27public async Task InitializeGitAsync(CancellationToken cancellationToken = default)
Utils\DockerUtils.cs (1)
50var detected = Task.Run(
Utils\Grpc\TestServerCallContext.cs (2)
44protected override Task WriteResponseHeadersAsyncCore(Metadata responseHeaders) 52return Task.CompletedTask;
Utils\Grpc\TestServerStreamWriter.cs (4)
44public Task WriteAsync(T message, CancellationToken cancellationToken) 49return Task.FromCanceled(_serverCallContext.CancellationToken); 57return Task.CompletedTask; 60public Task WriteAsync(T message)
Utils\LoggerNotificationExtensions.cs (10)
23public static Task WaitForTextAsync(this DistributedApplication app, string logText, string? resourceName = null, CancellationToken cancellationToken = default) 31public static async Task WaitForHealthyAsync<T>(this DistributedApplication app, IResourceBuilder<T> resource, CancellationToken cancellationToken = default) where T : IResource 47public static Task WaitForTextAsync(this DistributedApplication app, IEnumerable<string> logTexts, string? resourceName = null, CancellationToken cancellationToken = default) 62public static Task WaitForTextAsync(this DistributedApplication app, Predicate<string> predicate, CancellationToken cancellationToken = default) 73public static Task WaitForTextAsync(this DistributedApplication app, Predicate<string> predicate, string? resourceName = null, CancellationToken cancellationToken = default) 84_ = Task.Run(() => WatchNotifications(app, resourceName, predicate, tcs, watchCts), watchCts.Token); 97public static async Task WaitForAllTextAsync(this DistributedApplication app, IEnumerable<string> logTexts, string? resourceName = null, CancellationToken cancellationToken = default) 122private static async Task WatchNotifications(DistributedApplication app, string? resourceName, Predicate<string> predicate, TaskCompletionSource tcs, CancellationTokenSource cancellationTokenSource) 128var logWatchTasks = new List<Task>(); 160private static async Task WatchResourceLogs(TaskCompletionSource tcs, string resourceId, Predicate<string> predicate, ResourceLoggerService resourceLoggerService, CancellationTokenSource cancellationTokenSource)
Utils\MockUserSecretsManager.cs (2)
51public Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default) 53return Task.CompletedTask;
Utils\PersistentContainerTestHelpers.cs (3)
24public static async Task AssertResourceReusesContainerAsync( 52public static async Task AssertResourcesReuseContainersAsync( 114var resourceSnapshots = await Task.WhenAll(
Utils\TestDcpExecutor.cs (8)
40public Task RunApplicationAsync(CancellationToken cancellationToken) => Task.CompletedTask; 42public Task StartResourceAsync(IResourceReference resourceReference, CancellationToken cancellationToken) 45return Task.CompletedTask; 48public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; 50public Task StopResourceAsync(IResourceReference resource, CancellationToken cancellationToken) => Task.CompletedTask;
Utils\TestPackageFetcher.cs (1)
17_versionTask = versionTask ?? Task.FromResult<List<NuGetPackage>>([]);
Utils\TestProcessRunner.cs (1)
109return (Task.FromResult(processResult), disposable);
Aspire.Hosting.Valkey (1)
ValkeyBuilderExtensions.cs (1)
184return Task.CompletedTask;
Aspire.Hosting.Valkey.Tests (29)
AddValkeyTests.cs (9)
71public async Task ValkeyCreatesConnectionStringWithDefaultPassword() 122public async Task VerifyWithoutPasswordManifest() 156public async Task VerifyWithPasswordManifest() 244public async Task WithDataVolumeAddsPersistenceAnnotation() 257public async Task WithDataVolumeDoesNotAddPersistenceAnnotationIfIsReadOnly() 268public async Task WithDataBindMountAddsPersistenceAnnotation() 281public async Task WithDataBindMountDoesNotAddPersistenceAnnotationIfIsReadOnly() 292public async Task WithPersistenceReplacesPreviousAnnotationInstances() 321public async Task AddValkeyContainerWithPasswordAnnotationMetadata()
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
ValkeyFunctionalTests.cs (5)
24public async Task VerifyValkeyResource() 66public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume) 206public async Task VerifyWaitForOnValkeyBlocksDependentResources() 225var pendingStart = app.StartAsync(cts.Token); 243public Task Valkey_WithPersistentLifetime_ReusesContainer()
Aspire.Hosting.Yarp (1)
YarpResourceExtensions.cs (1)
56return Task.CompletedTask;
Aspire.Hosting.Yarp.Tests (19)
AddYarpTests.cs (14)
38public async Task VerifyRunEnvVariablesAreSet(bool containerCertificateSupport) 71public async Task VerifyPublishEnvVariablesAreSet() 110public async Task VerifyWithStaticFilesAddsEnvironmentVariable() 133public async Task VerifyWithStaticFilesWorksInPublishOperation() 155public async Task VerifyWithStaticFilesBindMountAddsEnvironmentVariable() 180public async Task VerifyWithStaticFilesBindMountWorksInPublishOperation() 220public async Task VerifyWithStaticFilesGeneratesCorrectDockerfileInPublishMode() 265public async Task VerifyPublishWithStaticFilesAddsEnvironmentVariableInPublishMode() 292public async Task VerifyPublishWithStaticFilesGeneratesCorrectDockerfile() 323public async Task VerifyPublishWithStaticFilesHandlesMissingSourceImageGracefully() 354public async Task VerifyPublishWithStaticFilesGeneratesCorrectDockerfileWithMultipleContainerFiles() 386public async Task VerifyPublishWithStaticFilesGeneratesCorrectDockerfileWithMultipleSourceContainerFiles() 424public async Task VerifyWithHostHttpsPortCreatesHttpsEndpointWithSpecifiedPort() 452public async Task VerifyWithHostHttpsPortDoesNotCreateHttpsEndpointWithoutCertificateConfiguration()
YarpConfigGeneratorTests.cs (3)
209public async Task GenerateConfiguration() 227public async Task GenerateEnvVariablesConfiguration() 264public async Task GenerateEnvVariablesConfigurationDockerCompose()
YarpFunctionalTests.cs (2)
21public async Task VerifyYarpResourceExtensionsConfig() 33private async Task VerifyYarpResource(Action<IResourceBuilder<YarpResource>, EndpointReference> configurator)
Aspire.Managed.Tests (20)
ParentProcessWatchdogTests.cs (4)
42public async Task ParentExitedCallback_StillForceExitsWhenCancellationCallbackThrows() 59public async Task CancellationBackstopFiresWhenCancellationCallbackBlocks() 71var cancellationTask = Task.Run(() => ParentProcessWatchdog.CancelAndForceExitAsync(
TerminalHostSignalTests.cs (15)
19public async Task TerminalHostSubcommandHandlesSigTermAndUnlinksSockets() 48var readyTask = WaitForFilesAsync(socketPaths, TimeSpan.FromSeconds(10)); 49var exitedTask = process.WaitForExitAsync(); 50if (await Task.WhenAny(readyTask, exitedTask) == exitedTask) 86public async Task TerminalHostSubcommandStopsWhenOwningAppHostIsGone() 90public async Task StandaloneTerminalHostStopsWhenOwningAppHostIsGone() 94private static async Task AssertTerminalHostStopsWhenOwningAppHostIsGoneAsync(string? hostAssemblyPath) 115var parentReadyTask = WaitForFilesAsync(parentSocketPaths, TimeSpan.FromSeconds(10)); 116var parentExitedTask = parentProcess.WaitForExitAsync(); 117if (await Task.WhenAny(parentReadyTask, parentExitedTask) == parentExitedTask) 145var readyTask = WaitForFilesAsync(socketPaths, TimeSpan.FromSeconds(20)); 146var exitedTask = process.WaitForExitAsync(); 147if (await Task.WhenAny(readyTask, exitedTask) == exitedTask) 234private static async Task WaitForFilesAsync(IEnumerable<string> paths, TimeSpan timeout) 245await Task.Delay(50);
tests\Shared\TemporaryWorkspace.cs (1)
27public async Task InitializeGitAsync(CancellationToken cancellationToken = default)
Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration.Tests (3)
ConformanceTests.cs (1)
97Task.Delay(1000).ConfigureAwait(false).GetAwaiter().GetResult();
tests\Aspire.Azure.Security.KeyVault.Tests\MockTransport.cs (2)
49private Task ProcessCore(HttpMessage message) 67return Task.CompletedTask;
Aspire.Milvus.Client.Tests (2)
AspireMilvusExtensionTests.cs (1)
115public async Task AddMilvusClient_HealthCheckShouldBeRegisteredByDefault(bool useKeyed)
MilvusHealthCheckTests.cs (1)
21public async Task HealthCheckReportsConnectionFailureDescription(bool useKeyed)
Aspire.MongoDB.Driver.Tests (2)
AspireMongoDBDriverExtensionsTests.cs (2)
120public async Task AddMongoDBDataSource_HealthCheckShouldBeRegisteredWhenEnabled() 162public async Task AddKeyedMongoDBDataSource_HealthCheckShouldBeRegisteredWhenEnabled()
Aspire.MongoDB.Driver.v2.Tests (2)
tests\Aspire.MongoDB.Driver.Tests\AspireMongoDBDriverExtensionsTests.cs (2)
120public async Task AddMongoDBDataSource_HealthCheckShouldBeRegisteredWhenEnabled() 162public async Task AddKeyedMongoDBDataSource_HealthCheckShouldBeRegisteredWhenEnabled()
Aspire.NATS.Net.Tests (2)
AspireNatsClientExtensionsTests.cs (2)
154public async Task AddNatsClient_HealthCheckShouldBeRegisteredByDefault(bool useKeyed) 182public async Task AddNatsClient_HealthCheckReportsConnectionFailureDescription(bool useKeyed)
Aspire.OpenAI.Tests (6)
AspireOpenAIClientBuilderChatClientExtensionsTests.cs (3)
199public async Task CanConfigurePipelineAsync(bool useKeyed) 229public async Task LogsCorrectly(bool useKeyed, bool disableOpenTelemetry) 269=> Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "Hello from middleware")));
AspireOpenAIClientBuilderEmbeddingGeneratorExtensionsTests.cs (3)
199public async Task CanConfigurePipelineAsync(bool useKeyed) 229public async Task LogsCorrectly(bool useKeyed, bool disableOpenTelemetry) 271return Task.FromResult(new GeneratedEmbeddings<Embedding<float>>(inputs.Select(i => new Embedding<float>(floats))));
Aspire.Playground.Tests (45)
AppHostTests.cs (4)
33public async Task TestEndpointsReturnOk(TestEndpoints testEndpoints) 40Task[]? waitForTextTasks = null; 64await Task.WhenAll(waitForTextTasks).WaitAsync(TimeSpan.FromMinutes(5)); 98await Task.WhenAll(waitForResourceTasks);
BlazorWasmHostingTests.cs (5)
20public async Task HostedBlazorWasm_ServesAppAndWeatherApi() 50public async Task HostedBlazorWasm_BrowserRendersWeatherAndSendsTelemetry() 101public async Task StandaloneBlazorWasm_GatewayServesAppAndWeatherApi() 131public async Task StandaloneBlazorWasm_BrowserRendersWeatherAndSendsTelemetry() 179private static async Task WaitForOtlpSignalsAsync(IPage page, ConcurrentBag<(string Url, int StatusCode)> otlpRequests)
Infrastructure\DistributedApplicationExtensions.cs (3)
86public static Task WaitForResource(this DistributedApplication app, string resourceName, string? targetState = null, CancellationToken cancellationToken = default) 99public static Task WaitForResources(this DistributedApplication app, IEnumerable<string>? targetStates = null, CancellationToken cancellationToken = default) 107return Task.WhenAll(applicationModel.Resources.Select(r => app.ResourceNotifications.WaitForResourceAsync(r.Name, r => targetStates?.Contains(r.Snapshot.State?.Text, StringComparer.OrdinalIgnoreCase) is true || r.Snapshot.IsHidden, cancellationToken)));
Infrastructure\DistributedApplicationTestFactory.cs (4)
55public Task OnBeforeStartAsync(BeforeStartEvent @event, CancellationToken cancellationToken = default) 70return Task.CompletedTask; 73public Task SubscribeAsync(IDistributedApplicationEventing eventing, Aspire.Hosting.DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken) 76return Task.CompletedTask;
ProjectSpecificTests.cs (4)
20public async Task WithDockerfileTest() 37public async Task KafkaTest() 64public async Task AzureFunctionsTest() 155internal static Task WaitForAllTextAsync(DistributedApplication app, IEnumerable<string> logTexts, string? resourceName = null, int timeoutSecs = -1)
tests\Aspire.Hosting.TestUtilities\Utils\LoggerNotificationExtensions.cs (10)
23public static Task WaitForTextAsync(this DistributedApplication app, string logText, string? resourceName = null, CancellationToken cancellationToken = default) 31public static async Task WaitForHealthyAsync<T>(this DistributedApplication app, IResourceBuilder<T> resource, CancellationToken cancellationToken = default) where T : IResource 47public static Task WaitForTextAsync(this DistributedApplication app, IEnumerable<string> logTexts, string? resourceName = null, CancellationToken cancellationToken = default) 62public static Task WaitForTextAsync(this DistributedApplication app, Predicate<string> predicate, CancellationToken cancellationToken = default) 73public static Task WaitForTextAsync(this DistributedApplication app, Predicate<string> predicate, string? resourceName = null, CancellationToken cancellationToken = default) 84_ = Task.Run(() => WatchNotifications(app, resourceName, predicate, tcs, watchCts), watchCts.Token); 97public static async Task WaitForAllTextAsync(this DistributedApplication app, IEnumerable<string> logTexts, string? resourceName = null, CancellationToken cancellationToken = default) 122private static async Task WatchNotifications(DistributedApplication app, string? resourceName, Predicate<string> predicate, TaskCompletionSource tcs, CancellationTokenSource cancellationTokenSource) 128var logWatchTasks = new List<Task>(); 160private static async Task WatchResourceLogs(TaskCompletionSource tcs, string resourceId, Predicate<string> predicate, ResourceLoggerService resourceLoggerService, CancellationTokenSource cancellationTokenSource)
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
Aspire.Qdrant.Client.Tests (2)
AspireQdrantClientExtensionsTest.cs (1)
32public async Task AddQdrantClient_HealthCheckShouldBeRegisteredWhenEnabled(bool useKeyed)
QdrantHealthCheckTests.cs (1)
20public async Task HealthCheckReportsConnectionFailureDescription(bool useKeyed)
Aspire.RabbitMQ.Client (1)
src\Components\Aspire.RabbitMQ.Client\AspireRabbitMQExtensions.cs (1)
182return Task.FromResult(new HealthCheckResult(context.Registration.FailureStatus, exception: ex));
Aspire.RabbitMQ.Client.Tests (5)
AspireRabbitMQExtensionsTests.cs (3)
164public async Task CanAddMultipleKeyedServices() 201public async Task AutoActivationCanSet(bool useKeyed, bool autoActivate) 238public async Task AutoActivationDisabledByDefault()
AspireRabbitMQLoggingTests.cs (1)
36public async Task EndToEndLoggingTest()
ConformanceTests.cs (1)
127Task.Run(async () =>
Aspire.RabbitMQ.Client.v6.Tests (4)
tests\Aspire.RabbitMQ.Client.Tests\AspireRabbitMQExtensionsTests.cs (3)
164public async Task CanAddMultipleKeyedServices() 201public async Task AutoActivationCanSet(bool useKeyed, bool autoActivate) 238public async Task AutoActivationDisabledByDefault()
tests\Aspire.RabbitMQ.Client.Tests\AspireRabbitMQLoggingTests.cs (1)
36public async Task EndToEndLoggingTest()
Aspire.Seq.Tests (3)
SeqEndpointCanBeConfigured.cs (3)
75public async Task HealthCheckDescriptionDoesNotExposeCredentialsFromServerUrl() 82var serverTask = WriteResponseAsync(listener, HttpStatusCode.ServiceUnavailable, serverCts.Token); 106private static async Task WriteResponseAsync(TcpListener listener, HttpStatusCode statusCode, CancellationToken cancellationToken)
Aspire.StackExchange.Redis.DistributedCaching (5)
AspireRedisDistributedCacheExtensions.cs (5)
44options.ConnectionMultiplexerFactory = () => Task.FromResult(sp.GetRequiredService<IConnectionMultiplexer>()); 74options.ConnectionMultiplexerFactory = () => Task.FromResult(sp.GetRequiredKeyedService<IConnectionMultiplexer>(name)); 108options.ConnectionMultiplexerFactory = () => Task.FromResult(sp.GetRequiredService<IConnectionMultiplexer>()); 112options.ConnectionMultiplexerFactory = () => Task.FromResult(sp.GetRequiredKeyedService<IConnectionMultiplexer>(key)); 168options.ConnectionMultiplexerFactory = () => Task.FromResult(sp.GetRequiredKeyedService<IConnectionMultiplexer>(builder.ServiceKey));
Aspire.StackExchange.Redis.DistributedCaching.Tests (2)
AspireRedisDistributedCacheExtensionsTests.cs (2)
46public async Task AddsRedisBuilderDistributedCacheCanConfigure() 73public async Task CanAddMultipleKeyedCachingServicesBuilder()
Aspire.StackExchange.Redis.OutputCaching (4)
AspireRedisOutputCacheExtensions.cs (4)
43options.ConnectionMultiplexerFactory = () => Task.FromResult(sp.GetRequiredService<IConnectionMultiplexer>()); 73options.ConnectionMultiplexerFactory = () => Task.FromResult(sp.GetRequiredKeyedService<IConnectionMultiplexer>(name)); 91options.ConnectionMultiplexerFactory = () => Task.FromResult(sp.GetRequiredService<IConnectionMultiplexer>()); 95options.ConnectionMultiplexerFactory = () => Task.FromResult(sp.GetRequiredKeyedService<IConnectionMultiplexer>(key));
Aspire.StackExchange.Redis.Tests (5)
AspireRedisExtensionsTests.cs (5)
302public async Task CanAddMultipleKeyedServices() 338public async Task CanAddMultipleKeyedCachingServices() 392public async Task CanAddMultipleKeyedCachingServicesBuilder() 446public async Task AutoActivationCanSet(bool useKeyed, bool autoActivate) 478public async Task AutoActivationDisabledByDefault()
Aspire.Templates.Tests (60)
AppHostTemplateTests.cs (1)
17public async Task EnsureProjectsReferencing8_1_0AppHostWithNewerWorkloadCanBuild()
BuildAndRunStarterTemplateBuiltInTest.cs (1)
33public async Task BuildAndRunStarterTemplateBuiltInTest_Test(string config, string testType)
BuildAndRunTemplateTests.cs (6)
34public async Task BuildAndRunAspireTemplate(string config) 48public async Task BuildAndRunAspireTemplateWithCentralPackageManagement() 114public async Task BuildAndRunAspireTemplateWithExplicitSdkReference(bool includeAspireHostingAppHostPackageReference) 169public async Task StarterTemplateNewAndRunWithoutExplicitBuild(string config) 186public async Task ProjectWithNoHTTPSRequiresExplicitOverrideWithEnvironmentVariable() 220public async Task CreateAndModifyAspireAppHostTemplate(string version)
EmptyTemplateRunTests.cs (1)
23public async Task ResourcesShowUpOnDashboad()
LocalhostTldHostnameTests.cs (1)
38public async Task LocalhostTld_GeneratesDnsCompliantHostnames(string templateName, string projectName, string expectedHostname, TestTargetFramework framework)
NewUpAndBuildStandaloneTemplateTests.cs (2)
15public async Task CanNewAndBuild(string templateName, string extraArgs, TestSdk sdk, TestTargetFramework tfm, string? error) 55private static async Task AssertStarterAspNetCoreTemplateContentAsync(AspireProject project, TestTargetFramework tfm)
NewUpAndBuildSupportProjectTemplatesTests.cs (8)
11protected async Task CanNewAndBuildActual(string templateName, string extraTestCreationArgs, TestSdk sdk, TestTargetFramework tfm, string? error) 68public Task CanNewAndBuild(string templateName, string extraTestCreationArgs, TestSdk sdk, TestTargetFramework tfm, string? error) 78public Task CanNewAndBuild(string templateName, string extraTestCreationArgs, TestSdk sdk, TestTargetFramework tfm, string? error) 88public Task CanNewAndBuild(string templateName, string extraTestCreationArgs, TestSdk sdk, TestTargetFramework tfm, string? error) 98public Task CanNewAndBuild(string templateName, string extraTestCreationArgs, TestSdk sdk, TestTargetFramework tfm, string? error) 108public Task CanNewAndBuild(string templateName, string extraTestCreationArgs, TestSdk sdk, TestTargetFramework tfm, string? error) 118public Task CanNewAndBuild(string templateName, string extraTestCreationArgs, TestSdk sdk, TestTargetFramework tfm, string? error) 128public Task CanNewAndBuild(string templateName, string extraTestCreationArgs, TestSdk sdk, TestTargetFramework tfm, string? error)
PerTestFrameworkTemplatesTests.cs (2)
27public async Task TemplatesForIndividualTestFrameworks(string prefix) 58async Task AssertBasicTemplateAsync(IBrowserContext context)
StarterTemplateProjectNamesTests.cs (1)
26public async Task StarterTemplateWithTest_ProjectNames(string prefix)
StarterTemplateRunTestsBase.cs (6)
28public async Task ResourcesShowUpOnDashboard() 43public async Task WebFrontendWorks(string urlPrefix) 64public async Task ApiServiceWorks(string urlPrefix) 79public static async Task CheckApiServiceWorksAsync(string url, ITestOutputHelper testOutput, string logPath) 90public static async Task CheckWebFrontendWorksAsync(IBrowserContext context, string url, ITestOutputHelper testOutput, string logPath, bool hasRedisCache = false) 109await Task.Delay(10_000);
TemplateTestsBase.cs (5)
35var t = Task.Run(async () => await PlaywrightProvider.CreateBrowserAsync()); 54Func<AspireProject, Task>? onBuildAspireProject = null, 180await Task.Delay(500); 203await Task.Delay(500); 285public static async Task AssertStarterTemplateRunAsync(IBrowserContext? context, AspireProject project, string config, ITestOutputHelper _testOutput)
tests\Shared\TemplatesTesting\AspireProject.cs (19)
163public async Task StartAppHostAsync(string[]? extraArgs = default, Action<ProcessStartInfo>? configureProcess = null, bool noBuild = true, bool waitForDashboardUrl = true, CancellationToken token = default) 270var tasksToWaitFor = new List<Task> { appRunning.Task, projectsParsed.Task }; 276var successfulStartupTask = Task.WhenAll(tasksToWaitFor); 277var startupTimeoutTask = Task.Delay(TimeSpan.FromSeconds(AppStartupWaitTimeoutSecs), token); 280var resultTask = await Task.WhenAny(successfulStartupTask, AppExited.Task, startupTimeoutTask).ConfigureAwait(false); 299var allOutputCompleteTask = Task.WhenAll(stdoutComplete.Task, stderrComplete.Task); 300var allOutputCompleteTimeoutTask = Task.Delay(TimeSpan.FromSeconds(5), token); 301var completedTask = await Task.WhenAny(allOutputCompleteTask, allOutputCompleteTimeoutTask).ConfigureAwait(false); 399public Task WaitForDashboardToBeAvailableAsync(CancellationToken cancellationToken = default) 409public static async Task WaitForDashboardToBeAvailableAsync(string dashboardUrl, ITestOutputHelper testOutput, CancellationToken token = default) 418public async Task StopAppHostAsync(CancellationToken token = default) 447public async Task DumpDockerInfoAsync(ITestOutputHelper? testOutputArg = null, CancellationToken cancellationToken = default) 464public async Task DumpComponentLogsAsync(string component, ITestOutputHelper? testOutputArg = null)
tests\Shared\TemplatesTesting\ProjectInfo.cs (2)
39public async Task WaitForHealthyStatusAsync(string bindingName, ITestOutputHelper testOutput, CancellationToken cancellationToken = default) 54await Task.Delay(100, cancellationToken);
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
35public async Task EnsureInstalledAsync(BuildEnvironment buildEnvironment)
tests\Shared\TemplatesTesting\ToolCommand.cs (4)
163var waitForExitTask = CurrentProcess.WaitForExitAsync(token); 164var completedTask = await Task.WhenAny(waitForExitTask, Task.Delay(TimeSpan.FromSeconds(5), token)).ConfigureAwait(false);
Aspire.TerminalHost (43)
DcpUpstreamAdapter.cs (6)
71private Task? _readPump; 189private async Task EnsureConnectedAsync(CancellationToken ct) 236_readPump = Task.Run(() => ReadPumpAsync(_disposeCts.Token), _disposeCts.Token); 261private async Task ApplyPendingResizeAsync(int width, int height) 278private async Task WriteFrameAsync(byte type, ReadOnlyMemory<byte> payload, CancellationToken ct) 351private async Task ReadPumpAsync(CancellationToken ct)
src\Shared\ParentProcessLivenessMonitor.cs (6)
16private readonly Task _monitorTask; 22Func<CancellationToken, Task> onParentExited, 44Func<CancellationToken, Task> onParentExited, 51private static async Task MonitorAsync( 54Func<CancellationToken, Task> onParentExited, 64await Task.Yield();
src\Shared\ParentProcessWatchdog.cs (4)
93internal static async Task CancelAndForceExitAsync( 101var forceExitTask = ForceExitAfterDelayAsync(stopToken, forceExitGracePeriod, exit); 123private static async Task ForceExitAfterDelayAsync( 128await Task.Delay(forceExitGracePeriod, stopToken).ConfigureAwait(false);
TerminalHostApp.cs (7)
141var replicaRun = replica.RunTask; 177private static async Task WaitForShutdownAsync(Task replicaRunTask, CancellationToken cancellationToken) 185var cancellation = Task.Delay(Timeout.Infinite, cancellationToken); 188await Task.WhenAny(cancellation, replicaRunTask).ConfigureAwait(false); 208private async Task TearDownAsync()
TerminalHostControlListener.cs (7)
21private Task? _acceptLoop; 51public Task StartAsync() 114_acceptLoop = Task.Run(() => AcceptLoopAsync(_disposeCts.Token)); 115return Task.CompletedTask; 118private async Task AcceptLoopAsync(CancellationToken cancellationToken) 195_ = Task.Run(() => ServeClientAsync(client, cancellationToken), cancellationToken); 199private async Task ServeClientAsync(Socket client, CancellationToken cancellationToken)
TerminalHostControlRpcTarget.cs (4)
32return Task.FromResult(_app.SnapshotSession()); 49return Task.FromResult(new TerminalHostInfoResponse 59public Task ShutdownAsync(CancellationToken cancellationToken = default) 63return Task.CompletedTask;
TerminalReplica.cs (9)
50private readonly Task _runTask; 164public Task RunTask => _runTask; 183_runTask = Task.Run(() => RecycleLoopAsync(_stopCts.Token), _stopCts.Token); 217private async Task RecycleLoopAsync(CancellationToken ct) 342await Task.Delay(delay, ct).ConfigureAwait(false); 455return Task.CompletedTask; 475return Task.CompletedTask; 564private async Task ApplyRestrictiveSocketPermissionsAsync(string path, CancellationToken ct) 596await Task.Delay(10, ct).ConfigureAwait(false);
Aspire.TerminalHost.Tests (47)
TerminalHostAppTests.cs (31)
47public async Task RunAsyncBindsControlListenerWhenStarted() 70public async Task ControlEndpointReturnsSessionInfo() 102public async Task ShutdownRequestCausesRunAsyncToReturn() 124public async Task ConcurrentControlConnectsAreRefusedDownToOne() 149var connectTasks = new Task[concurrency]; 158await Task.WhenAll(connectTasks).WaitAsync(TimeSpan.FromSeconds(10)); 164var results = await Task.WhenAll(rawSockets.Select(TryGetInfoAsync)); 207public async Task SnapshotSessionReportsConfiguredPaths() 233public async Task RunAsyncWithBadArgsViaStaticEntryPointReturnsExUsage() 240public async Task HostStartsCleanlyWithStaleProducerAndConsumerSocketFiles() 293public async Task SessionRecyclesAfterProducerDisconnect() 376public async Task GracefulCancellationDeletesProducerAndConsumerSockets() 426public async Task SessionSnapshotIncludesNewFields() 457public async Task DownstreamPrimaryResizeIsForwardedUpstreamAsRawResizeFrame() 571public async Task SendHelloAsync(int width, int height, CancellationToken ct) 577public Task SendOutputAsync(byte[] payload, CancellationToken ct) => 622private async Task ReadExactlyAsync(byte[] buffer, CancellationToken ct) 637private async Task SendFrameAsync(byte type, byte[] payload, CancellationToken ct) 684await Task.Delay(50).ConfigureAwait(false); 729await Task.Delay(50).ConfigureAwait(false); 736public async Task SendClientHelloAsync(string displayName, string defaultRole, CancellationToken ct) 744public async Task SendRequestPrimaryAsync(int cols, int rows, CancellationToken ct) 750private async Task SendFrameAsync(byte type, byte[] payload, CancellationToken ct) 778private static async Task WaitForAsync(Func<bool> predicate, TimeSpan timeout, string failureMessage) 787await Task.Delay(25).ConfigureAwait(false); 814public async Task ControlSocketIsRestrictedToOwningUser() 849public async Task ProducerAndConsumerSocketsAreRestrictedToOwningUser() 893private static async Task WaitForUnixFileModeAsync(string path, UnixFileMode expected, TimeSpan timeout) 922await Task.Delay(50); 929private static async Task WaitForFileAsync(string path, TimeSpan timeout) 938await Task.Delay(50);
tests\Shared\AsyncTestHelpers.cs (15)
83public static Task DefaultTimeout(this Task task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 93public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 98public static Task DefaultTimeout(this ValueTask task, int milliseconds = -1, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 108public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = default) 176public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 215public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILogger? logger = null, int retries = 10) 217return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger, retries); 220public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10) 228await Task.Delay((i + 1) * (i + 1) * 10 * 5); 241public static Task WaitForCancellationAsync(CancellationToken token) 256public static Task WaitUntilCancelledAsync(this CancellationToken token) 260return Task.CompletedTask;
tests\Shared\TemporaryWorkspace.cs (1)
27public async Task InitializeGitAsync(CancellationToken cancellationToken = default)
Aspire.TestTools (8)
GitHubActionsApi.cs (1)
94public static Task DownloadArtifactZipAsync(string repository, long artifactId, string outputPath, CancellationToken cancellationToken)
GitHubCli.cs (7)
42return Task.FromException<string>(new InvalidOperationException(File.ReadAllText(fixturePath))); 61public static async Task DownloadFileAsync(string endpoint, string outputPath, CancellationToken cancellationToken) 183public static async Task ReopenIssueAsync(string repository, int issueNumber, CancellationToken cancellationToken) 201public static async Task AddIssueCommentAsync(string repository, int issueNumber, string body, CancellationToken cancellationToken) 293private static async Task RunGhToFileAsync(IReadOnlyList<string> arguments, string outputPath, CancellationToken cancellationToken) 321var stdoutTask = process.StandardOutput.BaseStream.CopyToAsync(outputStream, cts.Token); 326await Task.WhenAll(process.WaitForExitAsync(cts.Token), stdoutTask, stderrTask).ConfigureAwait(false);
AspireWithNode.AppHost (1)
AppHost.cs (1)
39return Task.CompletedTask;
AzureKusto.Worker (4)
IngestionWorker.cs (2)
30protected override async Task ExecuteAsync(CancellationToken stoppingToken) 43private async Task IngestFromDataReaderAsync(CancellationToken stoppingToken)
QueryWorker.cs (2)
30protected override async Task ExecuteAsync(CancellationToken stoppingToken) 35await Task.Delay(TimeSpan.FromSeconds(1), stoppingToken);
AzureSearch.ApiService (6)
Program.cs (6)
44static async Task DeleteIfExistsAsync(ILogger logger, string indexName, SearchIndexClient searchIndexClient, CancellationToken cancellationToken) 60static async Task CreateIndexAsync(ILogger logger, string indexName, SearchIndexClient indexClient, CancellationToken cancellationToken) 70static async Task WriteDocumentsAsync(ILogger logger, SearchResults<Hotel> searchResults, CancellationToken cancellationToken) 78static async Task RunQueriesAsync(ILogger logger, SearchClient searchClient, CancellationToken cancellationToken) 145static async Task UploadDocumentsAsync(ILogger logger, SearchClient searchClient, CancellationToken cancellationToken) 172await Task.Delay(TimeSpan.FromSeconds(2), cancellationToken);
AzureStorageEndToEnd.ApiService (1)
Program.cs (1)
41static async Task ReadBlobsAsync(BlobContainerClient containerClient, List<string> output)
AzureVirtualNetworkEndToEnd.ApiService (1)
Program.cs (1)
70static async Task ReadBlobsAsync(BlobContainerClient containerClient, List<string> output)
Binding.Http.IntegrationTests (5)
BasicHttpBindingTests.4.0.0.cs (2)
118return Task.FromResult((HttpResponseMessage)null); 176return Task.FromResult((HttpResponseMessage)null);
OperationContextTests.cs (3)
30public static async Task OperationContextLegacyBehavior() 49await Task.Yield(); 59await Task.Yield(); // Hop back to original sync context
Binding.ReliableSession.IntegrationTests (26)
NetHttpBindingTests.cs (11)
23public static async Task EchoCall(ReliableMessagingVersion rmVersion, bool ordered, string endpointSuffix) 62public static async Task OneWayCall(ReliableMessagingVersion rmVersion, bool ordered, string endpointSuffix) 100public static async Task ResendFailedRequest(ReliableMessagingVersion rmVersion, bool ordered, string endpointSuffix) 146return Task.FromResult(response); 184public static async Task RetryCountApplied(ReliableMessagingVersion rmVersion, bool ordered, string endpointSuffix) 242await Task.Delay((int)sw.ElapsedMilliseconds * 10); 266public static async Task MaxTransferWindowSizeApplied(ReliableMessagingVersion rmVersion, bool ordered, string endpointSuffix) 328await Task.Delay((int)sw.ElapsedMilliseconds * 6); 355public static async Task InactivityTimeoutApplied(ReliableMessagingVersion rmVersion, bool ordered, string endpointSuffix) 378return Task.FromResult<HttpResponseMessage>(null); 387await Task.Delay(keepAliveInterval * 1.1);
NetTcpBindingTests.cs (4)
18public static async Task EchoCall(ReliableMessagingVersion rmVersion, bool ordered, string endpointSuffix) 56public static async Task OneWayCall(ReliableMessagingVersion rmVersion, bool ordered, string endpointSuffix) 93public static async Task DuplexEchoCall(ReliableMessagingVersion rmVersion, bool ordered, string endpointSuffix) 137return Task.FromResult(echo);
WSHttpBindingTests.cs (11)
23public static async Task EchoCall(ReliableMessagingVersion rmVersion, bool ordered, string endpointSuffix) 62public static async Task OneWayCall(ReliableMessagingVersion rmVersion, bool ordered, string endpointSuffix) 100public static async Task ResendFailedRequest(ReliableMessagingVersion rmVersion, bool ordered, string endpointSuffix) 146return Task.FromResult(response); 184public static async Task RetryCountApplied(ReliableMessagingVersion rmVersion, bool ordered, string endpointSuffix) 242await Task.Delay((int)sw.ElapsedMilliseconds * 10); 266public static async Task MaxTransferWindowSizeApplied(ReliableMessagingVersion rmVersion, bool ordered, string endpointSuffix) 328await Task.Delay((int)sw.ElapsedMilliseconds * 6); 355public static async Task InactivityTimeoutApplied(ReliableMessagingVersion rmVersion, bool ordered, string endpointSuffix) 378return Task.FromResult<HttpResponseMessage>(null); 387await Task.Delay(keepAliveInterval * 1.1);
Binding.Tcp.IntegrationTests (15)
NetTcpBindingTests.4.0.0.cs (2)
50public static async Task SecurityModeNone_Echo_RoundTrips_String_SyncAfterAsync() 88public static async Task SecurityModeNone_Echo_RoundTrips_Task_SyncAfterAsync()
OperationContextAsyncFlowTests.cs (13)
17public static async Task OperationContextScopeAsyncFlow() 36await Task.Yield(); 46await Task.Yield(); // Hop back to original sync context 52public static async Task OperationContextScopeNestedAsyncFlow() 71await Task.Yield(); 79await Task.Yield(); 93await Task.Yield(); // Hop back to original sync context 100public static async Task OperationContextCallbackAsyncFlow() 149public Task CallCompletedTask => _tcs.Task; 151public async Task OnPingCallbackAsync(Guid guid) 162await Task.Yield(); 175await Task.Yield(); // Hop back to original sync context 190Task OnPingCallbackAsync(Guid guid);
Binding.WS.TransportWithMessageCredentialSecurity.IntegrationTests (2)
WSNetTcpTransportWithMessageCredentialSecurityTests.cs (2)
121bool success = Task.Run(() => 125Task.Factory.StartNew(() => NetTcp_SecModeTransWithMessCred_UserNameClientCredential_Succeeds(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
blazor-gateway (1)
BlazorGateway.cs (1)
173Task.FromResult(lifetime.ApplicationStopping.IsCancellationRequested
BlazorHosted.ClientServiceDefaults (2)
BackgroundExportHandler.cs (2)
30return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK)); 33private async Task SendWithRetryAsync(
BlazorStandalone.ClientServiceDefaults (2)
BackgroundExportHandler.cs (2)
34return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK)); 37private async Task SendWithRetryAsync(
CatalogDb (8)
CatalogDbInitializer.cs (3)
13protected override async Task ExecuteAsync(CancellationToken cancellationToken) 22public async Task InitializeDatabaseAsync(CatalogDbContext dbContext, CancellationToken cancellationToken = default) 34private async Task SeedAsync(CatalogDbContext dbContext, CancellationToken cancellationToken)
CatalogDbInitializerHealthCheck.cs (5)
9var task = dbInitializer.ExecuteTask; 13{ IsCompletedSuccessfully: true } => Task.FromResult(HealthCheckResult.Healthy()), 14{ IsFaulted: true } => Task.FromResult(HealthCheckResult.Unhealthy(task.Exception?.InnerException?.Message, task.Exception)), 15{ IsCanceled: true } => Task.FromResult(HealthCheckResult.Unhealthy("Database initialization was canceled")), 16_ => Task.FromResult(HealthCheckResult.Degraded("Database initialization is still in progress"))
Client.ChannelLayer.IntegrationTests (32)
DuplexChannelShapeTests.4.0.0.cs (14)
93Task.Factory.FromAsync(factory.BeginOpen, factory.EndOpen, TaskCreationOptions.None).GetAwaiter().GetResult(); 97Task.Factory.FromAsync(channel.BeginOpen, channel.EndOpen, TaskCreationOptions.None).GetAwaiter().GetResult(); 108Task.Factory.FromAsync((asyncCallback, o) => channel.BeginSend(requestMessage, asyncCallback, o), 111replyMessage = Task.Factory.FromAsync(channel.BeginReceive, channel.EndReceive, TaskCreationOptions.None).GetAwaiter().GetResult(); 125Task.Factory.FromAsync(channel.BeginClose, channel.EndClose, TaskCreationOptions.None).GetAwaiter().GetResult(); 126Task.Factory.FromAsync(factory.BeginClose, factory.EndClose, TaskCreationOptions.None).GetAwaiter().GetResult(); 152Task task = channel.DoWorkAsync(); 181Task task = channel.DoWorkAsync(); 204public async Task CallWithWaitAsync(int delayTime) 207await Task.Delay(delayTime); 210await Task.Delay(100); 225public async Task CallWithWaitAsync(int delayTime) 228await Task.Delay(delayTime); 231await Task.Delay(100);
DuplexChannelWithSynchronizationContext.cs (8)
39Task syncCtxTask = syncCtx.RunOnThreadPoolThread(); 100Task syncCtxTask = syncCtx.RunOnThreadPoolThread(); 151bool success = Task.Run(() => 155Task.Factory.StartNew(() => SingleThreadedSyncContext_CallbackUsingDefaultSyncCtx_SyncCallNotBlocked_Helper(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 216bool success = Task.Run(() => 220Task.Factory.StartNew(() => SingleThreadedSyncContext_SyncCallNotBlocked_Helper(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 266Task.Run(async () => 268await Task.Delay(100);
RequestReplyChannelShapeTests.4.0.0.cs (10)
143Task.Factory.FromAsync(factory.BeginOpen, factory.EndOpen, TaskCreationOptions.None).GetAwaiter().GetResult(); 147Task.Factory.FromAsync(channel.BeginOpen, channel.EndOpen, TaskCreationOptions.None).GetAwaiter().GetResult(); 157replyMessage = Task.Factory.FromAsync((asyncCallback, o) => channel.BeginRequest(requestMessage, asyncCallback, o), 171Task.Factory.FromAsync(channel.BeginClose, channel.EndClose, TaskCreationOptions.None).GetAwaiter().GetResult(); 172Task.Factory.FromAsync(factory.BeginClose, factory.EndClose, TaskCreationOptions.None).GetAwaiter().GetResult(); 199Task.Factory.FromAsync(factory.BeginOpen, factory.EndOpen, TaskCreationOptions.None).GetAwaiter().GetResult(); 203Task.Factory.FromAsync(channel.BeginOpen, channel.EndOpen, TaskCreationOptions.None).GetAwaiter().GetResult(); 213replyMessage = Task.Factory.FromAsync((asyncCallback, o) => channel.BeginRequest(requestMessage, asyncCallback, o), 228Task.Factory.FromAsync(channel.BeginClose, channel.EndClose, TaskCreationOptions.None).GetAwaiter().GetResult(); 229Task.Factory.FromAsync(factory.BeginClose, factory.EndClose, TaskCreationOptions.None).GetAwaiter().GetResult();
Client.ClientBase.IntegrationTests (1)
DuplexClientBaseTests.4.1.0.cs (1)
83Task.Run(() => proxy.Ping(guid));
Client.ExpectedExceptions.IntegrationTests (6)
ExpectedExceptionTests.4.0.0.cs (3)
283Task.Delay(500).Wait(); 288Task.Delay(100).Wait(); 328tasks[i] = Task.Run(callFunc);
ExpectedExceptionTests.4.1.0.cs (3)
533Task.Delay(500).Wait(); 538Task.Delay(100).Wait(); 578tasks[i] = Task.Run(callFunc);
Client.TypedClient.IntegrationTests (14)
TypedProxyTests.4.0.0.cs (10)
68bool success = Task.Run(() => 72Task.Factory.StartNew(() => TypedProxyTests.ServiceContract_TypedProxy_AsyncBeginEnd_Call(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 102bool success = Task.Run(() => 106Task.Factory.StartNew(() => TypedProxyTests.ServiceContract_TypedProxy_AsyncTask_Call(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 156bool success = Task.Run(() => 160Task.Factory.StartNew(() => TypedProxyTests.ServiceContract_TypedProxy_Synchronous_Call(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 188bool success = Task.Run(() => 571public static async Task ServiceContract_TypedProxy_Task_Call_AsyncLocal_NonCapture() 598await Task.Yield(); 613await Task.Yield();
TypedProxyTests.4.1.0.cs (4)
22bool success = Task.Run(() => 26Task.Factory.StartNew(() => TypedProxyTests.ServiceContract_TypedProxy_NetTcpBinding_AsyncBeginEnd_Call(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 36bool success = Task.Run(() => 40Task.Factory.StartNew(() => TypedProxyTests.ServiceContract_TypedProxy_NetTcpBinding_AsyncTask_Call(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
CodeStyleConfigFileGenerator (4)
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
232public static Task ReportNonFatalErrorAsync(this Task task) 242public static Task ReportNonFatalErrorUnlessCancelledAsync(this Task task, CancellationToken cancellationToken)
Consumer (3)
ConsumerWorker.cs (3)
10protected override Task ExecuteAsync(CancellationToken stoppingToken) 13return Task.Factory.StartNew(async () => 29await Task.Delay(100);
Contract.Service.IntegrationTests (30)
ServiceContractTests.4.0.0.cs (16)
307Task t = Task.Factory.FromAsync(factory.BeginOpen, factory.EndOpen, TaskCreationOptions.None); 332bool success = Task.Run(() => 336Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_Async_Open_ChannelFactory(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 361Task t = Task.Factory.FromAsync(proxyAsCommunicationObject.BeginOpen, proxyAsCommunicationObject.EndOpen, TaskCreationOptions.None); 385bool success = Task.Run(() => 389Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_Async_Open_Proxy(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 416Task t = Task.Factory.FromAsync(factory.BeginClose, factory.EndClose, TaskCreationOptions.None); 436bool success = Task.Run(() => 440Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_Async_Close_ChannelFactory(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 465Task t = Task.Factory.FromAsync(proxyAsCommunicationObject.BeginClose, proxyAsCommunicationObject.EndClose, TaskCreationOptions.None); 486bool success = Task.Run(() => 490Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_Async_Close_Proxy(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
ServiceContractTests.4.1.0.cs (14)
206bool success = Task.Run(() => 210Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_DefaultSettings_Echo_RoundTrips_String_Streamed(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 220bool success = Task.Run(() => 224Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_DefaultSettings_Echo_RoundTrips_String_Streamed_Async(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 260Task.Delay(sendTimeoutMs * 2).Wait(); 269Task.Delay(sendTimeoutMs * 2).Wait(); 320Task.Delay(sendTimeoutMs * 2).Wait(); 326Task.Delay(sendTimeoutMs * 2).Wait(); 610bool success = Task.Run(() => 614Task.Factory.StartNew(() => ServiceContractTests.NetTcp_NoSecurity_Streamed_RoundTrips_String(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 624bool success = Task.Run(() => 628Task.Factory.StartNew(() => ServiceContractTests.NetTcp_NoSecurity_Streamed_Async_RoundTrips_String(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 879Task factoryTask = Task.Factory.FromAsync(factory.BeginClose, factory.EndClose, TaskCreationOptions.None);
csc (13)
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (3)
160public async Task WriteAsync(Stream outStream, CancellationToken cancellationToken = default(CancellationToken)) 282public async Task WriteAsync(Stream outStream, 675internal static async Task ReadAllAsync(
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (10)
163internal static async Task WaitForServerProcessExitAsync( 173await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken).ConfigureAwait(false); 240return Task.FromResult<NamedPipeClientStream?>(null); 251return Task.FromResult<NamedPipeClientStream?>(null); 271return Task.FromResult<NamedPipeClientStream?>(null); 315var monitorTask = MonitorDisconnectAsync(pipeStream, request.RequestId, logger, serverCts.Token); 316await Task.WhenAny(responseTask, monitorTask).ConfigureAwait(false); 352internal static async Task MonitorDisconnectAsync( 365await Task.Delay(millisecondsDelay: 100, cancellationToken).ConfigureAwait(false); 414await Task.Run(() => pipeStream.ConnectAsync(timeoutMs, cancellationToken), cancellationToken).ConfigureAwait(false);
CustomResources.AppHost (7)
TalkingClockResource.cs (2)
107await Task.Delay(1000, token); 117await Task.Delay(1000, token);
TestResource.cs (5)
39public Task OnBeforeStartAsync(BeforeStartEvent @event, CancellationToken cancellationToken = default) 48Task.Run(async () => 76return Task.CompletedTask; 85public Task SubscribeAsync(IDistributedApplicationEventing eventing, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken) 88return Task.CompletedTask;
DatabaseMigration.MigrationService (3)
ApiDbInitializer.cs (3)
20protected override async Task ExecuteAsync(CancellationToken cancellationToken) 41private static async Task EnsureDatabaseAsync(MyDb1Context dbContext, CancellationToken cancellationToken) 57private static async Task RunMigrationAsync(MyDb1Context dbContext, CancellationToken cancellationToken)
datacollector (2)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (2)
139Task.Delay(1000).GetAwaiter().GetResult(); 161Task.Delay(1000).Wait();
datacollector.arm64 (2)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (2)
139Task.Delay(1000).GetAwaiter().GetResult(); 161Task.Delay(1000).Wait();
dotnet (109)
CommandFactory\CommandResolution\ProjectToolsCommandResolver.cs (1)
235lockedToken => Task.FromResult(File.Exists(path)),
Commands\BuildServer\Shutdown\BuildServerShutdownCommand.cs (6)
83private List<(IBuildServer, Task)> StartShutdown() 85var tasks = new List<(IBuildServer, Task)>(); 89tasks.Add((server, Task.Run(() => server.Shutdown()))); 95private int WaitForResult(Task[] tasks) 99return Task.WaitAny(tasks.First()); 101return Task.WaitAny(tasks);
Commands\New\BuiltInTemplatePackageProvider.cs (1)
41return Task.FromResult<IReadOnlyList<ITemplatePackage>>(packages);
Commands\New\MSBuildEvaluation\ProjectCapabilityConstraint.cs (1)
34return Task.FromResult((ITemplateConstraint)new ProjectCapabilityConstraint(environmentSettings, this, evaluationResult));
Commands\New\MSBuildEvaluation\ProjectContextSymbolSource.cs (6)
35return Task.FromResult((string?)null); 42return Task.FromResult((string?)null); 47return Task.FromResult((string?)null); 60Task.FromResult(propertyValue); 65return Task.FromResult(propertyValue); 70return Task.FromResult((string?)null);
Commands\New\OptionalWorkloadProvider.cs (1)
46return Task.FromResult<IReadOnlyList<ITemplatePackage>>(list);
Commands\New\SdkInfoProvider.cs (2)
34return Task.FromResult(Product.Version); 61return Task.FromResult(sdks);
Commands\New\WorkloadsInfoProvider.cs (1)
18return Task.FromResult(
Commands\Restore\RestoringCommand.cs (1)
44Task.Run(() => WorkloadManifestUpdater.BackgroundUpdateAdvertisingManifestsAsync(userProfileDir));
Commands\Sdk\Check\ProductCollectionProvider.cs (3)
17return uri != null ? Task.Run(() => ProductCollection.GetAsync(uri.ToString())).Result : 18filePath != null ? Task.Run(() => ProductCollection.GetFromFileAsync(filePath, false)).Result : 19Task.Run(() => ProductCollection.GetAsync()).Result;
Commands\Solution\Add\SolutionAddCommand.cs (1)
129private async Task AddProjectsToSolutionAsync(IEnumerable<string> projectPaths, CancellationToken cancellationToken)
Commands\Solution\Migrate\SolutionMigrateCommand.cs (1)
45private async Task ConvertToSlnxAsync(string filePath, string slnxFilePath, CancellationToken cancellationToken)
Commands\Solution\Remove\SolutionRemoveCommand.cs (1)
67private static async Task RemoveProjectsAsync(string solutionFileFullPath, IEnumerable<string> projectPaths, CancellationToken cancellationToken)
Commands\Test\MTP\ArtifactPostProcessingManager.cs (2)
66public async Task ExecuteAsync( 85private async Task ExecuteCoreAsync(
Commands\Test\MTP\IPC\HttpTestHostGateway.cs (4)
23private readonly Task _listenerTask; 81private async Task ListenAsync(CancellationToken cancellationToken) 102private async Task HandleRequestAsync(HttpListenerContext context, CancellationToken cancellationToken) 322private static async Task CompleteErrorResponseAsync(
Commands\Test\MTP\IPC\NamedPipeServer.cs (4)
24private Task? _loopTask; 50public async Task WaitConnectionAsync(CancellationToken cancellationToken) 54_loopTask = Task.Run( 75private async Task InternalLoopAsync(CancellationToken cancellationToken)
Commands\Test\MTP\TestApplication.cs (23)
35/// Largest timeout <see cref="Task.WaitAsync(TimeSpan)"/> accepts, in seconds. Anything above 95var testAppPipeConnectionLoop = _httpGateway is null 96? Task.Run(async () => await WaitConnectionAsync(cancellationToken)) 97: Task.CompletedTask; 98var controlPipeConnectionLoop = _httpGateway is null 99? Task.Run(async () => await WaitControlConnectionAsync(cancellationToken)) 100: Task.CompletedTask; 127var stdOutTask = Task.Factory.StartNew(() => 137var stdErrTask = Task.Factory.StartNew(() => 152Task processExitTask = process.WaitForExitAsync(); 155Task firstCompletedTask = await Task.WhenAny(processExitTask, testRunPolicy.Cancellation); 216await Task.WhenAll(stdOutTask, stdErrTask).WaitAsync(TimeSpan.FromSeconds(5)); 274await Task.WhenAll(testAppPipeConnectionLoop, controlPipeConnectionLoop); 600private async Task WaitConnectionAsync(CancellationToken token) 626private async Task WaitControlConnectionAsync(CancellationToken token) 675return Task.FromResult<IResponse>(new ServerControlMessage(ServerControlKinds.CancelSession)); 716return Task.FromResult<IResponse>(VoidResponse.CachedInstance); 744return Task.FromResult((IResponse)CreateHandshakeMessage( 783return Task.FromResult((IResponse)VoidResponse.CachedInstance); 806return Task.FromResult((IResponse)VoidResponse.CachedInstance);
Commands\Test\MTP\TestApplicationActionQueue.cs (5)
14private readonly Task[] _readers; 34_readers = new Task[degreeOfParallelism]; 39_readers[i] = Task.Run(async () => await Read( 69Task.WaitAll(_readers); 76private async Task Read(
Commands\Workload\Install\FileBasedInstaller.cs (1)
657public Task ExtractManifestAsync(string nupkgPath, string targetPath)
Commands\Workload\Install\FileBasedManifestInstaller.cs (1)
39public async Task ExtractManifestAsync(string nupkgPath, string targetPath)
Commands\Workload\Install\IWorkloadManifestInstaller.cs (1)
13Task ExtractManifestAsync(string nupkgPath, string targetPath);
Commands\Workload\Install\IWorkloadManifestUpdater.cs (2)
13Task UpdateAdvertisingManifestsAsync(bool includePreviews, bool useWorkloadSets = false, DirectoryPath? offlineCache = null); 15Task BackgroundUpdateAdvertisingManifestsWhenRequiredAsync();
Commands\Workload\Install\WorkloadAdvertisingManifestUpdater.cs (5)
64public async Task UpdateAdvertisingManifestsAsync(bool includePreviews, bool useWorkloadSets = false, DirectoryPath? offlineCache = null) 74await Task.WhenAll(manifests.Select(manifest => UpdateAdvertisingManifestAsync(manifest, includePreviews, offlineCache))).ConfigureAwait(false); 79public async Task BackgroundUpdateAdvertisingManifestsWhenRequiredAsync() 273private async Task UpdateAdvertisingManifestAsync(WorkloadManifestInfo manifest, bool includePreviews, DirectoryPath? offlineCache = null) 345var availableUpdates = await Task.WhenAll(manifests.Select(manifest => NewerManifestPackageExists(manifest))).ConfigureAwait(false);
Commands\Workload\Install\WorkloadInstallCommand.cs (1)
340private Task DownloadToOfflineCacheAsync(IEnumerable<WorkloadId> workloadIds, DirectoryPath offlineCache, bool skipManifestUpdate, bool includePreviews)
Commands\Workload\Install\WorkloadManifestUpdater.cs (1)
76public static async Task BackgroundUpdateAdvertisingManifestsAsync(string userProfileDir)
Commands\Workload\Install\WorkloadManifestUpdater.Managed.cs (2)
56public Task UpdateAdvertisingManifestsAsync( 62public Task BackgroundUpdateAdvertisingManifestsWhenRequiredAsync()
Commands\Workload\Update\WorkloadUpdateCommand.cs (1)
205private async Task DownloadToOfflineCacheAsync(DirectoryPath offlineCache, bool includePreviews)
NugetPackageDownloader\NuGetConsoleLogger.cs (4)
43public Task LogAsync(LogLevel level, string data) 46return Task.CompletedTask; 49public Task LogAsync(ILogMessage message) 52return Task.CompletedTask;
NugetPackageDownloader\NuGetPackageDownloader.cs (10)
33private readonly Func<IEnumerable<Task>> _retryTimer; 71Func<IEnumerable<Task>> timer = null, 252private async Task VerifySigning(string nupkgPath, SourceRepository repository) 663await Task.WhenAll( 749await Task.WhenAll( 884await Task.WhenAny(tasks).ConfigureAwait(false); 970var autoCompletes = await Task.WhenAll(packagesSources.Select(async (source) => await GetAutocompleteAsync(source, cancellationToken).ConfigureAwait(false))).ConfigureAwait(false); 975var packageIdLists = await Task.WhenAll(packageIdTasks).ConfigureAwait(false); 984var autoCompletes = await Task.WhenAll(packagesSources.Select(async (source) => await GetAutocompleteAsync(source, cancellationToken).ConfigureAwait(false))).ConfigureAwait(false); 989var versions = await Task.WhenAll(versionTasks).ConfigureAwait(false);
SdkVulnerability\SdkReleaseMetadataCache.cs (1)
105public async Task UpdateCacheAsync(string sdkVersion, CancellationToken cancellationToken = default)
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.11.0-1.26424.106\contentFiles\cs\net11.0\BuildProtocol.cs (3)
160public async Task WriteAsync(Stream outStream, CancellationToken cancellationToken = default(CancellationToken)) 282public async Task WriteAsync(Stream outStream, 675internal static async Task ReadAllAsync(
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.11.0-1.26424.106\contentFiles\cs\net11.0\BuildServerConnection.cs (10)
163internal static async Task WaitForServerProcessExitAsync( 173await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken).ConfigureAwait(false); 240return Task.FromResult<NamedPipeClientStream?>(null); 251return Task.FromResult<NamedPipeClientStream?>(null); 271return Task.FromResult<NamedPipeClientStream?>(null); 315var monitorTask = MonitorDisconnectAsync(pipeStream, request.RequestId, logger, serverCts.Token); 316await Task.WhenAny(responseTask, monitorTask).ConfigureAwait(false); 352internal static async Task MonitorDisconnectAsync( 365await Task.Delay(millisecondsDelay: 100, cancellationToken).ConfigureAwait(false); 414await Task.Run(() => pipeStream.ConnectAsync(timeoutMs, cancellationToken), cancellationToken).ConfigureAwait(false);
Telemetry\TelemetryClient.cs (2)
23private Task? _trackEventTask; 334? Task.Run(() => TrackEventTask(eventName, properties))
dotnet-aot (32)
ManagedHost.cs (2)
21private Task? _initTask; 42_initTask = Task.Run(Initialize);
src\sdk\src\Cli\dotnet\Commands\Sdk\Check\ProductCollectionProvider.cs (3)
17return uri != null ? Task.Run(() => ProductCollection.GetAsync(uri.ToString())).Result : 18filePath != null ? Task.Run(() => ProductCollection.GetFromFileAsync(filePath, false)).Result : 19Task.Run(() => ProductCollection.GetAsync()).Result;
src\sdk\src\Cli\dotnet\Commands\Solution\Migrate\SolutionMigrateCommand.cs (1)
45private async Task ConvertToSlnxAsync(string filePath, string slnxFilePath, CancellationToken cancellationToken)
src\sdk\src\Cli\dotnet\Commands\Solution\Remove\SolutionRemoveCommand.cs (1)
67private static async Task RemoveProjectsAsync(string solutionFileFullPath, IEnumerable<string> projectPaths, CancellationToken cancellationToken)
src\sdk\src\Cli\dotnet\Commands\Workload\Install\FileBasedManifestInstaller.cs (1)
39public async Task ExtractManifestAsync(string nupkgPath, string targetPath)
src\sdk\src\Cli\dotnet\Commands\Workload\Install\IWorkloadManifestInstaller.cs (1)
13Task ExtractManifestAsync(string nupkgPath, string targetPath);
src\sdk\src\Cli\dotnet\Commands\Workload\Install\WorkloadAdvertisingManifestUpdater.cs (5)
64public async Task UpdateAdvertisingManifestsAsync(bool includePreviews, bool useWorkloadSets = false, DirectoryPath? offlineCache = null) 74await Task.WhenAll(manifests.Select(manifest => UpdateAdvertisingManifestAsync(manifest, includePreviews, offlineCache))).ConfigureAwait(false); 79public async Task BackgroundUpdateAdvertisingManifestsWhenRequiredAsync() 273private async Task UpdateAdvertisingManifestAsync(WorkloadManifestInfo manifest, bool includePreviews, DirectoryPath? offlineCache = null) 345var availableUpdates = await Task.WhenAll(manifests.Select(manifest => NewerManifestPackageExists(manifest))).ConfigureAwait(false);
src\sdk\src\Cli\dotnet\Commands\Workload\Install\WorkloadManifestUpdater.cs (1)
76public static async Task BackgroundUpdateAdvertisingManifestsAsync(string userProfileDir)
src\sdk\src\Cli\dotnet\NugetPackageDownloader\NuGetConsoleLogger.cs (4)
43public Task LogAsync(LogLevel level, string data) 46return Task.CompletedTask; 49public Task LogAsync(ILogMessage message) 52return Task.CompletedTask;
src\sdk\src\Cli\dotnet\NugetPackageDownloader\NuGetPackageDownloader.cs (10)
33private readonly Func<IEnumerable<Task>> _retryTimer; 71Func<IEnumerable<Task>> timer = null, 252private async Task VerifySigning(string nupkgPath, SourceRepository repository) 663await Task.WhenAll( 749await Task.WhenAll( 884await Task.WhenAny(tasks).ConfigureAwait(false); 970var autoCompletes = await Task.WhenAll(packagesSources.Select(async (source) => await GetAutocompleteAsync(source, cancellationToken).ConfigureAwait(false))).ConfigureAwait(false); 975var packageIdLists = await Task.WhenAll(packageIdTasks).ConfigureAwait(false); 984var autoCompletes = await Task.WhenAll(packagesSources.Select(async (source) => await GetAutocompleteAsync(source, cancellationToken).ConfigureAwait(false))).ConfigureAwait(false); 989var versions = await Task.WhenAll(versionTasks).ConfigureAwait(false);
src\sdk\src\Cli\dotnet\SdkVulnerability\SdkReleaseMetadataCache.cs (1)
105public async Task UpdateCacheAsync(string sdkVersion, CancellationToken cancellationToken = default)
src\sdk\src\Cli\dotnet\Telemetry\TelemetryClient.cs (2)
23private Task? _trackEventTask; 334? Task.Run(() => TrackEventTask(eventName, properties))
dotnet-format (10)
Analyzers\AnalyzerRunner.cs (2)
13public Task RunCodeAnalysisAsync( 24public async Task RunCodeAnalysisAsync(
Analyzers\Interfaces\IAnalyzerRunner.cs (2)
12Task RunCodeAnalysisAsync( 22Task RunCodeAnalysisAsync(
Analyzers\SolutionCodeFixApplier.cs (2)
96private static Task<IEnumerable<Diagnostic>> EmptyDignosticResult => Task.FromResult(Enumerable.Empty<Diagnostic>()); 118? Task.FromResult<IEnumerable<Diagnostic>>(_diagnosticsByProject[project])
Formatters\CharsetFormatter.cs (1)
31return Task.Run(() =>
Formatters\DocumentFormatter.cs (1)
77var formatTask = Task.Run(async () =>
Formatters\EndOfLineFormatter.cs (1)
28return Task.Run(() =>
Utilities\ProcessRunner.cs (1)
104Task.Run(() =>
dotnet-openapi (8)
Commands\AddCommand.cs (1)
26return Task.FromResult(0);
Commands\BaseCommand.cs (6)
145internal async Task AddOpenAPIReference( 190private async Task EnsurePackagesInProjectAsync(FileInfo projectFile, CodeGenerator? codeGenerator) 204private async Task TryAddPackage(string packageId, string packageVersion, FileInfo projectFile) 256internal async Task DownloadToFileAsync(string url, string destinationPath, bool overwrite) 331await Task.Delay(1 * 1000, cancellationToken); // Wait for a while before retry. 507private async Task WriteToFileAsync(Stream content, string destinationPath, bool overwrite)
Commands\RemoveCommand.cs (1)
48return Task.FromResult(0);
dotnet-sourcelink (4)
dotnet-suggest (4)
SuggestionDispatcher.cs (4)
41return Task.CompletedTask; 62return Task.CompletedTask; 149return Task.FromResult(0); 174return Task.FromResult(0);
dotnet-svcutil-lib (327)
Bootstrapper\SvcutilBootstrapper.cs (3)
95internal async Task GenerateProjectAsync(bool keepBootstrapperDir, ILogger logger, CancellationToken cancellationToken) 167internal async Task GenerateProgramFileAsync(ILogger logger, CancellationToken cancellationToken) 186internal async Task BuildBootstrapProjectAsync(ILogger logger, CancellationToken cancellationToken)
CodeDomFixup\CodeDomHelpers.cs (1)
97MatchType<Task>(method.ReturnType)));
CodeDomFixup\CodeDomVisitors\AddAsyncOpenClose.cs (1)
43ReturnType = new CodeTypeReference(typeof(Task)),
CommandProcessorOptions.cs (13)
198public async Task ResolveAsync(CancellationToken cancellationToken) 251internal async Task ProcessBasicOptionsAsync(ILogger logger, CancellationToken cancellation) 327private async Task ProcessProjectFileOptionAsync(CancellationToken cancellationToken) 382private async Task ProcessOutputDirOptionAsync(string workingDirectory, CancellationToken cancellationToken) 421private async Task ProcessOutputFileOptionAsync(string workingDirectory, CancellationToken cancellationToken) 469private async Task ProcessUpdateOptionAsync(CancellationToken cancellation) 571private async Task ProcessBootstrapDirOptionAsync(CancellationToken cancellationToken) 611private async Task ProcessReferencesOptionAsync(CancellationToken cancellationToken) 650private async Task ProcessNamespaceMappingsOptionAsync(CancellationToken cancellationToken) 676private async Task ProcessTargetFrameworkOptionAsync(CancellationToken cancellationToken) 728private async Task ProcessInputsAsync(CancellationToken cancellationToken) 815private async Task ProcessReferenceAssembliesAsync(CancellationToken cancellationToken) 1025internal async Task SetupBootstrappingDirectoryAsync(ILogger logger, CancellationToken cancellationToken)
DebugLogger.cs (11)
63public Task WriteMessageAsync(string message, bool logToUI) 65return Task.Run(() => LogMessage(message, LogTag.LogMessage, logToUI)); 68public Task WriteErrorAsync(string errorMessage, bool logToUI) 70return Task.Run(() => LogMessage(errorMessage, LogTag.Error, logToUI)); 73public Task WriteWarningAsync(string warningMessage, bool logToUI) 75return Task.Run(() => LogMessage(warningMessage, LogTag.Warning, logToUI)); 85public Task WriteEndOperationAsync(DateTime startTime, bool logToUI = false) 133Task NuGet.Common.ILogger.LogAsync(NuGet.Common.ILogMessage message) 135return Task.Run(() => LogMessage(message.Message, message.Level)); 138Task NuGet.Common.ILogger.LogAsync(NuGet.Common.LogLevel level, string data) 140return Task.Run(() => LogMessage(data, level));
FrameworkFork\Microsoft.Xml\Xml\AsyncHelper.cs (20)
17public static readonly Task DoneTask = Task.FromResult(true); 19public static readonly Task<bool> DoneTaskTrue = Task.FromResult(true); 21public static readonly Task<bool> DoneTaskFalse = Task.FromResult(false); 23public static readonly Task<int> DoneTaskZero = Task.FromResult(0); 25public static bool IsSuccess(this Task task) 30public static Task CallVoidFuncWhenFinish(this Task task, Action func) 43private static async Task _CallVoidFuncWhenFinish(this Task task, Action func) 49public static async Task<bool> ReturnTaskBoolWhenFinish(this Task task, bool ret) 59public static async Task<bool> _ReturnTaskBoolWhenFinish(this Task task, bool ret) 65public static Task CallTaskFuncWhenFinish(this Task task, Func<Task> func) 77private static async Task _CallTaskFuncWhenFinish(Task task, Func<Task> func) 83public static Task<bool> CallBoolTaskFuncWhenFinish(this Task task, Func<Task<bool>> func) 95private static async Task<bool> _CallBoolTaskFuncWhenFinish(this Task task, Func<Task<bool>> func)
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\XmlBinaryReaderAsync.cs (1)
87public override Task SkipAsync()
FrameworkFork\Microsoft.Xml\Xml\Core\ReadContentAsBinaryHelperAsync.cs (1)
241internal async Task FinishAsync()
FrameworkFork\Microsoft.Xml\Xml\Core\XmlAsyncCheckReader.cs (3)
18private Task _lastTask = AsyncHelper.DoneTask; 866public override Task SkipAsync() 869var task = _coreReader.SkipAsync();
FrameworkFork\Microsoft.Xml\Xml\Core\XmlCharCheckingReaderAsync.cs (1)
428private async Task FinishReadBinaryAsync()
FrameworkFork\Microsoft.Xml\Xml\Core\XmlReaderAsync.cs (3)
131public virtual Task SkipAsync() 231private async Task WriteNodeAsync(XmlWriter xtw, bool defattr) 427private Task FinishReadElementContentAsXxxAsync()
FrameworkFork\Microsoft.Xml\Xml\Core\XmlSubtreeReaderAsync.cs (5)
25return Task.FromResult(_curNode.value); 106public override async Task SkipAsync() 515return Task.FromResult(0); 533return Task.FromResult(copyCount); 554return Task.FromResult(0);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWrappingReaderAsync.cs (1)
30public override Task SkipAsync()
FrameworkFork\Microsoft.Xml\Xml\Core\XsdCachingReaderAsync.cs (4)
28return Task.FromResult(_cachedNode.OriginalStringValue); 32return Task.FromResult(_cachedNode.RawValue); 111public override async Task SkipAsync() 140internal Task SetToReplayModeAsync()
FrameworkFork\Microsoft.Xml\Xml\Core\XsdValidatingReaderAsync.cs (9)
30return Task.FromResult(_cachedNode.RawValue); 261private Task<bool> ReadAsync_ReadAhead(Task task) 274private async Task<bool> _ReadAsync_ReadAhead(Task task) 311Task task = ProcessReaderEventAsync(); 339public override async Task SkipAsync() 477private Task ProcessReaderEventAsync() 528private async Task ProcessElementEventAsync() 605private async Task ProcessEndElementEventAsync() 625private async Task ProcessInlineSchemaAsync()
FrameworkFork\Microsoft.Xml\Xml\Resolvers\XmlPreloadedResolverAsync.cs (2)
40return Task.FromResult<Object>(data.AsStream()); 44return Task.FromResult<Object>(data.AsTextReader());
FrameworkFork\Microsoft.Xml\Xml\schema\ParserAsync.cs (1)
25public async Task StartParsingAsync(XmlReader reader, string targetNamespace)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBaseWriter.cs (10)
352private async Task WriteEndAttributeAsyncImpl() 528private async Task StartElementAndWriteStartElementAsync(string prefix, string localName, string namespaceUri) 648private Task FlushElementAsync() 650return _writeState == WriteState.Element ? AutoCompleteAsync(WriteState.Content) : Task.CompletedTask; 669protected async Task StartContentAsync() 735private async Task AutoCompleteAsync(WriteState writeState) 750private Task EndStartElementAsync() 1515private Task FlushBase64Async() 1517return _trailByteCount > 0 ? FlushTrailBytesAsync() : Task.CompletedTask; 1534private async Task FlushTrailBytesAsync()
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionaryAsyncCheckWriter.cs (3)
18private Task _lastTask; 42private Task SetLastTask(Task task)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlNodeWriter.cs (6)
20public virtual Task FlushAsync() 29public virtual Task WriteStartElementAsync(string prefix, string localName) 39public virtual Task WriteEndStartElementAsync(bool isEmpty) 44public virtual Task WriteEndElementAsync(string prefix, string localName) 65public virtual Task WriteEndAttributeAsync() 93public virtual Task WriteBase64TextAsync(byte[] trailBuffer, int trailCount, byte[] buffer, int offset, int count)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlStreamNodeWriter.cs (12)
155protected Task WriteByteAsync(byte b) 164return Task.CompletedTask; 168private async Task FlushBufferAndWriteByteAsync(byte b) 180protected Task WriteByteAsync(char ch) 200protected Task WriteBytesAsync(byte b1, byte b2) 210return Task.CompletedTask; 214private async Task FlushAndWriteBytesAsync(byte b1, byte b2) 227protected Task WriteBytesAsync(char ch1, char ch2) 495protected virtual Task FlushBufferAsync() 499var task = _stream.WriteAsync(_buffer, 0, _offset); 504return Task.CompletedTask; 513public override async Task FlushAsync()
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlUTF8TextWriter.cs (6)
224public override async Task WriteStartElementAsync(string prefix, string localName) 266public override async Task WriteEndStartElementAsync(bool isEmpty) 290public override async Task WriteEndElementAsync(string prefix, string localName) 396public override async Task WriteEndAttributeAsync() 744public override async Task WriteBase64TextAsync(byte[] trailBytes, int trailByteCount, byte[] buffer, int offset, int count) 775private async Task InternalWriteBase64TextAsync(byte[] buffer, int offset, int count)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\ActionItem.cs (2)
37Task.Factory.StartNew(callback, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 67Task.Factory.StartNew(callback, this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TaskHelpers.cs (16)
15public static async Task AsyncWait<TException>(this Task task) 78public static Task ToApm(this Task task, AsyncCallback callback, object state) 144Task task = iar as Task; 153public static async Task<bool> AwaitWithTimeout(this Task task, TimeSpan timeout) 168var completedTask = await Task.WhenAny(task, Task.Delay(timeout, cts.Token)); 183public static void WaitForCompletion(this Task task) 193public static bool WaitWithTimeSpan(this Task task, TimeSpan timeout) 206public static void Wait(this Task task, TimeSpan timeout, Action<Exception, TimeSpan, string> exceptionConverter, string operationType) 237public static Task CompletedTask() 239return Task.FromResult(true); 291Task.Run(continuation);
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TimeoutHelper.cs (1)
326tokenTask = Task.FromResult(new CancellationTokenSource(millisecondsTimeout).Token);
FrameworkFork\System.ServiceModel\System\IdentityModel\Selectors\KerberosSecurityTokenProvider.cs (1)
70return Task.FromResult(GetToken(cancellationToken, null));
FrameworkFork\System.ServiceModel\System\IdentityModel\Selectors\SecurityTokenProvider.cs (2)
50public async Task CancelTokenAsync(CancellationToken cancellationToken, SecurityToken securityToken) 67protected virtual Task CancelTokenCoreAsync(CancellationToken cancellationToken, SecurityToken token)
FrameworkFork\System.ServiceModel\System\IdentityModel\Selectors\UserNameSecurityTokenProvider.cs (1)
28return Task.FromResult((SecurityToken)_userNameToken);
FrameworkFork\System.ServiceModel\System\IdentityModel\Selectors\X509SecurityTokenProvider.cs (1)
65return await Task.FromResult<SecurityToken>(new X509SecurityToken(_certificate));
FrameworkFork\System.ServiceModel\System\ServiceModel\ChannelFactory.cs (2)
317internal protected override async Task OnCloseAsync(TimeSpan timeout) 343protected internal override async Task OnOpenAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BodyWriter.cs (3)
86protected virtual Task OnWriteBodyContentsAsync(XmlDictionaryWriter writer) 89return Task.CompletedTask; 123internal Task WriteBodyContentsAsync(XmlDictionaryWriter writer)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BufferedWriteStream.cs (11)
164public override Task FlushAsync(CancellationToken cancellationToken) 168return Task.FromCanceled<int>(cancellationToken); 176private async Task FlushAsyncInternal(CancellationToken cancellationToken) 210private async Task FlushWriteAsync(CancellationToken cancellationToken) 395public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 403return Task.FromCanceled<int>(cancellationToken); 411Task semaphoreLockTask = _sem.WaitAsync(); 429? Task.CompletedTask 430: Task.FromException(error); 447private async Task WriteToUnderlyingStreamAsync(byte[] array, int offset, int count, 449Task semaphoreLockTask)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ChannelFactoryBase.cs (1)
66protected internal override Task OnCloseAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ClientWebSocketTransportDuplexSessionChannel.cs (1)
57protected internal override async Task OnOpenAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CommunicationObject.cs (8)
146private async Task CloseAsyncInternal(TimeSpan timeout) 152async Task IAsyncCommunicationObject.CloseAsync(TimeSpan timeout) 321private async Task OpenAsyncInternal(TimeSpan timeout) 327async Task IAsyncCommunicationObject.OpenAsync(TimeSpan timeout) 758internal protected virtual Task OnCloseAsync(TimeSpan timeout) 764internal protected virtual Task OnOpenAsync(TimeSpan timeout) 828public static async Task OnCloseAsyncInternal(CommunicationObject communicationObject, TimeSpan timeout) 834public static async Task OnOpenAsyncInternal(CommunicationObject communicationObject, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Connection.cs (8)
325public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 449private Action<Task, object> _onWrite; 451private Task _writeResult; 465_onWrite = new Action<Task, object>(OnWrite); 562Task localTask = _stream.WriteAsync(buffer, offset, size); 590Task localResult = _writeResult; 607private void OnWrite(Task antecedant, Object state) 814internal static async Task WriteAsync(this IConnection connection, byte[] buffer, int offset, int size, bool immediate, TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ConnectionOrientedTransportChannelFactory.cs (2)
301protected internal override async Task OnOpenAsync(TimeSpan timeout) 310protected internal override async Task OnCloseAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\DelegatingStream.cs (3)
125public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 135public override Task FlushAsync(CancellationToken cancellationToken) 171public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingChannels.cs (3)
57protected override Task CloseOutputSessionCoreAsync(TimeSpan timeout) 315protected internal override async Task OnOpenAsync(TimeSpan timeout) 446public static async Task DecodeFramingFaultAsync(ClientFramingDecoder decoder, IConnection connection,
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (6)
504internal protected override Task OnOpenAsync(TimeSpan timeout) 510protected internal override Task OnCloseAsync(TimeSpan timeout) 770internal protected override Task OnOpenAsync(TimeSpan timeout) 803protected internal override async Task OnCloseAsync(TimeSpan timeout) 895public async Task SendRequestAsync(Message message, TimeoutHelper timeoutHelper) 1224private async Task SendPreauthenticationHeadRequestIfNeeded()
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelHelpers.cs (2)
60return Task.FromResult((NetworkCredential)null); 246return Task.FromResult(bytesRead);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MaxMessageSizeStream.cs (1)
31public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Message.cs (6)
384public Task WriteBodyContentsAsync(XmlDictionaryWriter writer) 403protected virtual Task OnWriteBodyContentsAsync(XmlDictionaryWriter writer) 633public virtual Task WriteMessageAsync(XmlWriter writer) 639public virtual async Task WriteMessageAsync(XmlDictionaryWriter writer) 645public virtual async Task OnWriteMessageAsync(XmlDictionaryWriter writer) 1064protected override Task OnWriteBodyContentsAsync(XmlDictionaryWriter writer)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageContent.cs (5)
184Task.Run(async () => await _messageEncoder.WriteMessageAsync(_message, bufferedStream)); 185return Task.FromResult(_stream); 188protected override Task SerializeToStreamAsync(Stream stream, TransportContext context) 219return Task.FromResult(_stream); 232protected override async Task SerializeToStreamAsync(Stream stream, TransportContext context)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageEncoder.cs (4)
39return Task.FromResult(ReadMessage(stream, maxSizeOfHeaders, contentType)); 44return Task.FromResult(ReadMessage(buffer, bufferManager, contentType)); 124public virtual Task WriteMessageAsync(Message message, Stream stream) 133return Task.FromResult(WriteMessage(message, maxMessageSize, bufferManager, messageOffset));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\OutputChannel.cs (1)
67protected abstract Task OnSendAsync(Message message, TimeSpan timeout);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ProducerConsumerStream.cs (1)
108public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\RequestChannel.cs (2)
112internal protected async Task WaitForPendingRequestsAsync(TimeSpan timeout) 332Task SendRequestAsync(Message message, TimeoutHelper timeoutHelper);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannel.cs (2)
1276protected internal override async Task OnCloseAsync(TimeSpan timeout) 1334protected internal override async Task OnOpenAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannelFactory.cs (2)
452protected internal override Task OnCloseAsync(TimeSpan timeout) 458protected internal override Task OnOpenAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannelProxy.cs (6)
159public static Task CreateTask(ServiceChannel channel, MethodCall methodCall, ProxyOperationRuntime operation) 168private static Task CreateGenericTask(ServiceChannel channel, ProxyOperationRuntime operation, object[] inputParameters) 209private static Task CreateTask(ServiceChannel channel, ProxyOperationRuntime operation, object[] inputParameters) 263public Task Task { get { return (Task)_tcsInfo.TaskProperty.GetValue(_tcsInstance); } } 311Task task = TaskCreator.CreateTask(_serviceChannel, methodCall, operation);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SslStreamSecurityUpgradeProvider.cs (2)
532internal override async Task OpenAsync(TimeSpan timeout) 556internal override async Task CloseAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\StreamSecurityUpgradeInitiatorBase.cs (4)
103internal override Task OpenAsync(TimeSpan timeout) 106return Task.CompletedTask; 114internal override Task CloseAsync(TimeSpan timeout) 117return Task.CompletedTask;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\StreamUpgradeInitiator.cs (2)
25internal abstract Task OpenAsync(TimeSpan timeout); 29internal abstract Task CloseAsync(TimeSpan timeout);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TextMessageEncoder.cs (3)
513return Task.FromResult(messageData); 516private async Task WriteMessageAsyncInternal(Message message, Stream stream) 522public override async Task WriteMessageAsync(Message message, Stream stream)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TimeoutStream.cs (2)
73public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 83private async Task WriteAsyncInternal(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TransportDuplexSessionChannel.cs (5)
270protected abstract Task CloseOutputSessionCoreAsync(TimeSpan timeout); 274protected async Task CloseOutputSessionAsync(TimeSpan timeout) 398protected internal override async Task OnCloseAsync(TimeSpan timeout) 502protected override async Task OnSendAsync(Message message, TimeSpan timeout) 669private async Task EnsureInputClosedAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketHelper.cs (2)
189internal static void ThrowExceptionOnTaskFailure(Task task, TimeSpan timeout, string operation) 202internal static Exception CreateExceptionOnTaskFailure(Task task, TimeSpan timeout, string operation)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (18)
103Task closeTask = CloseAsync(); 122Task task = CloseOutputAsync(CancellationToken.None); 126protected override async Task CloseOutputSessionCoreAsync(TimeSpan timeout) 170protected internal override async Task OnCloseAsync(TimeSpan timeout) 202Task task = WebSocket.SendAsync(messageData, outgoingMessageType, true, helper.GetCancellationToken()); 253Task task = CloseOutputAsync(helper.GetCancellationToken()); 294Task task = WebSocket.SendAsync(messageData, outgoingMessageType, true, helper.GetCancellationToken()); 357private Task CloseAsync() 374private Task CloseOutputAsync(CancellationToken cancellationToken) 396private async void HandleCloseOutputAsyncCompletion(Task task, TimeSpan timeout, Action<object> callback, object state) 412private async void HandleSendAsyncCompletion(Task task, TimeSpan timeout, Action<object> callback, object state) 561private async Task ReadBufferedMessageAsync() 1030return Task.FromResult(0); 1035return Task.FromResult(GetBytesFromInitialReadBuffer(buffer, offset, count)); 1042return Task.FromResult(0); 1123public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 1163private async Task WriteAsyncInternal(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 1183Task task = _webSocket.SendAsync(new ArraySegment<byte>(Array.Empty<byte>(), 0, 0), _outgoingMessageType, true, timeoutHelper.GetCancellationToken());
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WindowsStreamSecurityUpgradeProvider.cs (1)
290internal override async Task OpenAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataExchangeClient.cs (3)
291return Task.Factory.FromAsync<MetadataRetriever, MetadataSet>(this.BeginGetMetadata, this.EndGetMetadata, retriever, /* state */ null); 301return Task.Factory.FromAsync<MetadataRetriever, MetadataSet>(this.BeginGetMetadata, this.EndGetMetadata, new MetadataReferenceRetriever(address, this), /* state */ null); 316return Task.Factory.FromAsync<MetadataRetriever, MetadataSet>(this.BeginGetMetadata, this.EndGetMetadata, new MetadataReferenceRetriever(address, via, this), /* state */ null);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceReflector.cs (1)
350internal static readonly Type taskType = typeof(Task);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ChannelDispatcher.cs (2)
473protected internal override Task OnCloseAsync(TimeSpan timeout) 479protected internal override Task OnOpenAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DispatchRuntime.cs (2)
408return Task.FromResult((object)Message.CreateMessage(message.Version, fault, message.Version.Addressing.DefaultFaultAction)); 414return Task.FromResult((object)null);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DuplexChannelBinder.cs (1)
1183Task.Factory.StartNew(s_receiveThreadSchedulerCallback, result, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ListenerHandler.cs (2)
80protected internal override Task OnCloseAsync(TimeSpan timeout) 86protected internal override Task OnOpenAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\OperationFormatter.cs (4)
50protected virtual Task SerializeBodyAsync(XmlDictionaryWriter writer, MessageVersion version, string action, MessageDescription messageDescription, object returnValue, object[] parameters, bool isRequest) 53return Task.CompletedTask; 353private async Task SerializeBodyContentsAsync(XmlDictionaryWriter writer, MessageVersion version, object[] parameters, object returnValue, bool isRequest) 726protected override Task OnWriteBodyContentsAsync(XmlDictionaryWriter writer)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\StreamFormatter.cs (3)
76private Task WriteEndWrapperIfNecessaryAsync(XmlDictionaryWriter writer) 81return Task.CompletedTask; 405public static async Task WriteValueAsync(XmlDictionaryWriter writer, OperationStreamProvider value)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\SyncMethodInvoker.cs (1)
185return Task.FromResult(Tuple.Create(returnValue, outputs));
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\TaskMethodInvoker.cs (4)
79Task task = null; 90task = tuple.Item1 as Task; 214var returnValueTask = returnValue as Task;
FrameworkFork\System.ServiceModel\System\ServiceModel\ICommunicationObject.cs (2)
36Task CloseAsync(TimeSpan timeout); 37Task OpenAsync(TimeSpan timeout);
FrameworkFork\System.ServiceModel\System\ServiceModel\InstanceContext.cs (2)
268protected internal override Task OnCloseAsync(TimeSpan timeout) 274protected internal override Task OnOpenAsync(TimeSpan timeout)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\ClientCredentialsSecurityTokenManager.cs (1)
274return Task.FromResult((SecurityToken)new KerberosRequestorSecurityToken(_innerProvider.ServicePrincipalName,
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SspiSecurityTokenProvider.cs (1)
36return Task.FromResult<SecurityToken>(_token);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WrapperSecurityCommunicationObject.cs (2)
112protected internal override async Task OnCloseAsync(TimeSpan timeout) 125protected internal override async Task OnOpenAsync(TimeSpan timeout)
Metadata\MetadaExchangeResolver.cs (2)
192await Task.Delay(100); 262await Task.Delay(100);
Metadata\MetadataDocumentLoader.cs (7)
162public async Task LoadAsync(CancellationToken cancellationToken) 210private async Task LoadAsync(string uri, string baseUrl, string basePath, CancellationToken cancellationToken) 288internal async Task LoadFromStreamAsync(Stream stream, string uri, string basePath, CancellationToken cancellationToken) 317private async Task LoadAsXmlSchemaAsync(XmlNS.XmlReader reader, string uri, string basePath, CancellationToken cancellationToken) 330private async Task LoadAsXmlSchemaIncludesAsync(XmlNS.Schema.XmlSchema schema, string uri, string basePath, CancellationToken cancellationToken) 344private async Task LoadAsWsdlAsync(XmlNS.XmlReader reader, string uri, string basePath, CancellationToken cancellationToken) 427private async Task LoadAsEPRAsync(XmlNS.XmlReader reader, CancellationToken cancellationToken)
Metadata\ServiceDescriptor.cs (2)
88public async Task ImportMetadataAsync(CancellationToken cancellationToken) 93public async Task ImportMetadataAsync(Action<WsdlImporter> onWsdlImporterCreated, Action<ServiceDescriptor> onBeforeMetadataImport, Func<ServiceDescriptor, bool> onAfterMetadataImport, CancellationToken cancellationToken)
Shared\MSBuildProj.cs (2)
684public async Task SaveAsync(bool force, ILogger logger, CancellationToken cancellationToken) 690public async Task SaveAsync(ILogger logger, CancellationToken cancellationToken)
Shared\Utilities\AsyncHelper.cs (6)
16public static async Task RunAsync(Action action, CancellationToken cancellationToken) 21public static async Task RunAsync(Action action, Action onCancellation, CancellationToken cancellationToken) 26var actionTask = Task.Run(action, cancellationToken); 27await Task.WhenAny(actionTask, taskCompletionSrc.Task); 50finishedTask = await Task.WhenAny(Task<T>.Run(func, cancellationToken), taskCompletionSrc.Task);
Shared\Utilities\ILogger.cs (4)
13Task WriteErrorAsync(string errorMessage, bool logToUI); 14Task WriteWarningAsync(string warningMessage, bool logToUI); 15Task WriteMessageAsync(string message, bool logToUI); 18Task WriteEndOperationAsync(DateTime startTime, bool logToUI = false);
Shared\Utilities\ProcessRunner.cs (1)
137await Task.Delay(100);
Shared\Utilities\RuntimeEnvironmentHelper.cs (1)
45public static async Task TryCopyingConfigFiles(string workingDirectory, string destinationDirectory, ILogger logger, CancellationToken cancellationToken)
Shared\Utilities\SafeLogger.cs (10)
42public Task WriteErrorAsync(string errorMessage, bool logToUI) 48return Task.CompletedTask; 51public Task WriteWarningAsync(string warningMessage, bool logToUI) 57return Task.CompletedTask; 60public Task WriteMessageAsync(string message, bool logToUI) 66return Task.CompletedTask; 75return Task.FromResult(DateTime.Now); 78public Task WriteEndOperationAsync(DateTime startTime, bool logToUI = false) 84return Task.CompletedTask; 97Task.WaitAny(this.logger.WriteEndOperationAsync(_startTime));
Tool.cs (1)
298private static async Task GenerateParamsFileAsync(CommandProcessorOptions options, ILogger logger, CancellationToken cancellationToken)
dotnet-svcutil-lib.Tests (17)
GlobalToolTests.cs (3)
129public async Task MultiTargetCloseAsyncGeneration(string testCaseName) 157public async Task MultiTargetTypeReuse() 188public async Task ParamsFiles_SDK_TFM(string targetFramework, string extraOptions)
MSBuildProjTests.cs (4)
30public async Task ParseAsync_ValidProjectWithPackageReference_ShouldParseSuccessfully() 49public async Task ParseAsync_ProjectWithUpdatePackageReference_ShouldSkipUpdatePackageAndParseRestOfProjectSuccessfully() 69public async Task ParseAsync_ValidProjectWithDotNetCliToolReference_ShouldParseSuccessfully() 88public async Task ParseAsync_ProjectWithUpdateDotNetCliToolReference_ShouldSkipUpdateReferencendParseRestOfProjectSuccessfully()
TestLogger.cs (9)
27public Task WriteEndOperationAsync(DateTime startTime, bool logToUI = false) 29return Task.CompletedTask; 32public Task WriteErrorAsync(string errorMessage, bool logToUI) 35return Task.CompletedTask; 38public Task WriteMessageAsync(string message, bool logToUI) 44return Task.CompletedTask; 50return Task.FromResult(DateTime.Now); 53public Task WriteWarningAsync(string warningMessage, bool logToUI) 56return Task.CompletedTask;
UnitTest.cs (1)
284public async Task CommandOptionsTelemetryString(string testCaseName, string options)
dotnet-watch (5)
Watch\DotNetWatcher.cs (4)
13public static async Task WatchAsync(DotNetWatchContext context, CancellationToken shutdownCancellationToken) 101Task finishedTask; 108finishedTask = await Task.WhenAny(processTask, fileSetTask, cancelledTaskSource.Task); 126await Task.WhenAll(processTask, fileSetTask);
Watch\StaticFileHandler.cs (1)
61await Task.WhenAll(tasks).WaitAsync(cancellationToken);
DotNetInvocationHostedAgent (3)
EchoAIAgent.cs (2)
24return Task.FromResult(response); 39await Task.CompletedTask;
EchoInvocationHandler.cs (1)
10public override async Task HandleAsync(
DotnetTool.AppHost (2)
AppHost.cs (2)
101return Task.FromResult(CommandResults.Success()); 105return Task.FromResult(CommandResults.Failure(ex));
EventHubsConsumer (4)
Consumer.cs (1)
22protected override async Task ExecuteAsync(CancellationToken stoppingToken)
Processor.cs (3)
26protected override async Task ExecuteAsync(CancellationToken stoppingToken) 41return Task.CompletedTask; 47public override async Task StopAsync(CancellationToken cancellationToken)
Extensibility.WebSockets.IntegrationTests (3)
WebSocketTests.4.1.0.cs (3)
756Task.Run(() => duplexProxy.Ping(guid)); 797Task.Run(() => duplexProxy.Ping(guid)); 841Task.Run(() => proxy.Ping(guid));
GenerateDocumentationAndConfigFiles (109)
src\0bf6ba47805c8821\AbstractMoveDeclarationNearReferenceService.cs (1)
118private static async Task MoveDeclarationToFirstReferenceAsync(
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
148public Task AppendAsync(Stream stream, CancellationToken cancellationToken = default) 158private async Task AppendAsyncCore(Stream stream, CancellationToken cancellationToken)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\PerformanceSensitiveAttribute.cs (1)
93/// <see cref="System.Threading.Tasks.Task"/>, either through caching the result or by using
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
602return (await Task.WhenAll(sequence.Select(item => selector(item, cancellationToken))).ConfigureAwait(false)).Flatten();
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
232public static Task ReportNonFatalErrorAsync(this Task task) 242public static Task ReportNonFatalErrorUnlessCancelledAsync(this Task task, CancellationToken cancellationToken)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (1)
44public new Task WaitUntilCurrentBatchCompletesAsync()
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (3)
98private Task<(bool ranToCompletion, TResult? result)> _updateTask = Task.FromResult((ranToCompletion: true, default(TResult?))); 228async Task<(bool ranToCompletion, TResult? result)> ContinueAfterDelayAsync(Task lastTask) 244await Task.Yield().ConfigureAwait(false);
src\roslyn\src\Dependencies\Threading\ConfiguredYieldAwaitable.cs (1)
16/// <see cref="Task.Yield"/>.
src\roslyn\src\Dependencies\Threading\ParallelExtensions.cs (4)
16public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 19public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 22public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 25public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body)
src\roslyn\src\Dependencies\Threading\ProducerConsumer.cs (35)
25Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 46public static Task RunAsync<TArgs>( 48Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 49Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 64public static Task RunAsync<TArgs>( 66Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 67Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 87public static Task RunParallelAsync<TSource, TArgs>( 89Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 90Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 101public static Task RunParallelAsync<TSource, TArgs>( 103Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 104Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 124public static Task RunParallelAsync<TSource, TArgs>( 126Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 127Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 138public static Task RunParallelAsync<TSource, TArgs>( 140Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 141Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 159Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 173Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 193Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 206Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 225Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 249Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 283/// Equivalent to <see cref="RunParallelAsync{TSource, TArgs}(IEnumerable{TSource}, Func{TSource, Action{TItem}, TArgs, CancellationToken, Task}, TArgs, CancellationToken)"/>, 290Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 321Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 342var writeTask = ProduceItemsAndWriteToChannelAsync(); 344await Task.WhenAll(writeTask, readTask).ConfigureAwait(false); 350await Task.Yield().ConfigureAwait(false); 354Task ProduceItemsAndWriteToChannelAsync() 359await Task.Yield().ConfigureAwait(false); 375private static async Task PerformActionAndCloseWriterAsync<TArgs>( 376Func<TArgs, CancellationToken, Task> action,
src\roslyn\src\Dependencies\Threading\TaskExtensions.cs (5)
25public static NoThrowTaskAwaitable NoThrowAwaitableInternal(this Task task, bool captureContext = true) 38private readonly Task _task; 50public NoThrowTaskAwaitable(Task task, bool captureContext) 74private readonly Task _task; 86public NoThrowTaskAwaiter(Task task, bool captureContext)
src\roslyn\src\Dependencies\Threading\YieldAwaitableExtensions.cs (4)
15/// Implements <c>ConfigureAwait(bool)</c> for <see cref="Task.Yield"/>. The resulting behavior in asynchronous code 16/// is the same as one would expect for <see cref="Task.ConfigureAwait(bool)"/>. 18/// <param name="awaitable">The awaitable provided by <see cref="Task.Yield"/>.</param> 19/// <param name="continueOnCapturedContext"><inheritdoc cref="Task.ConfigureAwait(bool)"/></param>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
22Task AnalyzeAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy.cs (1)
24asynchronousComputeFunction: static (outerArg, cancellationToken) => Task.FromResult(outerArg.synchronousComputeFunction(outerArg.arg, cancellationToken)),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (5)
93/// Creates an AsyncLazy that always returns the value, analogous to <see cref="Task.FromResult{T}" />. 97_cachedResult = Task.FromResult(value); 297CompleteWithTask(Task.FromException<T>(ex), CancellationToken.None); 302CompleteWithTask(Task.FromResult(result), CancellationToken.None); 331return Task.FromCanceled<T>(cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (6)
62private Task _updateTask = Task.CompletedTask; 135async Task ContinueAfterDelayAsync(Task lastTask) 151await Task.Yield().ConfigureAwait(false); 163private async Task ProcessNextBatchAsync()
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (4)
46var tasks = new Task[streams.Length]; 55Task.WhenAll(tasks).CompletesChannel(channel); 59static async Task ProcessAsync(IAsyncEnumerable<T> stream, ChannelWriter<T> writer, CancellationToken cancellationToken) 70public static void CompletesChannel<T>(this Task task, Channel<T> channel)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (12)
18public static readonly Task<bool> True = Task.FromResult(true); 19public static readonly Task<bool> False = Task.FromResult(false); 23public static readonly Task EmptyTask = Task.CompletedTask; 82return new ValueTask<T[]>(Task.WhenAll(taskArray.Select(task => task.AsTask()))); 90await Task.WhenAll((IEnumerable<Task>)tasks).ConfigureAwait(false); 100public static readonly Task<T?> Default = Task.FromResult<T?>(default); 101public static readonly Task<IEnumerable<T>> EmptyEnumerable = Task.FromResult<IEnumerable<T>>(SpecializedCollections.EmptyEnumerable<T>()); 102public static readonly Task<ImmutableArray<T>> EmptyImmutableArray = Task.FromResult(ImmutableArray<T>.Empty); 103public static readonly Task<IList<T>> EmptyList = Task.FromResult(SpecializedCollections.EmptyList<T>()); 104public static readonly Task<IReadOnlyList<T>> EmptyReadOnlyList = Task.FromResult(SpecializedCollections.EmptyReadOnlyList<T>());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (3)
60/// Asserts the <see cref="Task"/> passed has already been completed. 67public static void VerifyCompleted(this Task task) 76/// Asserts the <see cref="Task"/> passed has already been completed.
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
151=> compilation.GetTypeByMetadataName(typeof(Task).FullName!);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (3)
37protected abstract Task FixAsync( 48public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 54protected sealed override async Task FixAllAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
80Func<SyntaxEditor, Task> editAsync, 97protected abstract Task FixAllAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
93protected abstract Task AddPotentiallyConflictingImportsAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
200public static async Task VerifyNoErrorsAsync(this Document newDocument, string message, CancellationToken cancellationToken, List<string>? ignoreErrorCodes = null)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (6)
26public static Task ApplyExpressionLevelSemanticEditsAsync<TType, TNode>( 49public static Task ApplyExpressionLevelSemanticEditsAsync<TType, TNode>( 72public static Task ApplyExpressionLevelSemanticEditsAsync<TNode>( 93public static Task ApplyMethodBodySemanticEditsAsync<TType, TNode>( 116public static Task ApplyMethodBodySemanticEditsAsync<TNode>( 150private static async Task ApplySemanticEditsAsync<TType, TNode>(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
150private async Task ReduceAsync(
GetDocument.Insider (11)
Commands\GetDocumentCommandWorker.cs (11)
44private static readonly Type _generateMethodReturnType = typeof(Task); 367using var resultTask = (Task)InvokeMethod(targetMethod, service, arguments); 490public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; 491public Task WaitForStartAsync(CancellationToken cancellationToken) => Task.CompletedTask; 498public Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) => Task.CompletedTask; 499public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
HealthChecksSandbox.AppHost (6)
AppHost.cs (6)
126public Task OnBeforeStartAsync(BeforeStartEvent @event, CancellationToken cancellationToken) 130Task.Run( 133await Task.Delay(TimeSpan.FromSeconds(10)); 142return Task.CompletedTask; 145public Task SubscribeAsync(IDistributedApplicationEventing eventing, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken) 148return Task.CompletedTask;
ILCompiler.DependencyAnalysisFramework (3)
src\runtime\src\coreclr\tools\Common\Sorting\MergeSortCore.cs (3)
31private static async Task ParallelSort(TDataStructure arrayToSort, int index, int length, TComparer comparer) 42Task rightSortTask = Task.Run(() => ParallelSort(arrayToSort, index + halfLen, length - halfLen, comparer));
ILCompiler.ReadyToRun (7)
Compiler\DependencyAnalysis\ReadyToRun\ReadyToRunHeaderNode.cs (1)
111_shouldAddSkipTypeValidationFlag = Task.FromResult((false, new string[0]));
Compiler\DependencyAnalysis\ReadyToRun\TypeValidationChecker.cs (6)
97Task<bool> skipValidatorForType = Task.Run(() => checker.ValidateTypeWorker(type)); 613return Task.FromResult(true); 619return Task.FromResult(true); 627return Task.FromResult(true); 638return Task.FromResult(false); 646return Task.FromResult(false);
ILLink.CodeFixProvider (16)
AddUnsafeToExternCodeFixProvider.cs (1)
36public override Task RegisterCodeFixesAsync(CodeFixContext context) =>
AddUnsafeToFieldCodeFixProvider.cs (1)
35public override Task RegisterCodeFixesAsync(CodeFixContext context) =>
AddUnsafeToLibraryImportCodeFixProvider.cs (1)
41public override Task RegisterCodeFixesAsync(CodeFixContext context) =>
AddUnsafeToPointerSignatureCodeFixProvider.cs (1)
34public override Task RegisterCodeFixesAsync(CodeFixContext context) =>
BaseAttributeCodeFixProvider.cs (1)
33protected async Task BaseRegisterCodeFixesAsync(CodeFixContext context)
DynamicallyAccessedMembersCodeFixProvider.cs (1)
93public override async Task RegisterCodeFixesAsync(CodeFixContext context)
MatchPartialSafetyModifierCodeFixProvider.cs (1)
45public override async Task RegisterCodeFixesAsync(CodeFixContext context)
RemoveInvalidUnsafeCodeFixProvider.cs (1)
41public override async Task RegisterCodeFixesAsync(CodeFixContext context)
RemoveUndocumentedUnsafeCodeFixProvider.cs (1)
36public override async Task RegisterCodeFixesAsync(CodeFixContext context)
RequiresAssemblyFilesCodeFixProvider.cs (1)
33public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) => BaseRegisterCodeFixesAsync(context);
RequiresDynamicCodeCodeFixProvider.cs (1)
30public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) => BaseRegisterCodeFixesAsync(context);
RequiresUnreferencedCodeCodeFixProvider.cs (1)
30public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) => BaseRegisterCodeFixesAsync(context);
RequiresUnsafeCodeFixProvider.cs (1)
32public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
SynchronizeUnsafeContractCodeFixProvider.cs (1)
73public override async Task RegisterCodeFixesAsync(CodeFixContext context)
UnconditionalSuppressMessageCodeFixProvider.cs (1)
38public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) => BaseRegisterCodeFixesAsync(context);
UnsafeModifierCodeFixHelpers.cs (1)
33internal static async Task RegisterAddUnsafeCodeFixAsync(
ILLink.RoslynAnalyzer (1)
CompilationExtensions.cs (1)
176=> compilation.GetTypeByMetadataName(typeof(Task).FullName!);
Infrastructure.Tests (470)
CreateFailingTestIssue\CreateFailingTestIssueFixture.cs (1)
30private static async Task BuildToolAsync(string toolProjectPath)
CreateFailingTestIssue\CreateFailingTestIssueToolTests.cs (18)
30public async Task ResolvesFailureFromFixtureArtifacts() 78public async Task CreateFlagCreatesIssueOnGitHub() 117public async Task CreateFlagReusesOpenExistingIssue() 158public async Task CreateFlagReopensClosedExistingIssue() 200public async Task CreateFlagCreatesNewIssueWhenNoExistingIssueFound() 242public async Task ForceNewFlagSkipsSearchAndCreatesNewIssue() 290public async Task ResolvesRunFromPullRequestUrlWithCompletedRun() 316public async Task ResolvesRunFromPullRequestUrlFallsBackToInProgressRun() 341public async Task WithoutCreateFlagDoesNotCreateIssue() 362public async Task ReturnsAvailableFailedTestsWhenNoMatchExists() 384public async Task ReturnsAllFailingTestsWhenNoTestQueryIsProvided() 436public async Task NormalizesCanonicalNameWhenTrxStoresFullyQualifiedMethodName() 466public async Task SupportsAttemptJobUrlsWithQueryString() 491public async Task AllowsQueuedRunsWhenArtifactsAlreadyExist() 512public async Task SkipsMissingFailedJobLogsWhenArtifactsStillResolveFailure() 535public async Task ResolvesFailureFromQueuedRunLogsWhenNoTestResultsArtifactsExist() 566public async Task ReturnsFastFailureForQueuedRunsWithoutTestResultsArtifactsOrMatchingLogs() 591public async Task KeepsIssueBodyUnderGitHubLimitBySnippingMiddleSections()
CreateFailingTestIssue\GitHubCliArgumentTests.cs (3)
22public async Task JobLogDownloadAllowsTerminalEscapeSequences() 35public async Task OrdinaryApiCallsDoNotAllowTerminalEscapeSequences() 59return Task.FromResult("{}");
DownloadFailingJobLogs\DownloadFailingJobLogsToolTests.cs (2)
43public async Task DownloadsLogsAndExtractsArtifactsFromFixtureRun() 70public async Task ReportsMissingArtifactWithoutFailing()
ExtractTestPartitions\ExtractTestPartitionsTests.cs (12)
28public async Task ExtractsPartitionTraits() 53public async Task IgnoresCollectionAttributes() 74public async Task ExtractsOnlyTraitPartitionsFromMixedAttributes() 98public async Task ReturnsEmptyForNoAttributes() 116public async Task SortsPartitionsAlphabetically() 141public async Task DeduplicatesPartitions() 164public async Task HandlesInvalidAssemblyPath() 179public async Task HandlesInvalidArguments() 190public async Task CreatesOutputDirectory() 210public async Task ExtractsPartitionsFromNestedTypes() 232public async Task IgnoresEmptyPartitionNames() 257public async Task IgnoresNonPartitionTraits()
GenerateTestSummary\GenerateTestSummaryToolTests.cs (8)
29public async Task IncludesStructuredErrorMessageAndStackTraceInReport() 51public async Task FailedTestsJsonListsOnlyFailedTestNames() 76public async Task FailedTestsJsonTreatsAbortedAsFailure() 102public async Task FailedTestsJsonIsEmptyWhenAllPass() 126public async Task FailedTestsJsonSetsExtractionFailedWhenAllTrxUnreadable() 152public async Task FailedTestsJsonSetsExtractionFailedWhenSomeTrxUnreadableAndNoFailuresFound() 182public async Task FailedTestsJsonDoesNotSetExtractionFailedWhenFailuresFoundDespiteUnreadableTrx() 209public async Task FailedTestsJsonHandlesRealTrxTimestamps()
Pipelines\ExtensionE2eRecorderStepTests.cs (1)
54public async Task RecorderStepSurvivesEveryAptOutcome(
Pipelines\NixCliPackageTests.cs (6)
25public async Task ManifestDescribesExpectedStableReleaseAssets() 57public async Task ManifestVersionMatchesPackageValidationBaselineVersion() 71public async Task UpdateVersionsParsesFirstHashTokenFromSha512CompanionFile() 116public async Task UpdateVersionsUsesSuppliedSha512OverridesWithoutReadingRelease() 178public async Task UpdateVersionsRejectsPartialSha512Overrides() 198public async Task FlakeLockPinsNixpkgsInput()
Pipelines\NpmCliPackageTests.cs (21)
42public async Task LauncherDetectsMuslArm64AndThrowsUnsupported() 56public async Task LauncherRejectsNonRegularCachedBinary() 71public async Task LauncherForwardsTerminatingSignalsToChild() 86public async Task LauncherUsesPlatformSpecificSignalListToAvoidWindowsCrash() 102public async Task LauncherRegistersSignalHandlersBeforeSpawningChild() 118public async Task LauncherDetectsMuslViaFilesystemFallbackWhenLddMissing() 132public async Task LauncherCreatesCacheDirectoryOwnerOnly() 144public async Task LauncherLoadsRidPackageMapInsideErrorHandler() 161public async Task LauncherPostinstallCheckSucceedsWhenNativePackageIsInstalled() 177public async Task LauncherPostinstallCheckExplainsDisabledOptionalDependenciesOnSupportedPlatform() 217public async Task LauncherPostinstallCheckSkipsUnsupportedPlatform() 245public async Task PackScriptGeneratesPointerPackageMetadataMapAndReadme() 316public async Task PointerPackageReadmeSupportedPlatformTextMatchesSupportedRidMatrix() 331public async Task PackScriptGeneratesRidPackageMetadataAndReadme(RidPackageExpectation expectation) 370public async Task NpmInstallValidationJobsUseExplicitJobsSharedStepsTemplateAndCentralArtifactNames() 409public async Task PolyglotTypeScriptToolchainUsesInternalNpmRegistry() 421public async Task RunTestsInstallsAzureFunctionsCoreToolsFromPinnedGitHubRelease() 433public async Task NpmSigningScopeCoversNestedTarballPayloads() 450public async Task ReleasePipelinePreflightsScheduledNpmPackagesBeforePublishing() 469public async Task ReleasePipelineGuardsNpmLatestDistTagAgainstServicingDowngrade() 480public async Task ReleasePipelineUsesEffectiveNpmOwnersAndApproversFromSingleSource()
Pipelines\ReleasePublishNugetPipelineTests.cs (33)
13public async Task ValidatesNpmPublishPreconditionsBeforeNuGetPublish() 35public async Task UsesEsrpPublishTemplateForNpmPublishing() 53public async Task DefinesTeamNameVariableForMicroBuildTelemetry() 69public async Task RoutesMicroBuildPublishAuthPluginToDncengFeedOrDisablesIt() 92public async Task AlreadyPublishedNpmPreflightExitsZeroAfterHandledRegistryMisses() 107public async Task NpmPublishUsesOnlyRidAndPointerSkipParameters() 122public async Task NpmLatestDistTagDowngradeGuardHasNoOverrideParameter() 134public async Task UsesRequiredNpmEsrpOwnersAndApprover() 163public async Task NpmEsrpOwnersRequireAnyConfiguredOwnerAlias() 177public async Task ForwardsNpmOwnerAndApproverParametersAsEnvironmentVariables() 197public async Task ComputesInstallerOnlyModeInsidePowerShell() 210public async Task DoesNotUseWildcardTemplateParameterExpressionLiteral() 221public async Task NpmPublishOwnerAndApproverParametersHaveWorkingDefaults() 238public async Task NpmAliasValidationHelpersMatchScript() 278public async Task ValidatesPublishedNpmPackageFromRegistryAfterPublish() 314public async Task PrepareNpmCliPackagesScriptIsBash32Compatible() 331public async Task PrepareNpmCliPackagesScriptInstallsOfflineWithTimeout() 350public async Task PointerPublishPreflightsRidPackagesAreOnRegistry() 378public async Task VerifiesStagedNpmPackageVersionsBeforeRidPublish() 405public async Task PostPublishSmokeRejectsEmptyAspireVersionOutput() 419public async Task PointerPreflightPinsPublicNpmRegistry() 439public async Task PointerPreflightRetriesForPropagationLag() 457public async Task NpmViewParsingFiltersToSemverShape() 477public async Task NpmSignatureSidecarsAreContentSanityChecked() 503public async Task AspireVersionCaptureStripsCarriageReturnForWindowsRunner() 533public async Task PointerPreflightExplicitlyPinsRegistryOnSpecLine() 549public async Task WinGetPublishingRunsOnlyForStableReleases() 579public async Task VSCodeExtensionPublishUsesAzureCredential() 601public async Task ExtensionReleaseInstructionsSkipNonExtensionReleaseLegs() 621public async Task ExtensionReleaseDryRunInstructionsDoNotOverstatePublisherRoleValidation() 630public async Task WinGetJobVerifiesWingetCreateBeforeConditionalSubmission() 650public async Task WinGetPreparationExercisesWingetCreate() 662public async Task MarketplacePublishingDocumentationKeepsIdentityDetailsInternalAndRetiresPat()
PowerShellScripts\AspireSkillsBundleHashTests.cs (2)
52public async Task NormalizesEveryLineEndingVariantToTheSameHash(LineEndings lineEndings) 64public async Task HookFileNamesMatchTheEmbeddedHookScripts()
PowerShellScripts\BuildTestMatrixTests.cs (20)
30public async Task GeneratesMatrixFromSingleProject() 60public async Task GeneratesMatrixFromMultipleProjects() 92public async Task GeneratesPartitionEntries() 133public async Task GeneratesClassEntries() 169public async Task DefaultsMtpBaseArgsToEmptyWhenNotSpecified() 196public async Task PreservesCustomMtpBaseArgs() 223public async Task PreservesRequiresNugetsProperty() 257public async Task GeneratesCorrectFilterArgs() 287public async Task CreatesEmptyMatrixWhenNoMetadataFiles() 307public async Task UsesUncollectedMtpBaseArgsForUncollectedEntry() 348public async Task PassesRequiresTestSdkProperty() 375public async Task PreservesSupportedOSes() 403public async Task InheritsSupportedOSesToPartitionEntries() 440public async Task PassesThroughRunnersForRegularTests() 469public async Task OmitsRunnersWhenNotSet() 495public async Task PassesThroughRunnersForPartitionEntries() 531public async Task PassesThroughRunnersForClassEntries() 570public async Task AllCITestsPropertiesAppearInOutputWithDefaults() 605public async Task DefaultsAreAppliedWhenPropertiesAreMissingFromMetadata() 693public async Task SplitTestEntriesInheritAllCITestsProperties()
PowerShellScripts\DownloadNativeArchivesTests.cs (13)
30public async Task FailsWhenAccessTokenIsMissing() 50public async Task FailsWhenNoArtifactsMatchPattern_ReportsAvailableArtifacts() 76public async Task FailsWhenArtifactTypeIsNotContainer() 100public async Task DownloadsAndExtractsMatchingEntries_PreservingArtifactPathComponent() 169public async Task RefusesToExtractZipEntryThatEscapesStagingRoot() 203public async Task FailsWhenOneArtifactDownloadFails_ButReportsAllResults() 243public async Task RetriesTransientDownloadFailure_ThenSucceeds() 279public async Task FailsFastForNonTransientHttpDownloadFailure() 307public async Task RetriesConnectionClosedDuringDownload_ThenSucceeds() 342public async Task RetriesCorruptDownload_ThenSucceeds() 449private Task? _serverTask; 537_serverTask = Task.Run(() => RunAsync(_cts.Token)); 540private async Task RunAsync(CancellationToken token)
PowerShellScripts\ExpandTestMatrixGitHubTests.cs (18)
30public async Task MapsWindowsToRunner() 57public async Task MapsLinuxToRunner() 84public async Task MapsMacOSToRunner() 108public async Task ExpandsMultipleOSes() 134public async Task GeneratesIncludeFormat() 161public async Task RemovesSupportedOSes() 192public async Task AddsRunsOnProperty() 224public async Task PreservesAllEntryProperties() 263public async Task HandlesEmptyMatrix() 280public async Task FailsWhenCanonicalMatrixNotFound() 293public async Task DefaultsToAllOSesWhenSupportedOSesEmpty() 319public async Task WarnsOnInvalidOS() 345public async Task HandlesOSNamesWithDifferentCasing() 371public async Task SplitTestsGoToNoNugetsCategory() 403public async Task UsesCustomRunnerForSpecificOS() 437public async Task UsesCustomRunnerForMultipleOSes() 477public async Task UsesDefaultRunnersWhenNoCustomRunnersSet() 506public async Task FullPipeline_SplitTestsExpandPerOS()
PowerShellScripts\PowerShellCommand.cs (4)
142var waitForExitTask = CurrentProcess.WaitForExitAsync(token); 143var completedTask = await Task.WhenAny(waitForExitTask, Task.Delay(TimeSpan.FromSeconds(5), token)).ConfigureAwait(false);
PowerShellScripts\SplitTestMatrixByDepsTests.cs (12)
33public async Task SplitsNoDepsTestsIntoNoNugetsBucket() 51public async Task SplitsRequiresNugetsTestsIntoRequiresNugetsBucket() 70public async Task SplitsRequiresNugetsByOs() 92public async Task SplitsRequiresCliArchiveTestsIntoCliArchiveBucket() 110public async Task CliArchiveTakesPriorityOverNugets() 126public async Task OverflowsEntriesBeyondThreshold() 144public async Task NoOverflowWhenBelowThreshold() 162public async Task HandlesEmptyMatrix() 181public async Task AllOutputKeysAlwaysPresent() 201public async Task ReadsMatrixFromFile() 220public async Task FailsWhenNoInputProvided() 233public async Task FailsWhenMatrixFileNotFound()
PowerShellScripts\SplitTestProjectsTests.cs (5)
39public async Task UsesCollectionModeWithPartitions() 69public async Task IncludesUncollectedEntry() 97public async Task OutputsValidJson() 128public async Task SortsPartitionsAlphabetically() 163public async Task FailsWhenAssemblyNotFound()
PowerShellScripts\StageNativeCliToolPackagesTests.cs (12)
40public async Task StagesCanonicalPointerAndRidPackages() 74public async Task StagesNpmPackagesWhenPresent() 104public async Task FailsWhenRequiredNpmPackagesAreMissing() 121public async Task FailsWhenCanonicalPointerPackageIsMissing() 138public async Task FailsWhenDuplicateCanonicalPointerPackagesAreDownloaded() 155public async Task FailsWhenRidPackageDoesNotMatchNativeArchiveRoot() 172public async Task FailsWhenRidPackageNameIsMalformed() 189public async Task FailsWhenDuplicateRidPackagesAreDownloaded() 206public async Task FailsWhenDuplicateRidPackagesHaveDifferentVersions() 225public async Task FailsWhenRidPackageVersionDoesNotMatchCanonicalPointerPackage() 244public async Task FailsWhenNoPackagesAreUnderNativeArchiveArtifacts() 261public async Task UsesConfiguredCanonicalPointerArtifactName()
PowerShellScripts\ValidateNpmPackageSignaturesTests.cs (9)
35public async Task FailsWhenShippingDirectoryDoesNotExist() 47public async Task FailsWhenShippingDirectoryIsAFile() 65public async Task FailsWhenNoNpmTarballsFound() 81public async Task FailsWhenSignatureSidecarIsMissing() 97public async Task FailsWhenSignatureIsShorterThanMinimumLength() 115public async Task FailsWhenSignatureHasNoPgpMarker() 134public async Task SucceedsForArmoredPgpSignature() 159public async Task SucceedsForBinaryOpenPgpSignaturePacket(int firstByteInt) 180public async Task ReportsAllFailuresInOnePass()
PowerShellScripts\ValidateNpmReleaseAliasesTests.cs (12)
31public async Task FailsWhenOwnersHasNoAliases() 43public async Task FailsWhenOwnersHasOnlyWhitespaceEntries() 55public async Task FailsWhenApproversHasMultipleAliases() 67public async Task FailsWhenOwnersHasMultipleAliases() 79public async Task FailsWhenOwnersMissingEveryRequiredAlias() 91public async Task FailsWhenOwnerAndApproverOverlap() 103public async Task FailsWhenAliasIsNotAMicrosoftEmail() 115public async Task FailsWhenMicrosoftEmailHasEmptyAlias() 127public async Task FailsWhenAliasContainsNewlineLoggingCommand() 142public async Task FailsWhenMicrosoftEmailSuffixWouldLeaveTrailingNewline() 155public async Task StripsMicrosoftEmailSuffixFromOwnerAliases() 166public async Task EmitsDeduplicatedEffectiveAliasesOnSuccess()
PowerShellScripts\WriteClassModeTestPropsTests.cs (3)
26public async Task WritesOverrideProjectToBuildForSplitProjectsWithoutPartitions() 65public async Task WritesZeroCountWhenEverySplitProjectAlreadyHasPartitions() 92public async Task FailsWhenClassModeMetadataDoesNotContainProjectPath()
tests\Shared\TemporaryWorkspace.cs (1)
27public async Task InitializeGitAsync(CancellationToken cancellationToken = default)
tools\GenerateCITimeline\GitHubApi.cs (1)
21await Task.WhenAll(stdoutTask, stderrTask).ConfigureAwait(false);
WorkflowScripts\AutoRerunTransientCiFailuresTests.cs (91)
35public async Task RetriesJobLevelInfrastructureFailureWithNoFailedSteps() 48public async Task RetriesRetrySafeFailedStepWhenAnnotationsMatchTransientSignature() 60public async Task SkipsJobsWhoseFailedStepsAreOutsideRetrySafeAllowlist() 73public async Task SkipsRetrySafeStepsWhenAnnotationsAreGeneric() 88public async Task IgnoresConfiguredAggregatorJobsEntirely(string jobName) 101public async Task KeepsMixedFailureVetoWhenIgnoredTestStepsFailAlongsideRetrySafeSteps() 116public async Task AllowsNarrowOverrideForExplicitJobLevelInfrastructureAnnotationsOnIgnoredSteps() 128public async Task AllowsNarrowOverrideForWindowsPostTestCleanupProcessInitializationFailures() 149public async Task DoesNotOverrideWindowsProcessInitializationFailuresWhenTestExecutionAlsoFailed() 169public async Task AllowsNarrowLogBasedOverrideForDncengFeedServiceIndexFailuresInIgnoredBuildSteps() 190public async Task AllowsSameFeedOverrideForOtherCiBootstrapBuildAndValidationSteps(string failedStep) 207public async Task AllowsSameNetworkOverrideForBroaderBootstrapStepsOutsideTheOldAllowlist() 224public async Task UsesPluralFailedStepLabelWhenMultipleFailedStepsShareALogBasedOverride() 241public async Task AllowsLogBasedOverrideForConnectionResetByPeerInBuildSteps() 258public async Task UsesLongerMarkdownFenceWhenMatchedPatternContainsBackticks() 272public async Task DoesNotApplyBroadNetworkOverrideWhenTestExecutionFailed() 290public async Task DoesNotRetryIgnoredBuildStepsWhenTheLogLacksFeedNetworkSignature() 308public async Task UsesAvailableDiagnosticsMessageWhenNoSignalsWereInspectedFromFailedStepsOrLogs() 323public async Task ContinuesInspectingLaterLogsWhenEarlierCandidatesAreNotRetryable() 352public async Task GetCheckRunIdForJobParsesCheckRunIdFromWorkflowJobPayload() 370public async Task GetCheckRunIdForJobFallsBackToLoadingWorkflowJobWhenNeeded() 388public async Task GetCheckRunIdForJobReturnsNullWhenNoCheckRunIdCanBeResolved() 407public async Task GetAssociatedPullRequestNumbersPrefersWorkflowRunPayloadWhenPresent() 430public async Task GetAssociatedPullRequestNumbersFallsBackToHeadLookupWhenPayloadOmitsPullRequests() 482public async Task GetAssociatedPullRequestNumbersPaginatesFallbackLookupUntilItFindsTheMatchingSha() 552public async Task GetAssociatedPullRequestNumbersRejectsAmbiguousFallbackMatches() 615public async Task GetAssociatedPullRequestNumbersReturnsEmptyWhenFallbackLookupFails() 641public async Task ComputeRerunEligibilityStillReportsSafeCandidatesDuringDryRun() 656public async Task ComputeRerunExecutionEligibilityDisablesRerunsWhenDryRunIsEnabled() 671public async Task AutomaticRerunRequiresAtLeastOneRetryableJob() 685public async Task AutomaticRerunIsEligibleWhenRetryableJobsStayWithinTheCap() 699public async Task AutomaticRerunIsSuppressedWhenMatchedJobsExceedTheCap() 718public async Task AttemptSpecificEligibilityRulesAreApplied(int retryableCount, int runAttempt, bool expectedEligible) 733public async Task ExecutionEligibilityAppliesTheStricterCapAfterTheFirstAttempt() 754public async Task ForceModeEligibilityDependsOnlyOnTheAttemptCap() 777public async Task ForceModeExecutionEligibilityRespectsDryRunAndTheAttemptCap() 797public async Task ForceModeRerunsFailedJobsWithAnEmptyJobListWhenPullRequestIsOpen() 846public async Task WorkflowYamlEnablesForceRerunAllMode() 879public async Task RepresentativeWorkflowFixturesStayAlignedWithCurrentWorkflowDefinitions() 927public async Task WorkflowYamlKeepsDocumentedSafetyRails() 946public async Task WriteAnalysisSummaryUsesExplicitOutcomeHeadingAndClickableAnalyzedRunLink() 979public async Task WriteAnalysisSummaryShowsWouldRerunDuringDryRun() 1011public async Task RerunMatchedJobsMakesNoRequestsWhenNoJobsAreSupplied() 1029public async Task RerunMatchedJobsRequestsOneRunLevelRerunAndWritesTheSummary() 1128public async Task RerunMatchedJobsSkipsRerunsWhenAllAssociatedPullRequestsAreClosed() 1173public async Task ForceRerunAllStillSkipsRerunWhenAllAssociatedPullRequestsAreClosed() 1206public async Task RerunMatchedJobsDoesNotFabricateCommentLinksWhenGitHubDoesNotReturnACommentUrl() 1243public async Task TestRetryPatternsJsonIsValidAndWellFormed() 1267public async Task TestRetryPatternsJsonHasValidRuleStructure() 1292public async Task TestRetryPatternsJsonPassesJavaScriptValidation() 1306public async Task TestRetryPatternsJsonRegexesCompileInJavaScript() 1332public async Task MatchesRetryPatternMatchesSubstringCaseInsensitively() 1343public async Task MatchesRetryPatternReturnsFalseWhenSubstringNotPresent() 1354public async Task MatchesRetryPatternMatchesRegexCaseInsensitively() 1365public async Task MatchesRetryPatternReturnsFalseForNonMatchingRegex() 1376public async Task MatchesRetryPatternHandlesInvalidRegexGracefully() 1387public async Task MatchTestFailurePatternsReturnsShouldRetryWhenOutputMatches() 1409public async Task MatchTestFailurePatternsReturnsFalseWhenNoPatternMatches() 1430public async Task MatchTestFailurePatternsSkipsDisabledPatterns() 1452public async Task MatchTestFailurePatternsUsesAndLogicWithinRules() 1474public async Task MatchTestFailurePatternsUsesOrLogicAcrossRules() 1497public async Task MatchTestFailurePatternsReturnsEmptyForNullInputs() 1509public async Task MatchJobLogPatternMatchesJobNameAndOutput() 1527public async Task MatchJobLogPatternReturnsNullWhenJobNameDoesNotMatch() 1543public async Task MatchJobLogPatternMatchesOutputOnlyPatterns() 1563public async Task AnalyzeFailedJobsWithConfigRetriesTestExecFailureViaJobLogPattern() 1589public async Task AnalyzeFailedJobsWithConfigSkipsWhenJobLogDoesNotMatchPattern() 1613public async Task AnalyzeFailedJobsWithConfigDoesNotApplyJobLogPatternToNonTestExecFailures() 1640public async Task AnalyzeTrxFilesFindsMatchedTests() 1666public async Task AnalyzeTrxFilesDedupesByTestName() 1694public async Task AnalyzeTrxFilesReturnsEmptyWhenNoMatches() 1719public async Task PromoteTestExecutionFailureJobsMovesTestExecJobsToRetryable() 1748public async Task PromoteTestExecutionFailureJobsDoesNothingWhenNoMatchedTests() 1768public async Task SelectTestResultsArtifactReturnsNewestNonExpired() 1787public async Task SelectTestResultsArtifactReturnsNullForExpired() 1803public async Task SelectTestResultsArtifactReturnsNullForOversized() 1821public async Task HasTestExecutionFailureStepReturnsTrueForRunTests() 1832public async Task HasTestExecutionFailureStepReturnsFalseForNonTestSteps() 1845public async Task ExtractFailedTestsFromTrxExtractsFailedTests() 1863public async Task ExtractFailedTestsFromTrxReturnsEmptyForNoFailures() 1877public async Task ExtractFailedTestsFromTrxReturnsEmptyForEmptyInput() 1888public async Task ExtractFailedTestsFromTrxHandlesMalformedXml() 1899public async Task ExtractFailedTestsFromTrxCapsOutputAt10KB() 1915public async Task ExtractFailedTestsFromTrxDecodesXmlEntities() 1931public async Task ExtractFailedTestsFromTrxDecodesDoubleEncodedXmlEntities() 1949public async Task ValidateRetryPatternsConfigRejectsUnknownTopLevelProperties() 1969public async Task ValidateRetryPatternsConfigRejectsWrongVersion() 1988public async Task ValidateRetryPatternsConfigRejectsMissingReason() 2010public async Task ValidateRetryPatternsConfigRejectsRuleWithNoMatcherFields() 2032public async Task ValidateRetryPatternsConfigRejectsInvalidRegex() 2054public async Task ValidateRetryPatternsConfigAcceptsValidConfig()
WorkflowScripts\CreateFailingTestIssueWorkflowTests.cs (13)
34public async Task ParseCommandSupportsFlagSyntax() 52public async Task ParseCommandFallsBackToDefaultSourceUrlForSinglePositionalArgument() 70public async Task ParseCommandUsesTrailingUrlForCompatibilitySyntax() 86public async Task ParseCommandSupportsPositionalTestNameWithFlags() 105public async Task ParseCommandRejectsAmbiguousPositionalSyntax() 120public async Task ParseCommandRejectsPositionalBeforeTestFlag() 135public async Task ParseCommandReturnsListOnlyWhenNoArgumentsProvided() 153public async Task ParseCommandReturnsListOnlyWhenFlagBasedWithoutTest() 171public async Task FormatListResponseReturnsErrorWhenResolverFailed() 187public async Task FormatListResponseReturnsTestNamesFromResult() 216public async Task FormatListResponseReturnsNoFailuresWhenResultIsEmpty() 233public async Task FormatListResponseReturnsErrorWhenResolverFailedWithResult() 254public async Task BuildIssueSearchQueryTargetsFailingTestIssuesByMetadataMarker()
WorkflowScripts\ExtensionChangelogFinalizedWorkflowTests.cs (18)
84public async Task PlaceholderContentFailsWithActionableAnnotation(string placeholder, string expectedReason, int expectedLine) 108public async Task FinalizedChangelogPasses() 128public async Task ReleaseBranchWithFinalizedMarkerAndNonExtensionBaseAdvancePasses() 147public async Task ReleaseBranchAcceptsLegacyDoneMarkerFromBaseBranchWorkflow() 166public async Task ReleaseBranchAllowsSyntacticallyValidButMissingFromSha() 187public async Task ReleaseBranchIgnoresHistoricalFinalizedMarkersOutsideTheCurrentSection() 212public async Task ReleaseBranchWithStaleExtensionBaseAdvanceFails() 233public async Task ReleaseBranchRequiresExactlyOneFinalizedMarker() 252public async Task ReleaseBranchCurrentVersionSectionRequiresReleaseNoteBullets() 269public async Task ReleaseBranchRejectsWhitespaceOnlyReleaseNoteBullets() 287public async Task ReleaseBranchGatePassesWhenFinalizedRangeIsAvailable() 302private async Task WriteChangelogAsync(string content) 429private async Task InitializeGitRepositoryAsync(string workingDirectory) 437private static async Task WritePackageJsonAsync(string workingDirectory, string version) 450private static async Task WriteChangelogAsync(string workingDirectory, string content) 453private static async Task WriteWorkspaceFileAsync(string workingDirectory, string relativePath, string content) 460private async Task CommitAllAsync(string workingDirectory, string message) 476private async Task RunGitAsync(string workingDirectory, params string[] args)
WorkflowScripts\ExtensionReleaseWorkflowTests.cs (22)
266public async Task CompiledWorkflowPreloadScriptHasValidBashSyntax() 278public async Task ApplyingTriggerLabelFailsWhenExistingLabelCannotBeRemoved() 309public async Task ApplyingTriggerLabelAddsLabelWithoutRemovingWhenMissing() 340public async Task ApplyingTriggerLabelReAddsExistingLabelAfterSuccessfulRemoval() 374public Task DeterministicFallbackIncludesEveryAcceptedCommitOnWindows() 380public Task DeterministicFallbackIncludesEveryAcceptedCommitOnUnix() 386public Task DeterministicFallbackAllowsRenderedOutputLargerThanEightThousandBytesOnWindows() 392public Task DeterministicFallbackAllowsRenderedOutputLargerThanEightThousandBytesOnUnix() 398public Task DeterministicFallbackSanitizesSplitlinesControlCharactersWithoutSplittingCommitsOnWindows() 404public Task DeterministicFallbackSanitizesSplitlinesControlCharactersWithoutSplittingCommitsOnUnix() 410public Task DeterministicFallbackStripsPrSuffixFromCrLfInputOnWindows() 416public Task DeterministicFallbackStripsPrSuffixFromCrLfInputOnUnix() 422public Task GitHubPullRequestBodyValidatorAcceptsBodiesAtLimitOnWindows() 428public Task GitHubPullRequestBodyValidatorAcceptsBodiesAtLimitOnUnix() 434public Task GitHubPullRequestBodyValidatorRejectsBodiesOverLimitOnWindows() 440public Task GitHubPullRequestBodyValidatorRejectsBodiesOverLimitOnUnix() 443private async Task DeterministicFallbackIncludesEveryAcceptedCommit(string pythonExecutable) 488private async Task DeterministicFallbackAllowsRenderedOutputLargerThanEightThousandBytes(string pythonExecutable) 507private async Task DeterministicFallbackSanitizesSplitlinesControlCharactersWithoutSplittingCommits(string pythonExecutable) 529private async Task DeterministicFallbackStripsPrSuffixFromCrLfInput(string pythonExecutable) 544private async Task GitHubPullRequestBodyValidatorAcceptsBodiesAtLimit(string pythonExecutable) 563private async Task GitHubPullRequestBodyValidatorRejectsBodiesOverLimit(string pythonExecutable)
WorkflowScripts\MonitorScheduledWorkflowsIntegrationTests.cs (15)
79public async Task DryRunDoesNotMutateGitHub() 99public async Task RealRunFilesIssueAndRecordsFailureComment() 116public async Task DedupsWhenLatestFailedRunAlreadyRecorded() 138public async Task DryRunDoesNotLogRecordWhenFailedRunAlreadyRecorded() 158public async Task ClosesIssueWhenLatestRunIsGreen() 180public async Task LeavesIssueOpenWhenAutoCloseStampIsFalse() 201public async Task DryRunDoesNotLogCloseWhenAutoCloseStampIsFalse() 222public async Task DryRunLogsCloseAfterWouldRecordWhenNewestRunSucceeded() 245public async Task DryRunRecordsMultipleFailuresInWindowWithoutReadingPlaceholderComments() 268public async Task DoesNotCommentWhenCloseFails() 290public async Task ProcessesRecentFailureEvenWhenNewerRunSucceeded() 314public async Task DoesNotCloseWhenNewestRunInPollingWindowIsRecordedFailure() 340public async Task SelfReportsEntryFilesBackstopIssueWithPerEntryLabelsOnStartupFailure() 362public async Task SelfReportsBackstopIssueDoesNotUseFailingTestLabel(string workflowFile) 376public async Task SelfReportsEntryDoesNotFileOnPlainFailure()
WorkflowScripts\MonitorScheduledWorkflowsTests.cs (14)
35public async Task BuildMarkerEmbedsWorkflowFile() 44public async Task SelectEnabledDropsDisabledEntries() 69public async Task BuildIssueTitleIncludesDisplayName() 78public async Task DecideActionRecordsWhenFailingWithoutIssue() 92public async Task DecideActionRecordsWhenFailingWithExistingIssue(string conclusion) 105public async Task DecideActionClosesWhenSucceedingWithExistingIssue() 116public async Task DecideActionNoopsWhenSucceedingWithoutIssue() 130public async Task DecideActionNoopsForNonActionableConclusions(string? conclusion) 141public async Task BuildIssueBodyIsStaticDescriptionWithMarker() 163public async Task FormatCommentDescribesRunAndConclusion() 185public async Task DecideActionForSelfReportsBackstopsStartupAndTimeoutButNotFailure(string conclusion, string expected) 199public async Task DecideActionForSelfReportsClosesOnGreen() 210public async Task BuildIssueBodyStampsAutoCloseTrue() 227public async Task BuildIssueBodyForSelfReportsExplainsBackstopScope()
WorkflowScripts\NodeCommand.cs (4)
134var waitForExitTask = CurrentProcess.WaitForExitAsync(token); 135var completedTask = await Task.WhenAny(waitForExitTask, Task.Delay(TimeSpan.FromSeconds(5), token)).ConfigureAwait(false);
WorkflowScripts\PrDocsCheckWorkflowTests.cs (3)
164public Task PythonTestsPassOnWindows() => PythonTestsPass("python"); 169public Task PythonTestsPassOnUnix() => PythonTestsPass("python3"); 171private async Task PythonTestsPass(string python)
WorkflowScripts\ReportCiFailureIntegrationTests.cs (12)
42public async Task ReportFailureFilesAutoCloseIssueAndRecordsRunAsComment() 65public async Task ReportFailureKeysSeparateIssuesPerBranch() 88public async Task ReportFailureCommentsOnExistingIssueForNewRun() 109public async Task ReportFailureCommentFailureLeavesRunUnrecorded() 125public async Task ResolveSuccessClosesTheBranchIssue() 149public async Task ResolveSuccessLeavesIssueOpenWhenAutoCloseStampIsMissing() 170public async Task ResolveSuccessDoesNotCommentWhenCloseFails() 192public async Task ResolveSuccessIsNoopWhenNoIssueOpen() 208public async Task ResolveSuccessLeavesAnotherBranchIssueOpen() 228public async Task TrackOpensIssueWhenCiRed() 244public async Task TrackClosesIssueWhenCiGreen() 262public async Task TrackIsNoopWhenNeitherRedNorGreen()
WorkflowScripts\ReportCiFailureTests.cs (4)
38public async Task BuildMarkerEmbedsRef(string @ref, string expected) 47public async Task BuildIssueTitleNamesTheBranch() 56public async Task BuildIssueBodyStampsAutoCloseTrueAndCarriesMarker() 69public async Task FormatCommentLinksTheRunAndCommit()
WorkflowScripts\ReportPipelineFailureIntegrationTests.cs (9)
50public async Task FilesIssueWithAllLabelsAndRecordsRunAsComment() 79public async Task CommentDetailRidesOnTheComment() 97public async Task ForcesAutomationBrokenLabelEvenIfCallerOmitsIt() 117public async Task CommentFailureLeavesRunUnrecorded() 135public async Task RetryAfterCommentFailurePostsExactlyOnceThenDedups() 171public async Task CommentsOnExistingIssueForNewRun() 196public async Task ReopensClosedIssueForNewRun() 231public async Task DoesNotManageAnotherWorkflowsAutomationBrokenIssue() 260public async Task PullRequestCarryingMarkerIsIgnored()
WorkflowScripts\ReportPipelineFailureTests.cs (6)
37public async Task BuildMarkerEmbedsWorkflowFile(string file, string expected) 46public async Task BuildIssueTitleIsNeutral() 58public async Task BuildIssueBodyIsStaticDescriptionWithMarker() 80public async Task BuildIssueBodyEmbedsCcWhenProvided() 108public async Task FormatCommentReferencesRunAndCommit() 120public async Task FormatCommentAppendsDetailWhenProvided()
WorkflowScripts\ReportSpecializedTestFailuresTests.cs (13)
37public async Task BuildMarkerEmbedsWorkflowAndKind(string kind, string expected) 49public async Task LabelForKindMapsCorrectly(string kind, string expected) 60public async Task BuildIssueTitleVariesByKind(string kind, string expected) 69public async Task ClassifyFailureTreatsQuarantineFailureAsInfra() 82public async Task ClassifyFailureIsTestFailuresWhenOuterloopTestsFailed() 93public async Task ClassifyFailureIsInfraWhenOuterloopFailedWithNoTestFailures() 104public async Task ClassifyFailureIsNoneWhenRunSucceeded() 115public async Task ClassifyFailureIsTestFailuresWhenExtractionFailedOnRedOuterloopRun() 129public async Task BuildIssueBodyIsStaticDescriptionWithMarker() 152public async Task FormatCommentForTestFailuresWithNoNamesPointsAtArtifacts() 170public async Task FormatCommentEscapesBacktickInTestName() 190public async Task FormatCommentListsFailedTestsCapped() 211public async Task FormatCommentForInfraReferencesRunOnly()
WorkflowScripts\SelectTestsCommentScriptTests.cs (7)
40public async Task NewCommitCreatesCommentLinkingPrHeadAndMinimizesSuperseded() 65public async Task RerunOfSameCommitUpdatesInPlaceWithoutNewComment() 88public async Task FallsBackToContextShaWhenNotPullRequest() 103public async Task SkipsCommentWhenSummaryFileMissing() 117public async Task MigratesLegacyStickyCommentByCreatingFreshAndCollapsingIt() 135public async Task NewCommitMinimizesAllSupersededComments() 155public async Task StaleRerunUpdatesOwnCommentButMinimizesNothing()
WorkflowScripts\SpecializedTestFailureRunnerTests.cs (7)
50public async Task FilesTestFailuresIssueAndRecordsRunAsComment() 73public async Task CommentFailureLeavesRunUnrecorded() 91public async Task RetryAfterCommentFailurePostsExactlyOnceThenDedups() 126public async Task ReopensClosedIssueForNewRun() 162public async Task MissingResultsPathIsClassifiedAsTestFailures() 179public async Task QuarantineFailureFilesInfraIssue() 198public async Task PullRequestCarryingMarkerIsIgnored()
WorkflowScripts\TrackingIssueTests.cs (15)
37public async Task FindOpenIssueForMarkerReturnsOldestMatch() 58public async Task FindOpenIssueForMarkerReturnsNullWhenNoMatch() 69public async Task RunMarkerEmbedsRunIdAsHtmlComment() 78public async Task RecordRunFilesIssueAndCommentsWhenNoneExists() 97public async Task RecordRunCommentsOnExistingIssueForNewRun() 124public async Task RecordRunSkipsWhenRunAlreadyRecorded() 149public async Task RecordRunReopensClosedIssueForNewRun() 176public async Task RecordRunPrefersOpenIssueOverOlderClosedDuplicate() 208public async Task BuildBodyEmbedsAutoCloseStampWhenTrue() 220public async Task BuildBodyEmbedsAutoCloseStampWhenFalse() 231public async Task BuildBodyOmitsAutoCloseStampWhenUnset() 242public async Task ReadAutoCloseReturnsTrueForTrueStamp() 253public async Task ReadAutoCloseReturnsFalseForFalseStamp() 264public async Task ReadAutoCloseReturnsNullWhenStampMissing() 275public async Task ReadAutoCloseReturnsNullWhenStampUnparseable()
installer.tasks (2)
StaticFileRegeneration\RegenerateThirdPartyNotices.cs (2)
49public async Task ExecuteAsync(HttpClient client) 51var results = await Task.WhenAll(TpnRepos
Microsoft.Agents.AI.ProjectTemplates.Tests (5)
AIAgentWebAPIExecutionTests.cs (1)
59public async Task TestAllSupportedConfigurations(params string[] args)
AIAgentWebAPISnapshotTests.cs (1)
29public async Task RunSnapshotTests(params string[] templateArgs)
TemplateExecutionTestBase.cs (1)
33protected async Task CreateRestoreAndBuild(string projectName, string[] args, string? startupProjectRelativePath = null)
TemplateExecutionTestClassFixtureBase.cs (2)
117public async Task RestoreProjectAsync(Project project) 134public async Task BuildProjectAsync(Project project)
Microsoft.Analyzers.Extra (2)
LegacyLoggingFixer.cs (1)
56public override async Task RegisterCodeFixesAsync(CodeFixContext context)
MakeExeTypesInternalFixer.cs (1)
26public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.Analyzers.Extra.Tests (65)
ArraysTests.cs (1)
17public static async Task Arrays()
AsyncCallInsideUsingBlockAnalyzerTests.cs (19)
44public static async Task WhenTaskIsAwaited_Ok() 63public static async Task WhenTaskInUsingDeclarationIsAwaited_Ok() 80public static async Task WhenTaskIsAwaitedWithConfigureAwait_Ok() 99public static async Task WhenTaskIsAssignedAndAwaited_Ok() 119public static async Task WhenDisposableInLambda_Ignored() 138public static async Task WhenTaskIsNotAwaited_Fires() 158public static async Task WhenDeclaredVarIsNotAwaited_Fires() 178public static async Task WhenTaskIsSyncWaited_Ok() 198public static async Task WhenAssignedVarIsSyncWaited_Ok() 220public static async Task WhenAssignedVarIsNotAwaited_Fires() 241public static async Task WhenAssignedVarIsAwaitedWithWhenAll_Ok() 262public static async Task WhenValueTaskIsNotAwaited_Fires() 282public static async Task WhenTaskResultIsNotAwaited_Fires() 302public static async Task WhenDeclaredResultVarIsSyncWaited_Ok() 323public static async Task WhenResultIsSyncWaited_Ok() 343public static async Task WhenResultIsGetAwaiterWaited_Ok() 363public static async Task WhenDisposableInArrow_Ignored() 384public static async Task WhenInvocationIsSync_Ok() 398private static async Task RunAnalyzer(string source, int expected)
AsyncMethodWithoutCancellationTests.cs (9)
15public static async Task WhenAsyncMethodWithoutCancellation_Failure() 31public static async Task WhenAsyncMethodWithinObsoleteType_Ok() 49public static async Task WhenAsyncMethodIsObsolete_Ok() 67public static async Task WhenAsyncMethodWithCancellationToken_Ok() 84public static async Task WhenAsyncMethodWithHttpContext_Ok() 101public static async Task WhenAsyncResultWithoutCancellation_Failure() 117public static async Task WhenAsyncMethodIsInterface_Failure() 137public static async Task WhenAsyncMethodIsOverride_Failure() 159private static async Task RunAnalyzer(string source, int expected)
CoalesceAnalyzerTests.cs (3)
12public static async Task CoalesceAssignmentWithTask() 46public static async Task CoalesceAssignment() 105public static async Task Coalesce()
ConditionalAccessAnalyzerTests.cs (1)
12public static async Task Basic()
LegacyCollectionTests.cs (1)
14public static async Task Basic()
LegacyLoggingTests.cs (13)
19public static async Task TargetClassInNamespace() 86public static async Task UsesExistingParameterNamesAsArgs() 179public static async Task TargetClassDoesntExistWithNamespace() 243public static async Task TargetClassDoesntExistWithFileScopedNamespace() 303public static async Task TargetClassExistWithDeepNamespace() 377public static async Task TargetClassDoesntExistInNestedType() 454public static async Task TargetClassHasMethodsWithoutEventId() 536public static async Task TargetClassHasMethodsWithAndWithoutEventId() 624public static async Task DuplicateFilename() 696public static async Task MissingMetadata() 776public static async Task FailureModes() 849GetSyntaxRootAsync = (_, _) => Task.FromResult<SyntaxNode?>(null) 862GetSemanticModelAsync = (_, _) => Task.FromResult<SemanticModel?>(null)
LegacyLoggingTests.Extra.cs (8)
16public static async Task PropertyAccess() 105public static async Task MissingReferenceToLoggerMessageAttribute() 186public static async Task TargetClassDoesntExist() 247public static async Task StringConstant() 310public static async Task ConcatenatedString() 371public static async Task InterpolatedString() 447public static async Task Basic() 697public static async Task Nullable()
MakeExeTypesInternalTests.cs (2)
14public static async Task Basic() 79public static async Task Disqualification()
SplitTests.cs (1)
13public static async Task FlagStringSplit()
StartsEndsWithTests.cs (2)
13public static async Task FlagStartsWith() 70public static async Task FlagEndsWith()
StaticTimeTests.cs (2)
18Assembly.GetAssembly(typeof(Task))!, 24public static async Task StaticTime()
UsingToStringInLoggersTests.cs (2)
23public async Task UsingToStringInLogger() 79public async Task NonLoggerAttribute()
ValueTupleTests.cs (1)
13public static async Task ValueTuple()
Microsoft.Analyzers.Local.Tests (18)
ApiLifecycleAnalyzerTest.cs (2)
27public async Task Analyzer_Reports_Diagnostics_When_Code_Was_Not_Annotated_Correctly(int expectedDiagnostics, string fileName, 54public async Task Analyzer_Reports_Diagnostics_When_StableCode_Was_Not_Found_In_The_Compilation(int expectedDiagnostics, string fileName,
InternalReferencedInPublicDocAnalyzerTests.cs (12)
99public async Task ShouldIndicateWhenExternallyVisibleMemberReferencesTopLevelInternalType(string member, string type) 118public async Task ShouldNotIndicateWhenMemberReferencesTopLevelType(string member, string type) 143public async Task ShouldNotIndicateWhenInternalClassMemberReferencesTopLevelType(string member, string type) 162public async Task ShouldIndicateWhenExternallyVisibleTopLevelTypeReferencesItsInvisibleMember(string type, string member) 193public async Task ShouldNotIndicateWhenTopLevelTypeReferencesItsMember(string type, string member) 206public async Task ShouldSupportReferencesToEnumMembers(string enumAccess, bool shouldIndicate) 244public async Task ShouldSupportCommentsOnEnumMembers(string enumAccess, string typeAccess, bool shouldIndicate) 297public async Task ShouldSupportCrefPointingToNestedType(string enclosingTypeAccess, string nestedTypeAccess, bool shouldIndicate) 349public async Task ShouldSupportCrefOnNestedType(string enclosingTypeAccess, string nestedTypeAccess, bool shouldIndicate) 388public async Task ShouldNotIndicateWhenCrefIsInvalid(string cref) 409public async Task ShouldNotIndicateWhenCommentIsOrphan() 431public async Task ShouldNotIndicateWhenCRefDoesNotBelongToXmlDocumentation()
ToInvariantStringTests.cs (1)
13public static async Task Basic()
UseThrowsTests.cs (3)
26public static async Task ShouldFindSingleWarning(string original, string exception) 40public static async Task ShouldNotProduceWarnings(string original) 274public static async Task Expression_ShouldFindSingleWarning(string original)
Microsoft.Arcade.Common (13)
ArcadeHttpMessageHandler.cs (2)
24return Task.FromResult(new HttpResponseMessage() 31return Task.FromResult(new HttpResponseMessage()
ExponentialRetry.cs (1)
88await Task.Delay(delay, cancellationToken);
Helpers.cs (2)
65public void MutexExec(Func<Task> function, string mutexName) => 75public void DirectoryMutexExec(Func<Task> function, string path) =>
IHelpers.cs (2)
15void MutexExec(Func<Task> function, string mutexName); 19void DirectoryMutexExec(Func<Task> function, string path);
IZipArchiveManager.cs (3)
26Task AddResourceFileToArchive<TAssembly>(string archivePath, string resourceName, string targetFileName = null); 34Task AddContentToArchive(string archivePath, string targetFilename, Stream content); 42Task AddContentToArchive(string archivePath, string targetFilename, string content);
ZipArchiveManager.cs (3)
18public async Task AddResourceFileToArchive<TAssembly>(string archivePath, string resourceName, string targetFileName = null) 44public Task AddContentToArchive(string archivePath, string targetFilename, string content) 47public async Task AddContentToArchive(string archivePath, string targetFilename, Stream content)
Microsoft.AspNetCore (8)
Internal\CsrfProtectionMiddleware.cs (2)
35public Task InvokeAsync(HttpContext context) 58private async Task InvokeCoreAsync(HttpContext context)
WebApplication.cs (6)
157/// A <see cref="Task"/> that represents the startup of the <see cref="WebApplication"/>. 160public Task StartAsync(CancellationToken cancellationToken = default) => 168/// A <see cref="Task"/> that represents the shutdown of the <see cref="WebApplication"/>. 171public Task StopAsync(CancellationToken cancellationToken = default) => 179/// A <see cref="Task"/> that represents the entire runtime of the <see cref="WebApplication"/> from startup to shutdown. 181public Task RunAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? url = null)
Microsoft.AspNetCore.Antiforgery (5)
AntiforgeryMiddleware.cs (2)
13public Task Invoke(HttpContext context) 36public async Task InvokeAwaited(HttpContext context)
IAntiforgery.cs (2)
54/// <returns>A <see cref="Task"/> that completes when validation has completed.</returns> 58Task ValidateRequestAsync(HttpContext httpContext);
Internal\DefaultAntiforgery.cs (1)
139public async Task ValidateRequestAsync(HttpContext httpContext)
Microsoft.AspNetCore.App.Analyzers (8)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (4)
70return Task.FromResult<CompletionDescription?>(null); 73return Task.FromResult<CompletionDescription?>(CompletionDescription.Create( 87return Task.FromResult(CompletionChange.Create( 92public override async Task ProvideCompletionsAsync(CompletionContext context)
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (4)
64return Task.FromResult<CompletionDescription?>(null); 67return Task.FromResult<CompletionDescription?>(CompletionDescription.Create( 81return Task.FromResult(CompletionChange.Create( 86public override async Task ProvideCompletionsAsync(CompletionContext context)
Microsoft.AspNetCore.App.CodeFixes (20)
Authorization\AddAuthorizationBuilderFixer.cs (2)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 138return Task.FromResult(document.WithSyntaxRoot(
Dependencies\AddPackageFixer.cs (1)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Dependencies\ExtensionMethodsCompletionProvider.cs (1)
27public override async Task ProvideCompletionsAsync(CompletionContext context)
DetectMismatchedParameterOptionalityFixer.cs (2)
23public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 34return Task.CompletedTask;
Http\HeaderDictionaryAddFixer.cs (3)
28public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 74return Task.FromResult(document.WithSyntaxRoot( 103return Task.FromResult(document.WithSyntaxRoot(root.ReplaceNode(diagnosticTarget, assignment)));
Http\HeaderDictionaryIndexerFixer.cs (2)
23public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 39return Task.CompletedTask;
Kestrel\ListenOnIPv6AnyFixer.cs (2)
24public override Task RegisterCodeFixesAsync(CodeFixContext context) 77return Task.CompletedTask;
PublicPartialProgramClassFixer.cs (2)
23public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 51return Task.CompletedTask;
RouteParameterUnusedParameterFixer.cs (3)
29public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 68return Task.FromResult(document); 71return Task.FromResult(UpdateDocument(diagnostic, root, document, routeUsage.UsageContext.MethodSyntax));
WebApplicationBuilderFixer.cs (2)
29public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 81return Task.FromResult(document.WithSyntaxRoot(root.ReplaceNode(diagnosticTarget, invocation)));
Microsoft.AspNetCore.Authentication (32)
AuthenticationHandler.cs (11)
147public async Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 169protected virtual async Task InitializeEventsAsync() 183protected virtual Task<object> CreateEventsAsync() => Task.FromResult(new object()); 189protected virtual Task InitializeHandlerAsync() => Task.CompletedTask; 286protected virtual Task HandleForbiddenAsync(AuthenticationProperties properties) 289return Task.CompletedTask; 299protected virtual Task HandleChallengeAsync(AuthenticationProperties properties) 302return Task.CompletedTask; 306public async Task ChallengeAsync(AuthenticationProperties? properties) 321public async Task ForbidAsync(AuthenticationProperties? properties)
AuthenticationMiddleware.cs (1)
40public async Task Invoke(HttpContext context)
Events\RemoteAuthenticationEvents.cs (9)
14public Func<AccessDeniedContext, Task> OnAccessDenied { get; set; } = context => Task.CompletedTask; 19public Func<RemoteFailureContext, Task> OnRemoteFailure { get; set; } = context => Task.CompletedTask; 24public Func<TicketReceivedContext, Task> OnTicketReceived { get; set; } = context => Task.CompletedTask; 29public virtual Task AccessDenied(AccessDeniedContext context) => OnAccessDenied(context); 34public virtual Task RemoteFailure(RemoteFailureContext context) => OnRemoteFailure(context); 39public virtual Task TicketReceived(TicketReceivedContext context) => OnTicketReceived(context);
PolicySchemeHandler.cs (4)
37protected override Task HandleChallengeAsync(AuthenticationProperties? properties) 41protected override Task HandleForbiddenAsync(AuthenticationProperties? properties) 45protected override Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 49protected override Task HandleSignOutAsync(AuthenticationProperties? properties)
RemoteAuthenticationHandler.cs (3)
63=> Task.FromResult<object>(new RemoteAuthenticationEvents()); 70=> Task.FromResult(Options.CallbackPath == Request.Path); 225protected override Task HandleForbiddenAsync(AuthenticationProperties properties)
SignInAuthenticationHandler.cs (2)
38public virtual Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 52protected abstract Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties);
SignOutAuthenticationHandler.cs (2)
37public virtual Task SignOutAsync(AuthenticationProperties? properties) 49protected abstract Task HandleSignOutAsync(AuthenticationProperties? properties);
Microsoft.AspNetCore.Authentication.Abstractions (25)
AuthenticationHttpContextExtensions.cs (16)
41public static Task ChallengeAsync(this HttpContext context, string? scheme) => 51public static Task ChallengeAsync(this HttpContext context) => 62public static Task ChallengeAsync(this HttpContext context, AuthenticationProperties? properties) => 73public static Task ChallengeAsync(this HttpContext context, string? scheme, AuthenticationProperties? properties) => 83public static Task ForbidAsync(this HttpContext context, string? scheme) => 93public static Task ForbidAsync(this HttpContext context) => 104public static Task ForbidAsync(this HttpContext context, AuthenticationProperties? properties) => 115public static Task ForbidAsync(this HttpContext context, string? scheme, AuthenticationProperties? properties) => 125public static Task SignInAsync(this HttpContext context, string? scheme, ClaimsPrincipal principal) => 135public static Task SignInAsync(this HttpContext context, ClaimsPrincipal principal) => 146public static Task SignInAsync(this HttpContext context, ClaimsPrincipal principal, AuthenticationProperties? properties) => 157public static Task SignInAsync(this HttpContext context, string? scheme, ClaimsPrincipal principal, AuthenticationProperties? properties) => 166public static Task SignOutAsync(this HttpContext context) => context.SignOutAsync(scheme: null, properties: null); 175public static Task SignOutAsync(this HttpContext context, AuthenticationProperties? properties) => context.SignOutAsync(scheme: null, properties: properties); 183public static Task SignOutAsync(this HttpContext context, string? scheme) => context.SignOutAsync(scheme, properties: null); 192public static Task SignOutAsync(this HttpContext context, string? scheme, AuthenticationProperties? properties) =>
IAuthenticationHandler.cs (3)
18Task InitializeAsync(AuthenticationScheme scheme, HttpContext context); 30Task ChallengeAsync(AuthenticationProperties? properties); 36Task ForbidAsync(AuthenticationProperties? properties);
IAuthenticationService.cs (4)
30Task ChallengeAsync(HttpContext context, string? scheme, AuthenticationProperties? properties); 40Task ForbidAsync(HttpContext context, string? scheme, AuthenticationProperties? properties); 50Task SignInAsync(HttpContext context, string? scheme, ClaimsPrincipal principal, AuthenticationProperties? properties); 59Task SignOutAsync(HttpContext context, string? scheme, AuthenticationProperties? properties);
IAuthenticationSignInHandler.cs (1)
19Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties);
IAuthenticationSignOutHandler.cs (1)
16Task SignOutAsync(AuthenticationProperties? properties);
Microsoft.AspNetCore.Authentication.BearerToken (7)
BearerTokenEvents.cs (3)
14public Func<MessageReceivedContext, Task> OnMessageReceived { get; set; } = context => Task.CompletedTask; 20public virtual Task MessageReceivedAsync(MessageReceivedContext context) => OnMessageReceived(context);
BearerTokenHandler.cs (4)
58protected override Task HandleChallengeAsync(AuthenticationProperties properties) 64protected override async Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 92protected override Task HandleSignOutAsync(AuthenticationProperties? properties) => Task.CompletedTask;
Microsoft.AspNetCore.Authentication.Certificate (12)
CertificateAuthenticationHandler.cs (3)
42protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new CertificateAuthenticationEvents()); 44protected override Task InitializeHandlerAsync() 189protected override async Task HandleChallengeAsync(AuthenticationProperties properties)
Events\CertificateAuthenticationEvents.cs (9)
16public Func<CertificateAuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask; 26public Func<CertificateValidatedContext, Task> OnCertificateValidated { get; set; } = context => Task.CompletedTask; 31public Func<CertificateChallengeContext, Task> OnChallenge { get; set; } = context => Task.CompletedTask; 38public virtual Task AuthenticationFailed(CertificateAuthenticationFailedContext context) => OnAuthenticationFailed(context); 45public virtual Task CertificateValidated(CertificateValidatedContext context) => OnCertificateValidated(context); 50public virtual Task Challenge(CertificateChallengeContext context) => OnChallenge(context);
Microsoft.AspNetCore.Authentication.Cookies (43)
CookieAuthenticationEvents.cs (27)
20public Func<CookieValidatePrincipalContext, Task> OnValidatePrincipal { get; set; } = context => Task.CompletedTask; 25public Func<CookieSlidingExpirationContext, Task> OnCheckSlidingExpiration { get; set; } = context => Task.CompletedTask; 30public Func<CookieSigningInContext, Task> OnSigningIn { get; set; } = context => Task.CompletedTask; 35public Func<CookieSignedInContext, Task> OnSignedIn { get; set; } = context => Task.CompletedTask; 40public Func<CookieSigningOutContext, Task> OnSigningOut { get; set; } = context => Task.CompletedTask; 45public Func<RedirectContext<CookieAuthenticationOptions>, Task> OnRedirectToLogin { get; set; } = context => 56return Task.CompletedTask; 62public Func<RedirectContext<CookieAuthenticationOptions>, Task> OnRedirectToAccessDenied { get; set; } = context => 73return Task.CompletedTask; 79public Func<RedirectContext<CookieAuthenticationOptions>, Task> OnRedirectToLogout { get; set; } = context => 89return Task.CompletedTask; 95public Func<RedirectContext<CookieAuthenticationOptions>, Task> OnRedirectToReturnUrl { get; set; } = context => 105return Task.CompletedTask; 130public virtual Task ValidatePrincipal(CookieValidatePrincipalContext context) => OnValidatePrincipal(context); 136public virtual Task CheckSlidingExpiration(CookieSlidingExpirationContext context) => OnCheckSlidingExpiration(context); 142public virtual Task SigningIn(CookieSigningInContext context) => OnSigningIn(context); 148public virtual Task SignedIn(CookieSignedInContext context) => OnSignedIn(context); 154public virtual Task SigningOut(CookieSigningOutContext context) => OnSigningOut(context); 160public virtual Task RedirectToLogout(RedirectContext<CookieAuthenticationOptions> context) => OnRedirectToLogout(context); 166public virtual Task RedirectToLogin(RedirectContext<CookieAuthenticationOptions> context) => OnRedirectToLogin(context); 172public virtual Task RedirectToReturnUrl(RedirectContext<CookieAuthenticationOptions> context) => OnRedirectToReturnUrl(context); 178public virtual Task RedirectToAccessDenied(RedirectContext<CookieAuthenticationOptions> context) => OnRedirectToAccessDenied(context);
CookieAuthenticationHandler.cs (10)
70protected override Task InitializeHandlerAsync() 74return Task.CompletedTask; 81protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new CookieAuthenticationEvents()); 93private async Task CheckForRefreshAsync(AuthenticationTicket ticket) 240protected virtual async Task FinishResponseAsync() 292protected override async Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 382protected override async Task HandleSignOutAsync(AuthenticationProperties? properties) 422private async Task ApplyHeaders(bool shouldRedirect, bool shouldHonorReturnUrlParameter, AuthenticationProperties properties) 460protected override async Task HandleForbiddenAsync(AuthenticationProperties properties) 473protected override async Task HandleChallengeAsync(AuthenticationProperties properties)
ITicketStore.cs (6)
45Task RenewAsync(string key, AuthenticationTicket ticket); 54Task RenewAsync(string key, AuthenticationTicket ticket, CancellationToken cancellationToken) => RenewAsync(key, ticket); 64Task RenewAsync(string key, AuthenticationTicket ticket, HttpContext httpContext, CancellationToken cancellationToken) => RenewAsync(key, ticket, cancellationToken); 95Task RemoveAsync(string key); 103Task RemoveAsync(string key, CancellationToken cancellationToken) => RemoveAsync(key); 112Task RemoveAsync(string key, HttpContext httpContext, CancellationToken cancellationToken) => RemoveAsync(key, cancellationToken);
Microsoft.AspNetCore.Authentication.Core (14)
AuthenticationSchemeProvider.cs (5)
50private static readonly Task<AuthenticationScheme?> _nullScheme = Task.FromResult<AuthenticationScheme?>(null); 123=> Task.FromResult(_schemes.TryGetValue(name, out var scheme) ? scheme : null); 130=> Task.FromResult(_requestHandlersCopy); 208=> Task.FromResult(_schemesCopy); 216_autoDefaultScheme = Task.FromResult<AuthenticationScheme?>(_schemesCopy.First());
AuthenticationService.cs (4)
108public virtual async Task ChallengeAsync(HttpContext context, string? scheme, AuthenticationProperties? properties) 131public virtual async Task ForbidAsync(HttpContext context, string? scheme, AuthenticationProperties? properties) 155public virtual async Task SignInAsync(HttpContext context, string? scheme, ClaimsPrincipal principal, AuthenticationProperties? properties) 197public virtual async Task SignOutAsync(HttpContext context, string? scheme, AuthenticationProperties? properties)
AuthenticationServiceImpl.cs (4)
37public override async Task ChallengeAsync(HttpContext context, string? scheme, AuthenticationProperties? properties) 52public override async Task ForbidAsync(HttpContext context, string? scheme, AuthenticationProperties? properties) 67public override async Task SignInAsync(HttpContext context, string? scheme, ClaimsPrincipal principal, AuthenticationProperties? properties) 82public override async Task SignOutAsync(HttpContext context, string? scheme, AuthenticationProperties? properties)
NoopClaimsTransformation.cs (1)
20return Task.FromResult(principal);
Microsoft.AspNetCore.Authentication.DeviceBoundSessions (13)
DeviceBoundSessionCookieEvents.cs (10)
31public override async Task ValidatePrincipal(CookieValidatePrincipalContext context) 36public override async Task CheckSlidingExpiration(CookieSlidingExpirationContext context) 41public override async Task SigningIn(CookieSigningInContext context) 47public override async Task SignedIn(CookieSignedInContext context) 52public override async Task SigningOut(CookieSigningOutContext context) 58public override async Task RedirectToLogout(RedirectContext<CookieAuthenticationOptions> context) 63public override async Task RedirectToLogin(RedirectContext<CookieAuthenticationOptions> context) 68public override async Task RedirectToReturnUrl(RedirectContext<CookieAuthenticationOptions> context) 73public override async Task RedirectToAccessDenied(RedirectContext<CookieAuthenticationOptions> context) 104internal static async Task ClearDerivedCookiesAsync(HttpContext httpContext, string dbscScheme)
DeviceBoundSessionHandler.cs (3)
58=> Task.FromResult(AuthenticateResult.NoResult()); 87private async Task HandleRegistrationAsync() 174private async Task HandleRefreshAsync()
Microsoft.AspNetCore.Authentication.JwtBearer (18)
JwtBearerEvents.cs (15)
14public Func<AuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask; 19public Func<ForbiddenContext, Task> OnForbidden { get; set; } = context => Task.CompletedTask; 24public Func<MessageReceivedContext, Task> OnMessageReceived { get; set; } = context => Task.CompletedTask; 29public Func<TokenValidatedContext, Task> OnTokenValidated { get; set; } = context => Task.CompletedTask; 34public Func<JwtBearerChallengeContext, Task> OnChallenge { get; set; } = context => Task.CompletedTask; 39public virtual Task AuthenticationFailed(AuthenticationFailedContext context) => OnAuthenticationFailed(context); 44public virtual Task Forbidden(ForbiddenContext context) => OnForbidden(context); 49public virtual Task MessageReceived(MessageReceivedContext context) => OnMessageReceived(context); 54public virtual Task TokenValidated(TokenValidatedContext context) => OnTokenValidated(context); 59public virtual Task Challenge(JwtBearerChallengeContext context) => OnChallenge(context);
JwtBearerHandler.cs (3)
50protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new JwtBearerEvents()); 275protected override async Task HandleChallengeAsync(AuthenticationProperties properties) 349protected override Task HandleForbiddenAsync(AuthenticationProperties properties)
Microsoft.AspNetCore.Authentication.Negotiate (18)
Events\NegotiateEvents.cs (12)
14public Func<AuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask; 20public Func<LdapContext, Task> OnRetrieveLdapClaims { get; set; } = context => Task.CompletedTask; 25public Func<AuthenticatedContext, Task> OnAuthenticated { get; set; } = context => Task.CompletedTask; 30public Func<ChallengeContext, Task> OnChallenge { get; set; } = context => Task.CompletedTask; 35public virtual Task AuthenticationFailed(AuthenticationFailedContext context) => OnAuthenticationFailed(context); 40public virtual Task RetrieveLdapClaims(LdapContext context) => OnRetrieveLdapClaims(context); 45public virtual Task Authenticated(AuthenticatedContext context) => OnAuthenticated(context); 50public virtual Task Challenge(ChallengeContext context) => OnChallenge(context);
Internal\LdapAdapter.cs (1)
20public static async Task RetrieveClaimsAsync(LdapSettings settings, ClaimsIdentity identity, ILogger logger)
NegotiateHandler.cs (5)
63protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new NegotiateEvents()); 198return Task.CompletedTask; 382protected override async Task HandleChallengeAsync(AuthenticationProperties properties) 432private static Task DisposeState(object state) 435return Task.CompletedTask;
Microsoft.AspNetCore.Authentication.OAuth (9)
Events\OAuthEvents.cs (7)
14public Func<OAuthCreatingTicketContext, Task> OnCreatingTicket { get; set; } = context => Task.CompletedTask; 19public Func<RedirectContext<OAuthOptions>, Task> OnRedirectToAuthorizationEndpoint { get; set; } = context => 22return Task.CompletedTask; 29/// <returns>A <see cref="Task"/> representing the completed operation.</returns> 30public virtual Task CreatingTicket(OAuthCreatingTicketContext context) => OnCreatingTicket(context); 36public virtual Task RedirectToAuthorizationEndpoint(RedirectContext<OAuthOptions> context) => OnRedirectToAuthorizationEndpoint(context);
OAuthHandler.cs (2)
61protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new OAuthEvents()); 263protected override async Task HandleChallengeAsync(AuthenticationProperties properties)
Microsoft.AspNetCore.Authentication.OpenIdConnect (38)
Events\OpenIdConnectEvents.cs (33)
14public Func<AuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask; 19public Func<AuthorizationCodeReceivedContext, Task> OnAuthorizationCodeReceived { get; set; } = context => Task.CompletedTask; 24public Func<MessageReceivedContext, Task> OnMessageReceived { get; set; } = context => Task.CompletedTask; 31public Func<RedirectContext, Task> OnRedirectToIdentityProvider { get; set; } = context => Task.CompletedTask; 36public Func<RedirectContext, Task> OnRedirectToIdentityProviderForSignOut { get; set; } = context => Task.CompletedTask; 41public Func<RemoteSignOutContext, Task> OnSignedOutCallbackRedirect { get; set; } = context => Task.CompletedTask; 46public Func<RemoteSignOutContext, Task> OnRemoteSignOut { get; set; } = context => Task.CompletedTask; 51public Func<TokenResponseReceivedContext, Task> OnTokenResponseReceived { get; set; } = context => Task.CompletedTask; 57public Func<TokenValidatedContext, Task> OnTokenValidated { get; set; } = context => Task.CompletedTask; 62public Func<UserInformationReceivedContext, Task> OnUserInformationReceived { get; set; } = context => Task.CompletedTask; 67public Func<PushedAuthorizationContext, Task> OnPushAuthorization { get; set; } = context => Task.CompletedTask; 72public virtual Task AuthenticationFailed(AuthenticationFailedContext context) => OnAuthenticationFailed(context); 77public virtual Task AuthorizationCodeReceived(AuthorizationCodeReceivedContext context) => OnAuthorizationCodeReceived(context); 82public virtual Task MessageReceived(MessageReceivedContext context) => OnMessageReceived(context); 89public virtual Task RedirectToIdentityProvider(RedirectContext context) => OnRedirectToIdentityProvider(context); 94public virtual Task RedirectToIdentityProviderForSignOut(RedirectContext context) => OnRedirectToIdentityProviderForSignOut(context); 99public virtual Task SignedOutCallbackRedirect(RemoteSignOutContext context) => OnSignedOutCallbackRedirect(context); 104public virtual Task RemoteSignOut(RemoteSignOutContext context) => OnRemoteSignOut(context); 109public virtual Task TokenResponseReceived(TokenResponseReceivedContext context) => OnTokenResponseReceived(context); 115public virtual Task TokenValidated(TokenValidatedContext context) => OnTokenValidated(context); 120public virtual Task UserInformationReceived(UserInformationReceivedContext context) => OnUserInformationReceived(context); 127public virtual Task PushAuthorization(PushedAuthorizationContext context) => OnPushAuthorization(context);
OpenIdConnectHandler.cs (5)
87protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new OpenIdConnectEvents()); 217public virtual async Task SignOutAsync(AuthenticationProperties? properties) 371protected override async Task HandleChallengeAsync(AuthenticationProperties properties) 389private async Task HandleChallengeAsyncInternal(AuthenticationProperties properties) 561private async Task PushAuthorizationRequest(OpenIdConnectMessage authorizeRequest, AuthenticationProperties properties, string parEndpoint)
Microsoft.AspNetCore.Authentication.Twitter (10)
TwitterEvents.cs (7)
14public Func<TwitterCreatingTicketContext, Task> OnCreatingTicket { get; set; } = context => Task.CompletedTask; 19public Func<RedirectContext<TwitterOptions>, Task> OnRedirectToAuthorizationEndpoint { get; set; } = context => 22return Task.CompletedTask; 29/// <returns>A <see cref="Task"/> representing the completed operation.</returns> 30public virtual Task CreatingTicket(TwitterCreatingTicketContext context) => OnCreatingTicket(context); 36public virtual Task RedirectToAuthorizationEndpoint(RedirectContext<TwitterOptions> context) => OnRedirectToAuthorizationEndpoint(context);
TwitterHandler.cs (3)
55protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new TwitterEvents()); 164protected override async Task HandleChallengeAsync(AuthenticationProperties properties) 357private async Task EnsureTwitterRequestSuccess(HttpResponseMessage response)
Microsoft.AspNetCore.Authentication.WsFederation (21)
WsFederationEvents.cs (18)
14public Func<AuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask; 19public Func<MessageReceivedContext, Task> OnMessageReceived { get; set; } = context => Task.CompletedTask; 24public Func<RedirectContext, Task> OnRedirectToIdentityProvider { get; set; } = context => Task.CompletedTask; 29public Func<RemoteSignOutContext, Task> OnRemoteSignOut { get; set; } = context => Task.CompletedTask; 34public Func<SecurityTokenReceivedContext, Task> OnSecurityTokenReceived { get; set; } = context => Task.CompletedTask; 39public Func<SecurityTokenValidatedContext, Task> OnSecurityTokenValidated { get; set; } = context => Task.CompletedTask; 44public virtual Task AuthenticationFailed(AuthenticationFailedContext context) => OnAuthenticationFailed(context); 49public virtual Task MessageReceived(MessageReceivedContext context) => OnMessageReceived(context); 54public virtual Task RedirectToIdentityProvider(RedirectContext context) => OnRedirectToIdentityProvider(context); 59public virtual Task RemoteSignOut(RemoteSignOutContext context) => OnRemoteSignOut(context); 64public virtual Task SecurityTokenReceived(SecurityTokenReceivedContext context) => OnSecurityTokenReceived(context); 69public virtual Task SecurityTokenValidated(SecurityTokenValidatedContext context) => OnSecurityTokenValidated(context);
WsFederationHandler.cs (3)
61protected override Task<object> CreateEventsAsync() => Task.FromResult<object>(new WsFederationEvents()); 85protected override async Task HandleChallengeAsync(AuthenticationProperties properties) 411public virtual async Task SignOutAsync(AuthenticationProperties? properties)
Microsoft.AspNetCore.Authorization (22)
AssertionRequirement.cs (2)
29Handler = context => Task.FromResult(handler(context)); 47public async Task HandleAsync(AuthorizationHandlerContext context)
AuthorizationHandler.cs (4)
20public virtual async Task HandleAsync(AuthorizationHandlerContext context) 33protected abstract Task HandleRequirementAsync(AuthorizationHandlerContext context, TRequirement requirement); 49public virtual async Task HandleAsync(AuthorizationHandlerContext context) 66protected abstract Task HandleRequirementAsync(AuthorizationHandlerContext context, TRequirement requirement, TResource resource);
AuthorizationOptions.cs (3)
16private static readonly Task<AuthorizationPolicy?> _nullPolicyTask = Task.FromResult<AuthorizationPolicy?>(null); 59PolicyMap[name] = Task.FromResult<AuthorizationPolicy?>(policy); 74PolicyMap[name] = Task.FromResult<AuthorizationPolicy?>(policyBuilder.Build());
ClaimsAuthorizationRequirement.cs (2)
51protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ClaimsAuthorizationRequirement requirement) 84return Task.CompletedTask;
DefaultAuthorizationHandlerProvider.cs (1)
27_handlersTask = Task.FromResult(handlers);
DefaultAuthorizationPolicyProvider.cs (2)
40_cachedDefaultPolicy = Task.FromResult(_options.DefaultPolicy); 54_cachedFallbackPolicy = Task.FromResult(_options.FallbackPolicy);
DenyAnonymousAuthorizationRequirement.cs (2)
22protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, DenyAnonymousAuthorizationRequirement requirement) 28return Task.CompletedTask;
IAuthorizationHandler.cs (1)
17Task HandleAsync(AuthorizationHandlerContext context);
NameAuthorizationRequirement.cs (2)
38protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, NameAuthorizationRequirement requirement) 58return Task.CompletedTask;
PassThroughAuthorizationHandler.cs (1)
35public async Task HandleAsync(AuthorizationHandlerContext context)
RolesAuthorizationRequirement.cs (2)
43protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, RolesAuthorizationRequirement requirement) 63return Task.CompletedTask;
Microsoft.AspNetCore.Authorization.Policy (4)
AuthorizationMiddleware.cs (1)
94public async Task Invoke(HttpContext context)
AuthorizationMiddlewareResultHandler.cs (2)
15public Task HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult) 24async Task Handle()
IAuthorizationMiddlewareResultHandler.cs (1)
23Task HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult);
Microsoft.AspNetCore.Components (267)
CascadingValue.cs (2)
51public Task SetParametersAsync(ParameterView parameters) 126return Task.CompletedTask;
CascadingValueSource.cs (7)
84/// <returns>A <see cref="Task"/> that completes when the notifications have been issued.</returns> 85public Task NotifyChangedAsync() 94var tasks = new List<Task>(); 116return Task.WhenAll(tasks); 120return Task.CompletedTask; 128/// <returns>A <see cref="Task"/> that completes when the notifications have been issued.</returns> 129public Task NotifyChangedAsync(TValue newValue)
CompilerServices\RuntimeHelpers.cs (9)
51public static EventCallback<T> CreateInferredEventCallback<T>(object receiver, Func<T, Task> callback, T value) 81public static Func<T, Task> CreateInferredBindSetter<T>(Func<T, Task> callback, T value) 94public static Func<T, Task> CreateInferredBindSetter<T>(Action<T?> callback, T value) 99return Task.CompletedTask; 133public static Task InvokeAsynchronousDelegate(Action callback) 136return Task.CompletedTask; 153public static Task InvokeAsynchronousDelegate(Func<Task> callback)
ComponentBase.cs (28)
99/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns> 100protected virtual Task OnInitializedAsync() 101=> Task.CompletedTask; 115/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns> 116protected virtual Task OnParametersSetAsync() 117=> Task.CompletedTask; 183/// Note that the component does not automatically re-render after the completion of any returned <see cref="Task"/>, 190/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns> 197protected virtual Task OnAfterRenderAsync(bool firstRender) 198=> Task.CompletedTask; 205protected Task InvokeAsync(Action workItem) 213protected Task InvokeAsync(Func<Task> workItem) 225/// <returns>A <see cref="Task"/> that will be completed when the exception has finished dispatching.</returns> 226protected Task DispatchExceptionAsync(Exception exception) 246/// <returns>A <see cref="Task"/> that completes when the component has finished updating and rendering itself.</returns> 259public virtual Task SetParametersAsync(ParameterView parameters) 274private async Task RunInitAndSetParametersAsync() 277var task = OnInitializedAsync(); 313private Task CallOnParametersSetAsync() 316var task = OnParametersSetAsync(); 332Task.CompletedTask; 335private async Task CallStateHasChangedOnAsyncCompletion(Task task) 355Task IHandleEvent.HandleEventAsync(EventCallbackWorkItem callback, object? arg) 357var task = callback.InvokeAsync(arg); 368Task.CompletedTask; 371Task IHandleAfterRender.OnAfterRenderAsync()
ComponentsActivitySource.cs (2)
105public async Task CaptureHandleEventStopAsync(Task task, ComponentsActivityHandle activityHandle)
ComponentsMetrics.cs (6)
84public async Task CaptureEventDuration(Task task, long startTimestamp, string? componentType, string? methodName, string? attributeName) 115public async Task CaptureParametersDuration(Task task, long startTimestamp, string? componentType) 142public async Task CaptureBatchDuration(Task task, long startTimestamp, int diffLength)
Dispatcher.cs (5)
50/// <returns>A <see cref="Task"/> that will be completed when the action has finished executing.</returns> 51public abstract Task InvokeAsync(Action workItem); 57/// <returns>A <see cref="Task"/> that will be completed when the action has finished executing.</returns> 58public abstract Task InvokeAsync(Func<Task> workItem);
DynamicComponent.cs (2)
63public Task SetParametersAsync(ParameterView parameters) 90return Task.CompletedTask;
ErrorBoundaryBase.cs (4)
55protected abstract Task OnErrorAsync(Exception exception); 83var onErrorTask = OnErrorAsync(exception); 93private async Task HandleOnErrorExceptions(Task onExceptionTask)
EventCallback.cs (4)
52/// <returns>A <see cref="Task"/> which completes asynchronously once event processing has completed.</returns> 53public Task InvokeAsync(object? arg) 67/// <returns>A <see cref="Task"/> which completes asynchronously once event processing has completed.</returns> 68public Task InvokeAsync() => InvokeAsync(null!);
EventCallbackFactory.cs (5)
63public EventCallback Create(object receiver, Func<Task> callback) 77public EventCallback Create(object receiver, Func<object, Task> callback) 147public EventCallback<TValue> Create<TValue>(object receiver, Func<Task> callback) 161public EventCallback<TValue> Create<TValue>(object receiver, Func<TValue, Task> callback) 191public EventCallback<TValue> CreateInferred<TValue>(object receiver, Func<TValue, Task> callback, TValue value)
EventCallbackFactoryBinderExtensions.cs (36)
69Func<string?, Task> setter, 109Func<bool, Task> setter, 149Func<bool?, Task> setter, 189Func<int, Task> setter, 229Func<int?, Task> setter, 269Func<long, Task> setter, 309Func<short, Task> setter, 349Func<long?, Task> setter, 389Func<short?, Task> setter, 429Func<float, Task> setter, 469Func<float?, Task> setter, 509Func<double, Task> setter, 549Func<double?, Task> setter, 589Func<decimal, Task> setter, 629Func<decimal?, Task> setter, 669Func<DateTime, Task> setter, 712Func<DateTime, Task> setter, 753Func<DateTime?, Task> setter, 796Func<DateTime?, Task> setter, 837Func<DateTimeOffset, Task> setter, 880Func<DateTimeOffset, Task> setter, 921Func<DateTimeOffset?, Task> setter, 964Func<DateTimeOffset?, Task> setter, 1005Func<DateOnly, Task> setter, 1048Func<DateOnly, Task> setter, 1089Func<DateOnly?, Task> setter, 1132Func<DateOnly?, Task> setter, 1173Func<TimeOnly, Task> setter, 1216Func<TimeOnly, Task> setter, 1257Func<TimeOnly?, Task> setter, 1300Func<TimeOnly?, Task> setter, 1343Func<T, Task> setter, 1397Func<T, Task> setter, 1402Func<ChangeEventArgs, Task> callback = async e => 1486Func<T, Task> setter, 1492Func<ChangeEventArgs, Task> callback = async e =>
EventCallbackFactoryEventArgsExtensions.cs (2)
34public static EventCallback<EventArgs> Create(this EventCallbackFactory factory, object receiver, Func<EventArgs, Task> callback) 64public static EventCallback<ChangeEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ChangeEventArgs, Task> callback)
EventCallbackOfT.cs (4)
47/// <returns>A <see cref="Task"/> which completes asynchronously once event processing has completed.</returns> 48public Task InvokeAsync(TValue? arg) 62/// <returns>A <see cref="Task"/> which completes asynchronously once event processing has completed.</returns> 63public Task InvokeAsync() => InvokeAsync(default!);
EventCallbackWorkItem.cs (11)
33/// <returns>A <see cref="Task"/> then will complete asynchronously once the delegate has completed.</returns> 34public Task InvokeAsync(object? arg) 39internal static Task InvokeAsync<T>(MulticastDelegate? @delegate, T arg) 44return Task.CompletedTask; 48return Task.CompletedTask; 52return Task.CompletedTask; 54case Func<Task> func: 57case Func<T, Task> funcEventArgs: 64return @delegate.DynamicInvoke(arg) as Task ?? Task.CompletedTask; 71return Task.FromException(e.InnerException!);
IComponent.cs (2)
21/// <returns>A <see cref="Task"/> that completes when the component has finished updating and rendering itself.</returns> 27Task SetParametersAsync(ParameterView parameters);
IHandleAfterRender.cs (2)
14/// <returns>A <see cref="Task"/> that represents the asynchronous event handling operation.</returns> 15Task OnAfterRenderAsync();
IHandleEvent.cs (2)
17/// A <see cref="Task"/> that completes once the component has processed the state change. 19Task HandleEventAsync(EventCallbackWorkItem item, object? arg);
IPersistentComponentStateStore.cs (2)
21/// <returns>A <see cref="Task" /> that completes when the state is persisted to disk.</returns> 22Task PersistStateAsync(IReadOnlyDictionary<string, byte[]> state);
LayoutComponentBase.cs (1)
29public override Task SetParametersAsync(ParameterView parameters) => base.SetParametersAsync(parameters);
LayoutView.cs (2)
42public Task SetParametersAsync(ParameterView parameters) 46return Task.CompletedTask;
NavigationManager.cs (3)
469var locationChangingTasks = new HashSet<Task>(); 491var completedHandlerTask = await Task.WhenAny(locationChangingTasks).WaitAsync(cancellationToken);
PersistentComponentState.cs (2)
52public PersistingComponentStateSubscription RegisterOnPersisting(Func<Task> callback) 62public PersistingComponentStateSubscription RegisterOnPersisting(Func<Task> callback, IComponentRenderMode? renderMode)
PersistentState\ComponentStatePersistenceManager.cs (15)
58/// <returns>A <see cref="Task"/> that will complete when the state has been restored.</returns> 59public async Task RestoreStateAsync(IPersistentComponentStateStore store) 69/// <returns>A <see cref="Task"/> that will complete when the state has been restored.</returns> 70public async Task RestoreStateAsync(IPersistentComponentStateStore store, RestoreContext context) 99/// <returns>A <see cref="Task"/> that will complete when the state has been restored.</returns> 100public Task PersistStateAsync(IPersistentComponentStateStore store, Renderer renderer) 109async Task PauseAndPersistState() 245return Task.FromResult(false); 256return Task.FromResult(true); 259static Task<bool> TryExecuteCallback(Func<Task> callback, ILogger<ComponentStatePersistenceManager> logger) 263var current = callback(); 266return Task.FromResult(true); 276return Task.FromResult(false); 279static async Task<bool> Awaited(Task task, ILogger<ComponentStatePersistenceManager> logger) 296foreach (var result in await Task.WhenAll(pendingCallbackTasks))
PersistentState\PersistComponentStateRegistration.cs (2)
7Func<Task> callback, 10public Func<Task> Callback { get; } = callback;
PersistentState\PersistentServicesRegistry.cs (2)
78return Task.CompletedTask; 108return Task.CompletedTask;
PersistentState\PersistentValueProviderComponentSubscription.cs (4)
180private Task PersistProperty() 189return Task.CompletedTask; 199return Task.CompletedTask; 205return Task.CompletedTask;
RenderHandle.cs (2)
112/// <returns>A <see cref="Task"/> that will be completed when the exception has finished dispatching.</returns> 113public Task DispatchExceptionAsync(Exception exception)
Rendering\ComponentState.cs (6)
146internal Task NotifyRenderCompletedAsync() 156return Task.FromCanceled(cex.CancellationToken); 160return Task.FromException(ex); 164return Task.CompletedTask; 248Task setParametersAsyncTask; 266setParametersAsyncTask = Task.FromException(ex);
Rendering\RendererSynchronizationContext.cs (11)
13private Task _taskQueue; 17public RendererSynchronizationContext() : this(new object(), Task.CompletedTask) { } 19private RendererSynchronizationContext(object @lock, Task taskQueue) 41public Task InvokeAsync(Action action) 44var t = completion.Task; // lazy initialize before passing around the struct 118public Task InvokeAsync(Func<Task> asyncAction) 121var t = completion.Task; // lazy initialize before passing around the struct 171Task antecedent; 191private async Task PostAsync<TState>(Task antecedent, Action<TState> callback, TState state)
Rendering\RendererSynchronizationContextDispatcher.cs (5)
21public override Task InvokeAsync(Action workItem) 27return Task.CompletedTask; 33public override Task InvokeAsync(Func<Task> workItem) 49return Task.FromResult(workItem());
RenderTree\Renderer.cs (58)
31internal static readonly Task CanceledRenderTask = Task.FromCanceled(new CancellationToken(canceled: true)); 50private Task? _ongoingQuiescenceTask; 55private List<Task>? _pendingTasks; 56private Task? _disposeTask; 300protected Task RenderRootComponentAsync(int componentId) 311/// The returned <see cref="Task"/> waits for this component and all descendant components to 320protected internal async Task RenderRootComponentAsync(int componentId, ParameterView initialParameters) 384private async Task WaitForQuiescence() 405async Task ProcessAsynchronousWork() 412var pendingWork = Task.WhenAll(_pendingTasks); 456/// <returns>A <see cref="Task"/> to represent the UI update process.</returns> 457protected abstract Task UpdateDisplayAsync(in RenderBatch renderBatch); 466/// A <see cref="Task"/> which will complete once all asynchronous processing related to the event 469public virtual Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo? fieldInfo, EventArgs eventArgs) 482/// A <see cref="Task"/> which will complete once all asynchronous processing related to the event 485public virtual Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo? fieldInfo, EventArgs eventArgs, bool waitForQuiescence) 520return Task.CompletedTask; 541Task? task = null; 579return Task.CompletedTask; 592var errorHandledTask = GetErrorHandledTask(task, receiverComponentState); 672internal void AddToPendingTasksWithErrorHandling(Task task, ComponentState? owningComponentState) 694var handledErrorTask = GetErrorHandledTask(task, owningComponentState); 705/// <param name="task">The <see cref="Task"/>.</param> 706protected virtual void AddPendingTask(ComponentState? componentState, Task task) 846var updateDisplayTask = Task.CompletedTask; 913private Task InvokeRenderCompletedCalls(ArrayRange<RenderTreeDiff> updatedComponents, Task updateDisplayTask) 923return Task.CompletedTask; 930return Task.CompletedTask; 945List<Task> batch = null; 957Task.WhenAll(batch) : 958Task.CompletedTask; 961private async Task InvokeRenderCompletedCallsAfterUpdateDisplayTask( 962Task updateDisplayTask, 980List<Task> batch = null; 991var result = batch != null ? 992Task.WhenAll(batch) : 993Task.CompletedTask; 998private void NotifyRenderCompleted(ComponentState state, ref List<Task> batch) 1007var task = state.NotifyRenderCompletedAsync(); 1027batch = batch ?? new List<Task>(); 1068var result = disposalTask.AsTask(); 1071async Task GetHandledAsynchronousDisposalErrorsTask(Task result) 1105private void RemoveEventHandlerIds(ArrayRange<ulong> eventHandlerIds, Task afterTaskIgnoreErrors) 1130async Task ContinueAfterTask(ArrayRange<ulong> eventHandlerIds, Task afterTaskIgnoreErrors) 1149RemoveEventHandlerIds(eventHandlerIdsClone, Task.CompletedTask); 1153private async Task GetErrorHandledTask(Task taskToHandle, ComponentState? owningComponentState) 1261var done = Dispatcher.InvokeAsync(() => Dispose(disposing)); 1285List<Task> asyncDisposables = null; 1323async Task HandleAsyncExceptions(List<Task> tasks) 1326foreach (var task in tasks)
RouteView.cs (2)
54public Task SetParametersAsync(ParameterView parameters) 64return Task.CompletedTask;
Routing\IHostEnvironmentNavigationManager.cs (1)
25void Initialize(string baseUri, string uri, Func<string, Task> onNavigateTo) =>
Routing\INavigationInterception.cs (2)
14/// <returns>A <see cref="Task" /> that represents the asynchronous operation.</returns> 15Task EnableNavigationInterceptionAsync();
Routing\IScrollToLocationHash.cs (2)
15/// <returns>A <see cref="Task" /> that represents the asynchronous operation.</returns> 16Task RefreshScrollPositionForHash(string locationAbsolute);
Routing\Router.cs (6)
39private Task _previousOnNavigateTask = Task.CompletedTask; 121public async Task SetParametersAsync(ParameterView parameters) 370var task = await Task.WhenAny(OnNavigateAsync.InvokeAsync(navigateContext), cancellationTcs.Task); 467async Task IHandleAfterRender.OnAfterRenderAsync()
Sections\SectionContent.cs (2)
46Task IComponent.SetParametersAsync(ParameterView parameters) 85return Task.CompletedTask;
Sections\SectionOutlet.cs (4)
42Task IComponent.SetParametersAsync(ParameterView parameters) 78return Task.CompletedTask; 140public Task SetParametersAsync(ParameterView parameters) 144return Task.CompletedTask;
Microsoft.AspNetCore.Components.AI (20)
Blocks\UIActionBlock.cs (3)
29private Task? _invocation; 65public Task InvokeAsync(CancellationToken cancellationToken = default) 77private async Task InvokeCoreAsync(CancellationToken cancellationToken)
Components\BlockRenderer.cs (2)
49Task IComponent.SetParametersAsync(ParameterView parameters) 79return Task.CompletedTask;
Components\MessageInput.cs (4)
53Task IComponent.SetParametersAsync(ParameterView parameters) 73return Task.CompletedTask; 139private async Task OnKeyDown(KeyboardEventArgs e) 147private async Task SubmitAsync()
Components\MessageList.cs (2)
55Task IComponent.SetParametersAsync(ParameterView parameters) 83return Task.CompletedTask;
Engine\AgentContext.cs (8)
63public Task SendMessageAsync(string text, CancellationToken cancellationToken = default) 74public async Task SendMessageAsync(ChatMessage message, CancellationToken cancellationToken = default) 100public async Task RetryAsync(CancellationToken cancellationToken = default) 121public Task CancelAsync() 125return Task.CompletedTask; 129return Task.CompletedTask; 187private async Task StreamIntoTurnAsync( 233var results = await Task.WhenAll(
Pipeline\BlockMappingPipeline.cs (1)
154await Task.CompletedTask;
Microsoft.AspNetCore.Components.Analyzers (7)
ComponentParametersShouldBePublicCodeFixProvider.cs (2)
31public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 57return Task.FromResult(document.WithSyntaxRoot(newSyntaxRoot));
JSInteropCodeFixProvider.cs (1)
31public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
JSInvokableCodeFixProvider.cs (2)
31public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 44return Task.CompletedTask;
StateHasChangedCodeFixProvider.cs (2)
29public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 79return Task.FromResult(newRoot is null ? document : document.WithSyntaxRoot(newRoot));
Microsoft.AspNetCore.Components.Authorization (3)
AuthenticationStateProvider.cs (2)
26/// <param name="task">A <see cref="Task"/> that supplies the updated <see cref="AuthenticationState"/>.</param> 38/// <param name="task">A <see cref="Task"/> that supplies the updated <see cref="AuthenticationState"/>.</param>
AuthorizeViewCore.cs (1)
73protected override async Task OnParametersSetAsync()
Microsoft.AspNetCore.Components.Endpoints (92)
Assets\ImportMap.cs (3)
42Task IComponent.SetParametersAsync(ParameterView parameters) 47return Task.CompletedTask; 57return Task.CompletedTask;
Assets\ResourcePreloader.cs (2)
25Task IComponent.SetParametersAsync(ParameterView parameters) 29return Task.CompletedTask;
BrowserConfiguration\ConfigureBrowser.cs (2)
32Task IComponent.SetParametersAsync(ParameterView parameters) 42return Task.CompletedTask;
Builder\OpaqueRedirection.cs (4)
66private static Task OpaqueRedirect(HttpContext httpContext) 71return Task.CompletedTask; 89return Task.CompletedTask; 93return Task.CompletedTask;
Builder\ResourceCollectionUrlEndpoint.cs (4)
221public async Task FingerprintedGzipContent(HttpContext context) 229public async Task FingerprintedContent(HttpContext context) 236public async Task Content(HttpContext context) 243public async Task GzipContent(HttpContext context)
CacheView\CacheView.cs (1)
118async Task IComponent.SetParametersAsync(ParameterView parameters)
CacheView\CacheViewService.cs (5)
250private async Task ApplyDuplicateResolutionAsync(CacheViewRenderState state, string key, Task<SerializedRenderFragment?> resolution) 274private async Task ResolveOrBeginCreateAsync(CacheView cacheView, CacheViewRenderState state, TaskCompletionSource<SerializedRenderFragment?> resolution, CancellationToken cancellationToken) 300var firstFinished = await Task.WhenAny(inflight, factoryStarted.Task); 344private async Task ObserveCacheStorePersistAsync(string key, Task<SerializedRenderFragment> pending)
CacheView\HybridCacheViewStore.cs (1)
41private async Task ClearCoreAsync()
DependencyInjection\HttpNavigationManager.cs (3)
19private Func<string, Task>? _onNavigateTo; 23void IHostEnvironmentNavigationManager.Initialize(string baseUri, string uri, Func<string, Task> onNavigateTo) 41async Task PerformNavigationAsync()
DependencyInjection\UnsupportedNavigationInterception.cs (1)
10public Task EnableNavigationInterceptionAsync()
DependencyInjection\UnsupportedScrollToLocationHash.cs (1)
10public Task RefreshScrollPositionForHash(string locationAbsolute)
IRazorComponentEndpointInvoker.cs (2)
25/// <returns>A <see cref="Task"/> that completes when the endpoint has been invoked and the component 27Task Render(HttpContext context);
RazorComponentEndpointHost.cs (2)
34public Task SetParametersAsync(ParameterView parameters) 38return Task.CompletedTask;
RazorComponentEndpointInvoker.cs (4)
36public Task Render(HttpContext context) 43private async Task RenderComponentCore(HttpContext context) 103Task quiesceTask; 124quiesceTask = Task.CompletedTask;
Rendering\Buffering\BufferedTextWriter.cs (5)
15private Task _currentFlushAsyncTask = Task.CompletedTask; 45public override Task FlushAsync() 51private async Task FlushAsyncCore(Task priorTask)
Rendering\Buffering\TextChunk.cs (1)
54public Task WriteToAsync(TextWriter writer, string charArraySegments, ref StringBuilder? tempBuffer)
Rendering\Buffering\TextChunkListBuilder.cs (1)
35public async Task WriteToAsync(TextWriter writer, string charArraySegments)
Rendering\EndpointHtmlRenderer.cs (9)
43private Task? _servicesInitializedTask; 53private readonly List<Task> _nonStreamingPendingTasks = new(); 83internal async Task InitializeStandardComponentServicesAsync( 101hostEnvironmentAuthenticationStateProvider.SetAuthenticationState(Task.FromResult(authenticationState)); 182protected override void AddPendingTask(ComponentState? componentState, Task task) 214internal Task? NonStreamingPendingTasksCompletion; 216protected override Task UpdateDisplayAsync(in RenderBatch renderBatch) 238static async Task FlushThenComplete(TextWriter writerToFlush, Task completion)
Rendering\EndpointHtmlRenderer.EventDispatch.cs (6)
25internal Task DispatchSubmitEventAsync(string? handlerName, out bool isBadRequest) 58: Task.CompletedTask; 73private Task ReturnErrorResponse(string detailedMessage) 79: Task.CompletedTask; 92internal async Task SetNotFoundWhenResponseHasStarted() 127private async Task OnNavigateTo(string uri)
Rendering\EndpointHtmlRenderer.Prerendering.cs (9)
162private async Task WaitForResultReady(bool waitForQuiescence, PrerenderedComponentHtmlContent result) 175private async Task GetErrorHandledTask(Task taskToHandle) 195public Task WaitForNonStreamingPendingTasks() 199async Task Execute() 204var pendingWork = Task.WhenAll(_nonStreamingPendingTasks); 360public Task QuiescenceTask => 361_htmlToEmitOrNull.HasValue ? _htmlToEmitOrNull.Value.QuiescenceTask : Task.CompletedTask;
Rendering\EndpointHtmlRenderer.PrerenderingState.cs (9)
92var saveServerTask = server.Saved.Count > 0 94: Task.CompletedTask; 96var saveWebAssemblyTask = webAssembly.Saved.Count > 0 98: Task.CompletedTask; 100await Task.WhenAll( 258public Task PersistStateAsync(IReadOnlyDictionary<string, byte[]> state) => Task.CompletedTask; 269public Task PersistStateAsync(IReadOnlyDictionary<string, byte[]> state) 272return Task.CompletedTask;
Rendering\EndpointHtmlRenderer.Streaming.cs (2)
47public async Task SendStreamingUpdatesAsync(HttpContext httpContext, Task untilTaskCompleted, TextWriter writer)
Rendering\SSRRenderModeBoundary.cs (2)
111public Task SetParametersAsync(ParameterView parameters) 148return Task.CompletedTask;
Results\RazorComponentResult.cs (1)
99public Task ExecuteAsync(HttpContext httpContext)
Results\RazorComponentResultExecutor.cs (2)
22public static Task ExecuteAsync(HttpContext httpContext, RazorComponentResult result) 41private static Task RenderComponentToResponse(
Routing\BasePath.cs (2)
23Task IComponent.SetParametersAsync(ParameterView parameters) 26return Task.CompletedTask;
SessionCascadingValueSupplier.cs (4)
87internal Task PersistAllValues() 91return Task.CompletedTask; 98return Task.CompletedTask; 125return Task.CompletedTask;
SessionEstablishmentHelper.cs (1)
53return Task.CompletedTask;
src\aspnetcore\src\Shared\Components\PrerenderComponentApplicationStore.cs (3)
48return Task.FromResult((IDictionary<string, byte[]>)ExistingState); 59public Task PersistStateAsync(IReadOnlyDictionary<string, byte[]> state) 73return Task.CompletedTask;
Microsoft.AspNetCore.Components.Forms (26)
EditContext.cs (14)
49/// <see cref="ValidationRequestedEventArgs.AddAsyncValidator(Func{CancellationToken, Task})"/>, for example 232/// <see cref="ValidationRequestedEventArgs.AddAsyncValidator(Func{CancellationToken, Task})"/> causes an 251/// register via <see cref="ValidationRequestedEventArgs.AddAsyncValidator(Func{CancellationToken, Task})"/>. 281List<Task>? tasksToAwait = null; 286var task = InvokeAsyncValidator(validators[i], cancellationToken); 309foreach (var task in tasksToAwait) 337static Task InvokeAsyncValidator(Func<CancellationToken, Task> validate, CancellationToken cancellationToken) 345/// and the returned <see cref="Task"/> is tracked for <see cref="IsValidationPending(in FieldIdentifier)"/> 361/// cancellation token and returns the in-flight <see cref="Task"/>.</param> 364public void RegisterAsyncFieldValidator(in FieldIdentifier fieldIdentifier, Func<CancellationToken, Task> validator) 373Task task; 521private async Task ObserveFieldValidationTask(FieldState state, Task task, CancellationTokenSource cts)
EditContextDataAnnotationsExtensions.cs (5)
109private async Task ValidateFormAndNotifyAsync(CancellationToken cancellationToken) 138private async Task ValidateFormWithValidatorAsync(CancellationToken cancellationToken) 192private async Task ValidateFormWithValidatableInfoAsync(IValidatableTypeInfo validatableInfo, CancellationToken cancellationToken) 246private async Task ValidateFieldWithValidatorAsync(FieldIdentifier fieldIdentifier, PropertyInfo propertyInfo, CancellationToken cancellationToken) 279private async Task ValidateFieldWithValidatableInfoAsync(
FieldState.cs (1)
23internal Task? PendingValidationTask { get; set; }
ValidationRequestedEventArgs.cs (6)
11private List<Func<CancellationToken, Task>>? _asyncValidators; 27/// Async validation can be registered via <see cref="AddAsyncValidator(Func{CancellationToken, Task})"/> only 36/// resulting <see cref="Task"/>. It is invoked by <see cref="EditContext.ValidateAsync(CancellationToken)"/> 43public void AddAsyncValidator(Func<CancellationToken, Task> validator) 57internal IReadOnlyList<Func<CancellationToken, Task>> AsyncValidators 58=> _asyncValidators ?? (IReadOnlyList<Func<CancellationToken, Task>>)[];
Microsoft.AspNetCore.Components.Media (7)
FileDownload.cs (2)
99private async Task OnClickAsync() 169public Task InvokeAsync() => _onClick.InvokeAsync();
MediaComponentBase.cs (5)
106Task IComponent.SetParametersAsync(ParameterView parameters) 121return Task.CompletedTask; 129return Task.CompletedTask; 132async Task IHandleAfterRender.OnAfterRenderAsync() 184private async Task LoadMediaAsync(MediaSource? source, CancellationToken cancellationToken)
Microsoft.AspNetCore.Components.QuickGrid (31)
Infrastructure\ColumnsCollectedNotifier.cs (2)
49public Task SetParametersAsync(ParameterView parameters) 59return Task.CompletedTask;
Infrastructure\EventCallbackSubscribable.cs (1)
19public async Task InvokeCallbacksAsync(T eventArg)
Pagination\PaginationState.cs (4)
52/// <returns>A <see cref="Task"/> representing the completion of the operation.</returns> 53public Task SetCurrentPageIndexAsync(int pageIndex) 60internal Task SetTotalItemCountAsync(int totalItemCount) 64return Task.CompletedTask;
Pagination\Paginator.razor.cs (8)
48private Task GoFirstAsync() => GoToPageAsync(0); 49private Task GoPreviousAsync() => GoToPageAsync(State.CurrentPageIndex - 1); 50private Task GoNextAsync() => GoToPageAsync(State.CurrentPageIndex + 1); 51private Task GoLastAsync() => GoToPageAsync(State.LastPageIndex.GetValueOrDefault(0)); 55private Task GoToPageAsync(int pageIndex) 58return Task.CompletedTask; 68protected override Task OnParametersSetAsync() 79return Task.CompletedTask;
QuickGrid.razor.cs (16)
265protected override Task OnParametersSetAsync() 297return (_columns.Count > 0 && mustRefreshData) ? RefreshDataCoreAsync() : Task.CompletedTask; 315protected override async Task OnAfterRenderAsync(bool firstRender) 378/// <returns>A <see cref="Task"/> representing the completion of the operation.</returns> 379public Task SortByColumnAsync(ColumnBase<TGridItem> column, SortDirection direction = SortDirection.Auto) 462public Task ShowColumnOptionsAsync(ColumnBase<TGridItem> column) 467return Task.CompletedTask; 473public Task HideColumnOptionsAsync() 477return Task.CompletedTask; 484/// <returns>A <see cref="Task"/> that represents the completion of the operation.</returns> 485public async Task RefreshDataAsync() 498/// <see cref="ComponentBase.InvokeAsync(Func{Task})"/>. 502/// <returns>A <see cref="Task"/> that completes when the target is aligned or superseded by another call.</returns> 503public Task ScrollToItemAsync(int itemIndex, CancellationToken cancellationToken = default) 516private async Task RefreshDataCoreAsync() 563await Task.Delay(100, request.CancellationToken);
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
ComponentParametersShouldBePublicCodeFixProvider.cs (2)
31public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 57return Task.FromResult(document.WithSyntaxRoot(newSyntaxRoot));
Microsoft.AspNetCore.Components.Server (145)
Builder\ServerComponentsEndpointOptions.cs (1)
56public Func<HttpContext, WebSocketAcceptContext, Task>? ConfigureWebSocketAcceptContext { get; set; }
CircuitDisconnectMiddleware.cs (2)
32public async Task Invoke(HttpContext context) 81private async Task TerminateCircuitGracefully(CircuitId circuitId)
CircuitJavaScriptInitializationMiddleware.cs (1)
21public async Task InvokeAsync(HttpContext context)
Circuits\CircuitClientProxy.cs (1)
38public Task SendCoreAsync(string method, object[] args, CancellationToken cancellationToken = default)
Circuits\CircuitHandler.cs (15)
45/// <returns><see cref="Task"/> that represents the asynchronous execution operation.</returns> 46public virtual Task OnCircuitOpenedAsync(Circuit circuit, CancellationToken cancellationToken) => Task.CompletedTask; 57/// <returns><see cref="Task"/> that represents the asynchronous execution operation.</returns> 58public virtual Task OnConnectionUpAsync(Circuit circuit, CancellationToken cancellationToken) => Task.CompletedTask; 65/// <returns><see cref="Task"/> that represents the asynchronous execution operation.</returns> 66public virtual Task OnConnectionDownAsync(Circuit circuit, CancellationToken cancellationToken) => Task.CompletedTask; 73/// <returns><see cref="Task"/> that represents the asynchronous execution operation.</returns> 74public virtual Task OnCircuitClosedAsync(Circuit circuit, CancellationToken cancellationToken) => Task.CompletedTask; 80/// <returns>A handler function that returns a <see cref="Task"/> that completes when the activity has finished.</returns> 81public virtual Func<CircuitInboundActivityContext, Task> CreateInboundActivityHandler(Func<CircuitInboundActivityContext, Task> next) => next;
Circuits\CircuitHost.cs (34)
30private Func<Func<Task>, Task> _dispatchInboundActivity; 117public Task InitializeAsync(ProtectedPrerenderComponentApplicationStore store, ActivityContext httpActivityContext, CancellationToken cancellationToken) 150var pendingRenders = new Task[count]; 158await Task.WhenAll(pendingRenders); 253private async Task OnCircuitOpenedAsync(CancellationToken cancellationToken) 283public async Task OnConnectionUpAsync(CancellationToken cancellationToken) 315public async Task OnConnectionDownAsync(CancellationToken cancellationToken) 351private async Task OnCircuitDownAsync(CancellationToken cancellationToken) 382public async Task OnRenderCompletedAsync(long renderId, string errorMessageOrNull) 403public async Task BeginInvokeDotNetFromJS(string callId, string assemblyName, string methodIdentifier, long dotNetObjectId, [StringSyntax(StringSyntaxAttribute.Json)] string argsJson) 429public async Task EndInvokeJSFromDotNet(long asyncCall, bool succeeded, string arguments) 463internal async Task ReceiveByteArray(int id, byte[] data) 563public async Task OnLocationChangedAsync(string uri, string state, bool intercepted) 605public async Task OnLocationChangingAsync(int callId, string uri, string? state, bool intercepted) 639authenticationStateProvider.SetAuthenticationState(Task.FromResult(authenticationState)); 655internal Task HandleInboundActivityAsync(Func<Task> handler) 666private static Func<Func<Task>, Task> BuildInboundActivityDispatcher(IReadOnlyList<CircuitHandler> circuitHandlers, Circuit circuit) 718private async Task ReportUnhandledException(Exception exception) 741private async Task TryNotifyClientErrorAsync(IClientProxy client, string error, Exception exception = null) 764internal Task UpdateRootComponents( 778var postRemovalTask = Task.CompletedTask; 870private static async Task EnqueueRestore( 883Task postStateTask) 889? new Task[operations.Length] 902var task = webRootComponentManager.AddRootComponentAsync( 924return Task.CompletedTask; 929await Task.WhenAll(pendingTasks); 957return Task.FromResult(false); 963return Task.FromResult(false); 969return Task.FromResult(false);
Circuits\CircuitInboundActivityContext.cs (2)
11internal Func<Task> Handler { get; } 18internal CircuitInboundActivityContext(Func<Task> handler, Circuit circuit)
Circuits\CircuitPersistenceManager.cs (6)
23public async Task PauseCircuitAsync(CircuitHost circuit, bool saveStateToClient = false, CancellationToken cancellation = default) 50internal async Task SaveStateToClient(CircuitHost circuit, PersistedCircuitState state, CancellationToken cancellation = default) 209public Task PersistRootComponents() 233return Task.CompletedTask; 243Task IPersistentComponentStateStore.PersistStateAsync(IReadOnlyDictionary<string, byte[]> state) 246return Task.CompletedTask;
Circuits\CircuitRegistry.cs (12)
90public virtual Task DisconnectAsync(CircuitHost circuitHost, string connectionId) 94Task circuitHandlerTask; 107return Task.CompletedTask; 179Task circuitHandlerTask; 284private Task PauseAndDisposeCircuitEntry(DisconnectedCircuitEntry entry) 307return Task.CompletedTask; 310private async Task PauseAndDisposeCircuitHost(CircuitHost circuitHost, bool saveStateToClient) 318internal async Task PauseCircuitAsync( 326Task pauseTask; 339internal virtual Task PauseCore(CircuitHost circuitHost, string connectionId) 347return Task.CompletedTask; 358return Task.CompletedTask;
Circuits\DefaultInMemoryCircuitPersistenceProvider.cs (4)
19private static readonly Task<PersistedCircuitState> _noMatch = Task.FromResult<PersistedCircuitState>(null); 44public Task PersistCircuitAsync(CircuitId circuitId, PersistedCircuitState persistedCircuitState, CancellationToken cancellation = default) 53return Task.CompletedTask; 112return Task.FromResult(state);
Circuits\HybridCacheCircuitPersistenceProvider.cs (1)
44public async Task PersistCircuitAsync(CircuitId circuitId, PersistedCircuitState persistedCircuitState, CancellationToken cancellation = default)
Circuits\ICircuitPersistenceProvider.cs (1)
9Task PersistCircuitAsync(CircuitId circuitId, PersistedCircuitState persistedCircuitState, CancellationToken cancellation = default);
Circuits\RemoteJSDataStream.cs (5)
168public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask; 194private async Task ThrowOnTimeout() 196await Task.Delay(_jsInteropDefaultCallTimeout); 217private async Task CompletePipeAndDisposeStream(Exception? ex = null)
Circuits\RemoteJSRuntime.cs (1)
181protected override async Task TransmitStreamAsync(long streamId, DotNetStreamReference dotNetStreamReference)
Circuits\RemoteNavigationInterception.cs (1)
26public async Task EnableNavigationInterceptionAsync()
Circuits\RemoteNavigationManager.cs (5)
25private Func<string, Task>? _onNavigateTo; 60public void Initialize(string baseUri, string uri, Func<string, Task> onNavigateTo) 124async Task PerformNavigationAsync() 174async Task RefreshAsync() 205private async Task SetHasLocationChangingListenersAsync(bool value)
Circuits\RemoteRenderer.cs (14)
21private static readonly Task CanceledTask = Task.FromCanceled(new CancellationToken(canceled: true)); 70public Task AddComponentAsync(Type componentType, ParameterView parameters, string domElementSelector) 80var attachComponentTask = _client.SendAsync("JS.AttachComponent", componentId, domElementSelector); 146protected override Task UpdateDisplayAsync(in Microsoft.AspNetCore.Components.RenderTree.RenderBatch batch) 190var _ = WriteBatchBytesAsync(pendingRender); 195public Task ProcessBufferedRenderBatches() 200return Task.WhenAll(_unacknowledgedRenderBatches.Select(WriteBatchBytesAsync)); 203private async Task WriteBatchBytesAsync(UnacknowledgedRenderBatch pending) 236public Task OnRenderCompletedAsync(long incomingBatchId, string? errorMessageOrNull) 241return Task.CompletedTask; 270return Task.CompletedTask; 373private async Task CaptureAsyncExceptions(Task task)
Circuits\RemoteScrollToLocationHash.cs (1)
26public async Task RefreshScrollPositionForHash(string locationAbsolute)
Circuits\RevalidatingServerAuthenticationStateProvider.cs (4)
57/// <returns>A <see cref="Task"/> that resolves as true if the <paramref name="authenticationState"/> is still valid, or false if it is not.</returns> 60private async Task RevalidationLoop(Task<AuthenticationState> authenticationStateTask, CancellationToken cancellationToken) 73await Task.Delay(RevalidationInterval, cancellationToken); 107SetAuthenticationState(Task.FromResult(anonymousState));
ComponentHub.cs (9)
76public override Task OnConnectedAsync() 80Context.Features.Get<IConnectionAuthenticationRefreshFeature>()?.OnAuthenticationRefresh = static _ => Task.FromResult(true); 82return Task.CompletedTask; 85public override Task OnDisconnectedAsync(Exception exception) 92return Task.CompletedTask; 98public override Task OnAuthenticationRefreshedAsync() 103return Task.CompletedTask; 188public async Task UpdateRootComponents(string serializedComponentOperations, string applicationState) 630private static Task NotifyClientError(IClientProxy client, string error) => client.SendAsync("JS.Error", error);
DependencyInjection\ServerRazorComponentsBuilderExtensions.cs (3)
167Func<HttpContext, WebSocketAcceptContext, Task>? configureConnection, 182var result = configureConnection.Invoke(httpContext, context); 194private async Task<WebSocket> ReturnAwaited(Task result, WebSocketAcceptContext context)
src\aspnetcore\src\Components\Shared\src\ArrayBuilderMemoryStream.cs (4)
79public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 84return Task.CompletedTask; 94public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
src\aspnetcore\src\Components\Shared\src\WebRootComponentManager.cs (11)
34private Task _currentUpdateTask = Task.CompletedTask; 36public async Task AddRootComponentAsync( 60public Task UpdateRootComponentAsync( 111internal void SetCurrentUpdateTask(Task postStateTask) 170public Task UpdateAsync( 175Task currentUpdateTask) 206return Task.CompletedTask; 222public Task RenderAsync(Renderer renderer) 227public async Task RenderAsync(Renderer renderer, Task updateTask)
src\aspnetcore\src\Shared\Components\PrerenderComponentApplicationStore.cs (3)
48return Task.FromResult((IDictionary<string, byte[]>)ExistingState); 59public Task PersistStateAsync(IReadOnlyDictionary<string, byte[]> state) 73return Task.CompletedTask;
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
Microsoft.AspNetCore.Components.Testing (41)
Infrastructure\ParentProcessWatcher.cs (2)
24protected override async Task ExecuteAsync(CancellationToken stoppingToken) 43await Task.Delay(1000, stoppingToken).ConfigureAwait(false);
Infrastructure\PlaywrightExtensions.cs (7)
149public static async Task SetTestSession( 168public static Task WaitForBlazorAsync(this IPage page) 179public static Task WaitForInteractiveAsync(this IPage page, string selector) 196public static async Task WaitForEnhancedNavigationAsync(this IPage page) 208public static async Task WaitForEnhancedNavigationAsync(this IPage page, Func<Task> navigationAction) 210var navTask = page.WaitForEnhancedNavigationAsync();
Infrastructure\ReadinessNotificationService.cs (7)
22public Task StartAsync(CancellationToken cancellationToken) 27return Task.CompletedTask; 37return Task.CompletedTask; 40public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; 42private static async Task NotifyReadyAsync(string url) 66await Task.Delay(delay).ConfigureAwait(false);
Infrastructure\RemoteLock.cs (1)
32public async Task ReleaseAsync()
Infrastructure\ResourceLock.cs (2)
74public Task WaitForRequestAsync() => _requestedTcs.Task; 80public async Task ReleaseAsync()
Infrastructure\ServerInstance.cs (9)
68internal async Task LaunchAsync( 74Task readySignal) 103var timeoutTask = Task.Delay(options.ReadinessTimeoutMs); 104var processExitTask = _process.WaitForExitAsync(); 105var completed = await Task.WhenAny(readySignal, timeoutTask, processExitTask).ConfigureAwait(false); 110await Task.Delay(100).ConfigureAwait(false); 331static async Task DrainStreamAsync(StreamReader reader, string prefix, StringBuilder buffer)
Infrastructure\TestLockProvider.cs (5)
18/// A service override calls <see cref="WaitOn"/> to get a <see cref="Task"/> that blocks until the 31/// Returns a <see cref="Task"/> that completes when <see cref="Release"/> is called with the same key. 32/// Calling with the same key multiple times returns the same <see cref="Task"/>. 35public Task WaitOn(string key) 43/// Completes the <see cref="Task"/> returned by <see cref="WaitOn"/>.
Playwright\BrowserTest.cs (1)
114protected internal override async Task InitializeCoreAsync()
Playwright\ContextTest.cs (1)
29protected internal override async Task InitializeCoreAsync()
Playwright\PageTest.cs (1)
23protected internal override async Task InitializeCoreAsync()
Playwright\UITest.cs (5)
82protected async Task TraceAsync(IBrowserContext context) 95protected internal virtual Task InitializeCoreAsync() => Task.CompletedTask; 100protected internal virtual Task CleanupCoreAsync() => Task.CompletedTask;
Microsoft.AspNetCore.Components.Web (44)
Forms\AntiforgeryToken.cs (2)
27Task IComponent.SetParametersAsync(ParameterView parameters) 38return Task.CompletedTask;
Forms\ClientValidation\ClientValidationData.cs (6)
23public Task SetParametersAsync(ParameterView parameters) 29return Task.CompletedTask; 38return Task.CompletedTask; 44return Task.CompletedTask; 51return Task.CompletedTask; 60return Task.CompletedTask;
Forms\DisplayName.cs (2)
39Task IComponent.SetParametersAsync(ParameterView parameters) 63return Task.CompletedTask;
Forms\EditForm.cs (2)
15private readonly Func<Task> _handleSubmitDelegate; // Cache to avoid per-render allocations 200private async Task HandleSubmitAsync()
Forms\InputBase.cs (1)
260public override Task SetParametersAsync(ParameterView parameters)
Forms\InputFile.cs (2)
48protected override async Task OnAfterRenderAsync(bool firstRender) 89Task IInputFileJsCallbacks.NotifyChange(BrowserFile[] files)
Forms\InputFile\IInputFileJsCallbacks.cs (1)
8Task NotifyChange(BrowserFile[] files);
Forms\InputFile\InputFileJsCallbacksRelay.cs (1)
24public Task NotifyChange(BrowserFile[] files)
Forms\Label.cs (2)
69Task IComponent.SetParametersAsync(ParameterView parameters) 104return Task.CompletedTask;
Forms\Mapping\FormMappingScope.cs (2)
36Task IComponent.SetParametersAsync(ParameterView parameters) 67return Task.CompletedTask;
Head\HeadOutlet.cs (1)
27protected override async Task OnAfterRenderAsync(bool firstRender)
HtmlRendering\HtmlRootComponent.cs (3)
16internal HtmlRootComponent(StaticHtmlRenderer renderer, int componentId, Task quiescenceTask) 24/// Gets a <see cref="Task"/> that completes when the component hierarchy has completed asynchronous tasks such as loading. 26public Task QuiescenceTask { get; }
HtmlRendering\StaticHtmlRenderer.cs (2)
70var quiescenceTask = RenderRootComponentAsync(componentId, initialParameters); 85protected override Task UpdateDisplayAsync(in RenderBatch renderBatch)
JSComponents\JSComponentInterop.cs (2)
176var callback = jsObjectReference is null ? null : new Func<Task>( 184var callback = jsObjectReference is null ? null : new Func<object, Task>(
Routing\FocusOnNavigate.cs (1)
75protected override async Task OnAfterRenderAsync(bool firstRender)
Routing\NavigationLock.cs (3)
47Task IComponent.SetParametersAsync(ParameterView parameters) 71return Task.CompletedTask; 74async Task IHandleAfterRender.OnAfterRenderAsync()
Virtualization\Virtualize.cs (9)
217/// <returns>A <see cref="Task"/> representing the completion of the operation.</returns> 218public async Task RefreshDataAsync() 234/// <see cref="ComponentBase.InvokeAsync(Func{Task})"/> to await completion. 238/// <returns>A <see cref="Task"/> that completes when the target is aligned or superseded by another call, 240public Task ScrollToItemAsync(int itemIndex, CancellationToken cancellationToken = default) 252return Task.FromCanceled(cancellationToken); 259private async Task ScrollToItemAsyncCore(int itemIndex, CancellationToken cancellationToken) 329private async Task EnsureRenderCommittedAsync(bool refetchRequired, CancellationToken token) 459protected override async Task OnAfterRenderAsync(bool firstRender)
Web\ErrorBoundary.cs (1)
20protected override async Task OnErrorAsync(Exception exception)
WebRenderer.cs (1)
167public Task DispatchEventAsync(JsonElement eventDescriptor, JsonElement eventArgs)
Microsoft.AspNetCore.Components.WebAssembly (59)
_generated\2\JSImports.g.cs (2)
10public static partial global::System.Threading.Tasks.Task LoadSatelliteAssemblies(string[] culturesToLoad) 21global::System.Threading.Tasks.Task __retVal;
Hosting\HostedServiceExecutor.cs (2)
20public async Task StartAsync(CancellationToken token) 28public async Task StopAsync(CancellationToken token)
Hosting\WebAssemblyCultureProvider.cs (1)
115public static partial Task LoadSatelliteAssemblies(string[] culturesToLoad);
Hosting\WebAssemblyHost.cs (6)
115/// <returns>A <see cref="Task"/> which represents exit of the application.</returns> 121public Task RunAsync() 129internal async Task RunAsyncCore(CancellationToken cancellationToken, WebAssemblyCultureProvider? cultureProvider = null) 198var pendingRenders = new List<Task>(count + initialOperationCount); 214await Task.WhenAll(pendingRenders); 232private static void AddWebRootComponents(WebAssemblyRenderer renderer, RootComponentOperationBatch operationBatch, List<Task> pendingRenders)
Rendering\NullDispatcher.cs (5)
16public override Task InvokeAsync(Action workItem) 21return Task.CompletedTask; 24public override Task InvokeAsync(Func<Task> workItem) 35return Task.FromResult(workItem());
Rendering\WebAssemblyDispatcher.cs (6)
18public override Task InvokeAsync(Action workItem) 27return Task.CompletedTask; 57return Task.FromResult(workItem()); 79public override Task InvokeAsync(Func<Task> workItem) 94var state = ((TaskCompletionSource tcs, Func<Task> workItem))o!;
Rendering\WebAssemblyRenderer.cs (7)
58var stateUpdateTask = Task.CompletedTask; 98private static async Task EnqueueRestore( 99Task task, 120public Task AddComponentAsync([DynamicallyAccessedMembers(Component)] Type componentType, ParameterView parameters, string domElementSelector) 166protected override unsafe Task UpdateDisplayAsync(in RenderBatch batch) 202return Task.CompletedTask;
Services\DefaultWebAssemblyJSRuntime.cs (2)
162=> Task.FromResult<Stream>(PullFromJSDataStream.CreateJSDataStream(this, jsStreamReference, totalLength, cancellationToken)); 165protected override Task TransmitStreamAsync(long streamId, DotNetStreamReference dotNetStreamReference)
Services\LazyAssemblyLoader.cs (2)
64return Task.FromResult<IEnumerable<Assembly>>(loadedAssemblies); 77var loadedStatus = await Task.WhenAll(pendingLoads);
Services\WebAssemblyNavigationInterception.cs (2)
12public Task EnableNavigationInterceptionAsync() 15return Task.CompletedTask;
Services\WebAssemblyNavigationManager.cs (1)
59async Task PerformNavigationAsync()
Services\WebAssemblyScrollToLocationHash.cs (2)
12public Task RefreshScrollPositionForHash(string locationAbsolute) 23return Task.CompletedTask;
src\aspnetcore\src\Components\Shared\src\ArrayBuilderMemoryStream.cs (4)
79public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 84return Task.CompletedTask; 94public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
src\aspnetcore\src\Components\Shared\src\PullFromJSDataStream.cs (2)
62public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
src\aspnetcore\src\Components\Shared\src\TransmitDataStreamToJS.cs (1)
15internal static async Task TransmitStreamAsync(IJSRuntime runtime, string methodIdentifier, long streamId, DotNetStreamReference dotNetStreamReference)
src\aspnetcore\src\Components\Shared\src\WebRootComponentManager.cs (11)
34private Task _currentUpdateTask = Task.CompletedTask; 36public async Task AddRootComponentAsync( 60public Task UpdateRootComponentAsync( 111internal void SetCurrentUpdateTask(Task postStateTask) 170public Task UpdateAsync( 175Task currentUpdateTask) 206return Task.CompletedTask; 222public Task RenderAsync(Renderer renderer) 227public async Task RenderAsync(Renderer renderer, Task updateTask)
src\aspnetcore\src\Shared\Components\PrerenderComponentApplicationStore.cs (3)
48return Task.FromResult((IDictionary<string, byte[]>)ExistingState); 59public Task PersistStateAsync(IReadOnlyDictionary<string, byte[]> state) 73return Task.CompletedTask;
Microsoft.AspNetCore.Components.WebAssembly.Authentication (9)
Options\AuthenticationStateDeserializationOptions.cs (2)
16Task.FromResult(new AuthenticationState(new ClaimsPrincipal(new ClaimsIdentity()))); 32return Task.FromResult(
RemoteAuthenticatorViewCore.cs (5)
150protected override async Task OnParametersSetAsync() 207private async Task ProcessLogIn(string returnUrl) 244private async Task ProcessLogInCallback() 279private async Task ProcessLogOut(string returnUrl) 333private async Task ProcessLogOutCallback()
Services\DeserializedAuthenticationStateProvider.cs (1)
18Task.FromResult(new AuthenticationState(new ClaimsPrincipal(new ClaimsIdentity())));
Services\RemoteAuthenticationService.cs (1)
217private async Task UpdateUserOnSuccess(RemoteAuthenticationResult<TRemoteAuthenticationState> result)
Microsoft.AspNetCore.Components.WebAssembly.Server (8)
AuthenticationStateSerializer.cs (1)
28private async Task OnPersistingAsync()
ContentEncodingNegotiator.cs (1)
33public Task InvokeAsync(HttpContext context)
TargetPickerUi.cs (6)
48/// <returns>The <see cref="Task"/>.</returns> 49public async Task DisplayFirefox(HttpContext context) 51static async Task SendMessageToBrowser(NetworkStream toStream, ExpandoObject args, CancellationToken token) 98static async Task EvaluateOnBrowser(NetworkStream toStream, string? to, string text, CancellationToken token) 263/// <returns>The <see cref="Task"/>.</returns> 264public async Task Display(HttpContext context)
Microsoft.AspNetCore.Components.WebView (29)
IpcReceiver.cs (3)
25private readonly Func<string, string, Task> _onAttachMessage; 27public IpcReceiver(Func<string, string, Task> onAttachMessage) 32public async Task OnMessageReceivedAsync(PageContext pageContext, string message)
IpcSender.cs (2)
100private void NotifyErrors(Task task) 104async Task AwaitAndNotify()
Services\WebViewJSRuntime.cs (2)
83=> Task.FromResult<Stream>(PullFromJSDataStream.CreateJSDataStream(this, jsStreamReference, totalLength, cancellationToken)); 85protected override Task TransmitStreamAsync(long streamId, DotNetStreamReference dotNetStreamReference)
Services\WebViewNavigationInterception.cs (2)
12public Task EnableNavigationInterceptionAsync() => Task.CompletedTask;
Services\WebViewNavigationManager.cs (2)
36async Task HandleLocationChangingAsync() 63async Task PerformNavigationAsync()
Services\WebViewRenderer.cs (2)
47protected override Task UpdateDisplayAsync(in RenderBatch renderBatch) 69public new Task RenderRootComponentAsync(int componentId, ParameterView parameters)
Services\WebViewScrollToLocationHash.cs (1)
25public async Task RefreshScrollPositionForHash(string locationAbsolute)
src\aspnetcore\src\Components\Shared\src\ArrayBuilderMemoryStream.cs (4)
79public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 84return Task.CompletedTask; 94public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
src\aspnetcore\src\Components\Shared\src\PullFromJSDataStream.cs (2)
62public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
src\aspnetcore\src\Components\Shared\src\TransmitDataStreamToJS.cs (1)
15internal static async Task TransmitStreamAsync(IJSRuntime runtime, string methodIdentifier, long streamId, DotNetStreamReference dotNetStreamReference)
WebViewManager.cs (8)
91public Task AddRootComponentAsync(Type componentType, string selector, ParameterView parameters) 113return Task.CompletedTask; 121public Task RemoveRootComponentAsync(string selector) 136return Task.CompletedTask; 176/// <returns>Returns a <see cref="Task"/> representing <c>true</c> if the <paramref name="workItem"/> was called, or <c>false</c> if it was not called because Blazor is not currently running.</returns> 216internal async Task AttachToPageAsync(string baseUrl, string startUrl) 232var pendingRenders = new List<Task>(_rootComponentsBySelector.Count); 242await Task.WhenAll(pendingRenders);
Microsoft.AspNetCore.Components.WebView.Maui (12)
BlazorWebView.cs (1)
84 /// <returns>Returns a <see cref="Task"/> representing <c>true</c> if the <paramref name="workItem"/> was called, or <c>false</c> if it was not called because Blazor is not currently running.</returns>
MauiDispatcher.cs (3)
21 public override Task InvokeAsync(Action workItem) 26 public override Task InvokeAsync(Func<Task> workItem)
RootComponent.cs (2)
33 internal Task AddToWebViewManagerAsync(WebViewManager webViewManager) 53 internal Task RemoveFromWebViewManagerAsync(WebViewManager webviewManager)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (3)
150 private async Task NotifyContentUpdatedAsync(string assemblyName, string relativePath) 183 public Task SetParametersAsync(ParameterView parameters) 184 => Task.CompletedTask;
src\Core\src\TaskExtensions.cs (2)
30 this Task task, 47 public static void FireAndForget(this Task task, ILogger? logger, [CallerMemberName] string? callerName = null) =>
Standard\BlazorWebViewHandler.cs (1)
23 /// <returns>Returns a <see cref="Task"/> representing <c>true</c> if the <paramref name="workItem"/> was called, or <c>false</c> if it was not called because Blazor is not currently running.</returns>
Microsoft.AspNetCore.Components.WebView.WindowsForms (17)
BlazorWebView.cs (1)
299 /// <returns>Returns a <see cref="Task"/> representing <c>true</c> if the <paramref name="workItem"/> was called, or <c>false</c> if it was not called because Blazor is not currently running.</returns>
RootComponent.cs (2)
50 internal Task AddToWebViewManagerAsync(WebViewManager webViewManager) 56 internal Task RemoveFromWebViewManagerAsync(WebView2WebViewManager webviewManager)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (3)
150 private async Task NotifyContentUpdatedAsync(string assemblyName, string relativePath) 183 public Task SetParametersAsync(ParameterView parameters) 184 => Task.CompletedTask;
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (2)
300 protected virtual Task HandleWebResourceRequest(CoreWebView2WebResourceRequestedEventArgs eventArgs) 333 return Task.CompletedTask;
WindowsFormsDispatcher.cs (9)
13 /// class uses the async <see cref="Task"/> pattern so everything must be mapped from the <see cref="IAsyncResult"/> 41 public override async Task InvokeAsync(Action workItem) 52 await Task.Factory.FromAsync(asyncResult, _dispatchThreadControl.EndInvoke); 65 public override async Task InvokeAsync(Func<Task> workItem) 96 await Task.WhenAll(tcs.Task, Task.Factory.FromAsync(asyncResult, _dispatchThreadControl.EndInvoke)); 164 await Task.WhenAll(tcs.Task, Task.Factory.FromAsync(asyncResult, _dispatchThreadControl.EndInvoke));
Microsoft.AspNetCore.Components.WebView.Wpf (11)
BlazorWebView.cs (1)
359 /// <returns>Returns a <see cref="Task"/> representing <c>true</c> if the <paramref name="workItem"/> was called, or <c>false</c> if it was not called because Blazor is not currently running.</returns>
RootComponent.cs (2)
32 internal Task AddToWebViewManagerAsync(WebViewManager webViewManager) 52 internal Task RemoveFromWebViewManagerAsync(WebView2WebViewManager webviewManager)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (3)
150 private async Task NotifyContentUpdatedAsync(string assemblyName, string relativePath) 183 public Task SetParametersAsync(ParameterView parameters) 184 => Task.CompletedTask;
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (2)
300 protected virtual Task HandleWebResourceRequest(CoreWebView2WebResourceRequestedEventArgs eventArgs) 333 return Task.CompletedTask;
WpfDispatcher.cs (3)
26 public override async Task InvokeAsync(Action workItem) 49 public override async Task InvokeAsync(Func<Task> workItem)
Microsoft.AspNetCore.Connections.Abstractions (18)
ConnectionBuilder.cs (1)
42return Task.CompletedTask;
ConnectionBuilderExtensions.cs (8)
32/// If you aren't calling the next function, use <see cref="Run(IConnectionBuilder, Func{ConnectionContext, Task})"/> instead. 34/// Prefer using <see cref="Use(IConnectionBuilder, Func{ConnectionContext, ConnectionDelegate, Task})"/> for better performance as shown below: 46public static IConnectionBuilder Use(this IConnectionBuilder connectionBuilder, Func<ConnectionContext, Func<Task>, Task> middleware) 52Func<Task> simpleNext = () => next(context); 60/// If you aren't calling the next function, use <see cref="Run(IConnectionBuilder, Func{ConnectionContext, Task})"/> instead. 65public static IConnectionBuilder Use(this IConnectionBuilder connectionBuilder, Func<ConnectionContext, ConnectionDelegate, Task> middleware) 76public static IConnectionBuilder Run(this IConnectionBuilder connectionBuilder, Func<ConnectionContext, Task> middleware)
ConnectionDelegate.cs (2)
12/// <returns>A <see cref="Task"/> that represents the connection lifetime. When the task completes, the connection will be closed.</returns> 13public delegate Task ConnectionDelegate(ConnectionContext connection);
ConnectionHandler.cs (2)
17/// <returns>A <see cref="Task"/> that represents the connection lifetime. When the task completes, the connection is complete.</returns> 18public abstract Task OnConnectedAsync(ConnectionContext connection);
Features\IConnectionCompleteFeature.cs (1)
20void OnCompleted(Func<object, Task> callback, object state);
Features\IStatefulReconnectFeature.cs (1)
28public void OnReconnected(Func<PipeWriter, Task> notifyOnReconnect);
MultiplexedConnectionBuilder.cs (1)
42return Task.CompletedTask;
MultiplexedConnectionDelegate.cs (2)
12/// <returns>A <see cref="Task"/> that represents the connection lifetime. When the task completes, the connection will be closed.</returns> 13public delegate Task MultiplexedConnectionDelegate(MultiplexedConnectionContext connection);
Microsoft.AspNetCore.CookiePolicy (1)
CookiePolicyMiddleware.cs (1)
63public Task Invoke(HttpContext context)
Microsoft.AspNetCore.Cors (11)
Infrastructure\CorsMiddleware.cs (8)
18private readonly Func<object, Task> OnResponseStartingDelegate = OnResponseStarting; 89public Task Invoke(HttpContext context, ICorsPolicyProvider corsPolicyProvider) 126return Task.CompletedTask; 161async Task InvokeCoreAwaited(HttpContext context, Task<CorsPolicy?> policyTask) 168private Task EvaluateAndApplyPolicy(HttpContext context, CorsPolicy? corsPolicy) 184return Task.CompletedTask; 193private static Task OnResponseStarting(object state) 204return Task.CompletedTask;
Infrastructure\CorsOptions.cs (2)
62PolicyMap[name] = (policy, Task.FromResult(policy)); 79PolicyMap[name] = (policy, Task.FromResult(policy));
Infrastructure\DefaultCorsPolicyProvider.cs (1)
12private static readonly Task<CorsPolicy?> NullResult = Task.FromResult<CorsPolicy?>(null);
Microsoft.AspNetCore.DataProtection (6)
Internal\DataProtectionHostedService.cs (4)
29public Task StartAsync(CancellationToken token) 46return Task.CompletedTask; 49public Task StopAsync(CancellationToken token) => Task.CompletedTask;
KeyManagement\KeyRingProvider.cs (2)
448_cacheableKeyRingTask = Task.Factory.StartNew( 514private static void ObserveTaskException(Task task)
Microsoft.AspNetCore.Diagnostics (33)
DeveloperExceptionPage\DeveloperExceptionPageMiddleware.cs (1)
53public Task Invoke(HttpContext context)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (6)
40private readonly Func<ErrorContext, Task> _exceptionHandler; 106public async Task Invoke(HttpContext context) 199private Task DisplayException(ErrorContext errorContext) 222private async Task DisplayExceptionContent(ErrorContext errorContext) 272private Task DisplayCompilationException( 334private Task DisplayRuntimeException(HttpContext context, Exception ex)
DeveloperExceptionPage\Views\CompilationErrorPage.Designer.cs (1)
52public async override global::System.Threading.Tasks.Task ExecuteAsync()
DeveloperExceptionPage\Views\ErrorPage.Designer.cs (1)
59public async override global::System.Threading.Tasks.Task ExecuteAsync()
ExceptionHandler\ExceptionHandlerMiddleware.cs (1)
47public Task Invoke(HttpContext context)
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (9)
27private readonly Func<object, Task> _clearCacheHeadersDelegate; 71public Task Invoke(HttpContext context) 77var task = _next(context); 83return Task.CompletedTask; 93static async Task Awaited(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task) 113private async Task HandleException(HttpContext context, ExceptionDispatchInfo edi) 307private static Task ClearCacheHeaders(object state) 314return Task.CompletedTask;
src\aspnetcore\src\Shared\Diagnostics\BaseView.cs (2)
61public async Task ExecuteAsync(HttpContext context) 74public abstract Task ExecuteAsync();
src\aspnetcore\src\Shared\RazorViews\BaseView.cs (3)
64public async Task ExecuteAsync(Stream stream) 80public async Task ExecuteAsync(HttpContext context) 97public abstract Task ExecuteAsync();
StatusCodePage\StatusCodePagesExtensions.cs (4)
61public static IApplicationBuilder UseStatusCodePages(this IApplicationBuilder app, Func<StatusCodeContext, Task> handler) 111return Task.CompletedTask; 120return Task.CompletedTask; 215private static Func<StatusCodeContext, Task> CreateHandler(string pathFormat, string? queryFormat, RequestDelegate? next = null)
StatusCodePage\StatusCodePagesMiddleware.cs (1)
39public async Task Invoke(HttpContext context)
StatusCodePage\StatusCodePagesOptions.cs (1)
62public Func<StatusCodeContext, Task> HandleAsync { get; set; }
WelcomePage\Views\Obsolete\WelcomePage.cs (1)
26public override async Task ExecuteAsync()
WelcomePage\Views\WelcomePage.Designer.cs (1)
24public async override global::System.Threading.Tasks.Task ExecuteAsync()
WelcomePage\WelcomePageMiddleware.cs (1)
38public Task Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.Abstractions (2)
IDeveloperPageExceptionFilter.cs (2)
18Task HandleExceptionAsync(ErrorContext errorContext, Func<ErrorContext, Task> next);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (12)
DatabaseDeveloperPageExceptionFilter.cs (2)
45public async Task HandleExceptionAsync(ErrorContext errorContext, Func<ErrorContext, Task> next)
DatabaseErrorPageMiddleware.cs (1)
75public virtual async Task Invoke(HttpContext httpContext)
MigrationsEndPointMiddleware.cs (3)
51public virtual Task Invoke(HttpContext context) 63private async Task InvokeCore(HttpContext context) 131private static async Task WriteErrorToResponse(HttpResponse response, string error)
src\aspnetcore\src\Shared\Diagnostics\BaseView.cs (2)
61public async Task ExecuteAsync(HttpContext context) 74public abstract Task ExecuteAsync();
src\aspnetcore\src\Shared\RazorViews\BaseView.cs (3)
64public async Task ExecuteAsync(Stream stream) 80public async Task ExecuteAsync(HttpContext context) 97public abstract Task ExecuteAsync();
Views\DatabaseErrorPage.Designer.cs (1)
38public async override global::System.Threading.Tasks.Task ExecuteAsync()
Microsoft.AspNetCore.Diagnostics.HealthChecks (3)
HealthCheckMiddleware.cs (1)
41public async Task InvokeAsync(HttpContext httpContext)
HealthCheckOptions.cs (1)
71public Func<HttpContext, HealthReport, Task> ResponseWriter { get; set; } = HealthCheckResponseWriters.WriteMinimalPlaintext;
HealthCheckResponseWriters.cs (1)
16public static Task WriteMinimalPlaintext(HttpContext httpContext, HealthReport result)
Microsoft.AspNetCore.Diagnostics.Middleware (17)
Latency\AddServerTimingHeaderMiddleware.cs (3)
30/// <returns>A <see cref="Task"/> that represents the execution of this middleware.</returns> 31public Task InvokeAsync(HttpContext context) 52return Task.CompletedTask;
Latency\CapturePipelineEntryMiddleware.cs (1)
26public async Task InvokeAsync(HttpContext context)
Latency\CapturePipelineExitMiddleware.cs (1)
29public async Task InvokeAsync(HttpContext context)
Latency\CaptureResponseTimeMiddleware.cs (4)
33/// <returns>A <see cref="Task"/> that represents the execution of this middleware.</returns> 34public Task InvokeAsync(HttpContext context) 43return Task.CompletedTask; 51return Task.CompletedTask;
Latency\RequestLatencyTelemetryMiddleware.cs (8)
27private static readonly ObjectPool<List<Task>> _exporterTaskPool = PoolFactory.CreateListPool<Task>(); 56/// <returns>A <see cref="Task"/> that represents the execution of this middleware.</returns> 57public Task InvokeAsync(HttpContext context) 70return Task.CompletedTask; 85private async Task ExportAsync(LatencyData latencyData) 90List<Task> exports = _exporterTaskPool.Get(); 96await Task.WhenAll(exports).ConfigureAwait(false);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (72)
Latency\AcceptanceTests.cs (2)
21public async Task RequestLatency_LatencyContextIsStarted() 58await Task.Delay(taskTimeMs + 10); // Adding 10 ms buffer
Latency\AddServerTimingHeaderMiddlewareTests.cs (6)
17static _ => Task.CompletedTask; 20public async Task Middleware_ReturnsTotalMillisecondsElapsed_InsteadOfFraction() 52private Func<Task> _responseStartingAsync = 53static () => Task.CompletedTask; 55public override void OnStarting(Func<object, Task> callback, object state) 65public async Task StartAsync() => await _responseStartingAsync();
Latency\ChecpointAcceptanceTests.cs (3)
34public async Task RequestCheckpoint_CanMeasureMiddlewarePipeTime() 70public async Task RequestCheckpointMiddleware_Does_Not_Throw_When_ServerTiming_Header_Is_Already_Set() 120public async Task MiddlewareTest_ReturnsNotFoundForRequest()
Latency\RequestLatencyTelemetryMiddlewareTests.cs (24)
22public async Task RequestLatency_GivenContext_InvokesOperations() 31return Task.CompletedTask; 53public async Task RequestLatency_WithoutServiceMetadata_InvokesOperations() 61return Task.CompletedTask; 81public async Task RequestLatency_WithServerNameHeadersSet_ReturnsLastServerName() 90return Task.CompletedTask; 111public async Task RequestLatency_NoServiceData_DoesNotAddHeader() 119return Task.CompletedTask; 140public async Task RequestLatency_NoExporter() 148return Task.CompletedTask; 161public async Task RequestLatency_GivenTimeout_PassedToExport() 170return Task.CompletedTask; 188private Func<Task> _responseStartingAsync = 189static () => Task.CompletedTask; 191public override void OnStarting(Func<object, Task> callback, object state) 196public override void OnCompleted(Func<object, Task> callback, object state) 201private void ChainCallback(Func<object, Task> callback, object state) 211public async Task StartAsync() => await _responseStartingAsync(); 219feature.Setup(m => m.OnCompleted(It.IsAny<Func<object, Task>>(), It.IsAny<object>())) 220.Callback<Func<object, Task>, object>((c, o) => c(o)); 242public async Task ExportAsync(LatencyData latencyData, CancellationToken cancellationToken) 245await Task.CompletedTask; 260public async Task ExportAsync(LatencyData latencyData, CancellationToken cancellationToken) 264var e = await Record.ExceptionAsync(() => Task.Delay(_timeSpanToDelay, cancellationToken));
Logging\AcceptanceTests.cs (22)
143private static Task RunAsync(LogLevel level, Action<IServiceCollection> configure, Func<FakeLogCollector, HttpClient, Task> func) 146private static async Task RunAsync<TStartup>( 149Func<FakeLogCollector, HttpClient, IServiceProvider, Task> func) 179private static async Task WaitForLogRecordsAsync(FakeLogCollector logCollector, TimeSpan timeout, int expectedRecords = 1) 190await Task.Delay(spinTime); 202public async Task HttpLogging_WhenLogLevelInfo_LogResponseBody(string responseContentTypeToLog, bool shouldLog) 262public async Task HttpLogging_WhenLogLevelInfo_LogRequestBody(string requestContentType, bool shouldLog) 315public async Task HttpLogging_WhenIncludeUnmatchedRoutes_LogRequestPath() 357public async Task HttpLogging_WhenLogLevelInfo_LogRequestStart() 428public async Task HttpLogging_WhenLogLevelInfo_LogHeaders() 482public async Task HttpLogging_WhenEnricherAdded_LogAdditionalProps() 520public async Task HttpLogging_WhenRedactionModeNone_LogIncomingRequestPath(IncomingPathLoggingMode pathLoggingMode) 554public async Task HttpLogging_WhenLogRequestStart_SkipEnrichingFirstLogRecord() 591public async Task HttpLogging_WhenSecondLogRequestStart_DontLogDurationAndStatus() 648public async Task HttpLogging_WhenException_LogError(string requestPath, string expectedStatus) 679public async Task HttpLogging_WhenException_LogBody() 716public async Task HttpLogging_WhenException_DontLogResponseBody() 748public async Task HttpLogging_WhenLogLevelError_NoLogHttp() 776public async Task HttpLogging_LogRecordIsNotCreated_If_isFiltered_True(string httpPath, string excludedPath, bool isFiltered) 953public async Task HttpLogging_LogRecordIsNotCreated_If_Disabled() 973public async Task HttpLogging_EnricherThrows_Logged()
Logging\AcceptanceTests.Mvc.cs (7)
51private static Task RunControllerAsync(LogLevel level, Action<IServiceCollection> configure, Func<FakeLogCollector, HttpClient, Task> func) 57public async Task TestServer_WhenController_RedactPath(HttpRouteParameterRedactionMode mode, string redactedPath) 92public async Task TestServer_WhenControllerWithPathRoute_RedactParameters() 131public async Task TestServer_WhenControllerWithPathRoute_HonorRouteParamDataClassMap(bool routeParameterRedactionModeNone) 182public async Task TestServer_WhenControllerWithPathRoute_RedactionModeNone() 218public async Task TestServer_WhenControllerWithoutPathRoute_LogPath(bool routeParameterRedactionModeNone)
Logging\AcceptanceTests.Routing.cs (3)
54private static Task RunRoutingTestAsync<TStartup>( 128public async Task Routing_WithFormattedPath_RedactPath( 166public async Task Routing_WithStructuredPath_RedactParameters(
Logging\TestController.cs (5)
21await Task.Yield(); 30await Task.Yield(); 39await Task.Yield(); 47await Task.Yield(); 56await Task.Yield();
Microsoft.AspNetCore.Grpc.JsonTranscoding (24)
Internal\CallHandlers\ServerCallHandlerBase.cs (6)
37public Task HandleCallAsync(HttpContext httpContext) 51var handleCallTask = HandleCallAsyncCore(httpContext, serverCallContext); 55return Task.CompletedTask; 67static async Task AwaitHandleCall(JsonTranscodingServerCallContext serverCallContext, Method<TRequest, TResponse> method, bool isStreaming, JsonSerializerOptions serializerOptions, Task handleCall) 80protected abstract Task HandleCallAsyncCore(HttpContext httpContext, JsonTranscodingServerCallContext serverCallContext);
Internal\CallHandlers\ServerStreamingServerCallHandler.cs (1)
27protected override async Task HandleCallAsyncCore(HttpContext httpContext, JsonTranscodingServerCallContext serverCallContext)
Internal\CallHandlers\UnaryServerCallHandler.cs (1)
29protected override async Task HandleCallAsyncCore(HttpContext httpContext, JsonTranscodingServerCallContext serverCallContext)
Internal\HttpContextStreamWriter.cs (6)
16private Task? _writeTask; 32Task IAsyncStreamWriter<TResponse>.WriteAsync(TResponse message, CancellationToken cancellationToken) 37public Task WriteAsync(TResponse message) 42private async Task WriteAsyncCore(TResponse message, CancellationToken cancellationToken) 84private async Task WriteMessageAndDelimiter(TResponse message, CancellationToken cancellationToken) 113var writeTask = _writeTask;
Internal\JsonTranscodingServerCallContext.cs (2)
102internal async Task ProcessHandlerErrorAsync(Exception ex, string method, bool isStreaming, JsonSerializerOptions options) 206protected override Task WriteResponseHeadersAsyncCore(Metadata responseHeaders)
src\aspnetcore\src\Grpc\JsonTranscoding\src\Shared\Server\DuplexStreamingServerMethodInvoker.cs (2)
66private async Task ResolvedInterceptorInvoker(IAsyncStreamReader<TRequest> requestStream, IServerStreamWriter<TResponse> responseStream, ServerCallContext resolvedContext) 95public async Task Invoke(HttpContext httpContext, ServerCallContext serverCallContext, IAsyncStreamReader<TRequest> requestStream, IServerStreamWriter<TResponse> responseStream)
src\aspnetcore\src\Grpc\JsonTranscoding\src\Shared\Server\ServerStreamingServerMethodInvoker.cs (3)
66private async Task ResolvedInterceptorInvoker(TRequest request, IServerStreamWriter<TResponse> responseStream, ServerCallContext resolvedContext) 94/// <returns>A <see cref="Task"/> that represents the asynchronous method.</returns> 95public async Task Invoke(HttpContext httpContext, ServerCallContext serverCallContext, TRequest request, IServerStreamWriter<TResponse> streamWriter)
src\aspnetcore\src\Grpc\JsonTranscoding\src\Shared\Server\UnaryServerMethodInvoker.cs (1)
123return Task.FromException<TResponse>(ex);
src\aspnetcore\src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
Microsoft.AspNetCore.HeaderPropagation (1)
HeaderPropagationMiddleware.cs (1)
43public Task Invoke(HttpContext context)
Microsoft.AspNetCore.HostFiltering (3)
HostFilteringMiddleware.cs (3)
53public Task Invoke(HttpContext context) 66private static Task HostValidationFailed(HttpContext context, MiddlewareConfiguration middlewareConfiguration) 77return Task.CompletedTask;
Microsoft.AspNetCore.Hosting (19)
GenericHost\GenericWebHostService.cs (2)
62public async Task StartAsync(CancellationToken cancellationToken) 197public async Task StopAsync(CancellationToken cancellationToken)
Internal\HostedServiceExecutor.cs (2)
17public async Task StartAsync(CancellationToken token) 25public async Task StopAsync(CancellationToken token)
Internal\HostingApplication.cs (1)
94public Task ProcessRequestAsync(Context context)
Internal\WebHost.cs (2)
125public async Task StartAsync(CancellationToken cancellationToken = default) 280public async Task StopAsync(CancellationToken cancellationToken = default)
src\aspnetcore\src\Shared\ErrorPage\ErrorPage.Designer.cs (1)
52public async override global::System.Threading.Tasks.Task ExecuteAsync()
src\aspnetcore\src\Shared\RazorViews\BaseView.cs (3)
64public async Task ExecuteAsync(Stream stream) 80public async Task ExecuteAsync(HttpContext context) 97public abstract Task ExecuteAsync();
WebHostExtensions.cs (8)
25/// <returns>A <see cref="Task"/> that completes when the <see cref="IWebHost"/> stops.</returns> 26public static async Task StopAsync(this IWebHost host, TimeSpan timeout) 46/// <returns>A <see cref="Task"/> that completes when shutdown is triggered via Ctrl+C or SIGTERM.</returns> 47public static async Task WaitForShutdownAsync(this IWebHost host, CancellationToken token = default) 80public static async Task RunAsync(this IWebHost host, CancellationToken token = default) 108private static async Task RunAsync(this IWebHost host, CancellationToken token, string? startupMessage) 152private static async Task WaitForTokenShutdownAsync(this IWebHost host, CancellationToken cancellationToken) 162await Task.Delay(Timeout.Infinite, applicationLifetime.ApplicationStopping)
Microsoft.AspNetCore.Hosting.Abstractions (4)
IWebHost.cs (4)
34/// <returns>A <see cref="Task"/> that completes when the <see cref="IWebHost"/> starts.</returns> 35Task StartAsync(CancellationToken cancellationToken = default); 41/// <returns>A <see cref="Task"/> that completes when the <see cref="IWebHost"/> stops.</returns> 42Task StopAsync(CancellationToken cancellationToken = default);
Microsoft.AspNetCore.Hosting.Server.Abstractions (3)
IHttpApplication.cs (1)
25Task ProcessRequestAsync(TContext context);
IServer.cs (2)
24Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) where TContext : notnull; 30Task StopAsync(CancellationToken cancellationToken);
Microsoft.AspNetCore.Http (26)
Builder\ApplicationBuilder.cs (1)
192return Task.CompletedTask;
Features\FormFeature.cs (1)
167_parsedFormTask = Task.FromResult(Form);
Features\HttpResponseFeature.cs (2)
37public virtual void OnStarting(Func<object, Task> callback, object state) 42public virtual void OnCompleted(Func<object, Task> callback, object state)
Features\RequestBodyPipeFeature.cs (1)
44return Task.CompletedTask;
Features\TlsConnectionFeature.cs (1)
19return Task.FromResult(ClientCertificate);
FormFile.cs (1)
99public async Task CopyToAsync(Stream target, CancellationToken cancellationToken = default(CancellationToken))
Internal\DefaultHttpResponse.cs (5)
127public override void OnStarting(Func<object, Task> callback, object state) 134public override void OnCompleted(Func<object, Task> callback, object state) 155public override Task StartAsync(CancellationToken cancellationToken = default) 159return Task.CompletedTask; 165public override Task CompleteAsync() => HttpResponseBodyFeature.CompleteAsync();
Internal\ReferenceReadStream.cs (3)
118public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 135public override Task FlushAsync(CancellationToken cancellationToken) 137return Task.CompletedTask;
SendFileFallback.cs (1)
23public static async Task SendFileAsync(Stream destination, string filePath, long offset, long? count, CancellationToken cancellationToken)
src\aspnetcore\src\Http\Shared\StreamCopyOperationInternal.cs (2)
20public static Task CopyToAsync(Stream source, Stream destination, long? count, CancellationToken cancel) 32public static async Task CopyToAsync(Stream source, Stream destination, long? count, int bufferSize, CancellationToken cancel)
src\aspnetcore\src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
StreamResponseBodyFeature.cs (4)
86public virtual async Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellationToken) 100public virtual Task StartAsync(CancellationToken cancellationToken = default) 107return Task.CompletedTask; 115public virtual async Task CompleteAsync()
Timeouts\RequestTimeoutsMiddleware.cs (2)
29public Task Invoke(HttpContext context) 96async Task SetTimeoutAsync()
Microsoft.AspNetCore.Http.Abstractions (39)
Extensions\HttpResponseWritingExtensions.cs (5)
26public static Task WriteAsync(this HttpResponse response, string text, CancellationToken cancellationToken = default(CancellationToken)) 43public static Task WriteAsync(this HttpResponse response, string text, Encoding encoding, CancellationToken cancellationToken = default(CancellationToken)) 52var startAsyncTask = response.StartAsync(cancellationToken); 64private static async Task StartAndWriteAsyncAwaited(this HttpResponse response, string text, Encoding encoding, CancellationToken cancellationToken, Task startAsyncTask)
Extensions\MapMiddleware.cs (2)
40public Task Invoke(HttpContext context) 55private async Task InvokeCore(HttpContext context, PathString matchedPath, PathString remainingPath)
Extensions\MapWhenMiddleware.cs (1)
45public Task Invoke(HttpContext context)
Extensions\UseExtensions.cs (5)
17/// Prefer using <see cref="Use(IApplicationBuilder, Func{HttpContext, RequestDelegate, Task})"/> for better performance as shown below: 29public static IApplicationBuilder Use(this IApplicationBuilder app, Func<HttpContext, Func<Task>, Task> middleware) 35Func<Task> simpleNext = () => next(context); 48public static IApplicationBuilder Use(this IApplicationBuilder app, Func<HttpContext, RequestDelegate, Task> middleware)
Extensions\UseMiddlewareExtensions.cs (6)
87if (!typeof(Task).IsAssignableFrom(invokeMethod.ReturnType)) 89throw new InvalidOperationException(Resources.FormatException_UseMiddlewareNonTaskReturnType(InvokeMethodName, InvokeAsyncMethodName, nameof(Task))); 200private static Func<T, HttpContext, IServiceProvider, Task> ReflectionFallback<T>(MethodInfo methodInfo, ParameterInfo[] parameters) 235return (Task)methodInfo.Invoke(middleware, BindingFlags.DoNotWrapExceptions, binder: null, methodArguments, culture: null)!; 265private static Func<T, HttpContext, IServiceProvider, Task> CompileExpression<T>(MethodInfo methodInfo, ParameterInfo[] parameters) 323var lambda = Expression.Lambda<Func<T, HttpContext, IServiceProvider, Task>>(body, instanceArg, httpContextArg, providerArg);
Extensions\UsePathBaseMiddleware.cs (2)
39public Task Invoke(HttpContext context) 50private async Task InvokeCore(HttpContext context, PathString matchedPath, PathString remainingPath)
HttpResponse.cs (10)
19private static readonly Func<object, Task> _callbackDelegate = callback => ((Func<Task>)callback)(); 20private static readonly Func<object, Task> _disposeDelegate = state => 31return Task.CompletedTask; 91public abstract void OnStarting(Func<object, Task> callback, object state); 103public virtual void OnStarting(Func<Task> callback) => OnStarting(_callbackDelegate, callback); 110public abstract void OnCompleted(Func<object, Task> callback, object state); 128public virtual void OnCompleted(Func<Task> callback) => OnCompleted(_callbackDelegate, callback); 149public virtual Task StartAsync(CancellationToken cancellationToken = default) { throw new NotImplementedException(); } 156public virtual Task CompleteAsync() { throw new NotImplementedException(); }
HttpResults\EmptyHttpResult.cs (2)
22public Task ExecuteAsync(HttpContext httpContext) 26return Task.CompletedTask;
HttpResults\IResult.cs (1)
16Task ExecuteAsync(HttpContext httpContext);
IMiddleware.cs (2)
16/// <returns>A <see cref="Task"/> that represents the execution of this middleware.</returns> 17Task InvokeAsync(HttpContext context, RequestDelegate next);
RequestDelegate.cs (1)
11public delegate Task RequestDelegate(HttpContext context);
src\aspnetcore\src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
Microsoft.AspNetCore.Http.Connections (71)
Internal\HttpConnectionContext.cs (21)
75internal Func<PipeWriter, Task>? NotifyOnReconnect { get; set; } 142internal Task? DisposeAndRemoveTask { get; set; } 153public Task PreviousPollTask { get; set; } = Task.CompletedTask; 155public Task? ApplicationTask { get; set; } 604public async Task DisposeAsync(bool closeGracefully = false) 606Task disposeTask; 622var applicationTask = ApplicationTask ?? Task.CompletedTask; 623var transportTask = TransportTask ?? Task.CompletedTask; 664private async Task WaitOnTasks(Task applicationTask, Task transportTask, bool closeGracefully) 706var result = await Task.WhenAny(applicationTask, transportTask); 778Task currentRequestTask, 813Task currentRequestTask, 996private async Task ExecuteApplication(ConnectionDelegate connectionDelegate) 1003await Task.Yield(); 1103public void OnReconnected(Func<PipeWriter, Task> notifyOnReconnect)
Internal\HttpConnectionDispatcher.cs (19)
64public async Task ExecuteAsync(HttpContext context, HttpConnectionDispatcherOptions options, ConnectionDelegate connectionDelegate) 105public async Task ExecuteNegotiateAsync(HttpContext context, HttpConnectionDispatcherOptions options) 124public async Task ExecuteRefreshAsync(HttpContext context, HttpConnectionDispatcherOptions options) 141private async Task ProcessRefresh(HttpContext context, HttpConnectionDispatcherOptions options, ConnectionLogScope logScope) 247private static async Task WriteRefreshErrorAsync(HttpContext context, int statusCode, string error) 271private async Task ExecuteAsync(HttpContext context, ConnectionDelegate connectionDelegate, HttpConnectionDispatcherOptions options, ConnectionLogScope logScope) 306if (connection.TryActivatePersistentConnection(connectionDelegate, sse, Task.CompletedTask, context, _logger)) 361var reconnectTask = Task.CompletedTask; 378reconnectTask = connection.NotifyOnReconnect?.Invoke(connection.Transport.Output) ?? Task.CompletedTask; 406var resultTask = await Task.WhenAny(connection.ApplicationTask!, connection.TransportTask!); 419await ((Task)connection.TransportTask!).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing); 478private async Task DoPersistentConnection(HttpConnectionContext connection) 481await Task.WhenAny(connection.ApplicationTask!, connection.TransportTask!); 486private async Task ProcessNegotiate(HttpContext context, HttpConnectionDispatcherOptions options, ConnectionLogScope logScope) 616private async Task ProcessSend(HttpContext context) 714private async Task ProcessDeleteAsync(HttpContext context) 1080private async Task WriteUserChangedResponseAsync(ClaimsPrincipal? originalUser, ClaimsPrincipal newUser, HttpContext context)
Internal\HttpConnectionManager.cs (4)
117private async Task ExecuteTimerLoop() 190var tasks = new List<Task>(_connections.Count); 200Task.WaitAll(tasks.ToArray(), TimeSpan.FromSeconds(5)); 203internal async Task DisposeAndRemoveAsync(HttpConnectionContext connection, bool closeGracefully, HttpConnectionStopStatus status)
Internal\Transports\IHttpTransport.cs (1)
13/// <returns>A <see cref="Task"/> that completes when the transport has finished processing</returns>
Internal\Transports\WebSocketsServerTransport.cs (13)
60public async Task ProcessSocketAsync(WebSocket socket) 64var receiving = StartReceiving(socket); 65var sending = StartSending(socket, ignoreFirstCancel); 68var trigger = await Task.WhenAny(receiving, sending); 83var resultTask = await Task.WhenAny(sending, Task.Delay(_options.CloseTimeout, delayCts.Token)); 111var resultTask = await Task.WhenAny(receiving, Task.Delay(_options.CloseTimeout, delayCts.Token)); 131private async Task StartReceiving(WebSocket socket) 200private async Task StartSending(WebSocket socket, bool ignoreFirstCancel)
ServerSentEventsMessageFormatter.cs (2)
15public static async Task WriteMessageAsync(ReadOnlySequence<byte> payload, Stream output, CancellationToken token) 66private static async Task WriteMessageToMemory(Stream output, ReadOnlySequence<byte> payload)
src\aspnetcore\src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
src\aspnetcore\src\SignalR\common\Shared\AwaitableThreadPool.cs (1)
29Task.Run(continuation);
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
src\aspnetcore\src\SignalR\common\Shared\PipeWriterStream.cs (2)
56public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 72return new ValueTask(Task.FromCanceled(cancellationToken));
src\aspnetcore\src\SignalR\common\Shared\TaskCache.cs (2)
8public static readonly Task<bool> True = Task.FromResult(true); 9public static readonly Task<bool> False = Task.FromResult(false);
Microsoft.AspNetCore.Http.Connections.Client (55)
HttpConnection.cs (12)
35private static readonly Task<string?> _noAccessToken = Task.FromResult<string?>(null); 186/// <returns>A <see cref="Task"/> that represents the asynchronous start.</returns> 192public Task StartAsync(CancellationToken cancellationToken = default) 202/// <returns>A <see cref="Task"/> that represents the asynchronous start.</returns> 208public async Task StartAsync(TransferFormat transferFormat, CancellationToken cancellationToken = default) 216private async Task StartAsyncCore(TransferFormat transferFormat, CancellationToken cancellationToken) 253/// <returns>A <see cref="Task"/> that represents the asynchronous dispose.</returns> 266private async Task DisposeAsyncCore() 312private async Task SelectAndStartTransport(TransferFormat transferFormat, CancellationToken cancellationToken) 350_accessTokenProvider = () => Task.FromResult<string?>(accessToken); 538private async Task StartTransport(Uri connectUrl, HttpTransportType transportType, TransferFormat transferFormat, 804_accessTokenProvider = () => Task.FromResult<string?>(accessToken);
Internal\ITransport.cs (2)
14Task StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken = default); 15Task StopAsync();
Internal\LongPollingTransport.cs (11)
30internal Task Running { get; private set; } = Task.CompletedTask; 43public async Task StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken = default) 71private async Task ProcessAsync(Uri url) 76var receiving = Poll(url, _transportCts.Token); 77var sending = SendUtils.SendMessages(url, _application, _httpClient, _logger); 80var trigger = await Task.WhenAny(receiving, sending).ConfigureAwait(false); 113public async Task StopAsync() 141private async Task Poll(Uri pollUrl, CancellationToken cancellationToken) 228private async Task SendDeleteRequest(Uri url)
Internal\SendUtils.cs (2)
19public static async Task SendMessages(Uri sendUrl, IDuplexPipe application, HttpClient httpClient, ILogger logger, CancellationToken cancellationToken = default) 100protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context)
Internal\ServerSentEventsTransport.cs (10)
31internal Task Running { get; private set; } = Task.CompletedTask; 46public async Task StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken = default) 88private async Task ProcessAsync(Uri url, HttpResponseMessage response) 93var receiving = ProcessEventStream(response, _transportCts.Token); 94var sending = SendUtils.SendMessages(url, _application, _httpClient, _logger, _inputCts.Token); 97var trigger = await Task.WhenAny(receiving, sending).ConfigureAwait(false); 126private async Task ProcessEventStream(HttpResponseMessage response, CancellationToken cancellationToken) 174public async Task StopAsync()
Internal\WebSocketsTransport.cs (16)
47private Func<PipeWriter, Task>? _notifyOnReconnect; 49internal Task Running { get; private set; } = Task.CompletedTask; 56public void OnReconnected(Func<PipeWriter, Task> notifyOnReconnect) 287public async Task StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken = default) 337private async Task ProcessSocketAsync(WebSocket socket, Uri url, bool isReconnect) 344var receiving = StartReceiving(socket); 345var sending = StartSending(socket, ignoreFirstCanceled: isReconnect); 354var trigger = await Task.WhenAny(receiving, sending).ConfigureAwait(false); 367var resultTask = await Task.WhenAny(sending, Task.Delay(_closeTimeout, _stopCts.Token)).ConfigureAwait(false); 433private async Task StartReceiving(WebSocket socket) 530private async Task StartSending(WebSocket socket, bool ignoreFirstCanceled) 655public async Task StopAsync()
src\aspnetcore\src\SignalR\common\Shared\PipeWriterStream.cs (2)
56public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 72return new ValueTask(Task.FromCanceled(cancellationToken));
Microsoft.AspNetCore.Http.Extensions (79)
HttpResponseJsonExtensions.cs (14)
36public static Task WriteAsJsonAsync<TValue>( 58public static Task WriteAsJsonAsync<TValue>( 80public static Task WriteAsJsonAsync<TValue>( 113public static Task WriteAsJsonAsync<TValue>( 132static async Task WriteAsJsonAsyncSlow(HttpResponse response, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, 154public static Task WriteAsJsonAsync( 174static async Task WriteAsJsonAsyncSlow(HttpResponse response, object? value, JsonTypeInfo jsonTypeInfo, 187private static async Task WriteAsJsonAsyncSlow<TValue>( 211public static Task WriteAsJsonAsync( 234public static Task WriteAsJsonAsync( 257public static Task WriteAsJsonAsync( 284private static async Task WriteAsJsonAsyncSlow( 309public static Task WriteAsJsonAsync( 331static async Task WriteAsJsonAsyncSlow(PipeWriter body, object? value, Type type, JsonSerializerContext context,
RequestDelegateFactory.cs (44)
105private static readonly MemberExpression CompletedTaskExpr = Expression.Property(null, (PropertyInfo)GetMemberInfo<Func<Task>>(() => Task.CompletedTask)); 314private static Func<object?, HttpContext, Task>? CreateTargetableRequestDelegate( 529if (returnType == typeof(Task)) 1112if (returnType == typeof(Task)) 1263private static Func<object?, HttpContext, Task> HandleRequestBodyAndCompileRequestDelegate(Expression responseWritingMethodCall, RequestDelegateFactoryContext factoryContext) 1270var continuation = Expression.Lambda<Func<object?, HttpContext, object?[], Task>>( 1290return Expression.Lambda<Func<object?, HttpContext, Task>>( 1304private static Func<object?, HttpContext, Task> HandleRequestBodyAndCompileRequestDelegateForJson(Expression responseWritingMethodCall, RequestDelegateFactoryContext factoryContext) 1318var continuation = Expression.Lambda<Func<object?, HttpContext, object?, object?[], Task>>( 1355var continuation = Expression.Lambda<Func<object?, HttpContext, object?, Task>>( 1459private static Func<object?, HttpContext, Task> HandleRequestBodyAndCompileRequestDelegateForForm( 1475var continuation = Expression.Lambda<Func<object?, HttpContext, object?, object?[], Task>>( 1509var continuation = Expression.Lambda<Func<object?, HttpContext, object?, Task>>( 2472private static Task ExecuteValueTaskOfObject(ValueTask<object> valueTask, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2474static async Task ExecuteAwaited(ValueTask<object> valueTask, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2487private static Task ExecuteTaskOfObject(Task<object> task, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2489static async Task ExecuteAwaited(Task<object> task, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2502private static Task ExecuteAwaitedReturn(object obj, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2507private static Task ExecuteTaskOfTFast<T>(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2511static async Task ExecuteAwaited(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2524private static Task ExecuteTaskOfT<T>(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2528static async Task ExecuteAwaited(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2541private static Task ExecuteTaskOfString(Task<string?> task, HttpContext httpContext) 2546static async Task ExecuteAwaited(Task<string> task, HttpContext httpContext) 2559private static Task ExecuteWriteStringResponseAsync(HttpContext httpContext, string text) 2565private static Task ExecuteValueTask(ValueTask task) 2567static async Task ExecuteAwaited(ValueTask task) 2575return Task.CompletedTask; 2581private static ValueTask<object?> ExecuteTaskWithEmptyResult(Task task) 2583static async ValueTask<object?> ExecuteAwaited(Task task) 2614private static Task ExecuteValueTaskOfTFast<T>(ValueTask<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2616static async Task ExecuteAwaited(ValueTask<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2629private static Task ExecuteValueTaskOfT<T>(ValueTask<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2631static async Task ExecuteAwaited(ValueTask<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2644private static Task ExecuteValueTaskOfString(ValueTask<string?> task, HttpContext httpContext) 2648static async Task ExecuteAwaited(ValueTask<string> task, HttpContext httpContext) 2661private static Task ExecuteValueTaskResult<T>(ValueTask<T?> task, HttpContext httpContext) where T : IResult 2663static async Task ExecuteAwaited(ValueTask<T> task, HttpContext httpContext) 2676private static async Task ExecuteTaskResult<T>(Task<T?> task, HttpContext httpContext) where T : IResult 2683private static async Task ExecuteResultWriteResponse(IResult? result, HttpContext httpContext) 2690private static Task WriteJsonResponseFast<T>(HttpResponse response, T value, JsonTypeInfo<T> jsonTypeInfo) 2693private static Task WriteJsonResponse<T>(HttpResponse response, T? value, JsonTypeInfo<T> jsonTypeInfo) 2888private static void EnsureRequestTaskNotNull(Task? task)
SendFileResponseExtensions.cs (6)
25public static Task SendFileAsync(this HttpResponse response, IFileInfo file, CancellationToken cancellationToken = default) 43public static Task SendFileAsync(this HttpResponse response, IFileInfo file, long offset, long? count, CancellationToken cancellationToken = default) 59public static Task SendFileAsync(this HttpResponse response, string fileName, CancellationToken cancellationToken = default) 77public static Task SendFileAsync(this HttpResponse response, string fileName, long offset, long? count, CancellationToken cancellationToken = default) 85private static async Task SendFileAsyncCore(HttpResponse response, IFileInfo file, long offset, long? count, CancellationToken cancellationToken) 112private static async Task SendFileAsyncCore(HttpResponse response, string fileName, long offset, long? count, CancellationToken cancellationToken = default)
src\aspnetcore\src\Http\Shared\StreamCopyOperationInternal.cs (2)
20public static Task CopyToAsync(Stream source, Stream destination, long? count, CancellationToken cancel) 32public static async Task CopyToAsync(Stream source, Stream destination, long? count, int bufferSize, CancellationToken cancel)
src\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
400if (methodReturnType == typeof(Task) || methodReturnType == typeof(ValueTask)) 415if (currentType == typeof(Task)) 471(awaitable) => ((Task)awaitable).GetAwaiter(),
src\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (6)
39/// or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>. 49/// to a <see cref="Task{TResult}"/>, or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>; 53/// When this method returns, contains the type of the closed generic instantiation of <see cref="Task{TResult}"/> or of <see cref="Task"/> that will be returned 114/// to a void-returning <see cref="Task"/> or <see cref="ValueTask"/>. 145var typeDef when typeDef == typeof(Task<>) && IsFSharpUnit(genericAwaitableType.GetGenericArguments()[0]) => (typeof(Task), MakeTaskOfUnitToTaskExpression(genericAwaitableType)), 155return Expression.Lambda(Expression.Convert(closedGenericTaskParam, typeof(Task)), closedGenericTaskParam);
src\aspnetcore\src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (2)
12public static Task ExecuteReturnAsync(object obj, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 39public static Task WriteJsonResponseAsync<T>(HttpResponse response, T? value, JsonTypeInfo<T> jsonTypeInfo)
StreamCopyOperation.cs (2)
18public static Task CopyToAsync(Stream source, Stream destination, long? count, CancellationToken cancel) 28public static Task CopyToAsync(Stream source, Stream destination, long? count, int bufferSize, CancellationToken cancel)
Microsoft.AspNetCore.Http.Features (9)
IFormFile.cs (1)
67Task CopyToAsync(Stream target, CancellationToken cancellationToken = default(CancellationToken));
IHttpResponseBodyFeature.cs (3)
31Task StartAsync(CancellationToken cancellationToken = default); 41Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellationToken = default); 48Task CompleteAsync();
IHttpResponseFeature.cs (3)
45/// <see cref="OnStarting(Func{object, Task}, object)"/> should no longer be called. 59void OnStarting(Func<object, Task> callback, object state); 67void OnCompleted(Func<object, Task> callback, object state);
ISession.cs (2)
34Task LoadAsync(CancellationToken cancellationToken = default(CancellationToken)); 40Task CommitAsync(CancellationToken cancellationToken = default(CancellationToken));
Microsoft.AspNetCore.Http.Results (81)
Accepted.cs (2)
59public Task ExecuteAsync(HttpContext httpContext) 75return Task.CompletedTask;
AcceptedAtRoute.cs (2)
77public Task ExecuteAsync(HttpContext httpContext) 102return Task.CompletedTask;
AcceptedAtRouteOfT.cs (1)
91public Task ExecuteAsync(HttpContext httpContext)
AcceptedOfT.cs (1)
75public Task ExecuteAsync(HttpContext httpContext)
BadRequest.cs (2)
34public Task ExecuteAsync(HttpContext httpContext) 45return Task.CompletedTask;
BadRequestOfT.cs (1)
45public Task ExecuteAsync(HttpContext httpContext)
ChallengeHttpResult.cs (1)
70public async Task ExecuteAsync(HttpContext httpContext)
Conflict.cs (2)
34public Task ExecuteAsync(HttpContext httpContext) 45return Task.CompletedTask;
ConflictOfT.cs (1)
45public Task ExecuteAsync(HttpContext httpContext)
ContentHttpResult.cs (1)
58public Task ExecuteAsync(HttpContext httpContext)
Created.cs (2)
59public Task ExecuteAsync(HttpContext httpContext) 75return Task.CompletedTask;
CreatedAtRoute.cs (2)
77public Task ExecuteAsync(HttpContext httpContext) 102return Task.CompletedTask;
CreatedAtRouteOfT.cs (1)
91public Task ExecuteAsync(HttpContext httpContext)
CreatedOfT.cs (1)
74public Task ExecuteAsync(HttpContext httpContext)
FileContentHttpResult.cs (2)
107public Task ExecuteAsync(HttpContext httpContext) 126Task.CompletedTask :
FileStreamHttpResult.cs (1)
113public async Task ExecuteAsync(HttpContext httpContext)
ForbidHttpResult.cs (1)
81public async Task ExecuteAsync(HttpContext httpContext)
HttpResultsHelper.cs (4)
26public static Task WriteResultAsJsonAsync<TValue>( 35return Task.CompletedTask; 69public static Task WriteResultAsContentAsync( 94return Task.CompletedTask;
InternalServerError.cs (2)
34public Task ExecuteAsync(HttpContext httpContext) 45return Task.CompletedTask;
InternalServerErrorOfT.cs (1)
45public Task ExecuteAsync(HttpContext httpContext)
JsonHttpResultOfT.cs (2)
92public Task ExecuteAsync(HttpContext httpContext) 108return Task.CompletedTask;
NoContent.cs (2)
33public Task ExecuteAsync(HttpContext httpContext) 45return Task.CompletedTask;
NotFound.cs (2)
33public Task ExecuteAsync(HttpContext httpContext) 44return Task.CompletedTask;
NotFoundOfT.cs (1)
44public Task ExecuteAsync(HttpContext httpContext)
Ok.cs (2)
33public Task ExecuteAsync(HttpContext httpContext) 44return Task.CompletedTask;
OkOfT.cs (1)
44public Task ExecuteAsync(HttpContext httpContext)
PhysicalFileHttpResult.cs (3)
108public Task ExecuteAsync(HttpContext httpContext) 136Task.CompletedTask : 140private static Task ExecuteCoreAsync(HttpContext httpContext, RangeItemHeaderValue? range, long rangeLength, string fileName)
ProblemHttpResult.cs (1)
52public async Task ExecuteAsync(HttpContext httpContext)
PushStreamHttpResult.cs (6)
16private readonly Func<Stream, Task> _streamWriterCallback; 24internal PushStreamHttpResult(Func<Stream, Task> streamWriterCallback, string? contentType) 38Func<Stream, Task> streamWriterCallback, 55Func<Stream, Task> streamWriterCallback, 101public Task ExecuteAsync(HttpContext httpContext) 120Task.CompletedTask :
RedirectHttpResult.cs (2)
89public Task ExecuteAsync(HttpContext httpContext) 121return Task.CompletedTask;
RedirectToRouteHttpResult.cs (2)
157public Task ExecuteAsync(HttpContext httpContext) 190return Task.CompletedTask;
Results.cs (1)
453Func<Stream, Task> streamWriterCallback,
ResultsOfT.Generated.cs (5)
40public Task ExecuteAsync(HttpContext httpContext) 104public Task ExecuteAsync(HttpContext httpContext) 177public Task ExecuteAsync(HttpContext httpContext) 259public Task ExecuteAsync(HttpContext httpContext) 350public Task ExecuteAsync(HttpContext httpContext)
ServerSentEventsResult.cs (1)
39public async Task ExecuteAsync(HttpContext httpContext)
SignInHttpResult.cs (1)
56public Task ExecuteAsync(HttpContext httpContext)
SignOutHttpResult.cs (1)
70public async Task ExecuteAsync(HttpContext httpContext)
src\aspnetcore\src\Http\Shared\StreamCopyOperationInternal.cs (2)
20public static Task CopyToAsync(Stream source, Stream destination, long? count, CancellationToken cancel) 32public static async Task CopyToAsync(Stream source, Stream destination, long? count, int bufferSize, CancellationToken cancel)
src\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (2)
29internal static async Task WriteFileAsync(HttpContext context, Stream fileStream, RangeItemHeaderValue? range, long rangeLength) 56internal static async Task WriteFileAsync(HttpContext context, ReadOnlyMemory<byte> buffer, RangeItemHeaderValue? range, long rangeLength)
StatusCodeHttpResult.cs (2)
37public Task ExecuteAsync(HttpContext httpContext) 48return Task.CompletedTask;
TypedResults.cs (1)
473Func<Stream, Task> streamWriterCallback,
UnauthorizedHttpResult.cs (2)
33public Task ExecuteAsync(HttpContext httpContext) 44return Task.CompletedTask;
UnprocessableEntity.cs (2)
34public Task ExecuteAsync(HttpContext httpContext) 45return Task.CompletedTask;
UnprocessableEntityOfT.cs (1)
45public Task ExecuteAsync(HttpContext httpContext)
Utf8ContentHttpResult.cs (1)
49public Task ExecuteAsync(HttpContext httpContext)
ValidationProblem.cs (1)
52public async Task ExecuteAsync(HttpContext httpContext)
VirtualFileHttpResult.cs (3)
102public Task ExecuteAsync(HttpContext httpContext) 131Task.CompletedTask : 135private static Task ExecuteCoreAsync(HttpContext httpContext, RangeItemHeaderValue? range, long rangeLength, IFileInfo fileInfo)
Microsoft.AspNetCore.HttpLogging (20)
BufferingStream.cs (2)
226public override Task FlushAsync(CancellationToken cancellationToken) 256public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
FileLoggerProcessor.cs (8)
31private readonly Task _outputTask; 103_outputTask = Task.Run(ProcessLogQueue); 119private async Task ProcessLogQueue() 144await Task.Delay(_flushInterval, _cancellationTokenSource.Token); 155private async Task WriteMessagesAsync(List<string> messages, CancellationToken cancellationToken) 260internal virtual async Task WriteMessageAsync(string message, StreamWriter streamWriter, CancellationToken cancellationToken) 333public virtual Task OnFirstWrite(StreamWriter streamWriter, CancellationToken cancellationToken) 335return Task.CompletedTask;
HttpLoggingMiddleware.cs (2)
53public Task Invoke(HttpContext context) 74private async Task InvokeInternal(HttpContext context, HttpLoggingOptions options,
ResponseBufferingStream.cs (5)
114public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 193public async Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellation) 199public async Task StartAsync(CancellationToken token = default) 205public async Task CompleteAsync() 217public override async Task FlushAsync(CancellationToken cancellationToken)
W3CLoggerProcessor.cs (2)
25public override async Task OnFirstWrite(StreamWriter streamWriter, CancellationToken cancellationToken) 120internal override Task WriteMessageAsync(string message, StreamWriter streamWriter, CancellationToken cancellationToken)
W3CLoggingMiddleware.cs (1)
70public async Task Invoke(HttpContext context)
Microsoft.AspNetCore.HttpOverrides (8)
CertificateForwardingFeature.cs (3)
28set => _certificateTask = value is not null ? Task.FromResult<X509Certificate2?>(value) : null; 38_certificateTask = Task.FromResult<X509Certificate2?>(certificate); 44return Task.FromResult<X509Certificate2?>(null);
CertificateForwardingMiddleware.cs (2)
46/// <returns>A <see cref="Task"/>.</returns> 47public Task Invoke(HttpContext httpContext)
ForwardedHeadersMiddleware.cs (1)
110public Task Invoke(HttpContext context)
HttpMethodOverrideMiddleware.cs (2)
36public Task Invoke(HttpContext context) 59private async Task InvokeCore(HttpContext context)
Microsoft.AspNetCore.HttpsPolicy (3)
HstsMiddleware.cs (1)
62public Task Invoke(HttpContext context)
HttpsRedirectionMiddleware.cs (2)
78public Task Invoke(HttpContext context) 114return Task.CompletedTask;
Microsoft.AspNetCore.Identity (65)
_generated\0\GeneratedRouteBuilderExtensions.g.cs (23)
113async Task RequestHandler(HttpContext httpContext) 141async Task RequestHandlerFiltered(HttpContext httpContext) 233async Task RequestHandler(HttpContext httpContext) 294async Task RequestHandlerFiltered(HttpContext httpContext) 417async Task RequestHandler(HttpContext httpContext) 444async Task RequestHandlerFiltered(HttpContext httpContext) 533async Task RequestHandler(HttpContext httpContext) 575async Task RequestHandlerFiltered(HttpContext httpContext) 680async Task RequestHandler(HttpContext httpContext) 708async Task RequestHandlerFiltered(HttpContext httpContext) 798async Task RequestHandler(HttpContext httpContext) 825async Task RequestHandlerFiltered(HttpContext httpContext) 914async Task RequestHandler(HttpContext httpContext) 941async Task RequestHandlerFiltered(HttpContext httpContext) 1031async Task RequestHandler(HttpContext httpContext) 1059async Task RequestHandlerFiltered(HttpContext httpContext) 1147async Task RequestHandler(HttpContext httpContext) 1168async Task RequestHandlerFiltered(HttpContext httpContext) 1253async Task RequestHandler(HttpContext httpContext) 1282async Task RequestHandlerFiltered(HttpContext httpContext) 1359private static Task ExecuteReturnAsync(object? obj, HttpContext httpContext, JsonTypeInfo<object?> jsonTypeInfo) 1378private static Task WriteJsonResponseAsync<T>(HttpResponse response, T? value, JsonTypeInfo<T?> jsonTypeInfo) 1475private static Task ExecuteAsyncExplicit(IResult result, HttpContext httpContext)
DataProtectorTokenProvider.cs (1)
189return Task.FromResult(false);
IdentityApiEndpointRouteBuilderExtensions.cs (1)
390async Task SendConfirmationEmailAsync(TUser user, UserManager<TUser> userManager, HttpContext context, string email, bool isChange = false)
IdentityCookiesBuilderExtensions.cs (1)
105OnRedirectToReturnUrl = _ => Task.CompletedTask
IdentityServiceCollectionExtensions.cs (3)
85OnRedirectToReturnUrl = _ => Task.CompletedTask 224protected override Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 229protected override Task HandleSignOutAsync(AuthenticationProperties? properties)
IEmailSender.cs (1)
20Task SendEmailAsync(string email, string subject, string htmlMessage);
IEmailSenderOfT.cs (3)
20Task SendConfirmationLinkAsync(TUser user, string email, string confirmationLink); 30Task SendPasswordResetLinkAsync(TUser user, string email, string resetLink); 40Task SendPasswordResetCodeAsync(TUser user, string email, string resetCode);
ISecurityStampValidator.cs (2)
21/// <returns>The <see cref="Task"/> that represents the asynchronous validation operation.</returns> 22Task ValidateAsync(CookieValidatePrincipalContext context);
NoOpEmailSender.cs (3)
14/// This method does nothing other return <see cref="Task.CompletedTask"/>. It should be replaced by a custom implementation 17public Task SendEmailAsync(string email, string subject, string htmlMessage) => Task.CompletedTask;
PasskeyHandler.cs (1)
567private async Task VerifyClientDataAsync(
SecurityStampValidator.cs (6)
92protected virtual async Task SecurityStampVerified(TUser user, CookieValidatePrincipalContext context) 135/// <returns>The <see cref="Task"/> that represents the asynchronous validation operation.</returns> 136public virtual async Task ValidateAsync(CookieValidatePrincipalContext context) 182/// <returns>The <see cref="Task"/> that represents the asynchronous validation operation.</returns> 183public static Task ValidatePrincipalAsync(CookieValidatePrincipalContext context) 195public static Task ValidateAsync<TValidator>(CookieValidatePrincipalContext context) where TValidator : ISecurityStampValidator
SecurityStampValidatorOptions.cs (1)
22public Func<SecurityStampRefreshingPrincipalContext, Task>? OnRefreshingPrincipal { get; set; }
SignInManager.cs (14)
180public virtual async Task RefreshSignInAsync(TUser user) 242public virtual Task SignInAsync(TUser user, bool isPersistent, string? authenticationMethod = null) 253public virtual Task SignInAsync(TUser user, AuthenticationProperties authenticationProperties, string? authenticationMethod = null) 271public virtual Task SignInWithClaimsAsync(TUser user, bool isPersistent, IEnumerable<Claim> additionalClaims) 281public virtual async Task SignInWithClaimsAsync(TUser user, AuthenticationProperties? authenticationProperties, IEnumerable<Claim> additionalClaims) 311public virtual async Task SignOutAsync() 717private async Task StorePasskeyAuthenticationInfoAsync(string operation, string? state) 782public virtual async Task RememberTwoFactorClientAsync(TUser user) 803public virtual async Task ForgetTwoFactorClientAsync() 1145/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the operation.</returns> 1330return Task.FromResult(SignInResult.LockedOut); 1355/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the operation.</returns> 1356protected virtual async Task ResetLockout(TUser user) 1385var resetLockoutTask = ResetLockout(user);
src\aspnetcore\src\Shared\DefaultMessageEmailSender.cs (3)
12public Task SendConfirmationLinkAsync(TUser user, string email, string confirmationLink) => 15public Task SendPasswordResetLinkAsync(TUser user, string email, string resetLink) => 18public Task SendPasswordResetCodeAsync(TUser user, string email, string resetCode) =>
TwoFactorSecurityStampValidator.cs (2)
52protected override Task SecurityStampVerified(TUser user, CookieValidatePrincipalContext context) 53=> Task.CompletedTask;
Microsoft.AspNetCore.Identity.EntityFrameworkCore (89)
RoleStore.cs (16)
115/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 116protected virtual async Task SaveChanges(CancellationToken cancellationToken) 199return Task.FromResult(ConvertIdToString(role.Id)!); 213return Task.FromResult(role.Name); 222/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 223public virtual Task SetRoleNameAsync(TRole role, string? roleName, CancellationToken cancellationToken = default(CancellationToken)) 229return Task.CompletedTask; 298return Task.FromResult(role.NormalizedName); 307/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 308public virtual Task SetNormalizedRoleNameAsync(TRole role, string? normalizedName, CancellationToken cancellationToken = default(CancellationToken)) 314return Task.CompletedTask; 350/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 351public virtual Task AddClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken)) 358return Task.FromResult(false); 367/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 368public virtual async Task RemoveClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken))
UserOnlyStore.cs (34)
180/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 181protected Task SaveChanges(CancellationToken cancellationToken) 183return AutoSaveChanges ? Context.SaveChangesAsync(cancellationToken) : Task.CompletedTask; 191/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the creation operation.</returns> 207/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the update operation.</returns> 233/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the update operation.</returns> 258/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="userId"/> if it exists. 274/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="normalizedUserName"/> if it exists. 348/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 349public override Task AddClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)) 358return Task.FromResult(false); 368/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 369public override async Task ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = default(CancellationToken)) 390/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 391public override async Task RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)) 412/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 413public override Task AddLoginAsync(TUser user, UserLoginInfo login, 421return Task.FromResult(false); 431/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 432public override async Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey, 451/// The <see cref="Task"/> for the asynchronous operation, containing a list of <see cref="UserLoginInfo"/> for the specified <paramref name="user"/>, if any. 470/// The <see cref="Task"/> for the asynchronous operation, containing the user, if any which matched the specified login provider and key. 507/// The <see cref="Task"/> contains a list of users, if any, that contain the specified claim. 540protected override Task AddUserTokenAsync(TUserToken token) 543return Task.CompletedTask; 551protected override Task RemoveUserTokenAsync(TUserToken token) 554return Task.CompletedTask; 617/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 618public virtual async Task AddOrUpdatePasskeyAsync(TUser user, UserPasskeyInfo passkey, CancellationToken cancellationToken) 645/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing a list of the user's passkeys.</returns> 668/// The <see cref="Task"/> that represents the asynchronous operation, containing the user, if any, associated with the specified passkey credential id. 689/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the user's passkey information.</returns> 707/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 708public virtual async Task RemovePasskeyAsync(TUser user, byte[] credentialId, CancellationToken cancellationToken)
UserStore.cs (39)
184/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 185protected Task SaveChanges(CancellationToken cancellationToken) 187return AutoSaveChanges ? Context.SaveChangesAsync(cancellationToken) : Task.CompletedTask; 195/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the creation operation.</returns> 211/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the update operation.</returns> 237/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the update operation.</returns> 262/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="userId"/> if it exists. 278/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="normalizedUserName"/> if it exists. 361/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 362public override async Task AddToRoleAsync(TUser user, string normalizedRoleName, CancellationToken cancellationToken = default(CancellationToken)) 383/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 384public override async Task RemoveFromRoleAsync(TUser user, string normalizedRoleName, CancellationToken cancellationToken = default(CancellationToken)) 465/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 466public override Task AddClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)) 475return Task.FromResult(false); 485/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 486public override async Task ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = default(CancellationToken)) 507/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 508public override async Task RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)) 529/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 530public override Task AddLoginAsync(TUser user, UserLoginInfo login, 538return Task.FromResult(false); 548/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 549public override async Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey, 568/// The <see cref="Task"/> for the asynchronous operation, containing a list of <see cref="UserLoginInfo"/> for the specified <paramref name="user"/>, if any. 587/// The <see cref="Task"/> for the asynchronous operation, containing the user, if any which matched the specified login provider and key. 624/// The <see cref="Task"/> contains a list of users, if any, that contain the specified claim. 647/// The <see cref="Task"/> contains a list of users, if any, that are in the specified role. 685protected override Task AddUserTokenAsync(TUserToken token) 688return Task.CompletedTask; 696protected override Task RemoveUserTokenAsync(TUserToken token) 699return Task.CompletedTask; 762/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 763public virtual async Task AddOrUpdatePasskeyAsync(TUser user, UserPasskeyInfo passkey, CancellationToken cancellationToken) 790/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing a list of the user's passkeys.</returns> 813/// The <see cref="Task"/> that represents the asynchronous operation, containing the user, if any, associated with the specified passkey credential id. 834/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the user's passkey information.</returns> 852/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 853public virtual async Task RemovePasskeyAsync(TUser user, byte[] credentialId, CancellationToken cancellationToken)
Microsoft.AspNetCore.Identity.UI (104)
_generated\0\AccessDenied_cshtml.g.cs (1)
30public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\1\ConfirmEmail_cshtml.g.cs (1)
52public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\10\Logout_cshtml.g.cs (1)
56public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\11\ChangePassword_cshtml.g.cs (1)
72public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\12\DeletePersonalData_cshtml.g.cs (1)
71public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\13\Disable2fa_cshtml.g.cs (1)
64public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\14\DownloadPersonalData_cshtml.g.cs (1)
58public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\15\Email_cshtml.g.cs (1)
79public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\16\EnableAuthenticator_cshtml.g.cs (1)
71public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\17\ExternalLogins_cshtml.g.cs (1)
69public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\18\GenerateRecoveryCodes_cshtml.g.cs (1)
64public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\19\Index_cshtml.g.cs (1)
69public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\2\ConfirmEmailChange_cshtml.g.cs (1)
52public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\20\PersonalData_cshtml.g.cs (1)
69public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\21\ResetAuthenticator_cshtml.g.cs (1)
63public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\22\SetPassword_cshtml.g.cs (1)
70public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\23\ShowRecoveryCodes_cshtml.g.cs (1)
58public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\24\TwoFactorAuthentication_cshtml.g.cs (1)
77public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\25\_Layout_cshtml.g.cs (1)
58public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\26\_ManageNav_cshtml.g.cs (1)
69public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\27\_StatusMessage_cshtml.g.cs (1)
44public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\28\_ViewImports_cshtml.g.cs (1)
36public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\29\_ViewStart_cshtml.g.cs (1)
36public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\3\ExternalLogin_cshtml.g.cs (1)
63public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\30\Register_cshtml.g.cs (1)
68public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\31\RegisterConfirmation_cshtml.g.cs (1)
30public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\32\ResendEmailConfirmation_cshtml.g.cs (1)
62public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\33\ResetPassword_cshtml.g.cs (1)
65public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\34\ResetPasswordConfirmation_cshtml.g.cs (1)
52public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\35\_StatusMessage_cshtml.g.cs (1)
38public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\36\_ViewImports_cshtml.g.cs (1)
30public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\37\Error_cshtml.g.cs (1)
24public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\38\_Layout_cshtml.g.cs (1)
92public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\39\_ValidationScriptsPartial_cshtml.g.cs (1)
60public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\4\ForgotPassword_cshtml.g.cs (1)
63public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\40\_ViewImports_cshtml.g.cs (1)
24public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\41\_ViewStart_cshtml.g.cs (1)
24public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\42\AccessDenied_cshtml.g.cs (1)
30public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\43\ConfirmEmail_cshtml.g.cs (1)
52public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\44\ConfirmEmailChange_cshtml.g.cs (1)
52public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\45\ExternalLogin_cshtml.g.cs (1)
66public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\46\ForgotPassword_cshtml.g.cs (1)
66public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\47\ForgotPasswordConfirmation_cshtml.g.cs (1)
30public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\48\Lockout_cshtml.g.cs (1)
30public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\49\Login_cshtml.g.cs (1)
79public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\5\ForgotPasswordConfirmation_cshtml.g.cs (1)
30public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\50\LoginWith2fa_cshtml.g.cs (1)
68public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\51\LoginWithRecoveryCode_cshtml.g.cs (1)
65public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\52\Logout_cshtml.g.cs (1)
56public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\53\ChangePassword_cshtml.g.cs (1)
76public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\54\DeletePersonalData_cshtml.g.cs (1)
73public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\55\Disable2fa_cshtml.g.cs (1)
63public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\56\DownloadPersonalData_cshtml.g.cs (1)
58public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\57\Email_cshtml.g.cs (1)
83public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\58\EnableAuthenticator_cshtml.g.cs (1)
73public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\59\ExternalLogins_cshtml.g.cs (1)
69public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\6\Lockout_cshtml.g.cs (1)
30public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\60\GenerateRecoveryCodes_cshtml.g.cs (1)
63public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\61\Index_cshtml.g.cs (1)
73public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\62\PersonalData_cshtml.g.cs (1)
68public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\63\ResetAuthenticator_cshtml.g.cs (1)
62public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\64\SetPassword_cshtml.g.cs (1)
73public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\65\ShowRecoveryCodes_cshtml.g.cs (1)
58public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\66\TwoFactorAuthentication_cshtml.g.cs (1)
77public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\67\_Layout_cshtml.g.cs (1)
58public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\68\_ManageNav_cshtml.g.cs (1)
69public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\69\_StatusMessage_cshtml.g.cs (1)
44public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\7\Login_cshtml.g.cs (1)
74public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\70\_ViewImports_cshtml.g.cs (1)
36public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\71\_ViewStart_cshtml.g.cs (1)
36public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\72\Register_cshtml.g.cs (1)
71public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\73\RegisterConfirmation_cshtml.g.cs (1)
30public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\74\ResendEmailConfirmation_cshtml.g.cs (1)
65public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\75\ResetPassword_cshtml.g.cs (1)
70public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\76\ResetPasswordConfirmation_cshtml.g.cs (1)
52public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\77\_StatusMessage_cshtml.g.cs (1)
38public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\78\_ViewImports_cshtml.g.cs (1)
30public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\79\Error_cshtml.g.cs (1)
24public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\8\LoginWith2fa_cshtml.g.cs (1)
66public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\80\_Layout_cshtml.g.cs (1)
93public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\81\_ValidationScriptsPartial_cshtml.g.cs (1)
60public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\82\_ViewImports_cshtml.g.cs (1)
24public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\83\_ViewStart_cshtml.g.cs (1)
24public async override global::System.Threading.Tasks.Task ExecuteAsync()
_generated\9\LoginWithRecoveryCode_cshtml.g.cs (1)
62public async override global::System.Threading.Tasks.Task ExecuteAsync()
Areas\Identity\Filters\ExternalLoginsPageFilter.cs (3)
13public async Task OnPageHandlerExecutionAsync(PageHandlerExecutingContext context, PageHandlerExecutionDelegate next) 26public Task OnPageHandlerSelectionAsync(PageHandlerSelectedContext context) 28return Task.CompletedTask;
Areas\Identity\Pages\V4\Account\Login.cshtml.cs (2)
83public virtual Task OnGetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? returnUrl = null) => throw new NotImplementedException(); 103public override async Task OnGetAsync(string? returnUrl = null)
Areas\Identity\Pages\V4\Account\Manage\Email.cshtml.cs (1)
97private async Task LoadAsync(TUser user)
Areas\Identity\Pages\V4\Account\Manage\EnableAuthenticator.cshtml.cs (1)
161private async Task LoadSharedKeyAndQrCodeUriAsync(TUser user)
Areas\Identity\Pages\V4\Account\Manage\Index.cshtml.cs (1)
78private async Task LoadAsync(TUser user)
Areas\Identity\Pages\V4\Account\Register.cshtml.cs (2)
84public virtual Task OnGetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? returnUrl = null) => throw new NotImplementedException(); 117public override async Task OnGetAsync(string? returnUrl = null)
Areas\Identity\Pages\V5\Account\Login.cshtml.cs (2)
83public virtual Task OnGetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? returnUrl = null) => throw new NotImplementedException(); 103public override async Task OnGetAsync(string? returnUrl = null)
Areas\Identity\Pages\V5\Account\Manage\Email.cshtml.cs (1)
97private async Task LoadAsync(TUser user)
Areas\Identity\Pages\V5\Account\Manage\EnableAuthenticator.cshtml.cs (1)
161private async Task LoadSharedKeyAndQrCodeUriAsync(TUser user)
Areas\Identity\Pages\V5\Account\Manage\Index.cshtml.cs (1)
78private async Task LoadAsync(TUser user)
Areas\Identity\Pages\V5\Account\Register.cshtml.cs (2)
84public virtual Task OnGetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? returnUrl = null) => throw new NotImplementedException(); 117public override async Task OnGetAsync(string? returnUrl = null)
src\aspnetcore\src\Shared\DefaultMessageEmailSender.cs (3)
12public Task SendConfirmationLinkAsync(TUser user, string email, string confirmationLink) => 15public Task SendPasswordResetLinkAsync(TUser user, string email, string resetLink) => 18public Task SendPasswordResetCodeAsync(TUser user, string email, string resetCode) =>
Microsoft.AspNetCore.InternalTesting (30)
CollectDumpAttribute.cs (4)
21public Task OnTestStartAsync(TestContext context, CancellationToken cancellationToken) 23return Task.CompletedTask; 26public Task OnTestEndAsync(TestContext context, Exception exception, CancellationToken cancellationToken) 35return Task.CompletedTask;
ExceptionAssertions.cs (5)
50public static async Task<TException> ThrowsAsync<TException>(Func<Task> testCode, string exceptionMessage) 109public static Task<ArgumentException> ThrowsArgumentAsync(Func<Task> testCode, string paramName, string exceptionMessage) 115Func<Task> testCode, 164public static Task<ArgumentException> ThrowsArgumentNullOrEmptyAsync(Func<Task> testCode, string paramName) 188public static Task<ArgumentException> ThrowsArgumentNullOrEmptyStringAsync(Func<Task> testCode, string paramName)
ITestMethodLifecycle.cs (2)
19Task OnTestStartAsync(TestContext context, CancellationToken cancellationToken); 21Task OnTestEndAsync(TestContext context, Exception exception, CancellationToken cancellationToken);
LoggedTest\LoggedTestBase.cs (6)
95public virtual Task InitializeAsync(TestContext context, MethodInfo methodInfo, object[] testMethodArguments, ITestOutputHelper testOutputHelper) 101protected virtual Task InitializeCoreAsync(TestContext context) => Task.CompletedTask; 117Task ITestMethodLifecycle.OnTestStartAsync(TestContext context, CancellationToken cancellationToken) 123Task ITestMethodLifecycle.OnTestEndAsync(TestContext context, Exception exception, CancellationToken cancellationToken) 129return Task.CompletedTask;
src\aspnetcore\src\Shared\TaskExtensions.cs (8)
34public static Task DefaultTimeout(this Task task, int milliseconds = DefaultTimeoutDuration, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 39public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 44public static Task DefaultTimeout(this ValueTask task, int milliseconds = DefaultTimeoutDuration, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 49public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 109public static async Task TimeoutAfter(this Task task, TimeSpan timeout,
xunit\AspNetTestAssemblyRunner.cs (2)
33protected override async Task AfterTestAssemblyStartingAsync() 85protected override async Task BeforeTestAssemblyFinishedAsync()
xunit\AspNetTestCollectionRunner.cs (2)
33protected override async Task AfterTestCollectionStartingAsync() 48protected override Task BeforeTestCollectionFinishedAsync()
xunit\AspNetTestRunner.cs (1)
97await Task.Delay(5000).ConfigureAwait(false);
Microsoft.AspNetCore.Localization (6)
AcceptLanguageHeaderRequestCultureProvider.cs (1)
48return Task.FromResult<ProviderCultureResult?>(new ProviderCultureResult(orderedLanguages));
CookieRequestCultureProvider.cs (1)
42return Task.FromResult<ProviderCultureResult?>(providerResultCulture);
QueryStringRequestCultureProvider.cs (1)
69return Task.FromResult<ProviderCultureResult?>(providerResultCulture);
RequestCultureProvider.cs (1)
18protected static readonly Task<ProviderCultureResult?> NullProviderCultureResult = Task.FromResult(default(ProviderCultureResult));
RequestLocalizationMiddleware.cs (2)
46/// <returns>A <see cref="Task"/> that completes when the middleware has completed processing.</returns> 47public async Task Invoke(HttpContext context)
Microsoft.AspNetCore.Localization.Routing (1)
RouteDataRequestCultureProvider.cs (1)
64return Task.FromResult<ProviderCultureResult?>(providerResultCulture);
Microsoft.AspNetCore.MiddlewareAnalysis (1)
AnalysisMiddleware.cs (1)
44public async Task Invoke(HttpContext httpContext)
Microsoft.AspNetCore.Mvc.Abstractions (31)
Abstractions\IActionInvoker.cs (2)
18/// <returns>A <see cref="Task"/> which will complete when action processing has completed.</returns> 19Task InvokeAsync();
Filters\ActionExecutionDelegate.cs (1)
11/// A <see cref="Task"/> that on completion returns an <see cref="ActionExecutedContext"/>.
Filters\IAsyncActionFilter.cs (2)
18/// <returns>A <see cref="Task"/> that on completion indicates the filter has executed.</returns> 19Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next);
Filters\IAsyncAuthorizationFilter.cs (2)
16/// A <see cref="Task"/> that on completion indicates the filter has executed. 18Task OnAuthorizationAsync(AuthorizationFilterContext context);
Filters\IAsyncExceptionFilter.cs (2)
15/// <returns>A <see cref="Task"/> that on completion indicates the filter has executed.</returns> 16Task OnExceptionAsync(ExceptionContext context);
Filters\IAsyncResourceFilter.cs (2)
21/// A <see cref="Task"/> which will complete when the remainder of the pipeline completes. 23Task OnResourceExecutionAsync(
Filters\IAsyncResultFilter.cs (2)
34/// <returns>A <see cref="Task"/> that on completion indicates the filter has executed.</returns> 35Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next);
Filters\ResourceExecutionDelegate.cs (1)
10/// <returns>A <see cref="Task"/> that on completion returns a <see cref="ResourceExecutedContext"/>.</returns>
Filters\ResultExecutionDelegate.cs (1)
10/// <returns>A <see cref="Task"/> that on completion returns an <see cref="ResultExecutedContext"/>.</returns>
Formatters\IInputFormatter.cs (1)
26/// <returns>A <see cref="Task"/> that on completion deserializes the request body.</returns>
Formatters\InputFormatterResult.cs (9)
13private static readonly Task<InputFormatterResult> _failureAsync = Task.FromResult(_failure); 14private static readonly Task<InputFormatterResult> _noValueAsync = Task.FromResult(_noValue); 59/// Returns a <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating 63/// A <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating the 86/// Returns a <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating 91/// A <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating the 96return Task.FromResult(Success(model)); 113/// Returns a <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating 117/// A <see cref="Task"/> that on completion provides an <see cref="InputFormatterResult"/> indicating the
Formatters\IOutputFormatter.cs (1)
24Task WriteAsync(OutputFormatterWriteContext context);
IActionResult.cs (1)
18Task ExecuteResultAsync(ActionContext context);
ModelBinding\IModelBinder.cs (2)
17/// A <see cref="Task"/> which will complete when the model binding process completes. 28Task BindModelAsync(ModelBindingContext bindingContext);
ModelBinding\IValueProviderFactory.cs (2)
16/// <returns>A <see cref="Task"/> that when completed will add an <see cref="IValueProvider"/> instance 18Task CreateValueProviderAsync(ValueProviderFactoryContext context);
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
ApiResponseTypeProvider.cs (1)
445declaredReturnType == typeof(Task) ||
EndpointMetadataApiDescriptionProvider.cs (1)
468if (returnType.IsAssignableFrom(typeof(Task)) || returnType.IsAssignableFrom(typeof(ValueTask)))
Microsoft.AspNetCore.Mvc.Core (297)
ActionResult.cs (2)
20public virtual Task ExecuteResultAsync(ActionContext context) 23return Task.CompletedTask;
Authorization\AuthorizeFilter.cs (1)
158public virtual async Task OnAuthorizationAsync(AuthorizationFilterContext context)
Builder\ControllerEndpointRouteBuilderExtensions.cs (4)
212var builder = endpoints.MapFallback(context => Task.CompletedTask); 276var builder = endpoints.MapFallback(pattern, context => Task.CompletedTask); 336var builder = endpoints.MapFallback(context => Task.CompletedTask); 402var builder = endpoints.MapFallback(pattern, context => Task.CompletedTask);
ChallengeResult.cs (1)
91public override async Task ExecuteResultAsync(ActionContext context)
ContentResult.cs (1)
31public override Task ExecuteResultAsync(ActionContext context)
ControllerBase.cs (9)
2527/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 2546/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 2574/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 2606/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 2643/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 2682/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 2716/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 2748/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 2785/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns>
Controllers\ControllerBinderDelegate.cs (1)
6internal delegate Task ControllerBinderDelegate(
Controllers\ControllerBinderDelegateProvider.cs (1)
52async Task Bind(ControllerContext controllerContext, object controller, Dictionary<string, object?> arguments)
FileContentResult.cs (1)
62public override Task ExecuteResultAsync(ActionContext context)
FileStreamResult.cs (1)
63public override Task ExecuteResultAsync(ActionContext context)
Filters\ActionFilterAttribute.cs (2)
31public virtual async Task OnActionExecutionAsync( 56public virtual async Task OnResultExecutionAsync(
Filters\ControllerActionFilter.cs (2)
18public Task OnActionExecutionAsync( 47private static async Task ExecuteActionFilter(
Filters\ControllerResultFilter.cs (2)
18public Task OnResultExecutionAsync( 47private static async Task ExecuteResultFilter(
Filters\ExceptionFilterAttribute.cs (2)
17public virtual Task OnExceptionAsync(ExceptionContext context) 22return Task.CompletedTask;
Filters\MiddlewareFilter.cs (1)
22public Task OnResourceExecutionAsync(ResourceExecutingContext context, ResourceExecutionDelegate next)
Filters\ResultFilterAttribute.cs (1)
28public virtual async Task OnResultExecutionAsync(
ForbidResult.cs (1)
91public override async Task ExecuteResultAsync(ActionContext context)
Formatters\HttpNoContentOutputFormatter.cs (3)
25if (context.ObjectType == typeof(void) || context.ObjectType == typeof(Task)) 34public Task WriteAsync(OutputFormatterWriteContext context) 43return Task.CompletedTask;
Formatters\InputFormatter.cs (1)
117/// <returns>A <see cref="Task"/> that on completion deserializes the request body.</returns>
Formatters\OutputFormatter.cs (2)
157public virtual Task WriteAsync(OutputFormatterWriteContext context) 182public abstract Task WriteResponseBodyAsync(OutputFormatterWriteContext context);
Formatters\StreamOutputFormatter.cs (1)
27public async Task WriteAsync(OutputFormatterWriteContext context)
Formatters\StringOutputFormatter.cs (2)
43public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding encoding) 51return Task.CompletedTask;
Formatters\SystemTextJsonOutputFormatter.cs (1)
61public sealed override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
Formatters\TextInputFormatter.cs (1)
59/// <returns>A <see cref="Task"/> that on completion deserializes the request body.</returns>
Formatters\TextOutputFormatter.cs (4)
104public override Task WriteAsync(OutputFormatterWriteContext context) 143return Task.CompletedTask; 153public sealed override Task WriteResponseBodyAsync(OutputFormatterWriteContext context) 169public abstract Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding);
HttpActionResult.cs (1)
29public override Task ExecuteResultAsync(ActionContext context)
Infrastructure\ActionMethodExecutor.cs (3)
198await (Task)executor.Execute(controller, arguments)!; 208await (Task)executor.Execute(controller, arguments)!; 212protected override bool CanExecute(ObjectMethodExecutor executor) => executor.MethodReturnType == typeof(Task);
Infrastructure\ContentResultExecutor.cs (1)
34public virtual async Task ExecuteAsync(ActionContext context, ContentResult result)
Infrastructure\ControllerActionInvoker.cs (27)
61private Task Next(ref State next, ref Scope scope, ref object? state, ref bool isCompleted) 77var task = BindArgumentsAsync(); 130var task = filter.OnActionExecutionAsync(actionExecutingContext, InvokeNextActionFilterAwaitedAsync); 210var task = InvokeNextActionFilterAsync(); 248var task = InvokeActionMethodAsync(); 271return Task.CompletedTask; 283return Task.CompletedTask; 291private Task InvokeNextActionFilterAsync() 301var lastTask = Next(ref next, ref scope, ref state, ref isCompleted); 317return Task.CompletedTask; 319static async Task Awaited(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, object? state, bool isCompleted) 351var task = InvokeNextActionFilterAsync(); 358return Task.FromResult<ActionExecutedContext>(_actionExecutedContext); 360static async Task<ActionExecutedContext> Awaited(ControllerActionInvoker invoker, Task task) 381private Task InvokeActionMethodAsync() 402return Task.CompletedTask; 404static async Task Awaited(ControllerActionInvoker invoker, ValueTask<IActionResult> actionResultValueTask) 409static async Task Logged(ControllerActionInvoker invoker) 456protected override Task InvokeInnerFilterAsync() 467var lastTask = Next(ref next, ref scope, ref state, ref isCompleted); 474return Task.CompletedTask; 480return Task.FromException(ex); 483static async Task Awaited(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, object? state, bool isCompleted) 514private Task BindArgumentsAsync() 522return Task.CompletedTask;
Infrastructure\FileContentResultExecutor.cs (4)
26public virtual Task ExecuteAsync(ActionContext context, FileContentResult result) 43return Task.CompletedTask; 56protected virtual Task WriteFileAsync(ActionContext context, FileContentResult result, RangeItemHeaderValue? range, long rangeLength) 63return Task.CompletedTask;
Infrastructure\FileResultExecutorBase.cs (1)
94protected static async Task WriteFileAsync(HttpContext context, Stream fileStream, RangeItemHeaderValue? range, long rangeLength)
Infrastructure\FileStreamResultExecutor.cs (3)
26public virtual async Task ExecuteAsync(ActionContext context, FileStreamResult result) 65protected virtual Task WriteFileAsync( 76return Task.CompletedTask;
Infrastructure\IActionResultExecutor.cs (2)
27/// <returns>A <see cref="Task"/> which represents the asynchronous operation.</returns> 28Task ExecuteAsync(ActionContext context, TResult result);
Infrastructure\LocalRedirectResultExecutor.cs (2)
36public virtual Task ExecuteAsync(ActionContext context, LocalRedirectResult result) 63return Task.CompletedTask;
Infrastructure\NonDisposableStream.cs (3)
139public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 145public override Task FlushAsync(CancellationToken cancellationToken) 163public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Infrastructure\ObjectResultExecutor.cs (4)
64/// A <see cref="Task"/> which will complete once the <see cref="ObjectResult"/> is written to the response. 66public virtual Task ExecuteAsync(ActionContext context, ObjectResult result) 84private Task ExecuteAsyncCore(ActionContext context, ObjectResult result, Type? objectType, object? value) 114return Task.CompletedTask;
Infrastructure\PhysicalFileResultExecutor.cs (5)
26public virtual Task ExecuteAsync(ActionContext context, PhysicalFileResult result) 54return Task.CompletedTask; 58protected virtual Task WriteFileAsync(ActionContext context, PhysicalFileResult result, RangeItemHeaderValue? range, long rangeLength) 63internal static Task WriteFileAsyncInternal( 75return Task.CompletedTask;
Infrastructure\RedirectResultExecutor.cs (2)
33public virtual Task ExecuteAsync(ActionContext context, RedirectResult result) 60return Task.CompletedTask;
Infrastructure\RedirectToActionResultExecutor.cs (2)
34public virtual Task ExecuteAsync(ActionContext context, RedirectToActionResult result) 66return Task.CompletedTask;
Infrastructure\RedirectToPageResultExecutor.cs (2)
34public virtual Task ExecuteAsync(ActionContext context, RedirectToPageResult result) 66return Task.CompletedTask;
Infrastructure\RedirectToRouteResultExecutor.cs (2)
34public virtual Task ExecuteAsync(ActionContext context, RedirectToRouteResult result) 62return Task.CompletedTask;
Infrastructure\ResourceInvoker.cs (71)
61public virtual Task InvokeAsync() 71Task task; 78return Awaited(this, Task.FromException(exception), scope); 88static async Task Awaited(ResourceInvoker invoker, Task task, IDisposable? scope) 100static async Task Logged(ResourceInvoker invoker) 217private Task InvokeFilterPipelineAsync() 236var lastTask = Next(ref next, ref scope, ref state, ref isCompleted); 243return Task.CompletedTask; 249return Task.FromException(ex); 252static async Task Awaited(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object? state, bool isCompleted) 263protected abstract Task InvokeInnerFilterAsync(); 265protected virtual Task InvokeResultAsync(IActionResult result) 274static async Task Logged(ResourceInvoker invoker, IActionResult result) 293private Task Next(ref State next, ref Scope scope, ref object? state, ref bool isCompleted) 351var task = filter.OnAuthorizationAsync(authorizationContext); 487var task = filter.OnResourceExecutionAsync(resourceExecutingContext, InvokeNextResourceFilterAwaitedAsync); 565var task = InvokeNextResourceFilter(); 609var task = InvokeAlwaysRunResultFilters(); 658var task = InvokeNextExceptionFilterAsync(); 685var task = filter.OnExceptionAsync(exceptionContext); 725var task = InvokeNextExceptionFilterAsync(); 796var task = InvokeAlwaysRunResultFilters(); 813return Task.CompletedTask; 829var task = InvokeResultFilters(); 840var task = InvokeInnerFilterAsync(); 857return Task.CompletedTask; 861var task = InvokeResultFilters(); 890return Task.CompletedTask; 902return Task.CompletedTask; 920var task = InvokeNextResourceFilter(); 927return Task.FromResult<ResourceExecutedContext>(_resourceExecutedContext); 929static async Task<ResourceExecutedContext> Awaited(ResourceInvoker invoker, Task task) 949private Task InvokeNextResourceFilter() 960var lastTask = Next(ref next, ref scope, ref state, ref isCompleted); 976return Task.CompletedTask; 978static async Task Awaited(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object? state, bool isCompleted) 1001private Task InvokeNextExceptionFilterAsync() 1012var lastTask = Next(ref next, ref scope, ref state, ref isCompleted); 1019return Task.CompletedTask; 1025return Task.FromException(ex); 1028static async Task Awaited(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object? state, bool isCompleted) 1049private Task InvokeAlwaysRunResultFilters() 1060var lastTask = ResultNext<IAlwaysRunResultFilter, IAsyncAlwaysRunResultFilter>(ref next, ref scope, ref state, ref isCompleted); 1067return Task.CompletedTask; 1073return Task.FromException(ex); 1076static async Task Awaited(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object? state, bool isCompleted) 1087private Task InvokeResultFilters() 1098var lastTask = ResultNext<IResultFilter, IAsyncResultFilter>(ref next, ref scope, ref state, ref isCompleted); 1105return Task.CompletedTask; 1111return Task.FromException(ex); 1114static async Task Awaited(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object? state, bool isCompleted) 1125private Task ResultNext<TFilter, TFilterAsync>(ref State next, ref Scope scope, ref object? state, ref bool isCompleted) 1184var task = filter.OnResultExecutionAsync(resultExecutingContext, InvokeNextResultFilterAwaitedAsync<TFilter, TFilterAsync>); 1266var task = InvokeNextResultFilterAsync<TFilter, TFilterAsync>(); 1316var task = InvokeResultAsync(_result); 1338return Task.CompletedTask; 1342return Task.CompletedTask; 1350private Task InvokeNextResultFilterAsync<TFilter, TFilterAsync>() 1362var lastTask = ResultNext<TFilter, TFilterAsync>(ref next, ref scope, ref state, ref isCompleted); 1379return Task.CompletedTask; 1381static async Task Awaited(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object? state, bool isCompleted) 1416var task = InvokeNextResultFilterAsync<TFilter, TFilterAsync>(); 1423return Task.FromResult<ResultExecutedContext>(_resultExecutedContext); 1425static async Task<ResultExecutedContext> Awaited(ResourceInvoker invoker, Task task)
Infrastructure\SystemTextJsonResultExecutor.cs (1)
34public async Task ExecuteAsync(ActionContext context, JsonResult result)
Infrastructure\VirtualFileResultExecutor.cs (5)
34public virtual Task ExecuteAsync(ActionContext context, VirtualFileResult result) 62return Task.CompletedTask; 66protected virtual Task WriteFileAsync(ActionContext context, VirtualFileResult result, IFileInfo fileInfo, RangeItemHeaderValue? range, long rangeLength) 74internal static Task WriteFileAsyncInternal( 83return Task.CompletedTask;
JsonResult.cs (1)
70public override Task ExecuteResultAsync(ActionContext context)
LocalRedirectResult.cs (1)
87public override Task ExecuteResultAsync(ActionContext context)
ModelBinding\Binders\BinderTypeModelBinder.cs (1)
40public async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\BodyModelBinder.cs (1)
87public async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\ByteArrayModelBinder.cs (4)
29public Task BindModelAsync(ModelBindingContext bindingContext) 41return Task.CompletedTask; 52return Task.CompletedTask; 69return Task.CompletedTask;
ModelBinding\Binders\CancellationTokenModelBinder.cs (2)
16public Task BindModelAsync(ModelBindingContext bindingContext) 28return Task.CompletedTask;
ModelBinding\Binders\CollectionModelBinder.cs (1)
105public virtual async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\ComplexObjectModelBinder.cs (3)
49public Task BindModelAsync(ModelBindingContext bindingContext) 58return Task.CompletedTask; 66private async Task BindModelCoreAsync(ModelBindingContext bindingContext, int propertyData)
ModelBinding\Binders\ComplexTypeModelBinder.cs (5)
78public Task BindModelAsync(ModelBindingContext bindingContext) 87return Task.CompletedTask; 95private async Task BindModelCoreAsync(ModelBindingContext bindingContext, int propertyData) 303/// A <see cref="Task"/> that when completed will set <see cref="ModelBindingContext.Result"/> to the 306protected virtual Task BindProperty(ModelBindingContext bindingContext)
ModelBinding\Binders\DateTimeModelBinder.cs (3)
33public Task BindModelAsync(ModelBindingContext bindingContext) 47return Task.CompletedTask; 96return Task.CompletedTask;
ModelBinding\Binders\DecimalModelBinder.cs (3)
35public Task BindModelAsync(ModelBindingContext bindingContext) 49return Task.CompletedTask; 108return Task.CompletedTask;
ModelBinding\Binders\DictionaryModelBinder.cs (1)
110public override async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\DoubleModelBinder.cs (3)
35public Task BindModelAsync(ModelBindingContext bindingContext) 49return Task.CompletedTask; 108return Task.CompletedTask;
ModelBinding\Binders\FloatModelBinder.cs (3)
35public Task BindModelAsync(ModelBindingContext bindingContext) 49return Task.CompletedTask; 108return Task.CompletedTask;
ModelBinding\Binders\FormCollectionModelBinder.cs (1)
33public async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\FormFileModelBinder.cs (2)
34public async Task BindModelAsync(ModelBindingContext bindingContext) 135private async Task GetFormFilesAsync(
ModelBinding\Binders\HeaderModelBinder.cs (1)
49public async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\KeyedServicesModelBinder.cs (3)
22public Task BindModelAsync(ModelBindingContext bindingContext) 28return Task.CompletedTask; 41return Task.CompletedTask;
ModelBinding\Binders\KeyValuePairModelBinder.cs (1)
39public async Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\Binders\ServicesModelBinder.cs (2)
20public Task BindModelAsync(ModelBindingContext bindingContext) 35return Task.CompletedTask;
ModelBinding\Binders\SimpleTypeModelBinder.cs (3)
35public Task BindModelAsync(ModelBindingContext bindingContext) 48return Task.CompletedTask; 104return Task.CompletedTask;
ModelBinding\Binders\TryParseModelBinder.cs (3)
43public Task BindModelAsync(ModelBindingContext bindingContext) 56return Task.CompletedTask; 95return Task.CompletedTask;
ModelBinding\FormFileValueProviderFactory.cs (3)
17public Task CreateValueProviderAsync(ValueProviderFactoryContext context) 28return Task.CompletedTask; 31private static async Task AddValueProviderAsync(ValueProviderFactoryContext context, HttpRequest request)
ModelBinding\FormValueProviderFactory.cs (3)
18public Task CreateValueProviderAsync(ValueProviderFactoryContext context) 29return Task.CompletedTask; 32private static async Task AddValueProviderAsync(ValueProviderFactoryContext context)
ModelBinding\JQueryFormValueProviderFactory.cs (3)
18public Task CreateValueProviderAsync(ValueProviderFactoryContext context) 29return Task.CompletedTask; 32private static async Task AddValueProviderAsync(ValueProviderFactoryContext context)
ModelBinding\JQueryQueryStringValueProviderFactory.cs (2)
16public Task CreateValueProviderAsync(ValueProviderFactoryContext context) 31return Task.CompletedTask;
ModelBinding\ModelBindingHelper.cs (5)
36/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful</returns> 76/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful</returns> 122/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful</returns> 161/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful</returns> 202/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful</returns>
ModelBinding\NoOpBinder.cs (2)
12public Task BindModelAsync(ModelBindingContext bindingContext) 14return Task.CompletedTask;
ModelBinding\PlaceholderBinder.cs (1)
18public Task BindModelAsync(ModelBindingContext bindingContext)
ModelBinding\QueryStringValueProviderFactory.cs (2)
17public Task CreateValueProviderAsync(ValueProviderFactoryContext context) 32return Task.CompletedTask;
ModelBinding\RouteValueProviderFactory.cs (2)
14public Task CreateValueProviderAsync(ValueProviderFactoryContext context) 24return Task.CompletedTask;
ObjectResult.cs (1)
60public override Task ExecuteResultAsync(ActionContext context)
PhysicalFileResult.cs (1)
54public override Task ExecuteResultAsync(ActionContext context)
RedirectResult.cs (1)
89public override Task ExecuteResultAsync(ActionContext context)
RedirectToActionResult.cs (1)
167public override Task ExecuteResultAsync(ActionContext context)
RedirectToPageResult.cs (1)
205public override Task ExecuteResultAsync(ActionContext context)
RedirectToRouteResult.cs (1)
159public override Task ExecuteResultAsync(ActionContext context)
Routing\ActionConstraintMatcherPolicy.cs (2)
76public Task ApplyAsync(HttpContext httpContext, CandidateSet candidateSet) 96return Task.CompletedTask;
Routing\ActionEndpointFactory.cs (1)
218var builder = new RouteEndpointBuilder(context => Task.CompletedTask, pattern, route.Order)
Routing\AttributeRoute.cs (2)
45public Task RouteAsync(RouteContext context) 297public Task RouteAsync(RouteContext context)
Routing\DynamicControllerEndpointMatcherPolicy.cs (1)
58public async Task ApplyAsync(HttpContext httpContext, CandidateSet candidates)
Routing\MvcAttributeRouteHandler.cs (3)
42public Task RouteAsync(RouteContext context) 58return Task.CompletedTask; 85return Task.CompletedTask;
Routing\MvcRouteHandler.cs (4)
39public Task RouteAsync(RouteContext context) 47return Task.CompletedTask; 54return Task.CompletedTask; 73return Task.CompletedTask;
Routing\NullRouter.cs (2)
21public Task RouteAsync(RouteContext context) 23return Task.CompletedTask;
SignInResult.cs (1)
78public override Task ExecuteResultAsync(ActionContext context)
SignOutResult.cs (3)
90public override Task ExecuteResultAsync(ActionContext context) 98Task IResult.ExecuteAsync(HttpContext httpContext) 103private async Task ExecuteAsync(HttpContext httpContext)
src\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
400if (methodReturnType == typeof(Task) || methodReturnType == typeof(ValueTask)) 415if (currentType == typeof(Task)) 471(awaitable) => ((Task)awaitable).GetAwaiter(),
src\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (6)
39/// or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>. 49/// to a <see cref="Task{TResult}"/>, or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>; 53/// When this method returns, contains the type of the closed generic instantiation of <see cref="Task{TResult}"/> or of <see cref="Task"/> that will be returned 114/// to a void-returning <see cref="Task"/> or <see cref="ValueTask"/>. 145var typeDef when typeDef == typeof(Task<>) && IsFSharpUnit(genericAwaitableType.GetGenericArguments()[0]) => (typeof(Task), MakeTaskOfUnitToTaskExpression(genericAwaitableType)), 155return Expression.Lambda(Expression.Convert(closedGenericTaskParam, typeof(Task)), closedGenericTaskParam);
src\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (2)
29internal static async Task WriteFileAsync(HttpContext context, Stream fileStream, RangeItemHeaderValue? range, long rangeLength) 56internal static async Task WriteFileAsync(HttpContext context, ReadOnlyMemory<byte> buffer, RangeItemHeaderValue? range, long rangeLength)
VirtualFileResult.cs (1)
60public override Task ExecuteResultAsync(ActionContext context)
Microsoft.AspNetCore.Mvc.Cors (3)
CorsAuthorizationFilter.cs (1)
63public async Task OnAuthorizationAsync(AuthorizationFilterContext context)
DisableCorsAuthorizationFilter.cs (2)
22public Task OnAuthorizationAsync(AuthorizationFilterContext context) 39return Task.CompletedTask;
Microsoft.AspNetCore.Mvc.Formatters.Xml (2)
XmlDataContractSerializerOutputFormatter.cs (1)
213public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
XmlSerializerOutputFormatter.cs (1)
192public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (3)
NewtonsoftJsonOutputFormatter.cs (1)
134public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
NewtonsoftJsonResultExecutor.cs (2)
67/// <returns>A <see cref="Task"/> which will complete when writing has completed.</returns> 68public async Task ExecuteAsync(ActionContext context, JsonResult result)
Microsoft.AspNetCore.Mvc.Razor (14)
Compilation\DefaultViewCompiler.cs (2)
64compiledViews.TryAdd(compiledView.RelativePath, Task.FromResult(compiledView)); 111return Task.FromResult(new CompiledViewDescriptor
HelperResult.cs (3)
14private readonly Func<TextWriter, Task> _asyncAction; 23public HelperResult(Func<TextWriter, Task> asyncAction) 33public Func<TextWriter, Task> WriteAction => _asyncAction;
IRazorPage.cs (1)
58Task ExecuteAsync();
RazorPageBase.cs (2)
173public abstract Task ExecuteAsync(); 371protected void DefineSection(string name, Func<object?, Task> section)
RazorView.cs (4)
76public virtual async Task RenderAsync(ViewContext context) 138private async Task RenderPageCoreAsync(IRazorPage page, ViewContext context) 157private async Task RenderViewStartsAsync(ViewContext context) 194private async Task RenderLayoutAsync(
RenderAsyncDelegate.cs (1)
10public delegate Task RenderAsyncDelegate();
TagHelpers\TagHelperComponentTagHelper.cs (1)
78public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (3)
PageLoaderMatcherPolicy.cs (3)
55public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates) 92return Task.CompletedTask; 95private static async Task ApplyAsyncAwaited(PageLoader pageLoader, CandidateSet candidates, Task<CompiledPageActionDescriptor> actionDescriptorTask, int index)
Microsoft.AspNetCore.Mvc.RazorPages (74)
Builder\RazorPagesEndpointRouteBuilderExtensions.cs (4)
81var builder = endpoints.MapFallback(context => Task.CompletedTask); 139var builder = endpoints.MapFallback(pattern, context => Task.CompletedTask); 193var builder = endpoints.MapFallback(context => Task.CompletedTask); 253var builder = endpoints.MapFallback(pattern, context => Task.CompletedTask);
Filters\IAsyncPageFilter.cs (4)
16/// <returns>A <see cref="Task"/> that on completion indicates the filter has executed.</returns> 17Task OnPageHandlerSelectionAsync(PageHandlerSelectedContext context); 26/// <returns>A <see cref="Task"/> that on completion indicates the filter has executed.</returns> 27Task OnPageHandlerExecutionAsync(PageHandlerExecutingContext context, PageHandlerExecutionDelegate next);
Filters\PageHandlerExecutionDelegate.cs (1)
11/// A <see cref="Task"/> that on completion returns an <see cref="PageHandlerExecutedContext"/>.
Filters\PageHandlerPageFilter.cs (4)
15public Task OnPageHandlerExecutionAsync(PageHandlerExecutingContext context, PageHandlerExecutionDelegate next) 42public Task OnPageHandlerSelectionAsync(PageHandlerSelectedContext context) 55return Task.CompletedTask; 58private static async Task ExecuteSyncFilter(
Filters\PageHandlerResultFIlter.cs (2)
15public Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next) 42private static async Task ExecuteSyncFilter(
Infrastructure\DefaultPageLoader.cs (1)
46compiledPageActionDescriptor.CompiledPageActionDescriptorTask ??= Task.FromResult(compiledPageActionDescriptor);
Infrastructure\DynamicPageEndpointMatcherPolicy.cs (1)
61public async Task ApplyAsync(HttpContext httpContext, CandidateSet candidates)
Infrastructure\ExecutorFactory.cs (5)
36else if (returnType == typeof(Task)) 79private readonly Func<object, object?[]?, Task> _thunk; 87_thunk = Expression.Lambda<Func<object, object?[]?, Task>>( 165return Task.FromResult<IActionResult?>(null); 192return Task.FromResult(_thunk(receiver, arguments));
Infrastructure\PageActionInvoker.cs (15)
76protected override async Task InvokeInnerFilterAsync() 104protected override Task InvokeResultAsync(IActionResult result) 180private Task BindArgumentsAsync() 186return Task.CompletedTask; 192private async Task BindArgumentsCoreAsync() 250private async Task InvokeHandlerMethodAsync() 301private Task Next(ref State next, ref Scope scope, ref object? state, ref bool isCompleted) 371var task = filter.OnPageHandlerSelectionAsync(handlerSelectedContext); 429var task = BindArgumentsAsync(); 485var task = filter.OnPageHandlerExecutionAsync(handlerExecutingContext, InvokeNextPageFilterAwaitedAsync); 570var task = InvokeNextPageFilterAsync(); 608var task = InvokeHandlerMethodAsync(); 631return Task.CompletedTask; 643return Task.CompletedTask; 651private async Task InvokeNextPageFilterAsync()
Infrastructure\PageActionInvokerCacheEntry.cs (2)
21Func<PageContext, object, Task> propertyBinder, 60public Func<PageContext, object, Task> PropertyBinder { get; }
Infrastructure\PageBinderFactory.cs (6)
10internal static readonly Func<PageContext, object, Task> NullPropertyBinder = (context, arguments) => Task.CompletedTask; 11internal static readonly PageHandlerBinderDelegate NullHandlerBinder = (context, arguments) => Task.CompletedTask; 13public static Func<PageContext, object, Task> CreatePropertyBinder( 46async Task Bind(PageContext pageContext, object instance) 127async Task Bind(PageContext pageContext, IDictionary<string, object?> arguments)
Infrastructure\PageHandlerBinderDelegate.cs (1)
6internal delegate Task PageHandlerBinderDelegate(PageContext pageContext, IDictionary<string, object?> arguments);
Infrastructure\PageLoader.cs (2)
19/// <returns>A <see cref="Task"/> that on completion returns a <see cref="CompiledPageActionDescriptor"/>.</returns> 28/// <returns>A <see cref="Task"/> that on completion returns a <see cref="CompiledPageActionDescriptor"/>.</returns>
Infrastructure\PageResultExecutor.cs (1)
51public virtual Task ExecuteAsync(PageContext pageContext, PageResult result)
Infrastructure\RazorPageAdapter.cs (1)
83public Task ExecuteAsync()
PageBase.cs (9)
1275/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1293/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1320/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1351/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1387/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1425/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1458/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1489/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1525/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns>
PageModel.cs (14)
184/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 200/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 225/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 256/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 292/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 330/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 363/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 394/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 430/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful.</returns> 1690/// <returns>A <see cref="Task"/> that on completion indicates the filter has executed.</returns> 1691public virtual Task OnPageHandlerSelectionAsync(PageHandlerSelectedContext context) 1696return Task.CompletedTask; 1706/// <returns>A <see cref="Task"/> that on completion indicates the filter has executed.</returns> 1707public virtual async Task OnPageHandlerExecutionAsync(PageHandlerExecutingContext context, PageHandlerExecutionDelegate next)
PageResult.cs (1)
50public override Task ExecuteResultAsync(ActionContext context)
Microsoft.AspNetCore.Mvc.TagHelpers (15)
Cache\DistributedCacheTagHelperFormatter.cs (2)
29return Task.FromResult(serialized); 38return Task.FromResult(new HtmlString(content));
Cache\DistributedCacheTagHelperStorage.cs (1)
34public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options)
Cache\IDistributedCacheTagHelperStorage.cs (1)
28Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options);
CacheTagHelper.cs (1)
61public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
ComponentTagHelper.cs (1)
86public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
DistributedCacheTagHelper.cs (1)
53public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
LabelTagHelper.cs (1)
50public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
OptionTagHelper.cs (1)
59public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
PartialTagHelper.cs (2)
104public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) 198private async Task RenderPartialViewAsync(TextWriter writer, object model, IView view)
PersistComponentStateTagHelper.cs (1)
41public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
RenderAtEndOfFormTagHelper.cs (1)
44public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
ScriptTagHelper.cs (1)
238public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
ValidationMessageTagHelper.cs (1)
52public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Microsoft.AspNetCore.Mvc.Testing (2)
DeferredHostBuilder.cs (2)
143public async Task StartAsync(CancellationToken cancellationToken = default) 157public Task StopAsync(CancellationToken cancellationToken = default) => _host.StopAsync(cancellationToken);
Microsoft.AspNetCore.Mvc.ViewFeatures (103)
Buffers\PagedBufferedTextWriter.cs (16)
29public override Task FlushAsync() => FlushAsyncCore(); 34private Task FlushAsyncCore() 41return Task.CompletedTask; 47private async Task FlushAsyncAwaited() 102public override Task WriteAsync(char value) 104var flushTask = FlushAsyncCore(); 111private async Task WriteAsyncAwaited(Task flushTask, char value) 117public override Task WriteAsync(char[] buffer, int index, int count) 119var flushTask = FlushAsyncCore(); 126private async Task WriteAsyncAwaited(Task flushTask, char[] buffer, int index, int count) 132public override Task WriteAsync(string value) 134var flushTask = FlushAsyncCore(); 141private async Task WriteAsyncAwaited(Task flushTask, string value)
Buffers\ViewBuffer.cs (2)
210/// <returns>A <see cref="Task"/> which will complete once content has been written.</returns> 211public async Task WriteToAsync(TextWriter writer, HtmlEncoder encoder)
Buffers\ViewBufferTextWriter.cs (16)
178public override Task WriteAsync(char value) 181return Task.CompletedTask; 185public override Task WriteAsync(char[] buffer, int index, int count) 195return Task.CompletedTask; 199public override Task WriteAsync(string value) 202return Task.CompletedTask; 219public override Task WriteLineAsync(char value) 223return Task.CompletedTask; 227public override Task WriteLineAsync(char[] value, int start, int offset) 231return Task.CompletedTask; 235public override Task WriteLineAsync(string value) 239return Task.CompletedTask; 243public override Task WriteLineAsync() 246return Task.CompletedTask; 270/// <returns>A <see cref="Task"/> that represents the asynchronous copy and flush operations.</returns> 271public override async Task FlushAsync()
Controller.cs (4)
341/// <returns>A <see cref="Task"/> instance.</returns> 343public virtual Task OnActionExecutionAsync( 362return Task.CompletedTask; 364static async Task Awaited(Controller controller, Task<ActionExecutedContext> task)
Filters\AntiforgeryMiddlewareAuthorizationFilter.cs (2)
14public Task OnAuthorizationAsync(AuthorizationFilterContext context) 31return Task.CompletedTask;
Filters\SaveTempDataFilter.cs (5)
14private static readonly Func<object, Task> OnStartingCallback = (state) => OnStarting((HttpContext)state); 50private static Task OnStarting(HttpContext httpContext) 55return Task.CompletedTask; 65return Task.CompletedTask; 74return Task.CompletedTask;
Filters\ValidateAntiforgeryTokenAuthorizationFilter.cs (1)
23public async Task OnAuthorizationAsync(AuthorizationFilterContext context)
HtmlHelper.cs (3)
461public Task RenderPartialAsync(string partialViewName, object model, ViewDataDictionary viewData) 503/// <returns>The <see cref="Task"/>.</returns> 504protected virtual async Task RenderPartialCoreAsync(
IViewComponentHelper.cs (2)
24/// <returns>A <see cref="Task"/> that on completion returns the rendered <see cref="IHtmlContent" />. 37/// <returns>A <see cref="Task"/> that on completion returns the rendered <see cref="IHtmlContent" />.
IViewComponentResult.cs (2)
24/// <returns>A <see cref="Task"/> that represents the asynchronous execution.</returns> 25Task ExecuteAsync(ViewComponentContext context);
NullView.cs (2)
15public Task RenderAsync(ViewContext context) 19return Task.CompletedTask;
PartialViewResult.cs (1)
60public override Task ExecuteResultAsync(ActionContext context)
PartialViewResultExecutor.cs (3)
128/// <returns>A <see cref="Task"/> which will complete when view execution is completed.</returns> 129public virtual Task ExecuteAsync(ActionContext actionContext, IView view, PartialViewResult viewResult) 145public virtual async Task ExecuteAsync(ActionContext context, PartialViewResult result)
Rendering\HtmlHelperPartialExtensions.cs (10)
22/// A <see cref="Task"/> that on completion returns a new <see cref="IHtmlContent"/> instance containing 44/// A <see cref="Task"/> that on completion returns a new <see cref="IHtmlContent"/> instance containing 67/// A <see cref="Task"/> that on completion returns a new <see cref="IHtmlContent"/> instance containing 243var result = htmlHelper.RenderPartialAsync(partialViewName, model, viewData); 254/// <returns>A <see cref="Task"/> that renders the created HTML when it executes.</returns> 258public static Task RenderPartialAsync( 276/// <returns>A <see cref="Task"/> that renders the created HTML when it executes.</returns> 280public static Task RenderPartialAsync( 299/// <returns>A <see cref="Task"/> that renders the created HTML when it executes.</returns> 303public static Task RenderPartialAsync(
Rendering\IHtmlHelper.cs (3)
488/// A <see cref="Task"/> that on completion returns a new <see cref="IHtmlContent"/> instance containing 576/// <returns>A <see cref="Task"/> that renders the created HTML when it executes.</returns> 580Task RenderPartialAsync(string partialViewName, object model, ViewDataDictionary viewData);
Rendering\ViewComponentHelperExtensions.cs (4)
20/// <returns>A <see cref="Task"/> that on completion returns the rendered <see cref="IHtmlContent" />. 34/// <returns>A <see cref="Task"/> that on completion returns the rendered <see cref="IHtmlContent" />. 49/// <returns>A <see cref="Task"/> that on completion returns the rendered <see cref="IHtmlContent" />. 63/// <returns>A <see cref="Task"/> that on completion returns the rendered <see cref="IHtmlContent" />.
TemplateRenderer.cs (1)
123var renderTask = viewEngineResult.View.RenderAsync(viewContext);
ViewComponentResult.cs (1)
59public override Task ExecuteResultAsync(ActionContext context)
ViewComponentResultExecutor.cs (1)
67public virtual async Task ExecuteAsync(ActionContext context, ViewComponentResult result)
ViewComponents\ContentViewComponentResult.cs (3)
48/// <returns>A completed <see cref="Task"/>.</returns> 49public Task ExecuteAsync(ViewComponentContext context) 53return Task.CompletedTask;
ViewComponents\DefaultViewComponentDescriptorProvider.cs (3)
92nameof(Task))); 104else if (typeof(Task).IsAssignableFrom(selectedMethod.ReturnType)) 109nameof(Task)));
ViewComponents\DefaultViewComponentInvoker.cs (2)
51public async Task InvokeAsync(ViewComponentContext context) 59if (returnType == typeof(void) || returnType == typeof(Task))
ViewComponents\HtmlContentViewComponentResult.cs (3)
49/// <returns>A completed <see cref="Task"/>.</returns> 50public Task ExecuteAsync(ViewComponentContext context) 54return Task.CompletedTask;
ViewComponents\IViewComponentInvoker.cs (2)
16/// <returns>A <see cref="Task"/> that represents the asynchronous operation of execution.</returns> 17Task InvokeAsync(ViewComponentContext context);
ViewComponents\ViewViewComponentResult.cs (3)
58var task = ExecuteAsync(context); 67/// <returns>A <see cref="Task"/> which will complete when view rendering is completed.</returns> 68public async Task ExecuteAsync(ViewComponentContext context)
ViewEngines\IView.cs (2)
24/// <returns>A <see cref="Task"/> that on completion renders the view.</returns> 25Task RenderAsync(ViewContext context);
ViewExecutor.cs (4)
120/// <returns>A <see cref="Task"/> which will complete when view execution is completed.</returns> 121public virtual async Task ExecuteAsync( 179/// <returns>A <see cref="Task"/> which will complete when view execution is completed.</returns> 180protected async Task ExecuteAsync(
ViewResult.cs (1)
60public override async Task ExecuteResultAsync(ActionContext context)
ViewResultExecutor.cs (1)
139public async Task ExecuteAsync(ActionContext context, ViewResult result)
Microsoft.AspNetCore.OpenApi (50)
_generated\0\GeneratedRouteBuilderExtensions.g.cs (7)
83var handler = Cast(del, global::System.Threading.Tasks.Task (global::Microsoft.AspNetCore.Http.HttpContext arg0, global::System.String? arg1= "v1") => throw null!); 108async Task RequestHandler(HttpContext httpContext) 122var task = handler(context_local, documentName_local); 126async Task RequestHandlerFiltered(HttpContext httpContext) 150var castHandler = Cast(handler, global::System.Threading.Tasks.Task (global::Microsoft.AspNetCore.Http.HttpContext arg0, global::System.String? arg1= "v1") => throw null!); 197private static Task ExecuteReturnAsync(object? obj, HttpContext httpContext, JsonTypeInfo<object?> jsonTypeInfo) 216private static Task WriteJsonResponseAsync<T>(HttpResponse response, T? value, JsonTypeInfo<T?> jsonTypeInfo)
Extensions\OpenApiEndpointConventionBuilderExtensions.cs (1)
134public static TBuilder AddOpenApiOperationTransformer<TBuilder>(this TBuilder builder, Func<OpenApiOperation, OpenApiOperationTransformerContext, CancellationToken, Task> transformer) where TBuilder : IEndpointConventionBuilder
Services\IDocumentProvider.cs (2)
22Task GenerateAsync(string documentName, TextWriter writer); 23Task GenerateAsync(string documentName, TextWriter writer, OpenApiSpecVersion openApiSpecVersion);
Services\OpenApiDocumentProvider.cs (2)
23public async Task GenerateAsync(string documentName, TextWriter writer) 41public async Task GenerateAsync(string documentName, TextWriter writer, OpenApiSpecVersion openApiSpecVersion)
Services\OpenApiDocumentService.cs (4)
104private async Task ApplyTransformersAsync(OpenApiDocument document, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, CancellationToken cancellationToken) 151internal static async Task FinalizeTransformers(IOpenApiSchemaTransformer[] schemaTransformers, IOpenApiOperationTransformer[] operationTransformers) 163internal async Task ForEachOperationAsync( 165Func<OpenApiOperation, OpenApiOperationTransformerContext, CancellationToken, Task> callback,
Services\OpenApiOptions.cs (3)
89public OpenApiOptions AddDocumentTransformer(Func<OpenApiDocument, OpenApiDocumentTransformerContext, CancellationToken, Task> transformer) 127public OpenApiOptions AddOperationTransformer(Func<OpenApiOperation, OpenApiOperationTransformerContext, CancellationToken, Task> transformer) 165public OpenApiOptions AddSchemaTransformer(Func<OpenApiSchema, OpenApiSchemaTransformerContext, CancellationToken, Task> transformer)
Services\Schemas\OpenApiSchemaService.cs (2)
494internal async Task ApplySchemaTransformersAsync(OpenApiDocument? document, IOpenApiSchema schema, Type type, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, ApiParameterDescription? parameterDescription = null, CancellationToken cancellationToken = default) 519private async Task InnerApplySchemaTransformersAsync(IOpenApiSchema inputSchema,
src\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
400if (methodReturnType == typeof(Task) || methodReturnType == typeof(ValueTask)) 415if (currentType == typeof(Task)) 471(awaitable) => ((Task)awaitable).GetAwaiter(),
src\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (6)
39/// or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>. 49/// to a <see cref="Task{TResult}"/>, or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>; 53/// When this method returns, contains the type of the closed generic instantiation of <see cref="Task{TResult}"/> or of <see cref="Task"/> that will be returned 114/// to a void-returning <see cref="Task"/> or <see cref="ValueTask"/>. 145var typeDef when typeDef == typeof(Task<>) && IsFSharpUnit(genericAwaitableType.GetGenericArguments()[0]) => (typeof(Task), MakeTaskOfUnitToTaskExpression(genericAwaitableType)), 155return Expression.Lambda(Expression.Convert(closedGenericTaskParam, typeof(Task)), closedGenericTaskParam);
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
Transformers\DelegateOpenApiDocumentTransformer.cs (3)
8private readonly Func<OpenApiDocument, OpenApiDocumentTransformerContext, CancellationToken, Task> _documentTransformer; 10public DelegateOpenApiDocumentTransformer(Func<OpenApiDocument, OpenApiDocumentTransformerContext, CancellationToken, Task> transformer) 13public async Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransformerContext context, CancellationToken cancellationToken)
Transformers\DelegateOpenApiOperationTransformer.cs (3)
8private readonly Func<OpenApiOperation, OpenApiOperationTransformerContext, CancellationToken, Task> _transformer; 10public DelegateOpenApiOperationTransformer(Func<OpenApiOperation, OpenApiOperationTransformerContext, CancellationToken, Task> transformer) 15public async Task TransformAsync(OpenApiOperation operation, OpenApiOperationTransformerContext context, CancellationToken cancellationToken)
Transformers\DelegateOpenApiSchemaTransformer.cs (3)
8private readonly Func<OpenApiSchema, OpenApiSchemaTransformerContext, CancellationToken, Task> _transformer; 10public DelegateOpenApiSchemaTransformer(Func<OpenApiSchema, OpenApiSchemaTransformerContext, CancellationToken, Task> transformer) 15public async Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext context, CancellationToken cancellationToken)
Transformers\IOpenApiDocumentTransformer.cs (1)
18Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransformerContext context, CancellationToken cancellationToken);
Transformers\IOpenApiOperationTransformer.cs (1)
18Task TransformAsync(OpenApiOperation operation, OpenApiOperationTransformerContext context, CancellationToken cancellationToken);
Transformers\IOpenApiSchemaTransformer.cs (1)
18Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext context, CancellationToken cancellationToken);
Transformers\TypeBasedOpenApiDocumentTransformer.cs (1)
22public async Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransformerContext context, CancellationToken cancellationToken)
Transformers\TypeBasedOpenApiOperationTransformer.cs (1)
32public Task TransformAsync(OpenApiOperation operation, OpenApiOperationTransformerContext context, CancellationToken cancellationToken)
Transformers\TypeBasedOpenApiSchemaTransformer.cs (1)
32public Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext context, CancellationToken cancellationToken)
Transformers\TypeBasedTransforrmerExtensions.cs (1)
16public static async Task FinalizeTransformer<ITransformer>(this ITransformer transformer)
Microsoft.AspNetCore.OutputCaching (5)
OutputCacheMiddleware.cs (3)
87/// <returns>A <see cref="Task"/> that completes when the middleware has completed processing.</returns> 88public Task Invoke(HttpContext httpContext) 99private async Task InvokeAwaited(HttpContext httpContext, IReadOnlyList<IOutputCachePolicy> policies)
Streams\OutputCacheStream.cs (2)
86public override async Task FlushAsync(CancellationToken cancellationToken) 156public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (3)
RedisOutputCacheStore.cs (3)
88_ = Task.Factory.StartNew(RunGarbageCollectionLoopAsync, default, TaskCreationOptions.LongRunning, TaskScheduler.Current); 91private async Task RunGarbageCollectionLoopAsync() 100await Task.Delay(TimeSpan.FromSeconds(secondsWithJitter)).ConfigureAwait(false);
Microsoft.AspNetCore.Owin (36)
OwinEnvironment.cs (3)
19using SendFileFunc = Func<string, long, long?, CancellationToken, Task>; 427return Task.CompletedTask; 446{ OwinConstants.CommonKeys.LoadClientCertAsync, new FeatureMap<ITlsConnectionFeature>(feature => new Func<Task>(() => feature.GetClientCertificateAsync(CancellationToken.None))) },
OwinExtensions.cs (5)
11Func<IDictionary<string, object>, Task>, 12Func<IDictionary<string, object>, Task> 14using AppFunc = Func<IDictionary<string, object>, Task>; 16Func<IDictionary<string, object>, Task>, 17Func<IDictionary<string, object>, Task>
OwinFeatureCollection.cs (8)
18using SendFileFunc = Func<string, long, long?, CancellationToken, Task>; 182void IHttpResponseFeature.OnStarting(Func<object, Task> callback, object state) 194void IHttpResponseFeature.OnCompleted(Func<object, Task> callback, object state) 229Task IHttpResponseBodyFeature.SendFileAsync(string path, long offset, long? length, CancellationToken cancellation) 264var loadAsync = Prop<Func<Task>>(OwinConstants.CommonKeys.LoadClientCertAsync); 424async Task IHttpResponseBodyFeature.StartAsync(CancellationToken cancellationToken) 435Task IHttpResponseBodyFeature.CompleteAsync() 442return Task.CompletedTask;
WebSockets\OwinWebSocketAcceptAdapter.cs (6)
9using AppFunc = Func<IDictionary<string, object>, Task>; 17Task // Complete 44private Task RequestTask { get { return _requestTcs.Task; } } 45private Task UpstreamTask { get; set; } 75private Task OwinAcceptCallback(IDictionary<string, object> webSocketContext) 82private void EnsureCompleted(Task task)
WebSockets\OwinWebSocketAdapter.cs (5)
13Task>; 25Task>; 125public override Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) 131public override async Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken) 154public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken)
WebSockets\WebSocketAcceptAdapter.cs (2)
9using AppFunc = Func<IDictionary<string, object>, Task>; 17Task // Complete
WebSockets\WebSocketAdapter.cs (7)
13Task>; 29Task>; 60internal Task SendAsync(ArraySegment<byte> buffer, int messageType, bool endOfMessage, CancellationToken cancel) 70return Task.CompletedTask; 92internal Task CloseAsync(int status, string description, CancellationToken cancel) 97private Task RedirectSendToCloseAsync(ArraySegment<byte> buffer, CancellationToken cancel) 119internal async Task CleanupAsync()
Microsoft.AspNetCore.RateLimiting (3)
RateLimitingMiddleware.cs (3)
64/// <returns>A <see cref="Task"/> that completes when the request leaves.</returns> 65public Task Invoke(HttpContext context) 83private async Task InvokeInternal(HttpContext context, EnableRateLimitingAttribute? enableRateLimitingAttribute)
Microsoft.AspNetCore.Razor (12)
TagHelpers\ITagHelperComponent.cs (2)
36/// <returns>A <see cref="Task"/> that on completion updates the <paramref name="output"/>.</returns> 37Task ProcessAsync(TagHelperContext context, TagHelperOutput output);
TagHelpers\TagHelper.cs (3)
49/// <returns>A <see cref="Task"/> that on completion updates the <paramref name="output"/>.</returns> 51public virtual Task ProcessAsync(TagHelperContext context, TagHelperOutput output) 54return Task.CompletedTask;
TagHelpers\TagHelperComponent.cs (2)
31public virtual Task ProcessAsync(TagHelperContext context, TagHelperOutput output) 34return Task.CompletedTask;
TagHelpers\TagHelperOutput.cs (5)
27(useCachedResult, encoder) => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent())) 220/// <returns>A <see cref="Task"/> that on completion returns content rendered by children.</returns> 237/// <returns>A <see cref="Task"/> that on completion returns content rendered by children.</returns> 251/// <returns>A <see cref="Task"/> that on completion returns content rendered by children.</returns> 273/// <returns>A <see cref="Task"/> that on completion returns content rendered by children.</returns>
Microsoft.AspNetCore.Razor.Runtime (13)
Runtime\TagHelpers\TagHelperExecutionContext.cs (6)
19private Func<Task> _executeChildContentAsync; 31executeChildContentAsync: () => Task.CompletedTask, 56Func<Task> executeChildContentAsync, 181Func<Task> executeChildContentAsync) 202/// <returns>A <see cref="Task"/> that on completion sets <see cref="Output"/>'s 204public async Task SetOutputContentAsync()
Runtime\TagHelpers\TagHelperRunner.cs (5)
21public Task RunAsync(TagHelperExecutionContext executionContext) 39var task = tagHelpers[i].ProcessAsync(tagHelperContext, tagHelperOutput); 46return Task.CompletedTask; 48static async Task Awaited(Task task, TagHelperExecutionContext executionContext, int i, int count)
Runtime\TagHelpers\TagHelperScopeManager.cs (2)
47Func<Task> executeChildContentAsync) 124Func<Task> executeChildContentAsync)
Microsoft.AspNetCore.Razor.Utilities.Shared (13)
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\Threading\SpecializedTasks.cs (8)
14public static readonly Task<bool> True = Task.FromResult(true); 15public static readonly Task<bool> False = Task.FromResult(false); 51public static readonly Task<T?> Default = Task.FromResult<T?>(default); 52public static readonly Task<IEnumerable<T>> EmptyEnumerable = Task.FromResult<IEnumerable<T>>([]); 53public static readonly Task<T[]> EmptyArray = Task.FromResult<T[]>([]); 54public static readonly Task<ImmutableArray<T>> EmptyImmutableArray = Task.FromResult(ImmutableArray<T>.Empty); 55public static readonly Task<IList<T>> EmptyList = Task.FromResult<IList<T>>([]); 56public static readonly Task<IReadOnlyList<T>> EmptyReadOnlyList = Task.FromResult<IReadOnlyList<T>>([]);
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\Threading\TaskExtensions.cs (3)
11/// Asserts the <see cref="Task"/> passed has already been completed. 18public static void VerifyCompleted(this Task task) 27/// Asserts the <see cref="Task"/> passed has already been completed.
Utilities\Hashing\NonCryptographicHashAlgorithm.cs (2)
147public Task AppendAsync(Stream stream, CancellationToken cancellationToken = default) 157private async Task AppendAsyncCore(Stream stream, CancellationToken cancellationToken)
Microsoft.AspNetCore.RequestDecompression (2)
RequestDecompressionMiddleware.cs (2)
45public Task Invoke(HttpContext context) 56private async Task InvokeCore(HttpContext context, Stream decompressionStream)
Microsoft.AspNetCore.ResponseCaching (9)
CacheEntry\CachedResponseBody.cs (1)
20public async Task CopyToAsync(PipeWriter destination, CancellationToken cancellationToken)
ResponseCachingMiddleware.cs (2)
84/// <returns>A <see cref="Task"/> that completes when the middleware has completed processing.</returns> 85public async Task Invoke(HttpContext httpContext)
src\aspnetcore\src\Shared\SegmentWriteStream.cs (4)
105public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask; 151public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 154return Task.CompletedTask;
Streams\ResponseCachingStream.cs (2)
86public override async Task FlushAsync(CancellationToken cancellationToken) 130public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
Microsoft.AspNetCore.ResponseCompression (9)
ResponseCompressionBody.cs (6)
39internal async Task FinishCompressionAsync() 120public override Task FlushAsync(CancellationToken cancellationToken) 177public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 300public Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellation) 312public Task StartAsync(CancellationToken token = default) 318public async Task CompleteAsync()
ResponseCompressionMiddleware.cs (3)
37public Task Invoke(HttpContext context) 48private async Task OnStartingResponseHandler(object state) 54private async Task InvokeCore(HttpContext context)
Microsoft.AspNetCore.Rewrite (2)
RewriteMiddleware.cs (2)
52public Task Invoke(HttpContext context) 69return Task.CompletedTask;
Microsoft.AspNetCore.Routing (65)
EndpointMiddleware.cs (5)
31public Task Invoke(HttpContext httpContext) 71var requestTask = endpoint.RequestDelegate(httpContext); 84return Task.CompletedTask; 90static async Task AwaitRequestTask(Endpoint endpoint, Task requestTask, ILogger logger)
EndpointRoutingMiddleware.cs (13)
98public Task Invoke(HttpContext httpContext) 116var matchTask = matcherTask.Result.MatchAsync(httpContext); 125static async Task AwaitMatcher(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task<Matcher> matcherTask) 132static async Task AwaitMatch(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task matchTask) 140private Task SetRoutingAndContinue(HttpContext httpContext) 197private Task ExecuteShortCircuit(IShortCircuitMetadata shortCircuitAttribute, Endpoint endpoint, HttpContext httpContext) 237var requestTask = endpoint.RequestDelegate(httpContext); 251return Task.CompletedTask; 253static async Task AwaitRequestTask(Endpoint endpoint, Task requestTask, ILogger logger) 270return Task.CompletedTask; 305_initializationTask = Task.FromResult(matcher);
Matching\AcceptsMatcherPolicy.cs (3)
47public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates) 135return Task.CompletedTask; 254return Task.CompletedTask;
Matching\DataSourceDependentMatcher.cs (1)
33public override Task MatchAsync(HttpContext httpContext)
Matching\DefaultEndpointSelector.cs (2)
11public override Task SelectAsync( 19return Task.CompletedTask;
Matching\DfaMatcher.cs (5)
32public sealed override unsafe Task MatchAsync(HttpContext httpContext) 60return Task.CompletedTask; 81return Task.CompletedTask; 194return Task.CompletedTask; 316private async Task SelectEndpointWithPoliciesAsync(
Matching\EndpointSelector.cs (2)
20/// <returns>A <see cref="Task"/> that completes asynchronously once endpoint selection is complete.</returns> 26public abstract Task SelectAsync(HttpContext httpContext, CandidateSet candidates);
Matching\HostMatcherPolicy.cs (2)
71public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates) 156return Task.CompletedTask;
Matching\HttpMethodMatcherPolicy.cs (3)
78public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates) 156return Task.CompletedTask; 390return Task.CompletedTask;
Matching\IEndpointSelectorPolicy.cs (1)
46Task ApplyAsync(HttpContext httpContext, CandidateSet candidates);
Matching\ILEmitTrieJumpTable.cs (3)
27private Task _task; 71internal async Task InitializeILDelegateAsync() 74await Task.Run(InitializeILDelegate);
Matching\Matcher.cs (2)
18/// <returns>A <see cref="Task"/> which represents the asynchronous completion of the operation.</returns> 19public abstract Task MatchAsync(HttpContext httpContext);
Matching\NegotiationMatcherPolicy.cs (3)
82public Task ApplyAsync(HttpContext httpContext, CandidateSet candidates) 169return Task.CompletedTask; 353return Task.CompletedTask;
NullRouter.cs (2)
19public Task RouteAsync(RouteContext context) 21return Task.CompletedTask;
RequestDelegateRouteBuilderExtensions.cs (5)
91Func<HttpRequest, HttpResponse, RouteData, Task> handler) 133Func<HttpRequest, HttpResponse, RouteData, Task> handler) 175Func<HttpRequest, HttpResponse, RouteData, Task> handler) 217Func<HttpRequest, HttpResponse, RouteData, Task> handler) 235Func<HttpRequest, HttpResponse, RouteData, Task> handler)
Route.cs (1)
92protected override Task OnRouteMatched(RouteContext context)
RouteBase.cs (4)
96protected abstract Task OnRouteMatched(RouteContext context); 106public virtual Task RouteAsync(RouteContext context) 118return Task.CompletedTask; 136return Task.CompletedTask;
RouteCollection.cs (1)
65public virtual async Task RouteAsync(RouteContext context)
RouteHandler.cs (2)
40public Task RouteAsync(RouteContext context) 43return Task.CompletedTask;
RouterMiddleware.cs (1)
41public async Task Invoke(HttpContext httpContext)
ShortCircuit\RouteShortCircuitEndpointRouteBuilderExtensions.cs (1)
14private static readonly RequestDelegate _shortCircuitDelegate = (context) => Task.CompletedTask;
src\aspnetcore\src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (2)
12public static Task ExecuteReturnAsync(object obj, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 39public static Task WriteJsonResponseAsync<T>(HttpResponse response, T? value, JsonTypeInfo<T> jsonTypeInfo)
Tree\TreeRouter.cs (1)
171public async Task RouteAsync(RouteContext context)
Microsoft.AspNetCore.Routing.Abstractions (1)
IRouter.cs (1)
15Task RouteAsync(RouteContext context);
Microsoft.AspNetCore.Server.HttpSys (79)
AuthenticationHandler.cs (8)
19return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(_requestContext.User!, properties: null, authenticationScheme: _scheme!.Name))); 21return Task.FromResult(AuthenticateResult.NoResult()); 24public Task ChallengeAsync(AuthenticationProperties? properties) 27return Task.CompletedTask; 30public Task ForbidAsync(AuthenticationProperties? properties) 33return Task.CompletedTask; 36public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 46return Task.CompletedTask;
MessagePump.cs (8)
29private Task? _stopTask; 71public Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) where TContext : notnull 130return Task.CompletedTask; 199public async Task StopAsync(CancellationToken cancellationToken) 201Task shutdownTask; 234private async Task StopAsyncCore() 299private async Task ExecuteAsync() 357async Task HandleRequest(RequestContext requestContext)
RequestProcessing\ClientCertLoader.cs (2)
84private Task Task 151internal Task LoadClientCertificateAsync()
RequestProcessing\OpaqueStream.cs (3)
108public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 137public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 152public override Task FlushAsync(CancellationToken cancellationToken)
RequestProcessing\RequestContext.cs (3)
112return Task.FromResult<Stream>(opaqueStream); 421public virtual Task ExecuteAsync() 423return Task.CompletedTask;
RequestProcessing\RequestContext.FeatureCollection.cs (19)
76private List<Tuple<Func<object, Task>, object>>? _onStartingActions = new List<Tuple<Func<object, Task>, object>>(); 77private List<Tuple<Func<object, Task>, object>>? _onCompletedActions = new List<Tuple<Func<object, Task>, object>>(); 350_clientCertTask = Task.FromResult(value); 369return _clientCertTask = Task.FromResult(clientCert); 490void IHttpResponseFeature.OnStarting(Func<object, Task> callback, object state) 498_onStartingActions.Add(new Tuple<Func<object, Task>, object>(callback, state)); 501void IHttpResponseFeature.OnCompleted(Func<object, Task> callback, object state) 509_onCompletedActions.Add(new Tuple<Func<object, Task>, object>(callback, state)); 524async Task IHttpResponseBodyFeature.SendFileAsync(string path, long offset, long? length, CancellationToken cancellation) 530Task IHttpResponseBodyFeature.StartAsync(CancellationToken cancellation) 535Task IHttpResponseBodyFeature.CompleteAsync() => CompleteAsync(); 543internal async Task CompleteAsync() 660internal async Task OnResponseStart() 673private async Task NotifiyOnStartingAsync() 754internal Task OnCompleted() 758return Task.CompletedTask; 764private async Task NotifyOnCompletedAsync()
RequestProcessing\RequestContextOfT.cs (1)
23public override async Task ExecuteAsync()
RequestProcessing\RequestStream.cs (10)
85public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask; 184return Task.FromResult<int>(0); 189return Task.FromCanceled<int>(cancellationToken); 204return Task.FromException<int>(exception); 207return Task.FromResult<int>((int)dataRead); 261return Task.FromException<int>(exception); 264return Task.FromResult<int>((int)totalRead); 283return Task.FromException<int>(exception); 286return Task.FromResult<int>((int)totalRead);
RequestProcessing\Response.cs (1)
711public Task SendFileAsync(string path, long offset, long? count, CancellationToken cancel)
RequestProcessing\ResponseBody.cs (13)
303public override Task FlushAsync(CancellationToken cancellationToken) 307return Task.CompletedTask; 313private unsafe Task FlushInternalAsync(ArraySegment<byte> data, CancellationToken cancellationToken) 317return Task.CompletedTask; 324return Task.CompletedTask; 330return Task.FromCanceled<int>(cancellationToken); 574public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 584return Task.CompletedTask; 597internal async Task SendFileAsync(string fileName, long offset, long? count, CancellationToken cancellationToken) 611internal unsafe Task SendFileAsyncCore(string fileName, long offset, long? count, CancellationToken cancellationToken) 615return Task.CompletedTask; 622return Task.CompletedTask; 628return Task.FromCanceled<int>(cancellationToken);
RequestProcessing\ResponseStreamAsyncResult.cs (1)
183internal Task Task
ResponseStream.cs (4)
9private readonly Func<Task> _onStart; 11internal ResponseStream(Stream innerStream, Func<Task> onStart) 52public override async Task FlushAsync(CancellationToken cancellationToken) 64public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DefaultMemoryPoolFactory.cs (2)
20private readonly Task _timerTask; 28_timerTask = Task.Run(async () =>
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (4)
154public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout) 156var task = await Task.WhenAny(_allBlocksReturned.Task, Task.Delay(timeout));
Microsoft.AspNetCore.Server.IIS (99)
Core\DuplexStream.cs (3)
63public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 73public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 78public override Task FlushAsync(CancellationToken cancellationToken)
Core\EmptyStream.cs (3)
25public override Task FlushAsync(CancellationToken cancellationToken) 27return Task.CompletedTask; 44return Task.FromResult(0);
Core\HttpRequestStream.cs (1)
71public override async Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
Core\HttpResponseStream.cs (2)
26public override Task FlushAsync(CancellationToken cancellationToken) 53public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Core\HttpUpgradeStream.cs (3)
107public override Task FlushAsync(CancellationToken cancellationToken) 148public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 153public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Core\IISHttpContext.cs (21)
51protected Stack<KeyValuePair<Func<object, Task>, object>>? _onStarting; 52protected Stack<KeyValuePair<Func<object, Task>, object>>? _onCompleted; 63protected Task? _readBodyTask; 64protected Task? _writeBodyTask; 490private async Task InitializeResponse(bool flushHeaders) 502private async Task ProduceStart(bool flushHeaders) 574protected Task ProduceEnd() 581return Task.CompletedTask; 602return Task.CompletedTask; 612private async Task ProduceEndAwaited() 726public void OnStarting(Func<object, Task> callback, object state) 737_onStarting = new Stack<KeyValuePair<Func<object, Task>, object>>(); 739_onStarting.Push(new KeyValuePair<Func<object, Task>, object>(callback, state)); 743public void OnCompleted(Func<object, Task> callback, object state) 749_onCompleted = new Stack<KeyValuePair<Func<object, Task>, object>>(); 751_onCompleted.Push(new KeyValuePair<Func<object, Task>, object>(callback, state)); 755protected async Task FireOnStarting() 757Stack<KeyValuePair<Func<object, Task>, object>>? onStarting = null; 779protected async Task FireOnCompleted() 781Stack<KeyValuePair<Func<object, Task>, object>>? onCompleted = null; 925private async Task HandleRequest()
Core\IISHttpContext.FeatureCollection.cs (11)
208Task IHttpResponseBodyFeature.StartAsync(CancellationToken cancellationToken) 215return Task.CompletedTask; 218Task IHttpResponseBodyFeature.SendFileAsync(string path, long offset, long? count, CancellationToken cancellation) 223Task IHttpResponseBodyFeature.CompleteAsync() 237var initializeTask = InitializeResponse(flushHeaders: false); 252private async Task CompleteResponseBodyAwaited(ValueTask completeAsyncTask) 265private async Task CompleteInitializeResponseAwaited(Task initializeTask) 330void IHttpResponseFeature.OnStarting(Func<object, Task> callback, object state) 335void IHttpResponseFeature.OnCompleted(Func<object, Task> callback, object state) 383return Task.FromResult(((ITlsConnectionFeature)this).ClientCertificate);
Core\IISHttpContext.IO.cs (7)
53internal Task CopyToAsync(Stream destination, CancellationToken cancellationToken) 69internal Task WriteAsync(ReadOnlyMemory<byte> memory, CancellationToken cancellationToken = default(CancellationToken)) 71async Task WriteFirstAsync() 85internal Task FlushAsync(CancellationToken cancellationToken = default(CancellationToken)) 87async Task FlushFirstAsync() 96private async Task ReadBody() 155private async Task WriteBody(bool flush = false)
Core\IISHttpServer.cs (3)
96public unsafe Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) where TContext : notnull 115return Task.CompletedTask; 118public Task StopAsync(CancellationToken cancellationToken)
Core\IISServerAuthenticationHandlerInternal.cs (8)
30return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(user, Scheme.Name))); 34return Task.FromResult(AuthenticateResult.NoResult()); 39public Task ChallengeAsync(AuthenticationProperties? properties) 45return Task.CompletedTask; 49public Task ForbidAsync(AuthenticationProperties? properties) 54return Task.CompletedTask; 58public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 65return Task.CompletedTask;
Core\IO\WebSocketsAsyncIOEngine.cs (1)
67return new ValueTask(Task.CompletedTask);
Core\OutputProducer.cs (11)
24private Task _lastFlushTask = Task.CompletedTask; 35public Task FlushAsync(CancellationToken cancellationToken) 72public Task WriteAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken) 78return Task.CompletedTask; 87private Task FlushAsync(PipeWriter pipeWriter, CancellationToken cancellationToken) 99private Task FlushNowAsync(PipeWriter pipeWriter, CancellationToken cancellationToken) 102return awaitable.IsCompleted ? Task.CompletedTask : FlushNowAsyncAwaited(awaitable, cancellationToken); 105private async Task FlushNowAsyncAwaited(ValueTask<FlushResult> awaitable, CancellationToken cancellationToken) 123private async Task AwaitLastFlushAndThenFlushAsync(Task lastFlushTask, PipeWriter pipeWriter, CancellationToken cancellationToken)
Core\ReadOnlyStream.cs (3)
33public override Task FlushAsync(CancellationToken cancellationToken) 35return Task.CompletedTask; 53public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Core\ThrowingWasUpgradedWriteOnlyStreamInternal.cs (1)
19public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Core\WrappingStream.cs (3)
54public override Task FlushAsync(CancellationToken cancellationToken) 78public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 87public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DefaultMemoryPoolFactory.cs (2)
20private readonly Task _timerTask; 28_timerTask = Task.Run(async () =>
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (4)
154public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout) 156var task = await Task.WhenAny(_allBlocksReturned.Task, Task.Delay(timeout));
src\aspnetcore\src\Shared\ErrorPage\ErrorPage.Designer.cs (1)
52public async override global::System.Threading.Tasks.Task ExecuteAsync()
src\aspnetcore\src\Shared\RazorViews\BaseView.cs (3)
64public async Task ExecuteAsync(Stream stream) 80public async Task ExecuteAsync(HttpContext context) 97public abstract Task ExecuteAsync();
src\aspnetcore\src\Shared\ServerInfrastructure\DuplexPipeStream.cs (2)
96public override Task WriteAsync(byte[]? buffer, int offset, int count, CancellationToken cancellationToken) 111public override Task FlushAsync(CancellationToken cancellationToken)
src\aspnetcore\src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
WebHostBuilderIISExtensions.cs (4)
82public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; 84public Task WaitForStartAsync(CancellationToken cancellationToken) 104return Task.CompletedTask;
Microsoft.AspNetCore.Server.IISIntegration (19)
AuthenticationHandler.cs (8)
23return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(_user, _scheme.Name))); 27return Task.FromResult(AuthenticateResult.NoResult()); 31public Task ChallengeAsync(AuthenticationProperties? properties) 37return Task.CompletedTask; 40public Task ForbidAsync(AuthenticationProperties? properties) 45return Task.CompletedTask; 48public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) 53return Task.CompletedTask;
ForwardedTlsConnectionFeature.cs (1)
50return Task.FromResult(ClientCertificate);
IISMiddleware.cs (10)
29private static readonly Func<object, Task> ClearUserDelegate = ClearUser; 100/// <returns>A <see cref="Task"/> that represents the asynchronous operation.</returns> 101public Task Invoke(HttpContext httpContext) 107return Task.CompletedTask; 116var shutdownTask = Task.Run(_applicationLifetime.StopApplication); 118return Task.CompletedTask; 125return Task.CompletedTask; 192private static Task ClearUser(object arg) 201return Task.CompletedTask;
Microsoft.AspNetCore.Server.IntegrationTesting (5)
ApplicationPublisher.cs (1)
99return Task.FromResult(new PublishedApplication(publishDirectory.FullName, logger));
Common\RetryHelper.cs (1)
59await Task.Delay(1 * 1000); //Wait for a while before retry.
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (2)
192private async Task RunScriptAsync(string serverAction) 259await Task.Delay(TimeSpan.FromMinutes(1));
src\aspnetcore\src\Shared\Process\ProcessEx.cs (1)
71public Task Exited => _exited.Task;
Microsoft.AspNetCore.Server.Kestrel.Core (257)
AnyIPListenOptions.cs (1)
19internal override async Task BindAsync(AddressBindContext context, CancellationToken cancellationToken)
Internal\AddressBindContext.cs (2)
14Func<ListenOptions, CancellationToken, Task> createBinding) 28public Func<ListenOptions, CancellationToken, Task> CreateBinding { get; }
Internal\AddressBinder.cs (8)
19public static Task BindAsync(ListenOptions[] listenOptions, AddressBindContext context, Func<ListenOptions, ListenOptions> useHttps, CancellationToken cancellationToken) 86internal static async Task BindEndpointAsync(ListenOptions endpoint, AddressBindContext context, CancellationToken cancellationToken) 170Task BindAsync(AddressBindContext context, CancellationToken cancellationToken); 175public async Task BindAsync(AddressBindContext context, CancellationToken cancellationToken) 195public override Task BindAsync(AddressBindContext context, CancellationToken cancellationToken) 217public override Task BindAsync(AddressBindContext context, CancellationToken cancellationToken) 237public virtual async Task BindAsync(AddressBindContext context, CancellationToken cancellationToken) 257public virtual async Task BindAsync(AddressBindContext context, CancellationToken cancellationToken)
Internal\ConnectionDispatcher.cs (4)
13private readonly Func<T, Task> _connectionDelegate; 17public ConnectionDispatcher(ServiceContext serviceContext, Func<T, Task> connectionDelegate, TransportConnectionManager transportConnectionManager) 27public Task StartAcceptingConnections(IConnectionListener<T> listener) 38async Task AcceptConnectionsAsync()
Internal\Http\Http1ChunkedEncodingMessageBody.cs (5)
27private Task? _pumpTask; 90private async Task PumpAsync() 187private async ValueTask StopAsyncAwaited(Task pumpTask) 197protected override Task OnReadStartedAsync() 200return Task.CompletedTask;
Internal\Http\Http1Connection.cs (1)
1101protected override Task TryProduceInvalidRequestResponse()
Internal\Http\Http1MessageBody.cs (5)
51protected override Task OnConsumeAsync() 61return Task.CompletedTask; 70return Task.CompletedTask; 78return Task.CompletedTask; 84protected async Task OnConsumeAsyncAwaited()
Internal\Http\Http1OutputProducer.cs (3)
96public Task WriteDataAsync(ReadOnlySpan<byte> buffer, CancellationToken cancellationToken = default) 100return Task.FromCanceled(cancellationToken); 110return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken));
Internal\Http\Http1UpgradeMessageBody.cs (2)
49public override Task ConsumeAsync() 51return Task.CompletedTask;
Internal\Http\HttpProtocol.cs (43)
43private Stack<KeyValuePair<Func<object, Task>, object>>? _onStarting; 44private Stack<KeyValuePair<Func<object, Task>, object>>? _onCompleted; 592public async Task ProcessRequestsAsync<TContext>(IHttpApplication<TContext> application) where TContext : notnull 646private async Task ProcessRequests<TContext>(IHttpApplication<TContext> application) where TContext : notnull 805public void OnStarting(Func<object, Task> callback, object state) 814_onStarting = new Stack<KeyValuePair<Func<object, Task>, object>>(); 816_onStarting.Push(new KeyValuePair<Func<object, Task>, object>(callback, state)); 819public void OnCompleted(Func<object, Task> callback, object state) 823_onCompleted = new Stack<KeyValuePair<Func<object, Task>, object>>(); 825_onCompleted.Push(new KeyValuePair<Func<object, Task>, object>(callback, state)); 828protected Task FireOnStarting() 836return Task.CompletedTask; 838static async Task ProcessEvents(HttpProtocol protocol, Stack<KeyValuePair<Func<object, Task>, object>> events) 856protected Task FireOnCompleted() 864return Task.CompletedTask; 866static async Task ProcessEvents(HttpProtocol protocol, Stack<KeyValuePair<Func<object, Task>, object>> events) 975public Task InitializeResponseAsync(int firstWriteByteCount) 977var startingTask = FireOnStarting(); 987return Task.CompletedTask; 991public async Task InitializeResponseAwaited(Task startingTask, int firstWriteByteCount) 1038protected virtual Task TryProduceInvalidRequestResponse() 1048return Task.CompletedTask; 1051protected Task ProduceEnd() 1055return Task.CompletedTask; 1067return Task.CompletedTask; 1091private Task WriteSuffix() 1120return Task.CompletedTask; 1123private async Task WriteSuffixAwaited(ValueTask<FlushResult> writeTask) 1540var initializeTask = InitializeResponseAsync(0); 1555public Task CompleteAsync(Exception? exception = null) 1571var onStartingTask = FireOnStarting(); 1593return Task.CompletedTask; 1596private async Task CompleteAsyncAwaited(Task onStartingTask) 1657var startingTask = FireOnStarting(); 1666private async ValueTask<FlushResult> FirstWriteAsyncAwaited(Task initializeTask, ReadOnlyMemory<byte> data, CancellationToken cancellationToken) 1703public Task FlushAsync(CancellationToken cancellationToken = default) 1709private async ValueTask<FlushResult> FlushAsyncAwaited(Task initializeTask, CancellationToken cancellationToken) 1715public Task WriteAsync(ReadOnlyMemory<byte> data, CancellationToken cancellationToken = default) 1720public async ValueTask<FlushResult> WriteAsyncAwaited(Task initializeTask, ReadOnlyMemory<byte> data, CancellationToken cancellationToken)
Internal\Http\HttpProtocol.FeatureCollection.cs (7)
100return Task.CompletedTask; 249void IHttpResponseFeature.OnStarting(Func<object, Task> callback, object state) 254void IHttpResponseFeature.OnCompleted(Func<object, Task> callback, object state) 321Task IHttpResponseBodyFeature.StartAsync(CancellationToken cancellationToken) 325return Task.CompletedTask; 337Task IHttpResponseBodyFeature.SendFileAsync(string path, long offset, long? count, CancellationToken cancellation) 342Task IHttpResponseBodyFeature.CompleteAsync()
Internal\Http\HttpRequestStream.cs (4)
65public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 85public override Task FlushAsync(CancellationToken cancellationToken) 87return Task.CompletedTask; 156public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
Internal\Http\HttpResponsePipeWriter.cs (3)
14private Task _completeTask = Task.CompletedTask; 79public Task StopAcceptingWritesAsync()
Internal\Http\HttpResponseStream.cs (2)
59public override Task FlushAsync(CancellationToken cancellationToken) 92public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Internal\Http\HttpUpgradeStream.cs (3)
107public override Task FlushAsync(CancellationToken cancellationToken) 148public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 153public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Internal\Http\IHttpOutputProducer.cs (1)
20Task WriteDataAsync(ReadOnlySpan<byte> data, CancellationToken cancellationToken);
Internal\Http\IHttpResponseControl.cs (1)
18Task CompleteAsync(Exception? exception = null);
Internal\Http\MessageBody.cs (10)
69public virtual Task ConsumeAsync() 71Task startTask = TryStartAsync(); 80private async Task ConsumeAwaited(Task startTask) 93protected virtual Task OnConsumeAsync() => Task.CompletedTask; 119protected Task TryStartAsync() 123return Task.CompletedTask; 182protected virtual Task OnReadStartedAsync() 184return Task.CompletedTask;
Internal\Http\ZeroContentLengthMessageBody.cs (2)
20public override Task ConsumeAsync() => Task.CompletedTask;
Internal\Http2\Http2Connection.cs (26)
113private readonly Task _inputTask; 290public async Task ProcessRequestsAsync<TContext>(IHttpApplication<TContext> application) where TContext : notnull 681private Task ProcessFrameAsync<TContext>(IHttpApplication<TContext> application, in ReadOnlySequence<byte> payload) where TContext : notnull 708private Task ProcessDataFrameAsync(in ReadOnlySequence<byte> payload) 790private Task ProcessHeadersFrameAsync<TContext>(IHttpApplication<TContext> application, in ReadOnlySequence<byte> payload) where TContext : notnull 930private Task ProcessPriorityFrameAsync() 952return Task.CompletedTask; 955private Task ProcessRstStreamFrameAsync() 985return Task.CompletedTask; 992return Task.CompletedTask; 995private Task ProcessSettingsFrameAsync(in ReadOnlySequence<byte> payload) 1014return Task.CompletedTask; 1079private Task ProcessPingFrameAsync(in ReadOnlySequence<byte> payload) 1107return Task.CompletedTask; 1113private Task ProcessGoAwayFrameAsync() 1129return Task.CompletedTask; 1132private Task ProcessWindowUpdateFrameAsync() 1197return Task.CompletedTask; 1200private Task ProcessContinuationFrameAsync(in ReadOnlySequence<byte> payload) 1234private Task ProcessUnknownFrameAsync() 1241return Task.CompletedTask; 1244private Task DecodeHeadersAsync(bool endHeaders, in ReadOnlySequence<byte> payload) 1268return Task.CompletedTask; 1271private Task DecodeTrailersAsync(bool endHeaders, in ReadOnlySequence<byte> payload) 1292return Task.CompletedTask; 1890private async Task CopyPipeAsync(PipeReader reader, PipeWriter writer)
Internal\Http2\Http2FrameWriter.cs (5)
107private readonly Task _writeQueueTask; 161_writeQueueTask = Task.Run(WriteToOutputPipe); 176private async Task WriteToOutputPipe() 350private async Task HandleFlowControlErrorAsync() 451public Task ShutdownAsync()
Internal\Http2\Http2MessageBody.cs (2)
44protected override Task OnReadStartedAsync() 56return Task.CompletedTask;
Internal\Http2\Http2OutputProducer.cs (6)
262return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken)); 385public Task WriteDataAsync(ReadOnlySpan<byte> data, CancellationToken cancellationToken) 389return Task.FromCanceled(cancellationToken); 400return Task.CompletedTask; 409var task = _flusher.FlushAsync(this, cancellationToken).GetAsTask(); 525return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken));
Internal\Http2\Http2Stream.cs (2)
470public Task OnDataAsync(Http2Frame dataFrame, in ReadOnlySequence<byte> payload) 537return Task.CompletedTask;
Internal\Http3\Http3Connection.cs (3)
329public async Task ProcessRequestsAsync<TContext>(IHttpApplication<TContext> application) where TContext : notnull 595private async Task CreateHttp3Stream<TContext>(ConnectionContext streamContext, IHttpApplication<TContext> application, long streamId) where TContext : notnull 638private async Task CreateAndAddWebTransportStream(Http3PendingStream stream, long streamId, WebTransportStreamType type)
Internal\Http3\Http3ControlStream.cs (3)
190public async Task ProcessRequestAsync<TContext>(IHttpApplication<TContext> application) where TContext : notnull 257private async Task HandleControlStream() 315private Task HandleEncodingDecodingTask()
Internal\Http3\Http3FrameWriter.cs (2)
94internal Task WriteSettingsAsync(List<Http3PeerSetting> settings) 153internal Task WriteStreamIdAsync(long id)
Internal\Http3\Http3OutputProducer.cs (5)
169return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken)); 326public Task WriteDataAsync(ReadOnlySpan<byte> data, CancellationToken cancellationToken) 330return Task.FromCanceled(cancellationToken); 341return Task.CompletedTask; 355return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken));
Internal\Http3\Http3Stream.cs (7)
655public async Task ProcessRequestAsync<TContext>(IHttpApplication<TContext> application) where TContext : notnull 836private Task ProcessHttp3Stream<TContext>(IHttpApplication<TContext> application, Http3RawFrame incomingFrame, bool isContinuedFrame, 857private static Task ProcessUnknownFrameAsync() 861return Task.CompletedTask; 864private async Task ProcessHeadersFrameAsync<TContext>(IHttpApplication<TContext> application, Http3RawFrame incomingFrame, bool isContinuedFrame, 976private Task ProcessDataFrameAsync(in ReadOnlySequence<byte> payload) 1008return Task.CompletedTask;
Internal\HttpConnection.cs (1)
53public async Task ProcessRequestsAsync<TContext>(IHttpApplication<TContext> httpApplication) where TContext : notnull
Internal\Infrastructure\BodyControl.cs (1)
89public Task StopAsync()
Internal\Infrastructure\KestrelConnection.cs (14)
15private Stack<KeyValuePair<Func<object, Task>, object>>? _onCompleted; 42public Task ExecutionTask => _completionTcs.Task; 75void IConnectionCompleteFeature.OnCompleted(Func<object, Task> callback, object state) 84_onCompleted = new Stack<KeyValuePair<Func<object, Task>, object>>(); 86_onCompleted.Push(new KeyValuePair<Func<object, Task>, object>(callback, state)); 89public Task FireOnCompletedAsync() 101return Task.CompletedTask; 107private Task CompleteAsyncMayAwait(Stack<KeyValuePair<Func<object, Task>, object>> onCompleted) 113var task = entry.Key.Invoke(entry.Value); 125return Task.CompletedTask; 128private async Task CompleteAsyncAwaited(Task currentTask, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
Internal\Infrastructure\KestrelConnectionOfT.cs (3)
13private readonly Func<T, Task> _connectionDelegate; 19Func<T, Task> connectionDelegate, 41internal async Task ExecuteAsync()
Internal\Infrastructure\PipeWriterHelpers\ConcurrentPipeWriter.cs (1)
143private async Task FlushAsyncAwaited(ValueTask<FlushResult> flushTask, CancellationToken cancellationToken)
Internal\Infrastructure\ReadOnlyStream.cs (1)
21public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Internal\Infrastructure\StatusCheckWriteStream.cs (2)
70public override Task FlushAsync(CancellationToken cancellationToken) 82public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Internal\Infrastructure\StreamCloseAwaitable.cs (1)
32Task.Run(continuation);
Internal\Infrastructure\ThrowingWasUpgradedWriteOnlyStream.cs (1)
21public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Internal\Infrastructure\TransportConnectionManager.cs (11)
57var closeTasks = new List<Task>(); 68var allClosedTask = Task.WhenAll(closeTasks.ToArray()); 69return await Task.WhenAny(allClosedTask, CancellationTokenAsTask(token)).ConfigureAwait(false) == allClosedTask; 74var abortTasks = new List<Task>(); 90var allAbortedTask = Task.WhenAll(abortTasks.ToArray()); 91return await Task.WhenAny(allAbortedTask, Task.Delay(1000)).ConfigureAwait(false) == allAbortedTask; 94private static Task CancellationTokenAsTask(CancellationToken token) 98return Task.CompletedTask;
Internal\Infrastructure\TransportManager.cs (13)
97private void StartAcceptLoop<T>(IConnectionListener<T> connectionListener, Func<T, Task> connectionDelegate, EndpointConfig? endpointConfig) where T : BaseConnectionContext 101var acceptLoopTask = connectionDispatcher.StartAcceptingConnections(connectionListener); 106public Task StopEndpointsAsync(List<EndpointConfig> endpointsToStop, CancellationToken cancellationToken) 119public Task StopAsync(CancellationToken cancellationToken) 124private async Task StopTransportsAsync(List<ActiveTransport> transportsToStop, CancellationToken cancellationToken) 126var tasks = new Task[transportsToStop.Count]; 133await Task.WhenAll(tasks).ConfigureAwait(false); 135async Task StopTransportConnection(ActiveTransport transport) 153await Task.WhenAll(tasks).ConfigureAwait(false); 160await Task.WhenAll(tasks).ConfigureAwait(false); 170public ActiveTransport(IConnectionListenerBase transport, Task acceptLoopTask, TransportConnectionManager transportConnectionManager, EndpointConfig? endpointConfig = null) 179public Task AcceptLoopTask { get; } 184public async Task UnbindAsync(CancellationToken cancellationToken)
Internal\Infrastructure\WrappingStream.cs (3)
53public override Task FlushAsync(CancellationToken cancellationToken) 77public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 86public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
Internal\IRequestProcessor.cs (1)
11Task ProcessRequestsAsync<TContext>(IHttpApplication<TContext> application) where TContext : notnull;
Internal\KestrelServerImpl.cs (5)
124public async Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) where TContext : notnull 139async Task OnBind(ListenOptions options, CancellationToken onBindCancellationToken) 243public async Task StopAsync(CancellationToken cancellationToken) 290private async Task BindAsync(CancellationToken cancellationToken) 330private async Task RebindAsync()
Internal\TlsConnectionFeature.cs (2)
103_clientCertTask = Task.FromResult(value); 152return _clientCertTask = Task.FromResult(ClientCertificate);
KestrelServer.cs (2)
53public Task StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) where TContext : notnull 60public Task StopAsync(CancellationToken cancellationToken)
ListenOptions.cs (3)
194return Task.CompletedTask; 210return Task.CompletedTask; 222internal virtual async Task BindAsync(AddressBindContext context, CancellationToken cancellationToken)
LocalhostListenOptions.cs (1)
38internal override async Task BindAsync(AddressBindContext context, CancellationToken cancellationToken)
Middleware\ConnectionLimitMiddleware.cs (4)
13private readonly Func<T, Task> _next; 18public ConnectionLimitMiddleware(Func<T, Task> next, long connectionLimit, KestrelTrace trace, KestrelMetrics metrics) 24internal ConnectionLimitMiddleware(Func<T, Task> next, ResourceCounter concurrentConnectionCounter, KestrelTrace trace, KestrelMetrics metrics) 32public async Task OnConnectionAsync(T connection)
Middleware\HttpConnectionMiddleware.cs (1)
28public Task OnConnectionAsync(ConnectionContext connectionContext)
Middleware\HttpMultiplexedConnectionMiddleware.cs (1)
28public Task OnConnectionAsync(MultiplexedConnectionContext connectionContext)
Middleware\HttpsConnectionMiddleware.cs (2)
146public async Task OnConnectionAsync(ConnectionContext context) 347private Task DoOptionsBasedHandshakeAsync(ConnectionContext context, SslStream sslStream, Core.Internal.TlsConnectionFeature feature, CancellationToken cancellationToken)
Middleware\Internal\LoggingStream.cs (2)
71public override Task FlushAsync(CancellationToken cancellationToken) 138public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Middleware\LoggingConnectionMiddleware.cs (1)
20public async Task OnConnectionAsync(ConnectionContext context)
Middleware\LoggingMultiplexedConnectionMiddleware.cs (1)
23public Task OnConnectionAsync(MultiplexedConnectionContext context)
Middleware\TlsListener.cs (1)
25internal async Task OnTlsClientHelloAsync(ConnectionContext connection, CancellationToken cancellationToken)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DefaultMemoryPoolFactory.cs (2)
20private readonly Task _timerTask; 28_timerTask = Task.Run(async () =>
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (4)
154public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout) 156var task = await Task.WhenAny(_allBlocksReturned.Task, Task.Delay(timeout));
src\aspnetcore\src\Shared\ServerInfrastructure\DuplexPipeStream.cs (2)
96public override Task WriteAsync(byte[]? buffer, int offset, int count, CancellationToken cancellationToken) 111public override Task FlushAsync(CancellationToken cancellationToken)
src\aspnetcore\src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
Microsoft.AspNetCore.Server.Kestrel.Transport.DirectTls (7)
Connection\DirectTlsConnection.cs (4)
38private Task? _receiveTask; 39private Task? _sendTask; 226private async Task ReceiveLoopAsync() 301private async Task SendLoopAsync()
Connection\DirectTlsConnection.FeatureCollection.cs (1)
42=> Task.FromResult(ClientCertificate);
TlsEventPump.cs (1)
1042private async Task DisposeAbandonedConnectionAsync(DirectTlsConnection connection)
TlsEventPumpPool.cs (1)
117var results = await Task.WhenAll(stops).ConfigureAwait(false);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (18)
Internal\NamedPipeConnection.cs (6)
31internal Task _receivingTask = Task.CompletedTask; 32internal Task _sendingTask = Task.CompletedTask; 77private async Task DoReceiveAsync() 148private async Task DoSendAsync()
Internal\NamedPipeConnectionListener.cs (6)
31private Task? _completeListeningTask; 73var listeningTasks = new Task[_options.ListenerQueueCount]; 81listeningTasks[i] = Task.Run(() => StartAsync(initialStream)); 84_completeListeningTask = Task.Run(async () => 88await Task.WhenAll(listeningTasks); 101private async Task StartAsync(NamedPipeServerStream nextStream)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DefaultMemoryPoolFactory.cs (2)
20private readonly Task _timerTask; 28_timerTask = Task.Run(async () =>
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (4)
154public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout) 156var task = await Task.WhenAny(_allBlocksReturned.Task, Task.Delay(timeout));
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (22)
Internal\QuicConnectionContext.cs (1)
31private Task? _closeTask;
Internal\QuicConnectionContext.FeatureCollection.cs (2)
32_clientCertTask = Task.FromResult(value); 38return _clientCertTask ??= Task.FromResult(ClientCertificate);
Internal\QuicStreamContext.cs (3)
21internal Task _processingTask = Task.CompletedTask; 148private async Task StartAsync()
src\aspnetcore\src\Servers\Kestrel\shared\ConnectionCompletion.cs (10)
12public static Task FireOnCompletedAsync(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>>? onCompleted) 16return Task.CompletedTask; 22private static Task CompleteAsyncMayAwait(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted) 28var task = entry.Key.Invoke(entry.Value); 40return Task.CompletedTask; 43private static async Task CompleteAsyncAwaited(Task currentTask, ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DefaultMemoryPoolFactory.cs (2)
20private readonly Task _timerTask; 28_timerTask = Task.Run(async () =>
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (4)
154public async Task WhenAllBlocksReturnedAsync(TimeSpan timeout) 156var task = await Task.WhenAny(_allBlocksReturned.Task, Task.Delay(timeout));
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (4)
Internal\SocketConnection.cs (4)
28private Task? _sendingTask; 29private Task? _receivingTask; 133private async Task DoReceive() 266private async Task DoSend()
Microsoft.AspNetCore.Session (6)
DistributedSession.cs (2)
211public async Task LoadAsync(CancellationToken cancellationToken = default) 244public async Task CommitAsync(CancellationToken cancellationToken = default)
SessionMiddleware.cs (4)
59/// <returns>A <see cref="Task"/> that completes when the middleware has completed processing.</returns> 60public async Task Invoke(HttpContext context) 129private static Task OnStartingCallback(object state) 136return Task.CompletedTask;
Microsoft.AspNetCore.SignalR.Client.Core (140)
HubConnection.cs (83)
111/// The <see cref="Task"/> result does not block <see cref="HubConnection"/> operations. 131public event Func<Exception?, Task>? Closed; 139/// The <see cref="Task"/> result does not block <see cref="HubConnection"/> operations. 151public event Func<Exception?, Task>? Reconnecting; 159/// The <see cref="Task"/> result does not block <see cref="HubConnection"/> operations. 171public event Func<string?, Task>? Reconnected; 178/// The authentication refresh operation waits for each handler's returned <see cref="Task"/> to complete. 180public event Func<AuthenticationRefreshedContext, Task>? AuthenticationRefreshed; 187/// The authentication refresh operation waits for each handler's returned <see cref="Task"/> to complete. 189public event Func<AuthenticationRefreshFailedContext, Task>? AuthenticationRefreshFailed; 293/// <returns>A <see cref="Task"/> that represents the asynchronous start.</returns> 294public virtual async Task StartAsync(CancellationToken cancellationToken = default) 303private async Task StartAsyncInner(CancellationToken cancellationToken = default) 346/// <returns>A <see cref="Task"/> that represents the asynchronous stop.</returns> 347public virtual async Task StopAsync(CancellationToken cancellationToken = default) 418public virtual IDisposable On(string methodName, Type[] parameterTypes, Func<object?[], object, Task> handler, object state) 501/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 505public virtual async Task SendCoreAsync(string methodName, object?[] args, CancellationToken cancellationToken = default) 513private async Task StartAsyncCore(CancellationToken cancellationToken) 664private static async Task InvokeEventHandlersAsync<T>( 665Func<T, Task> handlers, 670foreach (Func<T, Task> handler in handlers.GetInvocationList()) 762private async Task OnAuthenticationRefreshTimerFired(AuthenticationRefreshTimerState timerState) 844private async Task StopAsyncCore(bool disposing) 858var reconnectTask = _state.ReconnectTask; 873var connectionStateStopTask = Task.CompletedTask; 893var writeTask = SendHubMessage(connectionState, CloseMessage.Empty); 1013var (irqLocal, tasks) = ((InvocationRequest, Task[]?))state!; 1084private Task[]? LaunchStreams(ConnectionState connectionState, Dictionary<string, object>? readers, CancellationToken cancellationToken) 1096var streamTasks = new Task[readers.Count]; 1140private Task InvokeStreamMethod(MethodInfo methodInfo, Type[] genericTypes, ConnectionState connectionState, string streamId, object reader, CancellationTokenSource tokenSource) 1149return (Task)methodInfo 1162private Task ReflectionSendStreamItems(MethodInfo methodInfo, ConnectionState connectionState, string streamId, object reader, CancellationTokenSource tokenSource) 1164async Task ReadAsyncEnumeratorStream(IAsyncEnumerator<object?> enumerator) 1179Func<Task> createAndConsumeStream; 1198private Task SendStreamItems<T>(ConnectionState connectionState, string streamId, ChannelReader<T> reader, CancellationTokenSource tokenSource) 1200async Task ReadChannelStream() 1215private Task SendIAsyncEnumerableStreamItems<T>(ConnectionState connectionState, string streamId, IAsyncEnumerable<T> stream, CancellationTokenSource tokenSource) 1217async Task ReadAsyncEnumerableStream() 1228private async Task SendStreamItemAsync(ConnectionState connectionState, string streamId, object? item, CancellationTokenSource tokenSource) 1234private async Task CommonStreaming(ConnectionState connectionState, string streamId, Func<Task> createAndConsumeStream, CancellationTokenSource cts) 1364var (irqLocal, tasks) = ((InvocationRequest, Task[]?))state!; 1406private async Task CancelInvocationAsync(InvocationRequest irq, Task[]? streamTasks = null) 1411await Task.WhenAll(streamTasks).ConfigureAwait(false); 1443private async Task InvokeCore(ConnectionState connectionState, string methodName, InvocationRequest irq, object?[] args, string[]? streams, CancellationToken cancellationToken) 1472private async Task InvokeStreamCore(ConnectionState connectionState, string methodName, InvocationRequest irq, object?[] args, string[]? streams, CancellationToken cancellationToken) 1515private async Task SendHubMessage(ConnectionState connectionState, HubMessage hubMessage, CancellationToken cancellationToken = default) 1537private async Task SendCoreAsyncCore(string methodName, object?[] args, CancellationToken cancellationToken) 1577private async Task SendWithLock(ConnectionState expectedConnectionState, HubMessage message, CancellationToken cancellationToken, [CallerMemberName] string callerName = "") 1682private async Task DispatchInvocationAsync(InvocationMessage invocation, ConnectionState connectionState) 1716var task = handler.InvokeAsync(invocation.Arguments); 1766private async Task DispatchInvocationStreamItemAsync(StreamItemMessage streamItem, InvocationRequest irq) 1799private async Task HandshakeAsync(ConnectionState startingConnectionState, int protocolVersion, CancellationToken cancellationToken) 1904private async Task ReceiveLoop(ConnectionState connectionState) 1915var timerTask = connectionState.TimerLoop(timer); 1924async Task StartProcessingInvocationMessages(ChannelReader<InvocationMessage> invocationMessageChannelReader) 1930var invokeTask = DispatchInvocationAsync(invocationMessage, connectionState); 2028internal Task RunTimerActions() 2041private async Task HandleConnectionClose(ConnectionState connectionState) 2096async Task RunClosedEventAsync() 2113private async Task ReconnectAsync(Exception? closeException) 2152await Task.Delay(nextRetryDelay.Value, _state.StopCts.Token).ConfigureAwait(false); 2267async Task RunReconnectingEventAsync() 2287async Task RunReconnectedEventAsync() 2395private readonly Func<object?[], object, Task> _callback; 2398public InvocationHandler(Type[] parameterTypes, Func<object?[], object, Task> callback, object state) 2405public Task InvokeAsync(object?[] parameters) 2431public Task? ReceiveTask { get; set; } 2436public Task? InvocationMessageReceiveTask { get; set; } 2530public Task StopAsync() 2548private async Task StopAsyncCore() 2560await ((ReceiveTask ?? Task.CompletedTask).ConfigureAwait(false)); 2573public async Task TimerLoop(TimerAwaitable timer) 2623public Task AckAsync(AckMessage ackMessage) 2630return Task.CompletedTask; 2647internal async Task RunTimerActions() 2749ReconnectTask = Task.CompletedTask; 2758public Task ReconnectTask { get; set; } = Task.CompletedTask; 2794public Task WaitConnectionLockAsync(CancellationToken token, [CallerMemberName] string? memberName = null, [CallerFilePath] string? filePath = null, [CallerLineNumber] int lineNumber = 0)
HubConnectionExtensions.cs (12)
21return Task.CompletedTask; 211public static IDisposable On(this HubConnection hubConnection, string methodName, Type[] parameterTypes, Func<object?[], Task> handler) 215var currentHandler = (Func<object?[], Task>)state; 227public static IDisposable On(this HubConnection hubConnection, string methodName, Func<Task> handler) 242public static IDisposable On<T1>(this HubConnection hubConnection, string methodName, Func<T1, Task> handler) 260public static IDisposable On<T1, T2>(this HubConnection hubConnection, string methodName, Func<T1, T2, Task> handler) 279public static IDisposable On<T1, T2, T3>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, Task> handler) 299public static IDisposable On<T1, T2, T3, T4>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, T4, Task> handler) 320public static IDisposable On<T1, T2, T3, T4, T5>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, T4, T5, Task> handler) 342public static IDisposable On<T1, T2, T3, T4, T5, T6>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, Task> handler) 365public static IDisposable On<T1, T2, T3, T4, T5, T6, T7>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, T7, Task> handler) 389public static IDisposable On<T1, T2, T3, T4, T5, T6, T7, T8>(this HubConnection hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, T7, T8, Task> handler)
HubConnectionExtensions.InvokeAsync.cs (23)
25public static Task InvokeAsync(this HubConnection hubConnection, string methodName, CancellationToken cancellationToken = default) 37/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 39public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, CancellationToken cancellationToken = default) 52/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 54public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, CancellationToken cancellationToken = default) 68/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 70public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, CancellationToken cancellationToken = default) 85/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 87public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, CancellationToken cancellationToken = default) 103/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 105public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, CancellationToken cancellationToken = default) 122/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 124public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, CancellationToken cancellationToken = default) 142/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 144public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, CancellationToken cancellationToken = default) 163/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 165public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, CancellationToken cancellationToken = default) 185/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 187public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, CancellationToken cancellationToken = default) 208/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 210public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, CancellationToken cancellationToken = default) 222/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 223public static Task InvokeCoreAsync(this HubConnection hubConnection, string methodName, object?[] args, CancellationToken cancellationToken = default)
HubConnectionExtensions.OnResult.cs (1)
23return Task.FromResult<object?>(currentHandler(parameters));
HubConnectionExtensions.SendAsync.cs (11)
25public static Task SendAsync(this HubConnection hubConnection, string methodName, CancellationToken cancellationToken = default) 40public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, CancellationToken cancellationToken = default) 56public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, CancellationToken cancellationToken = default) 73public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, CancellationToken cancellationToken = default) 91public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, CancellationToken cancellationToken = default) 110public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, CancellationToken cancellationToken = default) 130public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, CancellationToken cancellationToken = default) 151public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, CancellationToken cancellationToken = default) 173public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, CancellationToken cancellationToken = default) 196public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, CancellationToken cancellationToken = default) 220public static Task SendAsync(this HubConnection hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, CancellationToken cancellationToken = default)
HubConnectionExtensions.StreamAsChannelAsync.cs (1)
287private static async Task RunChannel<TResult>(ChannelReader<object?> inputChannel, Channel<TResult> outputChannel)
src\aspnetcore\src\Shared\ValueTaskExtensions\ValueTaskExtensions.cs (2)
13public static Task GetAsTask(this in ValueTask<FlushResult> valueTask) 20return Task.CompletedTask;
src\aspnetcore\src\SignalR\common\Shared\AwaitableThreadPool.cs (1)
29Task.Run(continuation);
src\aspnetcore\src\SignalR\common\Shared\MessageBuffer.cs (3)
89private async Task RunTimer() 191public async Task AckAsync(AckMessage ackMessage) 256internal async Task ResendAsync(PipeWriter writer)
src\aspnetcore\src\SignalR\common\Shared\PipeWriterStream.cs (2)
56public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 72return new ValueTask(Task.FromCanceled(cancellationToken));
src\aspnetcore\src\SignalR\common\Shared\TimerAwaitable.cs (1)
85Task.Run(continuation);
Microsoft.AspNetCore.SignalR.Common (4)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
Microsoft.AspNetCore.SignalR.Core (203)
ClientProxyExtensions.cs (33)
20/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 22public static Task SendAsync(this IClientProxy clientProxy, string method, CancellationToken cancellationToken = default) 35/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 37public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, CancellationToken cancellationToken = default) 51/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 53public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, CancellationToken cancellationToken = default) 68/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 70public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, CancellationToken cancellationToken = default) 86/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 88public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, CancellationToken cancellationToken = default) 105/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 107public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, CancellationToken cancellationToken = default) 125/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 127public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, CancellationToken cancellationToken = default) 146/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 148public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, CancellationToken cancellationToken = default) 168/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 170public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, CancellationToken cancellationToken = default) 191/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 193public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, CancellationToken cancellationToken = default) 215/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 217public static Task SendAsync(this IClientProxy clientProxy, string method, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, CancellationToken cancellationToken = default) 228/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 242/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 257/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 273/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 290/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 308/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 327/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 347/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 368/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 390/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 413/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns>
DefaultHubLifetimeManager.cs (40)
34public override Task AddToGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default) 42return Task.CompletedTask; 51return Task.CompletedTask; 63return Task.CompletedTask; 67public override Task RemoveFromGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default) 75return Task.CompletedTask; 84return Task.CompletedTask; 90return Task.CompletedTask; 94public override Task SendAllAsync(string methodName, object?[] args, CancellationToken cancellationToken = default) 99private Task SendToAllConnections(string methodName, object?[] args, Func<HubConnectionContext, object?, bool>? include, object? state = null, CancellationToken cancellationToken = default) 101List<Task>? tasks = null; 123tasks = new List<Task>(); 138return Task.CompletedTask; 142return Task.WhenAll(tasks); 147private static void SendToGroupConnections(string methodName, object?[] args, ConcurrentDictionary<string, HubConnectionContext> connections, Func<HubConnectionContext, object?, bool>? include, object? state, ref List<Task>? tasks, ref SerializedHubMessage? message, CancellationToken cancellationToken) 168tasks = new List<Task>(); 183public override Task SendConnectionAsync(string connectionId, string methodName, object?[] args, CancellationToken cancellationToken = default) 191return Task.CompletedTask; 202public override Task SendGroupAsync(string groupName, string methodName, object?[] args, CancellationToken cancellationToken = default) 211List<Task>? tasks = null; 217return Task.WhenAll(tasks); 221return Task.CompletedTask; 225public override Task SendGroupsAsync(IReadOnlyList<string> groupNames, string methodName, object?[] args, CancellationToken cancellationToken = default) 228List<Task>? tasks = null; 247return Task.WhenAll(tasks); 250return Task.CompletedTask; 254public override Task SendGroupExceptAsync(string groupName, string methodName, object?[] args, IReadOnlyList<string> excludedConnectionIds, CancellationToken cancellationToken = default) 261List<Task>? tasks = null; 268return Task.WhenAll(tasks); 272return Task.CompletedTask; 286public override Task SendUserAsync(string userId, string methodName, object?[] args, CancellationToken cancellationToken = default) 292public override Task OnConnectedAsync(HubConnectionContext connection) 295return Task.CompletedTask; 299public override Task OnDisconnectedAsync(HubConnectionContext connection) 312return Task.CompletedTask; 316public override Task SendAllExceptAsync(string methodName, object?[] args, IReadOnlyList<string> excludedConnectionIds, CancellationToken cancellationToken = default) 322public override Task SendConnectionsAsync(IReadOnlyList<string> connectionIds, string methodName, object?[] args, CancellationToken cancellationToken = default) 328public override Task SendUsersAsync(IReadOnlyList<string> userIds, string methodName, object?[] args, CancellationToken cancellationToken = default) 384public override Task SetConnectionResultAsync(string connectionId, CompletionMessage result) 387return Task.CompletedTask;
Hub.cs (9)
74/// <returns>A <see cref="Task"/> that represents the asynchronous connect.</returns> 75public virtual Task OnConnectedAsync() 77return Task.CompletedTask; 83/// <returns>A <see cref="Task"/> that represents the asynchronous disconnect.</returns> 84public virtual Task OnDisconnectedAsync(Exception? exception) 86return Task.CompletedTask; 94/// <returns>A <see cref="Task"/> that represents the asynchronous operation.</returns> 105public virtual Task OnAuthenticationRefreshedAsync() 107return Task.CompletedTask;
HubConnectionContext.cs (10)
429private async Task CompleteWriteAsync(ValueTask<FlushResult> task, CancellationToken cancellationToken) 452private async Task WriteSlowAsync(HubMessage message, bool ignoreAbort, CancellationToken cancellationToken) 481private async Task WriteSlowAsync(SerializedHubMessage message, CancellationToken cancellationToken) 523private async Task TryWritePingSlowAsync() 548private async Task WriteHandshakeResponseAsync(HandshakeResponseMessage message) 764internal Task AbortAsync() 777private async Task AbortAsyncSlow() 859static async Task InnerAbortConnection(HubConnectionContext connection) 908internal Task AckAsync(AckMessage ackMessage) 915return Task.CompletedTask;
HubConnectionHandler.cs (6)
113public override async Task OnConnectedAsync(ConnectionContext connection) 321private async Task HandleUserRefreshedAsync(HubConnectionContext connection, ClaimsPrincipal user, SemaphoreSlim authenticationRefreshLock) 381private async Task RunHubAsync(HubConnectionContext connection) 420private async Task HubOnDisconnectedAsync(HubConnectionContext connection, Exception? exception) 459private async Task SendCloseAsync(HubConnectionContext connection, Exception? exception, bool allowReconnect) 483private async Task DispatchMessagesAsync(HubConnectionContext connection)
HubLifetimeManager.cs (28)
19/// <returns>A <see cref="Task"/> that represents the asynchronous connect.</returns> 20public abstract Task OnConnectedAsync(HubConnectionContext connection); 27/// <returns>A <see cref="Task"/> that represents the asynchronous disconnect.</returns> 28public abstract Task OnDisconnectedAsync(HubConnectionContext connection); 36/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 37public abstract Task SendAllAsync(string methodName, object?[] args, CancellationToken cancellationToken = default); 46/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 47public abstract Task SendAllExceptAsync(string methodName, object?[] args, IReadOnlyList<string> excludedConnectionIds, CancellationToken cancellationToken = default); 56/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 57public abstract Task SendConnectionAsync(string connectionId, string methodName, object?[] args, CancellationToken cancellationToken = default); 66/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 67public abstract Task SendConnectionsAsync(IReadOnlyList<string> connectionIds, string methodName, object?[] args, CancellationToken cancellationToken = default); 76/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 77public abstract Task SendGroupAsync(string groupName, string methodName, object?[] args, CancellationToken cancellationToken = default); 86/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 87public abstract Task SendGroupsAsync(IReadOnlyList<string> groupNames, string methodName, object?[] args, CancellationToken cancellationToken = default); 97/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 98public abstract Task SendGroupExceptAsync(string groupName, string methodName, object?[] args, IReadOnlyList<string> excludedConnectionIds, CancellationToken cancellationToken = default); 107/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 108public abstract Task SendUserAsync(string userId, string methodName, object?[] args, CancellationToken cancellationToken = default); 117/// <returns>A <see cref="Task"/> that represents the asynchronous send.</returns> 118public abstract Task SendUsersAsync(IReadOnlyList<string> userIds, string methodName, object?[] args, CancellationToken cancellationToken = default); 126/// <returns>A <see cref="Task"/> that represents the asynchronous add.</returns> 127public abstract Task AddToGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default); 135/// <returns>A <see cref="Task"/> that represents the asynchronous remove.</returns> 136public abstract Task RemoveFromGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default); 157/// <returns>A <see cref="Task"/> that represents the result being set or being forwarded to another server.</returns> 158public virtual Task SetConnectionResultAsync(string connectionId, CompletionMessage result)
IClientProxy.cs (2)
22/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns> 23Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default);
IGroupManager.cs (4)
17/// <returns>A <see cref="Task"/> that represents the asynchronous add.</returns> 18Task AddToGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default); 26/// <returns>A <see cref="Task"/> that represents the asynchronous remove.</returns> 27Task RemoveFromGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default);
IHubFilter.cs (4)
25Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next) => next(context); 34Task OnDisconnectedAsync(HubLifetimeContext context, Exception? exception, Func<HubLifetimeContext, Exception?, Task> next) => next(context, exception);
Internal\ChannelBasedSemaphore.cs (1)
60private async Task RunTask<TState>(Func<TState, Task<bool>> callback, TState state)
Internal\DefaultHubDispatcher.cs (22)
32private readonly Func<HubLifetimeContext, Task>? _onConnectedMiddleware; 33private readonly Func<HubLifetimeContext, Exception?, Task>? _onDisconnectedMiddleware; 83public override async Task OnConnectedAsync(HubConnectionContext connection) 120public override async Task OnDisconnectedAsync(HubConnectionContext connection, Exception? exception) 156public override Task OnAuthenticationRefreshedAsync(HubConnectionContext connection) 199public override Task DispatchMessageAsync(HubConnectionContext connection, HubMessage hubMessage) 209return Task.CompletedTask; 287return Task.CompletedTask; 290private Task ProcessInvocationBindingFailure(HubConnectionContext connection, InvocationBindingFailureMessage bindingFailureMessage) 299private Task ProcessStreamBindingFailure(HubConnectionContext connection, StreamBindingFailureMessage bindingFailureMessage) 312return Task.CompletedTask; 315private Task ProcessStreamItem(HubConnectionContext connection, StreamItemMessage message) 317if (!connection.StreamTracker.TryProcessItem(message, out var processTask)) 320return Task.CompletedTask; 327private Task ProcessInvocation(HubConnectionContext connection, 342return Task.CompletedTask; 407Task? invocation = null; 433static async Task ExecuteInvocation(DefaultHubDispatcher<THub> dispatcher, 588private async Task StreamAsync(string invocationId, HubConnectionContext connection, HubCallerContext hubCallerContext, object?[] arguments, AsyncServiceScope scope, 717if (methodExecutor.MethodReturnType == typeof(Task)) 719await (Task)methodExecutor.Execute(hub, arguments)!; 733private static async Task SendInvocationError(string? invocationId, HubConnectionContext connection, string errorMessage)
Internal\GroupManager.cs (2)
15public Task AddToGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default) 20public Task RemoveFromGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default)
Internal\HubCallerClients.cs (2)
113public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 144public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default)
Internal\HubDispatcher.cs (4)
11public abstract Task OnConnectedAsync(HubConnectionContext connection); 12public abstract Task OnDisconnectedAsync(HubConnectionContext connection, Exception? exception); 13public abstract Task OnAuthenticationRefreshedAsync(HubConnectionContext connection); 14public abstract Task DispatchMessageAsync(HubConnectionContext connection, HubMessage hubMessage);
Internal\HubFilterFactory.cs (4)
39public async Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next) 56public async Task OnDisconnectedAsync(HubLifetimeContext context, Exception? exception, Func<HubLifetimeContext, Exception?, Task> next)
Internal\NonInvokingSingleClientProxy.cs (1)
17public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) =>
Internal\Proxies.cs (9)
19public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 36public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 55public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 72public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 93public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 108public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 125public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 142public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default) 160public Task SendCoreAsync(string method, object?[] args, CancellationToken cancellationToken = default)
Internal\TypedClientBuilder.cs (4)
125bool isInvoke = returnType != typeof(Task); 285if (!typeof(Task).IsAssignableFrom(interfaceMethod.ReturnType)) 288$"Cannot generate proxy implementation for '{typeof(T).FullName}.{interfaceMethod.Name}'. All client proxy methods must return '{typeof(Task).FullName}' or '{typeof(Task).FullName}<T>'.");
ISingleClientProxy.cs (1)
22/// <returns>A <see cref="Task"/> that represents the asynchronous invoke and wait for a client result.</returns>
src\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
400if (methodReturnType == typeof(Task) || methodReturnType == typeof(ValueTask)) 415if (currentType == typeof(Task)) 471(awaitable) => ((Task)awaitable).GetAwaiter(),
src\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (6)
39/// or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>. 49/// to a <see cref="Task{TResult}"/>, or to a <see cref="Task"/>, if <c>TResult</c> is <see href="https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-unit-0.html">FSharp.Core.Unit</see>; 53/// When this method returns, contains the type of the closed generic instantiation of <see cref="Task{TResult}"/> or of <see cref="Task"/> that will be returned 114/// to a void-returning <see cref="Task"/> or <see cref="ValueTask"/>. 145var typeDef when typeDef == typeof(Task<>) && IsFSharpUnit(genericAwaitableType.GetGenericArguments()[0]) => (typeof(Task), MakeTaskOfUnitToTaskExpression(genericAwaitableType)), 155return Expression.Lambda(Expression.Convert(closedGenericTaskParam, typeof(Task)), closedGenericTaskParam);
src\aspnetcore\src\SignalR\common\Shared\MessageBuffer.cs (3)
89private async Task RunTimer() 191public async Task AckAsync(AckMessage ackMessage) 256internal async Task ResendAsync(PipeWriter writer)
src\aspnetcore\src\SignalR\common\Shared\TaskCache.cs (2)
8public static readonly Task<bool> True = Task.FromResult(true); 9public static readonly Task<bool> False = Task.FromResult(false);
StreamTracker.cs (3)
62public bool TryProcessItem(StreamItemMessage message, [NotNullWhen(true)] out Task? task) 127Task WriteToStream(object? item); 157public Task WriteToStream(object? o)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (4)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (4)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
Microsoft.AspNetCore.SignalR.Specification.Tests (99)
HubLifetimeManagerTestBase.cs (24)
32/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 34public async Task SendAllAsyncWritesToAllConnectionsOutput() 63/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 65public async Task SendAllAsyncDoesNotWriteToDisconnectedConnectionsOutput() 93/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 95public async Task SendGroupAsyncWritesToAllConnectionsInGroupOutput() 123/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 125public async Task SendGroupExceptAsyncDoesNotWriteToExcludedConnections() 154/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 156public async Task SendConnectionAsyncWritesToConnectionOutput() 177/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 179public async Task CanProcessClientReturnResult() 204/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 206public async Task CanProcessClientReturnErrorResult() 231/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 233public async Task ExceptionWhenIncorrectClientCompletesClientResult() 267/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 269public async Task ConnectionIDNotPresentWhenInvokingClientResult() 287/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 289public async Task InvokesForMultipleClientsDoNotCollide() 320/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 322public async Task ClientDisconnectsWithoutCompletingClientResult() 345/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 347public async Task CanCancelClientResult()
Internal\TaskExtensions.cs (6)
25if (task == await Task.WhenAny(task, Task.Delay(timeout, cts.Token))) 36public static async Task TimeoutAfter(this Task task, TimeSpan timeout, 49if (task == await Task.WhenAny(task, Task.Delay(timeout, cts.Token)))
ScaleoutHubLifetimeManagerTests.cs (47)
30private static async Task AssertMessageAsync(TestClient client) 41/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 43public async Task InvokeAllAsyncWithMultipleServersWritesToAllConnectionsOutput() 68/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 70public async Task InvokeAllAsyncWithMultipleServersDoesNotWriteToDisconnectedConnectionsOutput() 98/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 100public async Task InvokeConnectionAsyncOnServerWithoutConnectionWritesOutputToConnection() 122/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 124public async Task InvokeGroupAsyncOnServerWithoutConnectionWritesOutputToGroupConnection() 148/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 150public async Task DisconnectConnectionRemovesConnectionFromGroup() 174/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 176public async Task RemoveGroupFromLocalConnectionNotInGroupDoesNothing() 194/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 196public async Task RemoveGroupFromConnectionOnDifferentServerNotInGroupDoesNothing() 215/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 217public async Task AddGroupAsyncForConnectionOnDifferentServerWorks() 240/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 242public async Task AddGroupAsyncForLocalConnectionAlreadyInGroupDoesNothing() 266/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 268public async Task AddGroupAsyncForConnectionOnDifferentServerAlreadyInGroupDoesNothing() 293/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 295public async Task RemoveGroupAsyncForConnectionOnDifferentServerWorks() 324/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 326public async Task InvokeConnectionAsyncForLocalConnectionDoesNotPublishToBackplane() 350/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 352public async Task WritingToRemoteConnectionThatFailsDoesNotThrow() 374/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 376public async Task WritingToGroupWithOneConnectionFailingSecondConnectionStillReceivesMessage() 409/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 411public async Task InvokeUserSendsToAllConnectionsForUser() 437/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 439public async Task StillSubscribedToUserAfterOneOfMultipleConnectionsAssociatedWithUserDisconnects() 470/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 472public async Task CanProcessClientReturnResultAcrossServers() 501/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 503public async Task CanProcessClientReturnErrorResultAcrossServers() 532/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 534public async Task ConnectionIDNotPresentMultiServerWhenInvokingClientResult() 554/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 556public async Task ClientDisconnectsWithoutCompletingClientResultOnSecondServer() 583/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 585public async Task InvocationsFromDifferentServersUseUniqueIDs() 618/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 620public async Task ConnectionDoesNotExist_FailsInvokeConnectionAsync() 633/// <returns>A <see cref="Task"/> representing the asynchronous completion of the test.</returns> 635public async Task ClientReturnResultAcrossServersWithWrongReturnedTypeErrors()
src\aspnetcore\src\Shared\TaskExtensions.cs (8)
34public static Task DefaultTimeout(this Task task, int milliseconds = DefaultTimeoutDuration, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 39public static Task DefaultTimeout(this Task task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 44public static Task DefaultTimeout(this ValueTask task, int milliseconds = DefaultTimeoutDuration, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 49public static Task DefaultTimeout(this ValueTask task, TimeSpan timeout, [CallerFilePath] string filePath = null, [CallerLineNumber] int lineNumber = default) 109public static async Task TimeoutAfter(this Task task, TimeSpan timeout,
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
src\aspnetcore\src\SignalR\common\testassets\Tests.Utils\TaskExtensions.cs (7)
12public static async Task OrThrowIfOtherFails(this Task task, Task otherTask) 14var completed = await Task.WhenAny(task, otherTask); 28public static async Task<T> OrThrowIfOtherFails<T>(this Task<T> task, Task otherTask) 30await OrThrowIfOtherFails((Task)task, otherTask);
src\aspnetcore\src\SignalR\common\testassets\Tests.Utils\TestClient.cs (3)
34public Task Connected => ((TaskCompletionSource)Connection.Items["ConnectedTask"]).Task; 68public async Task<Task> ConnectAsync( 78var connection = handler.OnConnectedAsync(Connection);
Microsoft.AspNetCore.SignalR.StackExchangeRedis (59)
Internal\AckHandler.cs (2)
23public Task CreateAck(int id) 29return Task.CompletedTask;
Internal\RedisSubscriptionManager.cs (4)
13public async Task AddSubscriptionAsync(string id, HubConnectionContext connection, Func<string, HubConnectionStore, Task> subscribeMethod) 42public async Task RemoveSubscriptionAsync(string id, HubConnectionContext connection, object state, Func<object, string, Task> unsubscribeMethod)
RedisHubLifetimeManager.cs (49)
91public override async Task OnConnectedAsync(HubConnectionContext connection) 98var userTask = Task.CompletedTask; 102var connectionTask = SubscribeToConnection(connection); 109await Task.WhenAll(connectionTask, userTask); 113public override Task OnDisconnectedAsync(HubConnectionContext connection) 120return Task.CompletedTask; 124var tasks = new List<Task>(); 149return Task.WhenAll(tasks); 153public override Task SendAllAsync(string methodName, object?[] args, CancellationToken cancellationToken = default) 160public override Task SendAllExceptAsync(string methodName, object?[] args, IReadOnlyList<string> excludedConnectionIds, CancellationToken cancellationToken = default) 167public override Task SendConnectionAsync(string connectionId, string methodName, object?[] args, CancellationToken cancellationToken = default) 184public override Task SendGroupAsync(string groupName, string methodName, object?[] args, CancellationToken cancellationToken = default) 193public override Task SendGroupExceptAsync(string groupName, string methodName, object?[] args, IReadOnlyList<string> excludedConnectionIds, CancellationToken cancellationToken = default) 202public override Task SendUserAsync(string userId, string methodName, object?[] args, CancellationToken cancellationToken = default) 209public override Task AddToGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default) 225public override Task RemoveFromGroupAsync(string connectionId, string groupName, CancellationToken cancellationToken = default) 241public override Task SendConnectionsAsync(IReadOnlyList<string> connectionIds, string methodName, object?[] args, CancellationToken cancellationToken = default) 245var publishTasks = new List<Task>(connectionIds.Count); 253return Task.WhenAll(publishTasks); 257public override Task SendGroupsAsync(IReadOnlyList<string> groupNames, string methodName, object?[] args, CancellationToken cancellationToken = default) 260var publishTasks = new List<Task>(groupNames.Count); 271return Task.WhenAll(publishTasks); 275public override Task SendUsersAsync(IReadOnlyList<string> userIds, string methodName, object?[] args, CancellationToken cancellationToken = default) 280var publishTasks = new List<Task>(userIds.Count); 289return Task.WhenAll(publishTasks); 292return Task.CompletedTask; 302private Task AddGroupAsyncCore(HubConnectionContext connection, string groupName) 312return Task.CompletedTask; 324private async Task RemoveGroupAsyncCore(HubConnectionContext connection, string groupName) 346private async Task SendGroupActionAndWaitForAck(string connectionId, string groupName, GroupAction action) 349var ack = _ackHandler.CreateAck(id); 357private Task RemoveUserAsync(HubConnectionContext connection, string userIdentifier) 437public override Task SetConnectionResultAsync(string connectionId, CompletionMessage result) 440return Task.CompletedTask; 449private async Task SubscribeToAll() 461var tasks = new List<Task>(_connections.Count); 471await Task.WhenAll(tasks); 480private async Task SubscribeToGroupManagementChannel() 516private async Task SubscribeToAckChannel() 528private async Task SubscribeToConnection(HubConnectionContext connection) 583private Task SubscribeToUser(HubConnectionContext connection, string userIdentifier) 597var tasks = new List<Task>(subscriptions.Count); 603await Task.WhenAll(tasks); 613private async Task SubscribeToGroupAsync(string groupChannel, HubConnectionStore groupConnections) 623var tasks = new List<Task>(groupConnections.Count); 634await Task.WhenAll(tasks); 643private async Task SubscribeToReturnResultsAsync() 734private async Task EnsureRedisServerConnection()
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (4)
138public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 191private async Task CopyToSlowAsync(Stream destination, CancellationToken cancellationToken) 277public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
Microsoft.AspNetCore.SpaProxy (10)
SpaProxyLaunchManager.cs (7)
21private Task? _launchTask; 53async Task UpdateStatus(Task launchTask) 125private async Task StartSpaProcessAndProbeForLiveness(CancellationToken cancellationToken) 146await Task.Delay(1000, cancellationToken); 317public Task StopAsync() 320return Task.CompletedTask;
SpaProxyMiddleware.cs (2)
44public Task Invoke(HttpContext context) 53private async Task InvokeCore(HttpContext context)
SpaProxyStartupFilter.cs (1)
36async Task StartIfNotRunning()
Microsoft.AspNetCore.SpaServices.Extensions (21)
AngularCli\AngularCliBuilder.cs (1)
39public async Task Build(ISpaBuilder spaBuilder)
AngularCli\AngularCliMiddleware.cs (2)
97private static async Task WaitForAngularCliServerToAcceptRequests(Uri cliServerUri) 120await Task.Delay(500);
Prerendering\ISpaPrerendererBuilder.cs (2)
20/// <returns>A <see cref="Task"/> representing completion of the build process.</returns> 21Task Build(ISpaBuilder spaBuilder);
Proxying\ConditionalProxyMiddleware.cs (2)
43public Task Invoke(HttpContext context) 52private async Task InvokeCore(HttpContext context)
Proxying\SpaProxy.cs (4)
165private static async Task CopyProxyHttpResponse(HttpContext context, HttpResponseMessage responseMessage, CancellationToken cancellationToken) 263await Task.WhenAll( 272private static async Task PumpWebSocket(WebSocket source, WebSocket destination, int bufferSize, CancellationToken cancellationToken) 296await Task.Delay(100, cancellationToken);
Proxying\SpaProxyingExtensions.cs (2)
46() => Task.FromResult(baseUri)); 55/// <param name="baseUriTaskFactory">A callback that will be invoked on each request to supply a <see cref="Task"/> that resolves with the target base URI to which requests should be proxied.</param>
Util\EventedStreamReader.cs (2)
30Task.Factory.StartNew(Run, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 74private async Task Run()
Util\TaskTimeoutExtensions.cs (6)
8public static async Task WithTimeout(this Task task, TimeSpan timeoutDelay, string message) 10if (task == await Task.WhenAny(task, Task.Delay(timeoutDelay))) 22if (task == await Task.WhenAny(task, Task.Delay(timeoutDelay)))
Microsoft.AspNetCore.StaticAssets (11)
Development\StaticAssetDevelopmentRuntimeHandler.cs (5)
164public Task CompleteAsync() 174public Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellationToken = default) 224return Task.CompletedTask; 242public Task StartAsync(CancellationToken cancellationToken = default) 306return Task.CompletedTask;
StaticAssetsInvoker.cs (6)
89private Task ApplyResponseHeadersAsync(StaticAssetInvocationContext context, int statusCode) 111return Task.CompletedTask; 114private Task SendStatusAsync(StaticAssetInvocationContext context, int statusCode) 127public async Task Invoke(HttpContext context) 189private async Task SendAsync(StaticAssetInvocationContext context) 204private async Task SendRangeAsync(StaticAssetInvocationContext requestContext, RangeItemHeaderValue? range)
Microsoft.AspNetCore.StaticFiles (18)
DefaultFilesMiddleware.cs (2)
49public Task Invoke(HttpContext context) 72return Task.CompletedTask;
DirectoryBrowserMiddleware.cs (2)
61public Task Invoke(HttpContext context) 74return Task.CompletedTask;
HtmlDirectoryFormatter.cs (2)
35public virtual Task GenerateContentAsync(HttpContext context, IEnumerable<IFileInfo> contents) 45return Task.CompletedTask;
IDirectoryFormatter.cs (1)
19Task GenerateContentAsync(HttpContext context, IEnumerable<IFileInfo> contents);
StaticFileContext.cs (6)
243public Task ApplyResponseHeadersAsync(int statusCode) 278return Task.CompletedTask; 297public Task SendStatusAsync(int statusCode) 304public async Task ServeStaticFile(HttpContext context, RequestDelegate next) 350public async Task SendAsync() 366internal async Task SendRangeAsync()
StaticFileMiddleware.cs (2)
58public Task Invoke(HttpContext context) 111private Task TryServeStaticFile(HttpContext context, string? contentType, PathString subPath)
StaticFileOptions.cs (3)
16internal static readonly Func<StaticFileResponseContext, Task> _defaultOnPrepareResponseAsync = _ => Task.CompletedTask; 78public Func<StaticFileResponseContext, Task> OnPrepareResponseAsync { get; set; }
Microsoft.AspNetCore.TestHost (45)
ApplicationWrapper.cs (3)
13internal abstract Task ProcessRequestAsync(object context); 49internal override Task ProcessRequestAsync(object context) 54Task IHttpApplication<TContext>.ProcessRequestAsync(TContext context)
AsyncStreamWrapper.cs (2)
37public override Task FlushAsync(CancellationToken cancellationToken) 102public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
HttpContextBuilder.cs (7)
28private Func<PipeWriter, Task>? _sendRequestStream; 68internal void SendRequestStream(Func<PipeWriter, Task> sendRequestStream) 89async Task RunRequestAsync() 108var requestTask = _sendRequestStream(_requestPipe.Writer); 157_ = Task.Factory.StartNew(RunRequestAsync, default, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 204internal async Task CompleteResponseAsync() 212internal async Task ReturnResponseMessageAsync()
NoopHostLifetime.cs (4)
10public Task StopAsync(CancellationToken cancellationToken) 12return Task.CompletedTask; 15public Task WaitForStartAsync(CancellationToken cancellationToken) 17return Task.CompletedTask;
ResponseBodyPipeWriter.cs (4)
11private readonly Func<Task> _onFirstWriteAsync; 17internal ResponseBodyPipeWriter(Pipe pipe, Func<Task> onFirstWriteAsync) 33private Task FirstWriteAsync() 40return Task.CompletedTask;
ResponseBodyReaderStream.cs (3)
56public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask; 61public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => throw new NotSupportedException();
ResponseBodyWriterStream.cs (2)
52public override async Task FlushAsync(CancellationToken cancellationToken) 68public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
ResponseFeature.cs (11)
15private Func<Task> _responseStartingAsync = () => Task.CompletedTask; 16private Func<Task> _responseCompletedAsync = () => Task.CompletedTask; 74public void OnStarting(Func<object, Task> callback, object state) 89public void OnCompleted(Func<object, Task> callback, object state) 105public async Task FireOnSendingHeadersAsync() 121public Task FireOnResponseCompletedAsync() 126public async Task StartAsync(CancellationToken token = default) 143public Task SendFileAsync(string path, long offset, long? count, CancellationToken cancellation) 148public Task CompleteAsync()
TestServer.cs (4)
251Task IServer.StartAsync<TContext>(IHttpApplication<TContext> application, CancellationToken cancellationToken) 258return Task.CompletedTask; 261Task IServer.StopAsync(CancellationToken cancellationToken) 263return Task.CompletedTask;
TestWebSocket.cs (5)
46public override async Task CloseAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) 69public override async Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) 154public override Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) 278public Task SendAsync(Message message) 297return Task.FromResult(true);
Microsoft.AspNetCore.Testing.Tests (11)
FakesExtensionsTests.cs (7)
30public async Task UseTestStartup_UsesFakeStartup() 40public async Task ListenHttpOnAnyPort_AddsListener() 50public async Task ListenHttpsOnAnyPort_WithoutCertificate_CertificateProvided() 69public async Task ListenHttpsOnAnyPort_WithCertificate_UsesTheCertificate() 83public async Task CreateClient_HandlerGiven_UsesTheHandler() 158public async Task CreateClient_UsingHttpsWithoutCertificate_CreatesCertificateAndMakesItWorking() 170public async Task CreateClient_UsingHttp_CreatesClient()
TestResources\ReturningHttpClientHandler.cs (1)
22return Task.FromResult(new HttpResponseMessage(HttpStatusCode.Gone));
TestResources\Startup.cs (2)
19public void Configure(IApplicationBuilder app) => app.Use((HttpContext _, Func<Task> _) => Task.CompletedTask);
TestResources\TestHandler.cs (1)
16return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK));
Microsoft.AspNetCore.Watch.BrowserRefresh (13)
src\sdk\src\Dotnet.Watch\Web.Middleware\BlazorWasmHotReloadMiddleware.cs (4)
50public Task InvokeAsync(HttpContext context) 67return Task.CompletedTask; 74private async Task OnGet(HttpContext context) 85private async Task OnPost(HttpContext context)
src\sdk\src\Dotnet.Watch\Web.Middleware\BrowserRefreshMiddleware.cs (2)
38public async Task InvokeAsync(HttpContext context) 124return Task.CompletedTask;
src\sdk\src\Dotnet.Watch\Web.Middleware\BrowserScriptMiddleware.cs (1)
37public async Task InvokeAsync(HttpContext context)
src\sdk\src\Dotnet.Watch\Web.Middleware\HostingStartup.cs (1)
45return Task.CompletedTask;
src\sdk\src\Dotnet.Watch\Web.Middleware\ResponseStreamWrapper.cs (3)
35private Task? _gzipCopyTask; 59public override async Task FlushAsync(CancellationToken cancellationToken) 83public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
src\sdk\src\Dotnet.Watch\Web.Middleware\ScriptInjectingStream.cs (2)
43public override Task FlushAsync(CancellationToken cancellationToken) 75public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Microsoft.AspNetCore.WebSockets (5)
AbortStream.cs (2)
95public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 110public override Task FlushAsync(CancellationToken cancellationToken)
WebSocketMiddleware.cs (3)
55/// <returns>The <see cref="Task"/> that represents the completion of the middleware pipeline.</returns> 56public Task Invoke(HttpContext context) 80return Task.CompletedTask;
Microsoft.AspNetCore.WebUtilities (57)
BufferedReadStream.cs (2)
178public override Task FlushAsync(CancellationToken cancellationToken) 196public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
FileBufferingReadStream.cs (3)
409public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 427public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 440async Task CopyToAsyncImpl()
FileBufferingWriteStream.cs (7)
140public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 184public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask; 194/// <returns>A <see cref="Task" /> that represents the asynchronous drain operation.</returns> 195public async Task DrainBufferAsync(Stream destination, CancellationToken cancellationToken = default) 219/// <returns>A <see cref="Task" /> that represents the asynchronous drain operation.</returns> 221public async Task DrainBufferAsync(PipeWriter destination, CancellationToken cancellationToken = default)
FormReader.cs (2)
168private async Task ReadNextPairAsyncImpl(CancellationToken cancellationToken = new CancellationToken()) 270private async Task BufferAsync(CancellationToken cancellationToken)
HttpResponseStreamWriter.cs (36)
193public override Task WriteAsync(char value) 209return Task.CompletedTask; 213private async Task WriteAsyncAwaited(char value) 224public override Task WriteAsync(char[] values, int index, int count) 233return Task.CompletedTask; 241return Task.CompletedTask; 249private async Task WriteAsyncAwaited(char[] values, int index, int count) 266public override Task WriteAsync(string? value) 275return Task.CompletedTask; 283return Task.CompletedTask; 291private async Task WriteAsyncAwaited(string value) 312public override Task WriteAsync(ReadOnlyMemory<char> value, CancellationToken cancellationToken = default) 321return Task.FromCanceled(cancellationToken); 326return Task.CompletedTask; 334return Task.CompletedTask; 342private async Task WriteAsyncAwaited(ReadOnlyMemory<char> value) 364public override Task WriteLineAsync(ReadOnlyMemory<char> value, CancellationToken cancellationToken = default) 373return Task.FromCanceled(cancellationToken); 378return Task.CompletedTask; 387return Task.CompletedTask; 395private async Task WriteLineAsyncAwaited(ReadOnlyMemory<char> value) 402public override Task WriteLineAsync(char[] values, int index, int count) 411return Task.CompletedTask; 422return Task.CompletedTask; 430private async Task WriteLineAsyncAwaited(char[] values, int index, int count) 437public override Task WriteLineAsync(char value) 453return Task.CompletedTask; 461private async Task WriteLineAsyncAwaited(char value) 468public override Task WriteLineAsync(string? value) 477return Task.CompletedTask; 488return Task.CompletedTask; 496private async Task WriteLineAsyncAwaited(string value) 514public override Task FlushAsync() 591private async Task FlushInternalAsync(bool flushEncoder) 672private static Task GetObjectDisposedTask() 674return Task.FromException(new ObjectDisposedException(nameof(HttpResponseStreamWriter)));
MultipartReaderStream.cs (2)
124public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 374public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
PagedByteBuffer.cs (2)
81public async Task MoveToAsync(PipeWriter writer, CancellationToken cancellationToken) 98public async Task MoveToAsync(Stream stream, CancellationToken cancellationToken)
StreamHelperExtensions.cs (3)
24public static Task DrainAsync(this Stream stream, CancellationToken cancellationToken) 39public static Task DrainAsync(this Stream stream, long? limit, CancellationToken cancellationToken) 55public static async Task DrainAsync(this Stream stream, ArrayPool<byte> bytePool, long? limit, CancellationToken cancellationToken)
Microsoft.Bcl.TimeProvider (13)
System\Threading\Tasks\TimeProviderTaskExtensions.cs (13)
7/// Provides extensions methods for <see cref="Task"/> operations with <see cref="TimeProvider"/>. 49public static Task Delay(this TimeProvider timeProvider, TimeSpan delay, CancellationToken cancellationToken = default) 52return Task.Delay(delay, timeProvider, cancellationToken); 121/// Gets a <see cref="Task"/> that will complete when this <see cref="Task"/> completes, when the specified timeout expires, or when the specified <see cref="CancellationToken"/> has cancellation requested. 124/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 127/// <returns>The <see cref="Task"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns> 130public static Task WaitAsync(this Task task, TimeSpan timeout, TimeProvider timeProvider, CancellationToken cancellationToken = default) 211/// Gets a <see cref="Task"/> that will complete when this <see cref="Task"/> completes, when the specified timeout expires, or when the specified <see cref="CancellationToken"/> has cancellation requested. 214/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 217/// <returns>The <see cref="Task"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns>
Microsoft.Build (74)
BackEnd\BuildManager\BuildManager.cs (3)
645_ = Task.Run(() => 1137Task projectCacheDispose = _projectCacheService!.DisposeAsync().AsTask(); 1785Task.Factory.StartNew(
BackEnd\BuildManager\LegacyThreadingData.cs (1)
139internal Task GetLegacyThreadInactiveTask(int submissionId)
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (8)
122Task[] waitForExitTasks = waitForExit && contextsToShutDown.Count > 0 ? new Task[contextsToShutDown.Count] : null; 152Task.WaitAll(waitForExitTasks); 1108var ignored = RunPacketReadLoopAsync(); 1114public async Task RunPacketReadLoopAsync() 1381public async Task WaitForExitAsync(ILoggingService loggingService) 1388await Task.Delay(100, _packetQueueDrainDelayCancellation.Token).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing); 1412await Task.Delay(delay).ConfigureAwait(false);
BackEnd\Components\ProjectCache\Experimental\ProjectCachePluginBase.cs (4)
24public abstract Task BeginBuildAsync( 45public abstract Task EndBuildAsync(PluginLoggerBase logger, CancellationToken cancellationToken); 68public virtual Task HandleProjectFinishedAsync( 72CancellationToken cancellationToken) => Task.CompletedTask;
BackEnd\Components\ProjectCache\ProjectCachePluginBase.cs (4)
22public abstract Task BeginBuildAsync( 43public abstract Task EndBuildAsync(PluginLoggerBase logger, CancellationToken cancellationToken); 66public virtual Task HandleProjectFinishedAsync( 70CancellationToken cancellationToken) => Task.CompletedTask;
BackEnd\Components\ProjectCache\ProjectCacheService.cs (12)
112Task.Run( 148Task.Run( 514Task.Run( 808public async Task HandleBuildResultAsync( 886Task[] tasks = new Task[projectCacheDescriptors.Count]; 890tasks[idx++] = Task.Run( 933await Task.WhenAll(tasks).ConfigureAwait(false); 969Task[] cleanupTasks = new Task[_projectCachePlugins.Count]; 973cleanupTasks[idx++] = Task.Run(async () => 1017await Task.WhenAll(cleanupTasks).ConfigureAwait(false);
BackEnd\Components\RequestBuilder\IntrinsicTasks\CallTarget.cs (1)
92return Task.FromResult(true);
BackEnd\Components\RequestBuilder\IRequestBuilderCallback.cs (1)
38Task BlockOnTargetInProgress(int blockingRequestId, string blockingTarget, BuildResult partialBuildResult);
BackEnd\Components\RequestBuilder\RequestBuilder.cs (13)
67private Task _requestTask; 400public async Task BlockOnTargetInProgress(int blockingGlobalRequestId, string blockingTarget, BuildResult partialBuildResult = null) 657_requestTask = Task.Factory.StartNew( 676return Task.FromResult<object>(null); 694_requestTask = Task.Factory.StartNew( 706_requestTask = Task.Factory.StartNew( 773private async Task RequestThreadProc(bool setThreadParameters) 1582private readonly BlockingCollection<Task> _tasks = new BlockingCollection<Task>(); 1585protected override void QueueTask(Task task) 1591protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) => false; 1593protected override IEnumerable<Task> GetScheduledTasks() => _tasks; 1621foreach (Task t in _tasks.GetConsumingEnumerable())
BackEnd\Components\RequestBuilder\TargetBuilder.cs (3)
337Task IRequestBuilderCallback.BlockOnTargetInProgress(int blockingGlobalBuildRequestId, string blockingTarget, BuildResult partialBuildResult) 338=> InternalError.Throw<Task>("This method should never be called by anyone except the TargetBuilder."); 404private async Task ProcessTargetStack(ITaskBuilder taskBuilder)
BackEnd\Components\RequestBuilder\TargetEntry.cs (1)
417internal async Task ExecuteTarget(ITaskBuilder taskBuilder, BuildRequestEntry requestEntry, ProjectLoggingContext projectLoggingContext, CancellationToken cancellationToken)
BackEnd\Components\Scheduler\Scheduler.cs (2)
639return Task.FromResult(0); 655return Task.FromResult(grantedCores);
BackEnd\Node\OutOfProcServerNode.cs (1)
389Task.Run(() =>
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (2)
33using Task = System.Threading.Tasks.Task; 895Task.Run(async delegate
Graph\ParallelWorkSet.cs (5)
38private readonly List<Task> _tasks; 92_tasks = new List<Task>(degreeOfParallelism); 148Task.WaitAll( 161private Task CreateProcessorItemTask() 163return Task.Run(
Logging\BinaryLogger\Postprocessing\SubStream.cs (1)
46public override Task FlushAsync(CancellationToken cancellationToken) => _stream.FlushAsync(cancellationToken);
Logging\BinaryLogger\Postprocessing\TransparentReadStream.cs (1)
80public override Task FlushAsync(CancellationToken cancellationToken)
Logging\BinaryLogger\ProjectImportsCollector.cs (2)
37private Task _currentTask = Task.CompletedTask;
src\9f0d3f3da306d8cf\IEnumerableExtensions.cs (1)
555return (await Task.WhenAll(sequence.Select(item => selector(item, cancellationToken))).ConfigureAwait(false)).Flatten();
src\msbuild\src\Shared\NodeEndpointOutOfProcBase.cs (1)
411Task connectionTask = localPipeServer.WaitForConnectionAsync();
Utilities\AwaitExtensions.cs (7)
82internal static Task ToTask(this WaitHandle handle, int timeout = Timeout.Infinite) 158private readonly ConcurrentQueue<Task> _queuedTasks = new ConcurrentQueue<Task>(); 163protected override System.Collections.Generic.IEnumerable<Task> GetScheduledTasks() 171protected override void QueueTask(Task task) 177Task t; 194protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
Microsoft.Build.Framework (4)
src\msbuild\artifacts\.packages\microsoft.codeanalysis.contracts\5.0.0-1.25277.114\contentFiles\cs\net9.0\ErrorReporting\FatalError.cs (4)
229public static Task ReportNonFatalErrorAsync(this Task task) 239public static Task ReportNonFatalErrorUnlessCancelledAsync(this Task task, CancellationToken cancellationToken)
Microsoft.Build.NuGetSdkResolver (5)
NuGetSdkLogger.cs (4)
113public Task LogAsync(LogLevel level, string data) 117return Task.CompletedTask; 121public Task LogAsync(ILogMessage message) 125return Task.CompletedTask;
NuGetSdkResolver.cs (1)
208var restoreTask = Task.Run(() => RestoreRunnerEx.RunWithoutCommit(
Microsoft.Build.Tasks.CodeAnalysis (17)
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (3)
160public async Task WriteAsync(Stream outStream, CancellationToken cancellationToken = default(CancellationToken)) 282public async Task WriteAsync(Stream outStream, 675internal static async Task ReadAllAsync(
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (10)
163internal static async Task WaitForServerProcessExitAsync( 173await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken).ConfigureAwait(false); 240return Task.FromResult<NamedPipeClientStream?>(null); 251return Task.FromResult<NamedPipeClientStream?>(null); 271return Task.FromResult<NamedPipeClientStream?>(null); 315var monitorTask = MonitorDisconnectAsync(pipeStream, request.RequestId, logger, serverCts.Token); 316await Task.WhenAny(responseTask, monitorTask).ConfigureAwait(false); 352internal static async Task MonitorDisconnectAsync( 365await Task.Delay(millisecondsDelay: 100, cancellationToken).ConfigureAwait(false); 414await Task.Run(() => pipeStream.ConnectAsync(timeoutMs, cancellationToken), cancellationToken).ConfigureAwait(false);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
232public static Task ReportNonFatalErrorAsync(this Task task) 242public static Task ReportNonFatalErrorUnlessCancelledAsync(this Task task, CancellationToken cancellationToken)
Microsoft.Build.Tasks.Core (20)
AssemblyDependency\Node\OutOfProcRarNode.cs (7)
89Task nodeEndpointTasks = Task.Run(() => RunNodeEndpointsAsync(linkedCts.Token), linkedCts.Token); 126private async Task RunNodeEndpointsAsync(CancellationToken cancellationToken) 137Task[] endpointTasks = new Task[endpoints.Length]; 143endpointTasks[i] = Task.Run(() => endpoint.RunAsync(cancellationToken), cancellationToken); 148await Task.WhenAll(endpointTasks);
AssemblyDependency\Node\OutOfProcRarNodeEndpoint.cs (4)
45internal async Task RunAsync(CancellationToken cancellationToken = default) 62private async Task RunInternalAsync(CancellationToken cancellationToken) 66Task logEventTask = Task.Run(
AssemblyDependency\Node\RarNodeBuildEngine.cs (2)
114internal async Task ProcessEventsAsync(CancellationToken cancellationToken) 147internal async Task FlushEventsAsync(CancellationToken cancellationToken)
DownloadFile.cs (3)
12using Task = System.Threading.Tasks.Task; 124await Task.Delay(RetryDelayMilliseconds, cancellationToken).ConfigureAwait(false); 150private async Task DownloadAsync(Uri uri, CancellationToken cancellationToken)
src\msbuild\src\Shared\NodePipeBase.cs (1)
140internal async Task WritePacketAsync(INodePacket packet, CancellationToken cancellationToken = default)
TarDirectory.cs (1)
474private static async System.Threading.Tasks.Task WriteStampedEntryAsync(TarWriter writer, TarEntryFormat format, FileSystemInfo info, string entryName, DateTimeOffset timestamp, CancellationToken cancellationToken)
Untar.cs (2)
268/// <returns>A <see cref="System.Threading.Tasks.Task"/> that completes when all entries have been processed.</returns> 269private async System.Threading.Tasks.Task ExtractAsync(TarReader reader, DirectoryInfo destinationDirectory)
Microsoft.CodeAnalysis (54)
DiagnosticAnalyzer\AnalyzerDriver.cs (30)
322private Task? _lazyInitializeTask; 332private Task? _lazyPrimaryTask; 412_lazyInitializeTask = Task.Run(async () => 453_lazyInitializeTask = Task.FromCanceled(new CancellationToken(canceled: true)); 456_lazyPrimaryTask = Task.FromCanceled(new CancellationToken(canceled: true)); 645internal async Task AttachQueueAndProcessAllEventsAsync(AsyncQueue<CompilationEvent> eventQueue, AnalysisScope analysisScope, CancellationToken cancellationToken) 656_lazyPrimaryTask = Task.FromResult(true); 662_lazyPrimaryTask ??= Task.FromCanceled(new CancellationToken(canceled: true)); 696_lazyPrimaryTask = Task.FromCanceled(new CancellationToken(canceled: true)); 704private async Task ExecutePrimaryAnalysisTaskAsync(AnalysisScope analysisScope, bool usingPrePopulatedEventQueue, CancellationToken cancellationToken) 726private static void OnDriverException(Task faultedTask, AnalyzerExecutor analyzerExecutor, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 1109var tasks = ArrayBuilder<Task>.GetInstance(); 1117var task = Task.Run( 1124Task.WaitAll(tasks.ToArray(), cancellationToken); 1439public Task WhenInitializedTask 1451public Task WhenCompletedTask 1523private async Task ProcessCompilationEventsAsync(AnalysisScope analysisScope, bool prePopulatedEventQueue, CancellationToken cancellationToken) 1540workerTasks[i] = Task.Run(async () => await ProcessCompilationEventsCoreAsync(analysisScope, prePopulatedEventQueue, cancellationToken).ConfigureAwait(false)); 1546var syntaxTreeActionsTask = analysisScope.SyntaxTrees.Any() 1547? Task.Run(() => ExecuteSyntaxTreeActions(analysisScope, cancellationToken), cancellationToken) 1548: Task.CompletedTask; 1551var additionalFileActionsTask = analysisScope.AdditionalFiles.Any() 1552? Task.Run(() => ExecuteAdditionalFileActions(analysisScope, cancellationToken), cancellationToken) 1553: Task.CompletedTask; 1558await Task.WhenAll(workerTasks.Concat(syntaxTreeActionsTask).Concat(additionalFileActionsTask)).ConfigureAwait(false); 1649private async Task ProcessEventAsync(CompilationEvent e, AnalysisScope analysisScope, CancellationToken cancellationToken) 1671private async Task OnEventProcessedCoreAsync(CompilationEvent compilationEvent, ImmutableArray<DiagnosticAnalyzer> processedAnalyzers, AnalysisScope analysisScope, CancellationToken cancellationToken) 1700async Task onSymbolAndMembersProcessedAsync(ISymbol symbol, DiagnosticAnalyzer analyzer) 1718async Task processContainerOnMemberCompletedAsync(INamespaceOrTypeSymbol containerSymbol, ISymbol processedMemberSymbol, DiagnosticAnalyzer analyzer)
DiagnosticAnalyzer\AnalyzerManager.AnalyzerExecutionContext.cs (3)
91return Task.Run(() => 118_lazyCompilationScopeTask = Task.Run(() => 153symbolScopeTask = Task.Run(() => getSymbolAnalysisScopeCore(), cancellationToken);
DiagnosticAnalyzer\AsyncQueue.cs (3)
218public Task WhenCompletedTask 239? Task.FromResult(result.Value) 240: Task.FromCanceled<TElement>(new CancellationToken(canceled: true));
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (2)
678private async Task ComputeAnalyzerDiagnosticsAsync(AnalysisScope? analysisScope, CancellationToken cancellationToken) 816static async Task attachQueueAndProcessAllEventsAsync(
DiagnosticAnalyzer\ShadowCopyAnalyzerPathResolver.cs (5)
65internal Task DeleteLeftoverDirectoriesTask { get; } 131DeleteLeftoverDirectoriesTask = Task.Run(DeleteLeftoverDirectories); 134internal static Task CleanLegacyShadowDirectoryAsync(string legacyShadowDirectory) 138return Task.Run(() => 147return Task.CompletedTask;
EmbeddedText.cs (1)
376public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Hashing\NonCryptographicHashAlgorithm.cs (2)
148public Task AppendAsync(Stream stream, CancellationToken cancellationToken = default) 158private async Task AppendAsyncCore(Stream stream, CancellationToken cancellationToken)
InternalSpecialType.cs (2)
72/// Indicates that the type is <see cref="System.Threading.Tasks.Task"/> from the COR library. 75/// Check for this special type cannot be used to find the "canonical" definition of <see cref="System.Threading.Tasks.Task"/>
InternalUtilities\PerformanceSensitiveAttribute.cs (1)
93/// <see cref="System.Threading.Tasks.Task"/>, either through caching the result or by using
PEWriter\DebugSourceDocument.cs (2)
40_sourceInfo = Task.Run(sourceInfo); 50_sourceInfo = Task.FromResult(new DebugSourceInfo(checksum, algorithm));
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
602return (await Task.WhenAll(sequence.Select(item => selector(item, cancellationToken))).ConfigureAwait(false)).Flatten();
Syntax\SyntaxReference.cs (1)
40return Task.FromResult(this.GetSyntax(cancellationToken));
Syntax\SyntaxTree.cs (1)
122return Task.FromResult(this.TryGetText(out SourceText? text) ? text : this.GetText(cancellationToken));
Microsoft.CodeAnalysis.Analyzers (148)
FixAnalyzers\FixerWithFixAllAnalyzer.Fixer.cs (1)
36public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.cs (3)
48public override Task RegisterCodeFixesAsync(CodeFixContext context) 102return Task.CompletedTask; 109return Task.FromResult(project.Solution);
MetaAnalyzers\Fixers\ApplyDiagnosticAnalyzerAttributeFix.cs (2)
20public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 78return Task.FromResult(document.WithSyntaxRoot(newRoot));
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (2)
34public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 62return Task.CompletedTask;
MetaAnalyzers\Fixers\ConfigureGeneratedCodeAnalysisFix.cs (2)
28public override Task RegisterCodeFixesAsync(CodeFixContext context) 40return Task.CompletedTask;
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.cs (1)
39public override async Task RegisterCodeFixesAsync(CodeFixContext context)
MetaAnalyzers\Fixers\EnableConcurrentExecutionFix.cs (2)
27public override Task RegisterCodeFixesAsync(CodeFixContext context) 39return Task.CompletedTask;
MetaAnalyzers\Fixers\PreferIsKindFix.cs (2)
22public override Task RegisterCodeFixesAsync(CodeFixContext context) 34return Task.CompletedTask;
src\0bf6ba47805c8821\AbstractMoveDeclarationNearReferenceService.cs (1)
118private static async Task MoveDeclarationToFirstReferenceAsync(
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
148public Task AppendAsync(Stream stream, CancellationToken cancellationToken = default) 158private async Task AppendAsyncCore(Stream stream, CancellationToken cancellationToken)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\PerformanceSensitiveAttribute.cs (1)
93/// <see cref="System.Threading.Tasks.Task"/>, either through caching the result or by using
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
602return (await Task.WhenAll(sequence.Select(item => selector(item, cancellationToken))).ConfigureAwait(false)).Flatten();
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
232public static Task ReportNonFatalErrorAsync(this Task task) 242public static Task ReportNonFatalErrorUnlessCancelledAsync(this Task task, CancellationToken cancellationToken)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (1)
44public new Task WaitUntilCurrentBatchCompletesAsync()
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (3)
98private Task<(bool ranToCompletion, TResult? result)> _updateTask = Task.FromResult((ranToCompletion: true, default(TResult?))); 228async Task<(bool ranToCompletion, TResult? result)> ContinueAfterDelayAsync(Task lastTask) 244await Task.Yield().ConfigureAwait(false);
src\roslyn\src\Dependencies\Threading\ConfiguredYieldAwaitable.cs (1)
16/// <see cref="Task.Yield"/>.
src\roslyn\src\Dependencies\Threading\ParallelExtensions.cs (4)
30public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 33public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 36public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 39public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body)
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (21)
37public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 55public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 72public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 118return Task.FromCanceled(cancellationToken); 122Func<object, Task> taskBody = static async o => 204return Task.FromException(e); 215public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 233public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 250public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 283return Task.FromCanceled(cancellationToken); 287Func<object, Task> taskBody = static async o => 369return Task.FromException(e); 395private readonly Func<object, Task> _taskBody; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 468System.Threading.Tasks.Task.Factory.StartNew(_taskBody!, this, default(CancellationToken), TaskCreationOptions.DenyChildAttach, _scheduler); 478public Task AcquireLock() 584IEnumerable<TSource> source, Func<object, Task> taskBody, 610IAsyncEnumerable<TSource> source, Func<object, Task> taskBody, 637T fromExclusive, T toExclusive, Func<object, Task> taskBody,
src\roslyn\src\Dependencies\Threading\ProducerConsumer.cs (35)
25Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 46public static Task RunAsync<TArgs>( 48Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 49Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 64public static Task RunAsync<TArgs>( 66Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 67Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 87public static Task RunParallelAsync<TSource, TArgs>( 89Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 90Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 101public static Task RunParallelAsync<TSource, TArgs>( 103Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 104Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 124public static Task RunParallelAsync<TSource, TArgs>( 126Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 127Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 138public static Task RunParallelAsync<TSource, TArgs>( 140Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 141Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 159Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 173Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 193Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 206Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 225Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 249Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 283/// Equivalent to <see cref="RunParallelAsync{TSource, TArgs}(IEnumerable{TSource}, Func{TSource, Action{TItem}, TArgs, CancellationToken, Task}, TArgs, CancellationToken)"/>, 290Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 321Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 342var writeTask = ProduceItemsAndWriteToChannelAsync(); 344await Task.WhenAll(writeTask, readTask).ConfigureAwait(false); 350await Task.Yield().ConfigureAwait(false); 354Task ProduceItemsAndWriteToChannelAsync() 359await Task.Yield().ConfigureAwait(false); 375private static async Task PerformActionAndCloseWriterAsync<TArgs>( 376Func<TArgs, CancellationToken, Task> action,
src\roslyn\src\Dependencies\Threading\TaskExtensions.cs (5)
25public static NoThrowTaskAwaitable NoThrowAwaitableInternal(this Task task, bool captureContext = true) 38private readonly Task _task; 50public NoThrowTaskAwaitable(Task task, bool captureContext) 74private readonly Task _task; 86public NoThrowTaskAwaiter(Task task, bool captureContext)
src\roslyn\src\Dependencies\Threading\YieldAwaitableExtensions.cs (4)
15/// Implements <c>ConfigureAwait(bool)</c> for <see cref="Task.Yield"/>. The resulting behavior in asynchronous code 16/// is the same as one would expect for <see cref="Task.ConfigureAwait(bool)"/>. 18/// <param name="awaitable">The awaitable provided by <see cref="Task.Yield"/>.</param> 19/// <param name="continueOnCapturedContext"><inheritdoc cref="Task.ConfigureAwait(bool)"/></param>
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (3)
258return Task.FromCanceled<CodeAnalysisMetricData>(context.CancellationToken); 324=> (await Task.WhenAll( 329select Task.Run(() => ComputeAsync(child, context))).ConfigureAwait(false)).ToImmutableArray();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
22Task AnalyzeAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy.cs (1)
24asynchronousComputeFunction: static (outerArg, cancellationToken) => Task.FromResult(outerArg.synchronousComputeFunction(outerArg.arg, cancellationToken)),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (5)
93/// Creates an AsyncLazy that always returns the value, analogous to <see cref="Task.FromResult{T}" />. 97_cachedResult = Task.FromResult(value); 297CompleteWithTask(Task.FromException<T>(ex), CancellationToken.None); 302CompleteWithTask(Task.FromResult(result), CancellationToken.None); 331return Task.FromCanceled<T>(cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (6)
62private Task _updateTask = Task.CompletedTask; 135async Task ContinueAfterDelayAsync(Task lastTask) 151await Task.Yield().ConfigureAwait(false); 163private async Task ProcessNextBatchAsync()
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (4)
46var tasks = new Task[streams.Length]; 55Task.WhenAll(tasks).CompletesChannel(channel); 59static async Task ProcessAsync(IAsyncEnumerable<T> stream, ChannelWriter<T> writer, CancellationToken cancellationToken) 70public static void CompletesChannel<T>(this Task task, Channel<T> channel)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (12)
18public static readonly Task<bool> True = Task.FromResult(true); 19public static readonly Task<bool> False = Task.FromResult(false); 23public static readonly Task EmptyTask = Task.CompletedTask; 82return new ValueTask<T[]>(Task.WhenAll(taskArray.Select(task => task.AsTask()))); 90await Task.WhenAll((IEnumerable<Task>)tasks).ConfigureAwait(false); 100public static readonly Task<T?> Default = Task.FromResult<T?>(default); 101public static readonly Task<IEnumerable<T>> EmptyEnumerable = Task.FromResult<IEnumerable<T>>(SpecializedCollections.EmptyEnumerable<T>()); 102public static readonly Task<ImmutableArray<T>> EmptyImmutableArray = Task.FromResult(ImmutableArray<T>.Empty); 103public static readonly Task<IList<T>> EmptyList = Task.FromResult(SpecializedCollections.EmptyList<T>()); 104public static readonly Task<IReadOnlyList<T>> EmptyReadOnlyList = Task.FromResult(SpecializedCollections.EmptyReadOnlyList<T>());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (3)
60/// Asserts the <see cref="Task"/> passed has already been completed. 67public static void VerifyCompleted(this Task task) 76/// Asserts the <see cref="Task"/> passed has already been completed.
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
151=> compilation.GetTypeByMetadataName(typeof(Task).FullName!);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (3)
37protected abstract Task FixAsync( 48public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 54protected sealed override async Task FixAllAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
80Func<SyntaxEditor, Task> editAsync, 97protected abstract Task FixAllAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
93protected abstract Task AddPotentiallyConflictingImportsAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
200public static async Task VerifyNoErrorsAsync(this Document newDocument, string message, CancellationToken cancellationToken, List<string>? ignoreErrorCodes = null)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (6)
26public static Task ApplyExpressionLevelSemanticEditsAsync<TType, TNode>( 49public static Task ApplyExpressionLevelSemanticEditsAsync<TType, TNode>( 72public static Task ApplyExpressionLevelSemanticEditsAsync<TNode>( 93public static Task ApplyMethodBodySemanticEditsAsync<TType, TNode>( 116public static Task ApplyMethodBodySemanticEditsAsync<TNode>( 150private static async Task ApplySemanticEditsAsync<TType, TNode>(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
150private async Task ReduceAsync(
Microsoft.CodeAnalysis.AnalyzerUtilities (119)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
148public Task AppendAsync(Stream stream, CancellationToken cancellationToken = default) 158private async Task AppendAsyncCore(Stream stream, CancellationToken cancellationToken)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\PerformanceSensitiveAttribute.cs (1)
93/// <see cref="System.Threading.Tasks.Task"/>, either through caching the result or by using
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
602return (await Task.WhenAll(sequence.Select(item => selector(item, cancellationToken))).ConfigureAwait(false)).Flatten();
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
232public static Task ReportNonFatalErrorAsync(this Task task) 242public static Task ReportNonFatalErrorUnlessCancelledAsync(this Task task, CancellationToken cancellationToken)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (1)
44public new Task WaitUntilCurrentBatchCompletesAsync()
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (3)
98private Task<(bool ranToCompletion, TResult? result)> _updateTask = Task.FromResult((ranToCompletion: true, default(TResult?))); 228async Task<(bool ranToCompletion, TResult? result)> ContinueAfterDelayAsync(Task lastTask) 244await Task.Yield().ConfigureAwait(false);
src\roslyn\src\Dependencies\Threading\ConfiguredYieldAwaitable.cs (1)
16/// <see cref="Task.Yield"/>.
src\roslyn\src\Dependencies\Threading\ParallelExtensions.cs (4)
30public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 33public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 36public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 39public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body)
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (21)
37public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 55public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 72public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 118return Task.FromCanceled(cancellationToken); 122Func<object, Task> taskBody = static async o => 204return Task.FromException(e); 215public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 233public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 250public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 283return Task.FromCanceled(cancellationToken); 287Func<object, Task> taskBody = static async o => 369return Task.FromException(e); 395private readonly Func<object, Task> _taskBody; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 468System.Threading.Tasks.Task.Factory.StartNew(_taskBody!, this, default(CancellationToken), TaskCreationOptions.DenyChildAttach, _scheduler); 478public Task AcquireLock() 584IEnumerable<TSource> source, Func<object, Task> taskBody, 610IAsyncEnumerable<TSource> source, Func<object, Task> taskBody, 637T fromExclusive, T toExclusive, Func<object, Task> taskBody,
src\roslyn\src\Dependencies\Threading\ProducerConsumer.cs (35)
25Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 46public static Task RunAsync<TArgs>( 48Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 49Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 64public static Task RunAsync<TArgs>( 66Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 67Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 87public static Task RunParallelAsync<TSource, TArgs>( 89Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 90Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 101public static Task RunParallelAsync<TSource, TArgs>( 103Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 104Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 124public static Task RunParallelAsync<TSource, TArgs>( 126Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 127Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 138public static Task RunParallelAsync<TSource, TArgs>( 140Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 141Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 159Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 173Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 193Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 206Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 225Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 249Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 283/// Equivalent to <see cref="RunParallelAsync{TSource, TArgs}(IEnumerable{TSource}, Func{TSource, Action{TItem}, TArgs, CancellationToken, Task}, TArgs, CancellationToken)"/>, 290Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 321Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 342var writeTask = ProduceItemsAndWriteToChannelAsync(); 344await Task.WhenAll(writeTask, readTask).ConfigureAwait(false); 350await Task.Yield().ConfigureAwait(false); 354Task ProduceItemsAndWriteToChannelAsync() 359await Task.Yield().ConfigureAwait(false); 375private static async Task PerformActionAndCloseWriterAsync<TArgs>( 376Func<TArgs, CancellationToken, Task> action,
src\roslyn\src\Dependencies\Threading\TaskExtensions.cs (5)
25public static NoThrowTaskAwaitable NoThrowAwaitableInternal(this Task task, bool captureContext = true) 38private readonly Task _task; 50public NoThrowTaskAwaitable(Task task, bool captureContext) 74private readonly Task _task; 86public NoThrowTaskAwaiter(Task task, bool captureContext)
src\roslyn\src\Dependencies\Threading\YieldAwaitableExtensions.cs (4)
15/// Implements <c>ConfigureAwait(bool)</c> for <see cref="Task.Yield"/>. The resulting behavior in asynchronous code 16/// is the same as one would expect for <see cref="Task.ConfigureAwait(bool)"/>. 18/// <param name="awaitable">The awaitable provided by <see cref="Task.Yield"/>.</param> 19/// <param name="continueOnCapturedContext"><inheritdoc cref="Task.ConfigureAwait(bool)"/></param>
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (3)
258return Task.FromCanceled<CodeAnalysisMetricData>(context.CancellationToken); 324=> (await Task.WhenAll( 329select Task.Run(() => ComputeAsync(child, context))).ConfigureAwait(false)).ToImmutableArray();
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (1)
4132/// <see cref="INamedTypeSymbol"/> for <see cref="System.Threading.Tasks.Task"/>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
22Task AnalyzeAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy.cs (1)
24asynchronousComputeFunction: static (outerArg, cancellationToken) => Task.FromResult(outerArg.synchronousComputeFunction(outerArg.arg, cancellationToken)),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (5)
93/// Creates an AsyncLazy that always returns the value, analogous to <see cref="Task.FromResult{T}" />. 97_cachedResult = Task.FromResult(value); 297CompleteWithTask(Task.FromException<T>(ex), CancellationToken.None); 302CompleteWithTask(Task.FromResult(result), CancellationToken.None); 331return Task.FromCanceled<T>(cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (6)
62private Task _updateTask = Task.CompletedTask; 135async Task ContinueAfterDelayAsync(Task lastTask) 151await Task.Yield().ConfigureAwait(false); 163private async Task ProcessNextBatchAsync()
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (4)
46var tasks = new Task[streams.Length]; 55Task.WhenAll(tasks).CompletesChannel(channel); 59static async Task ProcessAsync(IAsyncEnumerable<T> stream, ChannelWriter<T> writer, CancellationToken cancellationToken) 70public static void CompletesChannel<T>(this Task task, Channel<T> channel)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (12)
18public static readonly Task<bool> True = Task.FromResult(true); 19public static readonly Task<bool> False = Task.FromResult(false); 23public static readonly Task EmptyTask = Task.CompletedTask; 82return new ValueTask<T[]>(Task.WhenAll(taskArray.Select(task => task.AsTask()))); 90await Task.WhenAll((IEnumerable<Task>)tasks).ConfigureAwait(false); 100public static readonly Task<T?> Default = Task.FromResult<T?>(default); 101public static readonly Task<IEnumerable<T>> EmptyEnumerable = Task.FromResult<IEnumerable<T>>(SpecializedCollections.EmptyEnumerable<T>()); 102public static readonly Task<ImmutableArray<T>> EmptyImmutableArray = Task.FromResult(ImmutableArray<T>.Empty); 103public static readonly Task<IList<T>> EmptyList = Task.FromResult(SpecializedCollections.EmptyList<T>()); 104public static readonly Task<IReadOnlyList<T>> EmptyReadOnlyList = Task.FromResult(SpecializedCollections.EmptyReadOnlyList<T>());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (3)
60/// Asserts the <see cref="Task"/> passed has already been completed. 67public static void VerifyCompleted(this Task task) 76/// Asserts the <see cref="Task"/> passed has already been completed.
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
151=> compilation.GetTypeByMetadataName(typeof(Task).FullName!);
Microsoft.CodeAnalysis.CodeStyle (118)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (3)
84public async Task AnalyzeAsync( 506private static async Task ProcessReportedDiagnosticsAsync( 583static async Task ProcessAttributeSuppressionsAsync(
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
148public Task AppendAsync(Stream stream, CancellationToken cancellationToken = default) 158private async Task AppendAsyncCore(Stream stream, CancellationToken cancellationToken)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\PerformanceSensitiveAttribute.cs (1)
93/// <see cref="System.Threading.Tasks.Task"/>, either through caching the result or by using
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
602return (await Task.WhenAll(sequence.Select(item => selector(item, cancellationToken))).ConfigureAwait(false)).Flatten();
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
232public static Task ReportNonFatalErrorAsync(this Task task) 242public static Task ReportNonFatalErrorUnlessCancelledAsync(this Task task, CancellationToken cancellationToken)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (1)
44public new Task WaitUntilCurrentBatchCompletesAsync()
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (3)
98private Task<(bool ranToCompletion, TResult? result)> _updateTask = Task.FromResult((ranToCompletion: true, default(TResult?))); 228async Task<(bool ranToCompletion, TResult? result)> ContinueAfterDelayAsync(Task lastTask) 244await Task.Yield().ConfigureAwait(false);
src\roslyn\src\Dependencies\Threading\ConfiguredYieldAwaitable.cs (1)
16/// <see cref="Task.Yield"/>.
src\roslyn\src\Dependencies\Threading\ParallelExtensions.cs (4)
30public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 33public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 36public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 39public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body)
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (21)
37public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 55public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 72public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 118return Task.FromCanceled(cancellationToken); 122Func<object, Task> taskBody = static async o => 204return Task.FromException(e); 215public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 233public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 250public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 283return Task.FromCanceled(cancellationToken); 287Func<object, Task> taskBody = static async o => 369return Task.FromException(e); 395private readonly Func<object, Task> _taskBody; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 468System.Threading.Tasks.Task.Factory.StartNew(_taskBody!, this, default(CancellationToken), TaskCreationOptions.DenyChildAttach, _scheduler); 478public Task AcquireLock() 584IEnumerable<TSource> source, Func<object, Task> taskBody, 610IAsyncEnumerable<TSource> source, Func<object, Task> taskBody, 637T fromExclusive, T toExclusive, Func<object, Task> taskBody,
src\roslyn\src\Dependencies\Threading\ProducerConsumer.cs (35)
25Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 46public static Task RunAsync<TArgs>( 48Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 49Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 64public static Task RunAsync<TArgs>( 66Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 67Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 87public static Task RunParallelAsync<TSource, TArgs>( 89Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 90Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 101public static Task RunParallelAsync<TSource, TArgs>( 103Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 104Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 124public static Task RunParallelAsync<TSource, TArgs>( 126Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 127Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 138public static Task RunParallelAsync<TSource, TArgs>( 140Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 141Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 159Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 173Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 193Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 206Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 225Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 249Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 283/// Equivalent to <see cref="RunParallelAsync{TSource, TArgs}(IEnumerable{TSource}, Func{TSource, Action{TItem}, TArgs, CancellationToken, Task}, TArgs, CancellationToken)"/>, 290Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 321Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 342var writeTask = ProduceItemsAndWriteToChannelAsync(); 344await Task.WhenAll(writeTask, readTask).ConfigureAwait(false); 350await Task.Yield().ConfigureAwait(false); 354Task ProduceItemsAndWriteToChannelAsync() 359await Task.Yield().ConfigureAwait(false); 375private static async Task PerformActionAndCloseWriterAsync<TArgs>( 376Func<TArgs, CancellationToken, Task> action,
src\roslyn\src\Dependencies\Threading\TaskExtensions.cs (5)
25public static NoThrowTaskAwaitable NoThrowAwaitableInternal(this Task task, bool captureContext = true) 38private readonly Task _task; 50public NoThrowTaskAwaitable(Task task, bool captureContext) 74private readonly Task _task; 86public NoThrowTaskAwaiter(Task task, bool captureContext)
src\roslyn\src\Dependencies\Threading\YieldAwaitableExtensions.cs (4)
15/// Implements <c>ConfigureAwait(bool)</c> for <see cref="Task.Yield"/>. The resulting behavior in asynchronous code 16/// is the same as one would expect for <see cref="Task.ConfigureAwait(bool)"/>. 18/// <param name="awaitable">The awaitable provided by <see cref="Task.Yield"/>.</param> 19/// <param name="continueOnCapturedContext"><inheritdoc cref="Task.ConfigureAwait(bool)"/></param>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
22Task AnalyzeAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy.cs (1)
24asynchronousComputeFunction: static (outerArg, cancellationToken) => Task.FromResult(outerArg.synchronousComputeFunction(outerArg.arg, cancellationToken)),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (5)
93/// Creates an AsyncLazy that always returns the value, analogous to <see cref="Task.FromResult{T}" />. 97_cachedResult = Task.FromResult(value); 297CompleteWithTask(Task.FromException<T>(ex), CancellationToken.None); 302CompleteWithTask(Task.FromResult(result), CancellationToken.None); 331return Task.FromCanceled<T>(cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (6)
62private Task _updateTask = Task.CompletedTask; 135async Task ContinueAfterDelayAsync(Task lastTask) 151await Task.Yield().ConfigureAwait(false); 163private async Task ProcessNextBatchAsync()
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (4)
46var tasks = new Task[streams.Length]; 55Task.WhenAll(tasks).CompletesChannel(channel); 59static async Task ProcessAsync(IAsyncEnumerable<T> stream, ChannelWriter<T> writer, CancellationToken cancellationToken) 70public static void CompletesChannel<T>(this Task task, Channel<T> channel)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (12)
18public static readonly Task<bool> True = Task.FromResult(true); 19public static readonly Task<bool> False = Task.FromResult(false); 23public static readonly Task EmptyTask = Task.CompletedTask; 82return new ValueTask<T[]>(Task.WhenAll(taskArray.Select(task => task.AsTask()))); 90await Task.WhenAll((IEnumerable<Task>)tasks).ConfigureAwait(false); 100public static readonly Task<T?> Default = Task.FromResult<T?>(default); 101public static readonly Task<IEnumerable<T>> EmptyEnumerable = Task.FromResult<IEnumerable<T>>(SpecializedCollections.EmptyEnumerable<T>()); 102public static readonly Task<ImmutableArray<T>> EmptyImmutableArray = Task.FromResult(ImmutableArray<T>.Empty); 103public static readonly Task<IList<T>> EmptyList = Task.FromResult(SpecializedCollections.EmptyList<T>()); 104public static readonly Task<IReadOnlyList<T>> EmptyReadOnlyList = Task.FromResult(SpecializedCollections.EmptyReadOnlyList<T>());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (3)
60/// Asserts the <see cref="Task"/> passed has already been completed. 67public static void VerifyCompleted(this Task task) 76/// Asserts the <see cref="Task"/> passed has already been completed.
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
151=> compilation.GetTypeByMetadataName(typeof(Task).FullName!);
Microsoft.CodeAnalysis.CodeStyle.Fixes (130)
src\0bf6ba47805c8821\AbstractMoveDeclarationNearReferenceService.cs (1)
118private static async Task MoveDeclarationToFirstReferenceAsync(
src\939a5660f39ce290\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (2)
43public override async Task RegisterCodeFixesAsync(CodeFixContext context) 56protected override async Task FixOneAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (2)
24public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 39protected sealed override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (3)
32public override async Task RegisterCodeFixesAsync(CodeFixContext context) 82protected override async Task FixAllAsync( 99private async Task FixOneAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (2)
65public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 210protected sealed override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\AddObsoleteAttribute\AbstractAddObsoleteAttributeCodeFixProvider.cs (2)
32public override async Task RegisterCodeFixesAsync(CodeFixContext context) 70protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
62public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\AddRequiredParentheses\AddRequiredParenthesesCodeFixProvider.cs (2)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
29public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
69public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (1)
21public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\ConvertTypeOfToNameOf\AbstractConvertTypeOfToNameOfCodeFixProvider.cs (2)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 33protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
29public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
33public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (2)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 38protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (2)
49public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 86protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
125private async Task InitializeNonDelegatedConstructorAsync(CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorCodeFixProvider.cs (1)
20public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (1)
28public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (3)
88private static async Task AddPropertyCodeActionsAsync( 177private async Task AddLocalCodeActionsAsync( 193private static async Task AddParameterCodeActionsAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (1)
23public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (1)
18public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\Iterator\AbstractIteratorCodeFixProvider.cs (1)
19public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (3)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override async Task FixAllAsync( 54private async Task MakeFieldReadonlyAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMemberStatic\AbstractMakeMemberStaticCodeFixProvider.cs (2)
19public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 28protected sealed override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor,
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (1)
42public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (2)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context) 239if (parentMemberAccessExpressionName == nameof(Task.ConfigureAwait))
src\roslyn\src\Analyzers\Core\CodeFixes\MakeTypeAbstract\AbstractMakeTypeAbstractCodeFixProvider.cs (2)
20public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 28protected sealed override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor,
src\roslyn\src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (2)
18public override async Task RegisterCodeFixesAsync(CodeFixContext context) 23protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
25public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
46public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (1)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (1)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (2)
32public override async Task RegisterCodeFixesAsync(CodeFixContext context) 43protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (4)
50public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 116private async Task FixWithEditorAsync( 129private async Task FixOneDiagnosticAsync( 211protected override Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\QualifyMemberAccess\AbstractQualifyMemberAccessCodeFixProvider.cs (2)
26public override async Task RegisterCodeFixesAsync(CodeFixContext context) 32protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (4)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 52protected sealed override async Task FixAllAsync( 209invocation = generator.MemberAccessExpression(taskTypeExpression, nameof(Task.CompletedTask)); 226var memberName = generator.GenericName(nameof(Task.FromResult), unwrappedReturnType);
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveRedundantEquality\RemoveRedundantEqualityCodeFixProvider.cs (1)
29protected override async Task FixAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsCodeFixProvider.cs (2)
30public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 52protected sealed override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs (2)
26public override async Task RegisterCodeFixesAsync(CodeFixContext context) 31protected override Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs (2)
26public override async Task RegisterCodeFixesAsync(CodeFixContext context) 39protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (2)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context) 45protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (2)
34public override async Task RegisterCodeFixesAsync(CodeFixContext context) 39protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (5)
132public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 284protected sealed override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 344private async Task FixAllAsync( 441private async Task FixAllValueAssignedIsUnusedDiagnosticsAsync( 883async Task OnDocumentUpdatedAsync()
src\roslyn\src\Analyzers\Core\CodeFixes\SimplifyBooleanExpression\SimplifyConditionalCodeFixProvider.cs (2)
29public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 34protected sealed override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\SimplifyInterpolation\AbstractSimplifyInterpolationCodeFixProvider.cs (2)
40public override async Task RegisterCodeFixesAsync(CodeFixContext context) 45protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\SimplifyLinqExpression\SimplifyLinqExpressionCodeFixProvider.cs (2)
27public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 32protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (2)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 40protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
83public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (2)
24public override async Task RegisterCodeFixesAsync(CodeFixContext context) 32protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (2)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context) 35protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (2)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (1)
60protected sealed override async Task FixAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseCompoundAssignment\AbstractUseCompoundAssignmentCodeFixProvider.cs (2)
44public override async Task RegisterCodeFixesAsync(CodeFixContext context) 49protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (2)
42protected abstract Task FixOneAsync( 46protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (2)
34public override async Task RegisterCodeFixesAsync(CodeFixContext context) 43protected override async Task FixOneAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseExplicitTupleName\UseExplicitTupleNameCodeFixProvider.cs (2)
26public override async Task RegisterCodeFixesAsync(CodeFixContext context) 31protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseInferredMemberName\AbstractUseInferredMemberNameCodeFixProvider.cs (2)
21public override async Task RegisterCodeFixesAsync(CodeFixContext context) 26protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs (2)
34public override async Task RegisterCodeFixesAsync(CodeFixContext context) 45protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (3)
79protected override async Task FixAsync( 98private async Task FixConditionalExpressionAsync( 156private async Task FixIfStatementAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
63protected override async Task FixAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (2)
28public override async Task RegisterCodeFixesAsync(CodeFixContext context) 33protected override async Task FixAllAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (3)
37protected abstract Task FixAsync( 48public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 54protected sealed override async Task FixAllAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
80Func<SyntaxEditor, Task> editAsync, 97protected abstract Task FixAllAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
93protected abstract Task AddPotentiallyConflictingImportsAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
200public static async Task VerifyNoErrorsAsync(this Document newDocument, string message, CancellationToken cancellationToken, List<string>? ignoreErrorCodes = null)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (6)
26public static Task ApplyExpressionLevelSemanticEditsAsync<TType, TNode>( 49public static Task ApplyExpressionLevelSemanticEditsAsync<TType, TNode>( 72public static Task ApplyExpressionLevelSemanticEditsAsync<TNode>( 93public static Task ApplyMethodBodySemanticEditsAsync<TType, TNode>( 116public static Task ApplyMethodBodySemanticEditsAsync<TNode>( 150private static async Task ApplySemanticEditsAsync<TType, TNode>(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
150private async Task ReduceAsync(
Microsoft.CodeAnalysis.CSharp (15)
Compilation\CSharpCompilation.cs (1)
2305/// - the return type is either void, int, or returns a <see cref="System.Threading.Tasks.Task" />,
Compiler\ClsComplianceChecker.cs (4)
35private readonly ConcurrentStack<Task> _compilerTasks; 56_compilerTasks = new ConcurrentStack<Task>(); 182while (tasks.TryPop(out Task curTask)) 214_compilerTasks.Push(Task.Run(UICultureUtilities.WithCurrentUICulture(() =>
Compiler\MethodCompiler.cs (9)
58private ConcurrentStack<Task>? _compilerTasks; 155methodCompiler._compilerTasks = new ConcurrentStack<Task>(); 342Task curTask; 383Task worker = CompileNamespaceAsAsync(symbol); 394private Task CompileNamespaceAsAsync(NamespaceSymbol symbol) 396return Task.Run(UICultureUtilities.WithCurrentUICulture(() => 429Task worker = CompileNamedTypeAsync(symbol); 440private Task CompileNamedTypeAsync(NamedTypeSymbol symbol) 442return Task.Run(UICultureUtilities.WithCurrentUICulture(() =>
Syntax\CSharpSyntaxTree.cs (1)
102return Task.FromResult(this.TryGetRoot(out CSharpSyntaxNode? node) ? node : this.GetRoot(cancellationToken));
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
347Expression: MemberAccessExpressionSyntax { Name.Identifier.ValueText: nameof(Task.ConfigureAwait), Expression: var underlying }
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
157returnType.Name is not nameof(Task) and not nameof(ValueTask) &&
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (163)
src\cef93d2425d77fca\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
33public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddBraces\CSharpAddBracesCodeFixProvider.cs (2)
25public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 30protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (2)
36public override async Task RegisterCodeFixesAsync(CodeFixContext context) 67protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (2)
28public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 133protected sealed override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (2)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 46protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (2)
35public override async Task RegisterCodeFixesAsync(CodeFixContext context) 40protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
474private static async Task RefactorInitializersAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\CSharpConvertToRecordCodeFixProvider.cs (1)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (2)
37public override async Task RegisterCodeFixesAsync(CodeFixContext context) 132protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (2)
63public override async Task RegisterCodeFixesAsync(CodeFixContext context) 74protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (2)
36public override async Task RegisterCodeFixesAsync(CodeFixContext context) 126protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
31public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\HiddenExplicitCast\CSharpHiddenExplicitCastCodeFixProvider.cs (4)
29public override Task RegisterCodeFixesAsync(CodeFixContext context) 32return Task.CompletedTask; 35protected override Task FixAllAsync( 56return Task.CompletedTask;
src\roslyn\src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.cs (2)
43public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 58protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (2)
39public override async Task RegisterCodeFixesAsync(CodeFixContext context) 44protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
38public override async Task RegisterCodeFixesAsync(CodeFixContext context) 43protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeAnonymousFunctionStatic\CSharpMakeAnonymousFunctionStaticCodeFixProvider.cs (2)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
38public static async Task MakeLocalFunctionStaticAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixProvider.cs (2)
25public override async Task RegisterCodeFixesAsync(CodeFixContext context) 30protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (4)
31public override Task RegisterCodeFixesAsync(CodeFixContext context) 50protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 60private static async Task WrapFixAsync( 63Func<Document, LocalFunctionStatementSyntax, ImmutableArray<ISymbol>, Task> fixer,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (2)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 109protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (1)
35public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (2)
32public override async Task RegisterCodeFixesAsync(CodeFixContext context) 47protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableCodeFixProvider.cs (2)
28public override async Task RegisterCodeFixesAsync(CodeFixContext context) 33protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (2)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context) 34protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStructReadOnly\CSharpMakeStructReadOnlyCodeFixProvider.cs (2)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 32protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (2)
57public override async Task RegisterCodeFixesAsync(CodeFixContext context) 179await Task.WhenAll(expandUsingDirectiveTasks.Values).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (1)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (1)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (3)
42public override async Task RegisterCodeFixesAsync(CodeFixContext context) 73protected override async Task FixAllAsync( 98private static async Task MakeDeclarationNullableAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveInKeyword\RemoveInKeywordCodeFixProvider.cs (1)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveNewModifier\RemoveNewModifierCodeFixProvider.cs (1)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnneccessaryUnsafeModifier\CSharpRemoveUnnecessaryUnsafeModifierCodeFixProvider.cs (1)
30public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (2)
31public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs (2)
28public override async Task RegisterCodeFixesAsync(CodeFixContext context) 33protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs (2)
34public override async Task RegisterCodeFixesAsync(CodeFixContext context) 39protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveCodeFixProvider.cs (2)
34public override async Task RegisterCodeFixesAsync(CodeFixContext context) 45protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessarySuppressions\CSharpRemoveUnnecessaryNullableWarningSuppressionsCodeFixProvider.cs (1)
31public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (2)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 48protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnusedLocalFunction\CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs (2)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
38public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastCodeFixProvider.cs (2)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context) 35protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\SimplifyPropertyAccessor\CSharpSimplifyPropertyAccessorCodeFixProvider.cs (2)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (2)
32public override async Task RegisterCodeFixesAsync(CodeFixContext context) 37protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\TransposeRecordKeyword\CSharpTransposeRecordKeywordCodeFixProvider.cs (2)
81public override async Task RegisterCodeFixesAsync(CodeFixContext context) 93protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (1)
34protected sealed override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (1)
37protected override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
35protected override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForEmptyCodeFixProvider.cs (1)
33protected override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (1)
43protected override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForNewCodeFixProvider.cs (1)
36protected override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocCodeFixProvider.cs (1)
30protected sealed override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (2)
34public override async Task RegisterCodeFixesAsync(CodeFixContext context) 39protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (2)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs (2)
28public override async Task RegisterCodeFixesAsync(CodeFixContext context) 33protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (2)
94public override async Task RegisterCodeFixesAsync(CodeFixContext context) 115protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
34public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (2)
39public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 52protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (2)
99return returnType.Name != nameof(Task); 102var taskType = semanticModel.Compilation.GetTypeByMetadataName(typeof(Task).FullName!);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (1)
33protected override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitlyTypedLambdaExpression\CSharpUseImplicitObjectCreationCodeFixProvider.cs (2)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context) 38protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationCodeFixProvider.cs (2)
40public override async Task RegisterCodeFixesAsync(CodeFixContext context) 45protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (7)
37public override async Task RegisterCodeFixesAsync(CodeFixContext context) 48protected override async Task FixAllAsync( 61internal static async Task HandleDeclarationAsync( 90private static async Task HandleDeclarationExpressionAsync(Document document, SyntaxEditor editor, DeclarationExpressionSyntax declarationExpression, CancellationToken cancellationToken) 118private static Task HandleForEachStatementAsync(Document document, SyntaxEditor editor, ForEachStatementSyntax forEach, CancellationToken cancellationToken) 126private static Task HandleVariableDeclarationAsync(Document document, SyntaxEditor editor, VariableDeclarationSyntax varDecl, CancellationToken cancellationToken) 137private static async Task UpdateTypeSyntaxAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (2)
28public override async Task RegisterCodeFixesAsync(CodeFixContext context) 39protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseIndexOperatorCodeFixProvider.cs (2)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context) 34protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (2)
39public override async Task RegisterCodeFixesAsync(CodeFixContext context) 44protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseInterpolatedVerbatimString\CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs (2)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context) 34protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (2)
36public override async Task RegisterCodeFixesAsync(CodeFixContext context) 48protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs (2)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLabeledJumpStatements\CSharpUseLabeledJumpStatementsCodeFixProvider.cs (1)
35protected override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
47public override async Task RegisterCodeFixesAsync(CodeFixContext context) 52protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseNameofInAttribute\CSharpUseNameofInAttributeCodeFixProvider.cs (2)
26public override async Task RegisterCodeFixesAsync(CodeFixContext context) 34protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (2)
58public override async Task RegisterCodeFixesAsync(CodeFixContext context) 70protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndMemberAccessCodeFixProvider.cs (2)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context) 38protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context) 38protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (2)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context) 35protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpUseNotPatternCodeFixProvider.cs (2)
28public override async Task RegisterCodeFixesAsync(CodeFixContext context) 33protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
56public override async Task RegisterCodeFixesAsync(CodeFixContext context) 108private static async Task UsePrimaryConstructorAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (2)
37public override async Task RegisterCodeFixesAsync(CodeFixContext context) 42protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (2)
40public override async Task RegisterCodeFixesAsync(CodeFixContext context) 73private static async Task UseSystemThreadingLockAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (2)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context) 38protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseTupleSwap\CSharpUseTupleSwapCodeFixProvider.cs (2)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context) 35protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (2)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context) 38protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (2)
36public override async Task RegisterCodeFixesAsync(CodeFixContext context) 41protected override async Task FixAllAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (2)
41protected override Task AddPotentiallyConflictingImportsAsync( 128public async Task AddPotentiallyConflictingImportsAsync(SyntaxNode container, HashSet<INamespaceSymbol> conflicts, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
95public static async Task UpdateParameterReferencesAsync(
Microsoft.CodeAnalysis.CSharp.Features (270)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
33public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
35public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.FixAllProvider.cs (1)
36return Task.FromResult<CodeAction?>(new FixAllCodeAction(EnableNullableReferenceTypesInSolutionAsync));
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
40public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
CodeRefactorings\UseExplicitOrImplicitType\AbstractUseTypeCodeRefactoringProvider.cs (2)
23protected abstract Task HandleDeclarationAsync(Document document, SyntaxEditor editor, TypeSyntax type, CancellationToken cancellationToken); 27public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
CodeRefactorings\UseExplicitOrImplicitType\UseExplicitTypeCodeRefactoringProvider.cs (1)
35protected override Task HandleDeclarationAsync(Document document, SyntaxEditor editor, TypeSyntax node, CancellationToken cancellationToken)
CodeRefactorings\UseExplicitOrImplicitType\UseImplicitTypeCodeRefactoringProvider.cs (2)
35protected override Task HandleDeclarationAsync(Document document, SyntaxEditor editor, TypeSyntax type, CancellationToken cancellationToken) 38return Task.CompletedTask;
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (3)
46public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 68_ => Task.FromResult(document.WithSyntaxRoot(replacementFunc(root))), 582protected override async Task RefactorAllAsync(
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (2)
51public override async Task ProvideCompletionsAsync(CompletionContext context) 247=> Task.FromResult(GetTextChange(selectedItem, ch));
Completion\CompletionProviders\AwaitCompletionProvider.cs (2)
87return nameof(Task); 101return $"{nameof(Task)}<{existingReturnType}>";
Completion\CompletionProviders\CrefCompletionProvider.cs (2)
60public override async Task ProvideCompletionsAsync(CompletionContext context) 372return Task.FromResult<TextChange?>(new TextChange(selectedItem.Span, insertionText));
Completion\CompletionProviders\DeclarationName\DeclarationNameCompletionProvider.cs (1)
40public override async Task ProvideCompletionsAsync(CompletionContext completionContext)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (2)
57public override async Task ProvideCompletionsAsync(CompletionContext context) 103private static async Task HandleSingleTypeAsync(
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (1)
104public override async Task ProvideCompletionsAsync(CompletionContext context)
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (2)
42public override async Task ProvideCompletionsAsync(CompletionContext context) 118return Task.FromResult(interfaceSet.SelectAsArray(t => new SymbolAndSelectionInfo(Symbol: t, Preselect: false)));
Completion\CompletionProviders\ExternAliasCompletionProvider.cs (1)
39public override async Task ProvideCompletionsAsync(CompletionContext context)
Completion\CompletionProviders\FileBasedPrograms\AbstractAppDirectiveCompletionProvider.cs (2)
44public override async Task ProvideCompletionsAsync(CompletionContext context) 104protected abstract Task AddDirectiveContentCompletionsAsync(CompletionContext context, ReadOnlyMemory<char> contentPrefix);
Completion\CompletionProviders\FileBasedPrograms\IncludeAppDirectiveCompletionProvider.cs (1)
45protected override async Task AddDirectiveContentCompletionsAsync(CompletionContext context, ReadOnlyMemory<char> contentPrefix)
Completion\CompletionProviders\FileBasedPrograms\PackageAppDirectiveCompletionProvider.cs (2)
43protected override Task AddDirectiveContentCompletionsAsync(CompletionContext context, ReadOnlyMemory<char> contentPrefix) 44=> Task.CompletedTask;
Completion\CompletionProviders\FileBasedPrograms\ProjectAppDirectiveCompletionProvider.cs (1)
43protected override async Task AddDirectiveContentCompletionsAsync(CompletionContext context, ReadOnlyMemory<char> contentPrefix)
Completion\CompletionProviders\FileBasedPrograms\PropertyAppDirectiveCompletionProvider.cs (2)
43protected override Task AddDirectiveContentCompletionsAsync(CompletionContext context, ReadOnlyMemory<char> contentPrefix) 44=> Task.CompletedTask;
Completion\CompletionProviders\FileBasedPrograms\RefAppDirectiveCompletionProvider.cs (1)
36protected override async Task AddDirectiveContentCompletionsAsync(CompletionContext context, ReadOnlyMemory<char> contentPrefix)
Completion\CompletionProviders\FileBasedPrograms\SdkAppDirectiveCompletionProvider.cs (2)
43protected override Task AddDirectiveContentCompletionsAsync(CompletionContext context, ReadOnlyMemory<char> contentPrefix) 44=> Task.CompletedTask;
Completion\CompletionProviders\FirstBuiltInCompletionProvider.cs (2)
27public override Task ProvideCompletionsAsync(CompletionContext context) 28=> Task.CompletedTask;
Completion\CompletionProviders\FunctionPointerUnmanagedCallingConventionCompletionProvider.cs (1)
43public override async Task ProvideCompletionsAsync(CompletionContext context)
Completion\CompletionProviders\ImportCompletion\ExtensionMemberImportCompletionProvider.cs (1)
60=> Task.FromResult(commitKey is ';' or '.');
Completion\CompletionProviders\LastBuiltInCompletionProvider.cs (2)
28public override Task ProvideCompletionsAsync(CompletionContext context) 29=> Task.CompletedTask;
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (2)
48public override async Task ProvideCompletionsAsync(CompletionContext context) 264return Task.FromResult<TextChange?>(new TextChange(
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider.cs (1)
96public override async Task ProvideCompletionsAsync(CompletionContext context)
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (1)
41public override async Task ProvideCompletionsAsync(CompletionContext context)
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
69public override async Task ProvideCompletionsAsync(CompletionContext context)
Completion\CompletionProviders\SpeculativeTCompletionProvider.cs (1)
38public override async Task ProvideCompletionsAsync(CompletionContext context)
Completion\CompletionProviders\TupleNameCompletionProvider.cs (2)
40public override async Task ProvideCompletionsAsync(CompletionContext completionContext) 118return Task.FromResult<TextChange?>(new TextChange(
Completion\Providers\ContextVariableArgumentProvider.cs (1)
31public override async Task ProvideArgumentAsync(ArgumentContext context)
Completion\Providers\DefaultArgumentProvider.cs (2)
25public override Task ProvideArgumentAsync(ArgumentContext context) 56return Task.CompletedTask;
Completion\Providers\FirstBuiltInArgumentProvider.cs (2)
27public override Task ProvideArgumentAsync(ArgumentContext context) 28=> Task.CompletedTask;
Completion\Providers\LastBuiltInArgumentProvider.cs (2)
28public override Task ProvideArgumentAsync(ArgumentContext context) 29=> Task.CompletedTask;
Completion\Providers\OutVariableArgumentProvider.cs (4)
27public override Task ProvideArgumentAsync(ArgumentContext context) 32return Task.CompletedTask; 38return Task.CompletedTask; 63return Task.CompletedTask;
ConvertBetweenRegularAndVerbatimString\AbstractConvertBetweenRegularAndVerbatimStringCodeRefactoringProvider.cs (1)
35public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ConvertNamespace\ConvertNamespaceCodeRefactoringProvider.cs (2)
35public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 87protected override async Task RefactorAllAsync(
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (3)
42public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 269async Task RemoveDirectFieldAndPropertyAssignmentsAsync() 353async Task RewritePrimaryConstructorParameterReferencesAsync()
ConvertProgram\ConvertToProgramMainCodeFixProvider.cs (2)
32public override async Task RegisterCodeFixesAsync(CodeFixContext context) 45protected override async Task FixAllAsync(
ConvertProgram\ConvertToProgramMainCodeRefactoringProvider.cs (1)
31public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ConvertProgram\ConvertToTopLevelStatementsCodeFixProvider.cs (2)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 44protected override async Task FixAllAsync(
ConvertProgram\ConvertToTopLevelStatementsCodeRefactoringProvider.cs (1)
31public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ConvertToExtension\ConvertToExtensionCodeRefactoringProvider.cs (1)
141public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ConvertToRawString\ConvertStringToRawStringCodeRefactoringProvider.cs (2)
70public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 142protected override async Task RefactorAllAsync(
ConvertToRecord\CSharpConvertToRecordRefactoringProvider.cs (1)
19public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
Copilot\CSharpCopilotCodeFixProvider.cs (1)
52public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Copilot\CSharpCopilotCodeFixProvider.DismissChangesCodeAction.cs (2)
26=> Task.FromResult<IEnumerable<CodeActionOperation>>(null!); 29=> Task.FromResult<IEnumerable<CodeActionOperation>>(
Copilot\CSharpImplementNotImplementedExceptionFixProvider.cs (2)
40public override async Task RegisterCodeFixesAsync(CodeFixContext context) 83protected override async Task FixAllAsync(
ExtractInterface\CSharpExtractInterfaceService.cs (1)
75return Task.FromResult(unformattedSolution);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
857IdentifierName(nameof(Task.ConfigureAwait))),
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.MultipleStatementsCodeGenerator.cs (1)
89return Task.FromResult<SyntaxNode>(statement.WithAdditionalAnnotations(CallSiteAnnotation));
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.SingleStatementCodeGenerator.cs (1)
50return Task.FromResult<SyntaxNode>(statement.WithAdditionalAnnotations(CallSiteAnnotation));
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (1)
25=> Task.FromResult(symbol);
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (2)
46protected abstract Task UpdateReferencesAsync(Project project, SolutionEditor solutionEditor, ISymbol implMember, INamedTypeSymbol containingType, CancellationToken cancellationToken); 48public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (1)
39protected override async Task UpdateReferencesAsync(
ImplementInterface\CSharpImplementImplicitlyCodeRefactoringProvider.cs (2)
45protected override Task UpdateReferencesAsync(Project project, SolutionEditor solutionEditor, ISymbol implMember, INamedTypeSymbol containingType, CancellationToken cancellationToken) 46=> Task.CompletedTask;
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
39public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (2)
71return Task.FromResult(document.Document.WithSyntaxRoot(newRoot)); 84return Task.FromResult(document.Document.WithSyntaxRoot(newRoot));
MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeRefactoringProvider.cs (1)
25public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
QuickInfo\CSharpSyntacticQuickInfoProvider.cs (1)
29=> Task.FromResult(BuildQuickInfo(token, context.CancellationToken));
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
34public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (1)
32return Task.FromResult((items, selectedItemIndex));
Snippets\CSharpElseSnippetProvider.cs (1)
60return Task.FromResult(new TextChange(TextSpan.FromBounds(position, position), elseClause.ToFullString()));
Snippets\CSharpUnsafeSnippetProvider.cs (1)
27=> Task.FromResult(new TextChange(TextSpan.FromBounds(position, position), SyntaxFactory.UnsafeStatement().ToFullString()));
src\cef93d2425d77fca\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
33public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
347Expression: MemberAccessExpressionSyntax { Name.Identifier.ValueText: nameof(Task.ConfigureAwait), Expression: var underlying }
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddBraces\CSharpAddBracesCodeFixProvider.cs (2)
25public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 30protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (2)
36public override async Task RegisterCodeFixesAsync(CodeFixContext context) 67protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (2)
28public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 133protected sealed override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (2)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 46protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (2)
35public override async Task RegisterCodeFixesAsync(CodeFixContext context) 40protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
474private static async Task RefactorInitializersAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\CSharpConvertToRecordCodeFixProvider.cs (1)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (2)
37public override async Task RegisterCodeFixesAsync(CodeFixContext context) 132protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (2)
63public override async Task RegisterCodeFixesAsync(CodeFixContext context) 74protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (2)
36public override async Task RegisterCodeFixesAsync(CodeFixContext context) 126protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
31public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\HiddenExplicitCast\CSharpHiddenExplicitCastCodeFixProvider.cs (4)
29public override Task RegisterCodeFixesAsync(CodeFixContext context) 32return Task.CompletedTask; 35protected override Task FixAllAsync( 56return Task.CompletedTask;
src\roslyn\src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.cs (2)
43public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 58protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (2)
39public override async Task RegisterCodeFixesAsync(CodeFixContext context) 44protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
38public override async Task RegisterCodeFixesAsync(CodeFixContext context) 43protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeAnonymousFunctionStatic\CSharpMakeAnonymousFunctionStaticCodeFixProvider.cs (2)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
38public static async Task MakeLocalFunctionStaticAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixProvider.cs (2)
25public override async Task RegisterCodeFixesAsync(CodeFixContext context) 30protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (4)
31public override Task RegisterCodeFixesAsync(CodeFixContext context) 50protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 60private static async Task WrapFixAsync( 63Func<Document, LocalFunctionStatementSyntax, ImmutableArray<ISymbol>, Task> fixer,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (2)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 109protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (1)
35public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (2)
32public override async Task RegisterCodeFixesAsync(CodeFixContext context) 47protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableCodeFixProvider.cs (2)
28public override async Task RegisterCodeFixesAsync(CodeFixContext context) 33protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (2)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context) 34protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStructReadOnly\CSharpMakeStructReadOnlyCodeFixProvider.cs (2)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 32protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (2)
57public override async Task RegisterCodeFixesAsync(CodeFixContext context) 179await Task.WhenAll(expandUsingDirectiveTasks.Values).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (1)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (1)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (3)
42public override async Task RegisterCodeFixesAsync(CodeFixContext context) 73protected override async Task FixAllAsync( 98private static async Task MakeDeclarationNullableAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveInKeyword\RemoveInKeywordCodeFixProvider.cs (1)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveNewModifier\RemoveNewModifierCodeFixProvider.cs (1)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnneccessaryUnsafeModifier\CSharpRemoveUnnecessaryUnsafeModifierCodeFixProvider.cs (1)
30public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (2)
31public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs (2)
28public override async Task RegisterCodeFixesAsync(CodeFixContext context) 33protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs (2)
34public override async Task RegisterCodeFixesAsync(CodeFixContext context) 39protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveCodeFixProvider.cs (2)
34public override async Task RegisterCodeFixesAsync(CodeFixContext context) 45protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessarySuppressions\CSharpRemoveUnnecessaryNullableWarningSuppressionsCodeFixProvider.cs (1)
31public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (2)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 48protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnusedLocalFunction\CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs (2)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
38public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastCodeFixProvider.cs (2)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context) 35protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\SimplifyPropertyAccessor\CSharpSimplifyPropertyAccessorCodeFixProvider.cs (2)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (2)
32public override async Task RegisterCodeFixesAsync(CodeFixContext context) 37protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\TransposeRecordKeyword\CSharpTransposeRecordKeywordCodeFixProvider.cs (2)
81public override async Task RegisterCodeFixesAsync(CodeFixContext context) 93protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (1)
34protected sealed override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (1)
37protected override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
35protected override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForEmptyCodeFixProvider.cs (1)
33protected override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (1)
43protected override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForNewCodeFixProvider.cs (1)
36protected override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocCodeFixProvider.cs (1)
30protected sealed override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (2)
34public override async Task RegisterCodeFixesAsync(CodeFixContext context) 39protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (2)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs (2)
28public override async Task RegisterCodeFixesAsync(CodeFixContext context) 33protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (2)
94public override async Task RegisterCodeFixesAsync(CodeFixContext context) 115protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
34public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (2)
39public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 52protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (2)
99return returnType.Name != nameof(Task); 102var taskType = semanticModel.Compilation.GetTypeByMetadataName(typeof(Task).FullName!);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (1)
33protected override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitlyTypedLambdaExpression\CSharpUseImplicitObjectCreationCodeFixProvider.cs (2)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context) 38protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationCodeFixProvider.cs (2)
40public override async Task RegisterCodeFixesAsync(CodeFixContext context) 45protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (7)
37public override async Task RegisterCodeFixesAsync(CodeFixContext context) 48protected override async Task FixAllAsync( 61internal static async Task HandleDeclarationAsync( 90private static async Task HandleDeclarationExpressionAsync(Document document, SyntaxEditor editor, DeclarationExpressionSyntax declarationExpression, CancellationToken cancellationToken) 118private static Task HandleForEachStatementAsync(Document document, SyntaxEditor editor, ForEachStatementSyntax forEach, CancellationToken cancellationToken) 126private static Task HandleVariableDeclarationAsync(Document document, SyntaxEditor editor, VariableDeclarationSyntax varDecl, CancellationToken cancellationToken) 137private static async Task UpdateTypeSyntaxAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (2)
28public override async Task RegisterCodeFixesAsync(CodeFixContext context) 39protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseIndexOperatorCodeFixProvider.cs (2)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context) 34protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (2)
39public override async Task RegisterCodeFixesAsync(CodeFixContext context) 44protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseInterpolatedVerbatimString\CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs (2)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context) 34protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (2)
36public override async Task RegisterCodeFixesAsync(CodeFixContext context) 48protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs (2)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLabeledJumpStatements\CSharpUseLabeledJumpStatementsCodeFixProvider.cs (1)
35protected override async Task FixAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
47public override async Task RegisterCodeFixesAsync(CodeFixContext context) 52protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseNameofInAttribute\CSharpUseNameofInAttributeCodeFixProvider.cs (2)
26public override async Task RegisterCodeFixesAsync(CodeFixContext context) 34protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (2)
58public override async Task RegisterCodeFixesAsync(CodeFixContext context) 70protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndMemberAccessCodeFixProvider.cs (2)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context) 38protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context) 38protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (2)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context) 35protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpUseNotPatternCodeFixProvider.cs (2)
28public override async Task RegisterCodeFixesAsync(CodeFixContext context) 33protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
56public override async Task RegisterCodeFixesAsync(CodeFixContext context) 108private static async Task UsePrimaryConstructorAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (2)
37public override async Task RegisterCodeFixesAsync(CodeFixContext context) 42protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (2)
40public override async Task RegisterCodeFixesAsync(CodeFixContext context) 73private static async Task UseSystemThreadingLockAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (2)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context) 38protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseTupleSwap\CSharpUseTupleSwapCodeFixProvider.cs (2)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context) 35protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (2)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context) 38protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (2)
36public override async Task RegisterCodeFixesAsync(CodeFixContext context) 41protected override async Task FixAllAsync(
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (3)
60public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 187protected override async Task RefactorAllAsync( 234static async Task FixDeclarationsAsync(
UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeRefactoringProvider.cs (2)
29public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 75private static async Task ComputeRefactoringsAsync(
UsePatternMatching\CSharpIsAndCastCheckWithoutNameCodeFixProvider.cs (3)
30public override Task RegisterCodeFixesAsync(CodeFixContext context) 33return Task.CompletedTask; 36protected override async Task FixAllAsync(
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (20)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\CSharpStaticHolderTypes.Fixer.cs (4)
27public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 37protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 41return Task.CompletedTask; 53return Task.CompletedTask;
Microsoft.CodeQuality.Analyzers\QualityGuidelines\CSharpAvoidDuplicateElementInitializationFixer.cs (2)
30public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 48_ => Task.FromResult(RemoveElementInitializer(elementInitializer, objectInitializer, root, context.Document)),
Microsoft.CodeQuality.Analyzers\QualityGuidelines\CSharpDoNotInitializeUnnecessarily.Fixer.cs (4)
24public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 28return Task.CompletedTask; 31protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 60return Task.CompletedTask;
Microsoft.NetCore.Analyzers\InteropServices\CSharpDisableRuntimeMarshalling.Fixer.cs (1)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.NetCore.Analyzers\InteropServices\CSharpDynamicInterfaceCastableImplementation.Fixer.cs (2)
23protected override async Task ImplementInterfacesOnDynamicCastableImplementationAsync( 179protected override async Task MakeMemberDeclaredOnImplementationTypeStaticAsync(SyntaxNode declaration, Document document, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Performance\CSharpCollapseMultiplePathOperations.Fixer.cs (2)
24public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 50protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Performance\CSharpPreferDictionaryTryMethodsOverContainsKeyGuardFixer.cs (2)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 52protected override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, FixAllState state, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\CSharpAvoidRedundantRegexIsMatchBeforeMatch.Fixer.cs (2)
49public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 61protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Usage\CSharpMissingShebangInFileBasedProgram.Fixer.cs (1)
18public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
157returnType.Name is not nameof(Task) and not nameof(ValueTask) &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (2)
41protected override Task AddPotentiallyConflictingImportsAsync( 128public async Task AddPotentiallyConflictingImportsAsync(SyntaxNode container, HashSet<INamespaceSymbol> conflicts, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
95public static async Task UpdateParameterReferencesAsync(
Microsoft.CodeAnalysis.Extensions.Package (6)
Compilation\CompilationExtensions.cs (1)
151=> compilation.GetTypeByMetadataName(typeof(Task).FullName!);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
602return (await Task.WhenAll(sequence.Select(item => selector(item, cancellationToken))).ConfigureAwait(false)).Flatten();
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
232public static Task ReportNonFatalErrorAsync(this Task task) 242public static Task ReportNonFatalErrorUnlessCancelledAsync(this Task task, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.Extensions (6)
Internal\ExtensionDocumentMessageHandlerWrapper.cs (2)
16protected override Task ExecuteAsync(MethodInfo executeAsyncMethod, object handler, object? message, Document argument, CancellationToken cancellationToken) 17=> (Task)executeAsyncMethod.Invoke(handler, [message, new ExtensionMessageContext(argument.Project.Solution), argument, cancellationToken])!;
Internal\ExtensionMessageHandlerWrapper.cs (2)
48var responseTask = ExecuteAsync(_executeAsyncMethod, _handler, message, argument, cancellationToken); 60protected abstract Task ExecuteAsync(MethodInfo executeAsyncMethod, object handler, object? message, TArgument argument, CancellationToken cancellationToken);
Internal\ExtensionWorkspaceMessageHandlerWrapper.cs (2)
16protected override Task ExecuteAsync(MethodInfo executeAsyncMethod, object handler, object? message, Solution argument, CancellationToken cancellationToken) 17=> (Task)executeAsyncMethod.Invoke(handler, [message, new ExtensionMessageContext(argument), cancellationToken])!;
Microsoft.CodeAnalysis.ExternalAccess.HotReload (6)
Api\HotReloadMSBuildWorkspace.cs (2)
234await Task.Delay(20, cancellationToken).ConfigureAwait(false); 244await Task.Delay(20 * (attemptIndex + 1), cancellationToken).ConfigureAwait(false);
Api\HotReloadMSBuildWorkspace.ProjectFileInfoProvider.cs (3)
29return Task.FromResult(ImmutableArray<ProjectFileInfo>.Empty); 32return Task.FromResult(instances.SelectAsArray(instance => 44=> Task.FromResult(
Api\HotReloadService.cs (1)
160public async Task StartSessionAsync(Solution solution, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (3)
NavigateTo\OmniSharpNavigateToSearchService.cs (3)
17public delegate Task OmniSharpNavigateToCallback(Project project, in OmniSharpNavigateToSearchResult result, CancellationToken cancellationToken); 19public static Task SearchAsync( 39public async Task AddResultsAsync(ImmutableArray<INavigateToSearchResult> results, Document? activeDocument, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features (603)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (1)
130private async Task AddInitializerToMemberAsync(
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.cs (1)
35public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
31public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
AddFileBanner\AbstractAddFileBannerCodeRefactoringProvider.cs (2)
33public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 148protected sealed override async Task RefactorAllAsync(
AddImport\AbstractAddImportCodeFixProvider.cs (1)
50public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
AddImport\AbstractAddImportCodeRefactoringProvider.cs (1)
44public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
AddImport\AbstractAddImportFeatureService.cs (4)
208private static async Task FindResultsInAllSymbolsInStartingProjectAsync( 216private static async Task FindResultsInUnreferencedProjectSourceSymbolsAsync( 261private async Task FindResultsInUnreferencedMetadataSymbolsAsync( 350private static async Task ProcessReferencesAsync(
AddImport\CodeActions\InstallWithPackageManagerCodeAction.cs (1)
28return Task.FromResult(ImmutableArray.Create<CodeActionOperation>(
AddImport\CodeActions\MetadataSymbolReferenceCodeAction.cs (1)
34return Task.FromResult<CodeActionOperation?>(new ApplyChangesOperation(project.AddMetadataReference(reference).Solution));
AddImport\CodeActions\ProjectSymbolReferenceCodeAction.cs (2)
49return Task.FromResult<CodeActionOperation?>(applyOperation); 52return Task.FromResult<CodeActionOperation?>(new AddProjectReferenceCodeActionOperation(OriginalDocument.Project.Id, FixData.ProjectReferenceToAdd, applyOperation));
AddImport\SymbolReferenceFinder_PackageAssemblySearch.cs (5)
21internal async Task FindNugetOrReferenceAssemblyReferencesAsync( 53async Task FindWorkerAsync( 124private async Task FindReferenceAssemblyReferencesAsync( 151private async Task FindNugetReferencesAsync( 181private async Task HandleReferenceAssemblyReferenceAsync(
AddImport\SymbolReferenceFinder.cs (1)
136await Task.WhenAll(tasks).ConfigureAwait(false);
AddMissingReference\AbstractAddMissingReferenceCodeFixProvider.cs (1)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context)
AddMissingReference\AddMissingReferenceCodeAction.cs (2)
80return Task.FromResult(ImmutableArray.Create<CodeActionOperation>( 88return Task.FromResult(ImmutableArray.Create(operation));
AddPackage\AbstractAddSpecificPackageCodeFixProvider.cs (1)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context)
AddPackage\InstallPackageDirectlyCodeAction.cs (1)
34=> Task.FromResult(ImmutableArray.Create(_installPackageOperation));
AddPackage\InstallWithPackageManagerCodeAction.cs (1)
25return Task.FromResult(ImmutableArray.Create<CodeActionOperation>(
BracePairs\IBracePairsService.cs (2)
22Task AddBracePairsAsync(Document document, TextSpan textSpan, ArrayBuilder<BracePairData> bracePairs, CancellationToken cancellationToken); 46public async Task AddBracePairsAsync(
ChangeSignature\AbstractChangeSignatureCodeRefactoringProvider.cs (1)
25public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (2)
67protected override Task DetermineDocumentsToSearchAsync<TData>( 80return Task.CompletedTask;
CodeFixes\Configuration\ConfigureCodeStyle\ConfigureCodeStyleOptionCodeFixProvider.cs (2)
56=> Task.FromResult(GetConfigurations(document.Project, diagnostics)); 59=> Task.FromResult(GetConfigurations(project, diagnostics));
CodeFixes\Configuration\ConfigureSeverity\ConfigureSeverityLevelCodeFixProvider.cs (2)
48=> Task.FromResult(GetConfigurations(document.Project, diagnostics, cancellationToken)); 51=> Task.FromResult(GetConfigurations(project, diagnostics, cancellationToken));
CodeFixes\Service\CodeFixService.cs (3)
156await Task.Yield().ConfigureAwait(false); 690var task = fixer.RegisterCodeFixesAsync(context) ?? Task.CompletedTask;
CodeFixes\Service\CodeFixService.FixAllPredefinedDiagnosticProvider.cs (2)
23=> Task.FromResult<IEnumerable<Diagnostic>>(_diagnostics); 26=> Task.FromResult<IEnumerable<Diagnostic>>(_diagnostics);
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (12)
111protected virtual async Task AddDocumentFixesAsync( 129if (fixAllState.Provider.RegisterCodeFixesAsync(context) is Task task) 156await Task.WhenAll(tasks).ConfigureAwait(false); 199protected virtual Task AddProjectFixesAsync( 204return Task.CompletedTask; 219return CodeAction.SolutionChangeAction.Create(title, _ => Task.FromResult(newSolution), title); 259var getChangedDocumentsTasks = new List<Task>(); 266await Task.WhenAll(getChangedDocumentsTasks).ConfigureAwait(false); 284var getFinalDocumentTasks = new List<Task>(); 291await Task.WhenAll(getFinalDocumentTasks).ConfigureAwait(false); 295private static async Task GetFinalDocumentTextAsync( 343private static async Task GetChangedDocumentsAsync(
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (1)
145return Task.FromResult(ImmutableArray<CodeFix>.Empty);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (1)
63return Task.FromResult(document);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaWarningBatchFixAllProvider.cs (1)
26protected override async Task AddDocumentFixesAsync(
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (3)
34protected override async Task AddDocumentFixesAsync( 84protected override async Task AddProjectFixesAsync( 149createChangedSolution: ct => Task.FromResult(currentSolution),
CodeFixes\Suppression\WrapperCodeFixProvider.cs (1)
22public override async Task RegisterCodeFixesAsync(CodeFixContext context)
CodeLens\CodeLensReferencesService.cs (4)
94progress => Task.FromResult(new ReferenceCount( 98progress => Task.FromResult(new ReferenceCount(progress.SearchCap, IsCapped: true, projectVersion.ToString())), 207var result = await Task.WhenAll(referenceTasks).ConfigureAwait(false); 380var result = await Task.WhenAll(descriptorTasks).ConfigureAwait(false);
CodeRefactorings\AddAwait\AbstractAddAwaitCodeRefactoringProvider.cs (2)
33public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 120generator.MemberAccessExpression(withoutTrivia, nameof(Task.ConfigureAwait)),
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsRefactoringProvider.cs (1)
19public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
CodeRefactorings\CodeRefactoringService.cs (2)
271var task = provider.ComputeRefactoringsAsync(context) ?? Task.CompletedTask;
CodeRefactorings\ExtractMethod\AbstractExtractMethodCodeRefactoringProvider.cs (1)
29public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
CodeRefactorings\MoveType\AbstractMoveTypeService.RenameFileEditor.cs (1)
32=> Task.FromResult<Solution?>(
CodeRefactorings\MoveType\MoveTypeCodeRefactoringProvider.cs (1)
18public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (1)
450var refLocations = await Task.WhenAll(
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.cs (1)
32public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
Completion\ArgumentProvider.cs (2)
23/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 24public abstract Task ProvideArgumentAsync(ArgumentContext context);
Completion\CommonCompletionProvider.cs (2)
106? Task.FromResult(CommonCompletionItem.GetDescription(item)) 107: Task.FromResult(CompletionDescription.Empty);
Completion\CompletionProvider.cs (3)
27public abstract Task ProvideCompletionsAsync(CompletionContext context); 64=> Task.FromResult<CompletionDescription?>(CompletionDescription.Empty); 78=> Task.FromResult(CompletionChange.Create(new TextChange(item.Span, item.DisplayText)));
Completion\FileSystemCompletionHelper.cs (1)
119=> Task.Run(() => GetItems(directoryPath, cancellationToken), cancellationToken);
Completion\INotifyCommittingItemCompletionProvider.cs (1)
24Task NotifyCommittingItemAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken);
Completion\Providers\AbstractAggregateEmbeddedLanguageCompletionProvider.cs (1)
88public override async Task ProvideCompletionsAsync(CompletionContext context)
Completion\Providers\AbstractAwaitCompletionProvider.cs (2)
78public sealed override async Task ProvideCompletionsAsync(CompletionContext context) 237? $".{nameof(Task.ConfigureAwait)}({_falseKeyword})"
Completion\Providers\AbstractContextVariableArgumentProvider.cs (1)
22public override async Task ProvideArgumentAsync(ArgumentContext context)
Completion\Providers\AbstractDocCommentCompletionProvider.cs (1)
77public override async Task ProvideCompletionsAsync(CompletionContext context)
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (2)
55public override async Task ProvideCompletionsAsync(CompletionContext context) 133private async Task AddAssemblyCompletionItemsAsync(CompletionContext context, CancellationToken cancellationToken)
Completion\Providers\AbstractKeywordCompletionProvider.cs (2)
33public override async Task ProvideCompletionsAsync(CompletionContext context) 76=> Task.FromResult((TextChange?)new TextChange(item.Span, item.DisplayText));
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (1)
100return Task.FromResult(ImmutableArray.Create(new SymbolAndSelectionInfo(Symbol: type, Preselect: !isArray)));
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (1)
22public override async Task ProvideCompletionsAsync(CompletionContext context)
Completion\Providers\AbstractOverrideCompletionProvider.cs (1)
21public override async Task ProvideCompletionsAsync(CompletionContext context)
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (1)
36public override async Task ProvideCompletionsAsync(CompletionContext context)
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (2)
27public sealed override async Task ProvideCompletionsAsync(CompletionContext completionContext) 116return Task.FromResult<TextChange?>(new TextChange(selectedItem.Span, insertionText));
Completion\Providers\AbstractPreprocessorCompletionProvider.cs (1)
17public sealed override async Task ProvideCompletionsAsync(CompletionContext context)
Completion\Providers\AbstractSuggestionModeCompletionProvider.cs (1)
16public override async Task ProvideCompletionsAsync(CompletionContext context)
Completion\Providers\AbstractSymbolCompletionProvider.cs (2)
331public override async Task ProvideCompletionsAsync(CompletionContext completionContext) 499=> Task.FromResult<TextChange?>(new TextChange(selectedItem.Span, GetInsertionText(selectedItem, ch)));
Completion\Providers\EmbeddedLanguageCompletionProvider.cs (1)
23public abstract Task ProvideCompletionsAsync(CompletionContext context);
Completion\Providers\ImportCompletionProvider\AbstractExtensionMethodImportCompletionProvider.cs (1)
37protected override async Task AddCompletionItemsAsync(
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (4)
23protected abstract Task AddCompletionItemsAsync(CompletionContext completionContext, SyntaxContext syntaxContext, HashSet<string> namespacesInScope, CancellationToken cancellationToken); 28public Task NotifyCommittingItemAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken) 31return Task.CompletedTask; 36public override async Task ProvideCompletionsAsync(CompletionContext completionContext)
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionProvider.cs (1)
33protected override async Task AddCompletionItemsAsync(CompletionContext completionContext, SyntaxContext syntaxContext, HashSet<string> namespacesInScope, CancellationToken cancellationToken)
Completion\Providers\ImportCompletionProvider\ExtensionMemberImportCompletionHelper.cs (1)
34public static async Task WarmUpCacheAsync(Project project, CancellationToken cancellationToken)
Completion\Providers\ImportCompletionProvider\ExtensionMemberImportCompletionHelper.SymbolComputer.cs (3)
111var results = await Task.WhenAll(peReferenceMemberSymbolsTask, projectMemberSymbolsTask).ConfigureAwait(false); 170private async Task GetExtensionMemberSymbolsFromProjectAsync( 215private async Task GetExtensionMemberSymbolsFromPeReferenceAsync(
Completion\Providers\Scripting\AbstractDirectivePathCompletionProvider.cs (2)
31public sealed override async Task ProvideCompletionsAsync(CompletionContext context) 157protected abstract Task ProvideCompletionsAsync(CompletionContext context, string pathThroughLastSlash);
Completion\Providers\Scripting\AbstractLoadDirectiveCompletionProvider.cs (1)
38protected override async Task ProvideCompletionsAsync(CompletionContext context, string pathThroughLastSlash)
Completion\Providers\Scripting\AbstractReferenceDirectiveCompletionProvider.cs (1)
50protected override async Task ProvideCompletionsAsync(CompletionContext context, string pathThroughLastSlash)
Completion\Providers\Scripting\GlobalAssemblyCacheCompletionHelper.cs (1)
30=> Task.Run(() => GetItems(directoryPath, cancellationToken));
Completion\Providers\Snippets\AbstractSnippetCompletionProvider.cs (2)
66public override async Task ProvideCompletionsAsync(CompletionContext context) 104return await Task.FromResult(CommonCompletionItem.GetDescription(item)).ConfigureAwait(false);
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (3)
43public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 149private static async Task ReplacePropertyReferencesAsync( 177private async Task ReplaceMatchingAnonymousTypesAsync(
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (1)
30public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
34public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ConvertCast\AbstractConvertCastCodeRefactoringProvider.cs (1)
35public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
59public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
53public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (2)
34public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 181protected sealed override async Task RefactorAllAsync(
ConvertLinq\AbstractConvertLinqQueryToForEachProvider.cs (2)
31public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 49c => Task.FromResult(document.WithSyntaxRoot(documentUpdateInfo.UpdateRoot(root))),
ConvertLinq\ConvertForEachToLinqQuery\AbstractConvertForEachToLinqQueryProvider.cs (2)
65public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 155return Task.FromResult(document.WithSyntaxRoot(rootWithLinqUsing));
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (2)
34public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 128return Task.FromResult(document.WithSyntaxRoot(updatedRoot));
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
32public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (2)
127public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 267protected override async Task RefactorAllAsync(
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringRefactoringProvider.cs (2)
30public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 110return Task.FromResult(document.WithSyntaxRoot(
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (4)
61public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 324private async Task ReplaceExpressionAndTypesInScopeAsync( 489private static async Task AddDocumentsToUpdateForProjectAsync(Project project, ArrayBuilder<DocumentToUpdate> result, ImmutableArray<string> tupleFieldNames, CancellationToken cancellationToken) 552private static async Task GenerateStructIntoContainingNamespaceAsync(
Copilot\CopilotChangeAnalysisUtilities.cs (1)
39public static async Task AnalyzeCopilotChangeAsync(
Copilot\ICopilotCodeAnalysisService.cs (2)
46Task AnalyzeDocumentAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken); 65Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken);
DesignerAttribute\DesignerAttributeDiscoveryService.cs (3)
176private async Task ProcessProjectAsync( 196private async Task ScanForDesignerCategoryUsageAsync( 384public static async Task DiscoverDesignerAttributesAsync(
Diagnostics\Service\DiagnosticAnalyzerService_CoreAnalyze.cs (3)
48var _ = Task.Run( 189static async Task AnalyzeDocumentAsync(
Diagnostics\Service\DiagnosticAnalyzerService_ForceCodeAnalysisDiagnostics.cs (1)
37await Task.WhenAll(documentDiagnosticsTask, projectDiagnosticsTask).ConfigureAwait(false);
Diagnostics\Service\DiagnosticAnalyzerService_GetDiagnosticsForSpan.cs (1)
303static async Task ComputeDocumentDiagnosticsAsync(
Diagnostics\Service\DiagnosticAnalyzerService.IncrementalMemberEditAnalyzer.cs (4)
132async Task ExecuteCompilerAnalyzerAsync( 147async Task ExecuteSpanBasedAnalyzersAsync( 159async Task ExecuteDocumentBasedAnalyzersAsync( 171async Task ExecuteAnalyzersAsync(
Diagnostics\Service\DocumentAnalysisExecutor_Helpers.cs (2)
124private static async Task VerifyDiagnosticLocationsAsync(ImmutableArray<Diagnostic> diagnostics, Project project, CancellationToken cancellationToken) 139async Task VerifyDiagnosticLocationAsync(string id, Location location)
DocumentHighlighting\AbstractDocumentHighlightsService.cs (1)
299private static async Task AddLocationSpanAsync(Location location, Solution solution, HashSet<DocumentSpan> spanSet, MultiDictionary<Document, HighlightSpan> tagList, HighlightSpanKind kind, CancellationToken cancellationToken)
EditAndContinue\CommittedSolution.cs (1)
401return await Task.Run(() => TryGetPdbMatchingSourceTextFromDisk(log, filePath, defaultEncoding, requiredChecksum, checksumAlgorithm), cancellationToken).ConfigureAwait(false);
EditAndContinue\DebuggingSession.cs (3)
283return Task.Run(ReadMvid, cancellationToken); 507_ = Task.Run(() => DebuggerService.PrepareModuleForUpdateAsync(mvid, cancellationToken), cancellationToken); 940_ = Task.Run(() => DebuggingSessionTelemetry.Log(data, Logger.Log, CorrelationIdFactory.GetNextId));
EditAndContinue\EditAndContinueDocumentAnalysesCache.cs (2)
46var tasks = documents.Select(document => Task.Run(() => GetDocumentAnalysisAsync(oldSolution, newSolution, document.oldDocument, document.newDocument, activeStatementSpanProvider, cancellationToken).AsTask(), cancellationToken)); 47var allResults = await Task.WhenAll(tasks).ConfigureAwait(false);
EditAndContinue\EditAndContinueService.cs (1)
143_ = await Task.WhenAll(documentTasks).ConfigureAwait(false);
EditAndContinue\EditSession.cs (1)
501internal static async Task GetProjectDifferencesAsync(
EmbeddedLanguages\Classification\AbstractEmbeddedLanguageClassificationService.cs (1)
38public async Task AddEmbeddedLanguageClassificationsAsync(
EmbeddedLanguages\DateAndTime\DateAndTimeEmbeddedCompletionProvider.cs (3)
60public override async Task ProvideCompletionsAsync(CompletionContext context) 226return Task.FromResult(CompletionChange.Create( 235return Task.FromResult((CompletionDescription?)CompletionDescription.Create(
EmbeddedLanguages\Json\LanguageServices\AbstractJsonDetectionCodeFixProvider.cs (4)
35public override Task RegisterCodeFixesAsync(CodeFixContext context) 38return Task.CompletedTask; 53protected override Task FixAllAsync( 60return Task.CompletedTask;
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedCompletionProvider.cs (3)
59public override async Task ProvideCompletionsAsync(CompletionContext context) 455return Task.FromResult(CompletionChange.Create( 467return Task.FromResult(CompletionDescription.Create(
EncapsulateField\EncapsulateFieldRefactoringProvider.cs (1)
18public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ExternalAccess\Pythia\Api\PythiaCompletionProviderBase.cs (3)
54: Task.FromResult(CommonCompletionItem.GetDescription(item)); 81public virtual Task NotifyCommittingItemAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken) 82=> Task.CompletedTask;
ExternalAccess\UnitTesting\API\INewUnitTestingIncrementalAnalyzerImplementation.cs (2)
12Task AnalyzeDocumentAsync( 17Task AnalyzeProjectAsync(
ExternalAccess\UnitTesting\API\NewUnitTestingIncrementalAnalyzer.cs (4)
17public Task AnalyzeDocumentAsync( 28public Task AnalyzeProjectAsync( 39public Task RemoveDocumentAsync(DocumentId documentId, CancellationToken cancellationToken) 42return Task.CompletedTask;
ExternalAccess\UnitTesting\API\UnitTestingDocumentSpan.cs (1)
31public async Task NavigateToAsync(UnitTestingNavigationOptions options, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\API\UnitTestingHotReloadService.cs (1)
62public async Task StartSessionAsync(Solution solution, ImmutableArray<string> capabilities, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\SolutionCrawler\IUnitTestingIncrementalAnalyzer.cs (3)
13Task AnalyzeDocumentAsync( 18Task AnalyzeProjectAsync( 23Task RemoveDocumentAsync(DocumentId documentId, CancellationToken cancellationToken);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingIdleProcessor.cs (8)
29private Task? _processorTask; 40protected abstract Task WaitAsync(CancellationToken cancellationToken); 41protected abstract Task ExecuteAsync(); 114await Task.Yield().ConfigureAwait(false); 120private async Task ProcessAsync() 123await Task.Yield().ConfigureAwait(false); 153public virtual Task AsyncProcessorTask 154=> _processorTask ?? Task.CompletedTask;
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.AbstractUnitTestingPriorityProcessor.cs (2)
65protected abstract Task HigherQueueOperationTask { get; } 68protected async Task WaitForHigherPriorityOperationsAsync()
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (11)
37private record struct TimestampedWorkItem(Func<Task> Work, DateTime TimestampAdded); 86var task = Task.Run(workItem.Work, cancellationToken); 119private void AddWork(Func<Task> work) 341private async Task EnqueueDocumentWorkItemAsync(Project project, DocumentId documentId, TextDocument? document, UnitTestingInvocationReasons invocationReasons, SyntaxNode? changedMember = null) 381private async Task EnqueueFullProjectWorkItemAsync(Project project, UnitTestingInvocationReasons invocationReasons, bool processSourceGeneratedDocuments) 401private async Task EnqueueWorkItemAsync(IUnitTestingIncrementalAnalyzer analyzer, UnitTestingReanalyzeScope scope) 411private async Task EnqueueWorkItemAsync( 423private async Task EnqueueWorkItemAsync(ProjectChanges projectChanges, bool processSourceGeneratedDocuments) 440private async Task EnqueueProjectConfigurationChangeWorkItemAsync(ProjectChanges projectChanges, bool processSourceGeneratedDocuments) 507private async Task EnqueueChangedDocumentWorkItemAsync(Document oldDocument, Document newDocument)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncProjectWorkItemQueue.cs (1)
22public override Task WaitAsync(CancellationToken cancellationToken)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncWorkItemQueue.cs (1)
65public virtual Task WaitAsync(CancellationToken cancellationToken)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingIncrementalAnalyzerProcessor.cs (6)
99public Task AsyncProcessorTask 103return Task.WhenAll( 119private async Task ProcessDocumentAnalyzersAsync( 147private async Task RunAnalyzersAsync<T>( 151Func<IUnitTestingIncrementalAnalyzer, T, CancellationToken, Task> runnerAsync, 181private async Task RunBodyAnalyzersAsync(ImmutableArray<IUnitTestingIncrementalAnalyzer> analyzers, UnitTestingWorkItem workItem, Document document, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingLowPriorityProcessor.cs (4)
43protected override Task WaitAsync(CancellationToken cancellationToken) 46protected override async Task ExecuteAsync() 66protected override Task HigherQueueOperationTask 117private async Task ProcessProjectAsync(ImmutableArray<IUnitTestingIncrementalAnalyzer> analyzers, UnitTestingWorkItem workItem, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingNormalPriorityProcessor.cs (10)
52Running = Task.CompletedTask; 95protected override Task WaitAsync(CancellationToken cancellationToken) 99public Task Running { get; private set; } 103protected override async Task ExecuteAsync() 153protected override Task HigherQueueOperationTask 154=> Task.CompletedTask; 170private async Task ProcessDocumentAsync(ImmutableArray<IUnitTestingIncrementalAnalyzer> analyzers, UnitTestingWorkItem workItem, CancellationToken cancellationToken) 249private async Task ProcessReanalyzeDocumentAsync(UnitTestingWorkItem workItem, TextDocument document, CancellationToken cancellationToken) 289private Task RemoveDocumentAsync(DocumentId documentId, CancellationToken cancellationToken) 292private static async Task RemoveDocumentAsync(ImmutableArray<IUnitTestingIncrementalAnalyzer> analyzers, DocumentId documentId, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (10)
71public override Task AsyncProcessorTask 72=> Task.WhenAll(base.AsyncProcessorTask, _processor.AsyncProcessorTask); 74protected override Task WaitAsync(CancellationToken cancellationToken) 77protected override async Task ExecuteAsync() 171private Task EnqueueWorkItemAsync(Document document, ISymbol symbol) 174private async Task EnqueueWorkItemAsync(Document thisDocument, ImmutableArray<Location> locations) 382public async Task EnqueueWorkItemAsync(Project project, DocumentId documentId, Document? document) 396protected override Task WaitAsync(CancellationToken cancellationToken) 399protected override async Task ExecuteAsync() 430private async Task EnqueueWorkItemAsync(Project? project)
ExternalAccess\VSTypeScript\Api\IVSTypeScriptClassificationService.cs (1)
16Task AddSemanticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, List<ClassifiedSpan> result, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\VSTypeScriptClassificationService.cs (5)
34public Task AddSyntacticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 35=> Task.CompletedTask; 37public Task AddEmbeddedLanguageClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 38=> Task.CompletedTask; 49public async Task AddSemanticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken)
ExternalAccess\VSTypeScript\VSTypeScriptNavigateToSearchService.cs (6)
34public async Task SearchDocumentAsync( 38Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, 49public async Task SearchProjectsAsync( 56Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, 57Func<Task> onProjectCompleted, 73async Task ProcessProjectAsync(Project project)
ExtractClass\AbstractExtractClassRefactoringProvider.cs (1)
27public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ExtractInterface\ExtractInterfaceCodeRefactoringProvider.cs (1)
28public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ExtractMethod\SelectionResult.cs (1)
180if (!syntaxFacts.StringComparer.Equals(identifier.ValueText, nameof(Task.ConfigureAwait)))
FindUsages\AbstractFindUsagesService_FindImplementations.cs (3)
24public async Task FindImplementationsAsync( 41public static async Task FindImplementationsAsync( 68private static async Task FindImplementationsInCurrentProcessAsync(
FindUsages\AbstractFindUsagesService_FindReferences.cs (7)
20async Task IFindUsagesService.FindReferencesAsync( 37Task IFindUsagesLSPService.FindReferencesAsync( 48private static async Task FindLiteralOrSymbolReferencesAsync( 83private static async Task FindSymbolReferencesAsync( 107public static async Task FindSymbolReferencesAsync( 124public static async Task FindReferencesAsync( 156private static Task FindReferencesInCurrentProcessAsync(
FindUsages\IFindUsagesLSPService.cs (2)
18Task FindReferencesAsync(IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken); 24Task FindImplementationsAsync(IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken);
FindUsages\IFindUsagesService.cs (2)
18Task FindReferencesAsync(IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken); 24Task FindImplementationsAsync(IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken);
FullyQualify\AbstractFullyQualifyCodeFixProvider.cs (1)
21public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
FullyQualify\AbstractFullyQualifyService.cs (1)
181private async Task AddFixesAsync(
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (1)
42public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (2)
66public override Task ComputeRefactoringsAsync(CodeRefactoringContext context) 151private async Task ComputeRefactoringsAsync(
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (1)
125private async Task AddOperatorsAsync(ArrayBuilder<IMethodSymbol> members, CancellationToken cancellationToken)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (3)
53public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 70private async Task HandleNonSelectionAsync(CodeRefactoringContext context) 234var codeActions = await Task.WhenAll(tasks).ConfigureAwait(false);
GenerateOverrides\GenerateOverridesCodeRefactoringProvider.cs (1)
31public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
GenerateOverrides\GenerateOverridesWithDialogCodeAction.cs (1)
73var members = await Task.WhenAll(memberTasks).ConfigureAwait(false);
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (2)
115private async Task AddMembersAsync(ArrayBuilder<ISymbol> members, GenerateTypeOptionsResult options = null) 185private async Task AddFieldDelegatingConstructorAsync(
GoToBase\AbstractGoToBaseService.cs (1)
31public async Task FindBasesAsync(IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken)
GoToBase\IGoToBaseService.cs (1)
19Task FindBasesAsync(IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken);
ImplementInterface\ImplementInterfaceCodeRefactoringProvider.cs (1)
22public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (1)
55public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
InlineHints\AbstractInlineParameterNameHintsService.cs (1)
35public async Task AddInlineHintsAsync(
InlineHints\AbstractInlineTypeHintsService.cs (1)
31public async Task AddInlineHintsAsync(
InlineHints\IInlineParameterNameHintsService.cs (1)
20Task AddInlineHintsAsync(
InlineHints\IInlineTypeHintsService.cs (1)
20Task AddInlineHintsAsync(
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
79public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (1)
48public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
645private async Task UpdateExpressionInOriginalFunctionAsync(SyntaxEditor editor, CancellationToken cancellationToken)
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (1)
53public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
IntroduceVariable\AbstractIntroduceLocalForExpressionCodeRefactoringProvider.cs (1)
32public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
IntroduceVariable\IntroduceVariableCodeRefactoringProvider.cs (1)
23public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
InvertConditional\AbstractInvertConditionalCodeRefactoringProvider.cs (1)
21public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (1)
93public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
InvertLogical\AbstractInvertLogicalCodeRefactoringProvider.cs (1)
35public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (5)
161private async Task AddPartsAsync(ImmutableArray<ISymbol> symbols) 391private async Task AddDescriptionPartAsync(ISymbol symbol) 635private async Task AddDescriptionForFieldAsync(IFieldSymbol symbol) 676private async Task AddDescriptionForLocalAsync(ILocalSymbol symbol) 744private async Task AddDescriptionForParameterAsync(IParameterSymbol symbol)
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (1)
181await Task.Delay(DelayTimeSpan.Short, cancellationToken).ConfigureAwait(false);
MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceCodeRefactoringProvider.cs (1)
16public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
MoveStaticMembers\AbstractMoveStaticMembersRefactoringProvider.cs (1)
20public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (2)
376tasks.Add(Task.Run(async () => 386var symbolRefs = await Task.WhenAll(tasks).ConfigureAwait(false);
MoveToNamespace\AbstractMoveToNamespaceService.cs (1)
176return Task.FromResult(MoveToNamespaceResult.Failed);
MoveToNamespace\MoveToNamespaceCodeActionProvider.cs (1)
20public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (1)
22public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (7)
68public async Task SearchCachedDocumentsAsync( 75Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, 76Func<Task> onProjectCompleted, 109public static async Task SearchCachedDocumentsInCurrentProcessAsync( 115Func<ImmutableArray<RoslynNavigateToItem>, VoidResult, CancellationToken, Task> onItemsFound, 116Func<Task> onProjectCompleted, 141async Task ProcessSingleProjectGroupAsync(
NavigateTo\AbstractNavigateToSearchService.cs (2)
36private static Func<ImmutableArray<RoslynNavigateToItem>, VoidResult, CancellationToken, Task> GetOnItemsFoundCallback( 37Solution solution, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound)
NavigateTo\AbstractNavigateToSearchService.GeneratedDocumentSearch.cs (7)
20public async Task SearchGeneratedDocumentsAsync( 26Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, 27Func<Task> onProjectCompleted, 60public static async Task SearchGeneratedDocumentsInCurrentProcessAsync( 64Func<ImmutableArray<RoslynNavigateToItem>, VoidResult, CancellationToken, Task> onItemsFound, 65Func<Task> onProjectCompleted, 77async Task ProcessSingleProjectAsync(
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (14)
26public async Task SearchDocumentAsync( 30Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, 53public static async Task SearchDocumentAndRelatedDocumentsInCurrentProcessAsync( 57Func<ImmutableArray<RoslynNavigateToItem>, VoidResult, CancellationToken, Task> onItemsFound, 69await Task.WhenAll( 73Task SearchDocumentsInCurrentProcessAsync(ImmutableArray<(Document document, NormalizedTextSpanCollection? spans)> documentAndSpans) 96async Task SearchRelatedDocumentsInCurrentProcessAsync() 146public async Task SearchProjectsAsync( 153Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, 154Func<Task> onProjectCompleted, 188public static async Task SearchProjectsInCurrentProcessAsync( 193Func<ImmutableArray<RoslynNavigateToItem>, VoidResult, CancellationToken, Task> onItemsFound, 194Func<Task> onProjectCompleted, 215async Task SearchSingleProjectAsync(
NavigateTo\INavigateToSearchCallback.cs (1)
16Task AddResultsAsync(ImmutableArray<INavigateToSearchResult> results, Document? activeDocument, CancellationToken cancellationToken);
NavigateTo\INavigateToSearcherHost.cs (4)
50private static Task? s_remoteHostHydrateTask = null; 88private Task GetRemoteHostHydrateTask() 99s_remoteHostHydrateTask = Task.CompletedTask; 105s_remoteHostHydrateTask = Task.Run(async () =>
NavigateTo\INavigateToSearchService.cs (11)
18Task SearchDocumentAsync( 22Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, 35Task SearchProjectsAsync( 42Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, 43Func<Task> onProjectCompleted, 62Task SearchCachedDocumentsAsync( 69Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, 70Func<Task> onProjectCompleted, 81Task SearchGeneratedDocumentsAsync( 87Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, 88Func<Task> onProjectCompleted,
NavigateTo\IRemoteNavigateToSearchService.cs (2)
51Func<ImmutableArray<RoslynNavigateToItem>, VoidResult, CancellationToken, Task> onItemsFound, 52Func<Task>? onProjectCompleted,
NavigateTo\NavigateToSearcher.cs (22)
115private async Task AddProgressItemsAsync(int count, CancellationToken cancellationToken) 124private async Task ProgressItemsCompletedAsync(int count, CancellationToken cancellationToken) 132public Task SearchAsync(NavigateToSearchScope searchScope, CancellationToken cancellationToken) 135public async Task SearchAsync( 184private async Task SearchCurrentDocumentAsync(CancellationToken cancellationToken) 199private Task SearchCurrentProjectAsync( 204return Task.CompletedTask; 220private async Task SearchAllProjectsAsync( 229private async Task SearchSpecificProjectsAsync( 346private async Task ProcessOrderedProjectsAsync( 350Func<INavigateToSearchService, ImmutableArray<Project>, Func<ImmutableArray<INavigateToSearchResult>, Task>, Func<Task>, Task> processProjectAsync, 413private Task SearchFullyLoadedProjectsAsync( 431private Task SearchCachedDocumentsAsync( 463private Task SearchGeneratedDocumentsAsync( 533public Task SearchDocumentAsync(Document document, string searchPattern, IImmutableSet<string> kinds, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, CancellationToken cancellationToken) 534=> Task.CompletedTask; 536public async Task SearchProjectsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken)
Navigation\DefaultSymbolNavigationService.cs (1)
22=> Task.FromResult<(string filePath, LinePosition linePosition)?>(null);
Navigation\INavigableLocation.cs (1)
39return Task.FromResult<INavigableLocation?>(
OrganizeImports\OrganizeImportsCodeRefactoringProvider.cs (3)
54protected override async Task RefactorAllAsync( 66public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 91cancellationToken => Task.FromResult(document.WithSyntaxRoot(newRoot))),
PdbSourceDocument\PdbFileLocatorService.cs (4)
66var delay = Task.Delay(SymbolLocatorTimeout, cancellationToken); 70var winner = await Task.WhenAny(pdbResultTask, delay).ConfigureAwait(false);
PdbSourceDocument\PdbSourceDocumentLoaderService.cs (4)
129var delay = Task.Delay(timeout, cancellationToken); 132var winner = await Task.WhenAny(sourceFileTask, delay).ConfigureAwait(false);
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
252var sourceFileInfos = await Task.WhenAll(sourceFileInfoTasks).ConfigureAwait(false);
PreferFrameworkType\PreferFrameworkTypeCodeFixProvider.cs (3)
26public override Task RegisterCodeFixesAsync(CodeFixContext context) 34return Task.CompletedTask; 37protected override async Task FixAllAsync(
PullMemberUp\AbstractPullMemberUpRefactoringProvider.cs (1)
24public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
PullMemberUp\MembersPuller.cs (1)
479var allSyntaxes = await Task.WhenAll(tasks).ConfigureAwait(false);
QuickInfo\CommonSemanticQuickInfoProvider.cs (1)
179=> Task.FromResult<OnTheFlyDocsInfo?>(null);
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (2)
39public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 55protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor syntaxEditor, CancellationToken cancellationToken)
ReplaceConditionalWithStatements\AbstractReplaceConditionalWithStatementsCodeRefactoringProvider.cs (1)
51public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (1)
24public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
33public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (1)
54public async Task ReplaceReferenceAsync(
ReplacePropertyWithMethods\IReplacePropertyWithMethodsService.cs (1)
18Task ReplaceReferenceAsync(
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (2)
38public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) 232private async Task ReplaceReferencesAsync(
SemanticSearch\SearchCompilationFailureDefinitionItem.cs (1)
37=> Task.FromResult<INavigableLocation?>(null);
SemanticSearch\SearchExceptionDefinitionItem.cs (1)
41=> Task.FromResult<INavigableLocation?>(null);
SimplifyThisOrMe\AbstractSimplifyThisOrMeCodeFixProvider.cs (3)
30public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 33return Task.CompletedTask; 36protected sealed override async Task FixAllAsync(
SimplifyTypeNames\AbstractSimplifyTypeNamesCodeFixProvider.cs (2)
70public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 91protected override async Task FixAllAsync(
Snippets\SnippetProviders\AbstractLockSnippetProvider.cs (1)
19return Task.FromResult(new TextChange(TextSpan.FromBounds(position, position), statement.NormalizeWhitespace().ToFullString()));
Snippets\SnippetProviders\AbstractMainMethodSnippetProvider.cs (1)
34return Task.FromResult(new TextChange(TextSpan.FromBounds(position, position), method.NormalizeWhitespace().ToFullString()));
Snippets\SnippetProviders\AbstractSnippetProvider.cs (1)
248=> Task.FromResult(document);
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (5)
37public override async Task RegisterCodeFixesAsync(CodeFixContext context) 63private async Task CheckNodeAsync(CodeFixContext context, Document document, SyntaxNode node, CancellationToken cancellationToken) 89private async Task CheckTokenAsync(CodeFixContext context, Document document, SyntaxToken token, CancellationToken cancellationToken) 107private async Task CreateSpellCheckCodeIssueAsync( 145private async Task CheckItemsAsync(
SplitOrMergeIfStatements\AbstractMergeIfStatementsCodeRefactoringProvider.cs (1)
35public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
SplitOrMergeIfStatements\AbstractSplitIfStatementCodeRefactoringProvider.cs (1)
32public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
SplitOrMergeIfStatements\Nested\AbstractSplitIntoNestedIfStatementsCodeRefactoringProvider.cs (1)
56return Task.FromResult(
src\939a5660f39ce290\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (2)
43public override async Task RegisterCodeFixesAsync(CodeFixContext context) 56protected override async Task FixOneAsync(
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (3)
84public async Task AnalyzeAsync( 506private static async Task ProcessReportedDiagnosticsAsync( 583static async Task ProcessAttributeSuppressionsAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (2)
24public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 39protected sealed override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (3)
32public override async Task RegisterCodeFixesAsync(CodeFixContext context) 82protected override async Task FixAllAsync( 99private async Task FixOneAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (2)
65public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 210protected sealed override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\AddObsoleteAttribute\AbstractAddObsoleteAttributeCodeFixProvider.cs (2)
32public override async Task RegisterCodeFixesAsync(CodeFixContext context) 70protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
62public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\AddRequiredParentheses\AddRequiredParenthesesCodeFixProvider.cs (2)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
29public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
69public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (1)
21public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\ConvertTypeOfToNameOf\AbstractConvertTypeOfToNameOfCodeFixProvider.cs (2)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 33protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
29public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
33public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (2)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 38protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (2)
49public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 86protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
125private async Task InitializeNonDelegatedConstructorAsync(CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorCodeFixProvider.cs (1)
20public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (1)
28public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (3)
88private static async Task AddPropertyCodeActionsAsync( 177private async Task AddLocalCodeActionsAsync( 193private static async Task AddParameterCodeActionsAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (1)
23public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (1)
18public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\Iterator\AbstractIteratorCodeFixProvider.cs (1)
19public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (3)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override async Task FixAllAsync( 54private async Task MakeFieldReadonlyAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMemberStatic\AbstractMakeMemberStaticCodeFixProvider.cs (2)
19public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 28protected sealed override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor,
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (1)
42public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (2)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context) 239if (parentMemberAccessExpressionName == nameof(Task.ConfigureAwait))
src\roslyn\src\Analyzers\Core\CodeFixes\MakeTypeAbstract\AbstractMakeTypeAbstractCodeFixProvider.cs (2)
20public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 28protected sealed override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor,
src\roslyn\src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (2)
18public override async Task RegisterCodeFixesAsync(CodeFixContext context) 23protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
25public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
46public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (1)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (1)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (2)
32public override async Task RegisterCodeFixesAsync(CodeFixContext context) 43protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (4)
50public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 116private async Task FixWithEditorAsync( 129private async Task FixOneDiagnosticAsync( 211protected override Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\QualifyMemberAccess\AbstractQualifyMemberAccessCodeFixProvider.cs (2)
26public override async Task RegisterCodeFixesAsync(CodeFixContext context) 32protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (4)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 52protected sealed override async Task FixAllAsync( 209invocation = generator.MemberAccessExpression(taskTypeExpression, nameof(Task.CompletedTask)); 226var memberName = generator.GenericName(nameof(Task.FromResult), unwrappedReturnType);
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveRedundantEquality\RemoveRedundantEqualityCodeFixProvider.cs (1)
29protected override async Task FixAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsCodeFixProvider.cs (2)
30public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 52protected sealed override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs (2)
26public override async Task RegisterCodeFixesAsync(CodeFixContext context) 31protected override Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs (2)
26public override async Task RegisterCodeFixesAsync(CodeFixContext context) 39protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (2)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context) 45protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (2)
34public override async Task RegisterCodeFixesAsync(CodeFixContext context) 39protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (5)
132public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 284protected sealed override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 344private async Task FixAllAsync( 441private async Task FixAllValueAssignedIsUnusedDiagnosticsAsync( 883async Task OnDocumentUpdatedAsync()
src\roslyn\src\Analyzers\Core\CodeFixes\SimplifyBooleanExpression\SimplifyConditionalCodeFixProvider.cs (2)
29public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 34protected sealed override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\SimplifyInterpolation\AbstractSimplifyInterpolationCodeFixProvider.cs (2)
40public override async Task RegisterCodeFixesAsync(CodeFixContext context) 45protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\SimplifyLinqExpression\SimplifyLinqExpressionCodeFixProvider.cs (2)
27public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 32protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (2)
27public override async Task RegisterCodeFixesAsync(CodeFixContext context) 40protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
83public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\roslyn\src\Analyzers\Core\CodeFixes\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (2)
24public override async Task RegisterCodeFixesAsync(CodeFixContext context) 32protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (2)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context) 35protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (2)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context) 36protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (1)
60protected sealed override async Task FixAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseCompoundAssignment\AbstractUseCompoundAssignmentCodeFixProvider.cs (2)
44public override async Task RegisterCodeFixesAsync(CodeFixContext context) 49protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (2)
42protected abstract Task FixOneAsync( 46protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (2)
34public override async Task RegisterCodeFixesAsync(CodeFixContext context) 43protected override async Task FixOneAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseExplicitTupleName\UseExplicitTupleNameCodeFixProvider.cs (2)
26public override async Task RegisterCodeFixesAsync(CodeFixContext context) 31protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseInferredMemberName\AbstractUseInferredMemberNameCodeFixProvider.cs (2)
21public override async Task RegisterCodeFixesAsync(CodeFixContext context) 26protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs (2)
34public override async Task RegisterCodeFixesAsync(CodeFixContext context) 45protected override async Task FixAllAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (3)
79protected override async Task FixAsync( 98private async Task FixConditionalExpressionAsync( 156private async Task FixIfStatementAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
63protected override async Task FixAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (2)
28public override async Task RegisterCodeFixesAsync(CodeFixContext context) 33protected override async Task FixAllAsync(
StackTraceExplorer\StackFrameMethodSymbolResolver.cs (1)
30return Task.FromResult(match);
StackTraceExplorer\StackTraceAnalyzer.cs (1)
29return Task.FromResult(result);
SymbolMapping\SymbolMappingServiceFactory.cs (1)
37=> Task.FromResult(new SymbolMappingResult(document.Project, symbol));
SyncNamespaces\AbstractSyncNamespacesService.cs (2)
154private static readonly Task<IEnumerable<Diagnostic>> EmptyDiagnosticResult = Task.FromResult(Enumerable.Empty<Diagnostic>()); 178? Task.FromResult<IEnumerable<Diagnostic>>(diagnostics)
Tagging\CompilationAvailableHelpers.cs (2)
15public static Task ComputeCompilationInCurrentProcessAsync(Project project, CancellationToken cancellationToken) 16=> s_shouldSkipComputation ? Task.CompletedTask : project.GetCompilationAsync(cancellationToken);
UnusedReferences\UnusedReferencesRemover.cs (2)
263public static async Task UpdateReferencesAsync( 274internal static async Task ApplyReferenceUpdatesAsync(
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (4)
19Task ComputeRefactoringsAsync(CodeRefactoringContext context, SyntaxNode root); 27public async Task ComputeRefactoringsAsync( 146return Task.FromResult(document.WithSyntaxRoot(newRoot)); 197public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
ValueTracking\ValueTracker.cs (7)
19public static async Task TrackValueSourceAsync( 73public static async Task TrackValueSourceAsync( 138private static async Task AddItemsFromAssignmentAsync(Document document, SyntaxNode lhsNode, OperationCollector collector, CancellationToken cancellationToken) 164private static async Task TrackVariableReferencesAsync(ISymbol symbol, OperationCollector collector, CancellationToken cancellationToken) 174private static async Task TrackParameterSymbolAsync( 188private static async Task TrackMethodSymbolAsync(IMethodSymbol methodSymbol, OperationCollector collector, CancellationToken cancellationToken) 284private static async Task TrackVariableDefinitionsAsync(ISymbol symbol, OperationCollector collector, CancellationToken cancellationToken)
ValueTracking\ValueTracker.FindReferencesProgress.cs (2)
144private async Task TrackConstructorAsync(ReferenceLocation referenceLocation, CancellationToken cancellationToken) 167private async Task TrackMethodInvocationArgumentsAsync(ReferenceLocation referenceLocation, CancellationToken cancellationToken)
ValueTracking\ValueTracker.OperationCollector.cs (17)
25public Task VisitAsync(IOperation operation, CancellationToken cancellationToken) 32IArgumentOperation argumentOperation => ShouldTrackArgument(argumentOperation) ? VisitAsync(argumentOperation.Value, cancellationToken) : Task.CompletedTask, 46private async Task VisitReturnDescendentsAsync(IOperation operation, bool allowImplicit, CancellationToken cancellationToken) 56private async Task VisitDefaultAsync(IOperation operation, CancellationToken cancellationToken) 99private Task VisitAssignmentOperationAsync(IAssignmentOperation assignmentOperation, CancellationToken cancellationToken) 102private Task VisitObjectCreationAsync(IObjectCreationOperation objectCreationOperation, CancellationToken cancellationToken) 105private async Task VisitInvocationAsync(IInvocationOperation invocationOperation, CancellationToken cancellationToken) 111private Task VisitReferenceAsync(IOperation operation, CancellationToken cancellationToken) 140return Task.CompletedTask; 142Task AddReferenceAsync(IOperation operation, CancellationToken cancellationToken) 149_ => Task.CompletedTask 153private Task VisitLiteralAsync(ILiteralOperation literalOperation, CancellationToken cancellationToken) 157return Task.CompletedTask; 163private Task VisitReturnAsync(IReturnOperation returnOperation, CancellationToken cancellationToken) 167return Task.CompletedTask; 173private async Task AddOperationAsync(IOperation operation, ISymbol symbol, CancellationToken cancellationToken) 182private async Task TrackArgumentsAsync(ImmutableArray<IArgumentOperation> argumentOperations, CancellationToken cancellationToken)
Wrapping\AbstractCodeActionComputer.cs (1)
160return new WrapItemsAction(title, parentTitle, (_, _) => Task.FromResult(formattedDocument));
Wrapping\AbstractWrappingCodeRefactoringProvider.cs (1)
35public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
Wrapping\ChainedExpression\ChainedExpressionCodeActionComputer.cs (3)
106private async Task AddWrapCodeActionAsync(ArrayBuilder<WrapItemsAction> actions, CancellationToken cancellationToken) 116private async Task AddUnwrapCodeActionAsync(ArrayBuilder<WrapItemsAction> actions, CancellationToken cancellationToken) 119private async Task AddWrapLongCodeActionAsync(ArrayBuilder<WrapItemsAction> actions, CancellationToken cancellationToken)
Wrapping\SeparatedSyntaxList\SeparatedSyntaxListCodeActionComputer.cs (2)
95private async Task AddTextChangeBetweenOpenAndFirstItemAsync( 144private async Task AddWrappingGroupsAsync(
Microsoft.CodeAnalysis.Features.ExternalAccess (17)
Copilot\Analyzer\CopilotAnalysisUtilities.cs (1)
15public static Task AnalyzeCopilotChangeAsync(
Copilot\Analyzer\IExternalCSharpCopilotCodeAnalysisService.cs (1)
19Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken);
Copilot\Internal\Analyzer\AbstractCopilotCodeAnalysisService.cs (4)
44protected abstract Task StartRefinementSessionCoreAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken); 80public async Task AnalyzeDocumentAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken) 171return Task.FromResult(diagnostics.WhereAsArray(static (diagnostic, span) => diagnostic.Location.SourceSpan.IntersectsWith(span), span)); 174public async Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken)
Copilot\Internal\Analyzer\CSharp\CSharpCopilotCodeAnalysisService.cs (10)
67return Task.FromResult(ImmutableArray<Diagnostic>.Empty); 75return Task.FromResult(ImmutableArray<string>.Empty); 83return Task.FromResult(ImmutableArray<Diagnostic>.Empty); 91return Task.FromResult(false); 94protected override Task StartRefinementSessionCoreAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken) 99return Task.CompletedTask; 107return Task.FromResult(string.Empty); 115return Task.FromResult((string.Empty, false)); 143return Task.FromResult(false); 151return Task.FromResult<(Dictionary<string, string>?, bool)>((null, false));
Copilot\SemanticSearch\CopilotSemanticSearchUtilities.cs (1)
45public static Task FindReferencesAsync(Solution solution, ISymbol symbol, Action<ReferenceLocation> callback, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.NetAnalyzers (246)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\AbstractTypesShouldNotHaveConstructors.Fixer.cs (3)
26public override Task RegisterCodeFixesAsync(CodeFixContext context) 30return Task.CompletedTask; 39protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\DefineAccessorsForAttributeArguments.Fixer.cs (3)
32public override async Task RegisterCodeFixesAsync(CodeFixContext context) 96private static async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, string? equivalenceKey, CancellationToken cancellationToken) 126private static async Task AddAccessorAsync(Document document, SyntaxNode parameter, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\DoNotDirectlyAwaitATask.Fixer.cs (1)
28public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EnumsShouldHaveZeroValue.Fixer.cs (1)
25public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EnumStorageShouldBeInt32.Fixer.cs (5)
23public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 27return Task.CompletedTask; 30protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 35return Task.CompletedTask; 45return Task.CompletedTask;
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EnumWithFlagsAttribute.Fixer.cs (3)
28public override async Task RegisterCodeFixesAsync(CodeFixContext context) 55: Task.CompletedTask); 62private static async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EquatableAnalyzer.Fixer.cs (2)
37public override async Task RegisterCodeFixesAsync(CodeFixContext context) 92private static async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor,
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\ExceptionsShouldBePublic.Fixer.cs (4)
23public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 26return Task.CompletedTask; 29protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 33return Task.CompletedTask;
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\IdentifiersShouldNotContainUnderscores.Fixer.cs (1)
32public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\ImplementStandardExceptionConstructors.Fixer.cs (3)
36public override Task RegisterCodeFixesAsync(CodeFixContext context) 43return Task.CompletedTask; 46protected override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\InterfaceMethodsShouldBeCallableByChildTypes.Fixer.cs (1)
33public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\MarkAttributesWithAttributeUsage.Fixer.cs (3)
33? Task.CompletedTask 36public override async Task RegisterCodeFixesAsync(CodeFixContext context) 91private static async Task AddAttributeUsageAttributeAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor,
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OperatorOverloadsHaveNamedAlternates.Fixer.cs (3)
26public override Task RegisterCodeFixesAsync(CodeFixContext context) 30return Task.CompletedTask; 33protected override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OperatorsShouldHaveSymmetricalOverloads.Fixer.cs (3)
31public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 34return Task.CompletedTask; 37protected sealed override async Task ApplyFixAsync(
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverloadOperatorEqualsOnOverridingValueTypeEquals.Fixer.cs (3)
25public override Task RegisterCodeFixesAsync(CodeFixContext context) 29return Task.CompletedTask; 32protected override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverrideEqualsAndOperatorEqualsOnValueTypes.Fixer.cs (3)
33public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 54return Task.CompletedTask; 57private static async Task ImplementMissingMembersAsync(
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverrideEqualsOnOverloadingOperatorEquals.Fixer.cs (3)
19public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 23return Task.CompletedTask; 26protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverrideGetHashCodeOnOverridingEquals.Fixer.cs (3)
19public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 23return Task.CompletedTask; 26protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverrideMethodsOnComparableTypes.Fixer.cs (2)
23public override async Task RegisterCodeFixesAsync(CodeFixContext context) 51protected override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\ParameterNamesShouldMatchBaseDeclaration.Fixer.cs (1)
33public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\TypesThatOwnDisposableFieldsShouldBeDisposable.Fixer.cs (2)
26public override async Task RegisterCodeFixesAsync(CodeFixContext context) 40protected override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\UriParametersShouldNotBeStrings.Fixer.cs (3)
39public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 61return Task.CompletedTask; 64private static async Task AddOverloadAsync(
Microsoft.CodeQuality.Analyzers\Maintainability\AvoidLengthCalculationWhenSlicingToEnd.Fixer.cs (2)
27public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 43protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.CodeQuality.Analyzers\Maintainability\AvoidUnusedPrivateFields.Fixer.cs (4)
23public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 27return Task.CompletedTask; 30protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 38return Task.CompletedTask;
Microsoft.CodeQuality.Analyzers\Maintainability\MakeTypesInternal.Fixer.cs (4)
17public override Task RegisterCodeFixesAsync(CodeFixContext context) 23return Task.CompletedTask; 26protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 33return Task.CompletedTask;
Microsoft.CodeQuality.Analyzers\Maintainability\UseCrossPlatformIntrinsicsFixer.cs (6)
23public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 26return Task.CompletedTask; 29protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 38return Task.CompletedTask; 44return Task.CompletedTask; 48return Task.CompletedTask;
Microsoft.CodeQuality.Analyzers\Maintainability\UseNameofInPlaceOfString.Fixer.cs (4)
24public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 40protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 46return Task.CompletedTask; 60return Task.CompletedTask;
Microsoft.CodeQuality.Analyzers\QualityGuidelines\MarkMembersAsStatic.Fixer.cs (1)
42public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\RemoveEmptyFinalizers.Fixer.cs (4)
23public override Task RegisterCodeFixesAsync(CodeFixContext context) 27return Task.CompletedTask; 30protected override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 40return Task.CompletedTask;
Microsoft.CodeQuality.Analyzers\QualityGuidelines\RethrowToPreserveStackDetails.Fixer.cs (4)
25public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 40protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 45return Task.CompletedTask; 56return Task.CompletedTask;
Microsoft.CodeQuality.Analyzers\QualityGuidelines\SealMethodsThatSatisfyPrivateInterfaces.Fixer.cs (1)
30public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\UseLiteralsWhereAppropriate.Fixer.cs (5)
23public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 38protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 44return Task.CompletedTask; 50return Task.CompletedTask; 91return Task.CompletedTask;
Microsoft.NetCore.Analyzers\ImmutableCollections\DoNotCallToImmutableCollectionOnAnImmutableCollectionValue.Fixer.cs (2)
31public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 68return Task.FromResult(newDocument);
Microsoft.NetCore.Analyzers\InteropServices\DynamicInterfaceCastableImplementation.Fixer.cs (4)
26public override async Task RegisterCodeFixesAsync(CodeFixContext context) 82private async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, string? equivalenceKey, CancellationToken cancellationToken) 114protected abstract Task ImplementInterfacesOnDynamicCastableImplementationAsync( 120protected abstract Task MakeMemberDeclaredOnImplementationTypeStaticAsync(
Microsoft.NetCore.Analyzers\InteropServices\ProvidePublicParameterlessSafeHandleConstructor.Fixer.cs (4)
20public override Task RegisterCodeFixesAsync(CodeFixContext context) 26return Task.CompletedTask; 29protected override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 39return Task.CompletedTask;
Microsoft.NetCore.Analyzers\InteropServices\SpecifyMarshalingForPInvokeStringArguments.Fixer.cs (2)
25public override async Task RegisterCodeFixesAsync(CodeFixContext context) 44protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Performance\DoNotGuardCall.Fixer.cs (4)
26public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 41protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 46return Task.CompletedTask; 55return Task.CompletedTask;
Microsoft.NetCore.Analyzers\Performance\DoNotUseCountWhenAnyCanBeUsed.Fixer.cs (6)
55/// <returns>A <see cref="Task" /> that represents the asynchronous operation.</returns> 56public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 80private Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, string? equivalenceKey, CancellationToken cancellationToken) 86return Task.CompletedTask; 95return Task.CompletedTask; 130return Task.CompletedTask;
Microsoft.NetCore.Analyzers\Performance\PreferConvertToHexStringOverBitConverter.Fixer.cs (2)
35public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 60protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Performance\PreferDictionaryTryMethodsOverContainsKeyGuardFixer.cs (1)
60protected abstract Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, FixAllState state, CancellationToken cancellationToken);
Microsoft.NetCore.Analyzers\Performance\PreferHashDataOverComputeHash.Fixer.cs (2)
26public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 76return Task.FromResult(Document.WithSyntaxRoot(root));
Microsoft.NetCore.Analyzers\Performance\PreferIsEmptyOverCount.Fixer.cs (4)
22public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 41protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 48return Task.CompletedTask; 79return Task.CompletedTask;
Microsoft.NetCore.Analyzers\Performance\PreferLengthCountIsEmptyOverAny.Fixer.cs (2)
32return Task.CompletedTask; 35public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.NetCore.Analyzers\Performance\PreferReadOnlySpanOverSpan.Fixer.cs (1)
44public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.NetCore.Analyzers\Performance\RecommendCaseInsensitiveStringComparison.Fixer.cs (3)
38public override async Task RegisterCodeFixesAsync(CodeFixContext context) 182return Task.FromResult(doc.WithSyntaxRoot(newRoot)); 212return Task.FromResult(doc.WithSyntaxRoot(newRoot));
Microsoft.NetCore.Analyzers\Performance\UseAsSpanInsteadOfRangeIndexer.Fixer.cs (2)
44return Task.CompletedTask; 47public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.NetCore.Analyzers\Performance\UsePropertyInsteadOfCountMethodWhenAvailable.Fixer.cs (5)
36/// <returns>A <see cref="Task" /> that represents the asynchronous operation.</returns> 37public override async Task RegisterCodeFixesAsync(CodeFixContext context) 53protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 61return Task.CompletedTask; 79return Task.CompletedTask;
Microsoft.NetCore.Analyzers\Performance\UseSearchValues.Fixer.cs (3)
47public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 59return Task.CompletedTask; 81private async Task ConvertToSearchValuesAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, FixState state, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Performance\UseSpanClearInsteadOfFIll.Fixer.cs (4)
23public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 38protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 44return Task.CompletedTask; 54return Task.CompletedTask;
Microsoft.NetCore.Analyzers\Performance\UseStartsWithInsteadOfIndexOfComparisonWithZero.Fixer.cs (4)
20public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 27return Task.CompletedTask; 30protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 96return Task.CompletedTask;
Microsoft.NetCore.Analyzers\Performance\UseStringContainsCharOverloadWithSingleCharacters.Fixer.cs (4)
20public override async Task RegisterCodeFixesAsync(CodeFixContext context) 35protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 40return Task.CompletedTask; 53return Task.CompletedTask;
Microsoft.NetCore.Analyzers\Performance\UseStringMethodCharOverloadWithSingleCharacters.Fixer.cs (2)
23public override async Task RegisterCodeFixesAsync(CodeFixContext context) 37protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\AvoidConstArrays.Fixer.cs (3)
39public override Task RegisterCodeFixesAsync(CodeFixContext context) 50return Task.CompletedTask; 64private static async Task ExtractConstArrayAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor,
Microsoft.NetCore.Analyzers\Runtime\AvoidUnreliableStreamRead.Fixer.cs (2)
35public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 48protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\AvoidUnsealedAttributes.Fixer.cs (4)
23public override Task RegisterCodeFixesAsync(CodeFixContext context) 27return Task.CompletedTask; 30protected override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 41return Task.CompletedTask;
Microsoft.NetCore.Analyzers\Runtime\AvoidZeroLengthArrayAllocations.Fixer.cs (3)
24public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 31return Task.CompletedTask; 34protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\DoNotUseEnumerableMethodsOnIndexableCollectionsInsteadUseTheCollectionDirectly.Fixer.cs (3)
35public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 91return Task.FromResult(document); 95return Task.FromResult(document.WithSyntaxRoot(newRoot));
Microsoft.NetCore.Analyzers\Runtime\ForwardCancellationTokenToInvocations.Fixer.cs (2)
49public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 66protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\InstantiateArgumentExceptionsCorrectly.Fixer.cs (2)
35public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 59private static async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, string? equivalenceKey, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\MarkAllNonSerializableFields.Fixer.cs (1)
26public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.NetCore.Analyzers\Runtime\MarkISerializableTypesWithSerializable.Fixer.cs (3)
25public override Task RegisterCodeFixesAsync(CodeFixContext context) 29return Task.CompletedTask; 32protected override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\PreferAsSpanOverSubstring.Fixer.cs (1)
31public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.NetCore.Analyzers\Runtime\PreferConstCharOverConstUnitString.Fixer.cs (2)
33public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 60private static async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, HashSet<SyntaxNode> rewritten, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\PreferDictionaryContainsMethods.Fixer.cs (3)
27return Task.CompletedTask; 30public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 51return Task.CompletedTask;
Microsoft.NetCore.Analyzers\Runtime\PreferJsonElementParse.Fixer.cs (2)
28public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 46protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\PreferStreamAsyncMemoryOverloads.Fixer.cs (2)
59public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 82private async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, string? equivalenceKey, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\PreferStringContainsOverIndexOf.Fixer.cs (2)
24public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 42protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\PreferTypedStringBuilderAppendOverloads.Fixer.cs (2)
33public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 59private static async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, string? equivalenceKey, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\SealInternalTypes.Fixer.cs (3)
19public override Task RegisterCodeFixesAsync(CodeFixContext context) 26return Task.CompletedTask; 41static async Task SealDeclarationAt(SolutionEditor solutionEditor, Location location, CancellationToken token)
Microsoft.NetCore.Analyzers\Runtime\SpecifyCultureForToLowerAndToUpper.Fixer.cs (2)
28public override async Task RegisterCodeFixesAsync(CodeFixContext context) 58private async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, string? equivalenceKey, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\TestForEmptyStringsUsingStringLength.Fixer.cs (2)
33public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 67private async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, string? equivalenceKey, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\TestForNaNCorrectly.Fixer.cs (2)
23public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 34protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\UseCancellationTokenThrowIfCancellationRequested.Fixer.cs (1)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.NetCore.Analyzers\Runtime\UseEnvironmentMembersFixer.cs (3)
35: Task.CompletedTask); 37public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 72private static async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\UseExceptionThrowHelpersFixer.cs (1)
29public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.NetCore.Analyzers\Runtime\UseOrdinalStringComparison.Fixer.cs (2)
21public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 57protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\UseRegexMembersFixer.cs (2)
38public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 67private static async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, string? equivalenceKey, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\UseSpanBasedStringConcat.Fixer.cs (2)
36public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 48protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\UseStringEqualsOverStringCompare.Fixer.cs (2)
30public override async Task RegisterCodeFixesAsync(CodeFixContext context) 43protected override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Tasks\DoNotCreateTaskCompletionSourceWithWrongArguments.Fixer.cs (2)
26public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 42protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Tasks\DoNotUseNonCancelableTaskDelayWithWhenAny.cs (2)
57method.Name != nameof(Task.WhenAny)) 134method.Name != nameof(Task.Delay))
Microsoft.NetCore.Analyzers\Tasks\DoNotUseWhenAllOrWaitAllWithSingleArgument.cs (4)
68case nameof(Task.WhenAll): 72case nameof(Task.WaitAll): 86var nameMatches = targetMethod.Name is (nameof(Task.WhenAll)) or (nameof(Task.WaitAll));
Microsoft.NetCore.Analyzers\Tasks\DoNotUseWhenAllOrWaitAllWithSingleArgumentFixer.cs (4)
23public override async Task RegisterCodeFixesAsync(CodeFixContext context) 39if (operation.TargetMethod.Name == nameof(Task.WaitAll)) 50nameof(Task.Wait)) 59else if (!IsValueStored(operation) && operation.TargetMethod.Name == nameof(Task.WhenAll))
Microsoft.NetCore.Analyzers\Usage\DoNotCompareSpanToNull.Fixer.cs (4)
20public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 27return Task.CompletedTask; 30protected sealed override Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken) 38return Task.CompletedTask;
Microsoft.NetCore.Analyzers\Usage\DoNotPassNonNullableValueToArgumentNullExceptionThrowIfNull.Fixer.cs (3)
35return Task.CompletedTask; 38public override async Task RegisterCodeFixesAsync(CodeFixContext context) 67return Task.CompletedTask;
Microsoft.NetCore.Analyzers\Usage\PreferGenericOverloads.Fixer.cs (1)
28public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.NetCore.Analyzers\Usage\UseVolatileReadWrite.Fixer.cs (2)
29public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 43protected sealed override async Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (3)
259return Task.FromCanceled<CodeAnalysisMetricData>(context.CancellationToken); 325=> (await Task.WhenAll( 330select Task.Run(() => ComputeAsync(child, context))).ConfigureAwait(false)).ToImmutableArray();
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PerformanceSensitiveAttribute.cs (1)
94/// <see cref="System.Threading.Tasks.Task"/>, either through caching the result or by using
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (1)
4129/// <see cref="INamedTypeSymbol"/> for <see cref="System.Threading.Tasks.Task"/>
SyntaxEditorBasedCodeFixProvider.cs (1)
61protected abstract Task ApplyFixAsync(Document document, Diagnostic diagnostic, SyntaxEditor editor, CancellationToken cancellationToken);
SyntaxEditorFixAllProvider.cs (7)
99return Task.CompletedTask; 108Func<Document, Diagnostic, SyntaxEditor, CancellationToken, Task> applyFixAsync) 132Func<Document, Diagnostic, SyntaxEditor, TState, CancellationToken, Task> applyFixAsync, 151Func<Document, Diagnostic, SyntaxEditor, CancellationToken, Task> applyFixAsync, 167Func<Document, Diagnostic, SyntaxEditor, TState, CancellationToken, Task> applyFixAsync, 191private readonly Func<Document, Diagnostic, SyntaxEditor, TState, CancellationToken, Task> _applyFixAsync; 197Func<Document, Diagnostic, SyntaxEditor, TState, CancellationToken, Task> applyFixAsync,
Microsoft.CodeAnalysis.Razor.Compiler (9)
Language\RazorProjectEngine.cs (1)
319method.ReturnType = $"global::{typeof(Task).FullName}";
Mvc.Version1_X\MvcViewDocumentClassifierPass.cs (1)
45method.ReturnType = $"global::{typeof(System.Threading.Tasks.Task).FullName}";
Mvc.Version2_X\MvcViewDocumentClassifierPass.cs (1)
45method.ReturnType = $"global::{typeof(System.Threading.Tasks.Task).FullName}";
Mvc.Version2_X\RazorPageDocumentClassifierPass.cs (1)
76method.ReturnType = $"global::{typeof(System.Threading.Tasks.Task).FullName}";
Mvc\MvcViewDocumentClassifierPass.cs (1)
64method.ReturnType = $"global::{typeof(System.Threading.Tasks.Task).FullName}";
Mvc\RazorExtensionsDiagnosticFactory.cs (2)
51nameof(Task)); 76nameof(Task));
Mvc\RazorPageDocumentClassifierPass.cs (1)
95method.ReturnType = $"global::{typeof(System.Threading.Tasks.Task).FullName}";
Mvc\ViewComponentTagHelperTargetExtensionBase.cs (1)
20private static readonly string s_taskTypeName = $"global::{typeof(Task).FullName}";
Microsoft.CodeAnalysis.ResxSourceGenerator (118)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
148public Task AppendAsync(Stream stream, CancellationToken cancellationToken = default) 158private async Task AppendAsyncCore(Stream stream, CancellationToken cancellationToken)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\PerformanceSensitiveAttribute.cs (1)
93/// <see cref="System.Threading.Tasks.Task"/>, either through caching the result or by using
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
602return (await Task.WhenAll(sequence.Select(item => selector(item, cancellationToken))).ConfigureAwait(false)).Flatten();
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
232public static Task ReportNonFatalErrorAsync(this Task task) 242public static Task ReportNonFatalErrorUnlessCancelledAsync(this Task task, CancellationToken cancellationToken)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (1)
44public new Task WaitUntilCurrentBatchCompletesAsync()
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (3)
98private Task<(bool ranToCompletion, TResult? result)> _updateTask = Task.FromResult((ranToCompletion: true, default(TResult?))); 228async Task<(bool ranToCompletion, TResult? result)> ContinueAfterDelayAsync(Task lastTask) 244await Task.Yield().ConfigureAwait(false);
src\roslyn\src\Dependencies\Threading\ConfiguredYieldAwaitable.cs (1)
16/// <see cref="Task.Yield"/>.
src\roslyn\src\Dependencies\Threading\ParallelExtensions.cs (4)
30public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 33public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 36public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 39public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body)
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (21)
37public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 55public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 72public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 118return Task.FromCanceled(cancellationToken); 122Func<object, Task> taskBody = static async o => 204return Task.FromException(e); 215public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 233public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 250public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 283return Task.FromCanceled(cancellationToken); 287Func<object, Task> taskBody = static async o => 369return Task.FromException(e); 395private readonly Func<object, Task> _taskBody; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 468System.Threading.Tasks.Task.Factory.StartNew(_taskBody!, this, default(CancellationToken), TaskCreationOptions.DenyChildAttach, _scheduler); 478public Task AcquireLock() 584IEnumerable<TSource> source, Func<object, Task> taskBody, 610IAsyncEnumerable<TSource> source, Func<object, Task> taskBody, 637T fromExclusive, T toExclusive, Func<object, Task> taskBody,
src\roslyn\src\Dependencies\Threading\ProducerConsumer.cs (35)
25Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 46public static Task RunAsync<TArgs>( 48Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 49Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 64public static Task RunAsync<TArgs>( 66Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 67Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 87public static Task RunParallelAsync<TSource, TArgs>( 89Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 90Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 101public static Task RunParallelAsync<TSource, TArgs>( 103Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 104Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 124public static Task RunParallelAsync<TSource, TArgs>( 126Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 127Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 138public static Task RunParallelAsync<TSource, TArgs>( 140Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 141Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 159Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 173Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 193Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 206Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 225Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 249Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 283/// Equivalent to <see cref="RunParallelAsync{TSource, TArgs}(IEnumerable{TSource}, Func{TSource, Action{TItem}, TArgs, CancellationToken, Task}, TArgs, CancellationToken)"/>, 290Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 321Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 342var writeTask = ProduceItemsAndWriteToChannelAsync(); 344await Task.WhenAll(writeTask, readTask).ConfigureAwait(false); 350await Task.Yield().ConfigureAwait(false); 354Task ProduceItemsAndWriteToChannelAsync() 359await Task.Yield().ConfigureAwait(false); 375private static async Task PerformActionAndCloseWriterAsync<TArgs>( 376Func<TArgs, CancellationToken, Task> action,
src\roslyn\src\Dependencies\Threading\TaskExtensions.cs (5)
25public static NoThrowTaskAwaitable NoThrowAwaitableInternal(this Task task, bool captureContext = true) 38private readonly Task _task; 50public NoThrowTaskAwaitable(Task task, bool captureContext) 74private readonly Task _task; 86public NoThrowTaskAwaiter(Task task, bool captureContext)
src\roslyn\src\Dependencies\Threading\YieldAwaitableExtensions.cs (4)
15/// Implements <c>ConfigureAwait(bool)</c> for <see cref="Task.Yield"/>. The resulting behavior in asynchronous code 16/// is the same as one would expect for <see cref="Task.ConfigureAwait(bool)"/>. 18/// <param name="awaitable">The awaitable provided by <see cref="Task.Yield"/>.</param> 19/// <param name="continueOnCapturedContext"><inheritdoc cref="Task.ConfigureAwait(bool)"/></param>
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (3)
258return Task.FromCanceled<CodeAnalysisMetricData>(context.CancellationToken); 324=> (await Task.WhenAll( 329select Task.Run(() => ComputeAsync(child, context))).ConfigureAwait(false)).ToImmutableArray();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
22Task AnalyzeAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy.cs (1)
24asynchronousComputeFunction: static (outerArg, cancellationToken) => Task.FromResult(outerArg.synchronousComputeFunction(outerArg.arg, cancellationToken)),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (5)
93/// Creates an AsyncLazy that always returns the value, analogous to <see cref="Task.FromResult{T}" />. 97_cachedResult = Task.FromResult(value); 297CompleteWithTask(Task.FromException<T>(ex), CancellationToken.None); 302CompleteWithTask(Task.FromResult(result), CancellationToken.None); 331return Task.FromCanceled<T>(cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (6)
62private Task _updateTask = Task.CompletedTask; 135async Task ContinueAfterDelayAsync(Task lastTask) 151await Task.Yield().ConfigureAwait(false); 163private async Task ProcessNextBatchAsync()
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (4)
46var tasks = new Task[streams.Length]; 55Task.WhenAll(tasks).CompletesChannel(channel); 59static async Task ProcessAsync(IAsyncEnumerable<T> stream, ChannelWriter<T> writer, CancellationToken cancellationToken) 70public static void CompletesChannel<T>(this Task task, Channel<T> channel)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (12)
18public static readonly Task<bool> True = Task.FromResult(true); 19public static readonly Task<bool> False = Task.FromResult(false); 23public static readonly Task EmptyTask = Task.CompletedTask; 82return new ValueTask<T[]>(Task.WhenAll(taskArray.Select(task => task.AsTask()))); 90await Task.WhenAll((IEnumerable<Task>)tasks).ConfigureAwait(false); 100public static readonly Task<T?> Default = Task.FromResult<T?>(default); 101public static readonly Task<IEnumerable<T>> EmptyEnumerable = Task.FromResult<IEnumerable<T>>(SpecializedCollections.EmptyEnumerable<T>()); 102public static readonly Task<ImmutableArray<T>> EmptyImmutableArray = Task.FromResult(ImmutableArray<T>.Empty); 103public static readonly Task<IList<T>> EmptyList = Task.FromResult(SpecializedCollections.EmptyList<T>()); 104public static readonly Task<IReadOnlyList<T>> EmptyReadOnlyList = Task.FromResult(SpecializedCollections.EmptyReadOnlyList<T>());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (3)
60/// Asserts the <see cref="Task"/> passed has already been completed. 67public static void VerifyCompleted(this Task task) 76/// Asserts the <see cref="Task"/> passed has already been completed.
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
151=> compilation.GetTypeByMetadataName(typeof(Task).FullName!);
Microsoft.CodeAnalysis.Scripting (14)
Script.cs (11)
235internal abstract Func<object[], Task> CommonGetExecutor(CancellationToken cancellationToken); 341private ImmutableArray<Func<object[], Task>> _lazyPrecedingExecutors; 374internal override Func<object[], Task> CommonGetExecutor(CancellationToken cancellationToken) 398private ImmutableArray<Func<object[], Task>> GetPrecedingExecutors(CancellationToken cancellationToken) 411private ImmutableArray<Func<object[], Task>> TryGetPrecedingExecutors(Script lastExecutedScriptInChainOpt, CancellationToken cancellationToken) 416return ImmutableArray<Func<object[], Task>>.Empty; 430return default(ImmutableArray<Func<object[], Task>>); 433var executors = ArrayBuilder<Func<object[], Task>>.GetInstance(scriptsReversed.Count); 560return Task.FromResult((ScriptState<T>)previousState); 577ImmutableArray<Func<object[], Task>> precedingExecutors, 578Func<object[], Task> currentExecutor,
ScriptBuilder.cs (1)
93executor ??= (s) => Task.FromResult(default(T));
ScriptExecutionState.cs (2)
68ImmutableArray<Func<object[], Task>> precedingExecutors, 69Func<object[], Task> currentExecutor,
Microsoft.CodeAnalysis.TestAnalyzerReference (1)
NonSourceFileRefactoring.cs (1)
21public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
Microsoft.CodeAnalysis.VisualBasic (17)
Compilation\ClsComplianceChecker.vb (6)
38Private ReadOnly _compilerTasks As ConcurrentStack(Of Task) 51Me._compilerTasks = New ConcurrentStack(Of Task)() 81Dim tasks As ConcurrentStack(Of Task) = Me._compilerTasks 86Dim curTask As Task = Nothing 110Task.Run( 154Task.Run(
Compilation\MethodCompiler.vb (10)
53Private ReadOnly _compilerTasks As ConcurrentStack(Of Task) 108_compilerTasks = New ConcurrentStack(Of Task)() 343Dim tasks As ConcurrentStack(Of Task) = Me._compilerTasks 348Dim curTask As Task = Nothing 500Dim worker As Task = CompileNamespaceAsync(symbol) 507Private Function CompileNamespaceAsync(symbol As NamespaceSymbol) As Task 508Return Task.Run( 532Dim worker As Task = CompileNamedTypeAsync(symbol, _filterOpt) 540Private Function CompileNamedTypeAsync(symbol As NamedTypeSymbol, filter As Predicate(Of Symbol)) As Task 541Return Task.Run(
Syntax\VisualBasicSyntaxTree.ParsedSyntaxTree.vb (1)
106Return Task.FromResult(_root)
Microsoft.CodeAnalysis.Workspaces (349)
Classification\AbstractClassificationService.cs (5)
33public Task AddSemanticClassificationsAsync( 39public Task AddEmbeddedLanguageClassificationsAsync( 45public async Task AddClassificationsAsync( 136private async Task AddClassificationsInCurrentProcessAsync( 201public async Task AddSyntacticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken)
Classification\ClassificationServiceExtensions.cs (3)
26public static Task AddSyntacticClassificationsAsync( 36public static Task AddSemanticClassificationsAsync( 47public static Task AddEmbeddedLanguageClassificationsAsync(
Classification\ClassifierHelper.cs (1)
56public static async Task AddClassifiedSpansAsync(
Classification\IClassificationService.cs (3)
46Task AddSyntacticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken); 63Task AddSemanticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken); 74Task AddEmbeddedLanguageClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken);
Classification\IEmbeddedLanguageClassificationService.cs (1)
16Task AddEmbeddedLanguageClassificationsAsync(
Classification\SyntaxClassification\AbstractSyntaxClassificationService.cs (1)
25public async Task AddSemanticClassificationsAsync(
Classification\SyntaxClassification\ISyntaxClassificationService.cs (1)
34Task AddSemanticClassificationsAsync(
Classification\SyntaxClassification\SyntaxClassificationExtensions.cs (1)
27public static Task AddSemanticClassificationsAsync(
CodeCleanup\Providers\FormatCodeCleanupProvider.cs (1)
40: Task.FromResult(result.GetFormattedRoot(cancellationToken));
CodeFixes\CodeFixProvider.cs (1)
33public abstract Task RegisterCodeFixesAsync(CodeFixContext context);
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (10)
76private static async Task FixSingleContextAsync( 106private static async Task AddDocumentChangesAsync( 150tasks.Add(Task.Run(async () => 158var registerTask = fixAllContext.CodeFixProvider.RegisterCodeFixesAsync(context) ?? Task.CompletedTask; 180await Task.WhenAll(tasks).ConfigureAwait(false); 196private static async Task MergeTextChangesAsync( 206using var _ = ArrayBuilder<Task>.GetInstance(out var tasks); 222tasks.Add(Task.Run( 226await Task.WhenAll(tasks).ConfigureAwait(false);
CodeFixes\FixAllOccurrences\DocumentBasedFixAllProvider.cs (1)
74private async Task DetermineDiagnosticsAndGetFixedDocumentsAsync(
CodeFixes\FixAllOccurrences\TextChangeMerger.cs (2)
44public async Task TryMergeChangesAsync(Document newDocument, CancellationToken cancellationToken) 64public async Task TryMergeChangesAsync(ImmutableArray<Document> newDocuments, CancellationToken cancellationToken)
CodeFixesAndRefactorings\DocumentBasedFixAllProviderHelpers.cs (1)
28Func<TFixAllContext, Func<Document, Document?, ValueTask>, Task> getFixedDocumentsAsync)
CodeRefactorings\CodeRefactoringProvider.cs (1)
24public abstract Task ComputeRefactoringsAsync(CodeRefactoringContext context);
CodeRefactorings\FixAllOccurences\DocumentBasedRefactorAllProvider.cs (1)
83private async Task GetRefactoredDocumentsAsync(
CodeRefactorings\SyntaxEditorBasedCodeRefactoringProvider.cs (3)
56Task RefactorAllAsync(SyntaxEditor editor) 66Func<SyntaxEditor, Task> editAsync, 78protected abstract Task RefactorAllAsync(
Editing\SymbolEditor.cs (1)
222public delegate Task AsyncDeclarationEditAction(DocumentEditor editor, SyntaxNode declaration, CancellationToken cancellationToken);
ExtensionManager\IExtensionManagerExtensions.cs (4)
48public static async Task PerformActionAsync( 51Func<Task?> function) 57var task = function() ?? Task.CompletedTask;
ExternalAccess\VSTypeScript\Api\TaskExtensions.cs (2)
13public static Task CompletesAsyncOperation(this Task task, VSTypeScriptAsyncToken asyncToken)
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (4)
79async Task SearchCurrentProjectAsync() 92async Task SearchProjectReferencesAsync() 112async Task SearchMetadataReferencesAsync() 136async Task AddAllAsync(ArrayBuilder<ISymbol> buffer, bool mapSymbol)
FindSymbols\Declarations\DeclarationFinder.cs (2)
18private static async Task AddCompilationSourceDeclarationsWithNormalQueryAsync( 67private static async Task AddMetadataDeclarationsWithNormalQueryAsync(
FindSymbols\FindLiterals\FindLiteralsSearchEngine.cs (4)
74public async Task FindReferencesAsync(CancellationToken cancellationToken) 85private async Task FindReferencesWorkerAsync(CancellationToken cancellationToken) 117private async Task ProcessDocumentWorkerAsync(Document document, CancellationToken cancellationToken) 137private async Task SearchDocumentAsync(Document document, CancellationToken cancellationToken)
FindSymbols\FindReferences\DependentProjectsFinder.cs (2)
202private static async Task AddSubmissionDependentProjectsAsync( 267private static async Task AddNonSubmissionDependentProjectsAsync(
FindSymbols\FindReferences\DependentTypeFinder.cs (6)
142async Task DescendInheritanceTreeInProjectAsync(Project project) 190async Task AddDescendantSourceTypesInProjectAsync(SymbolSet result, Project project) 252async Task AddMatchingTypesAsync( 276async Task AddSourceTypesThatDeriveFromNameAsync(SymbolSet result, string name) 292async Task AddDescendantMetadataTypesInProjectAsync(SymbolSet result, Project project) 332async Task AddMatchingMetadataTypesInMetadataReferenceAsync(
FindSymbols\FindReferences\Finders\AbstractMemberScopedReferenceFinder.cs (1)
27protected sealed override async Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (12)
33public abstract Task DetermineDocumentsToSearchAsync<TData>( 83protected static async Task FindDocumentsAsync<T, TData>( 116protected static Task FindDocumentsAsync<TData>( 139protected static Task FindDocumentsWithGlobalSuppressMessageAttributeAsync<TData>( 146protected static async Task FindDocumentsAsync<TData>( 328protected static Task FindDocumentsWithPredicateAsync<T, TData>( 344protected static Task FindDocumentsWithPredicateAsync<TData>( 361protected static Task FindDocumentsWithForEachStatementsAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 364protected static Task FindDocumentsWithUsingStatementsAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 367protected static Task FindDocumentsWithCollectionExpressionsAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 697protected abstract Task DetermineDocumentsToSearchAsync<TData>( 721public sealed override async Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\AliasSymbolReferenceFinder.cs (1)
24protected override async Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (3)
53protected override async Task DetermineDocumentsToSearchAsync<TData>( 101private static Task FindDocumentsWithImplicitObjectCreationExpressionAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 104private static async Task AddDocumentsAsync<TData>(
FindSymbols\FindReferences\Finders\CrefTypeParameterSymbolReferenceFinder.cs (1)
27protected override async Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\DestructorSymbolReferenceFinder.cs (1)
18protected override async Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\DynamicTypeSymbolReferenceFinder.cs (1)
25protected override Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\EventSymbolReferenceFinder.cs (1)
49protected sealed override async Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (1)
26protected sealed override async Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\ExplicitInterfaceMethodReferenceFinder.cs (1)
18protected sealed override async Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\ExplicitOrImplicitConstructorInitializerSymbolReferenceFinder.cs (1)
20protected sealed override Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\FieldSymbolReferenceFinder.cs (1)
29protected override async Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\IReferenceFinder.cs (1)
53Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (1)
47protected sealed override Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (2)
53protected override async Task DetermineDocumentsToSearchAsync<TData>( 81private static async Task AddDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\NamespaceSymbolReferenceFinder.cs (1)
26protected override async Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\OperatorSymbolReferenceFinder.cs (2)
21protected sealed override async Task DetermineDocumentsToSearchAsync<TData>( 36private static async Task FindDocumentsAsync<TData>(
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (4)
67protected override async Task DetermineDocumentsToSearchAsync<TData>( 113private static Task FindDocumentsWithDeconstructionAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 116private static Task FindDocumentsWithAwaitExpressionAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 119private static Task FindDocumentsWithCollectionInitializersAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken)
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (1)
24protected override Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\PreprocessingSymbolReferenceFinder.cs (1)
19protected override async Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\PropertyAccessorSymbolReferenceFinder.cs (1)
39protected override async Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\Finders\PropertySymbolReferenceFinder.cs (3)
107protected sealed override async Task DetermineDocumentsToSearchAsync<TData>( 174private static Task FindDocumentWithExplicitOrImplicitElementAccessExpressionsAsync<TData>( 181private static Task FindDocumentWithIndexerMemberCrefAsync<TData>(
FindSymbols\FindReferences\Finders\TypeParameterSymbolReferenceFinder.cs (1)
24protected override Task DetermineDocumentsToSearchAsync<TData>(
FindSymbols\FindReferences\FindReferencesSearchEngine_FindReferencesInDocuments.cs (1)
21public async Task FindReferencesInDocumentsAsync(
FindSymbols\FindReferences\FindReferencesSearchEngine.BidirectionalSymbolSet.cs (1)
45public override async Task InheritanceCascadeAsync(Project project, CancellationToken cancellationToken)
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (4)
60public Task FindReferencesAsync(ISymbol symbol, CancellationToken cancellationToken) 63public async Task FindReferencesAsync( 82private async Task PerformSearchAsync( 341private async Task AddGlobalAliasesAsync(
FindSymbols\FindReferences\FindReferencesSearchEngine.NonCascadingSymbolSet.cs (1)
24public override async Task InheritanceCascadeAsync(Project project, CancellationToken cancellationToken)
FindSymbols\FindReferences\FindReferencesSearchEngine.SymbolSet.cs (5)
56public abstract Task InheritanceCascadeAsync(Project project, CancellationToken cancellationToken); 179protected static async Task AddCascadedAndLinkedSymbolsToAsync( 186protected static async Task AddCascadedAndLinkedSymbolsToAsync( 231protected static async Task AddDownSymbolsAsync( 264protected static async Task AddUpSymbolsAsync(
FindSymbols\FindReferences\FindReferencesSearchEngine.UnidirectionalSymbolSet.cs (1)
43public override async Task InheritanceCascadeAsync(Project project, CancellationToken cancellationToken)
FindSymbols\SymbolFinder_Callers.cs (1)
65async Task AddReferencingSymbolsAsync(ReferencedSymbol reference, bool isDirect)
FindSymbols\SymbolFinder_FindLiteralReferences.cs (2)
15internal static async Task FindLiteralReferencesAsync( 45internal static Task FindLiteralReferencesInCurrentProcessAsync(
FindSymbols\SymbolFinder_FindReferences_Current.cs (3)
21internal static async Task FindReferencesAsync( 70internal static Task FindReferencesInCurrentProcessAsync( 85internal static Task FindReferencesInDocumentsInCurrentProcessAsync(
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (1)
103var textChecksums = await Task.WhenAll(textChecksumsTasks).ConfigureAwait(false);
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (9)
57private Task CreateWorkAsync(Func<Task> createWorkAsync, CancellationToken cancellationToken) 58=> Task.Factory.StartNew(createWorkAsync, cancellationToken, TaskCreationOptions.None, _scheduler).Unwrap(); 141private async Task AnalyzeProjectAsync(Project project, CancellationToken cancellationToken) 143using var _ = ArrayBuilder<Task>.GetInstance(out var tasks); 153await Task.WhenAll(tasks).ConfigureAwait(false); 156private async Task UpdateSourceSymbolTreeInfoAsync(Project project, CancellationToken cancellationToken) 187private async Task UpdateReferenceAsync( 239public readonly Task AnalyzeSolutionAsync()
Log\RoslynEventSource.cs (2)
77Task.Yield().GetAwaiter().OnCompleted(FireAndForgetSendFunctionDefinitions); 88_ = Task.Run(SendFunctionDefinitions);
Log\WorkspaceStructureLogger.cs (2)
110=> Task.FromResult<IEnumerable<XElement>>([]); 166private async Task AddCompilationElementsAsync(XElement projectElement, Project project, CancellationToken cancellationToken)
Remote\IRemoteHostClientProvider.cs (1)
25Task WaitForClientCreationAsync(CancellationToken cancellationToken);
Remote\IRemoteKeepAliveService.cs (5)
99static async Task InvokeKeepAliveAsync( 108await Task.Yield().ConfigureAwait(false); 132static async Task WaitForSessionIdAsync( 190var task = CreateClientAndKeepAliveAsync(); 195async Task CreateClientAndKeepAliveAsync()
Remote\RemoteHostClient.cs (2)
22public static Task WaitForClientCreationAsync(Workspace workspace, CancellationToken cancellationToken) 26return Task.CompletedTask;
Rename\ConflictEngine\ConflictResolver.cs (2)
168private static async Task AddImplicitConflictsAsync( 221private static async Task AddDeclarationConflictsAsync(
Rename\ConflictEngine\ConflictResolver.Session.cs (2)
262private async Task DebugVerifyNoErrorsAsync(MutableConflictResolution conflictResolution, IEnumerable<DocumentId> documents) 717private async Task AddDocumentsWithPotentialConflictsAsync(
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (2)
401private static async Task AddLocationsToRenameInStringsAsync( 420private static async Task AddLocationsToRenameInCommentsAsync(
Shared\TestHooks\AsynchronousOperationListener.cs (10)
46return Task.FromCanceled<bool>(cancellationToken); 57var delayTask = Task.Delay(delay, cancellationTokenSource.Token); 64return Task.FromCanceled<bool>(cancellationToken); 72static Task<bool> DelaySlowAsync(Task delayTask, CancellationTokenSource cancellationTokenSourceToDispose, CancellationToken cancellationToken) 81return Task.FromCanceled<bool>(cancellationToken); 156public Task ExpeditedWaitAsync() 163return Task.CompletedTask; 182public async Task WaitUntilConditionIsMetAsync(Func<IEnumerable<DiagnosticAsyncToken>, bool> condition) 193await Task.Delay(TimeSpan.FromMilliseconds(10)).ConfigureAwait(false);
Shared\TestHooks\AsynchronousOperationListener+DiagnosticAsyncToken.cs (2)
27public Task? Task { get; set; } 29internal void AssociateWithTask(Task task)
Shared\TestHooks\AsynchronousOperationListenerProvider.cs (5)
115public async Task WaitAllAsync(Workspace? workspace, string[]? featureNames = null, Action? eventProcessingAction = null, TimeSpan? timeout = null) 126List<Task>? tasks = null; 154if (Task.WaitAll([.. tasks], smallTimeout)) 170await Task.Delay(smallTimeout).ConfigureAwait(continueOnCapturedContext); 179foreach (var task in tasks)
Shared\TestHooks\AsynchronousOperationListenerProvider+NullOperationListener.cs (4)
37return Task.FromCanceled<bool>(cancellationToken); 40var t = Task.Delay(delay, cancellationToken); 47: Task.FromCanceled<bool>(cancellationToken);
Shared\TestHooks\IAsynchronousOperationWaiter.cs (1)
20Task ExpeditedWaitAsync();
Shared\TestHooks\TaskExtensions.cs (6)
16public static Task CompletesAsyncOperation(this Task task, IAsyncToken asyncToken) 30public static Task CompletesTrackingOperation(this Task task, IDisposable token) 39static async Task CompletesTrackingOperationSlow(Task task, IDisposable token)
Shared\Utilities\IWorkspaceThreadingService.cs (1)
20/// allow callers to simply use <see cref="Task.Wait()"/>.</para>
src\0bf6ba47805c8821\AbstractMoveDeclarationNearReferenceService.cs (1)
118private static async Task MoveDeclarationToFirstReferenceAsync(
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\ShadowCopyAnalyzerPathResolver.cs (5)
65internal Task DeleteLeftoverDirectoriesTask { get; } 131DeleteLeftoverDirectoriesTask = Task.Run(DeleteLeftoverDirectories); 134internal static Task CleanLegacyShadowDirectoryAsync(string legacyShadowDirectory) 138return Task.Run(() => 147return Task.CompletedTask;
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
148public Task AppendAsync(Stream stream, CancellationToken cancellationToken = default) 158private async Task AppendAsyncCore(Stream stream, CancellationToken cancellationToken)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\PerformanceSensitiveAttribute.cs (1)
93/// <see cref="System.Threading.Tasks.Task"/>, either through caching the result or by using
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
602return (await Task.WhenAll(sequence.Select(item => selector(item, cancellationToken))).ConfigureAwait(false)).Flatten();
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
232public static Task ReportNonFatalErrorAsync(this Task task) 242public static Task ReportNonFatalErrorUnlessCancelledAsync(this Task task, CancellationToken cancellationToken)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (1)
44public new Task WaitUntilCurrentBatchCompletesAsync()
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (3)
98private Task<(bool ranToCompletion, TResult? result)> _updateTask = Task.FromResult((ranToCompletion: true, default(TResult?))); 228async Task<(bool ranToCompletion, TResult? result)> ContinueAfterDelayAsync(Task lastTask) 244await Task.Yield().ConfigureAwait(false);
src\roslyn\src\Dependencies\Threading\ConfiguredYieldAwaitable.cs (1)
16/// <see cref="Task.Yield"/>.
src\roslyn\src\Dependencies\Threading\ParallelExtensions.cs (4)
16public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 19public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 22public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 25public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body)
src\roslyn\src\Dependencies\Threading\ProducerConsumer.cs (35)
25Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 46public static Task RunAsync<TArgs>( 48Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 49Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 64public static Task RunAsync<TArgs>( 66Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 67Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 87public static Task RunParallelAsync<TSource, TArgs>( 89Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 90Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 101public static Task RunParallelAsync<TSource, TArgs>( 103Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 104Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 124public static Task RunParallelAsync<TSource, TArgs>( 126Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 127Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 138public static Task RunParallelAsync<TSource, TArgs>( 140Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 141Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 159Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 173Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 193Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 206Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 225Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 249Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 283/// Equivalent to <see cref="RunParallelAsync{TSource, TArgs}(IEnumerable{TSource}, Func{TSource, Action{TItem}, TArgs, CancellationToken, Task}, TArgs, CancellationToken)"/>, 290Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 321Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 342var writeTask = ProduceItemsAndWriteToChannelAsync(); 344await Task.WhenAll(writeTask, readTask).ConfigureAwait(false); 350await Task.Yield().ConfigureAwait(false); 354Task ProduceItemsAndWriteToChannelAsync() 359await Task.Yield().ConfigureAwait(false); 375private static async Task PerformActionAndCloseWriterAsync<TArgs>( 376Func<TArgs, CancellationToken, Task> action,
src\roslyn\src\Dependencies\Threading\TaskExtensions.cs (5)
25public static NoThrowTaskAwaitable NoThrowAwaitableInternal(this Task task, bool captureContext = true) 38private readonly Task _task; 50public NoThrowTaskAwaitable(Task task, bool captureContext) 74private readonly Task _task; 86public NoThrowTaskAwaiter(Task task, bool captureContext)
src\roslyn\src\Dependencies\Threading\YieldAwaitableExtensions.cs (4)
15/// Implements <c>ConfigureAwait(bool)</c> for <see cref="Task.Yield"/>. The resulting behavior in asynchronous code 16/// is the same as one would expect for <see cref="Task.ConfigureAwait(bool)"/>. 18/// <param name="awaitable">The awaitable provided by <see cref="Task.Yield"/>.</param> 19/// <param name="continueOnCapturedContext"><inheritdoc cref="Task.ConfigureAwait(bool)"/></param>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
22Task AnalyzeAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy.cs (1)
24asynchronousComputeFunction: static (outerArg, cancellationToken) => Task.FromResult(outerArg.synchronousComputeFunction(outerArg.arg, cancellationToken)),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (5)
93/// Creates an AsyncLazy that always returns the value, analogous to <see cref="Task.FromResult{T}" />. 97_cachedResult = Task.FromResult(value); 297CompleteWithTask(Task.FromException<T>(ex), CancellationToken.None); 302CompleteWithTask(Task.FromResult(result), CancellationToken.None); 331return Task.FromCanceled<T>(cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (6)
62private Task _updateTask = Task.CompletedTask; 135async Task ContinueAfterDelayAsync(Task lastTask) 151await Task.Yield().ConfigureAwait(false); 163private async Task ProcessNextBatchAsync()
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (4)
46var tasks = new Task[streams.Length]; 55Task.WhenAll(tasks).CompletesChannel(channel); 59static async Task ProcessAsync(IAsyncEnumerable<T> stream, ChannelWriter<T> writer, CancellationToken cancellationToken) 70public static void CompletesChannel<T>(this Task task, Channel<T> channel)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (12)
18public static readonly Task<bool> True = Task.FromResult(true); 19public static readonly Task<bool> False = Task.FromResult(false); 23public static readonly Task EmptyTask = Task.CompletedTask; 82return new ValueTask<T[]>(Task.WhenAll(taskArray.Select(task => task.AsTask()))); 90await Task.WhenAll((IEnumerable<Task>)tasks).ConfigureAwait(false); 100public static readonly Task<T?> Default = Task.FromResult<T?>(default); 101public static readonly Task<IEnumerable<T>> EmptyEnumerable = Task.FromResult<IEnumerable<T>>(SpecializedCollections.EmptyEnumerable<T>()); 102public static readonly Task<ImmutableArray<T>> EmptyImmutableArray = Task.FromResult(ImmutableArray<T>.Empty); 103public static readonly Task<IList<T>> EmptyList = Task.FromResult(SpecializedCollections.EmptyList<T>()); 104public static readonly Task<IReadOnlyList<T>> EmptyReadOnlyList = Task.FromResult(SpecializedCollections.EmptyReadOnlyList<T>());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (3)
60/// Asserts the <see cref="Task"/> passed has already been completed. 67public static void VerifyCompleted(this Task task) 76/// Asserts the <see cref="Task"/> passed has already been completed.
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
151=> compilation.GetTypeByMetadataName(typeof(Task).FullName!);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (3)
37protected abstract Task FixAsync( 48public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 54protected sealed override async Task FixAllAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
80Func<SyntaxEditor, Task> editAsync, 97protected abstract Task FixAllAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
93protected abstract Task AddPotentiallyConflictingImportsAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
200public static async Task VerifyNoErrorsAsync(this Document newDocument, string message, CancellationToken cancellationToken, List<string>? ignoreErrorCodes = null)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (6)
26public static Task ApplyExpressionLevelSemanticEditsAsync<TType, TNode>( 49public static Task ApplyExpressionLevelSemanticEditsAsync<TType, TNode>( 72public static Task ApplyExpressionLevelSemanticEditsAsync<TNode>( 93public static Task ApplyMethodBodySemanticEditsAsync<TType, TNode>( 116public static Task ApplyMethodBodySemanticEditsAsync<TNode>( 150private static async Task ApplySemanticEditsAsync<TType, TNode>(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
150private async Task ReduceAsync(
Telemetry\TelemetryLogging.cs (2)
138private static async Task PostCollectedTelemetryAsync(CancellationToken cancellationToken) 140await Task.Delay(TimeSpan.FromMinutes(30), cancellationToken).ConfigureAwait(false);
TemporaryStorage\TemporaryStorageService.cs (2)
142await Task.Yield().ConfigureAwait(false); 291await Task.Yield().ConfigureAwait(false);
Workspace\Host\Status\DefaultWorkspaceStatusService.cs (2)
25public Task WaitUntilFullyLoadedAsync(CancellationToken cancellationToken) 28return Task.CompletedTask;
Workspace\Host\Status\IWorkspaceStatusService.cs (1)
35Task WaitUntilFullyLoadedAsync(CancellationToken cancellationToken);
Workspace\Host\TemporaryStorage\ITemporaryStorage.cs (2)
19Task WriteTextAsync(SourceText text, CancellationToken cancellationToken = default); 28Task WriteStreamAsync(Stream stream, CancellationToken cancellationToken = default);
Workspace\Host\TemporaryStorage\LegacyTemporaryStorageService.cs (2)
69public async Task WriteStreamAsync(Stream stream, CancellationToken cancellationToken = default) 110public async Task WriteTextAsync(SourceText text, CancellationToken cancellationToken = default)
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
536private async Task OnBatchScopeDisposedMaybeAsync(bool useAsync)
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (9)
51private readonly Func<bool, ImmutableArray<string>, Task> _onDocumentsAddedMaybeAsync; 81Func<bool, ImmutableArray<string>, Task> onDocumentsAddedMaybeAsync, 301public Task ApplyBatchChangeToWorkspaceAsync(Func<SolutionChangeAccumulator, ProjectUpdateState, ProjectUpdateState> mutation, Action<ProjectUpdateState>? onAfterUpdateAlways) 307public async Task ApplyBatchChangeToWorkspaceMaybeAsync(bool useAsync, Func<SolutionChangeAccumulator, ProjectUpdateState, ProjectUpdateState> mutation, Action<ProjectUpdateState>? onAfterUpdateAlways) 323public async Task ApplyBatchChangeToWorkspaceMaybe_NoLockAsync(bool useAsync, Func<SolutionChangeAccumulator, ProjectUpdateState, ProjectUpdateState> mutation, Action<ProjectUpdateState>? onAfterUpdateAlways) 841private Task StartRefreshingMetadataReferencesForFileAsync(string fullFilePath, CancellationToken cancellationToken) 861private Task StartRefreshingAnalyzerReferenceForFileAsync(string fullFilePath, CancellationToken cancellationToken) 909private async Task StartRefreshingReferencesForFileAsync<TReference>( 949internal Task RaiseOnDocumentsAddedMaybeAsync(bool useAsync, ImmutableArray<string> filePaths)
Workspace\ProjectSystem\ReferenceFileChangeTracker.cs (2)
38private readonly Func<string, CancellationToken, Task> _callback; 44Func<string, CancellationToken, Task> callback)
Workspace\Solution\ChecksumCollection.cs (1)
56internal static async Task FindAsync<TState, TArg>(
Workspace\Solution\Document.cs (2)
95var result = Task.FromResult(syntaxTree); 188_ = Interlocked.CompareExchange(ref _syntaxTreeResultTask, Task.FromResult(tree), null);
Workspace\Solution\Project.cs (1)
493var results = await Task.WhenAll(this.Documents.Select(predicateAsync)).ConfigureAwait(false);
Workspace\Solution\ProjectState.AnalyzerConfigOptionsCache.cs (1)
42var analyzerConfigs = await Task.WhenAll(tasks).ConfigureAwait(false);
Workspace\Solution\SolutionCompilationState.GeneratorDriverInitializationCache.cs (1)
58_ = Task.Run(() => createdAsyncLazy.GetValueAsync(CancellationToken.None));
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (2)
227return await Task.FromCanceled<Compilation>(cancellationToken).ConfigureAwait(false); 466await Task.Yield().ConfigureAwait(false);
Workspace\Solution\SolutionState_Checksum.cs (1)
120var allResults = await Task.WhenAll(projectChecksumTasks).ConfigureAwait(false);
Workspace\Solution\StateChecksums.cs (4)
100public async Task FindAsync<TArg>( 254public async Task FindAsync<TArg>( 425public async Task FindAsync<TArg>( 511public async Task FindAsync<TArg>(
Workspace\Solution\TextLoader.cs (1)
123await Task.Delay(RetryDelay, cancellationToken).ConfigureAwait(false);
Workspace\Solution\VersionSource\RecoverableTextAndVersion.cs (1)
191private async Task SaveAsync(SourceText text, CancellationToken cancellationToken)
Workspace\Workspace_Events.cs (13)
96protected Task RaiseWorkspaceChangedEventAsync(WorkspaceChangeKind kind, Solution oldSolution, Solution newSolution, ProjectId? projectId = null, DocumentId? documentId = null) 102return Task.CompletedTask; 123return Task.CompletedTask; 136protected Task RaiseDocumentOpenedEventAsync(Document document) 139protected Task RaiseTextDocumentOpenedEventAsync(TextDocument document) 142private Task RaiseTextDocumentOpenedOrClosedEventAsync<TDocument, TDocumentEventArgs>( 153return Task.CompletedTask; 156protected Task RaiseDocumentClosedEventAsync(Document document) 159protected Task RaiseTextDocumentClosedEventAsync(TextDocument document) 163protected Task RaiseDocumentActiveContextChangedEventAsync(Document document) 166protected Task RaiseDocumentActiveContextChangedEventAsync(SourceTextContainer sourceTextContainer, DocumentId oldActiveContextDocumentId, DocumentId newActiveContextDocumentId) 169return Task.CompletedTask; 181return Task.CompletedTask;
Workspace\Workspace.cs (3)
562protected internal Task ScheduleTask(Action action, string? taskName = "Workspace.Task") 572internal Task ScheduleTask(EventArgs args, EventHandlerSet handlerSet) 714await Task.Factory.StartNew(() =>
Microsoft.CodeAnalysis.Workspaces.MSBuild (16)
MSBuild\BuildHostProcessManager.cs (2)
209Task.Run(async () => 468public async Task ConnectAsync(string pipeName)
MSBuild\MSBuildProjectLoader.cs (1)
235return Task.FromResult(ImmutableArray<ProjectInfo>.Empty);
Rpc\RemoteBuildHost.cs (2)
45public Task ConfigureGlobalStateAsync(ImmutableArray<string> knownCommandLineParserLanguages, ImmutableDictionary<string, string> globalProperties, string? binlogPath, int? maxNodeCount, CancellationToken cancellationToken) 78public Task ShutdownAsync(CancellationToken cancellationToken)
Rpc\RemoteProjectFile.cs (9)
36public Task AddDocumentAsync(string filePath, string? logicalPath, CancellationToken cancellationToken) 39public Task RemoveDocumentAsync(string filePath, CancellationToken cancellationToken) 42public Task AddMetadataReferenceAsync(string metadataReferenceIdentity, ImmutableArray<string> aliases, string? hintPath, CancellationToken cancellationToken) 45public Task RemoveMetadataReferenceAsync(string shortAssemblyName, string fullAssemblyName, string filePath, CancellationToken cancellationToken) 48public Task AddProjectReferenceAsync(string projectName, ProjectFileReference projectFileReference, CancellationToken cancellationToken) 51public Task RemoveProjectReferenceAsync(string projectName, string projectFilePath, CancellationToken cancellationToken) 54public Task AddAnalyzerReferenceAsync(string fullPath, CancellationToken cancellationToken) 57public Task RemoveAnalyzerReferenceAsync(string fullPath, CancellationToken cancellationToken) 60public Task SaveAsync(CancellationToken cancellationToken)
Rpc\RpcClient.cs (2)
52Task.Run(async () => 122public Task InvokeAsync(int targetObject, string methodName, List<object?> parameters, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (12)
AbstractBuildHost.cs (1)
223public async Task ShutdownAsync()
Rpc\RpcMethodInvoker.cs (1)
46public static async Task<object?> GetTaskResultAsync(Task task, MethodInfo calledMethod)
Rpc\RpcServer.cs (9)
90public async Task RunAsync() 92var runningTasks = new ConcurrentSet<Task>(); 109var runningTask = Task.Run(() => ProcessRequestAsync(request)); 127var remainingTasks = new List<Task>(capacity: runningTasks.Count); 128foreach (var task in runningTasks) 131await Task.WhenAll(remainingTasks).ConfigureAwait(false); 134private async Task ProcessRequestAsync(Request request) 174if (result is Task resultTask)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\PerformanceSensitiveAttribute.cs (1)
93/// <see cref="System.Threading.Tasks.Task"/>, either through caching the result or by using
Microsoft.CodeAnalysis.Workspaces.MSBuild.Contracts (5)
IBuildHost.cs (1)
60Task ShutdownAsync();
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
232public static Task ReportNonFatalErrorAsync(this Task task) 242public static Task ReportNonFatalErrorUnlessCancelledAsync(this Task task, CancellationToken cancellationToken)
Microsoft.Data.Analysis.Interactive (2)
DataFrameKernelExtension.cs (2)
20public async Task OnLoadAsync(Kernel kernel) 29private static async Task LoadExtensionApiAsync(Kernel cSharpKernel)
Microsoft.Data.Analysis.Tests (2)
ArrowIntegrationTests.cs (1)
141public async Task TestEmptyDataFrameRecordBatch()
DataFrame.IOTests.cs (1)
1256public async Task TestSQLite()
Microsoft.Deployment.DotNet.Releases (3)
ReleaseFile.cs (1)
104public async Task DownloadAsync(string destinationPath)
Utils.cs (2)
47internal static async Task DownloadFileAsync(Uri address, string fileName) 118internal static async Task GetLatestFileAsync(string path, bool downloadLatest, Uri address)
Microsoft.Diagnostics.NETCore.Client (78)
DiagnosticsClient\DiagnosticsClient.cs (10)
58internal Task WaitForConnectionAsync(CancellationToken token) 197public Task WriteDumpAsync(DumpType dumpType, string dumpPath, bool logDumpGeneration, CancellationToken token) 209public async Task WriteDumpAsync(DumpType dumpType, string dumpPath, WriteDumpFlags flags, CancellationToken token) 248internal async Task AttachProfilerAsync(TimeSpan attachTimeout, Guid profilerGuid, string profilerPath, byte[] additionalData, CancellationToken token) 268internal async Task SetStartupProfilerAsync(Guid profilerGuid, string profilerPath, CancellationToken token) 285internal async Task ResumeRuntimeAsync(CancellationToken token) 304internal async Task SetEnvironmentVariableAsync(string name, string value, CancellationToken token) 358public async Task ApplyStartupHookAsync(string startupHookPath, CancellationToken token) 381internal async Task EnablePerfMapAsync(PerfMapType type, CancellationToken token) 398internal async Task DisablePerfMapAsync(CancellationToken token)
DiagnosticsClient\EventPipeSession.cs (1)
77public async Task StopAsync(CancellationToken cancellationToken)
DiagnosticsIpc\IpcAdvertise.cs (1)
82public static async Task SerializeAsync(Stream stream, Guid runtimeInstanceCookie, ulong processId, CancellationToken token)
DiagnosticsIpc\IpcClient.cs (1)
99private static Task WriteAsync(Stream stream, IpcMessage message, CancellationToken cancellationToken)
DiagnosticsIpc\IpcSocket.cs (3)
33return await Task.Factory.FromAsync(BeginAccept, EndAccept, this).ConfigureAwait(false); 67public async Task ConnectAsync(EndPoint remoteEP, CancellationToken token) 76await Task.Factory.FromAsync(beginConnect, EndConnect, this).ConfigureAwait(false);
DiagnosticsIpc\IpcTransport.cs (4)
53public abstract Task WaitForConnectionAsync(CancellationToken token); 170public override Task WaitForConnectionAsync(CancellationToken token) 220public override async Task WaitForConnectionAsync(CancellationToken token) 294public override async Task WaitForConnectionAsync(CancellationToken token)
DiagnosticsServerRouter\DiagnosticsServerRouterFactory.cs (53)
46public virtual Task Start(CancellationToken token) 51public virtual Task Stop() 122protected async Task IsStreamConnectedAsync(Stream stream, CancellationToken token) 135await Task.Delay(IsStreamConnectedTimeoutMs, token).ConfigureAwait(false); 141protected static bool IsCompletedSuccessfully(Task t) 217public abstract Task Stop(); 314public override async Task Stop() 372public override async Task Stop() 503await Task.Delay(TcpClientRetryTimeoutMs, token).ConfigureAwait(false); 514private async Task ConnectAsyncInternal(Socket clientSocket, EndPoint remoteEP, CancellationToken token) 523await Task.Factory.FromAsync(beginConnect, clientSocket.EndConnect, this).ConfigureAwait(false); 701await Task.Delay(IpcClientRetryTimeoutMs, token).ConfigureAwait(false); 761public override Task Start(CancellationToken token) 768return Task.CompletedTask; 771public override Task Stop() 800await Task.WhenAny(ipcServerStreamTask, netServerStreamTask).ConfigureAwait(false); 813using Task checkIpcStreamTask = IsStreamConnectedAsync(ipcServerStream, cancelRouter.Token); 816await Task.WhenAny(netServerStreamTask, checkIpcStreamTask).ConfigureAwait(false); 823await Task.WhenAll(netServerStreamTask, checkIpcStreamTask).ConfigureAwait(false); 850using Task checkTcpStreamTask = IsStreamConnectedAsync(tcpServerStream, cancelRouter.Token); 853await Task.WhenAny(ipcServerStreamTask, checkTcpStreamTask).ConfigureAwait(false); 860await Task.WhenAll(ipcServerStreamTask, checkTcpStreamTask).ConfigureAwait(false); 887await Task.WhenAll(ipcServerStreamTask, netServerStreamTask).ConfigureAwait(false); 960public override Task Start(CancellationToken token) 966return Task.CompletedTask; 969public override Task Stop() 974return Task.CompletedTask; 996using Task checkIpcStreamTask = IsStreamConnectedAsync(ipcServerStream, cancelRouter.Token); 999await Task.WhenAny(tcpClientStreamTask, checkIpcStreamTask).ConfigureAwait(false); 1006await Task.WhenAll(tcpClientStreamTask, checkIpcStreamTask).ConfigureAwait(false); 1086public override Task Start(CancellationToken token) 1097return Task.CompletedTask; 1100public override Task Stop() 1130using Task checkTcpStreamTask = IsStreamConnectedAsync(tcpServerStream, cancelRouter.Token); 1133await Task.WhenAny(ipcClientStreamTask, checkTcpStreamTask).ConfigureAwait(false); 1140await Task.WhenAll(ipcClientStreamTask, checkTcpStreamTask).ConfigureAwait(false); 1237public override Task Start(CancellationToken token) 1241return Task.CompletedTask; 1244public override Task Stop() 1248return Task.CompletedTask; 1275using Task checkTcpStreamTask = IsStreamConnectedAsync(tcpClientStream, cancelRouter.Token); 1278await Task.WhenAny(ipcClientStreamTask, checkTcpStreamTask).ConfigureAwait(false); 1285await Task.WhenAll(ipcClientStreamTask, checkTcpStreamTask).ConfigureAwait(false); 1355using Task checkTcpStreamTask = IsStreamConnectedAsync(tcpClientStream, cancelReadConnect.Token); 1358await Task.WhenAny(readTask, checkTcpStreamTask).ConfigureAwait(false); 1365await Task.WhenAll(readTask, checkTcpStreamTask).ConfigureAwait(false); 1395private async Task UpdateRuntimeInfo(CancellationToken token) 1445private Task _backendReadFrontendWriteTask; 1446private Task _frontendReadBackendWriteTask; 1494List<Task> runningTasks = new(); 1506await Task.WhenAll(runningTasks.ToArray()).ConfigureAwait(false); 1549private async Task BackendReadFrontendWrite(CancellationToken token) 1592private async Task FrontendReadBackendWrite(CancellationToken token)
DiagnosticsServerRouter\DiagnosticsServerRouterRunner.cs (2)
60List<Task> runningTasks = new(); 93while (await Task.WhenAny(runningTasks.ToArray()).ConfigureAwait(false) != routerTask);
ReversedServer\ReversedDiagnosticsServer.cs (3)
32private Task _acceptTransportTask; 250private async Task AcceptTransportAsync(IpcServerTransport transport, CancellationToken token) 353internal async Task WaitForConnectionAsync(Guid runtimeInstanceCookie, CancellationToken token)
Microsoft.DotNet.Arcade.Sdk (1)
src\DownloadFile.cs (1)
220await Tasks.Task.Delay(RetryDelayMilliseconds).ConfigureAwait(false);
Microsoft.DotNet.Build.Tasks.Installers (1)
src\ExecWithRetries.cs (1)
105Task.Delay(delay, _cancelTokenSource.Token).Wait();
Microsoft.DotNet.Build.Tasks.Packaging (4)
NuGetUtility.cs (4)
122public Task LogAsync(LogLevel level, string data) => Task.Run(() => Log(level, data)); 124public Task LogAsync(ILogMessage message) => Task.Run(() => Log(message));
Microsoft.DotNet.Cli.Telemetry (6)
Implementation\HttpTelemetryUploadTransport.cs (1)
91protected override async Task SerializeToStreamAsync(Stream stream, TransportContext? context)
Implementation\PersistentStorageTelemetryUploader.cs (1)
48public async Task DrainAsync(CancellationToken cancellationToken)
PersistentStorageLogExporter.cs (2)
39private Task? _drainTask; 105_drainTask = Task.Run(async () =>
PersistentStorageTraceExporter.cs (2)
38private Task? _drainTask; 113_drainTask = Task.Run(async () =>
Microsoft.DotNet.Cli.Utils (20)
BuiltInCommand.cs (3)
61var taskOut = _stdOut.BeginRead(new StreamReader(outStream)); 62var taskErr = _stdErr.BeginRead(new StreamReader(errorStream)); 69Task.WaitAll(taskOut, taskErr);
Command.cs (2)
59var taskOut = _stdOut?.BeginRead(_process.StandardOutput); 60var taskErr = _stdErr?.BeginRead(_process.StandardError);
ExponentialRetry.cs (7)
36Func<IEnumerable<Task>> timer, 40foreach (var t in timer()) 64Func<IEnumerable<Task>> timer, 67Func<Task<T>> asyncAction = () => Task.FromResult(action()); 73Func<IEnumerable<Task>>? timer = null) 79public static IEnumerable<Task> Timer(IEnumerable<TimeSpan> interval) 81return interval.Select(Task.Delay);
Extensions\ProcessStartInfoExtensions.cs (2)
48var taskOut = outStream.BeginRead(process.StandardOutput); 49var taskErr = errStream.BeginRead(process.StandardError);
FileAccessRetrier.cs (4)
38await Task.Delay(sleepDuration); 44await Task.Delay(sleepDuration); 95Task.Run(() => Task.Delay(nextWaitTime)).Wait();
StreamForwarder.cs (2)
50public Task BeginRead(TextReader reader) 52return Task.Run(() => Read(reader));
Microsoft.DotNet.HotReload.Utils.Generator (13)
BaselineProject.cs (2)
67var t = Task.Run (async () => {
Runner.cs (4)
28public async Task Run (CancellationToken ct = default) { 51protected Func<CancellationToken,Task>? OutputsDone {get; set;} = null; 63protected abstract Task PrepareToRun(CancellationToken ct = default); 107private async Task GenerateDeltas (DeltaProject deltaProject, IAsyncEnumerable<Delta> deltas,
Runners\LiveRunner.cs (2)
17protected override Task PrepareToRun (CancellationToken ct = default) => Task.CompletedTask;
Runners\ScriptRunner.cs (3)
41internal async Task OutputsDone(CancellationToken ct = default) { 49protected override async Task PrepareToRun(CancellationToken ct = default) 82await Task.CompletedTask; // to make compiler happy
Util\AsyncEnumerableExtras.cs (1)
6await System.Threading.Tasks.Task.CompletedTask;
Util\FSWGen.cs (1)
63Task<WhenAnyResult> t = await Task.WhenAny(completion, readOne.ContinueWith((t) => WhenAnyResult.Read)).ConfigureAwait(false);
Microsoft.DotNet.HotReload.Utils.Generator.Frontend (1)
Frontend.cs (1)
34static async Task Run (Microsoft.DotNet.HotReload.Utils.Generator.Config config)
Microsoft.DotNet.HotReload.Watch (90)
Aspire\AspireServiceFactory.cs (6)
18private readonly struct Session(string dcpId, string sessionId, RunningProject runningProject, Task outputReader) 23public Task OutputReader { get; } = outputReader; 93await Task.WhenAll(sessions.Select(TerminateSessionAsync)).WaitAsync(CancellationToken.None); 166var outputReader = StartChannelReader(runningProject.Process.ExitedCancellationToken); 179async Task StartChannelReader(CancellationToken cancellationToken) 229private async Task TerminateSessionAsync(Session session)
Build\ProjectBuildManager.cs (1)
91var results = await Task.WhenAll(buildTasks);
HotReload\HotReloadDotNetWatcher.cs (7)
29internal Task? Test_FileChangesCompletedTask { get; set; } 64public async Task WatchAsync(CancellationToken shutdownCancellationToken) 243await Task.Delay(50, iterationCancellationToken); 249await Task.Delay(150, iterationCancellationToken); 707var copyTasks = new List<Task>(); 730copyTasks.Add(Task.Run(() => 755await Task.WhenAll(copyTasks);
HotReload\ManagedCodeWorkspace.cs (3)
101public async Task UpdateFileContentAsync(IReadOnlyList<ChangedFile> changedFiles, CancellationToken cancellationToken) 107private Task SolutionUpdatedAsync(Solution newSolution, string operationDisplayName, CancellationToken cancellationToken) 110private async Task ReportSolutionFilesAsync(Solution solution, int updateId, string operationDisplayName, CancellationToken cancellationToken)
HotReload\ProjectUpdatesBuilder.cs (2)
78(project, cancellationToken) => project.Clients.ReportCompilationErrorsInApplicationAsync([.. errorsToDisplayInApp], cancellationToken).AsTask() ?? Task.CompletedTask, 266await Task.Delay(-1, cancellationToken);
HotReload\RunningProjectsManager.cs (11)
202private async Task HandleRuntimeRudeEditAsync(RunningProject runningProject, string rudeEditMessage, CancellationToken cancellationToken) 244var applyTasks = new List<Task>(); 276_ = Task.Run(async () => 306var applyTask = await runningProject.Clients.ApplyManagedCodeUpdatesAsync( 317var staticAssetApplyTaskProducers = new List<Task<Task>>(); 329applyTasks.AddRange(await Task.WhenAll(staticAssetApplyTaskProducers)); 334async Task CompleteApplyOperationAsync() 338await Task.WhenAll(applyTasks); 384await Task.WhenAll(projectsToRestart.Where(p => !p.Options.IsMainProject).Select(p => p.TerminateForRestartAsync())).WaitAsync(cancellationToken); 390public async Task RestartPeripheralProjectsAsync(IReadOnlyList<RunningProject> projectsToRestart, CancellationToken cancellationToken) 399await Task.WhenAll(
Process\RunningProcess.cs (1)
48public Task TerminateAsync()
Process\RunningProject.cs (3)
73public Task TerminateForRestartAsync() 79public async Task CompleteApplyOperationAsync(Task applyTask)
src\sdk\src\Dotnet.Watch\AspireService\AspireServerService.cs (7)
63private readonly Task _requestListener; 209private Task StartListeningAsync() 268private async Task HandleInfoRequestAsync(HttpContext context) 279private async Task HandleSessionNotifyRequestAsync(HttpContext context) 323private async Task HandleStartSessionRequestAsync(HttpContext context) 364private async Task WriteResponseTextAsync(HttpResponse response, Exception ex, bool useRichErrorResponse) 424private async Task HandleStopSessionRequestAsync(HttpContext context, string sessionId)
src\sdk\src\Dotnet.Watch\HotReloadClient\ClientTransport.cs (1)
31public abstract Task WaitForConnectionAsync(CancellationToken cancellationToken);
src\sdk\src\Dotnet.Watch\HotReloadClient\DefaultHotReloadClient.cs (7)
95private async Task ListenForResponsesAsync(CancellationToken cancellationToken) 158public override Task WaitForConnectionEstablishedAsync(CancellationToken cancellationToken) 174return Task.FromResult(false); 181return Task.FromResult(true); 218return Task.FromResult(true); 243var results = await Task.WhenAll(completionTasks); 282public override async Task InitialUpdatesAppliedAsync(CancellationToken cancellationToken)
src\sdk\src\Dotnet.Watch\HotReloadClient\HotReloadClient.cs (7)
33private Task _pendingUpdates = Task.CompletedTask; 41internal Task PendingUpdates 63public abstract Task WaitForConnectionEstablishedAsync(CancellationToken cancellationToken); 89public abstract Task InitialUpdatesAppliedAsync(CancellationToken cancellationToken); 147Task previous; 152_pendingUpdates = Task.Run(async () =>
src\sdk\src\Dotnet.Watch\HotReloadClient\HotReloadClients.cs (11)
108await Task.WhenAll(clients.Select(c => c.WaitForConnectionEstablishedAsync(cancellationToken))); 125var results = await Task.WhenAll(clients.Select(c => c.GetUpdateCapabilitiesAsync(cancellationToken))); 133public async Task<Task> ApplyManagedCodeUpdatesAsync(ImmutableArray<HotReloadManagedCodeUpdate> updates, CancellationToken applyOperationCancellationToken, CancellationToken cancellationToken) 144var applyTasks = await Task.WhenAll(clients.Select(c => c.ApplyManagedCodeUpdatesAsync(updates, applyOperationCancellationToken, cancellationToken))); 148async Task CompleteApplyOperationAsync() 150var results = await Task.WhenAll(applyTasks); 170await Task.WhenAll(clients.Select(c => c.InitialUpdatesAppliedAsync(cancellationToken))); 175public async Task<Task> ApplyStaticAssetUpdatesAsync(IEnumerable<StaticWebAsset> assets, CancellationToken applyOperationCancellationToken, CancellationToken cancellationToken) 205public async ValueTask<Task> ApplyStaticAssetUpdatesAsync(ImmutableArray<HotReloadStaticAssetUpdate> updates, CancellationToken applyOperationCancellationToken, CancellationToken cancellationToken) 211var applyTasks = await Task.WhenAll(clients.Select(c => c.ApplyStaticAssetUpdatesAsync(updates, applyOperationCancellationToken, cancellationToken))); 213return Task.WhenAll(applyTasks);
src\sdk\src\Dotnet.Watch\HotReloadClient\NamedPipeClientTransport.cs (1)
50public override async Task WaitForConnectionAsync(CancellationToken cancellationToken)
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\AbstractBrowserRefreshServer.cs (4)
152public async Task WaitForClientConnectionAsync(CancellationToken cancellationToken) 164var progressReportingTask = Task.Run(async () => 170await Task.Delay(SuppressTimeouts ? TimeSpan.MaxValue : reportDelayInSeconds, progressCancellationSource.Token);
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\BrowserRefreshServer.cs (1)
51private async Task WebSocketRequestAsync(HttpContext context)
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\WebAssemblyHotReloadClient.cs (8)
89public override async Task WaitForConnectionEstablishedAsync(CancellationToken cancellationToken) 94=> Task.FromResult(_capabilities); 101return Task.FromResult(true); 107return Task.FromResult(true); 155=> Task.FromResult(Task.FromResult(true)); 169public override Task InitialUpdatesAppliedAsync(CancellationToken cancellationToken) 170=> Task.CompletedTask;
src\sdk\src\Dotnet.Watch\HotReloadClient\WebSocketClientTransport.cs (3)
75public override Task WaitForConnectionAsync(CancellationToken cancellationToken) 117public async Task HandleRequestAsync(HttpContext context) 157await Task.Delay(Timeout.InfiniteTimeSpan, context.RequestAborted);
UI\PhysicalConsole.cs (3)
30private async Task ListenToStandardInputAsync() 108private Task ListenToConsoleKeyPressAsync() 116return Task.Factory.StartNew(() =>
Utilities\ImmutableDictionaryExtensions.cs (3)
40public static Task ForEachValueAsync<TKey, TValue>(this ImmutableDictionary<TKey, ImmutableArray<TValue>> dictionary, Func<TValue, CancellationToken, Task> action, CancellationToken cancellationToken) 42=> Task.WhenAll(dictionary.SelectMany(entry => entry.Value).Select(project => action(project, cancellationToken))).WaitAsync(cancellationToken);
Microsoft.DotNet.HotReload.WebAssembly.Browser (2)
_generated\0\JSExports.g.cs (1)
42global::System.Threading.Tasks.Task __invokeRetVal = default;
WebAssemblyHotReload.cs (1)
65public static async Task InitializeAsync(string baseUri)
Microsoft.Extensions.AI (21)
ChatCompletion\AnonymousDelegatingChatClient.cs (5)
32private readonly Func<IEnumerable<ChatMessage>, ChatOptions?, Func<IEnumerable<ChatMessage>, ChatOptions?, CancellationToken, Task>, CancellationToken, Task>? _sharedFunc; 51Func<IEnumerable<ChatMessage>, ChatOptions?, Func<IEnumerable<ChatMessage>, ChatOptions?, CancellationToken, Task>, CancellationToken, Task> sharedFunc) 137async Task ProcessAsync()
ChatCompletion\CachingChatClient.cs (4)
179/// <returns>A <see cref="Task"/> representing the completion of the operation.</returns> 182protected abstract Task WriteCacheAsync(string key, ChatResponse value, CancellationToken cancellationToken); 191/// <returns>A <see cref="Task"/> representing the completion of the operation.</returns> 194protected abstract Task WriteCacheStreamingAsync(string key, IReadOnlyList<ChatResponseUpdate> value, CancellationToken cancellationToken);
ChatCompletion\ChatClientBuilder.cs (2)
108public ChatClientBuilder Use(Func<IEnumerable<ChatMessage>, ChatOptions?, Func<IEnumerable<ChatMessage>, ChatOptions?, CancellationToken, Task>, CancellationToken, Task> sharedFunc)
ChatCompletion\DistributedCachingChatClient.cs (2)
100protected override async Task WriteCacheAsync(string key, ChatResponse value, CancellationToken cancellationToken) 111protected override async Task WriteCacheStreamingAsync(string key, IReadOnlyList<ChatResponseUpdate> value, CancellationToken cancellationToken)
ChatReduction\MessageCountingChatReducer.cs (1)
43return Task.FromResult(GetReducedMessages(messages));
Common\FunctionInvocationProcessor.cs (1)
76results.AddRange(await Task.WhenAll(
Embeddings\CachingEmbeddingGenerator.cs (2)
129/// <returns>A <see cref="Task"/> representing the completion of the operation.</returns> 130protected abstract Task WriteCacheAsync(string key, TEmbedding value, CancellationToken cancellationToken);
Embeddings\DistributedCachingEmbeddingGenerator.cs (1)
90protected override async Task WriteCacheAsync(string key, TEmbedding value, CancellationToken cancellationToken)
Realtime\FunctionInvokingRealtimeClientSession.cs (1)
128public Task SendAsync(RealtimeClientMessage message, CancellationToken cancellationToken = default) =>
Realtime\LoggingRealtimeClientSession.cs (1)
77public async Task SendAsync(RealtimeClientMessage message, CancellationToken cancellationToken = default)
Realtime\OpenTelemetryRealtimeClientSession.cs (1)
176public async Task SendAsync(RealtimeClientMessage message, CancellationToken cancellationToken = default)
Microsoft.Extensions.AI.Abstractions (33)
ChatCompletion\ChatResponseExtensions.cs (3)
104/// <returns>A <see cref="Task"/> representing the completion of the operation.</returns> 113public static Task AddMessagesAsync( 121static async Task AddMessagesAsync(
Files\HostedFileDownloadStream.cs (1)
79public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
Functions\AIFunctionDeclaration.cs (1)
63/// a function that returns <see cref="void"/>, <see cref="Task"/>, or <see cref="ValueTask"/>,
Functions\AIFunctionFactory.cs (22)
119/// <see cref="void"/>, <see cref="Task"/>, or <see cref="ValueTask"/>, no return schema is produced (the property is <see langword="null"/>). 196/// For methods returning <see cref="void"/>, <see cref="Task"/>, or <see cref="ValueTask"/>, no return schema is produced. 288/// <see cref="void"/>, <see cref="Task"/>, or <see cref="ValueTask"/>, no return schema is produced (the property is <see langword="null"/>). 375/// For methods returning <see cref="void"/>, <see cref="Task"/>, or <see cref="ValueTask"/>, no return schema is produced. 480/// <see cref="void"/>, <see cref="Task"/>, or <see cref="ValueTask"/>, no return schema is produced (the property is <see langword="null"/>). 887if (t == typeof(Task) || t == typeof(ValueTask)) 1049if (returnType == typeof(Task)) 1056await ((Task)ThrowIfNullResult(result)).ConfigureAwait(true); 1063await ((Task)ThrowIfNullResult(result)).ConfigureAwait(true); 1101await ((Task)ThrowIfNullResult(taskObj)).ConfigureAwait(true); 1113await ((Task)ThrowIfNullResult(taskObj)).ConfigureAwait(true); 1122await ((Task)ThrowIfNullResult(taskObj)).ConfigureAwait(true); 1140var task = (Task)ReflectionInvoke(valueTaskAsTask, ThrowIfNullResult(taskObj), null)!; 1153var task = (Task)ReflectionInvoke(valueTaskAsTask, ThrowIfNullResult(taskObj), null)!; 1163var task = (Task)ReflectionInvoke(valueTaskAsTask, ThrowIfNullResult(taskObj), null)!; 1411public override Task FlushAsync(CancellationToken cancellationToken) => 1412Task.CompletedTask; 1414public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => 1428return new ValueTask(Task.FromCanceled(cancellationToken));
Functions\AIFunctionFactoryOptions.cs (4)
104/// Methods strongly typed to return types of <see cref="Task"/>, <see cref="Task{TResult}"/>, <see cref="ValueTask"/>, 105/// and <see cref="ValueTask{TResult}"/> are special-cased. For methods typed to return <see cref="Task"/> or <see cref="ValueTask"/>, 114/// or <see langword="null"/>. If the method is typed to return <see cref="Task"/>, <see cref="ValueTask"/>, or <see langword="void"/>, 127/// <see cref="void"/>, <see cref="Task"/>, or <see cref="ValueTask"/>.
parent\parent\parent\eng\MSBuild\parent\parent\src\LegacySupport\FilePolyfills\FilePolyfills.cs (1)
57public static async Task WriteAllBytesAsync(string path, ReadOnlyMemory<byte> bytes, CancellationToken cancellationToken = default)
Realtime\IRealtimeClientSession.cs (1)
42Task SendAsync(RealtimeClientMessage message, CancellationToken cancellationToken = default);
Microsoft.Extensions.AI.Abstractions.Tests (186)
ChatCompletion\ChatClientExtensionsTests.cs (7)
101public async Task GetResponseAsync_CreatesTextMessageAsync() 119return Task.FromResult(expectedResponse); 129public async Task GetStreamingResponseAsync_CreatesTextMessageAsync() 162public async Task GetResponseAsync_UsesProvidedContinuationToken() 193return Task.FromResult(expectedResponse); 203public async Task GetStreamingResponseAsync_UsesProvidedContinuationToken() 249await Task.Yield();
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (27)
27public async Task ToChatResponse_SuccessfullyCreatesResponse(bool useAsync) 71public async Task ToChatResponse_RoleOrIdOrAuthorNameChangeDictatesMessageChange(bool useAsync) 127public async Task ToChatResponse_AuthorNameChangeDictatesMessageBoundary(bool useAsync) 180public async Task ToChatResponse_AuthorNameWithOtherBoundaries(bool useAsync) 239public async Task ToChatResponse_EmptyOrNullAuthorNameDoesNotCreateBoundary(bool useAsync) 274public async Task ToChatResponse_AuthorNameNullToNonNullDoesNotCreateBoundary(bool useAsync) 309public async Task ToChatResponse_MessageIdNullToNonNullDoesNotCreateBoundary(bool useAsync) 344public async Task ToChatResponse_EmptyMessageIdDoesNotCreateBoundary(bool useAsync) 377public async Task ToChatResponse_RoleNullToNonNullDoesNotCreateBoundary(bool useAsync) 412public async Task ToChatResponse_CustomRoleChangesCreateBoundary(bool useAsync) 450public async Task ToChatResponse_AdditionalPropertiesGoToMessages(bool useAsync) 499public async Task ToChatResponse_AdditionalPropertiesRoutingBasedOnMessageId(bool useAsync) 535public async Task ToChatResponse_UpdatesProduceMultipleResponseMessages(bool useAsync) 624public async Task ToChatResponse_Coalescing_VariousSequenceAndGapLengths(bool useAsync, int numSequences, int sequenceLength, int gapLength, bool gapBeginningEnd) 685public async Task ToChatResponse_CoalescesTextContentAndTextReasoningContentSeparately(bool useAsync) 723public async Task ToChatResponse_CoalescesTextReasoningContentUpToProtectedData(bool useAsync) 760public async Task ToChatResponse_DoesNotCoalesceAnnotatedContent(bool useAsync) 800public async Task ToChatResponse_UsageContentExtractedFromContents() 822public async Task ToChatResponse_AlternativeTimestamps(bool useAsync) 895public async Task ToChatResponse_TimestampFolding(bool useAsync, string? timestamp1, string? timestamp2, string? expectedTimestamp) 920public async Task ToChatResponse_CoalescesImageGenerationToolResultContent(bool useAsync) 979public async Task ToChatResponse_ImageGenerationToolResultContentWithDistinctCallIds_DoesNotCoalesce(bool useAsync) 1013public async Task ToChatResponse_CoalescesWebSearchToolCallContent(bool useAsync) 1062public async Task ToChatResponse_CoalescesWebSearchToolCallContent_NullQueriesFirst(bool useAsync) 1082public async Task ToChatResponse_WebSearchToolCallContentWithDistinctCallIds_DoesNotCoalesce(bool useAsync) 1103public async Task ToChatResponse_CoalescesWebSearchToolCallContent_CallingToChatResponseTwiceOnSameUpdates(bool useAsync, bool firstHasQueries) 1147await Task.Yield();
ChatCompletion\DelegatingChatClientTests.cs (3)
21public async Task ChatAsyncDefaultsToInnerClientAsync() 53public async Task ChatStreamingAsyncDefaultsToInnerClientAsync() 156await Task.Yield();
ChatRouting\RoutingChatClientTests.cs (7)
21public async Task Create_SelectsClientForRequest() 33return Task.FromResult(expected); 61public async Task Create_DoesNotReselectAfterFailure() 83public async Task Create_NullSelectionThrowsForNonStreamingAndStreaming() 97public async Task Create_RejectsNullMessagesForNonStreamingAndStreaming() 108public async Task Create_DoesNotDisposeSelectedClient() 165Task.FromResult(new ChatResponse());
Contents\DataContentTests.cs (28)
313public async Task LoadFromAsync_Path_InfersMediaTypeAndName() 340public async Task LoadFromAsync_Path_UsesProvidedMediaType() 367public async Task LoadFromAsync_Path_FallsBackToOctetStream() 393public async Task LoadFromAsync_Stream_InfersFromFileStream() 421public async Task LoadFromAsync_Stream_UsesProvidedMediaType() 437public async Task LoadFromAsync_Stream_FallsBackToOctetStream() 453public async Task SaveToAsync_WritesDataToFile() 480public async Task SaveToAsync_InfersExtension_WhenPathHasNoExtension() 507public async Task SaveToAsync_UsesDirectoryAndInfersNameFromNameProperty() 539public async Task SaveToAsync_UsesRandomNameWhenDirectoryProvidedAndNoName() 568public async Task SaveToAsync_DoesNotInferExtension_WhenPathAlreadyHasExtension() 594public async Task SaveToAsync_WithJustFilename_SavesInCurrentDirectory() 624public async Task SaveToAsync_WithRelativeDirectory_UsesNameFromContent() 653public async Task SaveToAsync_WithEmptyPath_UsesCurrentDirectoryAndContentName() 682public async Task LoadFromAsync_Path_ThrowsOnNull() 688public async Task LoadFromAsync_Path_ThrowsOnEmpty() 694public async Task LoadFromAsync_Stream_ThrowsOnNull() 700public async Task SaveToAsync_ThrowsOnNull() 707public async Task LoadFromAsync_ExtractsFilenameFromPath() 736public async Task SaveToAsync_DirectoryPath_WithoutName_GeneratesRandomName() 766public async Task LoadFromAsync_WithCancellationToken_PropagatesToken() 792public async Task SaveToAsync_WithCancellationToken_PropagatesToken() 818public async Task LoadFromAsync_Stream_WithCancellationToken_PropagatesToken() 833public async Task SaveToAsync_ExistingDirectory_WithName_UsesNameAsFilename() 863public async Task SaveToAsync_NonExistentPath_TreatedAsFilePath() 892public async Task LoadFromAsync_LargeFile_LoadsCorrectly() 919public async Task SaveToAsync_LargeContent_SavesCorrectly() 946public async Task SaveToAsync_ExistingFile_ThrowsAndPreservesOriginalContent()
Contents\FunctionCallContentTests.cs (7)
180public async Task AIFunctionFactory_ObjectValues_Converted() 200public async Task AIFunctionFactory_JsonElementValues_ValuesDeserialized() 234public async Task AIFunctionFactory_JsonDocumentValues_ValuesDeserialized() 255public async Task AIFunctionFactory_JsonNodeValues_ValuesDeserialized() 276public async Task TypelessAIFunction_JsonDocumentValues_AcceptsArguments() 294public async Task TypelessAIFunction_JsonElementValues_AcceptsArguments() 312public async Task TypelessAIFunction_JsonNodeValues_AcceptsArguments()
Embeddings\DelegatingEmbeddingGeneratorTests.cs (1)
21public async Task GenerateEmbeddingsDefaultsToInnerServiceAsync()
Embeddings\EmbeddingGeneratorExtensionsTests.cs (5)
79public async Task GenerateAsync_InvalidArgs_ThrowsAsync() 87public async Task GenerateAsync_ReturnsSingleEmbeddingAsync() 94Task.FromResult<GeneratedEmbeddings<Embedding<float>>>([result]) 105public async Task GenerateAndZipEmbeddingsAsync_ReturnsExpectedList(int count) 116Task.FromResult<GeneratedEmbeddings<Embedding<float>>>(new(embeddings))
Embeddings\GeneratedEmbeddingsTests.cs (2)
249public async Task Generator_SupportsCovariantInput() 255GenerateAsyncCallback = (values, options, cancellationToken) => Task.FromResult(expectedGeneratedEmbeddings),
Files\DelegatingHostedFileClientTests.cs (6)
24public async Task UploadAsyncDefaultsToInnerClientAsync() 55public async Task DownloadAsyncDefaultsToInnerClientAsync() 82public async Task GetFileInfoAsyncDefaultsToInnerClientAsync() 109public async Task ListFilesAsyncDefaultsToInnerClientAsync() 140public async Task DeleteAsyncDefaultsToInnerClientAsync() 227await Task.Yield();
Files\HostedFileClientExtensionsTests.cs (37)
16public async Task UploadAsync_DataContent_PassesCorrectArgs() 31return Task.FromResult(new HostedFileContent("file-1")); 46public async Task UploadAsync_DataContent_NullClient_Throws() 54public async Task UploadAsync_DataContent_NullContent_Throws() 61public async Task UploadAsync_FilePath_CreatesStreamAndInfersMediaType() 99public async Task UploadAsync_FilePath_NullClient_Throws() 106public async Task UploadAsync_FilePath_NullPath_Throws() 113public async Task UploadAsync_FilePath_EmptyPath_Throws() 120public async Task DownloadToAsync_SavesStreamToFilePath() 130return Task.FromResult<HostedFileDownloadStream>(new TestHostedFileDownloadStream(data)); 147public async Task DownloadToAsync_DirectoryPath_UsesFileName() 156Task.FromResult<HostedFileDownloadStream>(new TestHostedFileDownloadStream(data, fileName: "result.bin")) 172public async Task DownloadToAsync_DirectoryPath_NoFileName_UsesFileId() 181Task.FromResult<HostedFileDownloadStream>(new TestHostedFileDownloadStream(data)) 197public async Task DownloadToAsync_EmptyDestinationPath_UsesCurrentDirectory() 205Task.FromResult<HostedFileDownloadStream>(new TestHostedFileDownloadStream(data, fileName: fileName)) 230public async Task DownloadToAsync_FileAlreadyExists_Throws() 238Task.FromResult<HostedFileDownloadStream>(new TestHostedFileDownloadStream(new byte[] { 4, 5, 6 })) 252public async Task DownloadToAsync_NullClient_Throws() 259public async Task DownloadToAsync_NullFileId_Throws() 266public async Task DownloadToAsync_NullDestinationPath_Throws() 273public async Task DownloadToAsync_EmptyFileId_Throws() 280public async Task DownloadToAsync_WhitespaceFileId_Throws() 287public async Task DownloadAsync_HostedFileContent_PassesFileId() 297return Task.FromResult<HostedFileDownloadStream>(new TestHostedFileDownloadStream([])); 305public async Task DownloadAsync_HostedFileContent_NullClient_Throws() 313public async Task DownloadAsync_HostedFileContent_NullContent_Throws() 320public async Task DownloadAsync_HostedFileContent_FlowsScope() 330return Task.FromResult<HostedFileDownloadStream>(new TestHostedFileDownloadStream([])); 339public async Task DownloadAsync_HostedFileContent_ExplicitOptionsScopeWins() 350return Task.FromResult<HostedFileDownloadStream>(new TestHostedFileDownloadStream([])); 359public async Task DownloadAsDataContentAsync_ReturnsCorrectDataContent() 368return Task.FromResult<HostedFileDownloadStream>( 379public async Task DownloadAsDataContentAsync_NullClient_Throws() 386public async Task DownloadAsDataContentAsync_NullFileId_Throws() 393public async Task DownloadAsDataContentAsync_EmptyFileId_Throws() 400public async Task DownloadAsDataContentAsync_WhitespaceFileId_Throws()
Files\HostedFileDownloadStreamTests.cs (5)
24public async Task ToDataContentAsync_BuffersStreamContent() 35public async Task ToDataContentAsync_NullMediaType_DefaultsToOctetStream() 46public async Task ToDataContentAsync_EmptyStream_ReturnsEmptyData() 61public async Task WriteApis_ThrowNotSupportedException() 70Assert.Throws<NotSupportedException>(() => stream.EndWrite(Task.CompletedTask));
Functions\ApprovalRequiredAIFunctionTests.cs (1)
35public async Task InvokeAsync_DelegatesToInnerFunction()
Functions\DelegatingAIFunctionTests.cs (1)
62public async Task OverriddenInvocation_SuccessfullyInvoked()
Image\DelegatingImageGeneratorTests.cs (1)
20public async Task GenerateImagesAsyncDefaultsToInnerGeneratorAsync()
Image\ImageGeneratorExtensionsTests.cs (12)
59public async Task EditImageAsync_DataContent_CallsGenerateImagesAsync() 78return Task.FromResult(expectedResponse); 89public async Task EditImageAsync_DataContent_NullArguments_Throws() 105public async Task EditImageAsync_ByteArray_CallsGenerateImagesAsync() 127return Task.FromResult(expectedResponse); 138public async Task EditImageAsync_ByteArray_NullGenerator_Throws() 147public async Task EditImageAsync_ByteArray_NullFileName_Throws() 157public async Task EditImageAsync_ByteArray_NullPrompt_Throws() 177public async Task EditImageAsync_ByteArray_InfersCorrectMediaType(string fileName, string expectedMediaType) 189return Task.FromResult(new ImageGenerationResponse()); 197public async Task EditImageAsync_AllMethods_PassDefaultOptionsAndCancellation() 212return Task.FromResult(new ImageGenerationResponse());
Image\ImageGeneratorTests.cs (7)
45public async Task GenerateImagesAsync_CallsCallback() 59return Task.FromResult(expectedResponse); 68public async Task GenerateImagesAsync_NoCallback_ReturnsEmptyResponse() 102public async Task GenerateImagesAsync_WithOptions_PassesThroughCorrectly() 121return Task.FromResult(new ImageGenerationResponse()); 129public async Task GenerateImagesAsync_WithEditRequest_PassesThroughCorrectly() 148return Task.FromResult(new ImageGenerationResponse());
parent\parent\parent\eng\MSBuild\parent\parent\src\LegacySupport\FilePolyfills\FilePolyfills.cs (1)
57public static async Task WriteAllBytesAsync(string path, ReadOnlyMemory<byte> bytes, CancellationToken cancellationToken = default)
SpeechToText\DelegatingSpeechToTextClientTests.cs (3)
22public async Task GetTextAsyncDefaultsToInnerClientAsync() 54public async Task GetStreamingTextAsyncDefaultsToInnerClientAsync() 157await Task.Yield();
SpeechToText\SpeechToTextClientExtensionsTests.cs (4)
24public async Task GetTextAsync_InvalidArgs_Throws() 39public async Task GetStreamingTextAsync_InvalidArgs_Throws() 53public async Task GetStreamingTextAsync_CreatesTextMessageAsync() 87await Task.Yield();
SpeechToText\SpeechToTextClientTests.cs (3)
14public async Task GetTextAsync_CreatesTextMessageAsync() 27return Task.FromResult(new SpeechToTextResponse("hello")); 43public async Task GetStreamingTextAsync_CreatesStreamingUpdatesAsync()
SpeechToText\SpeechToTextResponseUpdateExtensionsTests.cs (4)
44public async Task ToSpeechToTextResponse_SuccessfullyCreatesResponse(bool useAsync) 79public async Task ToSpeechToTextResponse_Coalescing_VariousSequenceAndGapLengths(bool useAsync, int numSequences, int sequenceLength, int gapLength, bool gapBeginningEnd) 135public async Task ToSpeechToTextResponse_UsageContentExtractedFromContents() 160await Task.Yield();
TestImageGenerator.cs (1)
31Task.FromResult(new ImageGenerationResponse());
TestRealtimeClientSession.cs (4)
15public Func<RealtimeClientMessage, CancellationToken, Task>? SendAsyncCallback { get; set; } 27public Task SendAsync(RealtimeClientMessage message, CancellationToken cancellationToken = default) 29return SendAsyncCallback?.Invoke(message, cancellationToken) ?? Task.CompletedTask; 59await Task.CompletedTask.ConfigureAwait(false);
TextToSpeech\DelegatingTextToSpeechClientTests.cs (3)
21public async Task GetAudioAsyncDefaultsToInnerClientAsync() 53public async Task GetStreamingAudioAsyncDefaultsToInnerClientAsync() 154await Task.Yield();
TextToSpeech\TextToSpeechClientTests.cs (3)
14public async Task GetAudioAsync_CreatesAudioResponseAsync() 24return Task.FromResult(new TextToSpeechResponse([new DataContent(new byte[] { 1, 2, 3 }, "audio/mpeg")])); 38public async Task GetStreamingAudioAsync_CreatesStreamingUpdatesAsync()
TextToSpeech\TextToSpeechResponseUpdateExtensionsTests.cs (3)
22public async Task ToTextToSpeechResponse_SuccessfullyCreatesResponse(bool useAsync) 53public async Task ToTextToSpeechResponse_UsageContentExtractedFromContents() 79await Task.Yield();
Microsoft.Extensions.AI.Evaluation (2)
Utilities\TaskExtensions.cs (1)
71var task = await Task.WhenAny(remaining).ConfigureAwait(false);
Utilities\TimingHelper.cs (1)
50internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation)
Microsoft.Extensions.AI.Evaluation.Console (4)
parent\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (1)
50internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation)
Telemetry\TelemetryConstants.cs (1)
142internal static async Task DisplayTelemetryOptOutMessageIfNeededAsync(this ILogger logger)
Telemetry\TelemetryExtensions.cs (1)
73Func<Task> operation,
Utilities\LoggerExtensions.cs (1)
54Func<Task> operation,
Microsoft.Extensions.AI.Evaluation.Integration.Tests (35)
AgentQualityEvaluatorTests.cs (4)
84public async Task ToolDefinitionsAreNotNeededAndNotPassed() 107public async Task ToolDefinitionsAreNotNeededButPassed() 140public async Task ToolDefinitionsAreNeededButNotPassed() 164public async Task ToolDefinitionsAreNeededAndPassed()
NLPEvaluatorTests.cs (4)
44public async Task ExactMatch() 70public async Task PartialMatch() 97public async Task Unmatched() 123public async Task AdditionalContextIsNotPassed()
QualityEvaluatorTests.cs (4)
77public async Task SampleSingleResponse() 110public async Task SampleMultipleResponses() 156public async Task AdditionalContextIsNotPassed() 191public async Task AdditionalContextIsPassed()
ResultsTests.cs (10)
153public async Task ResultWithBooleanMetric() 181public async Task ResultWithBooleanMetricAndInterpretation() 212public async Task ResultWithStringMetric() 268public async Task ResultWithStringMetricAndInterpretation() 336public async Task ResultWithNumericMetrics() 372public async Task ResultWithNumericMetricsAndInterpretation() 415public async Task ResultWithDiagnosticsOnUninterpretedMetrics() 468public async Task ResultWithDiagnosticsOnFailingMetrics() 527public async Task ResultWithDiagnosticsOnPassingMetrics() 586public async Task ResultWithException()
SafetyEvaluatorTests.cs (13)
157public async Task EvaluateConversationWithSingleTurn_HubBasedProject() 169public async Task EvaluateConversationWithSingleTurn_NonHubBasedProject() 180private static async Task EvaluateConversationWithSingleTurn(ScenarioRun scenarioRun) 235public async Task EvaluateConversationWithMultipleTurns_HubBasedProject() 247public async Task EvaluateConversationWithMultipleTurns_NonHubBasedProject() 258private static async Task EvaluateConversationWithMultipleTurns(ScenarioRun scenarioRun) 326public async Task EvaluateConversationWithImageInQuestion() 362public async Task EvaluateConversationWithImageInAnswer() 398public async Task EvaluateConversationWithImagesInMultipleTurns() 447public async Task EvaluateConversationWithImagesAndTextInMultipleTurns() 509public async Task EvaluateCodeCompletionWithSingleTurn() 538public async Task EvaluateCodeCompletionWithMultipleTurns() 579public async Task EvaluateSafetyAndQualityMetricsForSameConversation()
Microsoft.Extensions.AI.Evaluation.NLP (1)
parent\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (1)
50internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation)
Microsoft.Extensions.AI.Evaluation.NLP.Tests (17)
BLEUEvaluatorTests.cs (6)
15public async Task ReturnsPerfectScoreForIdenticalText() 31public async Task ReturnsLowScoreForCompletelyDifferentText() 47public async Task ReturnsErrorDiagnosticIfNoContext() 66public async Task SampleCases(string reference, string hypothesis, double score) 79public async Task MultipleReferences() 99public async Task ReturnsErrorDiagnosticIfEmptyResponse()
F1EvaluatorTests.cs (5)
15public async Task ReturnsPerfectScoreForIdenticalText() 31public async Task ReturnsLowScoreForCompletelyDifferentText() 47public async Task ReturnsErrorDiagnosticIfNoContext() 66public async Task SampleCases(string reference, string hypothesis, double score) 79public async Task ReturnsErrorDiagnosticIfEmptyResponse()
GLEUEvaluatorTests.cs (6)
15public async Task ReturnsPerfectScoreForIdenticalText() 31public async Task ReturnsLowScoreForCompletelyDifferentText() 47public async Task ReturnsErrorDiagnosticIfNoContext() 66public async Task SampleCases(string reference, string hypothesis, double score) 79public async Task MultipleReferences() 99public async Task ReturnsErrorDiagnosticIfEmptyResponse()
Microsoft.Extensions.AI.Evaluation.Quality (1)
parent\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (1)
50internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation)
Microsoft.Extensions.AI.Evaluation.Reporting (7)
ResponseCachingChatClient.cs (2)
98protected override async Task WriteCacheAsync(string key, ChatResponse value, CancellationToken cancellationToken) 120protected override async Task WriteCacheStreamingAsync(
Storage\DiskBasedResponseCache.CacheEntry.cs (1)
68public async Task WriteAsync(
Storage\DiskBasedResponseCache.cs (4)
160public async Task RefreshAsync(string key, CancellationToken cancellationToken = default) 185public Task RemoveAsync(string key, CancellationToken cancellationToken = default) 189return Task.CompletedTask; 204public async Task SetAsync(
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (4)
Storage\AzureStorageResponseCache.CacheEntry.cs (1)
80public async Task WriteAsync(
Storage\AzureStorageResponseCache.cs (3)
109public async Task RefreshAsync(string key, CancellationToken cancellationToken = default) 141public async Task RemoveAsync(string key, CancellationToken cancellationToken = default) 165public async Task SetAsync(
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (17)
CacheEntryTests.cs (1)
78public async Task SerializeCacheEntryToFileAsync()
DiskBased\PathValidationTests.cs (2)
200public async Task DiskBasedResultStore_DeleteWithTraversal_Throws() 228public async Task DiskBasedResponseCacheProvider_TraversalInScenarioName_Throws()
ResponseCacheTester.cs (6)
29public async Task AddUncachedEntry() 52public async Task RemoveCachedEntry() 78public async Task CacheEntryExpiration() 106public async Task MultipleCacheInstances() 128public async Task DeleteExpiredEntries() 163public async Task ResetCache()
ResultStoreTester.cs (8)
65public async Task WriteAndReadResults() 104public async Task WriteAndReadHistoricalResults() 119await Task.Delay(TimeSpan.FromMilliseconds(500)); 129await Task.Delay(TimeSpan.FromMilliseconds(500)); 148public async Task DeleteExecutions() 172public async Task DeleteSomeExecutions() 207public async Task DeleteScenarios() 242public async Task DeleteIterations()
Microsoft.Extensions.AI.Evaluation.Safety (2)
ContentSafetyService.cs (1)
385await Task.Delay(InitialDelayInMilliseconds * attempts, cancellationToken).ConfigureAwait(false);
parent\Microsoft.Extensions.AI.Evaluation\Utilities\TimingHelper.cs (1)
50internal static async ValueTask<TimeSpan> ExecuteWithTimingAsync(Func<Task> operation)
Microsoft.Extensions.AI.Integration.Tests (74)
ChatClientIntegrationTests.cs (46)
52public virtual async Task GetResponseAsync_SingleRequestMessage() 62public virtual async Task GetResponseAsync_MultipleRequestMessages() 80public virtual async Task GetResponseAsync_WithEmptyMessage() 96public virtual async Task GetStreamingResponseAsync() 117public virtual async Task GetResponseAsync_UsageDataAvailable() 129public virtual async Task GetStreamingResponseAsync_UsageDataAvailable() 156public virtual async Task GetStreamingResponseAsync_AppendToHistory() 177public virtual async Task MultiModal_DescribeImage() 195public virtual async Task MultiModal_DescribePdf() 213public virtual async Task FunctionInvocation_AutomaticallyInvokeFunction_Parameterless() 244public virtual async Task FunctionInvocation_AutomaticallyInvokeFunction_WithParameters_NonStreaming() 259public virtual async Task FunctionInvocation_AutomaticallyInvokeFunction_WithParameters_Streaming() 280public virtual async Task FunctionInvocation_OptionalParameter() 312public virtual async Task FunctionInvocation_NestedParameters() 344public virtual async Task FunctionInvocation_ArrayParameter() 394public virtual Task AvailableTools_SchemasAreAccepted_Strict() => 398public virtual Task AvailableTools_SchemasAreAccepted_NonStrict() => 401private async Task AvailableTools_SchemasAreAccepted(bool strict) 565public virtual async Task FunctionInvocation_SupportsMultipleParallelRequests() 592public virtual async Task FunctionInvocation_RequireAny() 615public virtual async Task FunctionInvocation_RequireSpecific() 636public virtual async Task Caching_OutputVariesWithoutCaching() 648public virtual async Task Caching_SamePromptResultsInCacheHit_NonStreaming() 673public virtual async Task Caching_SamePromptResultsInCacheHit_Streaming() 712public virtual async Task Caching_BeforeFunctionInvocation_AvoidsExtraCalls() 748public virtual async Task Caching_AfterFunctionInvocation_FunctionOutputUnchangedAsync() 790public virtual async Task Caching_AfterFunctionInvocation_FunctionOutputChangedAsync() 831public virtual async Task Logging_LogsCalls_NonStreaming() 850public virtual async Task Logging_LogsCalls_Streaming() 872public virtual async Task Logging_LogsFunctionCalls_NonStreaming() 898public virtual async Task Logging_LogsFunctionCalls_Streaming() 926public virtual async Task OpenTelemetry_CanEmitTracesAndMetrics() 956public virtual async Task GetResponseAsync_StructuredOutput() 972public virtual async Task GetResponseAsync_StructuredOutputArray() 988public virtual async Task GetResponseAsync_StructuredOutputInteger() 1001public virtual async Task GetResponseAsync_StructuredOutputString() 1014public virtual async Task GetResponseAsync_StructuredOutputBool_True() 1027public virtual async Task GetResponseAsync_StructuredOutputBool_False() 1040public virtual async Task GetResponseAsync_StructuredOutputEnum() 1052public virtual async Task GetResponseAsync_StructuredOutput_WithFunctions() 1083public virtual async Task GetResponseAsync_StructuredOutput_NonNative() 1129public virtual async Task SummarizingChatReducer_PreservesConversationContext() 1171public virtual async Task SummarizingChatReducer_PreservesSystemMessage() 1215public virtual async Task SummarizingChatReducer_WithFunctionCalls() 1266public virtual async Task SummarizingChatReducer_Streaming() 1311public virtual async Task SummarizingChatReducer_CustomPrompt()
EmbeddingGeneratorIntegrationTests.cs (6)
45public virtual async Task GenerateEmbedding_CreatesEmbeddingSuccessfully() 60public virtual async Task GenerateEmbeddings_CreatesEmbeddingsSuccessfully() 82public virtual async Task Caching_SameOutputsForSameInput() 105public virtual async Task OpenTelemetry_CanEmitTracesAndMetrics() 137public async Task Quantization_Binary_EmbeddingsCompareSuccessfully() 181public async Task Quantization_Half_EmbeddingsCompareSuccessfully()
ImageGeneratingChatClientIntegrationTests.cs (8)
116public virtual async Task GenerateImage_CallsGenerateFunction_ReturnsDataContent(bool useStreaming) 152public virtual async Task EditImage_WithImageInSameRequest_PassesExactDataContent(bool useStreaming) 183public virtual async Task GenerateThenEdit_FromChatHistory_EditsGeneratedImage(bool useStreaming) 233public virtual async Task MultipleEdits_EditsLatestImage(bool useStreaming) 278public virtual async Task MultipleEdits_EditsFirstImage(bool useStreaming) 323public virtual async Task ImageGeneration_WithOptions_PassesOptionsToGenerator(bool useStreaming) 355public virtual async Task ImageContentHandling_AllImages_ReplacesImagesWithPlaceholders(bool useStreaming) 426return Task.FromResult(new ImageGenerationResponse([imageContent]));
ImageGeneratorIntegrationTests.cs (3)
32public virtual async Task GenerateImagesAsync_SingleImageGeneration() 65public virtual async Task GenerateImagesAsync_MultipleImages() 90public virtual async Task EditImagesAsync_SingleImage()
parent\Microsoft.Extensions.AI.Abstractions.Tests\TestImageGenerator.cs (1)
31Task.FromResult(new ImageGenerationResponse());
ReducingChatClientTests.cs (2)
24public async Task Reduction_LimitsMessagesBasedOnTokenLimit() 34return Task.FromResult(new ChatResponse());
SpeechToTextClientIntegrationTests.cs (3)
33public virtual async Task GetTextAsync_SingleAudioRequestMessage() 44public virtual async Task GetStreamingTextAsync_SingleStreamingResponseChoice() 67public virtual async Task GetTextAsync_AutoDetectsAudioFormat(string fileName)
TextToSpeechClientIntegrationTests.cs (5)
32public virtual async Task GetAudioAsync_SimpleText_ReturnsAudio() 48public virtual async Task GetAudioAsync_WithVoice_ReturnsAudio() 67public virtual async Task GetAudioAsync_WithAudioFormat_ReturnsCorrectMediaType() 86public virtual async Task GetAudioAsync_WithSpeed_ReturnsAudio() 104public virtual async Task GetStreamingAudioAsync_SimpleText_ReturnsUpdates()
Microsoft.Extensions.AI.OllamaSharp.Integration.Tests (7)
OllamaSharpChatClientIntegrationTests.cs (6)
21public override Task FunctionInvocation_RequireAny() 24return Task.CompletedTask; // Unreachable 27public override Task FunctionInvocation_RequireSpecific() => FunctionInvocation_RequireAny(); 32public async Task PromptBasedFunctionCalling_NoArgs() 56public async Task PromptBasedFunctionCalling_WithArgs() 91public async Task InvalidModelParameter_ThrowsInvalidOperationException()
OllamaSharpEmbeddingGeneratorIntegrationTests.cs (1)
19public async Task InvalidModelParameter_ThrowsInvalidOperationException()
Microsoft.Extensions.AI.OpenAI (11)
OpenAIFileDownloadStream.cs (3)
49return Task.FromResult(new DataContent(_data.ToMemory(), MediaType ?? "application/octet-stream") 79public override Task FlushAsync(CancellationToken cancellationToken) => 99public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) =>
OpenAIHostedFileClient.cs (1)
391public override Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) =>
OpenAIRealtimeClientSession.cs (7)
71public async Task ConnectAsync(CancellationToken cancellationToken = default) 82private async Task UpdateSessionAsync(RealtimeSessionOptions options, CancellationToken cancellationToken) 109public async Task SendAsync(RealtimeClientMessage message, CancellationToken cancellationToken = default) 203private async Task SendResponseCreateAsync(CreateResponseRealtimeClientMessage responseCreate, CancellationToken cancellationToken) 302private async Task SendConversationItemCreateAsync(CreateConversationItemRealtimeClientMessage itemCreate, CancellationToken cancellationToken) 336private async Task SendInputAudioAppendAsync(InputAudioBufferAppendRealtimeClientMessage audioAppend, CancellationToken cancellationToken) 356private async Task SendRawCommandAsync(RealtimeClientMessage message, CancellationToken cancellationToken)
Microsoft.Extensions.AI.OpenAI.Tests (279)
OpenAIAssistantChatClientIntegrationTests.cs (10)
43public override Task Caching_AfterFunctionInvocation_FunctionOutputChangedAsync() => Task.CompletedTask; 44public override Task Caching_AfterFunctionInvocation_FunctionOutputUnchangedAsync() => Task.CompletedTask; 47public override Task MultiModal_DescribeImage() => Task.CompletedTask; 48public override Task MultiModal_DescribePdf() => Task.CompletedTask; 51public async Task UseCodeInterpreter_ProducesCodeExecutionResults() 104public async Task DeleteAllThreads()
OpenAIChatClientTests.cs (25)
107public async Task BasicRequestResponse_NonStreaming() 188public async Task BasicRequestResponse_Streaming() 276public async Task ChatOptions_StrictRespected() 344public async Task ChatOptions_DoNotOverwrite_NotNullPropertiesInRawRepresentation_NonStreaming() 424public async Task ChatOptions_DoNotOverwrite_NotNullPropertiesInRawRepresentation_Streaming() 505public async Task ChatOptions_Overwrite_NullPropertiesInRawRepresentation_NonStreaming() 582public async Task ChatOptions_Overwrite_NullPropertiesInRawRepresentation_Streaming() 660public async Task StronglyTypedOptions_AllSent() 749public async Task MultipleMessages_NonStreaming() 862public async Task MultiPartSystemMessage_NonStreaming() 959public async Task EmptyAssistantMessage_NonStreaming() 1057public async Task FunctionCallContent_NonStreaming() 1174public async Task HostedWebSearchTool_MapsToWebSearchOptions_NonStreaming() 1257public async Task FunctionCallContent_Streaming() 1370public async Task AssistantMessageWithBothToolsAndContent_NonStreaming() 1511public Task DataContentMessage_Image_AdditionalProperty_ChatImageDetailLevel_NonStreaming() 1515public Task DataContentMessage_Image_AdditionalProperty_StringDetail_NonStreaming() 1518private static async Task DataContentMessage_Image_AdditionalPropertyDetail_NonStreaming(object detailValue) 1626public async Task RequestHeaders_UserAgent_ContainsMEAI() 1639public async Task ChatOptions_ModelId_OverridesClientModel_NonStreaming() 1694public async Task ChatOptions_ModelId_OverridesClientModel_Streaming() 1829public async Task ReasoningOptions_Effort_ProducesExpectedJson(ReasoningEffort effort, string expectedEffortString) 1872public async Task ReasoningContent_NonStreaming_SurfacedAsTextReasoningContent() 1922public async Task ReasoningContent_Streaming_SurfacedAsTextReasoningContent() 1977public async Task OpenAIApiTypeTag_SetToChatCompletions(bool streaming)
OpenAIConversionTests.cs (18)
914public async Task AsChatResponse_ConvertsOpenAIStreamingChatCompletionUpdates() 945await Task.Yield(); 977public async Task AsChatResponseUpdatesAsync_ConvertsOpenAIStreamingResponseUpdates() 1112await Task.Yield(); 1128public async Task AsChatResponseUpdatesAsync_McpToolCallApprovalResponseItem_WithoutCorrelatedRequest_FallsBackToAIContent() 1152await Task.Yield(); 1663public async Task AsOpenAIStreamingChatCompletionUpdatesAsync_WithNullArgument_ThrowsArgumentNullException() 1670public async Task AsOpenAIStreamingChatCompletionUpdatesAsync_WithEmptyCollection_ReturnsEmptySequence() 1684public async Task AsOpenAIStreamingChatCompletionUpdatesAsync_WithRawRepresentation_ReturnsOriginal() 1710public async Task AsOpenAIStreamingChatCompletionUpdatesAsync_WithTextContent_CreatesValidUpdate() 1739public async Task AsOpenAIStreamingChatCompletionUpdatesAsync_WithUsageContent_CreatesUpdateWithUsage() 1772public async Task AsOpenAIStreamingChatCompletionUpdatesAsync_WithFunctionCallContent_CreatesUpdateWithToolCalls() 1810public async Task AsOpenAIStreamingChatCompletionUpdatesAsync_WithMultipleFunctionCalls_CreatesCorrectIndexes() 1841public async Task AsOpenAIStreamingChatCompletionUpdatesAsync_WithMixedContent_IncludesAllContent() 1879public async Task AsOpenAIStreamingChatCompletionUpdatesAsync_WithDifferentRoles_MapsCorrectly() 1905public async Task AsOpenAIStreamingChatCompletionUpdatesAsync_WithDifferentFinishReasons_MapsCorrectly() 1934public async Task AsOpenAIStreamingChatCompletionUpdatesAsync_WithMultipleUpdates_ProcessesAllCorrectly() 2263await Task.Yield();
OpenAIEmbeddingGeneratorTests.cs (5)
97public async Task GetEmbeddingsAsync_ExpectedRequestResponse() 151public async Task EmbeddingGenerationOptions_DoNotOverwrite_NotNullPropertiesInRawRepresentation() 220public async Task EmbeddingGenerationOptions_MissingUsage_Ignored() 262public async Task EmbeddingGenerationOptions_NullUsage_Ignored() 305public async Task RequestHeaders_UserAgent_ContainsMEAI()
OpenAIHostedFileClientIntegrationTests.cs (12)
27public async Task Upload_Download_Delete_Roundtrip() 84public async Task Upload_ListFiles_VerifyPresent() 115public async Task GetFileInfo_ReturnsMetadata() 150public async Task Delete_NonExistent_ReturnsFalse() 159public async Task GetFileInfo_NonExistent_ReturnsNull() 168public async Task Upload_DataContent_Extension() 196public async Task Download_AsDataContent_Extension() 225public async Task Upload_DownloadTo_Extension() 265public async Task Container_Upload_Download_Delete_Roundtrip() 335public async Task CodeInterpreter_ProducesDownloadableOutputs() 385public async Task CodeInterpreter_Upload_ProcessedByCodeInterpreter() 449await Task.Delay(delayMs * (i + 1));
OpenAIHostedFileClientTests.cs (40)
88public async Task Upload_DefaultPurpose_SendsUserData() 125public async Task Upload_ExplicitPurposeFineTune_SendsFineTune() 157public async Task Upload_NullContent_ThrowsArgumentNullException() 166public async Task Download_NullFileId_Throws() 175public async Task Download_WhitespaceFileId_Throws() 184public async Task GetFileInfo_ReturnsCorrectHostedFile() 214public async Task GetFileInfo_NotFound_ReturnsNull() 226public async Task GetFileInfo_NullFileId_Throws() 235public async Task GetFileInfo_WhitespaceFileId_Throws() 244public async Task ListFiles_ReturnsAllFiles() 280public async Task ListFiles_WithLimit_ReturnsLimitedCount() 303public async Task ListFiles_WithPurposeFilter() 326public async Task Delete_Success_ReturnsTrue() 346public async Task Delete_NotFound_ReturnsFalse() 358public async Task Delete_NullFileId_Throws() 367public async Task Delete_WhitespaceFileId_Throws() 376public async Task Upload_WithScope_OnFileOnlyClient_ThrowsInvalidOperation() 387public async Task Download_WithScope_OnFileOnlyClient_ThrowsInvalidOperation() 397public async Task GetFileInfo_WithScope_OnFileOnlyClient_ThrowsInvalidOperation() 407public async Task ListFiles_WithScope_OnFileOnlyClient_ThrowsInvalidOperation() 417public async Task Delete_WithScope_OnFileOnlyClient_ThrowsInvalidOperation() 427public async Task Upload_WithoutScope_OnContainerOnlyClient_ThrowsInvalidOperation() 438public async Task Download_WithoutScope_OnContainerOnlyClient_ThrowsInvalidOperation() 448public async Task GetFileInfo_WithoutScope_OnContainerOnlyClient_ThrowsInvalidOperation() 458public async Task ListFiles_WithoutScope_OnContainerOnlyClient_ThrowsInvalidOperation() 468public async Task Delete_WithoutScope_OnContainerOnlyClient_ThrowsInvalidOperation() 567public async Task Download_ReturnsStreamWithMediaTypeAndFileName() 601public async Task Download_StreamWriteThrowsNotSupportedException() 645public async Task Upload_WithScope_UsesContainerApi() 670public async Task Upload_WithScope_DoesNotDisposeCallerStream() 696public async Task Download_WithScope_UsesContainerApi() 727public async Task GetFileInfo_WithScope_ReturnsContainerFileInfo() 752public async Task GetFileInfo_WithScope_NotFound_ReturnsNull() 764public async Task ListFiles_WithScope_ReturnsContainerFiles() 799public async Task Delete_WithScope_Success_ReturnsTrue() 815public async Task Delete_WithScope_NotFound_ReturnsFalse() 827public async Task DefaultScope_IsUsedWhenNoScopeInOptions() 854public async Task Upload_WithScope_RawRepresentationFactory_IsInvoked() 903Task.FromResult(new HttpResponseMessage(HttpStatusCode.NotFound) { Content = new StringContent("{}") }); 909Task.FromResult(handler(request));
OpenAIRealtimeClientSessionTests.cs (8)
16public async Task GetService_ReturnsExpectedServices() 27public async Task GetService_NullServiceType_Throws() 34public async Task DisposeAsync_CanBeCalledMultipleTimes() 45public async Task Options_InitiallyNull() 58public async Task SendAsync_NullMessage_Throws() 65public async Task SendAsync_CancelledToken_ThrowsOperationCanceledException() 76public async Task SendAsync_NotConnected_ThrowsInvalidOperationException() 85public async Task ConnectAsync_CancelledToken_Throws()
OpenAIRealtimeClientTests.cs (1)
52public async Task CreateSessionAsync_Cancelled_Throws()
OpenAIRequestPoliciesTests.cs (6)
86public async Task AddPolicy_CustomUserAgent_ReplacesMeaiHeader() 102public async Task AddPolicy_CustomHeaderAdd_StacksWithMeaiUserAgent() 118public async Task NoPolicyRegistered_MeaiUserAgentStillEmitted() 133public async Task AddPolicy_Concurrent_AllPoliciesRetained() 138await Task.WhenAll(Enumerable.Range(0, Count).Select(i => 139Task.Run(() => policies.AddPolicy(new NoopPolicy()))));
OpenAIResponseClientIntegrationTests.cs (33)
31public override Task Caching_AfterFunctionInvocation_FunctionOutputUnchangedAsync() => Task.CompletedTask; 34public async Task UseCodeInterpreter_ProducesCodeExecutionResults() 78public async Task UseWebSearch_AnnotationsReflectResults() 139public async Task UseImageGeneration_ProducesImageContent(bool streaming, string imageModel) 187public async Task RemoteMCP_ListTools() 204public async Task RemoteMCP_CallTool_ApprovalNeverRequired() 211async Task RunAsync(bool streaming, bool requireSpecific) 242public async Task RemoteMCP_CallTool_ApprovalRequired() 251async Task RunAsync(bool streaming, bool requireSpecific, bool useConversationId) 311public async Task RemoteMCP_DeferLoadingTools() 352public async Task GetResponseAsync_BackgroundResponses() 373await Task.Delay(1000); 380public async Task GetResponseAsync_BackgroundResponses_WithFunction() 407await Task.Delay(1000); 415public async Task GetStreamingResponseAsync_BackgroundResponses() 436public async Task GetStreamingResponseAsync_BackgroundResponses_StreamResumption() 474public async Task GetStreamingResponseAsync_BackgroundResponses_WithFunction() 500public async Task RemoteMCP_Connector() 515async Task RunAsync(bool streaming, bool approval) 561public async Task ToolCallResult_TextContent() 581public async Task ToolCallResult_MultipleAIContents() 609public async Task ToolCallResult_ImageDataContent() 634public async Task ToolCallResult_PdfDataContent() 654public async Task ToolCallResult_MixedContentWithImage() 686public async Task ReasoningContent_NonStreaming_RoundtripsEncryptedContent() 766public async Task ReasoningContent_Streaming_RoundtripsEncryptedContent() 852public async Task UseToolSearch_WithDeferredFunctions() 888public async Task UseToolSearch_OnlyToolSearchNoFunctions_Throws() 906public async Task UseToolSearch_WithNonDeferredFunctionsOnly_Throws() 930public async Task UseToolSearch_DeferLoadingOnNonDeferrableTool_Throws() 956public async Task UseToolSearch_NamespaceWithDescription_RoundTrips() 998public async Task UseToolSearch_TwoNamespacesWithDescriptions_RoundTrips()
OpenAIResponseClientTests.cs (99)
76public async Task BasicRequestResponse_NonStreaming() 176public async Task BasicReasoningResponse_Streaming() 353public async Task ReasoningTextDelta_Streaming() 480public async Task ReasoningTextDelta_Streaming_PreservesEncryptedContent() 580public async Task EncryptedReasoning_Streaming_RoundTripsReasoningItemId() 669public async Task BasicRequestResponse_Streaming() 784public async Task MissingAbstractionResponse_NonStreaming() 924public async Task MissingAbstractionResponse_Streaming() 1026public async Task ChatOptions_StrictRespected() 1100public async Task ChatOptions_DoNotOverwrite_NotNullPropertiesInRawRepresentation_NonStreaming() 1271public async Task MultipleOutputItems_NonStreaming() 1389public async Task McpToolCall_ApprovalRequired_NonStreaming(string role) 1656public async Task ToolApprovalResponse_NonMcpToolCall_SilentlyIgnored_NonStreaming(string role) 1779public async Task McpToolCall_ApprovalNotRequired_NonStreaming(bool rawTool) 2041public async Task McpToolCall_ApprovalNotRequired_Streaming() 2454public async Task McpToolCall_ErrorResponse_NonStreaming(bool rawTool) 2649public async Task McpToolCall_WithAuthorizationTokenAndCustomHeaders_IncludesInRequest() 2740public async Task McpToolCall_WithCaseInsensitiveBearerToken_ExtractsToken(string authHeaderValue) 2821public async Task GetResponseAsync_BackgroundResponses_FirstCall() 2901public async Task GetResponseAsync_BackgroundResponses_PollingCall(ResponseStatus expectedStatus) 3011public async Task GetResponseAsync_BackgroundResponses_PollingCall_WithMessages() 3031public async Task GetStreamingResponseAsync_BackgroundResponses() 3153public async Task GetStreamingResponseAsync_BackgroundResponses_StreamResumption() 3254public async Task GetStreamingResponseAsync_BackgroundResponses_StreamResumption_WithMessages() 3281public async Task CodeInterpreterTool_NonStreaming() 3410public async Task CodeInterpreterTool_Streaming() 3635public async Task CodeInterpreterTool_Streaming_YieldsCodeDeltas() 3754public async Task RequestHeaders_UserAgent_ContainsMEAI() 3767public async Task ConversationId_AsResponseId_NonStreaming() 3825public async Task ConversationId_AsConversationId_NonStreaming() 3883public async Task ConversationId_WhenStoreDisabled_ReturnsNull_NonStreaming() 3945public async Task ConversationId_ChatOptionsOverridesRawRepresentationResponseId_NonStreaming() 4007public async Task ConversationId_RawRepresentationPreviousResponseIdTakesPrecedence_NonStreaming() 4069public async Task ConversationId_WhenStoreExplicitlyTrue_UsesResponseId_NonStreaming() 4131public async Task ConversationId_WhenStoreExplicitlyTrue_UsesResponseId_Streaming() 4212public async Task ConversationId_WhenStoreDisabled_ReturnsNull_Streaming() 4293public async Task ConversationId_ReturnsNullWhenResponseStoreFieldFalse_NonStreaming() 4352public async Task ConversationId_ReturnsNullWhenResponseStoreFieldFalse_Streaming() 4430public async Task ConversationId_AsConversationId_Streaming() 4508public async Task ConversationId_AsResponseId_Streaming() 4586public async Task ConversationId_RawRepresentationConversationIdTakesPrecedence_NonStreaming() 4648public async Task ChatOptions_ModelId_OverridesClientModel_NonStreaming() 4706public async Task ChatOptions_ModelId_OverridesClientModel_Streaming() 4778public async Task ToolCallResult_SingleTextContent_SerializesCorrectly() 4831public async Task ToolCallResult_MultipleTextContents_SerializesCorrectly() 4893public async Task ToolCallResult_DataContent_SerializesAsInputImage() 4951public async Task ToolCallResult_UriContent_SerializesAsInputImage() 5008public async Task ToolCallResult_HostedFileContent_SerializesCorrectly() 5065public async Task ToolCallResult_MixedContent_SerializesCorrectly() 5129public async Task ToolCallResult_DataContentPDF_SerializesAsInputFile() 5187public async Task ToolCallResult_ObjectSerialization_SerializesCorrectly() 5242public async Task ToolCallResult_StringFallback_SerializesCorrectly() 5297public async Task ToolCallResult_UriContentNonImage_SerializesAsInputFile() 5354public async Task ToolCallResult_HostedFileContentNonImage_SerializesAsInputFile() 5411public async Task ResponseWithEndUserId_IncludesInAdditionalProperties() 5443public async Task ResponseWithError_IncludesInAdditionalPropertiesAndMessage() 5481public async Task ResponseWithUsageDetails_ParsesTokenCounts() 5524public async Task UserMessageWithVariousContentTypes_ConvertsCorrectly() 5588public async Task NonStreamingResponseWithIncompleteReason_MapsFinishReason() 5621public async Task StreamingResponseWithQueuedUpdate_HandlesCorrectly() 5659public async Task StreamingResponseWithFailedUpdate_HandlesCorrectly() 5694public async Task StreamingResponseWithIncompleteUpdate_HandlesCorrectly() 5729public async Task StreamingResponseWithInProgressUpdate_HandlesCorrectly() 5767public async Task StreamingResponseWithRefusalUpdate_HandlesCorrectly() 5809public async Task GetContinuationToken_WithMessages_ThrowsException() 5825public async Task StreamingErrorUpdate_DocumentedFormat_ParsesCorrectly() 5868public async Task StreamingErrorUpdate_ActualErroneousFormat_ParsesCorrectly() 5911public async Task StreamingErrorUpdate_NoErrorInformation_HandlesGracefully() 5954public async Task StreamingResponseWithAnnotations_HandlesCorrectly() 5993public async Task StreamingResponseWithFunctionCallOutput_YieldsFunctionResultContent() 6104public async Task UserMessageWithEmptyText_CreatesEmptyInputPart() 6135public async Task ResponseWithRefusalContent_ParsesCorrectly() 6179public async Task ResponseWithInputImageHttpUrl_ParsesAsUriContent() 6242public async Task ResponseWithInputImageDataUri_ParsesAsDataContent() 6305public async Task HostedImageGenerationTool_NonStreaming() 6398public async Task HostedImageGenerationTool_Streaming() 6508public async Task HostedImageGenerationTool_StreamingMultipleImages() 6657public async Task ReasoningOptions_EffortAndOutput_ProducesExpectedJson( 6715public async Task OpenAIApiTypeTag_SetToResponses(bool streaming) 6793public async Task ApplyPatchTool_NonStreaming() 6981public async Task WebSearchTool_NonStreaming() 7182public async Task WebSearchTool_Streaming() 7316public async Task ToolSearchTool_OnlyToolSearch_NonStreaming() 7374public async Task ToolSearchTool_SearchableFunctionsDeferred_NonStreaming() 7467public async Task ToolSearchTool_MixedDeferredAndNonDeferredFunctions_NonStreaming() 7559public async Task ToolSearchTool_NoFunctionTools_NonStreaming() 7624public async Task ToolSearchTool_NamespaceGrouping_NonStreaming() 7737public async Task ToolSearchTool_NamespaceAllDeferred_NonStreaming() 7836public async Task ToolSearchTool_MultipleNamespaces_NonStreaming() 7942public async Task ToolSearchTool_SameNamespaceMerged_NonStreaming() 8042public async Task ToolSearchTool_ToolClaimedByFirstNamespace_NonStreaming() 8128public async Task ToolSearchTool_McpToolNamespaceGrouping_NonStreaming() 8219public async Task ToolSearchTool_NonDeferrableToolStaysTopLevel_NonStreaming() 8305public async Task ToolSearchTool_NamespaceWithDescription_NonStreaming() 8424public async Task ToolSearchTool_NamespaceDescriptionAloneDoesNotWrap_NonStreaming() 8521public async Task ToolSearchTool_NamespaceWithDescription_FirstWins_NonStreaming() 8632public async Task ToolSearchTool_NamespaceDescription_FirstNonEmptyWins_NonStreaming() 8744public async Task Tool_SchemaWithObjectAdditionalProperties_FunctionCallArgumentsReceived() 8849public async Task Tool_SchemaWithObjectAdditionalProperties_Streaming_FunctionCallArgumentsReceived()
OpenAISpeechToTextClientTests.cs (12)
70public async Task GetTextAsync_BasicRequestResponse(string? speechLanguage, string? textLanguage) 105public async Task GetTextAsync_Cancelled_Throws() 119public async Task GetStreamingTextAsync_Cancelled_Throws() 141public async Task GetStreamingTextAsync_BasicRequestResponse(string? speechLanguage, string? textLanguage) 178public async Task GetStreamingTextAsync_BasicTranslateRequestResponse() 213public async Task GetTextAsync_Transcription_StronglyTypedOptions_AllSent() 253public async Task GetTextAsync_Translation_StronglyTypedOptions_AllSent() 291public async Task GetStreamingTextAsync_SegmentUpdates_SurfaceTimingMetadata() 379public async Task GetTextAsync_DetectsAudioFormatFromMagicBytes(byte[] header, string expectedFilename) 408public async Task GetStreamingTextAsync_DetectsAudioFormatFromMagicBytes(byte[] header, string expectedFilename) 440public async Task GetTextAsync_StreamPositionNotAtZero_SkipsDetectionAndDefaultsToMp3() 471public async Task GetStreamingTextAsync_StreamPositionNotAtZero_SkipsDetectionAndDefaultsToMp3()
OpenAITextToSpeechClientIntegrationTests.cs (1)
20public async Task GetStreamingAudioAsync_StreamingModel_ReturnsMultipleUpdatesWithUsage()
OpenAITextToSpeechClientTests.cs (9)
65public async Task GetAudioAsync_DefaultVoice_BasicRequestResponse() 93public async Task GetAudioAsync_CustomVoice_SetsVoice() 121public async Task GetAudioAsync_SpeedMapping_SetsSpeedRatio() 154public async Task GetAudioAsync_AudioFormat_SetsFormatAndMediaType(string audioFormat, string expectedMediaType) 183public async Task GetAudioAsync_StronglyTypedOptions_AllSent() 219public async Task GetAudioAsync_Cancelled_Throws() 232public async Task GetStreamingAudioAsync_Cancelled_Throws() 249public async Task GetStreamingAudioAsync_FallsBackToNonStreaming() 281public async Task GetStreamingAudioAsync_StreamingModel_YieldsMultipleChunksAndUsage()
Microsoft.Extensions.AI.Templates.Tests (7)
AIChatWebExecutionTests.cs (3)
77public async Task TestAllSupportedConfigurations(params string[] args) 90public async Task CreateRestoreAndBuild_AspireProjectName() 115public async Task CreateRestoreAndBuild_AspireProjectName_Variants(string projectName)
AIChatWebSnapshotTests.cs (1)
35public async Task RunSnapshotTests(params string[] templateArgs)
TemplateExecutionTestBase.cs (1)
33protected async Task CreateRestoreAndBuild(string projectName, string[] args, string? startupProjectRelativePath = null)
TemplateExecutionTestClassFixtureBase.cs (2)
117public async Task RestoreProjectAsync(Project project) 134public async Task BuildProjectAsync(Project project)
Microsoft.Extensions.AI.Tests (653)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (22)
20public async Task SuccessUsage_Default() 71return Task.FromResult(expectedResponse); 97public async Task SuccessUsage_NoJsonSchema() 132return Task.FromResult(expectedResponse); 158public async Task WrapsNonObjectValuesInDataProperty() 184return Task.FromResult(expectedResponse); 193public async Task OnlyUsesLastMessage() 228return Task.FromResult(expectedResponse); 237public async Task FailureUsage_InvalidJson() 242GetResponseAsyncCallback = (messages, options, cancellationToken) => Task.FromResult(expectedResponse), 256public async Task FailureUsage_NullJson() 261GetResponseAsyncCallback = (messages, options, cancellationToken) => Task.FromResult(expectedResponse), 275public async Task FailureUsage_NoJsonInResponse() 280GetResponseAsyncCallback = (messages, options, cancellationToken) => Task.FromResult(expectedResponse), 294public async Task CanUseNativeStructuredOutputWithSanitizedTypeName() 307return Task.FromResult(expectedResponse); 328public async Task CanUseNativeStructuredOutputWithArray() 336GetResponseAsyncCallback = (messages, options, cancellationToken) => Task.FromResult(expectedResponse) 356public async Task CanSpecifyCustomJsonSerializationOptions() 397return Task.FromResult(expectedResponse); 411public async Task HandlesBackendReturningMultipleObjects() 425return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, resultDuplicatedJson)));
ChatCompletion\ConfigureOptionsChatClientTests.cs (3)
33public async Task ConfigureOptions_ReturnedInstancePassedToNextClient(bool nullProvidedOptions) 47return Task.FromResult(expectedResponse); 93await Task.Yield();
ChatCompletion\DistributedCachingChatClientTest.cs (29)
41public async Task CachesSuccessResultsAsync(bool conversationIdSet, bool customCaching) 82return Task.FromResult(expectedResponse); 130public async Task AllowsConcurrentCallsAsync() 168public async Task DoesNotCacheExceptionResultsAsync() 200public async Task DoesNotCacheCanceledResultsAsync() 241public async Task StreamingCachesSuccessResultsAsync(bool conversationIdSet) 309public async Task StreamingCoalescesConsecutiveTextChunksAsync(bool? coalesce) 364public async Task StreamingCoalescingPropagatesMetadataAsync() 430public async Task StreamingAllowsConcurrentCallsAsync() 458var result1Assertion = AssertResponsesEqualAsync(expectedResponse, result1); 459var result2Assertion = AssertResponsesEqualAsync(expectedResponse, result2); 474public async Task StreamingDoesNotCacheExceptionResultsAsync() 483return ToAsyncEnumerableAsync<ChatResponseUpdate>(Task.CompletedTask, 512public async Task StreamingDoesNotCacheCanceledResultsAsync() 523innerCallCount == 1 ? completionTcs.Task : Task.CompletedTask, 549public async Task CacheKeyVariesByChatOptionsAsync() 559await Task.Yield(); 600public async Task CacheKeyVariesByAdditionalKeyValuesAsync() 610await Task.Yield(); 646public async Task SubclassCanOverrideCacheKeyToVaryByChatOptionsAsync() 656await Task.Yield(); 682public async Task CanCacheCustomContentTypesAsync() 711return Task.FromResult(expectedResponse); 734public async Task CanResolveIDistributedCacheFromDI() 744return Task.FromResult(new ChatResponse( 776private static IAsyncEnumerable<T> ToAsyncEnumerableAsync<T>(Task preTask, IEnumerable<T> valueFactories) 779private static async IAsyncEnumerable<T> ToAsyncEnumerableAsync<T>(Task preTask, IEnumerable<Func<T>> values) 785await Task.Yield(); 831private static async Task AssertResponsesEqualAsync(IReadOnlyList<ChatResponseUpdate> expected, IAsyncEnumerable<ChatResponseUpdate> actual)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (39)
19public async Task AllFunctionCallsReplacedWithApprovalsWhenAllRequireApprovalAsync(bool useAdditionalTools) 59public async Task AllFunctionCallsReplacedWithApprovalsWhenAnyRequireApprovalAsync() 100public async Task AllFunctionCallsReplacedWithApprovalsWhenAnyRequestOrAdditionalRequireApprovalAsync(bool additionalToolsRequireApproval) 152public async Task RequiresConfirmation_IsTrueForApprovalRequiredFunctionNestedInDelegatingWrapperAsync() 198public async Task RequiresConfirmation_IsFalseForFunctionCallWithNoMatchingToolWhenPeerRequiresApprovalAsync() 243public async Task ApprovedApprovalResponsesAreExecutedAsync() 294public async Task ApprovedApprovalResponsesAreGroupedWhenMessageIdIsNullAsync() 347public async Task ApprovedApprovalResponsesFromSeparateFCCMessagesAreExecutedAsync() 406public async Task RejectedApprovalResponsesAreFailedAsync() 465public async Task MixedApprovedAndRejectedApprovalResponsesAreExecutedAndFailedAsync() 529public async Task RejectedApprovalResponsesWithCustomReasonAsync() 594public async Task MixedApprovalResponsesWithCustomAndDefaultReasonsAsync() 688public async Task RejectedApprovalResponsesWithEmptyOrWhitespaceReasonUsesDefaultMessageAsync(string? reason) 745public async Task ApprovedInputsAreExecutedAndFunctionResultsAreConvertedAsync() 799public async Task AlreadyExecutedApprovalsAreIgnoredAsync() 871public async Task RejectionSetsInformationalOnlyOnBothRequestAndResponseFccInstancesAsync(bool streaming) 905Task.FromResult(new ChatResponse([new ChatMessage(ChatRole.Assistant, "world")])), 941public async Task MixedInformationalOnlyWorkaroundWithMiddlewareAsync(bool streaming) 985Task.FromResult(new ChatResponse([new ChatMessage(ChatRole.Assistant, "world")])), 1015public async Task MixedApprovalRequiredToolsWithNonApprovalRequiringFunctionCallAsync() 1070public async Task ApprovalRequestWithoutApprovalResponseThrowsAsync() 1100public async Task ApprovedApprovalResponsesWithoutApprovalRequestAreExecutedAsync() 1146public async Task FunctionCallContentIsNotPassedToDownstreamServiceWithServiceThreadsAsync() 1190public async Task ApprovedResponsesStayAdjacentToToolCallWhenTrailingMessagesPresentWithServiceThreadsAsync() 1239public async Task ApprovedResponseStaysAdjacentToToolCallWhenApprovalMessageHasOtherContentWithServiceThreadsAsync() 1287public async Task ApprovedResponsesStayAdjacentToToolCallWhenTrailingMessagesPresentWithClientHistoryAsync() 1341public async Task ApprovedResponseStaysAdjacentToToolCallWhenApprovalMessageHasOtherContentWithClientHistoryAsync() 1392public async Task ApprovedResponseThatRequestsTerminationStopsBeforeCallingInnerClientAsync() 1456public async Task FunctionCallContentIsBufferedUntilEndOfStreamWhenStreamingAsync() 1478await Task.Yield(); 1531public async Task FunctionCalsAreBufferedUntilApprovalRequirementEncounteredWhenStreamingAsync() 1554await Task.Yield(); 1629public async Task FunctionCallsWithInformationalOnlyTrueAreNotReplacedWithApprovalsAsync(bool streaming) 1670public async Task ApprovalResponsePreservesOriginalRequestMessageMetadata() 1721public async Task FunctionCallReplacedWithApproval_MixedWithMcpApprovalAsync(bool useAdditionalTools) 1764public async Task ApprovedApprovalResponseIsExecuted_MixedWithMcpApprovalAsync(bool useAdditionalTools) 1846public async Task RejectedApprovalResponses_MixedWithMcpApprovalAsync(bool useAdditionalTools, bool approveFuncCall, bool approveMcpCall) 1974await Task.Yield(); 2082await Task.Yield();
ChatCompletion\FunctionInvokingChatClientTests.cs (102)
79public async Task SupportsSingleFunctionCallPerRequestAsync() 111public async Task SupportsToolsProvidedByAdditionalTools(bool provideOptions) 143public async Task PrefersToolsProvidedByChatOptions() 178public async Task SupportsMultipleFunctionCallsPerRequestAsync(bool concurrentInvocation) 226public async Task ParallelFunctionCallsMayBeInvokedConcurrentlyAsync() 274public async Task ConcurrentInvocationOfParallelCallsDisabledByDefaultAsync() 285await Task.Delay(100); 315public async Task FunctionInvokerDelegateOverridesHandlingAsync() 360public async Task FunctionReturningFunctionResultContentWithMatchingCallId_UsesItDirectly(bool streaming) 379return Task.FromResult(new ChatResponse( 384return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "done"))); 441public async Task FunctionReturningFunctionResultContentWithMismatchedCallId_WrapsIt(bool streaming) 460return Task.FromResult(new ChatResponse( 465return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "done"))); 522public async Task FunctionReturningDerivedFunctionResultContent_PropagatesInstanceToInnerClient(bool streaming) 541return Task.FromResult(new ChatResponse( 546return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "done"))); 616public async Task ContinuesWithSuccessfulCallsUntilMaximumIterations() 657public async Task LastIteration_RemovesFunctionDeclarationTools_NonStreaming() 669return Task.FromResult(new ChatResponse(message)); 701public async Task LastIteration_RemovesFunctionDeclarationTools_Streaming() 745public async Task LastIteration_PreservesNonFunctionDeclarationTools() 760return Task.FromResult(new ChatResponse(message)); 765return Task.FromResult(new ChatResponse(message)); 794public async Task LastIteration_DoesNotModifyOriginalOptions() 805return Task.FromResult(new ChatResponse(message)); 832public async Task ContinuesWithFailingCallsUntilMaximumConsecutiveErrors(bool allowConcurrentInvocation) 913public async Task CanFailOnFirstException(bool allowConcurrentInvocation) 969public async Task KeepsFunctionCallingContent() 1008public async Task ExceptionDetailsOnlyReportedWhenRequestedAsync(bool detailedErrors) 1038public async Task FunctionInvocationsLogged(LogLevel level) 1060async Task InvokeAsync(Func<IServiceProvider, Task> work) 1093public async Task FunctionInvocationTrackedWithActivity(bool enableTelemetry, bool enableSensitiveData) 1117async Task InvokeAsync(Func<Task> work) 1168public async Task SupportsConsecutiveStreamingUpdatesWithFunctionCalls() 1226public async Task AllResponseMessagesReturned() 1242await Task.Yield(); 1266public async Task CanAccesssFunctionInvocationContextFromFunctionCall() 1272await Task.Yield(); 1316async Task InvokeAsync(Func<Task<List<ChatMessage>>> work) 1342public async Task HaltFunctionCallingAfterTermination() 1370return Task.FromResult(new ChatResponse(message)); 1395public async Task PropagatesResponseConversationIdToOptions() 1431Task.FromResult(callback(chatContents, chatOptions, cancellationToken)), 1445public async Task FunctionInvocations_PassesServices() 1471public async Task FunctionInvocations_InvokedOnOriginalSynchronizationContext() 1495await Task.Delay(1, cancellationToken); 1504await Task.Delay(1, cancellationToken); 1517public async Task TerminateOnUnknownCalls_ControlsBehaviorForUnknownFunctions(bool terminateOnUnknown) 1571public async Task RequestsWithOnlyFunctionDeclarations_TerminatesRegardlessOfTerminateOnUnknownCalls(bool terminateOnUnknown) 1595public async Task MixedKnownFunctionAndDeclaration_TerminatesWithoutInvokingKnown() 1630public async Task ClonesChatOptionsAndResetContinuationTokenForBackgroundResponsesAsync() 1648return Task.FromResult(new ChatResponse { Messages = messages }); 1674public async Task DoesNotCreateOrchestrateToolsSpanWhenInvokeAgentIsParent(string displayName) 1722public async Task StreamingPreservesTraceContextWhenInvokeAgentWithNameIsParent(string displayName) 1785public async Task CreatesOrchestrateToolsSpanWhenParentIsNotInvokeAgent(string displayName) 1827public async Task UsesAgentActivitySourceWhenInvokeAgentIsParent(string displayName) 1876public async Task SensitiveDataPropagatesFromAgentActivityWhenInvokeAgentIsParent( 1950public async Task CreatesOrchestrateToolsSpanWhenNoInvokeAgentParent(bool streaming) 1996public async Task InformationalOnly_SetToTrueAfterProcessing() 2024public async Task InformationalOnly_IgnoresFunctionCallsWithInformationalOnlyTrue(bool streaming) 2039await Task.Yield(); 2070public async Task InformationalOnly_ProcessesMixedFunctionCalls(bool streaming) 2092await Task.Yield(); 2140public async Task InformationalOnly_MultipleFunctionInvokingChatClientsOnlyProcessOnce() 2155await Task.Yield(); 2219await Task.Yield(); 2311await Task.Yield(); 2351public async Task RespectsChatOptionsToolsModificationsByFunctionTool_AddTool(bool streaming) 2382await Task.Yield(); 2448public async Task RespectsChatOptionsToolsModificationsByFunctionTool_RemoveTool(bool streaming) 2476await Task.Yield(); 2550public async Task RespectsChatOptionsToolsModificationsByFunctionTool_ReplaceTool(bool streaming) 2584await Task.Yield(); 2655public async Task RespectsChatOptionsToolsModificationsByFunctionTool_AddToolWithAdditionalTools(bool streaming) 2682await Task.Yield(); 2758public async Task RespectsChatOptionsToolsModificationsByFunctionTool_AddToolOverridingAdditionalTool(bool streaming) 2786await Task.Yield(); 2860public async Task ToolMapNotRefreshedWhenToolsUnchanged(bool streaming) 2883await Task.Yield(); 2935public async Task RespectsChatOptionsToolsModificationsByFunctionTool_ClearAllTools(bool streaming) 2962await Task.Yield(); 3035public async Task RespectsChatOptionsToolsModificationsByFunctionTool_AddApprovalRequiredTool(bool streaming) 3063await Task.Yield(); 3138public async Task RespectsChatOptionsToolsModificationsByFunctionTool_ReplaceWithApprovalRequiredTool(bool streaming) 3169await Task.Yield(); 3244public async Task LogsFunctionNotFound() 3273public async Task LogsNonInvocableFunction() 3305public async Task LogsFunctionRequestedTermination() 3338public async Task LogsFunctionRequiresApproval() 3376public async Task LogsProcessingApprovalResponse() 3386Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "world"))) 3413public async Task LogsFunctionRejected() 3423Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "world"))) 3457public async Task ServerHandledFunctionCalls_MarkedAsInformationalOnly(bool streaming) 3471await Task.Yield(); 3510public async Task ServerHandledFunctionCalls_MixedWithLocalCalls(bool streaming) 3531await Task.Yield(); 3588public async Task ServerHandledFunctionCalls_NoMatchingFRC_StillInvoked(bool streaming) 3603await Task.Yield();
ChatCompletion\ImageGeneratingChatClientTests.cs (20)
32public async Task GetResponseAsync_WithoutImageGenerationTool_PassesThrough() 39return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "test response"))); 64public async Task GetResponseAsync_WithImageGenerationTool_ReplacesTool() 76return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "test response"))); 111public async Task GetResponseAsync_WithMixedTools_ReplacesOnlyImageGenerationTool() 123return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "test response"))); 210public async Task GetStreamingResponseAsync_WithImageGenerationTool_ReplacesTool() 228await Task.Yield(); 254public async Task GetResponseAsync_WithNullOptions_DoesNotThrow() 261return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "test response"))); 274public async Task GetResponseAsync_WithEmptyTools_DoesNotModify() 284return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "test response"))); 308public async Task GetResponseAsync_WithFunctionCallContent_ReplacesWithImageGenerationToolCallContent() 318return Task.FromResult(new ChatResponse(responseMessage)); 344public async Task GetStreamingResponseAsync_WithFunctionCallContent_ReplacesWithImageGenerationToolCallContent() 358await Task.Yield(); 391public async Task GetResponseAsync_FunctionCallContent_SurroundingContentPreservedInOrder(string position) 413return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, contents))); 462public async Task GetStreamingResponseAsync_FunctionCallContent_SurroundingContentPreservedInOrder(string position) 477await Task.Yield();
ChatCompletion\LoggingChatClientTests.cs (4)
47public async Task GetResponseAsync_LogsResponseInvocationAndCompletion(LogLevel level) 59return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "blue whale"))); 95public async Task GetResponseStreamingStreamAsync_LogsUpdateReceived(LogLevel level) 107await Task.Yield();
ChatCompletion\OpenTelemetryChatClientTests.cs (27)
27public async Task ExpectedInformationLogged_Async(bool enableSensitiveData, bool streaming) 40await Task.Yield(); 69await Task.Yield(); 73await Task.Yield(); 155await Task.Yield(); 390public async Task AllOfficialOtelContentPartTypes_SerializedCorrectly(bool streaming) 403await Task.Yield(); 421await Task.Yield(); 458await Task.Yield(); 574public async Task UnknownContentTypes_Ignored() 587await Task.Yield(); 644public async Task ServerToolCallContentTypes_SerializedCorrectly(bool streaming) 657await Task.Yield(); 675await Task.Yield(); 712await Task.Yield(); 809public async Task McpServerToolApprovalContentTypes_SerializedCorrectly() 822await Task.Yield(); 896public async Task StreamingChunkMetrics_RecordedForStreamingCalls() 916await Task.Yield(); 918await Task.Yield(); 920await Task.Yield(); 966public async Task StreamingChunkMetrics_NotRecordedForNonStreamingCalls() 979await Task.Yield(); 1005public async Task ExceptionLogged_Async(bool streaming) 1063public async Task Streaming_NoListeners_PreservesActivityCurrent() 1103await Task.Yield(); 1105await Task.Yield();
ChatCompletion\ReducingChatClientTests.cs (7)
33public async Task GetResponseAsync_CallsReducerBeforeInnerClient(bool streaming) 59return Task.FromResult(expectedResponse); 96public async Task UseChatReducer_WithReducerFromServices() 110return Task.FromResult(new ChatResponse()); 139public async Task UseChatReducer_WithConfigureCallback() 148Task.FromResult(new ChatResponse()) 177return Task.FromResult(ReducedMessages ?? messages);
ChatCompletion\UseDelegateChatClientTests.cs (8)
26public async Task Shared_ContextPropagated() 42return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "hello"))); 76public async Task GetResponseFunc_ContextPropagated() 91return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "hello"))); 118public async Task GetStreamingResponseFunc_ContextPropagated() 169public async Task BothGetResponseAndGetStreamingResponseFuncs_ContextPropagated() 184return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "non-streaming hello"))); 243await Task.Yield();
ChatReduction\MessageCountingChatReducerTests.cs (9)
32public async Task ReduceAsync_ThrowsOnNullMessages() 39public async Task ReduceAsync_HandlesEmptyMessages() 47public async Task ReduceAsync_PreservesFirstSystemMessage() 82public async Task ReduceAsync_OnlyFirstSystemMessageIsPreserved() 121public async Task ReduceAsync_IgnoresFunctionCallsAndResults() 160public async Task ReduceAsync_RespectsTargetCount(int targetCount, int messageCount, int expectedCount) 196public async Task ReduceAsync_HandlesOnlySystemMessage() 217public async Task ReduceAsync_HandlesOnlyFunctionMessages() 235public async Task ReduceAsync_HandlesTargetCountOfOne()
ChatReduction\SummarizingChatReducerTests.cs (19)
43public async Task ReduceAsync_ThrowsOnNullMessages() 51public async Task ReduceAsync_HandlesEmptyMessages() 62public async Task ReduceAsync_PreservesSystemMessage() 76Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "Summary of conversation"))); 87public async Task ReduceAsync_PreservesCompleteToolCallSequence() 108return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "Asked about time"))); 131public async Task ReduceAsync_PreservesUserMessageWhenWithinThreshold() 156return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "Summary of first exchange"))); 177public async Task ReduceAsync_ExcludesToolCallsFromSummarizedPortion() 209return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "User asked about weather in Seattle and New York."))); 234public async Task ReduceAsync_RespectsTargetAndThresholdCounts(int targetCount, int thresholdCount, int messageCount, bool shouldSummarize) 249return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "Summary"))); 269public async Task ReduceAsync_CancellationTokenIsRespected() 287return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "Summary"))); 295public async Task ReduceAsync_OnlyFirstSystemMessageIsPreserved() 310Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "Summary"))); 323public async Task CanHaveSummarizedConversation() 350return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, Summary))); 377return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, Summary)));
ChatRouting\FailoverChatClientTests.cs (49)
31public async Task Failover_RejectsNullMessagesForNonStreamingAndStreaming() 44public async Task InitialSelectionFailureDoesNotReportAttempt(bool streaming) 71public async Task InitialSelectionFailureWithCallerCancellationPropagatesSelectionFailure(bool streaming) 98public async Task NullSelectionDoesNotReportAttempt(bool streaming) 116public async Task Failover_RetrySelectionFailureReportsOnlyCompletedAttempt() 145public async Task TerminalRoutingUpdateFailureReplacesRequestFailure() 171public async Task NonterminalRoutingUpdateFailureStopsWithoutAnotherUpdate() 204public async Task Dispatch_ConfiguredClientPreservesAndOverridesRequestOptions() 212return Task.FromResult(new ChatResponse()); 236public async Task Failover_UsesRequestOptionsForEveryAttempt(bool streaming) 263return Task.FromResult(expected); 294public async Task Failover_SelectionAndInvocationShareRequestOptions(bool streaming) 303return Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "ok"))); 332public async Task Failure_Propagates() 361public async Task Failover_UpdateChangesStateBeforeNextSelection() 370GetResponseAsyncCallback = (_, _, _) => Task.FromResult(expected), 410public async Task Failover_CanRetrySameClient() 418: Task.FromResult(new ChatResponse()), 429public async Task MaximumAttemptsPerRequest_AllowsSuccessAtLimit() 438: Task.FromResult(expected), 453public async Task MaximumAttemptsPerRequest_RethrowsLastFailure() 482public async Task Failover_NullResponseIsReturnedWithoutFailover() 486GetResponseAsyncCallback = (_, _, _) => Task.FromResult<ChatResponse>(null!), 511public async Task Cancellation_DoesNotReselect() 536public async Task Failover_CancellationReportsTerminalUpdate() 564public async Task Failover_CancellationDuringUpdateIsObservedByNextAttempt() 609public async Task Streaming_PreOutputFailurePropagates() 637public async Task Streaming_FallsBackBeforeFirstUpdate() 659public async Task Streaming_CancellationDuringUpdateIsObservedByNextAttempt() 705public async Task Streaming_CancellationDoesNotSelectNext() 740public async Task OperationCanceledException_CanTriggerFailover() 753return Task.FromResult(expected); 765public async Task Streaming_OperationCanceledExceptionCanTriggerFailover() 790public async Task Streaming_DisposalCancellationCanTriggerFailover() 819public async Task Streaming_MaximumAttemptsPerRequest_RethrowsLastFailure() 847public async Task Streaming_StreamCreationFailureFallsBack() 869public async Task Streaming_EnumeratorCreationFailureFallsBack() 892public async Task Streaming_CurrentFailureFallsBackBeforeOutput() 927public async Task Streaming_CurrentFailureCancellationIsObservedByNextAttempt() 975public async Task Streaming_EmptyStreamDisposalFailureFallsBack() 1015public async Task Streaming_MidStreamFailureIsObservedAndDoesNotReselect() 1040async Task ConsumeAsync() 1062public async Task Streaming_CompletionNotifiesHook() 1091public async Task Streaming_EmptyCompletionNotifiesHook() 1118public async Task Streaming_CallerStopsEarlyNotifiesHookAsIncomplete() 1155private static async Task ConsumeOneAsync(IAsyncEnumerable<ChatResponseUpdate> updates) 1165await Task.Yield(); 1172await Task.Yield(); 1184await Task.Yield();
ChatRouting\OrderedFailoverChatClientTests.cs (22)
27public async Task OrderedFailover_TriesClientsInOrderAndSkipsFailures() 44return Task.FromResult(expected); 56public async Task OrderedFailover_InvokesRepeatedClientOncePerPosition() 67: Task.FromResult(expected); 87public async Task OrderedFailover_RepeatedClientExhaustionRethrowsLastFailure() 108public async Task OrderedFailover_ExhaustionRethrowsLastFailure() 127public async Task OrderedFailover_StateIsScopedToOneRequest() 140GetResponseAsyncCallback = (_, _, _) => Task.FromResult(new ChatResponse()), 151public async Task OrderedFailover_ConcurrentRequestsHaveIndependentState() 175return Task.FromResult(new ChatResponse()); 185_ = await Task.WhenAll(requests); 192public async Task OrderedFailover_ReleasesStateWhenStreamingEnds() 215public async Task OrderedFailover_SnapshotsConfiguredClients() 220GetResponseAsyncCallback = (_, _, _) => Task.FromResult(expected), 232public async Task OrderedFailover_UsesEachConfiguredClient() 251return Task.FromResult(new ChatResponse()); 275public async Task OrderedFailover_StreamingFallsBackBeforeFirstUpdate() 294public async Task OrderedFailover_CancellationDoesNotFallback() 308return Task.FromResult(new ChatResponse()); 352public async Task NestedRouters_ReturnLeafResponse() 357GetResponseAsyncCallback = (_, _, _) => Task.FromResult(expected), 384Task.FromResult(new ChatResponse());
ChatRouting\SemanticRoutingChatClientTests.cs (13)
74public async Task SemanticRouting_SelectsBestProfileAndCachesIndex() 93return Task.FromResult(new GeneratedEmbeddings<Embedding<float>>( 100GetResponseAsyncCallback = (_, _, _) => Task.FromResult(expected), 105Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "writing"))), 129public async Task SemanticRouting_AggregatesGlobalTopKByClient( 143Task.FromResult(new GeneratedEmbeddings<Embedding<float>>( 149Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "code"))), 154Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "writing"))), 176public async Task SemanticRouting_UsesDefaultBelowThreshold() 186Task.FromResult(new GeneratedEmbeddings<Embedding<float>>( 192Task.FromResult(new ChatResponse(new ChatMessage(ChatRole.Assistant, "profiled"))), 197GetResponseAsyncCallback = (_, _, _) => Task.FromResult(expected), 245Task.FromResult(new ChatResponse());
Embeddings\ConfigureOptionsEmbeddingGeneratorTests.cs (2)
31public async Task ConfigureOptions_ReturnedInstancePassedToNextClient(bool nullProvidedOptions) 44return Task.FromResult(expectedEmbeddings);
Embeddings\DistributedCachingEmbeddingGeneratorTest.cs (15)
44public async Task CachesSuccessResultsAsync() 56return Task.FromResult<GeneratedEmbeddings<Embedding<float>>>([_expectedEmbedding]); 82public async Task SupportsPartiallyCachedBatchesAsync() 102return Task.FromResult<GeneratedEmbeddings<Embedding<float>>>(new(values.Select(i => expected[int.Parse(i)]))); 136public async Task AllowsConcurrentCallsAsync() 174public async Task DoesNotCacheExceptionResultsAsync() 205public async Task DoesNotCacheCanceledResultsAsync() 243public async Task CacheKeyVariesByEmbeddingOptionsAsync() 253await Task.Yield(); 294public async Task CacheKeyVariesByAdditionalKeyValuesAsync() 304await Task.Yield(); 337public async Task SubclassCanOverrideCacheKeyToVaryByOptionsAsync() 347await Task.Yield(); 373public async Task CanResolveIDistributedCacheFromDI() 383return Task.FromResult<GeneratedEmbeddings<Embedding<float>>>([_expectedEmbedding]);
Embeddings\LoggingEmbeddingGeneratorTests.cs (2)
46public async Task GetResponseAsync_LogsResponseInvocationAndCompletion(LogLevel level) 58return Task.FromResult(new GeneratedEmbeddings<Embedding<float>>([new Embedding<float>(new float[] { 1f, 2f, 3f })]));
Embeddings\OpenTelemetryEmbeddingGeneratorTests.cs (3)
21public async Task ExpectedInformationLogged_Async(string? perRequestModelId, bool enableSensitiveData) 37await Task.Yield(); 99public async Task ExceptionLogged_Async()
Embeddings\UseDelegateEmbeddingGeneratorTests.cs (2)
25public async Task GenerateFunc_ContextPropagated() 41return Task.FromResult(expectedEmbeddings);
Files\LoggingHostedFileClientTests.cs (18)
50public async Task UploadAsync_LogsInvocationAndCompletion(LogLevel level) 61Task.FromResult(new HostedFileContent("file-123") { Name = "test.txt" }), 113public async Task DownloadAsync_LogsInvocationAndCompletion(LogLevel level) 121Task.FromResult<HostedFileDownloadStream>(new TestDownloadStream(new byte[] { 1 })), 162public async Task GetFileInfoAsync_LogsInvocationAndCompletion(LogLevel level) 170Task.FromResult<HostedFileContent?>(new HostedFileContent("file-456") { Name = "report.pdf" }), 220public async Task ListFilesAsync_LogsInvocationAndCompletion(LogLevel level) 232await Task.Yield(); 280public async Task DeleteAsync_LogsInvocationAndCompletion(LogLevel level) 287DeleteAsyncCallback = (fileId, options, ct) => Task.FromResult(true), 329public async Task UploadAsync_OnException_LogsError() 359public async Task UploadAsync_OnCancellation_LogsCanceled() 385public async Task DownloadAsync_OnException_LogsError() 414public async Task GetFileInfoAsync_OnException_LogsError() 443public async Task DeleteAsync_OnException_LogsError() 472public async Task DeleteAsync_OnCancellation_LogsCanceled() 497public async Task ListFilesAsync_OnIterationException_LogsError() 509await Task.Yield();
Files\OpenTelemetryHostedFileClientTests.cs (25)
29public async Task UploadAsync_TracesExpectedData(bool enableSensitiveData) 41Task.FromResult(new HostedFileContent("file-abc") { Name = "test.txt", SizeInBytes = 1024 }), 82public async Task DownloadAsync_TracesExpectedData() 94Task.FromResult<HostedFileDownloadStream>(new TestDownloadStream(new byte[] { 1 })), 122public async Task GetFileInfoAsync_TracesExpectedData(bool enableSensitiveData) 134Task.FromResult<HostedFileContent?>(new HostedFileContent("file-info") { Name = "report.pdf", SizeInBytes = 2048 }), 170public async Task ListFilesAsync_TracesExpectedData() 187await Task.Yield(); 219public async Task DeleteAsync_TracesExpectedData() 230DeleteAsyncCallback = (fileId, options, ct) => Task.FromResult(true), 256public async Task UploadAsync_OnError_SetsErrorStatus() 291public async Task ListFilesAsync_OnIterationError_SetsErrorStatus() 311await Task.Yield(); 337public async Task GetService_ReturnsActivitySource() 353public async Task NoListeners_NoActivityCreated() 367Task.FromResult(new HostedFileContent("file-1")), 382public async Task DownloadAsync_OnError_SetsErrorStatus() 417public async Task DeleteAsync_OnError_SetsErrorStatus() 452public async Task GetFileInfoAsync_OnError_SetsErrorStatus() 487public async Task NoMetadata_ServerTagsAbsent() 499Task.FromResult(new HostedFileContent("file-1")), 525public async Task AdditionalProperties_TaggedWhenSensitiveDataEnabled() 537Task.FromResult(new HostedFileContent("file-1")), 562public async Task AdditionalProperties_NotTaggedWhenSensitiveDataDisabled() 574Task.FromResult(new HostedFileContent("file-1")),
Functions\AIFunctionFactoryTest.cs (69)
44public async Task Parameters_MappedByName_Async() 59public async Task Parameters_DefaultValuesAreUsedButOverridable_Async() 67public async Task Parameters_DefaultValueAttributeIsRespected_Async() 112public async Task Parameters_MissingRequiredParametersFail_Async() 131public async Task Parameters_ToleratesJsonEncodedParameters() 159public async Task Parameters_ToleratesJsonStringParameters(string jsonStringParam) 180public async Task Parameters_ToleratesInvalidJsonStringParameters(string invalidJsonParam) 194public async Task Parameters_MappedByType_Async() 213public async Task Returns_AsyncReturnTypesSupported_Async() 217func = AIFunctionFactory.Create(Task<string> (string a) => Task.FromResult(a + " " + a)); 226func = AIFunctionFactory.Create(async Task (int a, long b) => { result = a + b; await Task.Yield(); }); 232func = AIFunctionFactory.Create(async ValueTask (int a, long b) => { result = a + b; await Task.Yield(); }); 245await Task.Yield(); 353public async Task Parameters_MappedByAIParameterNameAttribute_Async() 381public async Task Parameters_AIParameterNameAttribute_StrictUnmappedMemberHandling_Async() 402public async Task Parameters_AIParameterNameAttribute_InheritedByOverride_Async() 531public async Task AIFunctionFactoryOptions_SupportsSkippingParameters() 631public async Task AIFunctionArguments_SatisfiesParameters() 677public async Task AIFunctionArguments_MissingServicesMayBeOptional() 704public async Task Create_NoInstance_UsesActivatorUtilitiesWhenServicesAvailable() 730public async Task Create_CreateInstanceReturnsNull_ThrowsDuringInvocation() 741public async Task Create_WrongConstructedType_ThrowsDuringInvocation() 760public async Task Create_NoInstance_DisposableInstanceCreatedDisposedEachInvocation() 779public async Task Create_NoInstance_AsyncDisposableInstanceCreatedDisposedEachInvocation() 798public async Task Create_NoInstance_DisposableAndAsyncDisposableInstanceCreatedDisposedEachInvocation() 819public async Task FromKeyedServices_ResolvesFromServiceProvider() 842public async Task FromKeyedServices_NullKeysBindToNonKeyedServices() 865public async Task FromKeyedServices_OptionalDefaultsToNull() 888public async Task ConfigureParameterBinding_CanBeUsedToSupportFromContext() 939public async Task ConfigureParameterBinding_CanBeUsedToOverrideServiceProvider() 956public async Task ConfigureParameterBinding_CanBeUsedToOverrideAIFunctionArguments() 973public async Task MarshalResult_UsedForVoidReturningMethods() 983await Task.Yield(); 996public async Task MarshalResult_UsedForTaskReturningMethods() 1001async (int i) => { await Task.Yield(); }, 1006await Task.Yield(); 1019public async Task MarshalResult_UsedForValueTaskReturningMethods() 1024async ValueTask (int i) => { await Task.Yield(); }, 1029await Task.Yield(); 1042public async Task MarshalResult_UsedForTReturningMethods() 1052await Task.Yield(); 1065public async Task MarshalResult_UsedForTaskTReturningMethods() 1070async (int i) => { await Task.Yield(); return i; }, 1075await Task.Yield(); 1088public async Task MarshalResult_UsedForValueTaskTReturningMethods() 1093async ValueTask<int> (int i) => { await Task.Yield(); return i; }, 1098await Task.Yield(); 1111public async Task MarshalResult_TypeIsDeclaredTypeEvenWhenNullReturned() 1116async ValueTask<string?> (int i) => { await Task.Yield(); return null; }, 1121await Task.Yield(); 1134public async Task MarshalResult_TypeIsDeclaredTypeEvenWhenDerivedTypeReturned() 1139async ValueTask<B> (int i) => { await Task.Yield(); return new C(); }, 1144await Task.Yield(); 1158public async Task AIContentReturnType_NotSerializedByDefault() 1205static async Task ValidateAsync<T>(IEnumerable<AIFunction> functions) 1215public async Task AIFunctionFactory_DefaultDefaultParameter() 1226public async Task AIFunctionFactory_NullableParameters() 1258public async Task AIFunctionFactory_NullableParameters_AllowReadingFromString() 1497public async Task LocalFunction_AsyncFunction() 1501await Task.Yield(); 1653public async Task AIFunctionFactory_DynamicMethod() 1667il.Emit(OpCodes.Call, typeof(Task).GetMethod(nameof(Task.FromResult))!.MakeGenericMethod(typeof(int))); 1689public async Task Parameters_UnmappedMemberHandlingDisallow_ThrowsOnExtraArgument_Async() 1720public async Task Parameters_UnmappedMemberHandlingDefault_IgnoresExtraArgument_Async() 1735public async Task Parameters_UnmappedMemberHandlingDisallow_HonorsArgumentsComparer_Async() 1767public async Task Parameters_UnmappedMemberHandlingDisallow_ParameterlessMethod_ThrowsOnAnyArgument_Async() 1788public async Task Parameters_UnmappedMemberHandlingDisallow_CustomBindParameter_SkipsStrictValidation_Async()
Image\ConfigureOptionsImageGeneratorTests.cs (2)
31public async Task ConfigureOptions_ReturnedInstancePassedToNextGenerator(bool nullProvidedOptions) 44return Task.FromResult(expectedResponse);
Image\LoggingImageGeneratorTests.cs (4)
47public async Task GenerateImagesAsync_LogsInvocationAndCompletion(LogLevel level) 59return Task.FromResult(new ImageGenerationResponse()); 98public async Task GenerateImagesAsync_WithOriginalImages_LogsInvocationAndCompletion(LogLevel level) 107return Task.FromResult(new ImageGenerationResponse());
Image\OpenTelemetryImageGeneratorTests.cs (3)
28public async Task ExpectedInformationLogged_Async(bool enableSensitiveData) 41await Task.Yield(); 172public async Task ExceptionLogged_Async()
parent\Microsoft.Extensions.AI.Abstractions.Tests\TestImageGenerator.cs (1)
31Task.FromResult(new ImageGenerationResponse());
parent\Microsoft.Extensions.AI.Abstractions.Tests\TestRealtimeClientSession.cs (4)
15public Func<RealtimeClientMessage, CancellationToken, Task>? SendAsyncCallback { get; set; } 27public Task SendAsync(RealtimeClientMessage message, CancellationToken cancellationToken = default) 29return SendAsyncCallback?.Invoke(message, cancellationToken) ?? Task.CompletedTask; 59await Task.CompletedTask.ConfigureAwait(false);
Realtime\FunctionInvokingRealtimeClientTests.cs (30)
62public async Task GetStreamingResponseAsync_NoFunctionCalls_PassesThrough() 89public async Task GetStreamingResponseAsync_FunctionCall_InvokesAndInjectsResult() 107return Task.CompletedTask; 139public async Task GetStreamingResponseAsync_FunctionCall_FromAdditionalTools() 156return Task.CompletedTask; 176public async Task GetStreamingResponseAsync_MaxIterations_StopsInvoking() 195SendAsyncCallback = (_, _) => Task.CompletedTask, 216public async Task GetStreamingResponseAsync_FunctionInvoker_CustomDelegate() 231SendAsyncCallback = (_, _) => Task.CompletedTask, 251public async Task GetStreamingResponseAsync_UnknownFunction_SendsErrorByDefault() 263return Task.CompletedTask; 283public async Task GetStreamingResponseAsync_FunctionError_IncludesDetailedErrors() 301return Task.CompletedTask; 321public async Task GetStreamingResponseAsync_FunctionError_HidesDetailsWhenNotEnabled() 339return Task.CompletedTask; 359public async Task GetService_ReturnsSelf() 371public async Task GetStreamingResponseAsync_TerminateOnUnknownCalls_StopsLoop() 384return Task.CompletedTask; 406public async Task GetStreamingResponseAsync_TerminateOnUnknownCalls_False_SendsError() 418return Task.CompletedTask; 442public async Task GetStreamingResponseAsync_ConcurrentInvocation_InvokesInParallel() 462await Task.Delay(50).ConfigureAwait(false); 496SendAsyncCallback = (_, _) => Task.CompletedTask, 512public async Task GetStreamingResponseAsync_ConsecutiveErrors_ExceedsLimit_Throws() 538SendAsyncCallback = (_, _) => Task.CompletedTask, 563public async Task UseFunctionInvocation_ConfigureCallback_IsInvoked() 590public async Task GetStreamingResponseAsync_NonInvocableTool_TerminatesLoop() 608return Task.CompletedTask; 659await Task.CompletedTask.ConfigureAwait(false); 676=> Task.FromResult(_session);
Realtime\LoggingRealtimeClientTests.cs (19)
20public async Task LoggingRealtimeClient_InvalidArgs_Throws() 29public async Task UseLogging_AvoidsInjectingNopSession() 66public async Task SendAsync_SessionUpdateMessage_LogsInvocationAndCompletion(LogLevel level) 108public async Task SendAsync_LogsInvocationAndCompletion(LogLevel level) 118SendAsyncCallback = (message, cancellationToken) => Task.CompletedTask, 153public async Task GetStreamingResponseAsync_LogsMessagesReceived(LogLevel level) 165await Task.Yield(); 206public async Task SendAsync_SessionUpdateMessage_LogsCancellation() 238public async Task SendAsync_SessionUpdateMessage_LogsErrors() 267public async Task GetStreamingResponseAsync_LogsCancellation() 281await Task.Yield(); 311public async Task GetStreamingResponseAsync_LogsErrors() 323await Task.Yield(); 352public async Task GetService_ReturnsLoggingClientWhenRequested() 370public async Task SendAsync_LogsCancellation() 403public async Task SendAsync_LogsErrors() 433public async Task JsonSerializerOptions_NullValue_Throws() 443public async Task JsonSerializerOptions_Roundtrip() 472=> Task.FromResult(_session);
Realtime\OpenTelemetryRealtimeClientTests.cs (39)
24public async Task ExpectedInformationLogged_GetStreamingResponseAsync(bool enableSensitiveData) 53await Task.Yield(); 196public async Task GetStreamingResponseAsync_TracesError() 216await Task.Yield(); 251public async Task GetStreamingResponseAsync_TracesErrorFromResponse() 268await Task.Yield(); 303public async Task NoListeners_NoActivityCreated() 320await Task.Yield(); 346public async Task InvalidArgs_Throws() 363public async Task GetService_ReturnsActivitySource() 376public async Task GetService_ReturnsSelf() 389public async Task TranscriptionSessionKind_Logged() 410await Task.Yield(); 442public async Task ToolCallContentInClientMessages_LoggedAsInputMessages() 485public async Task ToolCallContentInServerMessages_LoggedAsOutputMessages() 528public async Task ToolContentNotLoggedWithoutSensitiveData() 569await Task.Yield(); 579await Task.Yield(); 589await Task.Yield(); 597await Task.Yield(); 613public async Task AudioBufferAppendMessage_LoggedAsInputMessage() 656public async Task AudioBufferCommitMessage_LoggedAsInputMessage() 699public async Task ResponseCreateMessageWithInstructions_LoggedAsInputMessage() 741public async Task ResponseCreateMessageWithItems_LoggedAsInputMessage() 783public async Task OutputTextAudioMessage_LoggedAsOutputMessage() 824public async Task InputAudioTranscriptionMessage_LoggedAsOutputMessage() 865public async Task ServerErrorMessage_LoggedAsOutputMessage() 906public async Task ConversationItemCreateWithTextContent_LoggedAsInputMessage() 947public async Task DataContentInClientMessage_LoggedWithModality() 992await Task.Yield(); 1000await Task.Yield(); 1009await Task.Yield(); 1019await Task.Yield(); 1028await Task.Yield(); 1040await Task.Yield(); 1052await Task.Yield(); 1072public async Task UseOpenTelemetry_BuildsPipeline() 1092public async Task DisposeAsync_CanBeCalledMultipleTimes() 1116=> Task.FromResult(_session);
Realtime\RealtimeClientBuilderTests.cs (1)
146=> Task.FromResult<IRealtimeClientSession>(new TestRealtimeClientSession());
Realtime\RealtimeClientExtensionsTests.cs (1)
115=> Task.FromResult<IRealtimeClientSession>(new TestRealtimeClientSession());
Realtime\RealtimeClientSessionExtensionsTests.cs (11)
21public async Task GetService_ReturnsMatchingService() 29public async Task GetService_ReturnsNullForNonMatchingType() 37public async Task GetService_WithServiceKey_ReturnsNull() 45public async Task GetService_ReturnsInterfaceType() 60public async Task GetRequiredService_NullServiceType_Throws() 67public async Task GetRequiredService_ReturnsMatchingService() 75public async Task GetRequiredService_ReturnsInterfaceType() 83public async Task GetRequiredService_NonGeneric_ReturnsMatchingService() 91public async Task GetRequiredService_ThrowsForNonMatchingType() 98public async Task GetRequiredService_NonGeneric_ThrowsForNonMatchingType() 105public async Task GetRequiredService_WithServiceKey_ThrowsForNonMatchingKey()
SpeechToText\ConfigureOptionsSpeechToTextClientTests.cs (3)
34public async Task ConfigureOptions_ReturnedInstancePassedToNextClient(bool nullProvidedOptions) 48return Task.FromResult(expectedResponse); 96await Task.Yield();
SpeechToText\LoggingSpeechToTextClientTests.cs (4)
49public async Task GetTextAsync_LogsResponseInvocationAndCompletion(LogLevel level) 61return Task.FromResult(new SpeechToTextResponse("blue whale")); 98public async Task GetStreamingTextAsync_LogsUpdateReceived(LogLevel level) 110await Task.Yield();
SpeechToText\OpenTelemetrySpeechToTextClientTests.cs (4)
33public async Task ExpectedInformationLogged_Async(bool streaming, bool enableSensitiveData) 46await Task.Yield(); 68await Task.Yield(); 156public async Task ExceptionLogged_Async(bool streaming)
TestInMemoryCacheStorage.cs (7)
22=> Task.FromResult(Get(key)); 29public Task RefreshAsync(string key, CancellationToken token = default) 30=> Task.CompletedTask; 35public Task RemoveAsync(string key, CancellationToken token = default) 38return Task.CompletedTask; 46public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default) 49return Task.CompletedTask;
TextToSpeech\ConfigureOptionsTextToSpeechClientTests.cs (3)
33public async Task ConfigureOptions_ReturnedInstancePassedToNextClient(bool nullProvidedOptions) 47return Task.FromResult(expectedResponse); 93await Task.Yield();
TextToSpeech\LoggingTextToSpeechClientTests.cs (4)
47public async Task GetAudioAsync_LogsResponseInvocationAndCompletion(LogLevel level) 59return Task.FromResult(new TextToSpeechResponse([new DataContent(new byte[] { 1, 2, 3 }, "audio/mpeg")])); 97public async Task GetStreamingAudioAsync_LogsUpdateReceived(LogLevel level) 109await Task.Yield();
TextToSpeech\OpenTelemetryTextToSpeechClientTests.cs (4)
30public async Task ExpectedInformationLogged_Async(bool streaming, bool enableSensitiveData) 43await Task.Yield(); 65await Task.Yield(); 136public async Task ExceptionLogged_Async(bool streaming)
Microsoft.Extensions.AmbientMetadata.Application.Tests (8)
AcceptanceTests.cs (8)
29public async Task UseApplicationMetadata_CreatesPopulatesAndRegistersOptions(string? sectionName) => 38return Task.CompletedTask; 45public async Task UseApplicationMetadata_HostApplicationBuilder_CreatesPopulatesAndRegistersOptions(string? sectionName) => 54return Task.CompletedTask; 58private static async Task RunAsync(Func<ApplicationMetadata, IHostEnvironment, Task> func, string? sectionName) 80private static async Task RunAsync_HostBuilder(Func<ApplicationMetadata, IHostEnvironment, Task> func, string? sectionName)
Microsoft.Extensions.AsyncState.Tests (43)
AsyncContextTests.cs (30)
14public async Task CreateAsyncContext_BeforeInitialize() 26await Task.Run(() => context1.Set(obj1)); 28await Task.Run(() => 37public async Task CreateAsyncContext_AfterInitialize() 50await Task.Run(() => context1.Set(obj1)); 52await Task.Run(() => 61public async Task CreateAsyncContext_BeforeAndAfterInitialize() 73await Task.Run(() => 79await Task.Run(() => 88public async Task Tryget_BeforeAndAfterInitialize() 99await Task.Run(() => 106await Task.Run(() => 114public async Task CreateAsyncContextInAsync_AfterInitialize() 124await Task.Run(async () => 132await Task.Run(() => 185public async Task TwoAsyncFlows_WithDiffrentAsyncStates() 190var task1 = Task.Run(async () => 196await Task.Run(async () => 200await Task.Run(() => Assert.Same(obj, context.Get())); 206var task2 = Task.Run(async () => 212await Task.Run(async () => 216await Task.Run(() => Assert.Same(obj, context.Get())); 222await Task.WhenAll(task1, task2); 227public async Task IndependentAsyncFlows_WithSameAsyncState() 233Func<Task?> setAsyncState = async () => 237await Task.Run(async () => 242await Task.Run(() => 251var tasks = new Task[10]; 255tasks[i] = Task.Run(setAsyncState); 258await Task.WhenAll(tasks);
AsyncStateTests.cs (13)
18public async Task GettingAsyncContextReturnsAsyncContext() 25static Task SetAsyncContext(AsyncState state, IThing context, AsyncStateToken token) 30return Task.CompletedTask; 39public async Task GettingAsyncContextReturnsNullAsyncContextIfSetToNull() 51var task = Task.Run(async () => 88public async Task GettingAsyncContextReturnsNullAsyncContextIfChanged() 101var task = Task.Run(async () => 140public async Task GettingAsyncContextDoesNotFlowIfAccessorSetToNull() 152var task = Task.Run(() => 172public async Task GettingAsyncContextDoesNotFlowIfExecutionContextDoesNotFlow()
Microsoft.Extensions.Caching.Abstractions (10)
DistributedCacheExtensions.cs (3)
42public static Task SetAsync(this IDistributedCache cache, string key, byte[] value, CancellationToken token = default(CancellationToken)) 87public static Task SetStringAsync(this IDistributedCache cache, string key, string value, CancellationToken token = default(CancellationToken)) 102public static Task SetStringAsync(this IDistributedCache cache, string key, string value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken))
IDistributedCache.cs (7)
26/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the located value or null.</returns> 44/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 45Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken)); 58/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 59Task RefreshAsync(string key, CancellationToken token = default(CancellationToken)); 72/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 73Task RemoveAsync(string key, CancellationToken token = default(CancellationToken));
Microsoft.Extensions.Caching.Hybrid (8)
Internal\DefaultHybridCache.StampedeStateT.cs (6)
65public Task ExecuteDirectAsync(in TState state, Func<TState, CancellationToken, ValueTask<T>> underlying, HybridCacheEntryOptions? options) 99Task first = await System.Threading.Tasks.Task.WhenAny(stampede.Task, cancelStub.Task).ConfigureAwait(false); 129static Task<CacheItem<T>> InvalidAsync() => System.Threading.Tasks.Task.FromException<CacheItem<T>>( 161private async Task BackgroundFetchAsync() 311await System.Threading.Tasks.Task.Delay(1, CancellationToken.None).ConfigureAwait(false);
Internal\DefaultHybridCache.TagInvalidation.cs (2)
13private static readonly Task<long> _zeroTimestamp = Task.FromResult<long>(0L); 243Task<long> timestampTask = Task.FromResult<long>(timestamp);
Microsoft.Extensions.Caching.Hybrid.Tests (102)
BufferReleaseTests.cs (6)
35public async Task BufferGetsReleased_NoL2() 70await Task.Delay(250); 117public async Task BufferDoesNotNeedRelease_LegacyL2() // byte[] API; not pooled 166await Task.Delay(250); 182public async Task BufferGetsReleased_BufferL2() // IBufferWriter<byte> API; pooled 229await Task.Delay(250);
DistributedCacheTests.cs (4)
57public async Task SimpleBufferRoundtrip(int size) 103public async Task SimpleBufferRoundtripAsync(int size) 169public async Task ReadOnlySequenceBufferRoundtrip(int size, SequenceKind kind) 231public async Task ReadOnlySequenceBufferRoundtripAsync(int size, SequenceKind kind)
ExpirationTests.cs (1)
17public async Task ExpirationRespected()
FunctionalTests.cs (4)
23public async Task RemoveSingleKey() 39public async Task RemoveNoKeyViaArray() 51public async Task RemoveSingleKeyViaArray() 67public async Task RemoveMultipleKeysViaArray()
HybridCacheEventSourceTests.cs (16)
23public async Task LocalCacheHit() 36public async Task LocalCacheMiss() 49public async Task DistributedCacheGet() 62public async Task DistributedCacheHit() 76public async Task DistributedCacheMiss() 90public async Task DistributedCacheFailed() 103public async Task DistributedCacheCanceled() 116public async Task UnderlyingDataQueryStart() 130public async Task UnderlyingDataQueryComplete() 144public async Task UnderlyingDataQueryFailed() 158public async Task UnderlyingDataQueryCanceled() 172public async Task LocalCacheWrite() 185public async Task DistributedCacheWrite() 198public async Task StampedeJoin() 211public async Task TagInvalidated() 231private async Task AssertCountersAsync()
L2Tests.cs (5)
50public async Task AssertL2Operations_Immutable(bool buffers) 108public async Task AssertL2Operations_Mutable(bool buffers) 238Task IDistributedCache.RefreshAsync(string key, CancellationToken token) 252Task IDistributedCache.RemoveAsync(string key, CancellationToken token) 266Task IDistributedCache.SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token)
LocalInvalidationTests.cs (3)
26public async Task GlobalInvalidateNoTags() 52public async Task TagBasedInvalidate(bool withL2, bool withExtraTag) 126await Task.Delay(10);
LogCollector.cs (2)
34public async Task WaitForLogsAsync(int[] expectedErrorIds, TimeSpan timeout) 68await Task.Delay(10);
NullDistributedCache.cs (7)
12Task<byte[]?> IDistributedCache.GetAsync(string key, CancellationToken token) => Task.FromResult<byte[]?>(null); 18Task IDistributedCache.RefreshAsync(string key, CancellationToken token) => Task.CompletedTask; 24Task IDistributedCache.RemoveAsync(string key, CancellationToken token) => Task.CompletedTask; 30Task IDistributedCache.SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token) => Task.CompletedTask;
PayloadTests.cs (5)
99public async Task RoundTrip_WildcardExpiration() 129public async Task RoundTrip_TagExpiration() 165public async Task RoundTrip_TagExpiration_Pending() 273public async Task MalformedKeyDetected() 300public async Task MalformedTagDetected()
RedisTests.cs (3)
36options.ConnectionMultiplexerFactory = () => Task.FromResult(redis); 43public async Task BasicUsage(bool useBuffers) 91await Task.Delay(100);
SampleUsage.cs (6)
14public async Task DistributedCacheWorks() 34public async Task HybridCacheWorks() 54public async Task HybridCacheNoCaptureWorks() 74public async Task HybridCacheNoCaptureObjReuseWorks() 134return Task.FromResult(new SomeInformation { Id = id, Name = name }); 143return Task.FromResult(new SomeInformationReuse { Id = id, Name = name });
ServiceConstructionTests.cs (3)
205public async Task KeyedHybridCaches_ShareLocalMemoryCache() 426public async Task BasicStatelessUsage() 439public async Task BasicStatefulUsage()
SizeTests.cs (4)
28public async Task ValidateSizeLimit_Immutable(string? key, long? sizeLimit, bool expectFromL1, long? maximumPayloadBytes, int? maximumKeyLength, 97public async Task ValidateSizeLimit_Mutable(string? key, long? sizeLimit, bool expectFromL1, long? maximumPayloadBytes, int? maximumKeyLength, 151public async Task BrokenSerializer_Mutable(string value, bool same, int runCount, int serializeCount, int deserializeCount, bool expectKnownFailure, params int[] errorIds) 212public async Task BrokenSerializer_Immutable(string value, bool same, int runCount, int serializeCount, int deserializeCount, bool expectKnownFailure, bool withL2,
StampedeTests.cs (16)
47Task IDistributedCache.RefreshAsync(string key, CancellationToken token) => throw new NotSupportedException("Intentionally not provided"); 53Task IDistributedCache.RemoveAsync(string key, CancellationToken token) => throw new NotSupportedException("Intentionally not provided"); 57Task IDistributedCache.SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token) => throw new NotSupportedException("Intentionally not provided"); 86public async Task MultipleCallsShareExecution_NoCancellation(int callerCount, bool canBeCanceled) 172public async Task MultipleCallsShareExecution_EveryoneCancels(int callerCount) 219await Task.Delay(500); 251public async Task MultipleCallsShareExecution_MostCancel(int callerCount, int remaining) 303await Task.Delay(500); 337public async Task ImmutableTypesShareFinalTask(bool withCancelation) 377public async Task ImmutableCustomTypesShareFinalTask(bool withCancelation) 421public async Task MutableTypesNeverShareFinalTask(bool withCancelation) 501private static async Task WaitForCompletionAsync( 502Task task, 512var completed = await Task.WhenAny(task, Task.Delay(timeoutMs));
TestEventListener.cs (1)
182await Task.Delay(TimeSpan.FromSeconds(EventCounterIntervalSec * 2));
UnreliableL2Tests.cs (16)
23public async Task WriteFailureInvisible(BreakType writeBreak, params int[] errorIds) 60public async Task ReadFailureInvisible(BreakType readBreak, params int[] errorIds) 161public Task LastWrite { get; private set; } = Task.CompletedTask; 170public Task RefreshAsync(string key, CancellationToken token = default) 175public Task RemoveAsync(string key, CancellationToken token = default) 180public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default) 190await Task.Yield(); 197private static Task? ThrowIfBrokenAsync(BreakType breakType) => ThrowIfBrokenAsync<int>(breakType); 221private static Task IgnoreFailure(Task task) 224? Task.CompletedTask : IgnoreAsync(task); 226static async Task IgnoreAsync(Task task) 240private Task TrackLast(Task lastWrite)
Microsoft.Extensions.Caching.Memory (10)
CacheEntry.CacheEntryTokens.cs (1)
109Task.Factory.StartNew(state => InvokeCallbacks((CacheEntry)state!), cacheEntry,
CacheEntry.cs (1)
281Task.Factory.StartNew(state =>
MemoryCache.cs (1)
435Task.Factory.StartNew(state => ((MemoryCache)state!).ScanForExpiredItems(), this,
MemoryDistributedCache.cs (7)
64return Task.FromResult(Get(key)); 95public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken)) 102return Task.CompletedTask; 122public Task RefreshAsync(string key, CancellationToken token = default(CancellationToken)) 127return Task.CompletedTask; 147public Task RemoveAsync(string key, CancellationToken token = default(CancellationToken)) 152return Task.CompletedTask;
Microsoft.Extensions.Caching.SqlServer (10)
DatabaseOperations.cs (3)
64public async Task DeleteCacheItemAsync(string key, CancellationToken token = default(CancellationToken)) 109public Task RefreshCacheItemAsync(string key, CancellationToken token = default(CancellationToken)) 169public async Task SetCacheItemAsync(string key, ArraySegment<byte> value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken))
IDatabaseOperations.cs (3)
24Task RefreshCacheItemAsync(string key, CancellationToken token = default(CancellationToken)); 28Task DeleteCacheItemAsync(string key, CancellationToken token = default(CancellationToken)); 32Task SetCacheItemAsync(string key, ArraySegment<byte> value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken));
SqlServerCache.cs (4)
135public async Task RefreshAsync(string key, CancellationToken token = default(CancellationToken)) 157public async Task RemoveAsync(string key, CancellationToken token = default(CancellationToken)) 196public async Task SetAsync( 273Task.Run(_deleteExpiredCachedItemsDelegate);
Microsoft.Extensions.Caching.StackExchangeRedis (7)
RedisCache.cs (7)
187var setFields = batch.HashSetAsync(prefixedKey, fields); 202public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default) 208private async Task SetImplAsync(string key, ReadOnlySequence<byte> value, DistributedCacheEntryOptions options, CancellationToken token = default) 235await Task.WhenAll( 265public async Task RefreshAsync(string key, CancellationToken token = default) 485public async Task RemoveAsync(string key, CancellationToken token = default) 545private async Task RefreshAsync(IDatabase cache, string key, DateTimeOffset? absExpr, TimeSpan sldExpr, CancellationToken token)
Microsoft.Extensions.Configuration.FileExtensions (1)
FileConfigurationProvider.cs (1)
39await Task.Delay(Source.ReloadDelay).ConfigureAwait(false);
Microsoft.Extensions.DataIngestion (2)
Processors\ImageAlternativeTextEnricher.cs (1)
88private async Task ProcessAsync(List<IngestionDocumentImage> batch, CancellationToken cancellationToken)
Writers\VectorStoreWriter.cs (1)
59public override async Task WriteAsync(IAsyncEnumerable<IngestionChunk<T>> chunks, CancellationToken cancellationToken = default)
Microsoft.Extensions.DataIngestion.Abstractions (1)
IngestionChunkWriter.cs (1)
23public abstract Task WriteAsync(IAsyncEnumerable<IngestionChunk<T>> chunks, CancellationToken cancellationToken = default);
Microsoft.Extensions.DataIngestion.Tests (79)
Chunkers\DocumentChunkerTests.cs (2)
17public async Task ProcessAsync_ThrowsArgumentNullException_WhenDocumentIsNull() 24public async Task EmptyDocument()
Chunkers\DocumentTokenChunkerTests.cs (1)
14public async Task SingleChunkText()
Chunkers\HeaderChunkerTests.cs (7)
16public async Task CanChunkNonTrivialDocument() 57public async Task CanRespectTokenLimit() 82public async Task ThrowsWhenLimitIsTooLowToFitAnythingMoreThanContext() 104public async Task CanSplitLongerParagraphsOnNewLine() 131public async Task ThrowsWhenHeaderSeparatorAndSingleRowExceedTokenLimit() 142public async Task CanSplitLargeTableIntoMultipleChunks_MultipleRowsPerChunk() 171public async Task CanSplitLargeTableIntoMultipleChunks_OneRowPerChunk()
Chunkers\NoOverlapTokenChunkerTests.cs (2)
21public async Task TwoChunks() 41public async Task ManyChunks()
Chunkers\OverlapTokenChunkerTests.cs (1)
22public async Task TokenChunking_WithOverlap()
Chunkers\SectionChunkerTests.cs (6)
21public async Task OneSection() 40public async Task TwoSections() 76public async Task EmptySection() 89public async Task NestedSections() 144public async Task SizeLimit_TwoChunks() 164public async Task SectionWithHeader()
Chunkers\SemanticSimilarityChunkerTests.cs (3)
32public async Task SingleParagraph() 63public async Task TwoTopicsParagraphs() 107public async Task TwoSeparateTopicsWithAllKindsOfElements()
IngestionPipelineTests.cs (6)
80public async Task CanProcessDocuments() 113public async Task CanProcessDocumentsInDirectory() 147public async Task ChunksCanBeMoreThanJustText() 188public async Task SingleFailureDoesNotTearDownEntirePipeline() 194? Task.FromException<IngestionDocument>(new ExpectedException()) 209async Task Verify(IAsyncEnumerable<IngestionResult> results)
Processors\AlternativeTextEnricherTests.cs (7)
26public async Task ThrowsOnNullDocument() 36public async Task CanGenerateImageAltText() 59return Task.FromResult(new ChatResponse(new[] 122public async Task SendsOneRequestPerBatchSize(int batchSize, int batchCount) 147return Task.FromResult(new ChatResponse(new[] { new ChatMessage(ChatRole.Assistant, JsonSerializer.Serialize(data)) })); 160public async Task FailureDoesNotStopTheProcessing() 166GetResponseAsyncCallback = (messages, options, cancellationToken) => Task.FromException<ChatResponse>(new ExpectedException())
Processors\ClassificationEnricherTests.cs (5)
51public async Task ThrowsOnNullChunks() 66public async Task CanClassify() 82return Task.FromResult(new ChatResponse(new[] 99public async Task FailureDoesNotStopTheProcessing() 105GetResponseAsyncCallback = (messages, options, cancellationToken) => Task.FromException<ChatResponse>(new ExpectedException())
Processors\KeywordEnricherTests.cs (5)
49public async Task ThrowsOnNullChunks() 66public async Task CanExtractKeywords(params string[] predefined) 82return Task.FromResult(new ChatResponse(new[] 99public async Task FailureDoesNotStopTheProcessing() 105GetResponseAsyncCallback = (messages, options, cancellationToken) => Task.FromException<ChatResponse>(new ExpectedException())
Processors\SentimentEnricherTests.cs (5)
35public async Task ThrowsOnNullChunks() 50public async Task CanProvideSentiment() 66return Task.FromResult(new ChatResponse(new[] 86public async Task FailureDoesNotStopTheProcessing() 92GetResponseAsyncCallback = (messages, options, cancellationToken) => Task.FromException<ChatResponse>(new ExpectedException())
Processors\SummaryEnricherTests.cs (5)
35public async Task ThrowsOnNullChunks() 50public async Task CanProvideSummary() 66return Task.FromResult(new ChatResponse(new[] 83public async Task FailureDoesNotStopTheProcessing() 89GetResponseAsyncCallback = (messages, options, cancellationToken) => Task.FromException<ChatResponse>(new ExpectedException())
Readers\DocumentReaderConformanceTests.cs (8)
22public async Task ThrowsWhenIdentifierIsNotProvided() 35public async Task ThrowsIfCancellationRequestedStream() 46public async Task ThrowsIfCancellationRequestedFile() 78public virtual async Task SupportsStreams(string source) 91public virtual async Task SupportsFiles(string source) 108public virtual Task SupportsImages() => SupportsImagesCore( 111protected async Task SupportsImagesCore(Uri source) 131public virtual async Task SupportsTables()
Readers\MarkdownReaderTests.cs (8)
23public override Task SupportsStreams(string source) => base.SupportsStreams(source); 27public override Task SupportsFiles(string source) => base.SupportsFiles(source); 30public override async Task SupportsTables() 62public async Task SupportsTablesWithoutTrailingPipes() 103public override async Task SupportsImages() 145public async Task SupportsTablesWithImages() 177public async Task SupportsInlineHtml() 189public async Task SupportsMultipleInlineHtmlElements()
Readers\MarkItDownMcpReaderTests.cs (3)
20public async Task ReadAsync_ThrowsWhenIdentifierIsNull() 33public async Task ReadAsync_ThrowsWhenSourceIsNull() 42public async Task ReadAsync_ThrowsWhenFileDoesNotExist()
Readers\MarkItDownReaderTests.cs (1)
44public override Task SupportsImages() => SupportsImagesCore(
Utils\TestEmbeddingGenerator.cs (1)
27return Task.FromResult(new GeneratedEmbeddings<Embedding<float>>(
Writers\VectorStoreWriterTests.cs (3)
16public async Task CanGenerateDynamicSchema() 61public async Task DoesSupportIncrementalIngestion() 121public async Task IncrementalIngestion_WithManyRecords_DeletesAllPreExistingChunks()
Microsoft.Extensions.DependencyInjection (2)
ServiceLookup\ServiceProviderEngineScope.cs (1)
116Task.Run(() => ((IAsyncDisposable)localService).DisposeAsync().AsTask()).GetAwaiter().GetResult();
ServiceLookup\StackGuard.cs (1)
57Task<R> task = Task.Factory.StartNew((Func<object?, R>)action, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
Microsoft.Extensions.DependencyInjection.AutoActivation (4)
AutoActivationHostedService.cs (4)
24public Task StartAsync(CancellationToken cancellationToken) 36return Task.CompletedTask; 39public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
Microsoft.Extensions.DependencyInjection.AutoActivation.Tests (40)
AcceptanceTest.cs (21)
18public async Task CanAddAndActivateSingletonAsync() 39public async Task ShouldIgnoreComponent_WhenNoAutoStartAsync() 60public async Task ShouldAddAndActivateOnlyOnce_WhenHasChildAsync() 81public async Task ShouldResolveComponentsAutomaticallyAsync() 100public async Task CanActivateEnumerableAsync() 125public async Task CanActivateEnumerableAsync_WithTypeArg() 150public async Task CanActivateOneServiceAsync() 169public async Task ShouldActivateService_WhenTypeIsSpecifiedInTypeParameterTService() 188public async Task ShouldActivateService_WhenTypeIsSpecifiedInParameter() 207public async Task TestStopHostAsync() 222public async Task ShouldNotActivate_WhenServiceOfTypeSpecifiedInTypeParameter_WasAlreadyAdded() 246public async Task ShouldNotActivate_WhenServiceOfTypeSpecifiedInParameter_WasAlreadyAdded() 270public async Task ShouldActivateOneSingleton_WhenTryAddIsCalled_WithTypeSpecifiedImplementation() 292public async Task ShouldActivateOneSingleton_WhenTryAddIsCalled_WithTypeSpecifiedImplementation_WithTypeArg() 314public async Task CanActivateSingletonAsync() 336public async Task ActivationOfNotRegisteredType_ThrowsExceptionAsync() 348public async Task CanActivateEnumerableImplicitlyAddedAsync() 367public async Task CanActivateEnumerableImplicitlyAddedAsync_WithTypeArg() 386public async Task CanActivateEnumerableExplicitlyAddedAsync() 406public async Task CanAutoActivateOpenGenericsAsEnumerableAsync() 428public async Task CanAutoActivateClosedGenericsAsEnumerableAsync()
AcceptanceTest.Keyed.cs (19)
18public async Task CanAddAndActivateKeyedSingletonAsync() 40public async Task ShouldAddAndActivateOnlyOnce_WhenHasChildAsync_Keyed() 62public async Task ShouldResolveComponentsAutomaticallyAsync_Keyed() 82public async Task CanActivateEnumerableAsync_Keyed() 108public async Task CanActivateEnumerableAsync_WithTypeArg_Keyed() 134public async Task CanActivateOneServiceAsync_Keyed() 154public async Task ShouldActivateService_WhenTypeIsSpecifiedInTypeParameterTService_Keyed() 174public async Task ShouldActivateService_WhenTypeIsSpecifiedInParameter_Keyed() 194public async Task TestStopHostAsync_Keyed() 210public async Task ShouldNotActivate_WhenServiceOfTypeSpecifiedInTypeParameter_WasAlreadyAdded_Keyed() 235public async Task ShouldNotActivate_WhenServiceOfTypeSpecifiedInParameter_WasAlreadyAdded_Keyed() 260public async Task ShouldActivateOneSingleton_WhenTryAddIsCalled_WithTypeSpecifiedImplementation_Keyed() 283public async Task ShouldActivateOneSingleton_WhenTryAddIsCalled_WithTypeSpecifiedImplementation_WithTypeArg_Keyed() 306public async Task CanActivateSingletonAsync_Keyed() 329public async Task ActivationOfNotRegisteredType_ThrowsExceptionAsync_Keyed() 342public async Task CanActivateEnumerableImplicitlyAddedAsync_Keyed() 362public async Task CanActivateEnumerableExplicitlyAddedAsync_Keyed() 383public async Task CanAutoActivateOpenGenericsAsEnumerableAsync_Keyed() 406public async Task CanAutoActivateClosedGenericsAsEnumerableAsync_Keyed()
Microsoft.Extensions.Diagnostics.ExceptionSummarization.Tests (6)
ExceptionSummarizerTests.cs (3)
206public async Task Summarize_WithInnerTaskCanceledException_ReturnSummary(string? additionalDetails) 214var task = Task.Run(() => { }, tokenSource.Token);
HttpExceptionSummaryProviderTests.cs (3)
116public async Task Describe_WithTaskCanceledException_ReturnDetails() 122var task = Task.Run(() => { }, tokenSource.Token);
Microsoft.Extensions.Diagnostics.HealthChecks (16)
DefaultHealthCheckService.cs (2)
56tasks[index++] = Task.Run(() => RunCheckAsync(registration, cancellationToken), cancellationToken); 59await Task.WhenAll(tasks).ConfigureAwait(false);
DependencyInjection\HealthChecksBuilderDelegateExtensions.cs (2)
58var instance = new DelegateHealthCheck((ct) => Task.FromResult(check())); 101var instance = new DelegateHealthCheck((ct) => Task.FromResult(check(ct)));
HealthCheckPublisherHostedService.cs (12)
62public Task StartAsync(CancellationToken cancellationToken = default) 66return Task.CompletedTask; 73return Task.CompletedTask; 76public Task StopAsync(CancellationToken cancellationToken = default) 89return Task.CompletedTask; 102return Task.CompletedTask; 144internal async Task RunAsync((TimeSpan Delay, TimeSpan Period) timerOptions) 178private async Task RunAsyncCore((TimeSpan Delay, TimeSpan Period) timerOptions, CancellationToken cancellationToken) 181await Task.Yield(); 195var tasks = new Task[publishers.Length]; 201await Task.WhenAll(tasks).ConfigureAwait(false); 204private async Task RunPublisherAsync(IHealthCheckPublisher publisher, HealthReport report, CancellationToken cancellationToken)
Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (2)
IHealthCheckPublisher.cs (2)
36/// <returns>A <see cref="Task"/> which will complete when publishing is complete.</returns> 37Task PublishAsync(HealthReport report, CancellationToken cancellationToken);
Microsoft.Extensions.Diagnostics.HealthChecks.Common (7)
ApplicationLifecycleHealthCheck.cs (4)
16private static readonly Task<HealthCheckResult> _healthy = Task.FromResult(HealthCheckResult.Healthy()); 17private static readonly Task<HealthCheckResult> _unhealthyNotStarted = Task.FromResult(HealthCheckResult.Unhealthy("Not Started")); 18private static readonly Task<HealthCheckResult> _unhealthyStopping = Task.FromResult(HealthCheckResult.Unhealthy("Stopping")); 19private static readonly Task<HealthCheckResult> _unhealthyStopped = Task.FromResult(HealthCheckResult.Unhealthy("Stopped"));
ManualHealthCheckService.cs (1)
37public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default) => Task.FromResult(_tracker.GetHealthCheckResult());
TelemetryHealthCheckPublisher.cs (2)
42public Task PublishAsync(HealthReport report, CancellationToken cancellationToken) 84return Task.CompletedTask;
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (6)
ApplicationLifecycleHealthCheckTests.cs (1)
13public async Task CheckHealthAsync_AssertHealthStatusAfterApplicationLifecycleEvents()
ManualHealthCheckTests.cs (4)
14public async Task CheckHealthAsync_Initial() 31public async Task CheckHealthAsync_AssertHealthStatus_AfterChange() 55public async Task CheckHealthAsync_AssertHealthStatus_AfterChangeWithReport() 81public async Task CheckHealthAsync_AssertHealthStatusAfterChange_MultipleModules()
TelemetryHealthChecksPublisherTests.cs (1)
78public async Task PublishAsync(
Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization (3)
ResourceUtilizationHealthCheck.cs (3)
59return Task.FromResult(HealthCheckResult.Unhealthy(message, data: data)); 81return Task.FromResult(HealthCheckResult.Degraded(message, data: data)); 84return Task.FromResult(HealthCheckResult.Healthy(data: data));
Microsoft.Extensions.Diagnostics.HealthChecks.ResourceUtilization.Tests (13)
ResourceHealthCheckExtensionsTests.cs (12)
31public async Task AddResourceHealthCheck() 51public async Task AddResourceHealthCheck_WithCustomResourceMonitorAddedAfterInternalResourceMonitor_OverridesIt() 95public async Task AddResourceHealthCheck_WithTags() 130public async Task AddResourceHealthCheck_WithTags_WithCustomResourceMonitorAddedAfterInternalResourceMonitor_OverridesIt() 150public async Task AddResourceHealthCheck_WithTagsEnumerable() 185public async Task AddResourceHealthCheck_WithAction() 226public async Task AddResourceHealthCheck_WithActionAndTags() 269public async Task AddResourceHealthCheck_WithActionAndTagsEnumerable() 312public async Task AddResourceHealthCheck_WithConfigurationSection() 346public async Task AddResourceHealthCheck_WithConfigurationSectionAndTags() 383public async Task AddResourceHealthCheck_WithConfigurationSectionAndTagsEnumerable() 473public async Task TestCpuAndMemoryChecks_WithMetrics(
ResourceHealthCheckTests.cs (1)
17public async Task TestCpuAndMemoryChecks(HealthStatus expected, double utilization, ulong memoryUsed, ulong totalMemory,
Microsoft.Extensions.Diagnostics.Probes (5)
TcpEndpointProbesService.cs (5)
39internal async Task UpdateHealthStatusAsync(CancellationToken cancellationToken) 49_ = Task.Run(() => OpenTcpAsync(cancellationToken), cancellationToken); 68protected async override Task ExecuteAsync(CancellationToken stoppingToken) 70await Task.Yield(); 82private async Task OpenTcpAsync(CancellationToken cancellationToken)
Microsoft.Extensions.Diagnostics.Probes.Tests (4)
KubernetesProbesOptionsValidatorTests.cs (1)
69public async Task Validator_WhenHostStarts_Succeeds()
MockHealthCheckService.cs (1)
27return Task.FromResult(new HealthReport(healthStatusRecords, TimeSpan.Zero));
TcpEndpointProbesServiceTests.cs (2)
19public async Task ExecuteAsync_CheckListenerOpenAndCloseAfterHealthStatusEvents() 70public async Task ExecuteAsync_Does_Nothing_On_Cancellation()
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
ResourceMonitorService.cs (2)
104internal async Task PublishUtilizationAsync(CancellationToken cancellationToken) 123protected override async Task ExecuteAsync(CancellationToken cancellationToken)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes.Tests (4)
Linux\AcceptanceTest.cs (2)
27public async Task LinuxUtilizationProvider_MeasuredWithKubernetesMetadata() 153await Task.CompletedTask;
Windows\AcceptanceTest.cs (2)
23public async Task WindowsContainerSnapshotProvider_MeasuredWithKubernetesMetadata() 178await Task.CompletedTask;
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (13)
ResourceMonitoringServiceTests.cs (11)
187public async Task StartAsync_WithSimulatingThatTimeDidNotPass_NoUtilizationDataWillBeGathered() 217await Task.Delay(TimeSpan.FromMilliseconds(TimerPeriod * 3)); 226public async Task RunTrackerAsync_IfProviderThrows_LogsError() 276public async Task RunTrackerAsync_IfPublisherThrows_LogsError() 308public async Task ResourceUtilizationTracker_InitializedProperly_InvokesPublishers() 358public async Task ResourceUtilizationTracker_LogsSnapshotInformation() 386await Task.Delay(10); // Give the async loop time to process 396public async Task ResourceUtilizationTracker_WhenInitializedWithZeroSnapshots_ReportsHighCpuSpikesThenConvergeInFewCycles() 503public async Task ResourceUtilizationTracker_WhenInitializedWithProperSnapshots_ReportsNoHighCpuSpikes() 629public async Task StopAsync_CalledTwice_DoesNotThrow() 735public async Task Disposing_Service_Twice_Does_Not_Throw()
Windows\WindowsContainerSnapshotProviderTests.cs (1)
556public Task SnapshotProvider_EmitsLogRecord()
Windows\WindowsSnapshotProviderTests.cs (1)
65public Task SnapshotProvider_EmitsLogRecord()
Microsoft.Extensions.Diagnostics.Testing (5)
Metrics\MetricCollector.cs (3)
209public Task WaitForMeasurementsAsync(int minCount, CancellationToken cancellationToken = default) 220return Task.CompletedTask; 251public async Task WaitForMeasurementsAsync(int minCount, TimeSpan timeout)
parent\parent\parent\eng\MSBuild\parent\parent\src\LegacySupport\TaskWaitAsync\TaskExtensions.cs (2)
31return Task.FromCanceled<TResult>(cancellationToken); 43var t = await Task.WhenAny(task, tcs.Task).ConfigureAwait(false);
Microsoft.Extensions.Diagnostics.Testing.Tests (17)
Logging\FakeLogCollectorTests.LogEnumeration.cs (8)
26public async Task GetLogsAsync_EnumeratesNewLogsAsynchronouslyWithCancellationSupport(bool isWaitCancelled) 87public async Task GetLogsAsync_RegardlessOfClearDuringWait_SuppliesNextLogWhenRecorded(bool clearIsCalledDuringWait) 130private static async Task AssertAwaitingTaskCompleted(Task task) 132var timeout = Task.Delay(TimeSpan.FromSeconds(5)); 134var finishedTask = await Task.WhenAny(task, timeout);
Metrics\MetricCollectorTests.cs (9)
234public static async Task Wait() 250var wait = collector.WaitForMeasurementsAsync(2); 272public static async Task WaitWithCancellation() 284var wait = collector.WaitForMeasurementsAsync(1, cts.Token); 298public static async Task WaitWithTimeout() 312var wait = collector.WaitForMeasurementsAsync(2, TimeSpan.FromSeconds(1)); 331public static async Task WaitWithTimeout_CanceledFromTimeout() 345public static async Task Dispose() 356var wait = collector.WaitForMeasurementsAsync(2, TimeSpan.FromSeconds(1));
Microsoft.Extensions.DotNetDeltaApplier (6)
src\sdk\src\Dotnet.Watch\HotReloadAgent.Host\Listener.cs (5)
23public Task Listen(CancellationToken cancellationToken) 50return Task.CompletedTask; 53return Task.Run(async () => 71private async Task InitializeAsync(CancellationToken cancellationToken) 85private async Task ReceiveAndApplyUpdatesAsync(bool initialUpdates, CancellationToken cancellationToken)
src\sdk\src\Dotnet.Watch\HotReloadAgent.Host\StartupHook.cs (1)
83async Task SendAndForgetAsync()
Microsoft.Extensions.FileProviders.Physical (1)
PhysicalFilesWatcher.cs (1)
826Task.Factory.StartNew(
Microsoft.Extensions.Hosting (30)
HostingHostBuilderExtensions.cs (4)
384/// <returns>A <see cref="Task"/> that only completes when the token is triggered or shutdown is triggered.</returns> 389public static Task RunConsoleAsync(this IHostBuilder hostBuilder, CancellationToken cancellationToken = default) 400/// <returns>A <see cref="Task"/> that only completes when the token is triggered or shutdown is triggered.</returns> 405public static Task RunConsoleAsync(this IHostBuilder hostBuilder, Action<ConsoleLifetimeOptions> configureOptions, CancellationToken cancellationToken = default)
Internal\ConsoleLifetime.cs (6)
75/// <returns>A <see cref="Task"/> that represents the asynchronous registration operation.</returns> 76public Task WaitForStartAsync(CancellationToken cancellationToken) 95return Task.CompletedTask; 119/// <returns>A <see cref="Task"/> that represents a completed task.</returns> 120public Task StopAsync(CancellationToken cancellationToken) 123return Task.CompletedTask;
Internal\Host.cs (16)
33private List<Task>? _backgroundServiceTasks; 74public async Task StartAsync(CancellationToken cancellationToken = default) 219Task monitorTask = TryExecuteBackgroundServiceAsync(backgroundService); 220List<Task> bgTasks = LazyInitializer.EnsureInitialized(ref _backgroundServiceTasks); 270private async Task TryExecuteBackgroundServiceAsync(BackgroundService backgroundService) 273Task? backgroundTask = backgroundService.ExecuteTask; 317public async Task StopAsync(CancellationToken cancellationToken = default) 396Task bgMonitoringTasks = Task.WhenAll(_backgroundServiceTasks); 400await Task.WhenAny(bgMonitoringTasks, tcs.Task).ConfigureAwait(false); 436private static async Task ForeachService<T>( 442Func<T, CancellationToken, Task> operation) 449List<Task>? tasks = null; 453Task task; 485Task groupedTasks = Task.WhenAll(tasks);
Internal\NullLifetime.cs (4)
14public Task WaitForStartAsync(CancellationToken cancellationToken) 16return Task.CompletedTask; 19public Task StopAsync(CancellationToken cancellationToken) 21return Task.CompletedTask;
Microsoft.Extensions.Hosting.Abstractions (39)
BackgroundService.cs (11)
15private Task? _executeTask; 24public virtual Task? ExecuteTask => _executeTask; 31/// <returns>A <see cref="Task"/> that represents the long running operations.</returns> 33protected abstract Task ExecuteAsync(CancellationToken stoppingToken); 39/// <returns>A <see cref="Task"/> that represents the asynchronous Start operation.</returns> 40public virtual Task StartAsync(CancellationToken cancellationToken) 48? Task.FromCanceled(cancellationToken) 49: Task.Run(() => ExecuteAsync(stoppingToken), CancellationToken.None); 52return Task.CompletedTask; 59/// <returns>A <see cref="Task"/> that represents the asynchronous Stop operation.</returns> 60public virtual async Task StopAsync(CancellationToken cancellationToken)
HostingAbstractionsHostExtensions.cs (8)
31/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 32public static async Task StopAsync(this IHost host, TimeSpan timeout) 57/// Runs an application and returns a <see cref="Task"/> that only completes when the token is triggered or shutdown is triggered. 62/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 63public static async Task RunAsync(this IHost host, CancellationToken token = default) 89/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 90public static async Task WaitForShutdownAsync(this IHost host, CancellationToken token = default) 101await Task.Delay(Timeout.Infinite, applicationLifetime.ApplicationStopping).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing);
IHost.cs (4)
25/// <returns>A <see cref="Task"/> that will be completed when the <see cref="IHost"/> starts.</returns> 26Task StartAsync(CancellationToken cancellationToken = default); 32/// <returns>A <see cref="Task"/> that will be completed when the <see cref="IHost"/> stops.</returns> 33Task StopAsync(CancellationToken cancellationToken = default);
IHostedLifecycleService.cs (8)
20/// <returns>A <see cref="Task"/> that represents the asynchronous operation.</returns> 21Task StartingAsync(CancellationToken cancellationToken); 27/// <returns>A <see cref="Task"/> that represents the asynchronous operation.</returns> 28Task StartedAsync(CancellationToken cancellationToken); 34/// <returns>A <see cref="Task"/> that represents the asynchronous operation.</returns> 35Task StoppingAsync(CancellationToken cancellationToken); 41/// <returns>A <see cref="Task"/> that represents the asynchronous operation.</returns> 42Task StoppedAsync(CancellationToken cancellationToken);
IHostedService.cs (4)
18/// <returns>A <see cref="Task"/> that represents the asynchronous Start operation.</returns> 19Task StartAsync(CancellationToken cancellationToken); 25/// <returns>A <see cref="Task"/> that represents the asynchronous Stop operation.</returns> 26Task StopAsync(CancellationToken cancellationToken);
IHostLifetime.cs (4)
19/// <returns>A <see cref="Task"/>.</returns> 20Task WaitForStartAsync(CancellationToken cancellationToken); 26/// <returns>A <see cref="Task"/>.</returns> 27Task StopAsync(CancellationToken cancellationToken);
Microsoft.Extensions.Hosting.Systemd (4)
SystemdLifetime.cs (4)
59public Task StopAsync(CancellationToken cancellationToken) 61return Task.CompletedTask; 73public Task WaitForStartAsync(CancellationToken cancellationToken) 88return Task.CompletedTask;
Microsoft.Extensions.Hosting.Testing (8)
FakeHost.cs (4)
66/// <returns>A <see cref="Task"/> that will be completed when the <see cref="IHost"/> starts.</returns> 68public async Task StartAsync(CancellationToken cancellationToken = default) 89/// <returns>A <see cref="Task"/> that will be completed when the <see cref="IHost"/> stops.</returns> 91public async Task StopAsync(CancellationToken cancellationToken = default)
FakeHostingExtensions.cs (2)
31/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 32public static async Task StartAndStopAsync(this IHostedService service, CancellationToken cancellationToken = default)
HostTerminatorService.cs (2)
41/// <returns>A <see cref="Task"/> that represents the long running operations.</returns> 42protected override async Task ExecuteAsync(CancellationToken stoppingToken)
Microsoft.Extensions.Hosting.Testing.Tests (30)
FakeHostTests.cs (16)
19public async Task CreateBuilder_AddsFakeLogging() 26public async Task Host_ShutsDownAfterTimeout() 50await Task.Delay(100); 57public async Task StartAsync_NoTokenProvided_UsesDefaultTimeout() 62.Returns(Task.CompletedTask); 72await Task.Delay(100); 79public async Task StartAsync_TokenProvided_Starts() 85.Returns(Task.CompletedTask); 98var task = new Task(() => { }); 122public async Task StopAsync_NoTokenProvided_UsesDefaultTimeout() 127.Returns(Task.CompletedTask); 138public async Task StopAsync_TokenProvided_Stops() 144.Returns(Task.CompletedTask); 157var task = new Task(() => { }); 185hostMock.Setup(x => x.StopAsync(It.IsAny<CancellationToken>())).Returns(Task.CompletedTask); 198hostMock.Setup(x => x.StopAsync(It.IsAny<CancellationToken>())).Returns(Task.CompletedTask);
HostingFakesExtensionsTests.cs (7)
19public async Task StartAndStop_NullGiven_Throws() 26public async Task StartAndStop_ServiceGiven_StartsAndStopsTheService() 31serviceMock.Setup(x => x.StartAsync(tokenSource.Token)).Returns(Task.CompletedTask); 32serviceMock.Setup(x => x.StopAsync(tokenSource.Token)).Returns(Task.CompletedTask); 40public async Task GetFakeLogCollector_FetchesGetFakeLogCollector() 59public async Task GetFakeRedactionCollector_FetchesFakeRedactionCollector() 311public async Task AddLoggingCallback_CallbackUsed_AddsCallback()
HostTerminatorServiceTests.cs (7)
17public async Task ExecuteAsync_ServiceCanceled_DoesNothing() 31public async Task ExecuteAsync_TimeToLiveUp_LogsAndDisposesHost() 37hostMock.Setup(x => x.StopAsync(It.IsAny<CancellationToken>())).Returns(Task.CompletedTask); 41var task = RunProtectedExecuteAsync(sut, CancellationToken.None); 53public async Task ExecuteAsync_DebuggerAttached_DoesNothing() 68private static Task RunProtectedExecuteAsync(HostTerminatorService instance, CancellationToken cancellationToken) 72return (Task)methodInfo.Invoke(instance, new object[] { cancellationToken })!;
Microsoft.Extensions.Hosting.WindowsServices (3)
WindowsServiceLifetime.cs (3)
75public Task WaitForStartAsync(CancellationToken cancellationToken) 123public async Task StopAsync(CancellationToken cancellationToken) 129await Task.Run(Stop, cancellationToken).ConfigureAwait(false);
Microsoft.Extensions.Http.Diagnostics (10)
Logging\Internal\HttpRequestReader.cs (2)
100public async Task ReadResponseAsync(LogRecord logRecord, HttpResponseMessage response, 118public async Task ReadRequestAsync(LogRecord logRecord, HttpRequestMessage request,
Logging\Internal\HttpResponseBodyReader.cs (3)
206private static Task WriteStreamToPipeAsync(Stream stream, PipeWriter writer, CancellationToken cancellationToken) 207=> Task.Run(() => WriteStreamToPipeImplAsync(stream, writer, cancellationToken), CancellationToken.None); 209private static async Task WriteStreamToPipeImplAsync(Stream stream, PipeWriter writer, CancellationToken cancellationToken)
Logging\Internal\IHttpRequestReader.cs (2)
24Task ReadResponseAsync(LogRecord record, HttpResponseMessage response, 36Task ReadRequestAsync(LogRecord record, HttpRequestMessage request,
parent\parent\parent\eng\MSBuild\parent\parent\src\LegacySupport\TaskWaitAsync\TaskExtensions.cs (3)
9/// Provides a set of static methods for <see cref="Task"/>. 31return Task.FromCanceled<TResult>(cancellationToken); 43var t = await Task.WhenAny(task, tcs.Task).ConfigureAwait(false);
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (3)
NoRemoteCallHandler.cs (1)
46return Task.FromResult(response);
NoRemoteCallNotSeekableHandler.cs (1)
49return Task.FromResult(response);
NotSeekableStream.cs (1)
36public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => _innerStream.WriteAsync(buffer, offset, count, cancellationToken);
Microsoft.Extensions.Http.Diagnostics.Tests (85)
Latency\Internal\HttpLatencyMediatorTests.cs (1)
45public async Task HttpLatencyTelemetryHandler_UsesMediator()
Latency\Internal\HttpLatencyTelemetryHandlerTest.cs (2)
43public async Task HttpLatencyTelemetryHandler_SetsLatencyContext() 73}).Returns(Task.FromResult(resp.Object));
Logging\AcceptanceTests.cs (12)
28public async Task AddHttpClientLogEnricher_WhenNullEnricherRegistered_SkipsNullEnrichers() 60public async Task HttpClientLogger_WhenEnricherThrows_EmitsErrorAndKeepsExecution() 94public async Task AddHttpClientLogging_ServiceCollectionAndEnrichers_EnrichesLogsWithAllEnrichers() 131public async Task AddHttpClientLogging_WithNamedHttpClients_WorksCorrectly() 208public async Task AddHttpClientLogging_WithTypedHttpClients_WorksCorrectly() 291public async Task AddHttpClientLogging_RedactSensitiveParams(HttpRouteParameterRedactionMode parameterRedactionMode, string redactedPath) 333public async Task AddHttpClientLogging_StructuredPathLogging_RedactsSensitiveParams( 402public async Task AddHttpClientLogging_NamedHttpClient_RedactSensitiveParams(HttpRouteParameterRedactionMode parameterRedactionMode, string redactedPath) 579public async Task AddHttpClientLogging_DisablesNetScope() 601public async Task AddHttpClientLogging_CallFromOtherClient_HasBuiltInLogging() 629public async Task AddDefaultHttpClientLogging_DisablesNetScope() 655public async Task HttpClientLoggingHandler_LogsBodyDataUpToSpecifiedLimit(int limit)
Logging\HttpClientLoggerTest.cs (26)
52public async Task SendAsync_NullRequest_ThrowsException() 68new TestingHandlerStub((_, _) => Task.FromResult(httpResponseMessage))); 79public async Task SendAsync_HttpRequestException_ThrowsException() 115public async Task Logger_WhenReadRequestAsyncThrows_DoesntThrow() 146new TestingHandlerStub((_, _) => Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK)))); 158public async Task HttpLoggingHandler_AllOptions_LogsOutgoingRequest() 235new TestingHandlerStub((_, _) => Task.FromResult(httpResponseMessage))); 259public async Task HttpLoggingHandler_AllOptionsWithLogRequestStart_LogsOutgoingRequestWithTwoRecords() 332new TestingHandlerStub((_, _) => Task.FromResult(httpResponseMessage))); 366public async Task HttpLoggingHandler_AllOptionsSendAsyncFailed_LogsRequestInformation() 463public async Task HttpLoggingHandler_ReadResponseThrows_LogsException() 552new TestingHandlerStub((_, _) => Task.FromResult(httpResponseMessage))); 579public async Task HttpLoggingHandler_AllOptionsTransferEncodingIsNotChunked_LogsOutgoingRequest() 646new TestingHandlerStub((_, _) => Task.FromResult(httpResponseMessage))); 669public async Task HttpLoggingHandler_WithEnrichers_CallsEnrichMethodExactlyOnce() 690new TestingHandlerStub((_, _) => Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK)))); 710public async Task HttpLoggingHandler_WithEnrichersAndLogRequestStart_CallsEnrichMethodExactlyOnce() 733new TestingHandlerStub((_, _) => Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK)))); 753public async Task HttpLoggingHandler_WithEnrichers_OneEnricherThrows_LogsEnrichmentErrorAndRequest() 771(_, _) => Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK)))); 796public async Task HttpLoggingHandler_WithEnrichers_SendAsyncAndOneEnricher_LogsEnrichmentErrorAndRequestError() 842public async Task HttpLoggingHandler_AllOptionsTransferEncodingChunked_LogsOutgoingRequest() 920return Task.FromResult(httpResponseMessage); 950public async Task HttpLoggingHandler_OnDifferentHttpStatusCodes_LogsOutgoingRequestWithAppropriateLogLevel( 962Task.FromResult(new HttpResponseMessage((HttpStatusCode)httpStatusCode)))); 979public async Task HttpClientLogger_LogsAnError_WhenResponseReaderThrows()
Logging\HttpClientLoggingExtensionsTest.cs (5)
204public async Task AddHttpClientLogging_GivenInvalidOptions_Throws() 529public async Task AddHttpClientLogging_ServiceCollection_GivenInvalidOptions_Throws() 651public async Task LatencyInfo_IsPopulated_WhenLoggerWrapsHandlersPipeline() 685public async Task AddExtendedHttpClientLogging_WrapHandlersPipelineParameter_LogsCorrectNumberOfAttempts() 743return Task.FromResult(responseFactory(request));
Logging\HttpRequestBodyReaderTest.cs (9)
31public async Task Reader_SimpleContent_ReadsContent() 52public async Task Reader_EmptyContent_ErrorMessage() 73public async Task Reader_UnreadableContent_ErrorMessage( 96public async Task Reader_OperationCanceled_ThrowsTaskCanceledException() 122public async Task Reader_BigContent_TrimsAtTheEnd([CombinatorialValues(32, 256, 4095, 4096, 4097, 65536, 131072)] int limit) 146public async Task Reader_SmallContentBigLimit_ReadsCorrectly([CombinatorialValues(32, 256, 4095, 4096, 4097, 65536, 131072)] int limit) 169public async Task Reader_ReadingTakesTooLong_Timesout() 202public async Task Reader_NullContent_ReturnsEmpty() 223public async Task Reader_MethodIsGet_ReturnsEmpty()
Logging\HttpRequestReaderTest.cs (16)
41public async Task ReadAsync_AllData_ReturnsLogRecord() 112public async Task ReadAsync_NoHost_ReturnsLogRecordWithoutHost() 171public async Task ReadAsync_AllDataWithRequestMetadataSet_ReturnsLogRecord() 244public async Task ReadAsync_FormatRequestPathDisabled_ReturnsLogRecordWithRoute() 323public async Task ReadAsync_RouteParameterRedactionModeNone_ReturnsLogRecordWithUnredactedRoute() 380public async Task ReadAsync_RequestMetadataRequestNameSetAndRouteMissing_ReturnsLogRecord() 453public async Task ReadAsync_NoMetadataUsesRedactedString_ReturnsLogRecord() 522public async Task ReadAsync_MetadataWithoutRequestRouteOrName_UsesRedactedPath_ReturnsLogRecord() 592public async Task ReadAsync_DependencyMetadataResolverReturnsHostDefaults_UsesRedactedPath() 627public async Task ReadAsync_SetsQueryParameters_WhenClassificationPresent() 676public async Task ReadAsync_SkipsQueryString_WhenClassificationEmpty() 703public async Task ReadAsync_SetsEmptyQueryParameters_WhenNoMatchingClassification() 734public async Task ReadAsync_SetsMultipleQueryParameters_WhenMultipleClassifications() 770public async Task LogRequestStartAsync_LogsQueryParameters_TagArray() 824public async Task ReadAsync_DoesntSetQueryString_WhenQueryValueEmpty() 858public async Task ReadAsync_RedactsPathAndQueryParameters()
Logging\HttpResponseBodyReaderTest.cs (10)
39public async Task Reader_SimpleContent_ReadsContent() 59public async Task Reader_NoContentType_ErrorMessage() 78public async Task Reader_EmptyContent_ReturnsEmptyString() 97public async Task Reader_UnreadableContent_ErrorMessage( 120public async Task Reader_OperationCanceled_ThrowsTaskCanceledException() 143public async Task Reader_BigContent_TrimsAtTheEnd([CombinatorialValues(32, 256, 4095, 4096, 4097, 65536, 131072)] int limit) 170public async Task Reader_ReaderCancelledAfterBuffering_ShouldCancelPipeReader() 205public async Task Reader_ReadingTakesTooLong_TimesOut() 233public async Task Reader_ReadingTakesTooLongAndOperationCancelled_Throws() 281public async Task Reader_DebuggerAttached_ReadsBodyAndLeavesContentReadable(bool seekable, bool bufferContent)
Logging\Internal\MockedRequestReader.cs (2)
22public Task ReadResponseAsync(LogRecord record, 27public Task ReadRequestAsync(LogRecord record,
Logging\Internal\NoRemoteCallHandler.cs (1)
40return Task.FromResult(response);
Logging\Internal\NotSeekableStream.cs (1)
37public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => _innerStream.WriteAsync(buffer, offset, count, cancellationToken);
Microsoft.Extensions.Http.Resilience.PerformanceTests (1)
NoRemoteCallHandler.cs (1)
23_completedResponse = Task.FromResult(_response);
Microsoft.Extensions.Http.Resilience.Tests (62)
BuildTransitive\GrpcNetClientFactoryVersionTargetTests.cs (5)
188public async Task CheckGrpcNetClientFactoryVersion_CompatibleVersion_DoesNotWarnOrFail( 201public async Task CheckGrpcNetClientFactoryVersion_IncompatibleVersion_Warns( 215public async Task CheckGrpcNetClientFactoryVersion_VersionWithoutComparableSystemVersion_DoesNotFail(string version) 336private static async Task ObserveOutputTasksAsync(Task<string> standardOutputTask, Task<string> standardErrorTask) 341await Task.WhenAll(standardOutputTask, standardErrorTask).ConfigureAwait(false);
Hedging\HedgingTests.cs (11)
80public async Task Send_EnsureContextFlows(bool asynchronous = true) 118public async Task Send_NoErrors_ShouldReturnSingleResponse(bool asynchronous = true) 140public async Task Send_NoRoutes_Throws(bool asynchronous = true) 162public async Task Send_NoRoutesLeftAndNoResult_ShouldThrow(bool asynchronous = true) 187public async Task Send_NoRoutesLeftAndSomeResultPresent_ShouldReturn(bool asynchronous = true) 211public async Task Send_EnsureDistinctContextForEachAttempt(bool asynchronous = true) 235public async Task Send_EnsureContextReplacedInRequestMessage(bool asynchronous = true) 263public async Task Send_NoRoutesLeft_EnsureLessThanMaxHedgedAttempts(bool asynchronous = true) 287public async Task Send_FailedExecution_ShouldReturnResponseFromHedging(bool asynchronous = true) 318return Task.FromResult(client.Send(request, cancellationToken)); 358return Task.FromResult(_responses.Dequeue());
Hedging\StandardHedgingTests.cs (8)
204public async Task VerifyPipelineSelection(string? customKey, bool asynchronous = true) 237public async Task DynamicReloads_Ok(bool asynchronous = true) 282public async Task NoRouting_Ok(bool asynchronous = true) 304public async Task Send_FailedConnect_ShouldReturnResponseFromHedging(bool asynchronous = true) 356await Task.Delay(100, cancellationToken); 360await Task.Delay(1000, cancellationToken); 370Task.Delay(100, cancellationToken).GetAwaiter().GetResult(); 374Task.Delay(1000, cancellationToken).GetAwaiter().GetResult();
Helpers\TestHandlerStub.cs (1)
17: this((_, _) => Task.FromResult(new HttpResponseMessage(statusCode)))
Internal\RequestMessageSnapshotStrategyTests.cs (1)
18public async Task ExecuteAsync_EnsureSnapshotAttached()
Polly\HttpCircuitBreakerStrategyOptionsTests.cs (2)
57public async Task ShouldHandleResultAsError_DefaultValue_ShouldClassify(HttpStatusCode statusCode, bool expectedCondition) 66public async Task ShouldHandleException_DefaultValue_ShouldClassify(Exception exception, bool expectedToHandle)
Polly\HttpRetryStrategyOptionsExtensionsTests.cs (5)
44public async Task DisableFor_PositiveScenario(string httpMethod, bool shouldHandle) 56public async Task DisableFor_RespectsOriginalShouldHandlePredicate() 68public async Task DisableFor_ResponseMessageIsNull_RetrievesRequestMessageFromContext() 81public async Task DisableFor_RequestMessageIsNull_DoesNotDisableRetries() 103public async Task DisableForUnsafeHttpMethods_PositiveScenario(string httpMethod, bool shouldHandle)
Polly\HttpRetryStrategyOptionsTests.cs (6)
56public async Task ShouldHandleResultAsError_DefaultValue_ShouldClassify(HttpStatusCode statusCode, bool expectedCondition) 67public async Task ShouldHandleException_DefaultValue_ShouldClassify(Exception exception, CancellationToken? token, bool expectedToHandle) 81public async Task ShouldHandleResultAsError_DefaultInstance_ShouldClassify(HttpStatusCode statusCode, bool expectedCondition) 91public async Task ShouldHandleException_DefaultInstance_ShouldClassify(Exception exception, CancellationToken? token, bool expectedToHandle) 99public async Task ShouldRetryAfterHeader_InvalidOutcomes_ShouldReturnNull() 127public async Task ShouldRetryAfterHeader_WhenResponseContainsRetryAfterHeader_ShouldReturnTimeSpan()
Resilience\GrpcResilienceTests.cs (6)
50public async Task SayHello_NoResilience_OK(bool asynchronous) 59public async Task SayHello_StandardResilience_OK(bool asynchronous) 69public async Task SayHello_StandardHedging_OK(bool asynchronous) 79public async Task SayHello_CustomResilience_OK(bool asynchronous) 97return Task.FromResult(client.SayHello(request)); 121return Task.FromResult(new HelloReply { Message = "HI!" });
Resilience\HttpClientBuilderExtensionsTests.BySelector.cs (1)
108public async Task SelectPipelineByAuthority_EnsureResiliencePipelineProviderCall(
Resilience\HttpClientBuilderExtensionsTests.Resilience.cs (5)
64public async Task AddResilienceHandler_OnPipelineDisposed_EnsureCalled(bool asynchronous = true) 116public async Task AddResilienceHandler_EnsureErrorType(bool asynchronous = true) 146public async Task AddResilienceHandler_EnsureResilienceHandlerContext(bool asynchronous = true) 200public async Task AddResilienceHandler_EnsureProperPipelineInstanceRetrieved(bool bySelector, bool asynchronous = true) 245public async Task AddResilienceHandlerBySelector_EnsureResiliencePipelineProviderCalled(bool asynchronous = true)
Resilience\HttpClientBuilderExtensionsTests.Standard.cs (3)
50return Task.FromResult(client.Send(request, default)); 225public async Task DynamicReloads_Ok(bool asynchronous = true) 245return Task.FromResult(new HttpResponseMessage(HttpStatusCode.InternalServerError));
Resilience\ResilienceHandlerTest.cs (8)
26public async Task Send_EnsureRequestMetadataFlows(bool resilienceContextSet, bool asynchronous = true) 64public async Task Send_EnsureExecutionContext(bool executionContextSet, bool asynchronous = true) 96public async Task Send_EnsureInvoker(bool executionContextSet, bool asynchronous = true) 112return Task.FromResult(new HttpResponseMessage { StatusCode = HttpStatusCode.Created }); 126public async Task Send_EnsureCancellationTokenFlowsToResilienceContext(bool asynchronous = true) 137return Task.FromResult(new HttpResponseMessage { StatusCode = HttpStatusCode.Created }); 151public async Task Send_Exception_EnsureRethrown(bool asynchronous = true) 175return Task.FromResult(invoker.Send(request, cancellationToken));
Microsoft.Extensions.Identity.Core (180)
AuthenticatorTokenProvider.cs (1)
37return Task.FromResult(string.Empty);
DefaultUserConfirmation.cs (1)
19/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the confirmation operation.</returns>
IRoleClaimStore.cs (2)
34Task AddClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken)); 43Task RemoveClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken));
IRoleStore.cs (4)
62/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 63Task SetRoleNameAsync(TRole role, string? roleName, CancellationToken cancellationToken); 79/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 80Task SetNormalizedRoleNameAsync(TRole role, string? normalizedName, CancellationToken cancellationToken);
IUserAuthenticationTokenStore.cs (5)
23/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 24Task SetTokenAsync(TUser user, string loginProvider, string name, string? value, CancellationToken cancellationToken); 33/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 34Task RemoveTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken); 43/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns>
IUserAuthenticatorKeyStore.cs (3)
21/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 22Task SetAuthenticatorKeyAsync(TUser user, string key, CancellationToken cancellationToken); 29/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the security stamp for the specified <paramref name="user"/>.</returns>
IUserClaimsPrincipalFactory.cs (1)
20/// <returns>The <see cref="Task"/> that represents the asynchronous creation operation, containing the created <see cref="ClaimsPrincipal"/>.</returns>
IUserClaimStore.cs (3)
34Task AddClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken); 44Task ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken); 53Task RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken);
IUserEmailStore.cs (3)
22Task SetEmailAsync(TUser user, string? email, CancellationToken cancellationToken); 51Task SetEmailConfirmedAsync(TUser user, bool confirmed, CancellationToken cancellationToken); 80Task SetNormalizedEmailAsync(TUser user, string? normalizedEmail, CancellationToken cancellationToken);
IUserLockoutStore.cs (9)
35/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 36Task SetLockoutEndDateAsync(TUser user, DateTimeOffset? lockoutEnd, CancellationToken cancellationToken); 43/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the incremented failed access count.</returns> 51/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 53Task ResetAccessFailedCountAsync(TUser user, CancellationToken cancellationToken); 60/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the failed access count.</returns> 69/// The <see cref="Task"/> that represents the asynchronous operation, true if a user can be locked out, otherwise false. 79/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 80Task SetLockoutEnabledAsync(TUser user, bool enabled, CancellationToken cancellationToken);
IUserLoginStore.cs (6)
23/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 24Task AddLoginAsync(TUser user, UserLoginInfo login, CancellationToken cancellationToken); 34/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 35Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey, CancellationToken cancellationToken); 43/// The <see cref="Task"/> for the asynchronous operation, containing a list of <see cref="UserLoginInfo"/> for the specified <paramref name="user"/>, if any. 54/// The <see cref="Task"/> for the asynchronous operation, containing the user, if any which matched the specified login provider and key.
IUserPasskeyStore.cs (7)
24/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 25Task AddOrUpdatePasskeyAsync(TUser user, UserPasskeyInfo passkey, CancellationToken cancellationToken); 32/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing a list of the user's passkeys.</returns> 41/// The <see cref="Task"/> that represents the asynchronous operation, containing the user, if any, associated with the specified passkey credential id. 51/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the user's passkey information.</returns> 60/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 61Task RemovePasskeyAsync(TUser user, byte[] credentialId, CancellationToken cancellationToken);
IUserPasswordStore.cs (4)
21/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 22Task SetPasswordHashAsync(TUser user, string? passwordHash, CancellationToken cancellationToken); 29/// <returns>The <see cref="Task"/> that represents the asynchronous operation, returning the password hash for the specified <paramref name="user"/>.</returns> 38/// The <see cref="Task"/> that represents the asynchronous operation, returning true if the specified <paramref name="user"/> has a password
IUserPhoneNumberStore.cs (6)
21/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 22Task SetPhoneNumberAsync(TUser user, string? phoneNumber, CancellationToken cancellationToken); 29/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the user's telephone number, if any.</returns> 38/// The <see cref="Task"/> that represents the asynchronous operation, returning true if the specified <paramref name="user"/> has a confirmed 49/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 50Task SetPhoneNumberConfirmedAsync(TUser user, bool confirmed, CancellationToken cancellationToken);
IUserRoleStore.cs (7)
22/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 23Task AddToRoleAsync(TUser user, string roleName, CancellationToken cancellationToken); 31/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 32Task RemoveFromRoleAsync(TUser user, string roleName, CancellationToken cancellationToken); 39/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing a list of role names.</returns> 49/// The <see cref="Task"/> that represents the asynchronous operation, containing a flag indicating whether the specified <paramref name="user"/> is 60/// The <see cref="Task"/> that represents the asynchronous operation, containing a list of users who are in the named role.
IUserSecurityStampStore.cs (3)
21/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 22Task SetSecurityStampAsync(TUser user, string stamp, CancellationToken cancellationToken); 29/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the security stamp for the specified <paramref name="user"/>.</returns>
IUserStore.cs (12)
21/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the identifier for the specified <paramref name="user"/>.</returns> 29/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the name for the specified <paramref name="user"/>.</returns> 38/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 39Task SetUserNameAsync(TUser user, string? userName, CancellationToken cancellationToken); 46/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the normalized user name for the specified <paramref name="user"/>.</returns> 55/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 56Task SetNormalizedUserNameAsync(TUser user, string? normalizedName, CancellationToken cancellationToken); 63/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the creation operation.</returns> 71/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the update operation.</returns> 79/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the delete operation.</returns> 88/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="userId"/> if it exists. 98/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="normalizedUserName"/> if it exists.
IUserTwoFactorRecoveryCodeStore.cs (1)
23Task ReplaceCodesAsync(TUser user, IEnumerable<string> recoveryCodes, CancellationToken cancellationToken);
IUserTwoFactorStore.cs (3)
22/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 23Task SetTwoFactorEnabledAsync(TUser user, bool enabled, CancellationToken cancellationToken); 32/// The <see cref="Task"/> that represents the asynchronous operation, containing a flag indicating whether the specified
IUserTwoFactorTokenProvider.cs (3)
21/// The <see cref="Task"/> that represents the asynchronous operation, containing the token for the specified 44/// The <see cref="Task"/> that represents the asynchronous operation, containing the a flag indicating the result 57/// The <see cref="Task"/> that represents the asynchronous operation, containing the a flag indicating if a two
IUserValidator.cs (1)
19/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the validation operation.</returns>
PasswordValidator.cs (1)
77Task.FromResult(errors?.Count > 0
PhoneNumberTokenProvider.cs (2)
25/// The <see cref="Task"/> that represents the asynchronous operation, containing the a flag indicating if a two 46/// The <see cref="Task"/> that represents the asynchronous operation, containing a constant modifier for the specified
RoleManager.cs (14)
153/// The <see cref="Task"/> that represents the asynchronous operation. 174/// The <see cref="Task"/> that represents the asynchronous operation. 176public virtual async Task UpdateNormalizedRoleNameAsync(TRole role) 187/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> for the update. 202/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> for the delete. 217/// The <see cref="Task"/> that represents the asynchronous operation, containing true if the role name exists, otherwise false. 243/// The <see cref="Task"/> that represents the asynchronous operation, containing the role 257/// The <see cref="Task"/> that represents the asynchronous operation, containing the name of the 272/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 289/// The <see cref="Task"/> that represents the asynchronous operation, containing the ID of the 303/// The <see cref="Task"/> that represents the asynchronous operation, containing the role 320/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 340/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 358/// The <see cref="Task"/> that represents the asynchronous operation, containing the list of <see cref="Claim"/>s
TotpSecurityStampBasedTokenProvider.cs (4)
25/// The <see cref="Task"/> that represents the asynchronous operation, containing the token for the specified 55/// The <see cref="Task"/> that represents the asynchronous operation, containing the a flag indicating the result 80/// The <see cref="Task"/> that represents the asynchronous operation, containing a constant modifier for the specified 98/// The <see cref="Task"/> that represents the asynchronous operation, containing the a flag indicating if a two
UserClaimsPrincipalFactory.cs (3)
58/// <returns>The <see cref="Task"/> that represents the asynchronous creation operation, containing the created <see cref="ClaimsPrincipal"/>.</returns> 70/// <returns>The <see cref="Task"/> that represents the asynchronous creation operation, containing the created <see cref="ClaimsIdentity"/>.</returns> 135/// <returns>The <see cref="Task"/> that represents the asynchronous creation operation, containing the created <see cref="ClaimsIdentity"/>.</returns>
UserManager.cs (70)
460return id == null ? Task.FromResult<TUser?>(null) : FindByIdAsync(id); 468/// The <see cref="Task"/> that represents the asynchronous operation, containing the security 473return Task.FromResult(Guid.NewGuid().ToString()); 482/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 526/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 552/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 581/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="userId"/> if it exists. 594/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="userName"/> if it exists. 632/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 696/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 697public virtual async Task UpdateNormalizedUserNameAsync(TUser user) 708/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the name for the specified <paramref name="user"/>.</returns> 721/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 745/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the identifier for the specified <paramref name="user"/>.</returns> 758/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing true if 809/// The <see cref="Task"/> that represents the asynchronous operation, returning true if the specified <paramref name="user"/> has a password 828/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 875/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 918/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 947/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="PasswordVerificationResult"/> 966/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the security stamp for the specified <paramref name="user"/>.</returns> 986/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1016/// <returns>The <see cref="Task"/> that represents the asynchronous operation, 1032/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1065/// The <see cref="Task"/> for the asynchronous operation, containing the user, if any which matched the specified login provider and key. 1084/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1115/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1156/// The <see cref="Task"/> for the asynchronous operation, containing a list of <see cref="UserLoginInfo"/> for the specified <paramref name="user"/>, if any. 1172/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1186/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1216/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1246/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1260/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1304/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1344/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1388/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1435/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1477/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing a list of role names.</returns> 1492/// The <see cref="Task"/> that represents the asynchronous operation, containing a flag indicating whether the specified <paramref name="user"/> is 1522/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1590public virtual async Task UpdateNormalizedEmailAsync(TUser user) 1605/// The <see cref="Task"/> that represents the asynchronous operation, an email confirmation token. 1619/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1675/// The <see cref="Task"/> that represents the asynchronous operation, an email change token. 1690/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1728/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the user's telephone number, if any.</returns> 1743/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1775/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 1816/// The <see cref="Task"/> that represents the asynchronous operation, returning true if the specified <paramref name="user"/> has a confirmed 1833/// The <see cref="Task"/> that represents the asynchronous operation, containing the telephone change number token. 1848/// The <see cref="Task"/> that represents the asynchronous operation, returning true if the <paramref name="token"/> 1869/// The <see cref="Task"/> that represents the asynchronous operation, returning true if the <paramref name="token"/> 1908/// The <see cref="Task"/> that represents result of the asynchronous operation, a token for 1952/// The <see cref="Task"/> that represents result of the asynchronous operation, a list of two 1977/// The <see cref="Task"/> that represents result of the asynchronous operation, true if the token is valid, 2014/// The <see cref="Task"/> that represents result of the asynchronous operation, a two factor authentication token 2044/// The <see cref="Task"/> that represents the asynchronous operation, true if the specified <paramref name="user "/> 2062/// The <see cref="Task"/> that represents the asynchronous operation, the <see cref="IdentityResult"/> of the operation 2090/// The <see cref="Task"/> that represents the asynchronous operation, true if the specified <paramref name="user "/> 2113/// The <see cref="Task"/> that represents the asynchronous operation, the <see cref="IdentityResult"/> of the operation 2139/// The <see cref="Task"/> that represents the asynchronous operation, true if a user can be locked out, otherwise false. 2170/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the operation.</returns> 2208/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the operation.</returns> 2241/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the operation.</returns> 2276/// <returns>The <see cref="Task"/> that contains the result the asynchronous operation, the current failed access count 2656/// The <see cref="Task"/> that represents the asynchronous operation, containing a list of the user's passkeys. 2673/// The <see cref="Task"/> that represents the asynchronous operation, containing the passkey if found; otherwise <see langword="null"/>. 2690/// The <see cref="Task"/> that represents the asynchronous operation, containing the user if found, otherwise <see langword="null"/>. 2707/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> 2818private async Task UpdateSecurityStampInternal(TUser user)
UserValidator.cs (1)
39/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the validation operation.</returns>
Microsoft.Extensions.Identity.Stores (109)
RoleStoreBase.cs (13)
84return Task.FromResult(ConvertIdToString(role.Id)!); 98return Task.FromResult(role.Name); 107/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 108public virtual Task SetRoleNameAsync(TRole role, string? roleName, CancellationToken cancellationToken = default(CancellationToken)) 114return Task.CompletedTask; 174return Task.FromResult(role.NormalizedName); 183/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 184public virtual Task SetNormalizedRoleNameAsync(TRole role, string? normalizedName, CancellationToken cancellationToken = default(CancellationToken)) 190return Task.CompletedTask; 220/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 221public abstract Task AddClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken)); 229/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 230public abstract Task RemoveClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken));
UserStoreBase.cs (96)
115/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the identifier for the specified <paramref name="user"/>.</returns> 121return Task.FromResult(ConvertIdToString(user.Id)!); 129/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the name for the specified <paramref name="user"/>.</returns> 135return Task.FromResult(user.UserName); 144/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 145public virtual Task SetUserNameAsync(TUser user, string? userName, CancellationToken cancellationToken = default(CancellationToken)) 151return Task.CompletedTask; 159/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the normalized user name for the specified <paramref name="user"/>.</returns> 165return Task.FromResult(user.NormalizedUserName); 174/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 175public virtual Task SetNormalizedUserNameAsync(TUser user, string? normalizedName, CancellationToken cancellationToken = default(CancellationToken)) 181return Task.CompletedTask; 189/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the creation operation.</returns> 197/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the update operation.</returns> 205/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="IdentityResult"/> of the update operation.</returns> 214/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="userId"/> if it exists. 254/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="normalizedUserName"/> if it exists. 272/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 273public virtual Task SetPasswordHashAsync(TUser user, string? passwordHash, CancellationToken cancellationToken = default(CancellationToken)) 279return Task.CompletedTask; 293return Task.FromResult(user.PasswordHash); 306return Task.FromResult(user.PasswordHash != null); 366/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 367public abstract Task AddClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)); 376/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 377public abstract Task ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = default(CancellationToken)); 385/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 386public abstract Task RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken)); 394/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 395public abstract Task AddLoginAsync(TUser user, UserLoginInfo login, CancellationToken cancellationToken = default(CancellationToken)); 404/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 405public abstract Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey, CancellationToken cancellationToken = default(CancellationToken)); 413/// The <see cref="Task"/> for the asynchronous operation, containing a list of <see cref="UserLoginInfo"/> for the specified <paramref name="user"/>, if any. 424/// The <see cref="Task"/> for the asynchronous operation, containing the user, if any which matched the specified login provider and key. 454return Task.FromResult(user.EmailConfirmed); 464public virtual Task SetEmailConfirmedAsync(TUser user, bool confirmed, CancellationToken cancellationToken = default(CancellationToken)) 470return Task.CompletedTask; 480public virtual Task SetEmailAsync(TUser user, string? email, CancellationToken cancellationToken = default(CancellationToken)) 486return Task.CompletedTask; 500return Task.FromResult(user.Email); 516return Task.FromResult(user.NormalizedEmail); 526public virtual Task SetNormalizedEmailAsync(TUser user, string? normalizedEmail, CancellationToken cancellationToken = default(CancellationToken)) 532return Task.CompletedTask; 560return Task.FromResult(user.LockoutEnd); 569/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 570public virtual Task SetLockoutEndDateAsync(TUser user, DateTimeOffset? lockoutEnd, CancellationToken cancellationToken = default(CancellationToken)) 576return Task.CompletedTask; 584/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the incremented failed access count.</returns> 591return Task.FromResult(user.AccessFailedCount); 599/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 601public virtual Task ResetAccessFailedCountAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken)) 607return Task.CompletedTask; 615/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the failed access count.</returns> 621return Task.FromResult(user.AccessFailedCount); 630/// The <see cref="Task"/> that represents the asynchronous operation, true if a user can be locked out, otherwise false. 637return Task.FromResult(user.LockoutEnabled); 646/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 647public virtual Task SetLockoutEnabledAsync(TUser user, bool enabled, CancellationToken cancellationToken = default(CancellationToken)) 653return Task.CompletedTask; 662/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 663public virtual Task SetPhoneNumberAsync(TUser user, string? phoneNumber, CancellationToken cancellationToken = default(CancellationToken)) 669return Task.CompletedTask; 677/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the user's telephone number, if any.</returns> 683return Task.FromResult(user.PhoneNumber); 692/// The <see cref="Task"/> that represents the asynchronous operation, returning true if the specified <paramref name="user"/> has a confirmed 700return Task.FromResult(user.PhoneNumberConfirmed); 709/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 710public virtual Task SetPhoneNumberConfirmedAsync(TUser user, bool confirmed, CancellationToken cancellationToken = default(CancellationToken)) 716return Task.CompletedTask; 725/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 726public virtual Task SetSecurityStampAsync(TUser user, string stamp, CancellationToken cancellationToken = default(CancellationToken)) 733return Task.CompletedTask; 741/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the security stamp for the specified <paramref name="user"/>.</returns> 747return Task.FromResult(user.SecurityStamp); 757/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 758public virtual Task SetTwoFactorEnabledAsync(TUser user, bool enabled, CancellationToken cancellationToken = default(CancellationToken)) 764return Task.CompletedTask; 774/// The <see cref="Task"/> that represents the asynchronous operation, containing a flag indicating whether the specified 782return Task.FromResult(user.TwoFactorEnabled); 791/// The <see cref="Task"/> contains a list of users, if any, that contain the specified claim. 810protected abstract Task AddUserTokenAsync(TUserToken token); 817protected abstract Task RemoveUserTokenAsync(TUserToken token); 827/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 828public virtual async Task SetTokenAsync(TUser user, string loginProvider, string name, string? value, CancellationToken cancellationToken) 853/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 854public virtual async Task RemoveTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken) 874/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 895/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 896public virtual Task SetAuthenticatorKeyAsync(TUser user, string key, CancellationToken cancellationToken) 904/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the security stamp for the specified <paramref name="user"/>.</returns> 952public virtual Task ReplaceCodesAsync(TUser user, IEnumerable<string> recoveryCodes, CancellationToken cancellationToken) 1036/// The <see cref="Task"/> contains a list of users, if any, that are in the specified role. 1046/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 1047public abstract Task AddToRoleAsync(TUser user, string normalizedRoleName, CancellationToken cancellationToken = default(CancellationToken)); 1055/// <returns>The <see cref="Task"/> that represents the asynchronous operation.</returns> 1056public abstract Task RemoveFromRoleAsync(TUser user, string normalizedRoleName, CancellationToken cancellationToken = default(CancellationToken));
Microsoft.Extensions.Logging.AzureAppServices (11)
BatchingLoggerProvider.cs (7)
27private Task _outputTask; 86internal abstract Task WriteMessagesAsync(IEnumerable<LogMessage> messages, CancellationToken token); 88private async Task ProcessLogQueue() 131/// <returns>A <see cref="Task"/> that completes when the <paramref name="interval"/> has passed or the <paramref name="cancellationToken"/> has been canceled.</returns> 132protected virtual Task IntervalAsync(TimeSpan interval, CancellationToken cancellationToken) 134return Task.Delay(interval, cancellationToken); 162_outputTask = Task.Run(ProcessLogQueue);
BlobAppendReferenceWrapper.cs (1)
31public async Task AppendAsync(ArraySegment<byte> data, CancellationToken cancellationToken)
BlobLoggerProvider.cs (1)
55internal override async Task WriteMessagesAsync(IEnumerable<LogMessage> messages, CancellationToken cancellationToken)
FileLoggerProvider.cs (1)
39internal override async Task WriteMessagesAsync(IEnumerable<LogMessage> messages, CancellationToken cancellationToken)
ICloudAppendBlob.cs (1)
20Task AppendAsync(ArraySegment<byte> data, CancellationToken cancellationToken);
Microsoft.Extensions.ML (2)
ModelLoaders\UriModelLoader.cs (2)
58_ = Task.Run(async () => 70internal async Task RunAsync()
Microsoft.Extensions.ML.Tests (2)
UriLoaderTests.cs (2)
97return Task.FromResult(true); 102return Task.FromResult(ETagMatches(uri, eTag));
Microsoft.Extensions.Options (6)
IAsyncStartupValidator.cs (1)
36Task ValidateAsync(CancellationToken cancellationToken = default);
NamedAsyncValidateOptionsFilter.cs (1)
44: Task.FromResult(ValidateOptionsResult.Skip);
StartupValidatorOptions.cs (2)
18public Dictionary<(Type, string), Func<CancellationToken, Task>> _asyncValidators { get; } = new Dictionary<(Type, string), Func<CancellationToken, Task>>();
ValidateOnStart.cs (2)
63public async Task ValidateAsync(CancellationToken cancellationToken = default) 67foreach (Func<CancellationToken, Task> asyncValidator in _validatorOptions._asyncValidators.Values)
Microsoft.Extensions.Options.Contextual.Tests (15)
AcceptanceTests.cs (1)
82public async Task Foo()
ContextualOptionsFactoryTests.cs (12)
21public async Task ContextualOptionsFactoryDoesNothingWithNoOptionalDependenciesProvided() 35public async Task DefaultValidatorsFailValidationForAnyInstanceName() 48public async Task NamedValidatorsFailValidationOnlyForNamedInstance() 61public async Task PostConfigureRunsAfterLoad() 82public async Task NamedLoadersLoadOnlyNamedOptions() 102public async Task DefaultLoadersLoadAllOptions() 122public async Task DefaultPostConfigureConfiguresAllOptions() 135public async Task NamePostConfigureConfiguresOnlyNamedOptions() 148public async Task ConfigureConfiguresOnlyOptions() 166public async Task LoadsRunConcurrentlyWhileConfiguresRunSequentially() 208public async Task CreateAsyncAggregatesAllExceptions() 231public async Task CreateAsyncCallsDisposeEvenAfterExceptions()
ContextualOptionsServiceCollectionExtensionsTests.cs (2)
42public async Task ConfigureDirectTest() 64public async Task ConfigureAllDirectTest()
Microsoft.Extensions.Options.DataAnnotations (1)
OptionsBuilderDataAnnotationsExtensions.cs (1)
100return Task.FromResult(ValidateOptionsResult.Skip);
Microsoft.Extensions.Primitives (10)
ChangeToken.cs (10)
56/// <param name="changeTokenConsumer">Function called when the token changes. The token is only re-registered once the returned <see cref="Task"/> completes.</param> 63public static IDisposable OnChange(Func<IChangeToken?> changeTokenProducer, Func<Task> changeTokenConsumer) 68return new AsyncChangeTokenRegistration<Func<Task>>(changeTokenProducer, static callback => callback(), changeTokenConsumer); 75/// <param name="changeTokenConsumer">Function called when the token changes. The token is only re-registered once the returned <see cref="Task"/> completes.</param> 83public static IDisposable OnChange<TState>(Func<IChangeToken?> changeTokenProducer, Func<TState, Task> changeTokenConsumer, TState state) 210private readonly Func<TState, Task> _changeTokenConsumer; 212public AsyncChangeTokenRegistration(Func<IChangeToken?> changeTokenProducer, Func<TState, Task> changeTokenConsumer, TState state) 229Task consumerTask; 262private async Task AwaitConsumerAndRegisterCallback(Task consumerTask, IChangeToken? token)
Microsoft.Extensions.ServiceDiscovery (20)
Http\HttpServiceEndpointResolver.cs (5)
23private Task? _cleanupTask; 136private async Task CleanupResolversAsyncCore() 138List<Task>? cleanupTasks = null; 150await Task.WhenAll(cleanupTasks).ConfigureAwait(false); 250private async Task DisposeAsyncCore()
parent\parent\Shared\FxPolyfills\Task.cs (3)
16extension(Task task) 18public async Task ConfigureAwait(ConfigureAwaitOptions options) 30await Task.Yield();
parent\parent\Shared\FxPolyfills\Task.TimeProvider.cs (2)
8extension(Task task) 10public Task WaitAsync(CancellationToken token)
ServiceEndpointResolver.cs (5)
22private Task? _cleanupTask; 145private async Task CleanupResolversAsyncCore() 147List<Task>? cleanupTasks = null; 159await Task.WhenAll(cleanupTasks).ConfigureAwait(false); 242private async Task DisposeAsyncCore()
ServiceEndpointWatcher.cs (5)
33private Task _refreshTask = Task.CompletedTask; 94private Task RefreshAsync(bool force) 129private async Task RefreshAsyncInternal() 131await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
Microsoft.Extensions.ServiceDiscovery.Abstractions (3)
parent\parent\Shared\FxPolyfills\Task.cs (3)
16extension(Task task) 18public async Task ConfigureAwait(ConfigureAwaitOptions options) 30await Task.Yield();
Microsoft.Extensions.ServiceDiscovery.Dns (6)
DnsServiceEndpointProvider.cs (1)
29protected override async Task ResolveAsyncCore()
DnsServiceEndpointProviderBase.cs (4)
19private Task _resolveTask = Task.CompletedTask; 72Task resolveTask; 103protected abstract Task ResolveAsyncCore();
DnsSrvServiceEndpointProvider.cs (1)
32protected override async Task ResolveAsyncCore()
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (87)
DnsServiceEndpointResolverTests.cs (1)
15public async Task ResolveServiceEndpoint_Dns_MultiShot()
DnsSrvServiceEndpointResolverTests.cs (4)
43public async Task ResolveServiceEndpoint_DnsSrv_UsesQuerySuffix(string querySuffix) 78public async Task ResolveServiceEndpoint_DnsSrv_ServiceDomainNameCallbackTakesPrecedenceOverQuerySuffix() 117public async Task ResolveServiceEndpoint_DnsSrv() 168public async Task ResolveServiceEndpoint_DnsSrv_MultipleProviders_PreventMixing(bool dnsFirst)
Resolver\CancellationTests.cs (3)
16public async Task PreCanceledToken_Throws() 27public async Task CancellationInProgress_Throws() 36return Task.CompletedTask;
Resolver\LoopbackDnsServer.cs (9)
32private static async Task<int> ProcessRequestCore(IPEndPoint remoteEndPoint, ArraySegment<byte> message, Func<LoopbackDnsResponseBuilder, IPEndPoint, Task> action, Memory<byte> responseBuffer) 52public async Task ProcessUdpRequest(Func<LoopbackDnsResponseBuilder, IPEndPoint, Task> action) 70public Task ProcessUdpRequest(Func<LoopbackDnsResponseBuilder, Task> action) 75public async Task ProcessTcpRequest(Func<LoopbackDnsResponseBuilder, IPEndPoint, Task> action) 113public Task ProcessTcpRequest(Func<LoopbackDnsResponseBuilder, Task> action)
Resolver\ResolveAddressesTests.cs (27)
19public async Task ResolveIPv4_NoData_Success(bool includeSoa) 29return Task.CompletedTask; 39public async Task ResolveIPv4_NoSuchName_Success(bool includeSoa) 50return Task.CompletedTask; 64public async Task ResolveIPv4_Simple_Success(string name) 70return Task.CompletedTask; 81public async Task ResolveIPv4_Aliases_InOrder_Success() 91return Task.CompletedTask; 102public async Task ResolveIPv4_Aliases_OutOfOrder_Success() 112return Task.CompletedTask; 123public async Task ResolveIPv4_Aliases_Loop_ReturnsEmpty() 132return Task.CompletedTask; 141public async Task ResolveIPv4_Aliases_Loop_Reverse_ReturnsEmpty() 150return Task.CompletedTask; 159public async Task ResolveIPv4_Alias_And_Address() 169return Task.CompletedTask; 178public async Task ResolveIPv4_DuplicateAlias() 190return Task.CompletedTask; 199public async Task ResolveIPv4_Aliases_NotFound_Success() 211return Task.CompletedTask; 220public async Task ResolveIP_InvalidAddressFamily_Throws() 236public async Task ResolveIP_SpecialName(string localhost, AddressFamily family, string? addressAsString) 244return Task.CompletedTask; 262public async Task Resolve_Timeout_ReturnsEmpty() 273public async Task Resolve_QuestionMismatch_ReturnsEmpty(string name, int type, int @class) 282return Task.CompletedTask; 290public async Task Resolve_HeaderMismatch_Ignores()
Resolver\ResolveServiceTests.cs (2)
16public async Task ResolveService_Simple_Success() 23return Task.CompletedTask;
Resolver\RetryTests.cs (27)
17private Task SetupUdpProcessFunction(LoopbackDnsServer server, Func<LoopbackDnsResponseBuilder, Task> func) 19return Task.Run(async () => 36private Task SetupUdpProcessFunction(Func<LoopbackDnsResponseBuilder, Task> func) 42public async Task Retry_Simple_Success() 49Task t = SetupUdpProcessFunction(builder => 60return Task.CompletedTask; 81public async Task PersistentErrorsResponseCode_FailoverToNextServer(PersistentErrorType type) 107return Task.CompletedTask; 113return Task.CompletedTask; 137public async Task DefinitiveAnswers_NoRetryOrFailover(DefinitveAnswerType type, bool additionalData) 170return Task.CompletedTask; 176return Task.CompletedTask; 195public async Task ExhaustedRetries_FailoverToNextServer() 208return Task.CompletedTask; 214return Task.CompletedTask; 235public async Task TransientError_RetryOnSameServer(TransientErrorType type) 252await Task.Delay(Options.Timeout.Multiply(1.5)); 270return Task.CompletedTask; 281private async Task<AddressResult[]> RunWithFallbackServerHelper(string name, Func<LoopbackDnsResponseBuilder, Task> primaryHandler, Func<LoopbackDnsResponseBuilder, Task> fallbackHandler) 283Task t = SetupUdpProcessFunction(primaryHandler); 285Task t2 = SetupUdpProcessFunction(fallbackServer, fallbackHandler); 293public async Task NameError_NoRetry() 296Task t = SetupUdpProcessFunction(builder => 301return Task.CompletedTask;
Resolver\TcpFailoverTests.cs (14)
17public async Task TcpFailover_Simple_Success() 25return Task.CompletedTask; 31return Task.CompletedTask; 42public async Task TcpFailover_ServerClosesWithoutData_EmptyResult() 51return Task.CompletedTask; 54Task serverTask = DnsServer.ProcessTcpRequest(builder => 66public async Task TcpFailover_TcpNotAvailable_EmptyResult() 75return Task.CompletedTask; 83public async Task TcpFailover_HeaderMismatch_ReturnsEmpty() 92return Task.CompletedTask; 99return Task.CompletedTask; 110public async Task TcpFailover_QuestionMismatch_ReturnsEmpty(string name, int type, int @class) 119return Task.CompletedTask; 126return Task.CompletedTask;
Microsoft.Extensions.ServiceDiscovery.Tests (18)
ConfigurationServiceEndpointResolverTests.cs (7)
21public async Task ResolveServiceEndpoint_Configuration_SingleResult_NoScheme() 55public async Task ResolveServiceEndpoint_Configuration_DisallowedScheme() 137public async Task ResolveServiceEndpoint_Configuration_DefaultEndpointName() 226public async Task ResolveServiceEndpoint_Configuration_DefaultEndpointName_ResolutionOrder( 275public async Task ResolveServiceEndpoint_Configuration_MultipleResults() 338public async Task ResolveServiceEndpoint_Configuration_MultipleProtocols() 383public async Task ResolveServiceEndpoint_Configuration_MultipleProtocols_WithSpecificationByConsumer()
ExtensionsServicePublicApiTests.cs (1)
147public async Task GetEndpointsAsyncShouldThrowWhenServiceNameIsNull()
PassThroughServiceEndpointResolverTests.cs (4)
21public async Task ResolveServiceEndpoint_PassThrough() 44public async Task ResolveServiceEndpoint_Superseded() 77public async Task ResolveServiceEndpoint_Fallback() 111public async Task ResolveServiceEndpoint_Fallback_NoScheme()
ServiceEndpointResolverTests.cs (6)
34public async Task ServiceEndpointResolver_NoProvidersConfigured_Throws() 57public async Task AddServiceDiscovery_NoProviders_Throws() 86public async Task ResolveServiceEndpoint() 138public async Task ResolveServiceEndpointOneShot() 174public async Task ResolveHttpServiceEndpointOneShot() 211public async Task ResolveServiceEndpoint_ThrowOnReload()
Microsoft.Extensions.ServiceDiscovery.Yarp (1)
ServiceDiscoveryDestinationResolver.cs (1)
33await Task.WhenAll(tasks).ConfigureAwait(false);
Microsoft.Extensions.ServiceDiscovery.Yarp.Tests (7)
YarpServiceDiscoveryTests.cs (7)
31public async Task ServiceDiscoveryDestinationResolverTests_PassThrough() 55public async Task ServiceDiscoveryDestinationResolverTests_Configuration() 86public async Task ServiceDiscoveryDestinationResolverTests_Configuration_NonPreferredScheme() 118public async Task ServiceDiscoveryDestinationResolverTests_Configuration_Host_Value(bool configHasHost) 198public async Task ServiceDiscoveryDestinationResolverTests_Configuration_DisallowedScheme() 233public async Task ServiceDiscoveryDestinationResolverTests_Dns() 270public async Task ServiceDiscoveryDestinationResolverTests_DnsSrv()
Microsoft.Extensions.Telemetry (1)
Latency\Internal\LatencyConsoleExporter.cs (1)
42public Task ExportAsync(LatencyData latencyData, CancellationToken cancellationToken)
Microsoft.Extensions.Telemetry.Abstractions (2)
Latency\ILatencyDataExporter.cs (2)
20/// <returns>A <see cref="Task"/> that represents the export operation.</returns> 21Task ExportAsync(LatencyData data, CancellationToken cancellationToken);
Microsoft.Extensions.Telemetry.Tests (6)
Latency\Internal\LatencyConsoleExporterTests.cs (4)
68public async Task ConsoleExporter_Export_OutputsData() 90public async Task ConsoleExporter_Export_OutputsLongData() 112public async Task ConsoleExporter_Export_OutputsTruncatedData() 134public async Task ConsoleExporter_Export_OutputsEmptyData()
Latency\Internal\LatencyContextTests.cs (2)
209public async Task Latency_Context_Is_Returning_Const_Duration_When_Frozen() 225await Task.Delay(1);
Microsoft.Extensions.TimeProvider.Testing.Tests (18)
FakeTimeProviderTests.cs (17)
289public async Task Delay_ZeroDelay_CompletesSuccessfully() 292var t = timeProvider.Delay(TimeSpan.Zero, CancellationToken.None); 299public async Task Delay_Awaited_CompletesSuccessfully() 303var delay = timeProvider.Delay(TimeSpan.FromMilliseconds(1), CancellationToken.None); 313public async Task Delay_TokenCancelled_ThrowsTaskCanceledException() 318var delay = timeProvider.Delay(_infiniteTimeout, cs.Token); 329public async Task Delay_WhenTimeAdvanced_CompletesWithoutCancellation() 334var task = fakeTimeProvider.Delay(TimeSpan.FromMilliseconds(10000), cancellationTokenSource.Token); 344public async Task Advance_CancelledToken_ThrowsTaskCanceledException() 356public async Task WaitAsync_NegativeTimeout_Throws() 370public async Task WaitAsync_ValidTimeout_CompletesSuccessfully() 379await Task.Delay(1); 390public async Task WaitAsync_InfiniteTimeout_CompletesSuccessfully() 399await Task.Delay(1); 409public async Task WaitAsync_Timeout_ResultsInFaultedTask() 418await Task.Delay(1); 427public async Task WaitAsync_CancelledToken_ThrowsTaskCanceledException()
TimerTests.cs (1)
171public async Task Change_WhenCalledAfterDisposeAsync_ReturnsFalse()
Microsoft.Extensions.Validation (6)
IValidatableParameterInfo.cs (2)
24/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 25Task ValidateAsync(object? value, ValidateContext context, CancellationToken cancellationToken);
IValidatablePropertyInfo.cs (2)
24/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 25Task ValidateAsync(object containingObject, ValidateContext context, CancellationToken cancellationToken);
IValidatableTypeInfo.cs (2)
26/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 27Task ValidateAsync(object? value, ValidateContext context, CancellationToken cancellationToken);
Microsoft.Extensions.VectorData.Abstractions (13)
VectorStore.cs (2)
70/// <returns>A <see cref="Task"/> that completes when the collection has been deleted.</returns> 71public abstract Task EnsureCollectionDeletedAsync(string name, CancellationToken cancellationToken = default);
VectorStoreCollection.cs (11)
44/// <returns>A <see cref="Task"/> that completes when the collection has been created.</returns> 45public abstract Task EnsureCollectionExistsAsync(CancellationToken cancellationToken = default); 51/// <returns>A <see cref="Task"/> that completes when the collection has been deleted.</returns> 52public abstract Task EnsureCollectionDeletedAsync(CancellationToken cancellationToken = default); 118public abstract Task DeleteAsync(TKey key, CancellationToken cancellationToken = default); 125/// <returns>A <see cref="Task"/> that completes when the records have been deleted.</returns> 137public virtual async Task DeleteAsync(IEnumerable<TKey> keys, CancellationToken cancellationToken = default) 154/// <returns>A <see cref="Task"/> that completes when the record has been upserted.</returns> 156public abstract Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default); 165/// <returns>A <see cref="Task"/> that completes when the records have been upserted.</returns> 182public abstract Task UpsertAsync(IEnumerable<TRecord> records, CancellationToken cancellationToken = default);
Microsoft.Extensions.VectorData.ConformanceTests (225)
CollectionManagementTests.cs (5)
17public virtual async Task Collection_Ensure_Exists_Delete() 32public virtual async Task EnsureCollectionExists_twice_does_not_throw() 42public virtual async Task Store_CollectionExists() 53public virtual async Task Store_DeleteCollection() 64public virtual async Task Store_ListCollections()
DependencyInjectionTests.cs (6)
269public override Task EnsureCollectionDeletedAsync(string name, CancellationToken cancellationToken = default) 287public override Task EnsureCollectionExistsAsync(CancellationToken cancellationToken = default) 289public override Task DeleteAsync(TKey key, CancellationToken cancellationToken = default) 291public override Task EnsureCollectionDeletedAsync(CancellationToken cancellationToken = default) 309public override Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default) 311public override Task UpsertAsync(IEnumerable<TRecord> records, CancellationToken cancellationToken = default)
DistanceFunctionTests.cs (10)
14public virtual Task CosineDistance() 18public virtual Task CosineSimilarity() 22public virtual Task DotProductSimilarity() 26public virtual Task NegativeDotProductSimilarity() 30public virtual Task EuclideanDistance() 34public virtual Task EuclideanSquaredDistance() 38public virtual Task HammingDistance() 42public virtual Task ManhattanDistance() 45protected virtual async Task Test( 122protected virtual async Task TestScoreThreshold(VectorStoreCollection<TKey, SearchRecord> collection)
EmbeddingGenerationTests.cs (19)
23public virtual async Task SearchAsync_with_property_generator() 34public virtual async Task SearchAsync_with_property_generator_dynamic() 45public virtual async Task SearchAsync_with_collection_generator() 56public virtual async Task SearchAsync_with_store_generator() 67public virtual async Task SearchAsync_with_store_dependency_injection() 88public virtual async Task SearchAsync_with_collection_dependency_injection() 108public virtual async Task SearchAsync_with_custom_input_type() 134public virtual async Task SearchAsync_with_search_only_embedding_generation() 147public virtual async Task SearchAsync_string_without_generator_throws() 169public virtual async Task SearchAsync_with_incompatible_generator_throws() 184public virtual async Task UpsertAsync() 208public virtual async Task UpsertAsync_dynamic() 232public virtual async Task UpsertAsync_batch() 268public virtual async Task UpsertAsync_batch_dynamic() 308public virtual async Task SearchAsync_with_IncludeVectors_throws() 318public virtual async Task GetAsync_with_IncludeVectors_throws() 328public virtual async Task GetAsync_enumerable_with_IncludeVectors_throws() 600return Task.FromResult(results); 614=> Task.FromResult(new GeneratedEmbeddings<Embedding<float>> { new(embedding) });
FilterTests.cs (56)
22public virtual Task Equal_with_int() 28public virtual Task Equal_with_string() 34public virtual Task Equal_with_string_sql_injection_in_value() 45public virtual async Task Equal_with_string_sql_injection_in_name() 58public virtual Task Equal_with_string_containing_special_characters() 64public virtual Task Equal_with_string_is_not_Contains() 72public virtual Task Equal_reversed() 79public virtual Task Equal_with_null_reference_type() 85public virtual Task Equal_with_null_captured() 95public virtual Task Equal_int_property_with_nonnull_nullable_int() 105public virtual Task Equal_int_property_with_null_nullable_int() 116public virtual Task Equal_int_property_with_nonnull_nullable_int_Value() 127public virtual async Task Equal_int_property_with_null_nullable_int_Value() 145public virtual Task NotEqual_with_int() 151public virtual Task NotEqual_with_string() 157public virtual Task NotEqual_reversed() 163public virtual Task NotEqual_with_null_reference_type() 169public virtual Task NotEqual_with_null_captured() 179public virtual Task Bool() 185public virtual Task Bool_And_Bool() 191public virtual Task Bool_Or_Not_Bool() 202public virtual Task GreaterThan_with_int() 208public virtual Task GreaterThanOrEqual_with_int() 214public virtual Task LessThan_with_int() 220public virtual Task LessThanOrEqual_with_int() 230public virtual Task And() 236public virtual Task Or() 242public virtual Task And_within_And() 248public virtual Task And_within_Or() 254public virtual Task Or_within_And() 261public virtual Task Not_over_Equal() 267public virtual Task Not_over_NotEqual() 274public virtual Task Not_over_And() 280public virtual Task Not_over_Or() 286public virtual Task Not_over_bool() 292public virtual Task Not_over_bool_And_Comparison() 302public virtual Task Contains_over_field_string_array() 308public virtual Task Contains_over_field_string_List() 314public virtual Task Contains_over_inline_int_array() 320public virtual Task Contains_over_inline_string_array() 326public virtual Task Contains_over_inline_string_array_with_weird_chars() 332public virtual Task Contains_over_captured_string_array() 349public virtual Task Contains_with_Enumerable_Contains() 373public virtual Task Any_with_Contains_over_inline_string_array() 379public virtual Task Any_with_Contains_over_captured_string_array() 389public virtual Task Any_with_Contains_over_captured_string_list() 399public virtual Task Any_over_List_with_Contains_over_captured_string_array() 413public virtual Task Captured_local_variable() 424public virtual Task Member_field() 430public virtual Task Member_readonly_field() 436public virtual Task Member_static_field() 442public virtual Task Member_static_readonly_field() 448public virtual Task Member_nested_access() 479public virtual Task True() 484protected virtual async Task TestFilterAsync( 722protected override Task WaitForDataAsync()
HybridSearchTests.cs (9)
20public virtual async Task HybridSearchAsync() 36public virtual async Task HybridSearchAsync_with_filter() 57public virtual async Task HybridSearchAsync_with_top() 74public virtual async Task HybridSearchAsync_with_Skip() 91public virtual async Task HybridSearchAsync_with_multiple_keywords_ranks_matched_keywords_higher() 108public virtual async Task HybridSearchAsync_with_multiple_text_properties() 134public virtual Task HybridSearchAsync_without_explicitly_specified_property_fails() 205protected override Task WaitForDataAsync() 255protected override Task WaitForDataAsync()
IndexKindTests.cs (2)
14public virtual Task Flat() 17protected virtual async Task Test(string indexKind)
ModelTests\BasicModelTests.cs (27)
17public virtual async Task GetAsync_single_record(bool includeVectors) 28public virtual async Task GetAsync_multiple_records(bool includeVectors) 45public virtual async Task GetAsync_throws_for_null_key() 58public virtual async Task GetAsync_throws_for_null_keys() 65public virtual async Task GetAsync_returns_null_for_missing_key() 73public virtual async Task GetAsync_multiple_records_with_missing_keys_returns_only_existing() 93public virtual async Task GetAsync_returns_empty_for_empty_keys() 100public virtual async Task GetAsync_with_filter(bool includeVectors) 115public virtual async Task GetAsync_with_filter_by_true() 125public virtual async Task GetAsync_with_filter_and_OrderBy() 153public virtual async Task GetAsync_with_filter_and_multiple_OrderBys() 189public virtual async Task GetAsync_with_filter_and_OrderBy_and_Skip() 208public virtual async Task Insert_single_record() 229public virtual async Task Update_single_record() 248public virtual async Task Insert_multiple_records() 282public virtual async Task Update_multiple_records() 314public virtual async Task Insert_and_update_in_same_batch() 346public virtual async Task UpsertAsync_throws_for_null_batch() 353public virtual async Task UpsertAsync_does_nothing_for_empty_batch() 369public virtual async Task Delete_single_record() 378public virtual async Task Delete_multiple_records() 387public virtual async Task DeleteAsync_does_nothing_for_non_existing_key() 397public virtual async Task DeleteAsync_does_nothing_for_empty_batch() 407public virtual async Task DeleteAsync_throws_for_null_keys() 419public virtual async Task SearchAsync(bool includeVectors) 434public virtual async Task SearchAsync_with_Skip() 447public virtual async Task SearchAsync_with_Filter()
ModelTests\DynamicModelTests.cs (19)
19public virtual async Task GetAsync_single_record(bool includeVectors) 32public virtual async Task GetAsync_multiple_records(bool includeVectors) 50public virtual async Task GetAsync_throws_for_null_key() 63public virtual async Task GetAsync_throws_for_null_keys() 70public virtual async Task GetAsync_returns_null_for_missing_key() 78public virtual async Task GetAsync_returns_empty_for_empty_keys() 85public virtual async Task GetAsync_with_filter(bool includeVectors) 100public virtual async Task GetAsync_with_filter_by_true() 108public virtual async Task GetAsync_with_filter_and_OrderBy() 148public virtual async Task GetAsync_with_filter_and_multiple_OrderBys() 187public virtual async Task GetAsync_with_filter_and_OrderBy_and_Skip() 211public virtual async Task Insert_single_record() 230public virtual async Task Update_single_record() 249public virtual async Task Insert_multiple_records() 287public virtual async Task Delete_single_record() 297public virtual async Task DeleteAsync_does_nothing_for_non_existing_key() 312public virtual async Task SearchAsync(bool includeVectors) 327public virtual async Task SearchAsync_with_Skip() 340public virtual async Task SearchAsync_with_Filter()
ModelTests\MultiVectorModelTests.cs (6)
18public virtual async Task GetAsync_single_record(bool includeVectors) 28public virtual async Task Insert_single_record() 47public virtual async Task Delete_single_record() 56public virtual async Task SearchAsync_with_multiple_vector_properties() 70public virtual async Task Search_without_explicitly_specified_vector_property_fails() 124protected override Task WaitForDataAsync()
ModelTests\NoDataModelTests.cs (3)
18public virtual async Task GetAsync_single_record(bool includeVectors) 28public virtual async Task Insert_single_record() 45public virtual async Task Delete_single_record()
ModelTests\NoVectorModelTests.cs (5)
19public virtual async Task GetAsync_single_record(bool includeVectors) 29public virtual async Task Insert_single_record() 46public virtual async Task Delete_single_record() 85protected override async Task WaitForDataAsync() 95await Task.Delay(TimeSpan.FromMilliseconds(100));
Support\DynamicVectorStoreCollectionFixture.cs (1)
11public virtual async Task ReseedAsync()
Support\TestStore.cs (7)
32protected abstract Task StartAsync(); 34protected virtual Task StopAsync() 35=> Task.CompletedTask; 43public virtual async Task ReferenceCountingStartAsync() 59public virtual async Task ReferenceCountingStopAsync() 123public virtual async Task WaitForDataAsync<TKey, TRecord>( 158await Task.Delay(TimeSpan.FromMilliseconds(100));
Support\VectorStoreCollectionFixture.cs (1)
10public virtual async Task ReseedAsync()
Support\VectorStoreCollectionFixtureBase.cs (2)
57protected virtual async Task SeedAsync() 66protected virtual Task WaitForDataAsync()
TypeTests\DataTypeTests.cs (37)
24public virtual Task Byte() 26? Task.CompletedTask 30public virtual Task Short() 32? Task.CompletedTask 36public virtual Task Int() 38? Task.CompletedTask 42public virtual Task Long() 44? Task.CompletedTask 48public virtual Task Float() 50? Task.CompletedTask 54public virtual Task Double() 56? Task.CompletedTask 60public virtual Task Decimal() 62? Task.CompletedTask 66public virtual Task String() 68? Task.CompletedTask 72public virtual Task Bool() 74? Task.CompletedTask 78public virtual Task Guid() 80? Task.CompletedTask 87public virtual Task DateTime() 89? Task.CompletedTask 97public virtual Task DateTimeOffset() 99? Task.CompletedTask 107public virtual Task DateOnly() 117return Task.CompletedTask; 122public virtual Task TimeOnly() 132return Task.CompletedTask; 137public virtual Task String_array() 139? Task.CompletedTask 146public virtual Task Nullable_value_type() 148? Task.CompletedTask 151protected virtual async Task Test<TTestType>( 240private async Task InsertData<TTestType>(PropertyInfo property, TTestType mainValue, TTestType otherValue) 282private async Task InsertDynamicData<TTestType>( 342private async Task TestFiltering<TTestType>( 382private async Task TestDynamicFiltering<TTestType>(
TypeTests\EmbeddingTypeTests.cs (6)
22public virtual Task ReadOnlyMemory_of_float() 29public virtual Task Embedding_of_float() 36public virtual Task Array_of_float() 41protected virtual async Task Test<TVector>( 186=> Task.FromResult(new GeneratedEmbeddings<Embedding<T>>([new(data)])); 201=> Task.FromResult(new GeneratedEmbeddings<BinaryEmbedding>([new(data)]));
TypeTests\KeyTypeTests.cs (4)
16public virtual Task Guid() 34protected virtual Task Test<TKey>(TKey key, bool supportsAutoGeneration = false) 41protected virtual Task Test<TKey>(TKey key1, TKey key2) 45protected virtual async Task Test<TKey>(TKey key1, TKey key2, bool supportsAutoGeneration)
Microsoft.Gen.BuildMetadata.Unit.Tests (1)
GeneratorTests.cs (1)
44public async Task BuildMetadataGenerator_ShouldGenerate([CombinatorialValues(true, false, null)] bool? isAzureDevOps)
Microsoft.Gen.ComplianceReports.Unit.Tests (4)
GeneratorTests.cs (4)
53public async Task TestAll(bool useExplicitReportPath) 98public async Task MissingDataClassificationSymbol() 117public async Task Should_EmitWarning_WhenPathUnavailable(bool isReportPathProvided) 137public async Task Should_UseProjectDir_WhenOutputPathIsRelative()
Microsoft.Gen.ContextualOptions.Unit.Tests (10)
EmitterTests.cs (1)
128public async Task TestEmitter()
ParserTests.cs (5)
20public async Task ShouldWarnWithUnusableProperties() 37public async Task ShouldReturnValidProperties() 54public async Task ShouldErrorWhenAttributeAppliedToNonPartialClass() 69public async Task ShouldErrorWhenAttributeAppliedToStaticClass() 84public async Task ShouldErrorWhenAttributeAppliedToRefStruct()
SyntaxContextReceiverTests.cs (4)
19public async Task ShouldCollectTypesWithTheOptionsContextAttribute() 42public async Task ShouldDoNothingWithoutTheOptionsContextAttributeReferenced() 58public async Task ShouldCollectMultiFileTypesWithTheOptionsContextAttribute() 80public async Task ShouldIgnoreTypesWithoutTheOptionsContextAttribute()
Microsoft.Gen.Logging.Unit.Tests (102)
AttributeParserTests.cs (13)
26public async Task RandomAttribute() 40public async Task LegacyAttribute() 56public async Task DataClassificationAttributeFullName() 70public async Task DataClassificationAttributeShortName() 84public Task DataClassificationAttributeNamespaceIsGloballyQualified() 164public async Task MultipleAttributesOnDifferentTopics() 179public async Task RedactorProviderIsInTheInstance(string type) 201public async Task DataClassOnAllTypes() 215public async Task MissingLogger() 230public async Task NotMissingDataClassificationAttributeInStatic() 244public async Task MethodNotStatic() 258public async Task CantUseDataClassificationWithLogProperties() 280public async Task CantUseDataClassificationWithTagProvider()
EmitterTests.cs (1)
23public async Task TestEmitter()
ParserTests.cs (33)
29public async Task IncompatibleAttributes() 80public async Task NullableStructEnumerable() 109public async Task MissingAttributeValue() 124public async Task WithNullLevel_GeneratorWontFail() 136public async Task WithNullEventId_GeneratorWontFail() 148public async Task WithNullMessage_GeneratorWontFail() 160public async Task ParameterlessConstructor() 177public async Task UnderscoresInMethodName() 191public async Task MissingLogLevel() 205public async Task MissingLogLevel_WhenDefaultCtor() 219public async Task MissingTemplate() 233public async Task MissingArgument() 261public async Task AtSymbolInTemplate(string template) 278public async Task AtSymbolArgumentOutOfOrder(string stringTemplate, string parameterName) 290public async Task NeedlessQualifierInMessage() 304public async Task NeedlessExceptionInMessage() 318public async Task NeedlessLogLevelInMessage() 332public async Task NeedlessLoggerInMessage() 346public async Task FileScopedNamespace() 361public async Task UnderscoresInParameterName(string name, string? template = null) 375public async Task MissingExceptionType() 409public async Task MissingEnrichmentPropertyBagTypes() 435public async Task MissingLoggerMessageAttributeType() 445public async Task MissingILoggerType() 459public async Task MissingLogLevelType() 477public async Task EventIdReuse() 494public async Task EventNameReuse() 511public async Task ValidTemplates() 550public async Task MalformedFormatString() 592public async Task Cancellation() 605public async Task SourceErrors() 634public Task MultipleTypeDefinitions() 688private static async Task RunGenerator(
ParserTests.LogMethod.cs (25)
14public async Task InvalidMethodBody() 32public async Task NullableLogger() 46public async Task MissingILogger() 60public async Task NoILoggerField() 74public async Task ValidDerivation() 117public async Task MultipleILoggerMembers() 158public async Task PrimaryConstructorParameterLoggerHidden() 175public async Task MethodReturnType() 191public async Task NotStatic() 205public async Task InstanceEmptyLoggingMethod() 223public async Task StaticEmptyLoggingMethod() 239public async Task NonEmptyLoggingMethod() 261public async Task NotPartial() 275public async Task MethodGeneric() 289public async Task MethodGenericWithConstraints() 304public async Task MethodGenericMultipleTypeParams() 320public async Task MethodGenericWithAllowsRefStructConstraint() 342public async Task LogMethodParamsRefKind([CombinatorialValues("ref", "out")] string modifier) 355public async Task LogMethodParamsModifier() 368public async Task LogMethodRefReadOnlyModifier() 381public async Task LogMethodScopedModifier() 395public async Task LogMethod_DetectsSensitiveMembersInRecord([CombinatorialRange(0, TotalSensitiveCases)] int positionNumber) 482public async Task LogMethod_DetectsSensitiveNullableMembersInRecord(string type) 504public async Task LogMethod_DetectsSensitiveMembersInRecord_WithPrimaryCtor(string annotation) 520public async Task LogMethod_SkipsNonSensitiveMembersInRecord()
ParserTests.LogProperties.cs (17)
19public static async Task InvalidLogPropertiesUsage() 52public static async Task LogPropertiesOmitParamName_DetectsNameCollision() 70public static async Task LogProperties_AllowsDefaultLogMethodCtor() 89public async Task LogProperties_AllowsRecordTypes(string type) 107public async Task LogPropertiesInvalidUsage(string annotation) 124public async Task LogPropertiesValidUsage(string parameterType) 153public async Task LogPropertiesParameterSkipped(string parameterType) 172public async Task LogPropertiesParameterNotSkipped() 188public async Task LogPropertiesPointlessUsage() 207public async Task SimpleNameCollision() 220public async Task LogPropertiesNameCollision() 244public async Task LogPropertiesTransitiveNameCollision() 316public async Task IneligibleTypeForPropertiesLogging(string type) 344public async Task PropertyToLogWithTypeCycle(string propertyType) 381public async Task PropertyHiddenInDerivedClass() 404public async Task DefaultToString() 444public async Task ClassWithNullableProperty()
ParserTests.TagProvider.cs (13)
13public async Task InvalidTagProviderUsage() 44public async Task TooManyAttributes() 79public async Task TagProviderTypeNotFound() 95public async Task TagProviderOnUnsupportedParameters() 132public async Task TagProviderMethodNotFound(string methodName) 163public async Task TagProviderMethodNotFoundNested(string methodName) 191public async Task TagProviderMethodNotFound2() 220public async Task TagProviderMethodIsGeneric() 245public async Task TagProvider_UsingInterfacesAndBaseClassAndNullableAndOptional() 294public async Task TagProviderMethodParamsCount(string paramsList) 320public async Task TagProviderMethodParamsRefKind( 353public async Task TagProviderMethodParamsInvalidType( 382public async Task TagProviderMethodIsInaccessible(string methodModifier)
Microsoft.Gen.MetadataExtractor.Unit.Tests (4)
GeneratorTests.cs (4)
70public async Task TestAll(bool useExplicitReportPath) 121public async Task ShouldNot_Generate_WhenDisabledViaConfig() 142public async Task Should_EmitWarning_WhenPathUnavailable(bool isReportPathProvided) 165public async Task Should_UseProjectDir_WhenOutputPathIsRelative()
Microsoft.Gen.Metrics.Unit.Tests (88)
EmitterTests.cs (1)
21public async Task TestEmitter()
ParserTests.cs (50)
20public async Task InvalidMethodName() 36public async Task InvalidReturnTypeLocation(string returnType) 52public async Task InvalidReturnTypeArity(string returnType) 71public async Task InvalidReturnType(string returnType) 99public async Task InvalidAttributeGenericType(string genericType) 115public async Task InvalidStaticDimensionsKeyNames() 129public async Task InvalidDynamicDimensionsKeyNames() 143public async Task ValidDimensionsKeyNames() 156public async Task ValidGenericAttribute() 169public async Task NotPartialMethod() 183public async Task NotStaticMethod() 197public async Task MetricNameStartingLowercaseChar() 211public async Task MetricNameStartingWithNonSymbol() 225public async Task MethodIsGeneric() 239public async Task InvalidParameterName() 253public async Task NullDimensionNames() 266public async Task NullMetricNameParameter() 279public async Task ValidParameterChecks() 312public async Task ValidExtensionMethodsChecks() 345public async Task ExistingMetricName() 362public async Task NestedType() 378public async Task FileScopedNamespace() 396public async Task MissingMeterObject(string args) 410public async Task MeterIsNotFirst() 424public async Task InvalidMethodBody() 439public async Task SemanticProblems() 482public async Task MissingMeterType() 504public async Task MissingCounterAttributeType() 528public async Task MissingHistogramAttributeType() 552public async Task Cancellation() 565public async Task ContainingClassIsInNestedNamespace() 581public async Task ContainingClassHasTypeParameter() 594public async Task MeterTypeIsConvertableToIMeter() 607public async Task GaugeIsDocumented() 623public async Task DimensionIsDocumentedCounter() 640public async Task DimensionIsDocumentedHistogram() 657public async Task CounterIsDocumented() 673public async Task HistogramIsDocumented() 689public async Task CounterIsNotProperlyDocumented() 706public async Task HistogramIsNotXmlDocumented() 720public async Task HistogramHasNoSummaryInXmlComment() 736public async Task IMeterTypeParameter() 799public async Task UnitParameterTest() 812public async Task StrongTypeGauge_CyclicReference() 838public async Task GaugeDuplicateDimensionStringName() 863public async Task GaugeDuplicateDimensionEnumName() 895public async Task GaugeDuplicateDimensionEnumNameInAttribute() 926public async Task GaugeWithGenericType() 939public async Task GaugeGenericWithTags() 959public async Task GaugeValidGenericTypes(string type)
ParserTests.Diagnostics.cs (23)
13public async Task StrongTypeCounter_CyclicReference() 39public async Task StrongTypeCounter_CyclicReference_BaseCycle() 69public async Task StrongTypeCounter_CyclicReference_InterimCycle() 100public async Task StructTypeGauge() 128public async Task StrongTypeGauge() 193public async Task DuplicateDimensionStringName() 218public async Task DuplicateDimensionStringNameInAttribute() 245public async Task DuplicateDimensionEnumName() 276public async Task DuplicateDimensionEnumNameInAttribute() 342public async Task InvalidDimensionType(string type) 361public async Task TooManyDimensions() 392public async Task GaugeT_InvalidGenericType(string type) 406public async Task Gauge_StrongType_CyclicReference() 430public async Task Gauge_ConflictWithCounterName() 447public async Task Gauge_ConflictWithHistogramName() 468public async Task Gauge_StrongType_NullableProperty(string type) 487public async Task Gauge_NotStaticMethod() 501public async Task Gauge_NotPartialMethod() 515public async Task Gauge_MissingMeterParameter() 529public async Task Gauge_InvalidTagNameWithSpecialChars() 543public async Task Gauge_StrongType_TooManyTags() 569public async Task Gauge_StrongType_DuplicateTagName() 598public async Task Gauge_StrongType_InvalidPropertyType(string type)
ParserTests.StrongTypes.cs (14)
13public async Task NullDimensionNamesInAttributes() 32public async Task StructTypeHistogram() 60public async Task StrongTypeHistogram() 140public async Task SimpleStrongTypeHistogram() 161public async Task TestNoStrongTypeDefined() 174public async Task StructTypeCounter() 206public async Task StrongTypeCounter() 271public async Task StrongTypeCounterWithDescription() 399public async Task StrongTypeHistogramWithDescription() 521public async Task StructTypeCounterWithDescription() 562public async Task StructTypeHistogramWithDescription() 596public async Task MaxDimensions() 616public async Task TransitiveDimensions() 665public async Task StructTypeWithUnit()
Microsoft.Gen.MetricsReports.Unit.Tests (4)
GeneratorTests.cs (4)
35public async Task TestAll(bool useExplicitReportPath) 82public async Task ShouldNot_Generate_WhenDisabledViaConfig() 98public async Task Should_EmitWarning_WhenPathUnavailable(bool isReportPathProvided) 118public async Task Should_UseProjectDir_WhenOutputPathIsRelative()
Microsoft.Interop.ComInterfaceGenerator (10)
Analyzers\AddGeneratedComClassFixer.cs (2)
25private static async Task AddGeneratedComClassAsync(SolutionEditor solutionEditor, DocumentId documentId, SyntaxNode node, CancellationToken ct) 72protected override Func<SolutionEditor, DocumentId, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions)
Analyzers\AddMarshalAsToElementFixer.cs (1)
22public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (2)
35protected override Func<SolutionEditor, DocumentId, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions) 76private static async Task ConvertComImportToGeneratedComInterfaceAsync(DocumentEditor editor, SyntaxNode node, bool mayRequireAdditionalWork, bool addStringMarshalling, CancellationToken ct)
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (4)
33protected abstract Func<SolutionEditor, DocumentId, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions); 106private static async Task<Solution> ApplyActionAndEnableUnsafe(Solution solution, DocumentId documentId, Func<SolutionEditor, DocumentId, CancellationToken, Task> solutionBasedFix, CancellationToken ct) 116public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 161protected record struct ConvertToSourceGeneratedInteropFix(Func<SolutionEditor, DocumentId, CancellationToken, Task> ApplyFix, ImmutableDictionary<string, Option> SelectedOptions);
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\FixAllContextExtensions.cs (1)
42return (await Task.WhenAll(sortedProjects.Select(context.GetAllDiagnosticsAsync)).ConfigureAwait(false)).SelectMany(diag => diag).ToImmutableArray();
Microsoft.Interop.LibraryImportGenerator (12)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (2)
30public override Task RegisterCodeFixesAsync(CodeFixContext context) 44return Task.CompletedTask;
Analyzers\ConvertToLibraryImportFixer.cs (2)
138protected override Func<SolutionEditor, DocumentId, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions) 172private static async Task ConvertToLibraryImport(
Analyzers\CustomMarshallerAttributeFixer.cs (3)
84return CodeAction.Create(SR.AddMissingCustomTypeMarshallerMembers, ct => Task.FromResult(symbolEditor.ChangedSolution)); 96return ImmutableArray.CreateRange((await Task.WhenAll(context.Solution.Projects.Select(context.GetAllDiagnosticsAsync)).ConfigureAwait(false)).SelectMany(arr => arr)); 109public override async Task RegisterCodeFixesAsync(CodeFixContext context)
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (4)
33protected abstract Func<SolutionEditor, DocumentId, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions); 106private static async Task<Solution> ApplyActionAndEnableUnsafe(Solution solution, DocumentId documentId, Func<SolutionEditor, DocumentId, CancellationToken, Task> solutionBasedFix, CancellationToken ct) 116public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 161protected record struct ConvertToSourceGeneratedInteropFix(Func<SolutionEditor, DocumentId, CancellationToken, Task> ApplyFix, ImmutableDictionary<string, Option> SelectedOptions);
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\FixAllContextExtensions.cs (1)
42return (await Task.WhenAll(sortedProjects.Select(context.GetAllDiagnosticsAsync)).ConfigureAwait(false)).SelectMany(diag => diag).ToImmutableArray();
Microsoft.JSInterop (15)
Infrastructure\DotNetDispatcher.cs (8)
33private static readonly ConcurrentDictionary<Type, Func<object, Task>> _cachedConvertToTaskByType = new(); 114else if (syncResult is Task task) 129var innerTask = GetTaskByType(syncResultType.GenericTypeArguments[0], syncResult); 142private static void EndInvokeDotNetAfterTask(Task task, JSRuntime jsRuntime, in DotNetInvocationInfo invocationInfo) 289/// associated <see cref="Task"/> as completed. 371private static Task GetTaskByType(Type type, object obj) 374taskConverterMethodInfo.MakeGenericMethod(t).CreateDelegate<Func<object, Task>>(), _taskConverterMethodInfo); 379private static Task CreateValueTaskConverter<[DynamicallyAccessedMembers(LinkerFlags.JsonSerialized)] T>(object result) => ((ValueTask<T>)result).AsTask();
Infrastructure\TaskGenericsUtil.cs (6)
26public static object? GetTaskResult(Task task) 43while (taskType != typeof(Task) && 47?? throw new ArgumentException($"The type '{taskType.FullName}' is not inherited from '{typeof(Task).FullName}'."); 64object? GetResult(Task task); 69public object? GetResult(Task task) => ((Task<T>)task).Result!; 74public object? GetResult(Task task)
JSRuntime.cs (1)
324protected internal virtual Task TransmitStreamAsync(long streamId, DotNetStreamReference dotNetStreamReference)
Microsoft.Maui (24)
Dispatching\DispatcherExtensions.cs (4)
44 /// <returns><see cref="Task"/>.</returns> 45 public static Task DispatchAsync(this IDispatcher dispatcher, Action action) => 85 public static Task DispatchAsync(this IDispatcher dispatcher, Func<Task> funcTask) =>
Handlers\HybridWebView\HybridWebViewHandler.cs (2)
273 if (dotnetReturnValue is Task task) // Task or Task<T> result 393 await Task.CompletedTask;
Handlers\SwipeItemMenuItem\SwipeItemMenuItemHandler.cs (2)
64 public static Task MapSourceAsync(ISwipeItemMenuItemHandler handler, ISwipeItemMenuItem image) 73 return Task.CompletedTask;
ImageSources\ImageSourceExtensions.cs (3)
29 static async Task LoadImageResult(Task<IImageSourceServiceResult<PlatformImage>?> task, Action<IImageSourceServiceResult<PlatformImage>?>? finished = null) 38 return Task.FromResult<IImageSourceServiceResult<PlatformImage>?>(null); 49 return Task.FromResult<IImageSourceServiceResult<PlatformImage>?>(null);
Platform\ImageSourcePartLoader.cs (2)
58 public async Task UpdateImageSourceAsync() 84 await Task.CompletedTask;
Platform\Standard\ViewExtensions.cs (2)
15 public static Task UpdateBackgroundImageSourceAsync(this object platformView, IImageSource? imageSource, IImageSourceServiceProvider? provider) 16 => Task.CompletedTask;
SoftInputExtensions.cs (4)
43 return Task.FromResult(false); 46 return Task.FromResult(platformView.HideSoftInput()); 66 return Task.FromResult(false); 95 return Task.FromResult(result).WaitAsync(token);
TaskExtensions.cs (3)
30 this Task task, 47 public static void FireAndForget(this Task task, ILogger? logger, [CallerMemberName] string? callerName = null) => 51 public static void FireAndForget<T>(this Task task, T? viewHandler, [CallerMemberName] string? callerName = null)
ViewExtensions.cs (1)
80 return Task.FromResult<IScreenshotResult?>(null);
WindowExtensions.cs (1)
29 return Task.FromResult<IScreenshotResult?>(null);
Microsoft.Maui.Controls (162)
Cells\Cell.cs (1)
274 await Task.Delay(TimeSpan.FromMilliseconds(16));
Device.cs (3)
100 public static Task InvokeOnMainThreadAsync(Action action) => 110 public static Task InvokeOnMainThreadAsync(Func<Task> funcTask) =>
DispatcherExtensions.cs (4)
63 public static Task DispatchIfRequiredAsync(this IDispatcher? dispatcher, Action action) 73 return Task.CompletedTask; 77 public static Task DispatchIfRequiredAsync(this IDispatcher? dispatcher, Func<Task> action)
DragAndDrop\DataPackageView.cs (2)
25 return Task.FromResult(DataPackage.Image); 31 return Task.FromResult(DataPackage.Text);
DragAndDrop\DropGestureRecognizer.cs (1)
106 internal async Task SendDrop(DropEventArgs args)
FileImageSource.cs (1)
26 return Task.FromResult(false);
HybridWebView\HybridWebView.cs (1)
85 internal async Task InvokeJavaScriptAsync(
ImageSource.cs (5)
56 return Task.FromResult(false); 62 return Task.FromResult(false); 91 return new StreamImageSource { Stream = token => Task.Run(stream, token) }; 124 private protected async Task OnLoadingCompleted(bool cancelled) 144 private protected async Task OnLoadingStarted()
INavigation.cs (6)
19 Task PopToRootAsync(); 20 Task PopToRootAsync(bool animated); 22 Task PushAsync(Page page); 24 Task PushAsync(Page page, bool animated); 25 Task PushModalAsync(Page page); 26 Task PushModalAsync(Page page, bool animated);
Internals\AsyncValue.cs (1)
85 public static AsyncValue<T> Null => new AsyncValue<T>(Task.FromResult<T>(default(T)));
Internals\ImageParser.cs (10)
135 public async Task SkipBlockAsync() 207 async Task ParseAsync(GIFDecoderStreamReader stream) 290 async Task ParseAsync(GIFDecoderStreamReader stream, bool skipTypeIdentifier) 452 async Task ParseNetscapeApplicationExtensionAsync(GIFDecoderStreamReader stream) 470 async Task ParseApplicationExtensionAsync(GIFDecoderStreamReader stream) 487 async Task ParseGIFBitmapHeaderAsync(GIFDecoderStreamReader stream) 502 async Task ParseImageDescriptorAsync(GIFDecoderStreamReader stream, GIFBitmapDecoder decoder, GIFBitmap previousBitmap, bool ignoreImageData) 533 async Task ParseExtensionAsync(GIFDecoderStreamReader stream) 733 public async Task DecodeAsync(GIFDecoderStreamReader stream, int width, int height) 863 public async Task ParseAsync(Stream stream, bool skipTypeIdentifier = false, bool ignoreImageData = false)
LockingSemaphore.cs (3)
11 static readonly Task Completed = Task.FromResult(true); 36 public Task WaitAsync(CancellationToken token)
NavigationPage\NavigationPage.cs (14)
113 internal Task CurrentNavigationTask { get; set; } 228 var oldTask = CurrentNavigationTask; 254 public Task PopToRootAsync() 260 public async Task PopToRootAsync(bool animated) 273 Task oldTask = CurrentNavigationTask; 282 Task result = PopToRootAsyncInner(animated); 288 public Task PushAsync(Page page) 294 public async Task PushAsync(Page page, bool animated) 310 Task oldTask = CurrentNavigationTask; 613 async Task SendHandlerUpdateAsync( 808 protected override Task OnPopToRootAsync(bool animated) 811 return Task.CompletedTask; 843 protected override Task OnPushAsync(Page root, bool animated) 846 return Task.CompletedTask;
NavigationPage\NavigationPage.Legacy.cs (4)
147 async Task PopToRootAsyncInner(bool animated) 180 async Task PushAsyncInner(Page page, bool animated) 283 protected override Task OnPopToRootAsync(bool animated) 288 protected override Task OnPushAsync(Page root, bool animated)
NavigationProxy.cs (15)
113 public Task PopToRootAsync() 119 public Task PopToRootAsync(bool animated) 125 public Task PushAsync(Page root) 131 public Task PushAsync(Page root, bool animated) 139 public Task PushModalAsync(Page modal) 145 public Task PushModalAsync(Page modal, bool animated) 189 return inner is null ? Task.FromResult(Pop()) : inner.PopAsync(animated); 195 return innerNav is null ? Task.FromResult(PopModal()) : innerNav.PopModalAsync(animated); 198 protected virtual Task OnPopToRootAsync(bool animated) 204 return Task.FromResult<Page>(null); 209 return Task.FromResult(root); 214 protected virtual Task OnPushAsync(Page page, bool animated) 220 return Task.FromResult(page); 225 protected virtual Task OnPushModal(Page modal, bool animated) 231 return Task.FromResult<object>(null);
Page\Page.cs (7)
291 /// <returns>A <see cref="Task"/> that displays an action sheet and returns the string caption of the button pressed by the user.</returns> 308 /// <returns>A <see cref="Task"/> that completes when the alert is dismissed.</returns> 310 public Task DisplayAlert(string title, string message, string cancel) 321 /// <returns>A <see cref="Task"/> that completes when the alert is dismissed.</returns> 323 public Task DisplayAlert(string title, string message, string cancel, FlowDirection flowDirection) 336 /// <returns>A <see cref="Task"/> that contains the user's choice as a <see cref="bool"/> value. <see langword="true"/> indicates that the user accepted the alert. <see langword="false"/> indicates that the user cancelled the alert.</returns> 367 /// <returns>A <see cref="Task"/> that displays a prompt display and returns the string value as entered by the user.</returns>
Platform\ModalNavigationManager\ModalNavigationManager.cs (7)
79 public Task PushModalAsync(Page modal) 119 async Task SyncPlatformModalStackAsync() 196 Task _waitForModalToFinishTask = Task.CompletedTask; 237 Task popTask = 238 (isPlatformReady && !syncing) ? PopModalPlatformAsync(animated) : Task.CompletedTask; 256 public async Task PushModalAsync(Page modal, bool animated)
Platform\ModalNavigationManager\ModalNavigationManager.Standard.cs (4)
15 return Task.FromResult(currentPage); 18 Task PushModalPlatformAsync(Page modal, bool animated) 21 return Task.CompletedTask; 24 Task SyncModalStackWhenPlatformIsReadyAsync() =>
RelativeBindingSource.cs (3)
74 internal async Task Apply(BindingExpression expression, Element relativeSourceTarget, BindableObject targetObject, BindableProperty targetProperty, SetterSpecificity specificity) 80 internal async Task Apply(TypedBindingBase binding, Element relativeSourceTarget, BindableObject targetObject, BindableProperty targetProperty, SetterSpecificity specificity) 86 private async Task Apply(IBindingAdapter bindingAdapter, Element relativeSourceTarget)
ScrollView\ScrollView.cs (4)
248 public Task ScrollToAsync(double x, double y, bool animated) 251 return Task.FromResult(false); 259 public Task ScrollToAsync(Element element, ScrollToPosition position, bool animated) 262 return Task.FromResult(false);
Shell\IShellController.cs (1)
45 Task OnFlyoutItemSelectedAsync(Element element);
Shell\IShellSectionController.cs (2)
27 void SendPopping(Task poppingCompleted); 28 void SendPoppingToRoot(Task finishedPopping);
Shell\Shell.cs (17)
802 Task IShellController.OnFlyoutItemSelectedAsync(Element element) => 805 Task OnFlyoutItemSelectedAsync(Element element, bool platformInitiated) 834 return Task.CompletedTask; 891 return Task.CompletedTask; 1008 public Task GoToAsync(ShellNavigationState state) 1014 public Task GoToAsync(ShellNavigationState state, bool animate) 1021 public Task GoToAsync(ShellNavigationState state, IDictionary<string, object> parameters) 1029 public Task GoToAsync(ShellNavigationState state, bool animate, IDictionary<string, object> parameters) 1036 /// This method navigates to a <see cref="ShellNavigationState" /> and returns a <see cref="Task" /> that will complete once the navigation animation. 1041 public Task GoToAsync(ShellNavigationState state, ShellNavigationQueryParameters shellNavigationQueryParameters) 1047 /// This method navigates to a <see cref="ShellNavigationState" /> and returns a <see cref="Task" />. 1053 public Task GoToAsync(ShellNavigationState state, bool animate, ShellNavigationQueryParameters shellNavigationQueryParameters) 1216 async Task SetCurrentItem() 2092 protected override Task OnPopToRootAsync(bool animated) => SectionProxy.PopToRootAsync(animated); 2094 protected override Task OnPushAsync(Page page, bool animated) => SectionProxy.PushAsync(page, animated); 2115 protected override async Task OnPushModal(Page modal, bool animated) 2152 protected override Task OnPushModal(Page modal, bool animated) => _shellProxy.PushModalAsync(modal, animated);
Shell\ShellNavigatingEventArgs.cs (4)
13 Func<Task> _deferralFinishedTask; 21 _deferralFinishedTask = () => Task.CompletedTask; 81 var task = _deferralFinishedTask(); 108 internal void RegisterDeferralCompletedCallBack(Func<Task> deferralFinishedTask)
Shell\ShellNavigationManager.cs (8)
25 public Task GoToAsync( 44 public Task GoToAsync(ShellNavigationParameters shellNavigationParameters) => 47 internal async Task GoToAsync( 53 await (_shell?.CurrentItem?.CurrentItem?.PendingNavigationTask ?? Task.CompletedTask); 108 await (currentShellSection?.PendingNavigationTask ?? Task.CompletedTask); 155 await (_shell?.CurrentItem?.CurrentItem?.PendingNavigationTask ?? Task.CompletedTask); 202 await (_shell?.CurrentItem?.CurrentItem?.PendingNavigationTask ?? Task.CompletedTask); 365 Func<Task> navigationTask = () => GoToAsync(navArgs.Target, navArgs.Animate, false, navArgs);
Shell\ShellSection.cs (17)
114 async void IShellSectionController.SendPopping(Task poppingCompleted) 131 async void IShellSectionController.SendPoppingToRoot(Task finishedPopping) 320 async Task PrepareCurrentStackForBeingReplaced(ShellNavigationRequest request, ShellRouteParameters queryData, IServiceProvider services, bool? animate, List<string> globalRoutes, bool isRelativePopping) 510 internal async Task GoToAsync(ShellNavigationRequest request, ShellRouteParameters queryData, IServiceProvider services, bool? animate, bool isRelativePopping) 594 Task PopModalAsync(bool isAnimated) 602 Task PushModalAsync(Page page, bool isAnimated) 610 async Task PushStackOfPages(List<Page> pages, bool? animate) 812 protected virtual async Task OnPopToRootAsync(bool animated) 854 protected virtual Task OnPushAsync(Page page, bool animated) 868 return Task.FromResult(true); 883 Task.CompletedTask; 886 internal async Task PopModalStackToPage(Page page, bool? animated) 1085 protected override Task OnPopToRootAsync(bool animated) 1111 protected override Task OnPushAsync(Page page, bool animated) 1127 internal Task PushModalInnerAsync(Page modal, bool animated) 1139 protected override async Task OnPushModal(Page modal, bool animated) 1240 internal Task? PendingNavigationTask => _handlerBasedNavigationCompletionSource?.Task;
TemplatedItemsList.cs (1)
1222 await Task.Delay(100);
TemplateUtilities.cs (2)
39 return Task.FromResult<Element>(null); 42 return Task.FromResult(parent);
ViewExtensions.cs (11)
69 /// <returns>A <see cref="Task"/> containing a <see cref="bool"/> value which indicates whether the animation was canceled. <see langword="true"/> indicates that the animation was canceled. <see langword="false"/> indicates that the animation ran to completion.</returns> 87 /// <returns>A <see cref="Task"/> containing a <see cref="bool"/> value which indicates whether the animation was canceled. <see langword="true"/> indicates that the animation was canceled. <see langword="false"/> indicates that the animation ran to completion.</returns> 115 /// <returns>A <see cref="Task"/> containing a <see cref="bool"/> value which indicates whether the animation was canceled. <see langword="true"/> indicates that the animation was canceled. <see langword="false"/> indicates that the animation ran to completion.</returns> 133 /// <returns>A <see cref="Task"/> containing a <see cref="bool"/> value which indicates whether the animation was canceled. <see langword="true"/> indicates that the animation was canceled. <see langword="false"/> indicates that the animation ran to completion.</returns> 151 /// <returns>A <see cref="Task"/> containing a <see cref="bool"/> value which indicates whether the animation was canceled. <see langword="true"/> indicates that the animation was canceled. <see langword="false"/> indicates that the animation ran to completion.</returns> 169 /// <returns>A <see cref="Task"/> containing a <see cref="bool"/> value which indicates whether the animation was canceled. <see langword="true"/> indicates that the animation was canceled. <see langword="false"/> indicates that the animation ran to completion.</returns> 187 /// <returns>A <see cref="Task"/> containing a <see cref="bool"/> value which indicates whether the animation was canceled. <see langword="true"/> indicates that the animation was canceled. <see langword="false"/> indicates that the animation ran to completion.</returns> 204 /// <returns>A <see cref="Task"/> containing a <see cref="bool"/> value which indicates whether the animation was canceled. <see langword="true"/> indicates that the animation was canceled. <see langword="false"/> indicates that the animation ran to completion.</returns> 222 /// <returns>A <see cref="Task"/> containing a <see cref="bool"/> value which indicates whether the animation was canceled. <see langword="true"/> indicates that the animation was canceled. <see langword="false"/> indicates that the animation ran to completion.</returns> 240 /// <returns>A <see cref="Task"/> containing a <see cref="bool"/> value which indicates whether the animation was canceled. <see langword="true"/> indicates that the animation was canceled. <see langword="false"/> indicates that the animation ran to completion.</returns> 259 /// <returns>A <see cref="Task"/> containing a <see cref="bool"/> value which indicates whether the animation was canceled. <see langword="true"/> indicates that the animation was canceled. <see langword="false"/> indicates that the animation ran to completion.</returns>
Window\Window.cs (3)
705 protected override Task OnPushAsync(Page page, bool animated) 715 protected override Task OnPopToRootAsync(bool animated) 735 protected override Task OnPushModal(Page modal, bool animated)
Microsoft.Maui.Controls.Foldable (2)
DualScreenInfo.cs (1)
233 public Task<int> GetHingeAngleAsync() => FoldableService?.GetHingeAngleAsync() ?? Task.FromResult(0);
NoPlatformFoldableService.cs (1)
28 public Task<int> GetHingeAngleAsync() => Task.FromResult(0);
Microsoft.Maui.Essentials (138)
AppActions\AppActions.netstandard.tvos.watchos.macos.tizen.cs (1)
15 public Task SetAsync(IEnumerable<AppAction> actions) =>
AppActions\AppActions.shared.cs (6)
28 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 29 Task SetAsync(IEnumerable<AppAction> actions); 94 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 95 public static Task SetAsync(params AppAction[] actions) 102 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 103 public static Task SetAsync(IEnumerable<AppAction> actions)
Clipboard\Clipboard.netstandard.tvos.watchos.tizen.cs (1)
8 public Task SetTextAsync(string? text)
Clipboard\Clipboard.shared.cs (4)
21 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 23 Task SetTextAsync(string? text); 46 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 48 public static Task SetTextAsync(string? text)
Email\Email.netstandard.tvos.watchos.cs (1)
10 Task PlatformComposeAsync(EmailMessage message) =>
Email\Email.shared.cs (13)
24 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 25 Task ComposeAsync(EmailMessage? message); 37 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 38 public static Task ComposeAsync(this IEmail email) => 48 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 49 public static Task ComposeAsync(this IEmail email, string subject, string body, params string[] to) => 55 public Task ComposeAsync(EmailMessage? message) 96 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 97 public static Task ComposeAsync() => 106 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 107 public static Task ComposeAsync(string subject, string body, params string[] to) => 114 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 115 public static Task ComposeAsync(EmailMessage message) =>
FilePicker\FilePicker.shared.cs (4)
27 /// picker, the <see cref="Task"/> object that was returned from the first call is cancelled. Be sure to 41 /// picker, the <see cref="Task"/> object that was returned from the first call is cancelled. Be sure to 62 /// picker, the <see cref="Task"/> object that was returned from the first call is cancelled. Be sure to 77 /// picker, the <see cref="Task"/> object that was returned from the first call is cancelled. Be sure to
Flashlight\Flashlight.netstandard.tvos.watchos.macos.cs (3)
12 public Task<bool> IsSupportedAsync() => Task.FromResult(false); 14 public Task TurnOnAsync() => 17 public Task TurnOffAsync() =>
Flashlight\Flashlight.shared.cs (8)
20 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 21 Task TurnOnAsync(); 26 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 27 Task TurnOffAsync(); 44 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 45 public static Task TurnOnAsync() => 51 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 52 public static Task TurnOffAsync() =>
MainThread\MainThread.shared.cs (9)
38 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 39 public static Task InvokeOnMainThreadAsync(Action action) 44 return Task.CompletedTask; 70 /// <returns>A <see cref="Task"/> object that can be awaited to capture the result object.</returns> 75 return Task.FromResult(func()); 100 /// <returns>A <see cref="Task"/> object that can be awaited.</returns> 101 public static Task InvokeOnMainThreadAsync(Func<Task> funcTask) 132 /// <returns>A <see cref="Task"/> object that can be awaited to capture the result object.</returns>
Map\Map.netstandard.tvos.cs (2)
8 public Task OpenAsync(double latitude, double longitude, MapLaunchOptions options) 11 public Task OpenAsync(Placemark placemark, MapLaunchOptions options)
Map\Map.shared.cs (24)
19 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 20 Task OpenAsync(double latitude, double longitude, MapLaunchOptions options); 27 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 28 Task OpenAsync(Placemark placemark, MapLaunchOptions options); 59 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 60 public static Task OpenAsync(Location location) => 68 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 69 public static Task OpenAsync(Location location, MapLaunchOptions options) => 77 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 78 public static Task OpenAsync(double latitude, double longitude) => 87 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 88 public static Task OpenAsync(double latitude, double longitude, MapLaunchOptions options) => 95 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 96 public static Task OpenAsync(Placemark placemark) => 104 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 105 public static Task OpenAsync(Placemark placemark, MapLaunchOptions options) => 191 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 192 public static Task OpenAsync(this IMap map, Location location) => 201 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 203 public static Task OpenAsync(this IMap map, Location location, MapLaunchOptions options) 251 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 252 public static Task OpenAsync(this IMap map, double latitude, double longitude) => 260 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 261 public static Task OpenAsync(this IMap map, Placemark placemark) =>
Permissions\Permissions.shared.cs (2)
52 internal static async Task EnsureGrantedAsync<TPermission>() 61 internal static async Task EnsureGrantedOrRestrictedAsync<TPermission>()
Screenshot\Screenshot.netstandard.watchos.macos.cs (1)
25 Task PlatformCopyToAsync(Stream destination, ScreenshotFormat format, int quality) =>
Screenshot\Screenshot.shared.cs (3)
128 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 129 Task CopyToAsync(Stream destination, ScreenshotFormat format = ScreenshotFormat.Png, int quality = 100); 293 public Task CopyToAsync(Stream destination, ScreenshotFormat format = ScreenshotFormat.Png, int quality = 100)
SecureStorage\SecureStorage.netstandard.cs (1)
11 Task PlatformSetAsync(string key, string data) =>
SecureStorage\SecureStorage.shared.cs (5)
24 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 25 Task SetAsync(string key, string value); 95 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 96 public static Task SetAsync(string key, string value) => 218 public Task SetAsync(string key, string value)
Share\Share.netstandard.tvos.watchos.cs (3)
7 Task PlatformRequestAsync(ShareTextRequest request) => 10 Task PlatformRequestAsync(ShareFileRequest request) => 13 Task PlatformRequestAsync(ShareMultipleFilesRequest request) =>
Share\Share.shared.cs (23)
20 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 21 Task RequestAsync(ShareTextRequest request); 27 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 28 Task RequestAsync(ShareFileRequest request); 34 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 35 Task RequestAsync(ShareMultipleFilesRequest request); 47 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 48 public static Task RequestAsync(string text) => 56 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 57 public static Task RequestAsync(string text, string title) => 64 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 65 public static Task RequestAsync(ShareTextRequest request) => 72 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 73 public static Task RequestAsync(ShareFileRequest request) => 80 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 81 public static Task RequestAsync(ShareMultipleFilesRequest request) => 107 public Task RequestAsync(ShareTextRequest request) 121 public Task RequestAsync(ShareFileRequest request) 135 public Task RequestAsync(ShareMultipleFilesRequest request) 163 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 164 public static Task RequestAsync(this IShare share, string text) => 173 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 174 public static Task RequestAsync(this IShare share, string text, string title) =>
Sms\Sms.netstandard.tvos.watchos.cs (1)
10 Task PlatformComposeAsync(SmsMessage message)
Sms\Sms.shared.cs (8)
22 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 23 Task ComposeAsync(SmsMessage? message); 35 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 36 public static Task ComposeAsync() 43 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 44 public static Task ComposeAsync(SmsMessage? message) 63 public Task ComposeAsync() => 66 public Task ComposeAsync(SmsMessage? message)
TextToSpeech\TextToSpeech.netstandard.cs (1)
10 Task PlatformSpeakAsync(string text, SpeechOptions options, CancellationToken cancelToken) =>
TextToSpeech\TextToSpeech.shared.cs (7)
27 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 28 Task SpeakAsync(string text, SpeechOptions? options = default, CancellationToken cancelToken = default); 49 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 50 public static Task SpeakAsync(string text, CancellationToken cancelToken = default) => 59 /// <returns>A <see cref="Task"/> object with the current status of the asynchronous operation.</returns> 60 public static Task SpeakAsync(string text, SpeechOptions? options, CancellationToken cancelToken = default) => 156 public async Task SpeakAsync(string text, SpeechOptions? options = default, CancellationToken cancelToken = default)
Types\LocationExtensions.shared.cs (2)
21 public static Task OpenMapsAsync(this Location location, MapLaunchOptions options) => 25 public static Task OpenMapsAsync(this Location location) =>
Types\PlacemarkExtensions.shared.cs (2)
13 public static Task OpenMapsAsync(this Placemark placemark, MapLaunchOptions options) => 17 public static Task OpenMapsAsync(this Placemark placemark) =>
Types\Shared\Utils.shared.cs (3)
36 var retTask = await Task.WhenAny(task, Task.Delay(timeSpan))
Microsoft.Maui.Graphics (5)
IImage.cs (1)
22 Task SaveAsync(Stream stream, ImageFormat format = ImageFormat.Png, float quality = 1);
IPdfPage.cs (1)
14 Task SaveAsync(Stream stream);
IPictureWriter.cs (1)
9 Task SaveAsync(IPicture picture, Stream stream);
PlatformImage.cs (2)
72 public Task SaveAsync(Stream stream, ImageFormat format = ImageFormat.Png, float quality = 1) 80 return Task.FromResult(true);
Microsoft.Maui.Graphics.Skia (1)
SkiaImage.cs (1)
111 public async Task SaveAsync(Stream stream, ImageFormat format = ImageFormat.Png, float quality = 1)
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (3)
src\Graphics\src\Graphics\Platforms\Windows\AsyncPump.cs (2)
27 public static void Run(Func<Task> func) 40 var t = func();
src\Graphics\src\Graphics\Platforms\Windows\PlatformImage.cs (1)
122 public async Task SaveAsync(Stream stream, ImageFormat format = ImageFormat.Png, float quality = 1)
Microsoft.Maui.Maps (3)
src\Core\src\TaskExtensions.cs (3)
30 this Task task, 47 public static void FireAndForget(this Task task, ILogger? logger, [CallerMemberName] string? callerName = null) => 51 public static void FireAndForget<T>(this Task task, T? viewHandler, [CallerMemberName] string? callerName = null)
Microsoft.Maui.Resizetizer (9)
AsyncTask.cs (1)
64 protected void Complete(System.Threading.Tasks.Task task)
AsyncTaskExtensions.cs (3)
40 public static Task RunTask(this MauiAsyncTask asyncTask, Action body) => 41 Task.Run(body, asyncTask.CancellationToken); 48 Task.Run(body, asyncTask.CancellationToken);
MauiAsyncTask.cs (2)
41 public virtual System.Threading.Tasks.Task ExecuteAsync() => System.Threading.Tasks.Task.CompletedTask;
ResizetizeImages.cs (3)
37 public override System.Threading.Tasks.Task ExecuteAsync() 45 return System.Threading.Tasks.Task.CompletedTask; 127 return System.Threading.Tasks.Task.CompletedTask;
Microsoft.ML.AutoML (6)
API\BinaryClassificationExperiment.cs (1)
457return Task.FromResult(Run(settings));
API\MulticlassClassificationExperiment.cs (1)
435return Task.FromResult(Run(settings));
API\RegressionExperiment.cs (2)
411return Task.FromResult(new TrialResult<RegressionMetrics>() 437return Task.FromResult(new TrialResult<RegressionMetrics>()
AutoMLExperiment\AutoMLExperiment.cs (1)
349return await Task.FromResult(_bestTrialResult);
AutoMLExperiment\Runner\SweepablePipelineRunner.cs (1)
103return Task.FromResult(Run(settings));
Microsoft.ML.AutoML.Interactive (5)
ActionThrottler.cs (2)
34public async Task ExecuteAsync() 42await Task.Delay(_nextUpdateTime - currentTime);
AutoMLMonitorKernelExtension.cs (2)
23public async Task OnLoadAsync(Kernel kernel) 39private static async Task LoadExtensionApiAsync(Kernel cSharpKernel)
NotebookMonitor.cs (1)
74Task.Run(async () => await _updateThrottler.ExecuteAsync());
Microsoft.ML.AutoML.Samples (2)
AutoMLExperiment.cs (1)
12public static async Task RunAsync()
Sweepable\SweepableLightGBMBinaryExperiment.cs (1)
22public static async Task RunAsync()
Microsoft.ML.AutoML.Tests (24)
AutoMLExperimentTests.cs (15)
33public async Task AutoMLExperiment_throw_timeout_exception_when_ct_is_canceled_and_no_trial_completed_Async() 63public async Task AutoMLExperiment_cancel_trial_when_exceeds_memory_limit_Async() 92public async Task AutoMLExperiment_lgbm_cancel_trial_when_exceeds_memory_limit_Async() 119public async Task AutoMLExperiment_return_current_best_trial_when_ct_is_canceled_with_trial_completed_Async() 152public async Task AutoMLExperiment_finish_training_when_time_is_up_Async() 183public async Task AutoMLExperiment_finish_training_when_reach_to_max_model_async() 210public async Task AutoMLExperiment_UCI_Adult_Train_Test_Split_Test() 235public async Task AutoMLExperiment_UCI_Adult_Fairlearn_Test() 260public async Task AutoMLExperiment_UCI_Adult_CV_5_Test() 285public async Task AutoMLExperiment_Iris_CV_5_Test() 312public async Task AutoMLExperiment_Iris_Train_Test_Split_Test() 339public async Task AutoMLExperiment_Taxi_Fare_Train_Test_Split_Test() 377public async Task AutoMLExperiment_Taxi_Fare_CV_5_Test() 396public async Task AutoMLExperiment_Taxi_Fare_CV_5_SamplingKey_Test() 449await Task.Delay(_finishAfterNSeconds * 1000, ct);
DatasetUtil.cs (1)
196private static async Task Download(string url, string destDir, string destFileName)
StopTrainingManagerTests.cs (8)
46public async Task TimeoutTrainingStopManager_isStopTrainingRequested_test() 56var waitForCompleted = Task.Run(async () => 60await Task.Delay(1000); 70public async Task AggregateTrainingStopManager_isStopTrainingRequested_test() 83var waitForCompleted = Task.Run(async () => 87await Task.Delay(1000);
Microsoft.ML.CodeAnalyzer.Tests (23)
Code\BaseTestClassTest.cs (4)
21public async Task TestClassWithFact() 40public async Task TestClassWithTheory() 59public async Task TestDirectlyExtendsBaseTestClass() 83public async Task TestIndirectlyExtendsBaseTestClass()
Code\BestFriendOnPublicDeclarationTest.cs (1)
22public async Task BestFriendOnPublicDeclaration()
Code\BestFriendTest.cs (1)
31public async Task BestFriend()
Code\ContractsCheckTest.cs (3)
25public async Task ContractsCheck() 65public async Task ContractsCheckDecoy() 98public async Task ContractsCheckFix()
Code\InstanceInitializerTest.cs (1)
18public async Task InstanceInitializer()
Code\NameTest.cs (3)
18public async Task PrivateFieldName() 58public async Task MoreNameTests() 133public async Task ExternName()
Code\ParameterVariableNameTest.cs (1)
18public async Task ParameterVariableName()
Code\RelaxTestNamingTest.cs (3)
29public async Task TestClassWithFact() 57public async Task TestClassWithTheory() 84public async Task TestAlreadyHasAsyncSuffix()
Code\SingleVariableDeclarationTest.cs (1)
18public async Task SingleVariableDeclaration()
Code\TypeParamNameTest.cs (1)
18public async Task TypeParamName()
Helpers\CSharpCodeFixVerifier`2.cs (4)
31public static async Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected) 42public static Task VerifyCodeFixAsync(string source, string fixedSource) 45public static Task VerifyCodeFixAsync(string source, DiagnosticResult expected, string fixedSource) 48public static async Task VerifyCodeFixAsync(string source, DiagnosticResult[] expected, string fixedSource)
Microsoft.ML.CodeGenerator.Tests (2)
UtilTest.cs (2)
121public async Task TestGenerateSampleDataAsync() 156public async Task TestGenerateSampleDataAsyncDuplicateColumnNames()
Microsoft.ML.Core (12)
Utilities\ResourceManagerUtils.cs (5)
90/// Returns a <see cref="Task"/> that tries to download a resource from a specified url, and returns the path to which it was 141await Task.Delay(10 * 1000); 160var t = Task.Run(() => DownloadResource(env, ch, client, new Uri(url), filePath, fileName, downloadCancel.Token)); 163var timeoutTask = Task.Delay(timeout).ContinueWith(task => default(Exception), TaskScheduler.Default); 165var completedTask = await Task.WhenAny(t, timeoutTask);
Utilities\ThreadUtils.cs (7)
15public static Task RunOnBackgroundThreadAsync(Action start) => 18public static Task RunOnBackgroundThreadAsync(Action<object> start, object obj) => 41/// and returns a <see cref="Task"/> that represents its eventual completion. The task will 45public static Task QueueAsync(Action threadStart) => QueueAsync((Delegate)threadStart, null); 49/// and returns a <see cref="Task"/> that represents its eventual completion. The task will 53public static Task QueueAsync(Action<object> threadStart, object state) => QueueAsync((Delegate)threadStart, state); 55private static Task QueueAsync(Delegate threadStart, object state)
Microsoft.ML.Core.Tests (1)
UnitTests\TestResourceDownload.cs (1)
28public async Task TestDownloadError()
Microsoft.ML.Data (26)
Commands\CrossValidationCommand.cs (1)
471Task.WaitAll(tasks);
Data\DataViewUtils.cs (4)
366Task[] workers = new Task[inputs.Length]; 477Task.WaitAll(workers); 560Task thread = Utils.RunOnBackgroundThreadAsync(
DataLoadSave\Binary\BinaryLoader.cs (6)
1231private readonly Task _readerThread; 1232private readonly Task _pipeTask; 1381private Task DecompressAsync() 1383Task[] pipeWorkers = new Task[_parent._threads]; 1411return Task.WhenAll(pipeWorkers);
DataLoadSave\Binary\BinarySaver.cs (5)
663Task compressionTask = null; 667Task[] compressionThreads = new Task[Environment.ProcessorCount]; 673compressionTask = Task.WhenAll(compressionThreads); 678Task writeThread = Utils.RunOnBackgroundThreadAsync(
DataLoadSave\Text\TextLoaderCursor.cs (4)
417private Task _thdRead; 881private readonly Task[] _threads; 916_threads = new Task[cthd]; 929Task.WaitAll(_threads);
DataView\CacheDataView.cs (4)
56private readonly ConcurrentBag<Task> _cacheFillerThreads; 99_cacheFillerThreads = new ConcurrentBag<Task>(); 367var fillerThread = Utils.RunOnBackgroundThreadAsync(() => Filler(cursor, caches, waiter)); 448Task.WaitAll(_cacheFillerThreads.ToArray());
Transforms\RowShufflingTransformer.cs (2)
492private readonly Task _producerTask; 566private async Task ProduceAsync()
Microsoft.ML.Fairlearn (1)
Reductions\GridSearchTrialRunner.cs (1)
96return Task.FromResult<TrialResult>(new FairnessTrialResult()
Microsoft.ML.FastTree (8)
Training\TreeLearners\LeastSquaresRegressionTreeLearner.cs (6)
350var smallSplitInit = Task.Run(() => 411var smallSplitInit = Task.Run(() => SmallerChildSplitCandidates.Initialize(lteChild, partitioning, targets, GetTargetWeights(), FilterZeros)); 424var smallSplitInit = Task.Run(() => SmallerChildSplitCandidates.Initialize(gtChild, partitioning, targets, GetTargetWeights(), FilterZeros));
Utils\ThreadTaskManager.cs (2)
54var task = Task.Run(_actions[i]);
Microsoft.ML.GenAI.Core (1)
CausalLMPipelineChatClient.cs (1)
48return Task.FromResult(new ChatResponse([chatMessage])
Microsoft.ML.GenAI.LLaMA (2)
LlamaCausalLMAgent.cs (1)
59return Task.FromResult<IMessage>(new TextMessage(Role.Assistant, output, from: this.Name));
LlamaTextCompletionService.cs (1)
75return Task.FromResult<IReadOnlyList<TextContent>>([new TextContent(response)]);
Microsoft.ML.GenAI.Mistral (2)
MistralCausalLMAgent.cs (2)
66return Task.FromResult<IMessage>(ParseAsToolCallMessage(output)); 69return Task.FromResult<IMessage>(new TextMessage(Role.Assistant, output, from: this.Name));
Microsoft.ML.GenAI.Phi (2)
Phi3\Phi3CausalLMAgent.cs (1)
58return Task.FromResult<IMessage>(new TextMessage(Role.Assistant, output, from: this.Name));
Phi3\Phi3CausalLMTextGenerationService.cs (1)
45return Task.FromResult<IReadOnlyList<TextContent>>([new TextContent(response)]);
Microsoft.ML.GenAI.Phi.Tests (3)
AutoGenTests.cs (1)
17public async Task ItGenerateTextReply()
SemanticKernelTests.cs (2)
20public async Task ItAddPhi3CausalLMChatCompletionServiceTestAsync() 56public async Task ItAddPhi3CausalLMTextGenerationServiceTestAsync()
Microsoft.ML.GenAI.Samples (10)
Llama\LlamaSample.cs (1)
19public static async Task RunLlama(string weightFolder, string checkPointName = "model.safetensors.index.json")
Llama\SFT_Llama_3_2_1B.cs (1)
22public static async Task Train(string weightFolder, string checkPointName = "model.safetensors.index.json")
MEAI\Llama3_1.cs (1)
20public static async Task RunAsync(string weightFolder, string checkPointName = "model.safetensors.index.json")
MEAI\Phi3.cs (1)
17public static async Task RunAsync(string weightFolder)
Mistral\Mistral_7B_Instruct.cs (3)
24return Task.FromResult($"The weather in {city} is sunny."); 27public static async Task RunAsync() 112public static async Task WeatherChatAsync()
Phi3Mini\AutoGenSample.cs (1)
18public static async Task RunAsync()
Phi3Mini\SemanticKernelSample.cs (2)
14public static async Task RunChatCompletionSample() 45public static async Task RunTextGenerationSample()
Microsoft.ML.InternalCodeAnalyzer (2)
ContractsCheckNameofFixProvider.cs (1)
34public override async Task RegisterCodeFixesAsync(CodeFixContext context)
NameFixProvider.cs (1)
49public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Microsoft.ML.Maml (2)
MAML.cs (2)
65var progressTrackerTask = Task.Run(() => TrackProgress(env, progressCancel.Token));
Microsoft.ML.PerformanceTests (1)
ImageClassificationBench.cs (1)
230public static async Task ReadAsFileAsync(this HttpContent content, string filename, bool overwrite)
Microsoft.ML.Samples (6)
Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (2)
331var task = Task.Run(() =>
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (2)
287var task = Task.Run(() =>
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (2)
308var task = Task.Run(() =>
Microsoft.ML.Samples.GPU (6)
docs\e4e90a0f3c9b109a\LearningRateSchedulingCifarResnetTransferLearning.cs (2)
331var task = Task.Run(() =>
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (2)
287var task = Task.Run(() =>
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (2)
308var task = Task.Run(() =>
Microsoft.ML.Sweeper (3)
AsyncSweeper.cs (3)
114return Task.FromResult<ParameterSetWithId>(null); 121return Task.FromResult(new ParameterSetWithId(_numGenerated++, paramSets[0])); 123return Task.FromResult<ParameterSetWithId>(null);
Microsoft.ML.Sweeper.Tests (7)
TestSweeper.cs (7)
130public async Task TestSimpleSweeperAsync() 180public async Task TestDeterministicSweeperAsyncCancellation() 220await Task.WhenAll(tasks); 230public async Task TestDeterministicSweeperAsync() 294await Task.WhenAll(tasks); 331var r = Task.Run(() => Parallel.For(0, sweeps, options, async (int i) => 350public async Task TestNelderMeadSweeperAsync()
Microsoft.ML.TestFramework (1)
TestCommandBase.cs (1)
988public async Task CommandTrainFastTreeInDifferentThreads()
Microsoft.ML.TestFrameworkCommon (3)
src\Common\tests\RetryHelper.cs (3)
74public static async Task ExecuteAsync(Func<Task> test, int maxAttempts = 5, Func<int, int>? backoffFunc = null, Predicate<Exception>? retryWhen = null, [CallerMemberName] string? testName = null) 106await Task.Delay((backoffFunc ?? _defaultBackoffFunc)(i)).ConfigureAwait(false);
Microsoft.ML.Tokenizers.Data.Tests (5)
src\Common\tests\RetryHelper.cs (3)
74public static async Task ExecuteAsync(Func<Task> test, int maxAttempts = 5, Func<int, int>? backoffFunc = null, Predicate<Exception>? retryWhen = null, [CallerMemberName] string? testName = null) 106await Task.Delay((backoffFunc ?? _defaultBackoffFunc)(i)).ConfigureAwait(false);
test\Microsoft.ML.Tokenizers.Tests\Utils.cs (1)
15public static async Task DownloadFile(string url, string fileName)
TokenizerDataTests.cs (1)
46public async Task TestTokenizerCreationWithProvidedData(string url)
Microsoft.ML.Tokenizers.Tests (9)
BertTokenizerTests.cs (2)
224public async Task TestWithAccentMarks() 301public async Task TestChineseCharacters()
BpeTests.cs (1)
376public async Task TestBpeCreation()
src\Common\tests\RetryHelper.cs (3)
74public static async Task ExecuteAsync(Func<Task> test, int maxAttempts = 5, Func<int, int>? backoffFunc = null, Predicate<Exception>? retryWhen = null, [CallerMemberName] string? testName = null) 106await Task.Delay((backoffFunc ?? _defaultBackoffFunc)(i)).ConfigureAwait(false);
TiktokenTests.cs (2)
49public async Task TestTokenizerCreation() 120public async Task TestTokenizerUsingExternalVocab(Tokenizer tokenizer, string url)
Utils.cs (1)
15public static async Task DownloadFile(string url, string fileName)
Microsoft.NET.Build.Containers (85)
AuthHandshakeMessageHandler.cs (1)
624await Task.Delay(TimeSpan.FromSeconds(1.0 * Math.Pow(2, retryCount)), cancellationToken).ConfigureAwait(false);
ImagePublisher.cs (6)
11public static async Task PublishImageAsync( 56public static async Task PublishImageAsync( 95private static async Task PushToLocalRegistryAsync<T>( 102Func<T, SourceImageReference, DestinationImageReference, CancellationToken, Task> loadFunc) 140private static async Task PushToRemoteRegistryAsync<T>( 146Func<T, SourceImageReference, DestinationImageReference, CancellationToken, Task> pushFunc,
Layer.cs (1)
381public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
LocalDaemons\ArchiveFileRegistry.cs (5)
20internal async Task LoadAsync<T>(T image, SourceImageReference sourceReference, 22Func<T, SourceImageReference, DestinationImageReference, Stream, CancellationToken, Task> writeStreamFunc) 55public async Task LoadAsync(BuiltImage image, SourceImageReference sourceReference, 62public async Task LoadAsync(MultiArchImage multiArchImage, SourceImageReference sourceReference, 69public Task<bool> IsAvailableAsync(CancellationToken cancellationToken) => Task.FromResult(true);
LocalDaemons\ContainerArchive.cs (12)
32public static async Task WriteImageToStreamAsync( 53internal static async Task WriteDockerImageToStreamAsync( 73internal static async Task WriteOciImageToStreamAsync( 88public static async Task WriteMultiArchOciImageToStreamAsync( 109private static async Task WriteImageLayersAsync( 137private static async Task WriteImageConfigAsync(TarWriter writer, BuiltImage image, string configPath, CancellationToken cancellationToken) 152private static async Task WriteManifestForDockerImageAsync( 186private static async Task WriteOciLayoutAsync(TarWriter writer, CancellationToken cancellationToken) 201private static async Task WriteManifestForOciImageAsync(TarWriter writer, BuiltImage image, CancellationToken cancellationToken) 217private static async Task WriteIndexJsonForOciImageAsync( 248private static async Task WriteOciImageToBlobsAsync( 267private static async Task WriteIndexJsonForMultiArchOciImageAsync(
LocalDaemons\ContainerRuntime.cs (3)
81public async Task LoadAsync( 93public async Task LoadAsync( 173await Task.WhenAll(podmanAvailable, dockerAvailable).ConfigureAwait(false);
LocalDaemons\ContainerRuntimeOperations.cs (5)
33public async Task LoadFromStandardInputAsync<T>( 39Func<T, SourceImageReference, DestinationImageReference, Stream, CancellationToken, Task> writeStreamFunc, 75await ((Task)loadTask).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing); 86public async Task LoadFromFileAsync<T>( 92Func<T, SourceImageReference, DestinationImageReference, Stream, CancellationToken, Task> writeStreamFunc,
LocalDaemons\ContainerRuntimes.cs (13)
43public virtual Task LoadAsync( 58public abstract Task LoadAsync( 85return Task.FromResult(true); 90return Task.FromResult(false); 97public override Task LoadAsync( 254public override Task LoadAsync( 265async Task LoadAsyncCore() 311async Task RunAsync(string arguments) 320async Task RunAndIgnoreAsync(string arguments) 343public override Task LoadAsync( 358public override Task LoadAsync( 380public override Task LoadAsync( 395public override Task LoadAsync(
LocalDaemons\DockerCli.cs (17)
87private async Task LoadAsync<T>( 91Func<T, SourceImageReference, DestinationImageReference, Stream, CancellationToken, Task> writeStreamFunc, 133public async Task LoadAsync(BuiltImage image, SourceImageReference sourceReference, DestinationImageReference destinationReference, CancellationToken cancellationToken) 137public async Task LoadAsync(MultiArchImage multiArchImage, SourceImageReference sourceReference, DestinationImageReference destinationReference, CancellationToken cancellationToken) 288public static async Task WriteImageToStreamAsync(BuiltImage image, SourceImageReference sourceReference, DestinationImageReference destinationReference, Stream imageStream, CancellationToken cancellationToken) 304private static async Task WriteDockerImageToStreamAsync( 328private static async Task WriteImageLayers( 361private static async Task WriteImageConfig( 378private static async Task WriteManifestForDockerImage( 410private static async Task WriteOciImageToStreamAsync( 431private static async Task WriteOciLayout(TarWriter writer, CancellationToken cancellationToken) 447private static async Task WriteManifestForOciImage( 465private static async Task WriteIndexJsonForOciImage( 490private static async Task WriteOciImageToBlobs( 506public static async Task WriteMultiArchOciImageToStreamAsync( 530private static async Task WriteIndexJsonForMultiArchOciImage( 586await Task.WhenAll(
LocalDaemons\IContainerRuntime.cs (2)
54Task LoadAsync( 64Task LoadAsync(
LocalDaemons\ILocalRegistry.cs (2)
15public Task LoadAsync(BuiltImage image, SourceImageReference sourceReference, DestinationImageReference destinationReference, CancellationToken cancellationToken); 21public Task LoadAsync(MultiArchImage multiArchImage, SourceImageReference sourceReference, DestinationImageReference destinationReference, CancellationToken cancellationToken);
Registry\DefaultBlobUploadOperations.cs (1)
24public async Task CompleteAsync(Uri uploadUri, string digest, CancellationToken cancellationToken)
Registry\DefaultManifestOperations.cs (1)
54public async Task PutAsync(string repositoryName, string reference, string manifestJson, string mediaType, CancellationToken cancellationToken)
Registry\HttpExtensions.cs (1)
67internal static async Task LogHttpResponseAsync(this HttpResponseMessage response, ILogger logger, CancellationToken cancellationToken)
Registry\IBlobUploadOperations.cs (1)
14public Task CompleteAsync(Uri uploadUri, string digest, CancellationToken cancellationToken);
Registry\IManifestOperations.cs (1)
18public Task PutAsync(string repositoryName, string reference, string manifestListJson, string mediaType, CancellationToken cancellationToken);
Registry\Registry.cs (9)
472await Task.Delay(_retryDelayProvider(), cancellationToken).ConfigureAwait(false); 481internal async Task PushLayerAsync(Layer layer, string repository, CancellationToken cancellationToken) 555private async Task UploadBlobAsync(string repository, string digest, Stream contents, CancellationToken cancellationToken) 582public async Task PushManifestListAsync( 597public Task PushAsync(BuiltImage builtImage, SourceImageReference source, DestinationImageReference destination, CancellationToken cancellationToken) 600public Task PushAsync(BuiltImage builtImage, SourceImageReference source, DestinationImageReference destination, bool noCache, CancellationToken cancellationToken) 603private async Task PushAsync(BuiltImage builtImage, SourceImageReference source, DestinationImageReference destination, bool pushTags, bool noCache, CancellationToken cancellationToken) 616Func<Descriptor, Task> uploadLayerFunc = async (descriptor) => 652await Task.WhenAll(builtImage.LayerDescriptors.Select(descriptor => uploadLayerFunc(descriptor))).ConfigureAwait(false);
StreamExtensions.cs (1)
10public static async Task CopyToAndVerifyAsync(
Tasks\CreateImageIndex.cs (2)
11using Task = System.Threading.Tasks.Task; 32Task.Run(() => ExecuteAsync(_cancellationTokenSource.Token)).GetAwaiter().GetResult();
Tasks\CreateNewImage.cs (1)
42Task.Run(() => ExecuteAsync(_cancellationTokenSource.Token)).GetAwaiter().GetResult();
Microsoft.NET.Build.Tasks (6)
GenerateBundle.cs (4)
78private async System.Threading.Tasks.Task ExecuteWithRetry() 107internal virtual async System.Threading.Tasks.Task RunBundler( 150public async System.Threading.Tasks.Task DoWithRetry(Action action) 168await System.Threading.Tasks.Task.Delay(_jitter.Next(10, 50));
LockFileCache.cs (2)
131public override System.Threading.Tasks.Task LogAsync(ILogMessage message) 134return Task.CompletedTask;
Microsoft.NET.Sdk.Publish.Tasks (20)
Kudu\KuduVfsDeploy.cs (7)
14private List<System.Threading.Tasks.Task> _postTasks; 20_postTasks = new List<System.Threading.Tasks.Task>(); 32public System.Threading.Tasks.Task? DeployAsync(string? sourcePath) 43var postTask = PostFilesAsync(file, sourcePath); 47return System.Threading.Tasks.Task.WhenAll(_postTasks); 50private System.Threading.Tasks.Task PostFilesAsync(string file, string sourcePath) 52return System.Threading.Tasks.Task.Run(
Tasks\Http\HttpClientExtensions.cs (3)
302private static async System.Threading.Tasks.Task RetryTaskAsync( 303Func<CancellationToken, System.Threading.Tasks.Task> func, 329await System.Threading.Tasks.Task.Delay(retryDelay, cancellationToken);
Tasks\Http\HttpResponseMessageForStatusCode.cs (1)
16return System.Threading.Tasks.Task.FromResult<Stream?>(new MemoryStream());
Tasks\Kudu\KuduDeploy.cs (3)
115System.Threading.Tasks.Task? deployTask = fileDeploy.DeployAsync(PublishIntermediateOutputPath); 187internal System.Threading.Tasks.Task DeleteTempZipFile(string? tempFilePath) 189return System.Threading.Tasks.Task.Factory.StartNew(
Tasks\OneDeploy\OneDeployStatusService.cs (1)
68await System.Threading.Tasks.Task.Delay(s_refreshDelay, retryToken);
Tasks\OneDeploy\ZipFilePackager.cs (1)
22return System.Threading.Tasks.Task.FromResult(true);
Tasks\ZipDeploy\ZipDeploymentStatus.cs (4)
68await System.Threading.Tasks.Task.Delay(TimeSpan.FromSeconds(StatusRefreshDelaySeconds)); 96private async System.Threading.Tasks.Task RetryAsync(Func<System.Threading.Tasks.Task> func, int retryCount, TimeSpan retryDelay) 114await System.Threading.Tasks.Task.Delay(retryDelay);
Microsoft.NET.Sdk.Razor.Tasks (8)
src\sdk\src\RazorSdk\Tool\Client.cs (3)
33public abstract Task WaitForDisconnectAsync(CancellationToken cancellationToken); 158public override async Task WaitForDisconnectAsync(CancellationToken cancellationToken) 169await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken);
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerConnection.cs (2)
248var monitorTask = client.WaitForDisconnectAsync(serverCts.Token); 249await Task.WhenAny(new[] { responseTask, monitorTask }).ConfigureAwait(false);
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerProtocol.cs (1)
38internal static async Task ReadAllAsync(
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerRequest.cs (1)
168public async Task WriteAsync(Stream outStream, CancellationToken cancellationToken = default(CancellationToken))
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerResponse.cs (1)
46public async Task WriteAsync(Stream outStream, CancellationToken cancellationToken)
Microsoft.Svcutil.NamedPipeMetadataImporter (1)
NamedPipeMetadataImporter.cs (1)
58await Task.Delay(100);
Microsoft.TemplateEngine.Cli (25)
Commands\BaseCommand.cs (4)
115protected internal static async Task CheckTemplatesWithSubCommandName( 159private static async Task HandleGlobalOptionsAsync( 191private static Task HandleDebugRebuildCacheAsync(TArgs args, TemplatePackageManager templatePackageManager, CancellationToken cancellationToken) 195return Task.CompletedTask;
Commands\create\InstantiateCommand.cs (3)
125.DefineColumn(t => Task.Run(() => GetTemplatePackagesList(t)).GetAwaiter().GetResult(), LocalizableStrings.ColumnNamePackage, showAlways: true) 309.DefineColumn(t => Task.Run(() => GetTemplatePackage(t)).GetAwaiter().GetResult(), LocalizableStrings.ColumnNamePackage, showAlways: true) 317string templatePackage = Task.Run(() => GetTemplatePackage(templates.First())).GetAwaiter().GetResult();
Commands\create\InstantiateCommand.Help.cs (1)
32IEnumerable<TemplateGroup> allTemplateGroups = Task.Run(
Commands\create\InstantiateCommand.TabCompletion.cs (4)
116Task.Run(async () => await templatePackageManager.GetTemplatesAsync(default).ConfigureAwait(false)).GetAwaiter().GetResult(); 146Task.Run(async () => 193Task.Run(async () => 197await Task.WhenAll(tasksToWait.Select(t => t.Task)).WaitAsync(cancellationTokenSource.Token).ConfigureAwait(false);
Commands\create\TemplateCommand.cs (2)
193Task[] tasksToWait = [instantiateTask, builtInPackageCheck, checkForUpdateTask]; 195await Task.WhenAll(tasksToWait).ConfigureAwait(false);
Commands\NewCommand.cs (1)
32Task.Run(async () => await templatePackageManager.GetTemplatesAsync(default).ConfigureAwait(false)).GetAwaiter().GetResult();
NuGet\CliNuGetLogger.cs (4)
29public Task LogAsync(LogLevel level, string data) 32return Task.FromResult(0); 35public Task LogAsync(ILogMessage message) 38return Task.FromResult(0);
TemplateGroup.cs (1)
217var templatePackages = await Task.WhenAll(Templates.Select(t => templatePackageManager.GetTemplatePackageAsync(t, cancellationToken))).ConfigureAwait(false);
TemplatePackageCoordinator.cs (2)
796var templatePackages = await Task.WhenAll( 922await Task.WhenAll(
TemplatePackageDisplay.cs (3)
81internal async Task DisplayInstallResultAsync( 222internal async Task DisplayInstalledTemplatePackagesAsync(TemplatePackageManager templatePackageManager, GlobalArgs args, CancellationToken cancellationToken) 394private async Task EvaluateAndDisplayConstraintsAsync(TemplateConstraintManager constraintsManager, IEnumerable<ITemplateInfo> templates, CancellationToken cancellationToken)
Microsoft.TemplateEngine.Edge (48)
BuiltInManagedProvider\GlobalSettings.cs (3)
109await Task.Delay(MillisecondsInterval, cancellationToken).ConfigureAwait(false); 114public async Task SetInstalledTemplatePackagesAsync(IReadOnlyList<TemplatePackageData> packages, CancellationToken cancellationToken) 149await Task.Delay(MillisecondsInterval, cancellationToken).ConfigureAwait(false);
BuiltInManagedProvider\GlobalSettingsTemplatePackageProvider.cs (5)
89await Task.WhenAll(tasks).ConfigureAwait(false); 125var results = await Task.WhenAll(installRequests.Select(async installRequest => 170var results = await Task.WhenAll(packages.Select(async package => 194var results = await Task.WhenAll(updatesToApply.Select(updateRequest => UpdateAsync(packages, updateRequest, cancellationToken))).ConfigureAwait(false); 217private async Task UpdateTemplatePackagesMetadataAsync(IEnumerable<IManagedTemplatePackage> templatePackages, CancellationToken cancellationToken)
BuiltInManagedProvider\IGlobalSettings.cs (1)
27Task SetInstalledTemplatePackagesAsync(IReadOnlyList<TemplatePackageData> packages, CancellationToken cancellationToken);
Components\EnvironmentVariablesBindSource.cs (1)
39return Task.FromResult(result);
Components\HostParametersBindSource.cs (1)
40return Task.FromResult(newValue);
Constraints\HostConstraint.cs (1)
20return Task.FromResult((ITemplateConstraint)new HostConstraint(environmentSettings, this));
Constraints\OSConstraint.cs (1)
26return Task.FromResult((ITemplateConstraint)new OSConstraint(environmentSettings, this));
Installers\Folder\FolderInstaller.cs (6)
26return Task.FromResult(_settings.Host.FileSystem.DirectoryExists(installationRequest.PackageIdentifier)); 44return Task.FromResult<IReadOnlyList<CheckUpdateResult>>(packages.Select(s => CheckUpdateResult.CreateSuccess(s, null, true)).ToList()); 56return Task.FromResult(InstallResult.CreateSuccess( 63return Task.FromResult( 90return Task.FromResult(UninstallResult.CreateSuccess(templatePackage)); 98return Task.FromResult(UpdateResult.CreateSuccess(
Installers\NuGet\NugetApiPackageManager.cs (2)
260await Task.WhenAll( 332await Task.WhenAny(tasks).ConfigureAwait(false);
Installers\NuGet\NuGetInstaller.cs (6)
91return Task.FromResult(validPackageId && hasValidVersion); 94return Task.FromResult(true); 114return await Task.WhenAll(packages.Select(async package => 341return Task.FromResult(UninstallResult.CreateFailure( 349return Task.FromResult(UninstallResult.CreateSuccess(templatePackage)); 354return Task.FromResult(UninstallResult.CreateFailure(
Installers\NuGet\NuGetLogger.cs (4)
41public Task LogAsync(NuGetLogLevel level, string data) 44return Task.FromResult(0); 47public Task LogAsync(ILogMessage message) 50return Task.FromResult(0);
Settings\ComponentManager.cs (2)
182Task.Delay(10).Wait(); 266Task.Delay(10).Wait();
Settings\Scanner.cs (1)
65return Task.Run(async () => await ScanMountPointForTemplatesAsync(source, default).ConfigureAwait(false)).GetAwaiter().GetResult();
Settings\TemplatePackageManager.cs (4)
97_cachedSources[provider] = Task.Run(() => provider.GetAllTemplatePackagesAsync(default)); 186public Task RebuildTemplateCacheAsync(CancellationToken token) 269_cachedSources[provider] = Task.Run(() => provider.GetAllTemplatePackagesAsync(default)); 353await Task.WhenAll(Enumerable.Range(0, allTemplatePackages.Count).Select(async index =>
Template\TemplateCreator.cs (2)
246return Task.FromResult((ITemplate?)null); 462return Task.Run(async () => await LoadTemplateAsync(info, baselineName, default).ConfigureAwait(false)).GetAwaiter().GetResult();
TemplateConstraintManager.cs (8)
27_templateConstrains[constraintFactory.Type] = Task.Run(() => constraintFactory.CreateTemplateConstraintAsync(engineEnvironmentSettings, _cancellationTokenSource.Token)); 151var tasksToWait = new List<Task>(); 224private async Task CancellableWhenAll(IEnumerable<Task> tasks, CancellationToken cancellationToken) 226await Task.WhenAny( 227Task.WhenAll(tasks), 228Task.Delay(Timeout.Infinite, cancellationToken)).ConfigureAwait(false); 236await Task.WhenAll(tasks).ConfigureAwait(false);
Microsoft.TemplateEngine.IDE (4)
Bootstrapper.cs (4)
271return Task.FromResult((IReadOnlyList<InstallResult>)new List<InstallResult>()); 305IReadOnlyList<CheckUpdateResult>[] results = await Task.WhenAll(requestsGroupedByProvider.Select(packages => packages.Key.GetLatestVersionsAsync(packages, cancellationToken))).ConfigureAwait(false); 327IReadOnlyList<UpdateResult>[] updateResults = await Task.WhenAll(requestsGroupedByProvider.Select(requests => requests.Key.UpdateAsync(requests, cancellationToken))).ConfigureAwait(false); 349IReadOnlyList<UninstallResult>[] uninstallResults = await Task.WhenAll(requestsGroupedByProvider.Select(packages => packages.Key.UninstallAsync(packages, cancellationToken))).ConfigureAwait(false);
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (15)
BindSymbolEvaluator.cs (3)
32public async Task EvaluateBindSymbolsAsync(IEnumerable<BindSymbol> symbols, IVariableCollection variableCollection, CancellationToken cancellationToken) 73await Task.WhenAll(tasksToRun.Select(t => t.Task)).ConfigureAwait(false); 235await Task.WhenAll(tasksToRun.Select(t => t.Task)).ConfigureAwait(false);
DirectoryBasedTemplate.cs (2)
109internal Task ValidateAsync(ValidationScope scope, CancellationToken cancellationToken) 120return Task.CompletedTask;
IRunnableProjectConfig.cs (1)
49Task EvaluateBindSymbolsAsync(IEngineEnvironmentSettings settings, IVariableCollection variableCollection, CancellationToken cancellationToken);
RunnableProjectConfig.cs (2)
238public Task EvaluateBindSymbolsAsync(IEngineEnvironmentSettings settings, IVariableCollection variableCollection, CancellationToken cancellationToken) 243return Task.FromResult(0);
RunnableProjectGenerator.cs (2)
237Task.Run(async () => await GetTemplatesFromMountPointInternalAsync(source, default).ConfigureAwait(false)).GetAwaiter().GetResult(); 271Task.Run(async () => await loadedTemplate.ValidateAsync(ValidationScope.Instantiation, CancellationToken.None).ConfigureAwait(false)).GetAwaiter().GetResult();
Validation\MandatoryLocalizationValidationFactory.cs (1)
17public Task<ITemplateValidator> CreateValidatorAsync(IEngineEnvironmentSettings engineEnvironmentSettings, CancellationToken cancellationToken) => Task.FromResult((ITemplateValidator)new MandatoryLocalizationValidation(this));
Validation\MandatoryValidationFactory.cs (1)
17public Task<ITemplateValidator> CreateValidatorAsync(IEngineEnvironmentSettings engineEnvironmentSettings, CancellationToken cancellationToken) => Task.FromResult((ITemplateValidator)new MandatoryValidation(this));
Validation\ValidationManager.cs (3)
19internal async Task ValidateTemplateAsync(IEngineEnvironmentSettings settings, ITemplateValidationInfo template, ValidationScope scope, CancellationToken cancellationToken) 50ITemplateValidator[] validators = await Task.WhenAll(tasks).ConfigureAwait(false); 65ITemplateValidator[] validators = await Task.WhenAll(validatorsToCreate).ConfigureAwait(false);
Microsoft.TemplateEngine.Utils (3)
AsyncLazy.cs (2)
21: base(() => Task.Factory.StartNew(valueFactory, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default)) 29: base(() => Task.Factory.StartNew(
DefaultTemplatePackageProvider.cs (1)
56return Task.FromResult<IReadOnlyList<ITemplatePackage>>(list);
Microsoft.TemplateSearch.Common (1)
Providers\NuGetMetadataSearchProvider.cs (1)
163private async Task AcquireFileFromCloudAsync(string searchMetadataFileLocation, CancellationToken cancellationToken)
Microsoft.TestPlatform.CommunicationUtilities (25)
DataCollectionRequestHandler.cs (2)
55private Task? _testCaseEventMonitorTask; 335_testCaseEventMonitorTask = Task.Factory.StartNew(
Interfaces\Communication\ICommunicationChannel.cs (4)
23/// <returns>A <see cref="Task"/> implying async nature of the function.</returns> 24Task Send(string data); 29/// <returns>A <see cref="Task"/> implying async nature of the function.</returns> 30Task NotifyDataAvailable(CancellationToken cancellationToken);
Interfaces\ICommunicationManager.cs (4)
25/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 26Task AcceptClientAsync(); 55/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 56Task SetupClientAsync(IPEndPoint endpoint);
LengthPrefixCommunicationChannel.cs (4)
43public Task Send(string data) 70return Task.CompletedTask; 74public Task NotifyDataAvailable(CancellationToken cancellationToken) 104return Task.CompletedTask;
SocketClient.cs (2)
85private void OnServerConnected(Task connectAsyncTask) 107Task.Run(() => _tcpClient.MessageLoopAsync(
SocketCommunicationManager.cs (5)
111/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 112public async Task AcceptClientAsync() 169/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 170public async Task SetupClientAsync(IPEndPoint endpoint) 336var str = await Task.Run(() => TryReceiveRawMessage(cancellationToken));
SocketServer.cs (2)
129private async Task AcceptClientAsync(TcpListener tcpListener) 180_ = Task.Run(() => client.MessageLoopAsync(_channel, error => StopOnError(error), _cancellation.Token));
TcpClientExtensions.cs (2)
22internal static Task MessageLoopAsync( 113return Task.CompletedTask;
Microsoft.TestPlatform.CoreUtilities (1)
Utilities\JobQueue.cs (1)
73private readonly Task _backgroundJobProcessor;
Microsoft.TestPlatform.CrossPlatEngine (19)
AttachmentsProcessing\TestRunAttachmentsProcessingManager.cs (3)
45public async Task ProcessTestRunAttachmentsAsync(string? runSettingsXml, IRequestData requestData, IEnumerable<AttachmentSet> attachments, IEnumerable<InvokedDataCollector>? invokedDataCollector, ITestRunAttachmentsProcessingEventsHandler eventHandler, CancellationToken cancellationToken) 70Task<Collection<AttachmentSet>> task = Task.Run(async () => await ProcessAttachmentsAsync(runSettingsXml, localAttachments, invokedDataCollector, eventHandler, cancellationToken)); 72var completedTask = await Task.WhenAny(task, cancelAttachmentProcessingCompletionSource.Task).ConfigureAwait(false);
Client\InProcessProxyDiscoveryManager.cs (3)
58Task.Run(() => 95Task.Run(() => _testHostManagerFactory.GetDiscoveryManager().Abort()); 101Task.Run(() => _testHostManagerFactory.GetDiscoveryManager().Abort(eventHandler));
Client\InProcessProxyexecutionManager.cs (4)
84Task.Run(() => _executionManager.StartTestRun(runRequest.AdapterSourceMap, runRequest.Package, 91Task.Run(() => _executionManager.StartTestRun(runRequest.Tests, runRequest.Package, 116Task.Run(() => _testHostManagerFactory.GetExecutionManager().Abort(eventHandler)); 125Task.Run(() => _testHostManagerFactory.GetExecutionManager().Cancel(eventHandler));
Client\Parallel\ParallelOperationManager.cs (3)
230var actionTasks = new Task[managers.Length]; 235actionTasks[i] = Task.Run(() => action(manager)); 238DoManagerAction(() => Task.WaitAll(actionTasks));
Client\Parallel\ParallelProxyDiscoveryManager.cs (2)
278Task.Run(() => 287private void HandleError(ITestDiscoveryEventsHandler2 eventHandler, Task t)
Client\Parallel\ParallelProxyExecutionManager.cs (1)
399Task.Run(() =>
Execution\BaseRunTests.cs (1)
280Task.Run(() => CancelTestRunInternal(_activeExecutor));
PostProcessing\ArtifactProcessingManager.cs (2)
125public async Task PostProcessArtifactsAsync() 175private async Task DataCollectorsAttachmentsPostProcessing(TestArtifacts[] testArtifacts)
Microsoft.TestPlatform.Extensions.BlameDataCollector (6)
NetClientHangDumper.cs (3)
58var tasks = new List<Task>(); 64tasks.Add(Task.Run( 104Task.WhenAll(tasks).GetAwaiter().GetResult();
ProcDumpDumper.cs (1)
180var procDumpExit = Task.Run(() => _procDumpProcess.WaitForExit(_timeout));
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (2)
139Task.Delay(1000).GetAwaiter().GetResult(); 161Task.Delay(1000).Wait();
Microsoft.TestPlatform.TestHostRuntimeProvider (6)
Hosting\DefaultTestHostManager.cs (3)
167return Task.FromResult(LaunchHost(testHostStartInfo, cancellationToken)); 392public Task CleanTestHostAsync(CancellationToken cancellationToken) 405return Task.FromResult(true);
Hosting\DotnetTestHostManager.cs (3)
230return Task.FromResult(LaunchHost(testHostStartInfo, cancellationToken)); 870public Task CleanTestHostAsync(CancellationToken cancellationToken) 883return Task.FromResult(true);
Microsoft.TestPlatform.VsTestConsole.TranslationLayer (64)
Interfaces\ITranslationLayerRequestSenderAsync.cs (6)
32Task DiscoverTestsAsync( 49Task StartTestRunAsync( 67Task StartTestRunAsync( 86Task StartTestRunWithCustomHostAsync( 106Task StartTestRunWithCustomHostAsync( 126Task ProcessTestRunAttachmentsAsync(
Interfaces\IVsTestConsoleWrapperAsync.cs (23)
24Task StartSessionAsync(); 32Task InitializeExtensionsAsync(IEnumerable<string> pathToAdditionalExtensions); 42Task DiscoverTestsAsync( 56Task DiscoverTestsAsync( 72Task DiscoverTestsAsync( 93Task RunTestsAsync( 107Task RunTestsAsync( 123Task RunTestsAsync( 141Task RunTestsAsync( 157Task RunTestsAsync( 171Task RunTestsAsync( 187Task RunTestsAsync( 205Task RunTestsAsync( 222Task RunTestsWithCustomTestHostAsync( 238Task RunTestsWithCustomTestHostAsync( 256Task RunTestsWithCustomTestHostAsync( 276Task RunTestsWithCustomTestHostAsync( 294Task RunTestsWithCustomTestHostAsync( 310Task RunTestsWithCustomTestHostAsync( 328Task RunTestsWithCustomTestHostAsync( 348Task RunTestsWithCustomTestHostAsync( 381Task ProcessTestRunAttachmentsAsync( 402Task ProcessTestRunAttachmentsAsync(
VsTestConsoleRequestSender.cs (11)
95Task.Run(() => 135await Task.Run(() => 184public async Task DiscoverTestsAsync( 227public async Task StartTestRunAsync( 277public async Task StartTestRunAsync( 329public async Task StartTestRunWithCustomHostAsync( 383public async Task StartTestRunWithCustomHostAsync( 452public Task ProcessTestRunAttachmentsAsync( 653private async Task SendMessageAndListenAndReportTestCasesAsync( 836private async Task SendMessageAndListenAndReportTestResultsAsync( 921private async Task SendMessageAndListenAndReportAttachmentsProcessingResultAsync(
VsTestConsoleWrapper.cs (24)
585public async Task StartSessionAsync() 618public async Task InitializeExtensionsAsync(IEnumerable<string> pathToAdditionalExtensions) 626public async Task DiscoverTestsAsync( 640public async Task DiscoverTestsAsync( 655public async Task DiscoverTestsAsync( 674public async Task RunTestsAsync( 687public async Task RunTestsAsync( 702public async Task RunTestsAsync( 719public async Task RunTestsAsync( 745public async Task RunTestsAsync( 758public async Task RunTestsAsync( 773public async Task RunTestsAsync( 790public async Task RunTestsAsync( 816public async Task RunTestsWithCustomTestHostAsync( 831public async Task RunTestsWithCustomTestHostAsync( 848public async Task RunTestsWithCustomTestHostAsync( 867public async Task RunTestsWithCustomTestHostAsync( 895public async Task RunTestsWithCustomTestHostAsync( 910public async Task RunTestsWithCustomTestHostAsync( 927public async Task RunTestsWithCustomTestHostAsync( 946public async Task RunTestsWithCustomTestHostAsync( 974public async Task ProcessTestRunAttachmentsAsync( 996public Task ProcessTestRunAttachmentsAsync( 1029private async Task EnsureInitializedAsync()
Microsoft.VisualStudio.TestPlatform.Client (3)
DesignMode\DesignModeClient.cs (3)
455Task.Run(() => 504Task.Run(() => 544Task.Run(() =>
Microsoft.VisualStudio.TestPlatform.Common (9)
DataCollection\DataCollectionAttachmentManager.cs (7)
54private readonly ConcurrentDictionary<DataCollectionContext, ConcurrentBag<Task>> _attachmentTasks; 82_attachmentTasks = new ConcurrentDictionary<DataCollectionContext, ConcurrentBag<Task>>(); 142Task.WhenAll(tasks.ToArray()).Wait(); 174_attachmentTasks.GetOrAdd(fileTransferInfo.Context, _ => new ConcurrentBag<Task>()); 254var task = Task.Factory.StartNew( 297var continuationTask = task.ContinueWith(
Interfaces\Engine\IArtifactProcessingManager.cs (1)
13Task PostProcessArtifactsAsync();
Interfaces\Engine\ITestRunAttachmentsProcessingManager.cs (1)
27Task ProcessTestRunAttachmentsAsync(string? runSettingsXml, IRequestData requestData, IEnumerable<AttachmentSet> attachments, IEnumerable<InvokedDataCollector>? invokedDataCollector, ITestRunAttachmentsProcessingEventsHandler eventHandler, CancellationToken cancellationToken);
Microsoft.VisualStudio.TestPlatform.ObjectModel (2)
Host\ITestRunTimeProvider.cs (2)
111/// The <see cref="Task"/>. 113Task CleanTestHostAsync(CancellationToken cancellationToken);
Mongo.AppHost (1)
AppHost.cs (1)
15await Task.Delay(TimeSpan.FromSeconds(10), ct);
MSBuild (1)
src\msbuild\src\Shared\NodeEndpointOutOfProcBase.cs (1)
411Task connectionTask = localPipeServer.WaitForConnectionAsync();
MSBuild.Coordinator (9)
CoordinatorServer.cs (9)
54public async Task RunAsync(CancellationToken cancellationToken = default) 71ConcurrentDictionary<Task, byte> clientTasks = []; 92Task clientTask = Task.Run(() => HandleTrackedClientAsync(pipeStream, token), CancellationToken.None); 107ICollection<Task> remainingTasks = clientTasks.Keys; 113await Task.WhenAll(remainingTasks); 159private async Task HandleTrackedClientAsync(NamedPipeServerStream pipeStream, CancellationToken token) 181private async Task HandleClientAsync(NamedPipeServerStream pipeStream, CancellationToken token) 210message = await Task.Run(client.ReadClientMessage, token);
mscorlib (1)
src\runtime\src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
1160[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.Task))]
MyFrontend (2)
Services\BasketServiceClient.cs (2)
58public async Task CheckoutBasketAsync(string buyerId) 63public async Task DeleteBasketAsync(string buyerId)
Nats.Backend (5)
Program.cs (5)
19private Task? _subscription; 21public Task StartAsync(CancellationToken cancellationToken) 23_subscription = Task.Run(async () => 30return Task.CompletedTask; 33public async Task StopAsync(CancellationToken cancellationToken)
netstandard (1)
netstandard.cs (1)
2117[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.Task))]
NuGet.Build.Tasks (2)
Common\MSBuildLogger.cs (2)
201public override System.Threading.Tasks.Task LogAsync(ILogMessage message) 205return System.Threading.Tasks.Task.CompletedTask;
NuGet.Build.Tasks.Pack (2)
src\nuget-client\src\NuGet.Core\NuGet.Build.Tasks\Common\MSBuildLogger.cs (2)
201public override System.Threading.Tasks.Task LogAsync(ILogMessage message) 205return System.Threading.Tasks.Task.CompletedTask;
NuGet.CommandLine.XPlat (52)
Commands\ConfigCommands\ConfigCommand.cs (4)
93return Task.FromResult(exitCode); 132return Task.FromResult(exitCode); 170return Task.FromResult(exitCode); 200return Task.FromResult(exitCode);
Commands\LocalsCommand.cs (1)
81return Task.FromResult(0);
Commands\NuGet\Add\DotnetNuGetAddCommand.cs (2)
63return Task.FromResult(0); 112return Task.FromResult(0);
Commands\NuGet\Disable\DotnetNuGetDisableCommand.cs (1)
34return Task.FromResult(0);
Commands\NuGet\Enable\DotnetNuGetEnableCommand.cs (1)
34return Task.FromResult(0);
Commands\NuGet\List\DotnetNuGetListCommand.cs (2)
42return Task.FromResult(0); 64return Task.FromResult(0);
Commands\NuGet\Remove\DotnetNuGetRemoveCommand.cs (2)
42return Task.FromResult(0); 67return Task.FromResult(0);
Commands\NuGet\Update\DotnetNuGetUpdateCommand.cs (2)
63return Task.FromResult(0); 112return Task.FromResult(0);
Commands\Package\Update\IPackageUpdateIO.cs (1)
48Task CommitAsync(RestoreResult restorePreviewResult, CancellationToken cancellationToken);
Commands\Package\Update\PackageUpdateIO.cs (6)
174public async Task CommitAsync(IPackageUpdateIO.RestoreResult restorePreviewResult, CancellationToken none) 237lookups[source] = Task.Run(() => FindHighestPackageVersionAsync(sourceRepository, packageId, includePrerelease, logger, cancellationToken)); 240await Task.WhenAll(lookups); 269tasks.Add(Task.Run(async () => 316lookups[source] = Task.Run(() => FindLowestNonVulnerablePackageVersionAsync(sourceRepository, packageId, minVersion, knownVulnerabilities, logger, cancellationToken)); 319await Task.WhenAll(lookups);
Commands\PackageReferenceCommands\ListPackage\ListPackageCommandRunner.cs (10)
94private async Task GetProjectMetadataAsync( 187private static async Task GetVulnerabilitiesFromAuditSourcesAsync( 470private async Task ThrottledForEachAsync<TItem, TResult>( 495_ = await Task.WhenAny(tasks); 510await Task.WhenAll(tasks); 527tasks[i] = Task.FromResult(default(TResult)); 531await Task.WhenAll(tasks); 561internal async Task UpdatePackagesWithSourceMetadata( 592var matchingPackagesWithDeprecationMetadata = await Task.WhenAll( 623var matchingPackagesWithDeprecationMetadata = await Task.WhenAll(
Commands\PackageSearch\PackageSearchRunner.cs (3)
93Task<IEnumerable<IPackageSearchMetadata>> completedTask = await Task.WhenAny(searchRequests.Keys); 153return Task.Run(async () => 185return Task.Run(async () =>
Commands\Why\WhyCommandRunner.cs (3)
38return Task.FromResult(ExitCodes.InvalidArguments); 55return Task.FromResult(ExitCodes.InvalidArguments); 97return Task.FromResult(anyErrors ? ExitCodes.Error : ExitCodes.Success);
src\nuget-client\build\Shared\TaskResult.cs (8)
18public static Task<bool> True { get; } = Task.FromResult(true); 23public static Task<bool> False { get; } = Task.FromResult(false); 36public static Task<int> Zero { get; } = Task.FromResult(0); 41public static Task<int> One { get; } = Task.FromResult(1); 52_ => Task.FromResult(i) 63public static readonly Task<T?> Instance = Task.FromResult<T?>(null); 73public static readonly Task<IEnumerable<T>> Instance = Task.FromResult(Enumerable.Empty<T>()); 83public static readonly Task<T[]> Instance = Task.FromResult(Array.Empty<T>());
Utility\AddPackageCommandUtility.cs (3)
39tasks.Add(Task.Run(() => GetLatestVersionFromSourceAsync(source, logger, packageId, prerelease, cancellationToken))); 42var finishedTask = await Task.WhenAny(tasks); 48await Task.WhenAll(tasks);
Utility\CommandOutputLogger.cs (2)
137public override Task LogAsync(ILogMessage message) 141return Task.CompletedTask;
Utility\RemappedLevelLogger.cs (1)
42public override Task LogAsync(ILogMessage message)
NuGet.Commands (59)
CommandRunners\DeleteRunner.cs (1)
20public static async Task Run(
CommandRunners\PushRunner.cs (2)
25public static Task Run( 59internal static async Task Run(
ListCommand\IListCommandRunner.cs (1)
12Task ExecuteCommand(ListArgs listArgs);
ListCommand\ListCommandRunner.cs (2)
28public async Task ExecuteCommand(ListArgs listArgs) 151private async Task PrintPackages(ListArgs listArgs, IEnumeratorAsync<IPackageSearchMetadata> asyncEnumerator)
PackCollectorLogger.cs (2)
58public override Task LogAsync(ILogMessage message) 77return Task.CompletedTask;
RestoreCommand\CompatibilityChecker.cs (1)
341private async Task VerifyDotnetToolCompatibilityChecks(CompatibilityData compatibilityData, GraphItem<RemoteResolveResult> node, RestoreTargetGraph graph, List<CompatibilityIssue> issues)
RestoreCommand\Diagnostics\UnexpectedDependencyMessages.cs (1)
27public static async Task LogAsync(IEnumerable<IRestoreTargetGraph> graphs, PackageSpec project, ILogger logger)
RestoreCommand\Diagnostics\UnresolvedMessages.cs (4)
31internal static async Task LogAsync(IEnumerable<IRestoreTargetGraph> graphs, RemoteWalkContext context, CancellationToken token) 44var messages = await Task.WhenAll(tasks); 49internal static async Task LogAsync(IList<DownloadDependencyResolutionResult> downloadDependencyResults, RemoteWalkContext context, CancellationToken token) 69var messages = await Task.WhenAll(messageTasks);
RestoreCommand\Logging\RestoreCollectorLogger.cs (3)
165public Task LogAsync(IRestoreLogMessage message) 194return Task.CompletedTask; 202public override Task LogAsync(ILogMessage message)
RestoreCommand\OriginalCaseGlobalPackageFolder.cs (1)
62public async Task CopyPackagesToOriginalCaseAsync(IEnumerable<RestoreTargetGraph> graphs, CancellationToken token)
RestoreCommand\ProjectRestoreCommand.cs (6)
79var frameworkGraphs = await Task.WhenAll(frameworkTasks); 146foreach (var runtimeSpecificGraph in (await Task.WhenAll(runtimeTasks)).SelectMany(g => g)) 230DownloadDependencyResolutionResult[] downloadDependencyResolutionResults = await Task.WhenAll(downloadDependencyResolutionTasks); 250Tuple<LibraryRange, RemoteMatch>[] packageDownloadMatches = await Task.WhenAll(packageDownloadTasks); 389success = (await Task.WhenAll(tasks)).All(p => p); 480return Task.WhenAll(resultGraphs);
RestoreCommand\RequestFactory\DependencyGraphSpecRequestProvider.cs (1)
57return Task.FromResult(requests);
RestoreCommand\RequestFactory\NoOpRestoreResult.cs (2)
35public override Task CommitAsync(ILogger log, CancellationToken token) 62return Task.CompletedTask;
RestoreCommand\RestoreCommand.cs (2)
1768private async Task FixCaseForLegacyReaders( 1912internal static Task LogDowngradeWarningsOrErrorsAsync(IEnumerable<RestoreTargetGraph> graphs, ILogger logger)
RestoreCommand\RestoreResult.cs (5)
179public virtual async Task CommitAsync(ILogger log, CancellationToken token) 222private async Task CommitAssetsFileAsync( 283private async Task CommitCacheFileAsync(ILogger log, bool toolCommit) 307private async Task CommitLockFileAsync(ILogger log, bool toolCommit) 322private async Task CommitDgSpecFileAsync(ILogger log, bool toolCommit)
RestoreCommand\RestoreRunner.cs (4)
85var task = Task.Run(() => ExecuteAndCommitAsync(request, restoreArgs.ProgressReporter, token), token); 151var task = Task.Run(() => ExecuteAsync(request, CancellationToken.None)); 341var doneTask = await Task.WhenAny(restoreTasks); 349var doneTask = await Task.WhenAny(restoreTasks);
RestoreCommand\SourceRepositoryDependencyProvider.cs (3)
599private async Task EnsureResource(CancellationToken cancellationToken) 692private async Task LogWarningAsync(ILogger logger, string id, FatalProtocolException e) 700private async Task LogErrorAsync(ILogger logger, string id, FatalProtocolException e)
RestoreCommand\Utility\AuditUtility.cs (1)
452await Task.WhenAll(results);
RestoreCommand\Utility\MSBuildRestoreUtility.cs (1)
1246public static Task ReplayWarningsAndErrorsAsync(IEnumerable<IAssetsLogMessage> messages, ILogger logger)
SignCommand\CertificateProvider.cs (1)
173return Task.FromResult(cert);
src\nuget-client\build\Shared\TaskResult.cs (8)
18public static Task<bool> True { get; } = Task.FromResult(true); 23public static Task<bool> False { get; } = Task.FromResult(false); 36public static Task<int> Zero { get; } = Task.FromResult(0); 41public static Task<int> One { get; } = Task.FromResult(1); 52_ => Task.FromResult(i) 63public static readonly Task<T?> Instance = Task.FromResult<T?>(null); 73public static readonly Task<IEnumerable<T>> Instance = Task.FromResult(Enumerable.Empty<T>()); 83public static readonly Task<T[]> Instance = Task.FromResult(Array.Empty<T>());
TrustedSignersCommand\TrustedSignerActionsProvider.cs (3)
44public async Task SyncTrustedRepositoryAsync(string name, CancellationToken token) 81public async Task AddTrustedSignerAsync(string name, ISignedPackageReader package, VerificationTarget trustTarget, bool allowUntrustedRoot, IEnumerable<string> owners, CancellationToken token) 220public async Task AddTrustedRepositoryAsync(string name, Uri serviceIndex, IEnumerable<string> owners, CancellationToken token)
TrustedSignersCommand\TrustedSignersCommandRunner.cs (2)
202private async Task ListAllTrustedSignersAsync(ILogger logger) 253private async Task RemoveTrustedSignerAsync(string name, ILogger logger)
Utility\Extensions.cs (2)
47public static Task LogMessagesAsync(this ILogger logger, params ILogMessage[] messages) 55public static async Task LogMessagesAsync(this ILogger logger, IEnumerable<ILogMessage> messages)
NuGet.Common (30)
AsyncLazy.cs (2)
42public static AsyncLazy<T> New<T>(Func<T> valueFactory) => new AsyncLazy<T>(() => Task.Run(valueFactory)); 46public static AsyncLazy<T> New<T>(T innerData) => new AsyncLazy<T>(() => Task.FromResult(innerData));
ConcurrencyUtilities.cs (2)
109await Task.Delay(SleepDuration, token); 116await Task.Delay(SleepDuration, token);
KeyedLock.cs (2)
29internal async Task EnterAsync(string key, CancellationToken token) 132internal async Task ExitAsync(string key)
Logging\ILogger.cs (2)
30Task LogAsync(LogLevel level, string data); 34Task LogAsync(ILogMessage message);
Logging\LegacyLoggerAdapter.cs (3)
57public Task LogAsync(LogLevel level, string data) 61return Task.CompletedTask; 69public virtual async Task LogAsync(ILogMessage message)
Logging\LoggerBase.cs (2)
23public abstract Task LogAsync(ILogMessage message); 33public virtual Task LogAsync(LogLevel level, string data)
Logging\NullLogger.cs (4)
29public override Task LogAsync(ILogMessage message) { return Task.CompletedTask; } 31public override Task LogAsync(LogLevel level, string data) { return Task.CompletedTask; }
PathUtil\FileUtility.cs (5)
33public static async Task DeleteWithLock(string filePath) 56public static async Task ReplaceWithLock(Action<string> writeSourceFile, string destFilePath) 121public static async Task ReplaceAsync(Func<string, Task> writeSourceFile, string destFilePath) 272await Task.Delay(100);
src\nuget-client\build\Shared\TaskResult.cs (8)
18public static Task<bool> True { get; } = Task.FromResult(true); 23public static Task<bool> False { get; } = Task.FromResult(false); 36public static Task<int> Zero { get; } = Task.FromResult(0); 41public static Task<int> One { get; } = Task.FromResult(1); 52_ => Task.FromResult(i) 63public static readonly Task<T?> Instance = Task.FromResult<T?>(null); 73public static readonly Task<IEnumerable<T>> Instance = Task.FromResult(Enumerable.Empty<T>()); 83public static readonly Task<T[]> Instance = Task.FromResult(Array.Empty<T>());
NuGet.Credentials (7)
DefaultNetworkCredentialsCredentialProvider.cs (2)
55return Task.FromResult(new CredentialResponse(CredentialStatus.ProviderNotApplicable)); 58return Task.FromResult(
DelegatingLogger.cs (1)
52public override async Task LogAsync(ILogMessage message)
PluginCredentialProvider.cs (2)
108return Task.FromResult(taskResponse); 164return Task.FromResult(taskResponse);
SecurePluginCredentialProvider.cs (2)
191private static async Task SetPluginLogLevelAsync( 221private async Task SetProxyCredentialsToPlugin(
NuGet.DependencyResolver.Core (12)
Providers\LocalDependencyProvider.cs (2)
97return Task.FromResult(library.Identity); 139return Task.FromResult(dependencyInfo);
ResolverUtility.cs (2)
428return Task.FromResult(result); 512var task = await Task.WhenAny(tasks);
src\nuget-client\build\Shared\TaskResult.cs (8)
18public static Task<bool> True { get; } = Task.FromResult(true); 23public static Task<bool> False { get; } = Task.FromResult(false); 36public static Task<int> Zero { get; } = Task.FromResult(0); 41public static Task<int> One { get; } = Task.FromResult(1); 52_ => Task.FromResult(i) 63public static readonly Task<T?> Instance = Task.FromResult<T?>(null); 73public static readonly Task<IEnumerable<T>> Instance = Task.FromResult(Enumerable.Empty<T>()); 83public static readonly Task<T[]> Instance = Task.FromResult(Array.Empty<T>());
NuGet.PackageManagement (121)
Audit\AuditChecker.cs (1)
172await Task.WhenAll(results);
BuildIntegration\BuildIntegratedRestoreUtility.cs (1)
27public static async Task ExecuteInitPs1ScriptsAsync(
Context\IDEExecutionContext.cs (3)
25public override async Task OpenFile(string fullPath) 30public async Task SaveExpandedNodeStates(ISolutionManager solutionManager) 35public async Task CollapseAllNodes(ISolutionManager solutionManager)
ExecutionContext.cs (1)
15public abstract Task OpenFile(string fullPath);
FileModifiers\IPackageFileTransformer.cs (2)
33Task TransformFileAsync( 56Task RevertFileAsync(
FileModifiers\Preprocessor.cs (2)
33public async Task TransformFileAsync( 73public async Task RevertFileAsync(
FileModifiers\XdtTransformer.cs (3)
39public async Task TransformFileAsync( 77public async Task RevertFileAsync( 99internal static async Task PerformXdtTransformAsync(
FileModifiers\XmlTransformer.cs (3)
55public async Task TransformFileAsync( 99public async Task RevertFileAsync( 169() => Task.FromResult(zipArchivePackageEntry.Open()),
IDE\ICommonOperations.cs (3)
12Task OpenFile(string fullPath); 14Task SaveSolutionExplorerNodeStates(ISolutionManager solutionManager); 16Task CollapseAllNodes(ISolutionManager solutionManager);
IDE\IDeleteOnRestartManager.cs (1)
44Task DeleteMarkedPackageDirectoriesAsync(INuGetProjectContext projectContext);
IDE\IPackageRestoreManager.cs (1)
63Task RaisePackagesMissingEventForSolutionAsync(string solutionDirectory, CancellationToken token);
IDE\PackageRestoreManager.cs (8)
61public virtual async Task RaisePackagesMissingEventForSolutionAsync(string solutionDirectory, CancellationToken token) 454tasks.Add(Task.Run(() => PackageRestoreRunnerAsync( 461return (await Task.WhenAll(tasks)).SelectMany(package => package); 503private static Task ThrottledCopySatelliteFilesAsync(HashSet<PackageReference> packageReferences, 508var tasks = new List<Task>(); 511tasks.Add(Task.Run(() => CopySatelliteFilesRunnerAsync(packageReferencesQueue, packageRestoreContext, nuGetProjectContext))); 514return Task.WhenAll(tasks); 580private static async Task CopySatelliteFilesRunnerAsync(ConcurrentQueue<PackageReference> packageReferencesQueue,
IInstallationCompatibility.cs (1)
59Task EnsurePackageCompatibilityAsync(
InstallationCompatibility.cs (1)
100public async Task EnsurePackageCompatibilityAsync(
LoggerAdapter.cs (1)
64public override Task LogAsync(ILogMessage message)
NuGetPackageManager.cs (25)
216public Task InstallPackageAsync( 253public Task InstallPackageAsync( 279public async Task InstallPackageAsync(NuGetProject nuGetProject, string packageId, ResolutionContext resolutionContext, 312public async Task InstallPackageAsync( 354public Task InstallPackageAsync( 377public Task InstallPackageAsync( 402public async Task InstallPackageAsync( 439public async Task InstallPackageAsync( 468public async Task UninstallPackageAsync(NuGetProject nuGetProject, string packageId, UninstallationContext uninstallationContext, 734tasks.Add(Task.Run(async () 746var allActions = await Task.WhenAll(tasks); 815var doneTask = await Task.WhenAny(updateTasks); 2068var task = Task.Run(() => metadataResource.Exists(packageIdentity, sourceCacheContext, logger, tokenSource.Token), tokenSource.Token); 2409public async Task ExecuteNuGetProjectActionsAsync(IEnumerable<NuGetProject> nuGetProjects, 2470public async Task ExecuteNuGetProjectActionsAsync(NuGetProject nuGetProject, 2498public async Task ExecuteNuGetProjectActionsAsync(NuGetProject nuGetProject, 3258public async Task ExecuteBuildIntegratedProjectActionsAsync( 3520private async Task RollbackAsync( 3563private Task OpenReadmeFile(NuGetProject nuGetProject, INuGetProjectContext nuGetProjectContext, CancellationToken token) 3664private async Task ExecuteInstallAsync( 3680private async Task ExecuteUninstallAsync(NuGetProject nuGetProject, PackageIdentity packageIdentity, HashSet<PackageIdentity> packageWithDirectoriesToBeDeleted, 3838tasks.Add(Task.Run(async () 3842var resolvedPackages = await Task.WhenAll(tasks); 3859tasks.Add(Task.Run(async () 3863var resolvedPackages = await Task.WhenAll(tasks);
PackageDownloader.cs (4)
155var completedTask = await Task.WhenAny(tasks); 172var remainingTasks = Task.Run(async () => 176await Task.WhenAll(tasks);
PackagePreFetcher.cs (2)
122await Task.WhenAny(downloadResults.Select(e => e.EnsureResultAsync())); 132var task = Task.Run(async () => await PackageDownloader.GetDownloadResourceResultAsync(
PackagePreFetcherResult.cs (1)
107public async Task EnsureResultAsync()
ProjectContextLogger.cs (2)
29public override Task LogAsync(ILogMessage message) 36return Task.CompletedTask;
Projects\BuildIntegratedNuGetProject.cs (1)
58public abstract Task AddFileToProjectAsync(string filePath);
Projects\DefaultProjectServices.cs (7)
39public Task AddOrUpdatePackageReferenceAsync( 63return Task.FromResult(items); 71public Task RemovePackageReferenceAsync(string packageName) 76public Task SaveProjectAsync(CancellationToken _) 79return Task.CompletedTask; 82public Task ExecutePackageScriptAsync( 91return Task.CompletedTask;
Projects\IMSBuildProjectSystem.cs (5)
32Task AddReferenceAsync(string referencePath); 34Task RemoveReferenceAsync(string name); 42Task AddFrameworkReferenceAsync(string name, string packageId); 51Task BeginProcessingAsync(); 59Task EndProcessingAsync();
Projects\IProjectScriptHostService.cs (1)
26Task ExecutePackageScriptAsync(
Projects\IProjectSystemReferencesService.cs (2)
26Task AddOrUpdatePackageReferenceAsync( 36Task RemovePackageReferenceAsync(string packageName);
Projects\IProjectSystemService.cs (1)
21Task SaveProjectAsync(CancellationToken token);
Projects\MSBuildNuGetProject.cs (1)
598public override Task PostProcessAsync(INuGetProjectContext nuGetProjectContext, CancellationToken token)
Projects\NuGetProject.cs (5)
60public virtual Task PreProcessAsync(INuGetProjectContext nuGetProjectContext, CancellationToken token) 63return Task.CompletedTask; 66public virtual Task PostProcessAsync(INuGetProjectContext nuGetProjectContext, CancellationToken token) 69return Task.CompletedTask; 120public Task SaveAsync(CancellationToken token)
Projects\PackagesConfigNuGetProject.cs (1)
241return Task.FromResult<IEnumerable<PackageReference>>(GetInstalledPackagesList());
Projects\ProjectJsonNuGetProject.cs (7)
106return Task.FromResult(ProjectJsonPathUtilities.GetLockFilePath(JsonConfigPath)); 115public override Task AddFileToProjectAsync(string filePath) 117return Task.CompletedTask; 132protected virtual Task UpdateInternalTargetFrameworkAsync() 135return Task.CompletedTask; 347private async Task SaveJsonAsync(JObject json) 359private async Task UpdateFrameworkAsync(JObject json)
Resolution\ResolverGather.cs (10)
252private async Task StartTasksAndProcessWork(CancellationToken token) 268await Task.WhenAny(_workerTasks); 283private async Task GatherInstalledPackagesAsync(IEnumerable<PackageIdentity> installedPackages, HashSet<string> allPrimaryTargets, CancellationToken token) 355private async Task ProcessResultsAsync() 381var task = Task.Run(async () => await GatherPackageAsync(request, token)); 588private async Task InitializeResourcesAsync(CancellationToken token) 595var getResourceTasks = new List<Task>(); 608var task = Task.Run(async () => await source.GetResourceAsync<DependencyInfoResource>(token)); 616var finishedTask = await Task.WhenAny(getResourceTasks);
src\nuget-client\build\Shared\TaskResult.cs (8)
18public static Task<bool> True { get; } = Task.FromResult(true); 23public static Task<bool> False { get; } = Task.FromResult(false); 36public static Task<int> Zero { get; } = Task.FromResult(0); 41public static Task<int> One { get; } = Task.FromResult(1); 52_ => Task.FromResult(i) 63public static readonly Task<T?> Instance = Task.FromResult<T?>(null); 73public static readonly Task<IEnumerable<T>> Instance = Task.FromResult(Enumerable.Empty<T>()); 83public static readonly Task<T[]> Instance = Task.FromResult(Array.Empty<T>());
Utility\MSBuildNuGetProjectSystemUtility.cs (6)
102internal static async Task TryAddFileAsync( 138internal static async Task AddFilesAsync( 213internal static async Task DeleteFilesAsync( 312() => Task.FromResult(zipArchiveFileEntry.Open()), 332() => Task.FromResult(zipArchiveFileEntry.Open()), 383internal static async Task DeleteFileSafeAsync(
NuGet.Packaging (57)
PackageArchiveReader.cs (4)
357public async Task ValidatePackageEntriesAsync(CancellationToken token) 426return Task.FromResult(_isSigned.Value); 429public override async Task ValidateIntegrityAsync(SignatureContent signatureContent, CancellationToken token) 498return Task.FromResult(hash);
PackageExtractor.cs (6)
23/// <remarks>For PackageReference directory layout, use <see cref="PackageExtractor.InstallFromSourceAsync(string, PackageIdentity, Func{Stream, Task}, VersionFolderPathResolver, PackageExtractionContext, CancellationToken, Guid)"/></remarks> 153/// <remarks>For PackageReference directory layout, use <see cref="PackageExtractor.InstallFromSourceAsync(string, PackageIdentity, Func{Stream, Task}, VersionFolderPathResolver, PackageExtractionContext, CancellationToken, Guid)"/></remarks> 260/// <remarks>For PackageReference directory layout, use <see cref="PackageExtractor.InstallFromSourceAsync(string, PackageIdentity, Func{Stream, Task}, VersionFolderPathResolver, PackageExtractionContext, CancellationToken, Guid)"/></remarks> 380Func<Stream, Task> copyToAsync, 1029private static async Task VerifyPackageSignatureAsync( 1149private static async Task LogPackageSignatureVerificationAsync(
PackageFolderReader.cs (1)
242public override Task ValidateIntegrityAsync(SignatureContent signatureContent, CancellationToken token)
PackageReaderBase.cs (22)
130return Task.FromResult(GetIdentity()); 135return Task.FromResult(GetMinClientVersion()); 140return Task.FromResult(GetPackageTypes()); 145return Task.FromResult(GetStream(path)); 150return Task.FromResult(GetFiles()); 155return Task.FromResult(GetFiles(folder)); 160return Task.FromResult(GetNuspec()); 165return Task.FromResult(GetNuspecFile()); 175return Task.FromResult(CopyFiles(destination, packageFiles, extractFile, logger, cancellationToken)); 324return Task.FromResult(GetFrameworkItems()); 329return Task.FromResult(GetBuildItems()); 334return Task.FromResult(GetToolItems()); 339return Task.FromResult(GetContentItems()); 344return Task.FromResult(GetLibItems()); 349return Task.FromResult(GetReferenceItems()); 354return Task.FromResult(GetPackageDependencies()); 392return Task.FromResult(GetSupportedFrameworks()); 402return Task.FromResult(IsServiceable()); 412return Task.FromResult(GetItems(folderName)); 422return Task.FromResult(GetDevelopmentDependency()); 590return Task.FromResult(NuspecReader); 602public abstract Task ValidateIntegrityAsync(SignatureContent signatureContent, CancellationToken token);
Signing\Archive\ReadOnlyBufferedStream.cs (3)
124public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 139public override Task FlushAsync(CancellationToken cancellationToken) 300public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
Signing\Archive\SignedPackageArchiveUtility.cs (1)
283private static Task RemoveRepositoryPrimarySignatureAsync(
Signing\Authoring\X509SignatureProvider.cs (2)
53return Task.FromResult(signature); 87return Task.FromResult(signature);
Signing\Package\ISignedPackageReader.cs (1)
38Task ValidateIntegrityAsync(SignatureContent signatureContent, CancellationToken token);
Signing\Package\ISignedPackageWriter.cs (2)
20Task RemoveSignatureAsync(CancellationToken token); 28Task AddSignatureAsync(Stream signatureStream, CancellationToken token);
Signing\Package\SignedPackageArchive.cs (3)
39public async Task AddSignatureAsync(Stream signatureStream, CancellationToken token) 69public async Task RemoveSignatureAsync(CancellationToken token) 95return Task.FromResult(SignedPackageArchiveUtility.IsZip64(reader));
Signing\Utility\SigningUtility.cs (1)
175public static async Task SignAsync(SigningOptions options, SignPackageRequest signRequest, CancellationToken token)
Signing\Verification\AllowListVerificationProvider.cs (1)
32return Task.FromResult(VerifyAllowList(package, signature, settings));
Signing\Verification\PackageSignatureVerifier.cs (1)
51var sigTrustResults = await Task.WhenAll(_verificationProviders.Select(e => e.GetTrustResultAsync(package, signature, settings, token)));
Signing\Verification\SignatureTrustAndValidityVerificationProvider.cs (1)
51return Task.FromResult(result);
src\nuget-client\build\Shared\TaskResult.cs (8)
18public static Task<bool> True { get; } = Task.FromResult(true); 23public static Task<bool> False { get; } = Task.FromResult(false); 36public static Task<int> Zero { get; } = Task.FromResult(0); 41public static Task<int> One { get; } = Task.FromResult(1); 52_ => Task.FromResult(i) 63public static readonly Task<T?> Instance = Task.FromResult<T?>(null); 73public static readonly Task<IEnumerable<T>> Instance = Task.FromResult(Enumerable.Empty<T>()); 83public static readonly Task<T[]> Instance = Task.FromResult(Array.Empty<T>());
NuGet.Protocol (141)
DependencyInfo\RegistrationUtility.cs (4)
100rangeTasks.Add(Task.FromResult<JObject?>(item)); 105await Task.WhenAll(rangeTasks.ToArray()); 174rangeTasks.Add(Task.FromResult<RegistrationPage?>(page)); 179await Task.WhenAll(rangeTasks.ToArray());
HttpSource\HttpCacheUtility.cs (1)
51public static async Task CreateCacheFileAsync(
HttpSource\HttpHandlerResourceV3Provider.cs (1)
54return Task.FromResult(new Tuple<bool, INuGetResource?>(curResource != null, curResource));
HttpSource\HttpRequestMessageExtensions.cs (1)
70protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context)
HttpSource\HttpRetryHandler.cs (2)
86await Task.Delay(retryAfter.Value, cancellationToken); 92await Task.Delay(TimeSpan.FromMilliseconds((Math.Pow(2, tries) * request.RetryDelay.TotalMilliseconds) + new Random().Next(200)), cancellationToken);
HttpSource\HttpSourceResourceProvider.cs (1)
81return Task.FromResult(new Tuple<bool, INuGetResource?>(curResource != null, curResource));
HttpSource\IThrottle.cs (1)
23Task WaitAsync();
HttpSource\NullThrottle.cs (2)
24public Task WaitAsync() 26return Task.CompletedTask;
HttpSource\SemaphoreSlimThrottle.cs (1)
24public async Task WaitAsync()
LegacyFeed\ODataServiceDocumentUtils.cs (2)
33return Task.FromResult(url); 36return Task.FromResult(response.RequestMessage.RequestUri!.ToString());
LocalPackageArchiveDownloader.cs (1)
246return Task.FromResult(packageHash);
LocalRepositories\LocalAutoCompleteResource.cs (2)
67return await Task.Run(() => 99return await Task.Run(() =>
LocalRepositories\LocalDependencyInfoResource.cs (2)
84return Task.FromResult<SourcePackageDependencyInfo?>(result); 137return Task.FromResult<IEnumerable<SourcePackageDependencyInfo>>(results);
LocalRepositories\LocalDownloadResource.cs (2)
84return Task.FromResult(new DownloadResourceResult(stream, packageInfo.GetReader(), _localResource.Root)); 88return Task.FromResult(new DownloadResourceResult(DownloadResourceResultStatus.NotFound));
LocalRepositories\LocalMetadataResource.cs (3)
83return Task.Run<IEnumerable<NuGetVersion>>(() => 113return Task.FromResult(_localResource.Exists(identity, log, token)); 126return Task.FromResult(_localResource.Exists(packageId, log, token));
LocalRepositories\LocalPackageListResource.cs (1)
56return Task.FromResult(enumerable);
LocalRepositories\LocalPackageMetadataResource.cs (2)
40return Task.Run<IEnumerable<IPackageSearchMetadata>>(() => 56return Task.Run<IPackageSearchMetadata?>(() =>
LocalRepositories\LocalPackageSearchResource.cs (1)
43return await Task.Factory.StartNew(() =>
LocalRepositories\LocalV2FindPackageByIdResource.cs (4)
100return Task.FromResult(infos.Select(p => p.Identity.Version)); 254return Task.FromResult<FindPackageByIdDependencyInfo?>(dependencyInfo); 325return Task.FromResult<IPackageDownloader?>(packageDownloader); 388return Task.FromResult(GetPackageInfo(id, version, cacheContext, logger) != null);
LocalRepositories\LocalV3FindPackageByIdResource.cs (4)
134return Task.FromResult<IEnumerable<NuGetVersion>>(GetVersions(id, cacheContext, logger)); 304return Task.FromResult<FindPackageByIdDependencyInfo?>(dependencyInfo); 367return Task.FromResult<IPackageDownloader?>(packageDependency); 430return Task.FromResult(DoesVersionExist(id, version));
Model\PackageSearchMetadata.cs (2)
301public Task<IEnumerable<VersionInfo>> GetVersionsAsync() => Task.FromResult<IEnumerable<VersionInfo>>(ParsedVersions ?? Enumerable.Empty<VersionInfo>()); 315public Task<PackageDeprecationMetadata?> GetDeprecationMetadataAsync() => Task.FromResult(DeprecationMetadata);
Plugins\AutomaticProgressReporter.cs (1)
170Task.Run(async () =>
Plugins\Connection.cs (2)
168public async Task ConnectAsync(CancellationToken cancellationToken) 225public async Task SendAsync(Message message, CancellationToken cancellationToken)
Plugins\IConnection.cs (1)
57Task SendAsync(Message message, CancellationToken cancellationToken);
Plugins\IMessageDispatcher.cs (4)
52Task DispatchCancelAsync(Message request, CancellationToken cancellationToken); 61Task DispatchFaultAsync(Message request, Fault fault, CancellationToken cancellationToken); 70Task DispatchProgressAsync(Message request, Progress progress, CancellationToken cancellationToken); 98Task DispatchResponseAsync<TOutbound>(Message request, TOutbound responsePayload, CancellationToken cancellationToken)
Plugins\InboundRequestContext.cs (3)
101private async Task ProcessResponseAsync(IRequestHandler requestHandler, Message request, IResponseHandler responseHandler) 194Task.Run(async () => 256Func<Task> task = () => ProcessResponseAsync(requestHandler, request, responseHandler);
Plugins\InboundRequestProcessingHandler.cs (2)
50internal void Handle(MessageMethod messageMethod, Func<Task> task, CancellationToken cancellationToken) 59Task.Run(task, cancellationToken);
Plugins\IPluginMulticlientUtilities.cs (2)
28Task DoOncePerPluginLifetimeAsync(string key, Func<Task> taskFunc, CancellationToken cancellationToken);
Plugins\IRequestHandler.cs (1)
35Task HandleResponseAsync(
Plugins\IResponseHandler.cs (1)
27Task SendResponseAsync<TPayload>(Message request, TPayload payload, CancellationToken cancellationToken)
Plugins\ISender.cs (1)
40Task SendAsync(Message message, CancellationToken cancellationToken);
Plugins\Logging\TaskLogMessage.cs (1)
25_currentTaskId = Task.CurrentId;
Plugins\MessageDispatcher.cs (14)
181public Task DispatchCancelAsync(Message request, CancellationToken cancellationToken) 195return Task.CompletedTask; 211public Task DispatchFaultAsync(Message request, Fault fault, CancellationToken cancellationToken) 225return Task.CompletedTask; 242public Task DispatchProgressAsync(Message request, Progress progress, CancellationToken cancellationToken) 261return Task.CompletedTask; 317public Task DispatchResponseAsync<TOutbound>( 340return Task.CompletedTask; 370Task IResponseHandler.SendResponseAsync<TPayload>( 378private async Task DispatchAsync<TOutgoing>( 403private async Task DispatchCancelAsync( 413private async Task DispatchFaultAsync( 437private async Task DispatchProgressAsync( 448private async Task DispatchWithExistingContextAsync(
Plugins\OutboundRequestContext`1.cs (1)
276Task.Run(async () =>
Plugins\PluginCacheEntry.cs (1)
62public async Task UpdateCacheFileAsync()
Plugins\PluginManager.cs (1)
432private static async Task InitializePluginAsync(
Plugins\PluginMulticlientUtilities.cs (5)
16private readonly ConcurrentDictionary<string, Lazy<Task>> _actions; 23_actions = new ConcurrentDictionary<string, Lazy<Task>>(); 39public async Task DoOncePerPluginLifetimeAsync( 41Func<Task> taskFunc, 56var lazyTask = _actions.GetOrAdd(key, _ => new Lazy<Task>(() => taskFunc()));
Plugins\PluginPackageReader.cs (1)
1133public override Task ValidateIntegrityAsync(SignatureContent signatureContent, CancellationToken token)
Plugins\RequestHandlers\CloseRequestHandler.cs (2)
60public Task HandleResponseAsync( 85return Task.CompletedTask;
Plugins\RequestHandlers\GetCredentialsRequestHandler.cs (1)
117public async Task HandleResponseAsync(
Plugins\RequestHandlers\GetServiceIndexRequestHandler.cs (1)
101public async Task HandleResponseAsync(
Plugins\RequestHandlers\LogRequestHandler.cs (1)
59public async Task HandleResponseAsync(
Plugins\RequestHandlers\MonitorNuGetProcessExitRequestHandler.cs (1)
77public async Task HandleResponseAsync(
Plugins\RequestHandlers\SymmetricHandshake.cs (1)
162public async Task HandleResponseAsync(
Plugins\Sender.cs (2)
120public Task SendAsync(Message message, CancellationToken cancellationToken) 167return Task.CompletedTask;
Plugins\StandardInputReceiver.cs (2)
24private Task? _receiveThread; 102_receiveThread = Task.Factory.StartNew(
Providers\FeedTypeResourceProvider.cs (1)
63return Task.FromResult(new Tuple<bool, INuGetResource?>(curResource != null, curResource));
Providers\ServiceIndexResourceV3Provider.cs (1)
180await Task.Delay(TimeSpan.FromMilliseconds(_enhancedHttpRetryHelper.DelayInMillisecondsOrDefault), token);
RemotePackageArchiveDownloader.cs (1)
239return Task.FromResult(packageHash);
RemoteRepositories\HttpFileSystemBasedFindPackageByIdResource.cs (1)
563await Task.Delay(TimeSpan.FromMilliseconds(_enhancedHttpRetryHelper.DelayInMillisecondsOrDefault), cancellationToken);
RemoteRepositories\PluginFindPackageByIdResource.cs (2)
141return Task.FromResult<IPackageDownloader?>(packageDependency); 499private async Task SetLogLevelAsync(ILogger logger, CancellationToken cancellationToken)
RemoteRepositories\RemoteV3FindPackageByIdResource.cs (1)
454private async Task EnsureDependencyProvider(CancellationToken cancellationToken)
Resources\DownloadResourcePlugin.cs (1)
165private async Task SetLogLevelAsync(ILogger logger, CancellationToken cancellationToken)
Resources\PackageUpdateResource.cs (10)
56public async Task Push( 82public async Task PushAsync( 128public async Task Push( 155public async Task Delete(string packageId, 165public async Task Delete(string packageId, 203private async Task PushSymbolsPath(string packagePath, 262private async Task PushPackagePath(string packagePath, 678private async Task PushPackageToFileSystem(Uri sourceUri, 726private async Task DeletePackage(string apiKey, 751private async Task DeletePackageFromServer(string source,
Resources\PluginResource.cs (1)
92private async Task SetPackageSourceCredentialsAsync(IPlugin plugin, CancellationToken cancellationToken)
Resources\VulnerabilityInfoResourceV3.cs (1)
161await Task.WhenAll(tasks);
src\nuget-client\build\Shared\TaskResult.cs (8)
18public static Task<bool> True { get; } = Task.FromResult(true); 23public static Task<bool> False { get; } = Task.FromResult(false); 36public static Task<int> Zero { get; } = Task.FromResult(0); 41public static Task<int> One { get; } = Task.FromResult(1); 52_ => Task.FromResult(i) 63public static readonly Task<T?> Instance = Task.FromResult<T?>(null); 73public static readonly Task<IEnumerable<T>> Instance = Task.FromResult(Enumerable.Empty<T>()); 83public static readonly Task<T[]> Instance = Task.FromResult(Array.Empty<T>());
Utility\DedicatedAsynchronousProcessingThread.cs (8)
13/// Uses a queue to execute all the tasks added through the invocation of <see cref="Enqueue(Func{Task})"/>. 19private Task? _processingThread; 23private readonly ConcurrentQueue<Func<Task>> _taskQueue = new ConcurrentQueue<Func<Task>>(); 39_processingThread = Task.Factory.StartNew( 50internal void Enqueue(Func<Task> task) 57private async Task ProcessAsync() 69await Task.Delay(_pollingDelay.Milliseconds);
Utility\FindPackagesByIdNupkgDownloader.cs (5)
171Func<Stream, Task> processStreamAsync, 215Func<Stream, Task> processStreamAsync, 313await Task.Delay(TimeSpan.FromMilliseconds(_enhancedHttpRetryHelper.DelayInMillisecondsOrDefault), token); 335Func<Stream, Task> processStreamAsync, 354return Task.FromResult(new FileStream(
Utility\OfflineFeedUtility.cs (1)
134public static async Task AddPackageToSource(
Utility\StreamExtensions.cs (1)
15public static async Task CopyToAsync(this Stream stream, Stream destination, CancellationToken token)
Utility\TimeoutUtility.cs (5)
39var timeoutTask = Task.Delay(timeout, timeoutTcs.Token); 42if (timeoutTask == await Task.WhenAny(responseTask, timeoutTask).ConfigureAwait(false)) 58public static async Task StartWithTimeout( 59Func<CancellationToken, Task> getTask,
OrderProcessor (5)
OrderProcessingWorker.cs (5)
24protected override Task ExecuteAsync(CancellationToken stoppingToken) 26return Task.Factory.StartNew(async () => 46public override async Task StopAsync(CancellationToken cancellationToken) 53private Task ProcessMessageAsync(object? sender, BasicDeliverEventArgs args) 77return Task.CompletedTask;
Pipelines.Library (1)
DistributedApplicationPipelineExtensions.cs (1)
56private static async Task DeployProjectToAppServiceAsync(
PresentationBuildTasks (1)
Microsoft\Build\Tasks\Windows\MarkupCompilePass1.cs (1)
1266System.Threading.Tasks.Task.Run(() =>
PresentationFramework (1)
System\Windows\Controls\SoundPlayerAction.cs (1)
155Task.Run(() =>
Producer (3)
ContinuousProducerWorker.cs (1)
10protected override async Task ExecuteAsync(CancellationToken stoppingToken)
IntermittentProducerWorker.cs (2)
10protected override async Task ExecuteAsync(CancellationToken stoppingToken) 25await Task.Delay(TimeSpan.FromSeconds(10), stoppingToken);
Publishers.AppHost (4)
DistributedApplicationBuilderExtensions.cs (4)
34private async Task PublishAsync(PipelineStepContext context) 86await Task.Delay(5000); 124await Task.CompletedTask; 161return Task.CompletedTask;
Roslyn.Diagnostics.Analyzers (147)
AbstractApplyTraitToClass`1.cs (1)
32public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
AbstractCreateTestAccessor`1.cs (1)
30public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
AbstractExposeMemberForTesting`1.cs (1)
36public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
AbstractRunIterations`1.cs (1)
25public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
DoNotMixAttributesFromDifferentVersionsOfMEF.Fixer.cs (2)
24public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) 27return Task.CompletedTask;
ExportedPartsShouldHaveImportingConstructorCodeFixProvider.cs (2)
35public override Task RegisterCodeFixesAsync(CodeFixContext context) 76return Task.CompletedTask;
ImportingConstructorShouldBeObsoleteCodeFixProvider.cs (2)
32public override Task RegisterCodeFixesAsync(CodeFixContext context) 82return Task.CompletedTask;
PartsExportedWithMEFv2MustBeMarkedAsShared.Fixer.cs (2)
30public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 65return Task.FromResult(document.WithSyntaxRoot(root.ReplaceNode(declaration, newDeclaration)));
src\0bf6ba47805c8821\AbstractMoveDeclarationNearReferenceService.cs (1)
118private static async Task MoveDeclarationToFirstReferenceAsync(
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
148public Task AppendAsync(Stream stream, CancellationToken cancellationToken = default) 158private async Task AppendAsyncCore(Stream stream, CancellationToken cancellationToken)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\PerformanceSensitiveAttribute.cs (1)
93/// <see cref="System.Threading.Tasks.Task"/>, either through caching the result or by using
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
602return (await Task.WhenAll(sequence.Select(item => selector(item, cancellationToken))).ConfigureAwait(false)).Flatten();
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (4)
232public static Task ReportNonFatalErrorAsync(this Task task) 242public static Task ReportNonFatalErrorUnlessCancelledAsync(this Task task, CancellationToken cancellationToken)
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (1)
44public new Task WaitUntilCurrentBatchCompletesAsync()
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (3)
98private Task<(bool ranToCompletion, TResult? result)> _updateTask = Task.FromResult((ranToCompletion: true, default(TResult?))); 228async Task<(bool ranToCompletion, TResult? result)> ContinueAfterDelayAsync(Task lastTask) 244await Task.Yield().ConfigureAwait(false);
src\roslyn\src\Dependencies\Threading\ConfiguredYieldAwaitable.cs (1)
16/// <see cref="Task.Yield"/>.
src\roslyn\src\Dependencies\Threading\ParallelExtensions.cs (4)
30public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 33public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 36public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 39public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body)
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (21)
37public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 55public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 72public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 109private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 118return Task.FromCanceled(cancellationToken); 122Func<object, Task> taskBody = static async o => 204return Task.FromException(e); 215public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 233public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 250public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 274private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 283return Task.FromCanceled(cancellationToken); 287Func<object, Task> taskBody = static async o => 369return Task.FromException(e); 395private readonly Func<object, Task> _taskBody; 418protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 468System.Threading.Tasks.Task.Factory.StartNew(_taskBody!, this, default(CancellationToken), TaskCreationOptions.DenyChildAttach, _scheduler); 478public Task AcquireLock() 584IEnumerable<TSource> source, Func<object, Task> taskBody, 610IAsyncEnumerable<TSource> source, Func<object, Task> taskBody, 637T fromExclusive, T toExclusive, Func<object, Task> taskBody,
src\roslyn\src\Dependencies\Threading\ProducerConsumer.cs (35)
25Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 46public static Task RunAsync<TArgs>( 48Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 49Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 64public static Task RunAsync<TArgs>( 66Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 67Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 87public static Task RunParallelAsync<TSource, TArgs>( 89Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 90Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 101public static Task RunParallelAsync<TSource, TArgs>( 103Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 104Func<IAsyncEnumerable<TItem>, TArgs, CancellationToken, Task> consumeItems, 124public static Task RunParallelAsync<TSource, TArgs>( 126Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 127Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 138public static Task RunParallelAsync<TSource, TArgs>( 140Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 141Func<ImmutableArray<TItem>, TArgs, CancellationToken, Task> consumeItems, 159Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 173Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 193Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 206Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 225Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 249Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 283/// Equivalent to <see cref="RunParallelAsync{TSource, TArgs}(IEnumerable{TSource}, Func{TSource, Action{TItem}, TArgs, CancellationToken, Task}, TArgs, CancellationToken)"/>, 290Func<TSource, Action<TItem>, TArgs, CancellationToken, Task> produceItems, 321Func<Action<TItem>, TArgs, CancellationToken, Task> produceItems, 342var writeTask = ProduceItemsAndWriteToChannelAsync(); 344await Task.WhenAll(writeTask, readTask).ConfigureAwait(false); 350await Task.Yield().ConfigureAwait(false); 354Task ProduceItemsAndWriteToChannelAsync() 359await Task.Yield().ConfigureAwait(false); 375private static async Task PerformActionAndCloseWriterAsync<TArgs>( 376Func<TArgs, CancellationToken, Task> action,
src\roslyn\src\Dependencies\Threading\TaskExtensions.cs (5)
25public static NoThrowTaskAwaitable NoThrowAwaitableInternal(this Task task, bool captureContext = true) 38private readonly Task _task; 50public NoThrowTaskAwaitable(Task task, bool captureContext) 74private readonly Task _task; 86public NoThrowTaskAwaiter(Task task, bool captureContext)
src\roslyn\src\Dependencies\Threading\YieldAwaitableExtensions.cs (4)
15/// Implements <c>ConfigureAwait(bool)</c> for <see cref="Task.Yield"/>. The resulting behavior in asynchronous code 16/// is the same as one would expect for <see cref="Task.ConfigureAwait(bool)"/>. 18/// <param name="awaitable">The awaitable provided by <see cref="Task.Yield"/>.</param> 19/// <param name="continueOnCapturedContext"><inheritdoc cref="Task.ConfigureAwait(bool)"/></param>
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (3)
258return Task.FromCanceled<CodeAnalysisMetricData>(context.CancellationToken); 324=> (await Task.WhenAll( 329select Task.Run(() => ComputeAsync(child, context))).ConfigureAwait(false)).ToImmutableArray();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
22Task AnalyzeAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy.cs (1)
24asynchronousComputeFunction: static (outerArg, cancellationToken) => Task.FromResult(outerArg.synchronousComputeFunction(outerArg.arg, cancellationToken)),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (5)
93/// Creates an AsyncLazy that always returns the value, analogous to <see cref="Task.FromResult{T}" />. 97_cachedResult = Task.FromResult(value); 297CompleteWithTask(Task.FromException<T>(ex), CancellationToken.None); 302CompleteWithTask(Task.FromResult(result), CancellationToken.None); 331return Task.FromCanceled<T>(cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncPriorityWorkQueue.cs (6)
62private Task _updateTask = Task.CompletedTask; 135async Task ContinueAfterDelayAsync(Task lastTask) 151await Task.Yield().ConfigureAwait(false); 163private async Task ProcessNextBatchAsync()
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (4)
46var tasks = new Task[streams.Length]; 55Task.WhenAll(tasks).CompletesChannel(channel); 59static async Task ProcessAsync(IAsyncEnumerable<T> stream, ChannelWriter<T> writer, CancellationToken cancellationToken) 70public static void CompletesChannel<T>(this Task task, Channel<T> channel)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (12)
18public static readonly Task<bool> True = Task.FromResult(true); 19public static readonly Task<bool> False = Task.FromResult(false); 23public static readonly Task EmptyTask = Task.CompletedTask; 82return new ValueTask<T[]>(Task.WhenAll(taskArray.Select(task => task.AsTask()))); 90await Task.WhenAll((IEnumerable<Task>)tasks).ConfigureAwait(false); 100public static readonly Task<T?> Default = Task.FromResult<T?>(default); 101public static readonly Task<IEnumerable<T>> EmptyEnumerable = Task.FromResult<IEnumerable<T>>(SpecializedCollections.EmptyEnumerable<T>()); 102public static readonly Task<ImmutableArray<T>> EmptyImmutableArray = Task.FromResult(ImmutableArray<T>.Empty); 103public static readonly Task<IList<T>> EmptyList = Task.FromResult(SpecializedCollections.EmptyList<T>()); 104public static readonly Task<IReadOnlyList<T>> EmptyReadOnlyList = Task.FromResult(SpecializedCollections.EmptyReadOnlyList<T>());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (3)
60/// Asserts the <see cref="Task"/> passed has already been completed. 67public static void VerifyCompleted(this Task task) 76/// Asserts the <see cref="Task"/> passed has already been completed.
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
151=> compilation.GetTypeByMetadataName(typeof(Task).FullName!);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (3)
37protected abstract Task FixAsync( 48public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) 54protected sealed override async Task FixAllAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
80Func<SyntaxEditor, Task> editAsync, 97protected abstract Task FixAllAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
93protected abstract Task AddPotentiallyConflictingImportsAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
200public static async Task VerifyNoErrorsAsync(this Document newDocument, string message, CancellationToken cancellationToken, List<string>? ignoreErrorCodes = null)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (6)
26public static Task ApplyExpressionLevelSemanticEditsAsync<TType, TNode>( 49public static Task ApplyExpressionLevelSemanticEditsAsync<TType, TNode>( 72public static Task ApplyExpressionLevelSemanticEditsAsync<TNode>( 93public static Task ApplyMethodBodySemanticEditsAsync<TType, TNode>( 116public static Task ApplyMethodBodySemanticEditsAsync<TNode>( 150private static async Task ApplySemanticEditsAsync<TType, TNode>(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
150private async Task ReduceAsync(
TestExportsShouldNotBeDiscoverableCodeFixProvider.cs (2)
35public override Task RegisterCodeFixesAsync(CodeFixContext context) 47return Task.CompletedTask;
Roslyn.Diagnostics.CSharp.Analyzers (9)
CSharpAvoidOptSuffixForNullableEnableCodeCodeFixProvider.cs (1)
31public override async Task RegisterCodeFixesAsync(CodeFixContext context)
CSharpDoNotUseDebugAssertForInterpolatedStringsFixer.cs (1)
29public override async Task RegisterCodeFixesAsync(CodeFixContext context)
NumberCommentsRefactoring.cs (1)
35public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
PreferNullLiteralCodeFixProvider.cs (2)
33public override Task RegisterCodeFixesAsync(CodeFixContext context) 45return Task.CompletedTask;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
157returnType.Name is not nameof(Task) and not nameof(ValueTask) &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (2)
41protected override Task AddPotentiallyConflictingImportsAsync( 128public async Task AddPotentiallyConflictingImportsAsync(SyntaxNode container, HashSet<INamespaceSymbol> conflicts, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
95public static async Task UpdateParameterReferencesAsync(
rzc (31)
Client.cs (3)
33public abstract Task WaitForDisconnectAsync(CancellationToken cancellationToken); 158public override async Task WaitForDisconnectAsync(CancellationToken cancellationToken) 169await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken);
Connection.cs (1)
14public abstract Task WaitForDisconnectAsync(CancellationToken cancellationToken);
ConnectionHost.cs (2)
94public override async Task WaitForDisconnectAsync(CancellationToken cancellationToken) 105await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken);
DefaultRequestDispatcher.cs (9)
22private Task _timeoutTask; 23private Task _gcTask; 125Task.WaitAll(_connections.ToArray()); 143var all = new List<Task>(_connections.Count + 3); 152Task.WaitAny(waitArray, cancellationToken); 227_timeoutTask = Task.Delay(_keepAlive.TimeSpan); 235_gcTask = Task.Delay(GCTimeout); 363var watcher = connection.WaitForDisconnectAsync(buildCancelled.Token); 367await Task.WhenAny(worker, watcher);
DiscoverCommand.cs (3)
149return Task.FromResult(ExitCodeFailure); 154return Task.FromResult(ExecuteWithSourceGenerator( 169return Task.FromResult(result);
GenerateCommand.cs (3)
83return Task.FromResult(ExitCodeFailure); 94return Task.FromResult(ExecuteWithSourceGenerator(sourceItems)); 106return Task.FromResult(result);
ServerCommand.cs (3)
71return Task.FromResult(-1); 78return Task.FromResult(1); 114return Task.FromResult(0);
ServerProtocol\ServerConnection.cs (2)
248var monitorTask = client.WaitForDisconnectAsync(serverCts.Token); 249await Task.WhenAny(new[] { responseTask, monitorTask }).ConfigureAwait(false);
ServerProtocol\ServerProtocol.cs (1)
38internal static async Task ReadAllAsync(
ServerProtocol\ServerRequest.cs (1)
168public async Task WriteAsync(Stream outStream, CancellationToken cancellationToken = default(CancellationToken))
ServerProtocol\ServerResponse.cs (1)
46public async Task WriteAsync(Stream outStream, CancellationToken cancellationToken)
ShadowCopyManager.cs (2)
76public Task PurgeUnusedDirectoriesAsync() 78return Task.Run((Action)PurgeUnusedDirectories);
ScenarioTests.Common.Tests (18)
ScenarioTestTypes.cs (11)
235public Task RunOnThreadPoolThread() 237return Task.Run(() => 269public static void Run(Func<Task> asyncMethod) 277var t = asyncMethod(); 776return Task.Run<Guid>(() => guid); 973Task.Run(async () => 975await Task.Delay(100); 984Task.Run(async () => 986await Task.Delay(100); 995Task.Run(async () => 997await Task.Delay(100);
ServiceInterfaces.cs (4)
94Task EchoReturnTaskAsync(); 425Task DoWorkAsync(); 431Task CallWithWaitAsync(int delayTime); 900Task OneWayAsync(string text);
TestMockStream.cs (3)
29public Func<Stream, int, CancellationToken, Task> CopyToAsyncFunc { get; set; } 48public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 50Task t = null;
Security.TransportSecurity.IntegrationTests (6)
Https\HttpsTests.4.1.0.cs (1)
275public static async Task ServerCertificateValidationUsingIdentity_EchoString()
Tcp\ClientCredentialTypeTests.4.1.1.cs (1)
260Task.Run(() => serviceProxy.Ping(guid));
Tcp\StreamingTests.4.1.0.cs (4)
381bool success = Task.Run(() => 385Task.Factory.StartNew(() => StreamingTests.NetTcp_TransportSecurity_Streamed_RoundTrips_String(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait(); 399bool success = Task.Run(() => 403Task.Factory.StartNew(() => StreamingTests.NetTcp_TransportSecurity_Streamed_Async_RoundTrips_String(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
ServiceBusWorker (10)
Consumer.cs (7)
8protected override async Task ExecuteAsync(CancellationToken cancellationToken) 17private Task MessageHandler(ProcessMessageEventArgs args) 22return Task.CompletedTask; 25private Task ErrorHandler(ProcessErrorEventArgs args) 29return Task.CompletedTask; 32public override Task StopAsync(CancellationToken cancellationToken) 35return Task.CompletedTask;
Producer.cs (3)
9protected override async Task ExecuteAsync(CancellationToken cancellationToken) 23public override Task StopAsync(CancellationToken cancellationToken) 26return Task.CompletedTask;
Shared (3)
ServerSentEvents\SseFormatter.cs (3)
30public static Task WriteAsync(IAsyncEnumerable<SseItem<string>> source, Stream destination, CancellationToken cancellationToken = default) 54public static Task WriteAsync<T>(IAsyncEnumerable<SseItem<T>> source, Stream destination, Action<SseItem<T>, IBufferWriter<byte>> itemFormatter, CancellationToken cancellationToken = default) 74private static async Task WriteAsyncCore<T>(IAsyncEnumerable<SseItem<T>> source, Stream destination, Action<SseItem<T>, IBufferWriter<byte>> itemFormatter, CancellationToken cancellationToken)
Shared.Tests (8)
Memoization\MemoizeTests.cs (2)
22public async Task MemoizeFunction_TaskReturningMethod_CanInvoke() 24Func<int, Task<int>> doubler = x => Task.FromResult(x * 2);
Pools\PoolTests.cs (6)
235public async Task Threading() 243await Task.WhenAll(new[] 245Task.Run(() => FunWithPools(pool, 1)), 246Task.Run(() => FunWithPools(pool, 2)), 247Task.Run(() => FunWithPools(pool, 3)), 248Task.Run(() => FunWithPools(pool, 4))
SignalRServerlessWeb (2)
Program.cs (2)
54protected override async Task ExecuteAsync(CancellationToken stoppingToken) 60await Task.Delay(2000, stoppingToken);
SignalRWeb (1)
Hubs\ChatHub.cs (1)
5public async Task SendMessage(string user, string message)
SimplePipelines.AppHost (3)
AppHost.cs (3)
16await Task.Delay(500, context.CancellationToken).ConfigureAwait(false); 34await Task.Delay(500, context.CancellationToken).ConfigureAwait(false); 52await Task.Delay(500, context.CancellationToken).ConfigureAwait(false);
Stress.ApiService (36)
ProducerConsumer.cs (5)
24public async Task ProduceAndConsumeAsync(int count) 26var consumerTask = Task.Run(async () => 40await Task.Delay(Random.Shared.Next(10, 50)); 53await Task.Delay(Random.Shared.Next(10, 50));
Program.cs (24)
140await Task.Delay(TimeSpan.FromSeconds(0.5)); 206await Task.Delay(100); 231await Task.Delay(50); 236static async Task RecurseToError(int current, int depth) 238await Task.Yield(); 277_ = Task.Run(async () => 293await Task.Delay(5, cancellationToken); 371await Task.Delay(1000); 374await Task.Delay(1000); 413await Task.Delay(100); 417await Task.Delay(100); 421await Task.Delay(10); 426await Task.Delay(20); 431await Task.Delay(30); 436await Task.Delay(100); 441await Task.Delay(30); 446await Task.Delay(20); 451await Task.Delay(10); 747await Task.Delay(100); 766await Task.Delay(100); 805await Task.Delay(100); 879await Task.Delay(100); 886async Task SimulateWorkAsync(ActivitySource source, int index, int millisecondsDelay = 2) 890await Task.Delay(millisecondsDelay);
TestMetrics.cs (2)
36Task.Run(async () => 44await Task.Delay(1000);
TraceCreator.cs (5)
35public async Task CreateTraceAsync(string traceName, int count, bool createChildren, string? rootName = null) 43await Task.Delay(Random.Shared.Next(10, 50)); 67private async Task CreateChildActivityAsync(string parentName) 106await Task.Delay(Random.Shared.Next(10, 50)); 110await Task.Delay(Random.Shared.Next(10, 50));
Stress.AppHost (62)
AppHost.cs (1)
14await Task.Delay(5_000, ct);
CommandResources.cs (30)
31return Task.FromResult(CommandResults.Success()); 42return Task.FromResult(CommandResults.Success()); 55return Task.FromResult(CommandResults.Success()); 66return Task.FromResult(CommandResults.Success()); 78return Task.FromResult(CommandResults.Success()); 90return Task.FromResult(CommandResults.Success()); 98return Task.FromResult(CommandResults.Success()); 114return Task.FromResult(CommandResults.Failure("The message and count arguments are required.")); 124return Task.FromResult(CreateJsonSuccess("Echoed command arguments.", response)); 164return Task.FromResult(CommandResults.Failure("The message argument is required.")); 168return Task.FromResult(CommandResults.Failure("The repeat argument must be between 1 and 10.")); 182return Task.FromResult(CreateJsonSuccess("Echoed command arguments.", payload, displayImmediately: true)); 249return Task.FromResult(CommandResults.Failure("The target argument is required.")); 253return Task.FromResult(CommandResults.Failure("The timeoutSeconds argument must be positive.")); 266? Task.FromResult(CreateJsonFailure("Argument validation failed.", payload)) 267: Task.FromResult(CreateJsonSuccess("Argument validation passed.", payload)); 281return Task.CompletedTask; 345return Task.FromResult(CreateJsonSuccess("Summarized command arguments.", payload, displayImmediately: true)); 368return Task.FromResult(CreateJsonSuccess("Dependent arguments received.", payload, displayImmediately: true)); 405await Task.Delay(1000, context.CancellationToken); 456await Task.Delay(500, context.CancellationToken); 926return Task.FromResult(CommandResults.Success()); 969return Task.FromResult(CommandResults.Success("Generated token.", resultData)); 989return Task.FromResult(CommandResults.Success(message, new CommandResultData { Value = connectionString, DisplayImmediately = true })); 999return Task.FromResult(CommandResults.Failure("Validation failed", json, CommandResultFormat.Json)); 1007return Task.FromResult(CommandResults.Failure("Health check failed", "Connection refused: ECONNREFUSED 127.0.0.1:5432\nRetries exhausted after 3 attempts", CommandResultFormat.Text)); 1033return Task.FromResult(CommandResults.Success("Database migrated.", new CommandResultData { Value = markdown, Format = CommandResultFormat.Markdown })); 1186private static async Task ExecuteCommandForAllResourcesAsync(IServiceProvider serviceProvider, string commandName, CancellationToken cancellationToken) 1196var commandTasks = new List<Task>(); 1201await Task.WhenAll(commandTasks).ConfigureAwait(false);
InteractionCommands.cs (26)
23await Task.WhenAll(resultTask1, resultTask2); 35await Task.Yield(); 122return Task.CompletedTask; 258return Task.CompletedTask; 305await Task.Delay(5000, context.CancellationToken); 324await Task.Delay(5000, context.CancellationToken); 374await Task.Delay(5000, context.CancellationToken); 397return Task.CompletedTask; 444await Task.Delay(1000, context.CancellationToken); 461await Task.Delay(1000, context.CancellationToken); 497return Task.CompletedTask; 562return Task.FromResult(CommandResults.Success()); 616await Task.Delay(1500, context.CancellationToken); 640await Task.Delay(2000, context.CancellationToken); 678await Task.Delay(1000, context.CancellationToken); 713await Task.Delay(6000, context.CancellationToken); 728await Task.Delay(3000, context.CancellationToken); 770return Task.CompletedTask; 807await Task.Delay(10000, ctx.CancellationToken); 834await Task.Delay(10000, ctx.CancellationToken); 863await Task.Delay(10000, commandContext.CancellationToken); 886await Task.Delay(10000, ctx.CancellationToken); 909await Task.Delay(10000, ctx.CancellationToken); 934await Task.Delay(10000, ctx.CancellationToken); 975await Task.Delay(10000, commandContext.CancellationToken); 1093private static void RunInteractionWithDismissValues(string title, Func<bool?, string, Task> action)
TestResource.cs (5)
137public Task OnBeforeStartAsync(BeforeStartEvent @event, CancellationToken cancellationToken = default) 145Task.Run(async () => 173return Task.CompletedTask; 182public Task SubscribeAsync(IDistributedApplicationEventing eventing, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken) 185return Task.CompletedTask;
Stress.TelemetryService (8)
CounterMetrics.cs (2)
10protected override async Task ExecuteAsync(CancellationToken cancellationToken) 23await Task.Delay(20, cancellationToken);
GaugeMetrics.cs (2)
11protected override Task ExecuteAsync(CancellationToken cancellationToken) 34return Task.CompletedTask;
TelemetryStresser.cs (4)
22protected override async Task ExecuteAsync(CancellationToken cancellationToken) 43await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken); 47private static async Task ExportMetrics(ILogger<TelemetryStresser> logger, Metadata metadata, MetricsService.MetricsServiceClient client, int value, CancellationToken cancellationToken) 89private static async Task ExportStructuredLog(ILogger<TelemetryStresser> logger, Metadata metadata, LogsService.LogsServiceClient client, int value, CancellationToken cancellationToken)
SuperFileCheck (2)
Program.cs (2)
729tasks[i] = Task.Run(() => RunSuperFileCheckAsync(methodDeclInfos[index], argsToCopy.ToArray(), checkPrefixes, tmpFilePath)); 732await Task.WhenAll(tasks);
System.CommandLine (4)
Command.cs (3)
141public void SetAction(Func<ParseResult, CancellationToken, Task> action) 159/// When possible, prefer using the <see cref="SetAction(Func{ParseResult, CancellationToken, Task})"/> overload 165public void SetAction(Func<ParseResult, Task> action)
Invocation\InvocationPipeline.cs (1)
77Task<int> firstCompletedTask = await Task.WhenAny(startedInvocation, terminationHandler.ProcessTerminationCompletionSource.Task);
System.ComponentModel.Annotations (10)
System\ComponentModel\DataAnnotations\Validator.cs (10)
519/// <returns>A <see cref="Task" /> representing the asynchronous validation operation.</returns> 523public static async Task ValidatePropertyAsync( 549/// <returns>A <see cref="Task" /> representing the asynchronous validation operation.</returns> 558public static Task ValidateObjectAsync( 577/// <returns>A <see cref="Task" /> representing the asynchronous validation operation.</returns> 586public static async Task ValidateObjectAsync( 615/// <returns>A <see cref="Task" /> representing the asynchronous validation operation.</returns> 618public static async Task ValidateValueAsync( 736Task<List<ValidationError>> completed = await Task.WhenAny(tasks).ConfigureAwait(false); 878await Task.WhenAny(tasks).ConfigureAwait(false);
System.ComponentModel.EventBasedAsync (1)
System\ComponentModel\BackgroundWorker.cs (1)
128Task.Factory.StartNew(
System.Console (6)
System\IO\SyncTextReader.cs (6)
96return Task.FromResult(ReadLine()); 108return Task.FromResult(ReadToEnd()); 114Task.FromCanceled<string>(cancellationToken) : 115Task.FromResult(ReadToEnd()); 127return Task.FromResult(ReadBlock(buffer, index, count)); 139return Task.FromResult(Read(buffer, index, count));
System.Data.Common (76)
src\runtime\src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (2)
22internal static Task<bool> TrueTask => field ??= Task.FromResult(true); 23internal static Task<bool> FalseTask => field ??= Task.FromResult(false);
System\Data\Common\AdapterUtil.Common.cs (1)
22internal static Task<T> CreatedTaskWithCancellation<T>() => Task.FromCanceled<T>(new CancellationToken(true));
System\Data\Common\DbBatch.cs (1)
60public abstract Task PrepareAsync(CancellationToken cancellationToken = default);
System\Data\Common\DbCommand.cs (10)
137return Task.FromResult(ExecuteNonQuery()); 141return Task.FromException<int>(e); 178return Task.FromResult<DbDataReader>(ExecuteReader(behavior)); 182return Task.FromException<DbDataReader>(e); 210return Task.FromResult<object?>(ExecuteScalar()); 214return Task.FromException<object?>(e); 227public virtual Task PrepareAsync(CancellationToken cancellationToken = default) 231return Task.FromCanceled(cancellationToken); 237return Task.CompletedTask; 241return Task.FromException(e);
System\Data\Common\DbConnection.cs (21)
92public virtual Task CloseAsync() 97return Task.CompletedTask; 101return Task.FromException(e); 113public virtual Task ChangeDatabaseAsync(string databaseName, CancellationToken cancellationToken = default) 117return Task.FromCanceled(cancellationToken); 123return Task.CompletedTask; 127return Task.FromException(e); 233return Task.FromCanceled<DataTable>(cancellationToken); 238return Task.FromResult(GetSchema()); 242return Task.FromException<DataTable>(e); 265return Task.FromCanceled<DataTable>(cancellationToken); 270return Task.FromResult(GetSchema(collectionName)); 274return Task.FromException<DataTable>(e); 297return Task.FromCanceled<DataTable>(cancellationToken); 302return Task.FromResult(GetSchema(collectionName, restrictionValues)); 306return Task.FromException<DataTable>(e); 322public Task OpenAsync() => OpenAsync(CancellationToken.None); 324public virtual Task OpenAsync(CancellationToken cancellationToken) 328return Task.FromCanceled(cancellationToken); 335return Task.CompletedTask; 339return Task.FromException(e);
System\Data\Common\DbDataReader.cs (14)
36public virtual Task CloseAsync() 41return Task.CompletedTask; 45return Task.FromException(e); 107return Task.FromCanceled<DataTable?>(cancellationToken); 112return Task.FromResult(GetSchemaTable()); 116return Task.FromException<DataTable?>(e); 137return Task.FromCanceled<ReadOnlyCollection<DbColumn>>(cancellationToken); 142return Task.FromResult(this.GetColumnSchema()); 146return Task.FromException<ReadOnlyCollection<DbColumn>>(e); 260return Task.FromResult<T>(GetFieldValue<T>(ordinal)); 264return Task.FromException<T>(e); 289return Task.FromException<bool>(e); 314return Task.FromException<bool>(e); 335return Task.FromException<bool>(e);
System\Data\Common\DbDataSource.cs (4)
337public override Task PrepareAsync(CancellationToken cancellationToken = default) 338=> Task.FromException(ExceptionBuilder.NotSupportedOnDataSourceCommand()); 566public override Task PrepareAsync(CancellationToken cancellationToken = default) 567=> Task.FromException(ExceptionBuilder.NotSupportedOnDataSourceBatch());
System\Data\Common\DbTransaction.cs (23)
23public virtual Task CommitAsync(CancellationToken cancellationToken = default) 27return Task.FromCanceled(cancellationToken); 33return Task.CompletedTask; 37return Task.FromException(e); 53public virtual Task RollbackAsync(CancellationToken cancellationToken = default) 57return Task.FromCanceled(cancellationToken); 63return Task.CompletedTask; 67return Task.FromException(e); 93/// <returns>A <see cref="Task " /> representing the asynchronous operation.</returns> 94public virtual Task SaveAsync(string savepointName, CancellationToken cancellationToken = default) 98return Task.FromCanceled(cancellationToken); 104return Task.CompletedTask; 108return Task.FromException(e); 119/// <returns>A <see cref="Task " /> representing the asynchronous operation.</returns> 120public virtual Task RollbackAsync(string savepointName, CancellationToken cancellationToken = default) 124return Task.FromCanceled(cancellationToken); 130return Task.CompletedTask; 134return Task.FromException(e); 146/// <returns>A <see cref="Task " /> representing the asynchronous operation.</returns> 147public virtual Task ReleaseAsync(string savepointName, CancellationToken cancellationToken = default) 151return Task.FromCanceled(cancellationToken); 157return Task.CompletedTask; 161return Task.FromException(e);
System.Data.Odbc (4)
Common\System\Data\ProviderBase\DbConnectionFactory.cs (1)
55Task task = s_pendingOpenNonPooled[idx];
src\runtime\src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (2)
22internal static Task<bool> TrueTask => field ??= Task.FromResult(true); 23internal static Task<bool> FalseTask => field ??= Task.FromResult(false);
src\runtime\src\libraries\Common\src\System\Data\ProviderBase\DbConnectionFactory.cs (1)
135return s_completedTask ??= Task.FromResult<DbConnectionInternal?>(null);
System.Data.OleDb (1)
System\Data\ProviderBase\DbConnectionFactory.cs (1)
164Task task = s_pendingOpenNonPooled[idx];
System.Diagnostics.Process (17)
System\Diagnostics\AsyncStreamReader.cs (5)
36private Task? _readToBufferTask; 89private async Task ReadBufferAsync() 91await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); 256internal Task EOF => _readToBufferTask ?? Task.CompletedTask;
System\Diagnostics\Process.cs (2)
1673public async Task WaitForExitAsync(CancellationToken cancellationToken = default) 1770async Task WaitUntilOutputEOF(CancellationToken cancellationToken)
System\Diagnostics\Process.Multiplexing.cs (5)
444Task whenAll = Task.WhenAll(outputTask, errorTask); 546Task outputTask = ReadToChannelAsync(outputReader, standardError: false, linkedCts.Token); 547Task errorTask = ReadToChannelAsync(errorReader, standardError: true, linkedCts.Token); 571async Task ReadToChannelAsync(StreamReader reader, bool standardError, CancellationToken ct)
System\Diagnostics\ProcessWaitState.Unix.cs (5)
220private Task _waitInProgress = Task.CompletedTask; 437Task? waitTask; 519private async Task WaitForExitAsync(CancellationToken cancellationToken) 552await Task.Delay(pollingIntervalMs, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing);
System.DirectoryServices.Protocols (2)
System\DirectoryServices\Protocols\ldap\LdapConnection.cs (2)
334static async Task ResponseCallback(ValueTask<DirectoryResponse> vt, LdapRequestState requestState) 1396await Task.Delay(Math.Min(iterationDelay, 100)).ConfigureAwait(false);
System.Formats.Tar (61)
src\runtime\src\libraries\Common\src\System\IO\SubReadStream.cs (3)
276public override Task FlushAsync(CancellationToken cancellationToken) => 277cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 278Task.CompletedTask;
src\runtime\src\libraries\Common\src\System\ReadWriteAdapter.cs (15)
26static abstract Task FlushAsync(Stream stream, CancellationToken cancellationToken); 27static abstract Task WaitAsync(TaskCompletionSource<bool> waiter); 28static abstract Task WaitAsync(Task task); 51public static Task FlushAsync(Stream stream, CancellationToken cancellationToken) => stream.FlushAsync(cancellationToken); 53public static Task WaitAsync(TaskCompletionSource<bool> waiter) => waiter.Task; 54public static Task WaitAsync(Task task) => task; 90public static Task FlushAsync(Stream stream, CancellationToken cancellationToken) 93return Task.CompletedTask; 96public static Task WaitAsync(TaskCompletionSource<bool> waiter) 99return Task.CompletedTask; 102public static Task WaitAsync(Task task) 105return Task.CompletedTask;
System\Formats\Tar\GnuSparseStream.cs (4)
193return Task.FromCanceled<int>(cancellationToken); 559public override Task FlushAsync(CancellationToken cancellationToken) => 560cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : Task.CompletedTask;
System\Formats\Tar\TarEntry.cs (10)
244public Task ExtractToFileAsync(string destinationFileName, bool overwrite, CancellationToken cancellationToken = default) 248return Task.FromCanceled(cancellationToken); 253return Task.FromException(new InvalidOperationException(SR.Format(SR.TarEntryTypeNotSupportedForExtracting, EntryType))); 340internal Task ExtractRelativeToDirectoryAsync(string destinationDirectoryPath, bool overwrite, SortedDictionary<string, UnixFileMode>? pendingModes, Stack<(string, DateTimeOffset)> directoryModificationTimes, TarHardLinkMode hardLinkMode, CancellationToken cancellationToken) 344return Task.FromCanceled(cancellationToken); 353return Task.CompletedTask; 547private Task ExtractToFileInternalAsync(string filePath, string? linkTargetPath, bool overwrite, TarHardLinkMode hardLinkMode, CancellationToken cancellationToken) 551return Task.FromCanceled(cancellationToken); 562return Task.CompletedTask; 694private async Task ExtractAsRegularFileAsync(string destinationFileName, CancellationToken cancellationToken)
System\Formats\Tar\TarFile.cs (25)
80public static Task CreateFromDirectoryAsync(string sourceDirectoryName, Stream destination, bool includeBaseDirectory, CancellationToken cancellationToken = default) 99public static Task CreateFromDirectoryAsync(string sourceDirectoryName, Stream destination, bool includeBaseDirectory, TarEntryFormat format, CancellationToken cancellationToken = default) 121public static Task CreateFromDirectoryAsync(string sourceDirectoryName, Stream destination, bool includeBaseDirectory, TarWriterOptions options, CancellationToken cancellationToken = default) 125return Task.FromCanceled(cancellationToken); 133return Task.FromException(new ArgumentException(SR.IO_NotSupported_UnwritableStream, nameof(destination))); 138return Task.FromException(new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, sourceDirectoryName), sourceDirectoryName)); 203public static Task CreateFromDirectoryAsync(string sourceDirectoryName, string destinationFileName, bool includeBaseDirectory, CancellationToken cancellationToken = default) 220public static Task CreateFromDirectoryAsync(string sourceDirectoryName, string destinationFileName, bool includeBaseDirectory, TarEntryFormat format, CancellationToken cancellationToken = default) 240public static Task CreateFromDirectoryAsync(string sourceDirectoryName, string destinationFileName, bool includeBaseDirectory, TarWriterOptions options, CancellationToken cancellationToken = default) 244return Task.FromCanceled(cancellationToken); 256return Task.FromException(new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, sourceDirectoryName), sourceDirectoryName)); 341public static Task ExtractToDirectoryAsync(Stream source, string destinationDirectoryName, bool overwriteFiles, CancellationToken cancellationToken = default) 363public static Task ExtractToDirectoryAsync(Stream source, string destinationDirectoryName, TarExtractOptions options, CancellationToken cancellationToken = default) 367return Task.FromCanceled(cancellationToken); 375return Task.FromException(new ArgumentException(SR.IO_NotSupported_UnreadableStream, nameof(source))); 380return Task.FromException(new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, destinationDirectoryName), destinationDirectoryName)); 469public static Task ExtractToDirectoryAsync(string sourceFileName, string destinationDirectoryName, bool overwriteFiles, CancellationToken cancellationToken = default) 490public static Task ExtractToDirectoryAsync(string sourceFileName, string destinationDirectoryName, TarExtractOptions options, CancellationToken cancellationToken = default) 494return Task.FromCanceled(cancellationToken); 507return Task.FromException(new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, sourceFileName))); 512return Task.FromException(new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, destinationDirectoryName), destinationDirectoryName)); 550private static async Task CreateFromDirectoryInternalAsync(string sourceDirectoryName, string destinationFileName, bool includeBaseDirectory, TarWriterOptions options, CancellationToken cancellationToken) 573private static async Task CreateFromDirectoryInternalAsync(string sourceDirectoryName, Stream destination, bool includeBaseDirectory, bool leaveOpen, TarWriterOptions options, CancellationToken cancellationToken) 672private static async Task ExtractToDirectoryInternalAsync(string sourceFileName, string destinationDirectoryFullPath, TarExtractOptions extractOptions, CancellationToken cancellationToken) 694private static async Task ExtractToDirectoryInternalAsync(Stream source, string destinationDirectoryFullPath, TarExtractOptions options, bool leaveOpen, CancellationToken cancellationToken)
System\Formats\Tar\TarWriter.cs (4)
180public Task WriteEntryAsync(string fileName, string? entryName, CancellationToken cancellationToken = default) 184return Task.FromCanceled(cancellationToken); 288public Task WriteEntryAsync(TarEntry entry, CancellationToken cancellationToken = default) 292return Task.FromCanceled(cancellationToken);
System.IO.Compression (66)
src\runtime\src\libraries\Common\src\System\IO\SubReadStream.cs (3)
276public override Task FlushAsync(CancellationToken cancellationToken) => 277cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 278Task.CompletedTask;
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (3)
77public override Task FlushAsync(CancellationToken cancellationToken) 81Task.FromCanceled(cancellationToken) : 82Task.CompletedTask;
System\IO\Compression\DeflateZLib\DeflateStream.cs (11)
217public override Task FlushAsync(CancellationToken cancellationToken) 223return Task.FromCanceled(cancellationToken); 226Task.CompletedTask : 229async Task Core(CancellationToken cancellationToken) 822public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 899public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 910return Task.FromCanceled<int>(cancellationToken); 941public async Task CopyFromSourceToDestinationAsync() 1026public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 1032return Task.CompletedTask; 1038return Task.FromException(new InvalidDataException(SR.GenericInvalidData));
System\IO\Compression\GZipStream.cs (3)
233public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 255public override Task FlushAsync(CancellationToken cancellationToken) 261public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
System\IO\Compression\PositionPreservingWriteOnlyStreamWrapper.cs (2)
58public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 83public override Task FlushAsync(CancellationToken cancellationToken) => _stream.FlushAsync(cancellationToken);
System\IO\Compression\WinZipAesStream.cs (7)
107private static async Task ReadAndValidateHeaderCore(bool isAsync, Stream baseStream, WinZipAesKeyMaterial keyMaterial, CancellationToken cancellationToken) 237private async Task ValidateAuthCodeAsync(CancellationToken cancellationToken) 253private async Task WriteHeaderAsync(CancellationToken cancellationToken) 335private async Task WriteAuthCodeCoreAsync(bool isAsync, CancellationToken cancellationToken) 520public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 618private async Task FinishEncryptingAsync(bool isAsync, CancellationToken cancellationToken) 665public override async Task FlushAsync(CancellationToken cancellationToken)
System\IO\Compression\ZipArchive.Async.cs (4)
180private async Task CloseStreamsAsync() 202private async Task EnsureCentralDirectoryReadAsync(CancellationToken cancellationToken) 213private async Task ReadCentralDirectoryAsync(CancellationToken cancellationToken) 269private async Task ReadEndOfCentralDirectoryAsync(CancellationToken cancellationToken)
System\IO\Compression\ZipArchiveEntry.Async.cs (11)
125return Task.FromResult<Stream>(OpenInWriteMode()); 178internal async Task ReadEncryptionSaltIfNeededAsync(CancellationToken cancellationToken) 408internal async Task WriteAndFinishLocalEntryAsync(bool forceWrite, CancellationToken cancellationToken) 417internal async Task WriteCentralDirectoryFileHeaderAsync(bool forceWrite, CancellationToken cancellationToken) 456internal async Task LoadLocalHeaderExtraFieldIfNeededAsync(CancellationToken cancellationToken) 470internal async Task LoadCompressedBytesIfNeededAsync(CancellationToken cancellationToken) 497internal async Task ThrowIfNotOpenableAsync(bool needToUncompress, bool needToLoadIntoMemory, CancellationToken cancellationToken) 726private async Task WriteLocalFileHeaderAndDataIfNeededAsync(bool forceWrite, CancellationToken cancellationToken) 977private async Task WriteCrcAndSizesInLocalHeaderAsync(bool zip64HeaderUsed, CancellationToken cancellationToken) 1033internal async Task UnloadStreamsAsync() 1043private async Task CloseStreamsAsync()
System\IO\Compression\ZipArchiveEntry.cs (2)
2362public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 2399public override Task FlushAsync(CancellationToken cancellationToken)
System\IO\Compression\ZipBlocks.Async.cs (4)
14public async Task WriteBlockAsync(Stream stream, CancellationToken cancellationToken) 24public static async Task WriteAllBlocksAsync(List<ZipGenericExtraField>? fields, ReadOnlyMemory<byte> trailingExtraFieldData, Stream stream, CancellationToken cancellationToken) 42public static async Task WriteAllBlocksExcludingTagAsync(List<ZipGenericExtraField>? fields, ReadOnlyMemory<byte> trailingExtraFieldData, Stream stream, ushort excludeTag, CancellationToken cancellationToken) 245public static async Task WriteBlockAsync(Stream stream, long numberOfEntries, long startOfCentralDirectory, long sizeOfCentralDirectory, byte[] archiveComment, CancellationToken cancellationToken)
System\IO\Compression\ZipBlocks.cs (1)
837public async Task WriteBlockAsync(Stream stream, CancellationToken cancellationToken = default)
System\IO\Compression\ZipCryptoStream.cs (2)
414public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 452public override Task FlushAsync(CancellationToken cancellationToken)
System\IO\Compression\ZipCustomStreams.cs (6)
182public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 217public override Task FlushAsync(CancellationToken cancellationToken) 421public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 466public override Task FlushAsync(CancellationToken cancellationToken) 469return _baseStream?.FlushAsync(cancellationToken) ?? Task.CompletedTask; 688public override Task FlushAsync(CancellationToken cancellationToken)
System\IO\Compression\ZLibStream.cs (3)
94public override Task FlushAsync(CancellationToken cancellationToken) 217public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 255public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
System\IO\Compression\Zstandard\ZstandardStream.Compress.cs (4)
262public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 336public override Task FlushAsync(CancellationToken cancellationToken) 346return Task.CompletedTask; 348async Task FlushAsyncInternal(CancellationToken cancellationToken)
System.IO.Compression.Brotli (10)
System\IO\Compression\dec\BrotliStream.Decompress.cs (2)
128/// <para>If the operation is canceled before it completes, the returned task contains the <see cref="System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="System.Threading.Tasks.Task.Status" /> property.</para></remarks> 141/// <para>If the operation is canceled before it completes, the returned task contains the <see cref="System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="System.Threading.Tasks.Task.Status" /> property.</para></remarks>
System\IO\Compression\enc\BrotliStream.Compress.cs (8)
130/// <para>If the operation is canceled before it completes, the returned task contains the <see cref="System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="System.Threading.Tasks.Task.Status" /> property.</para></remarks> 131public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 143/// <para>If the operation is canceled before it completes, the returned task contains the <see cref="System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="System.Threading.Tasks.Task.Status" /> property.</para></remarks> 214/// <remarks>If the operation is canceled before it completes, the returned task contains the <see cref="System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="System.Threading.Tasks.Task.Status" /> property.</remarks> 215public override Task FlushAsync(CancellationToken cancellationToken) 221return Task.FromCanceled(cancellationToken); 223return _mode != CompressionMode.Compress ? Task.CompletedTask : FlushAsyncCore(cancellationToken); 226private async Task FlushAsyncCore(CancellationToken cancellationToken)
System.IO.Compression.ZipFile (32)
System\IO\Compression\ZipFile.Create.Async.cs (11)
219public static Task CreateFromDirectoryAsync(string sourceDirectoryName, string destinationArchiveFileName, CancellationToken cancellationToken = default) => 268public static Task CreateFromDirectoryAsync(string sourceDirectoryName, string destinationArchiveFileName, CompressionLevel compressionLevel, bool includeBaseDirectory, CancellationToken cancellationToken = default) => 340public static Task CreateFromDirectoryAsync(string sourceDirectoryName, string destinationArchiveFileName, 368public static Task CreateFromDirectoryAsync(string sourceDirectoryName, Stream destination, CancellationToken cancellationToken = default) => 398public static Task CreateFromDirectoryAsync(string sourceDirectoryName, Stream destination, CompressionLevel compressionLevel, bool includeBaseDirectory, CancellationToken cancellationToken = default) => 429public static Task CreateFromDirectoryAsync(string sourceDirectoryName, Stream destination, 442public static async Task CreateFromDirectoryAsync(string sourceDirectoryName, string destinationArchiveFileName, ZipFileCreationOptions options, CancellationToken cancellationToken = default) 469public static async Task CreateFromDirectoryAsync(string sourceDirectoryName, Stream destination, ZipFileCreationOptions options, CancellationToken cancellationToken = default) 487private static async Task DoCreateFromDirectoryAsync(string sourceDirectoryName, string destinationArchiveFileName, 506private static async Task DoCreateFromDirectoryAsync(string sourceDirectoryName, Stream destination, 520private static async Task CreateZipArchiveFromDirectoryAsync(string sourceDirectoryName, ZipArchive archive,
System\IO\Compression\ZipFile.Extract.Async.cs (12)
44public static Task ExtractToDirectoryAsync(string sourceArchiveFileName, string destinationDirectoryName, CancellationToken cancellationToken = default) => 80public static Task ExtractToDirectoryAsync(string sourceArchiveFileName, string destinationDirectoryName, bool overwriteFiles, CancellationToken cancellationToken = default) => 137public static Task ExtractToDirectoryAsync(string sourceArchiveFileName, string destinationDirectoryName, Encoding? entryNameEncoding, CancellationToken cancellationToken = default) => 195public static async Task ExtractToDirectoryAsync(string sourceArchiveFileName, string destinationDirectoryName, Encoding? entryNameEncoding, bool overwriteFiles, CancellationToken cancellationToken = default) 264private static async Task ExtractToDirectoryAsync(string sourceArchiveFileName, string destinationDirectoryName, Encoding? entryNameEncoding, bool overwriteFiles, ReadOnlyMemory<char> password, CancellationToken cancellationToken = default) 309public static Task ExtractToDirectoryAsync(Stream source, string destinationDirectoryName, CancellationToken cancellationToken = default) => 341public static Task ExtractToDirectoryAsync(Stream source, string destinationDirectoryName, bool overwriteFiles, CancellationToken cancellationToken = default) => 381public static Task ExtractToDirectoryAsync(Stream source, string destinationDirectoryName, Encoding? entryNameEncoding, CancellationToken cancellationToken = default) => 422public static async Task ExtractToDirectoryAsync(Stream source, string destinationDirectoryName, Encoding? entryNameEncoding, bool overwriteFiles, CancellationToken cancellationToken = default) 478private static async Task ExtractToDirectoryAsync(Stream source, string destinationDirectoryName, Encoding? entryNameEncoding, bool overwriteFiles, ReadOnlyMemory<char> password, CancellationToken cancellationToken = default) 507public static Task ExtractToDirectoryAsync(string sourceArchiveFileName, string destinationDirectoryName, ZipExtractionOptions options, CancellationToken cancellationToken = default) 522public static Task ExtractToDirectoryAsync(Stream source, string destinationDirectoryName, ZipExtractionOptions options, CancellationToken cancellationToken = default)
System\IO\Compression\ZipFileExtensions.ZipArchive.Extract.Async.cs (3)
40public static Task ExtractToDirectoryAsync(this ZipArchive source, string destinationDirectoryName, CancellationToken cancellationToken = default) => 73public static async Task ExtractToDirectoryAsync(this ZipArchive source, string destinationDirectoryName, bool overwriteFiles, CancellationToken cancellationToken = default) 89public static async Task ExtractToDirectoryAsync(this ZipArchive source, string destinationDirectoryName, ZipExtractionOptions options, CancellationToken cancellationToken = default)
System\IO\Compression\ZipFileExtensions.ZipArchiveEntry.Extract.Async.cs (6)
38public static Task ExtractToFileAsync(this ZipArchiveEntry source, string destinationFileName, CancellationToken cancellationToken = default) => 70public static async Task ExtractToFileAsync(this ZipArchiveEntry source, string destinationFileName, bool overwrite, CancellationToken cancellationToken = default) 81public static Task ExtractToFileAsync(this ZipArchiveEntry source, string destinationFileName, ZipExtractionOptions options, CancellationToken cancellationToken = default) 88private static async Task ExtractToFileAsync(ZipArchiveEntry source, string destinationFileName, bool overwrite, ReadOnlyMemory<char> password, CancellationToken cancellationToken = default) 99private static async Task ExtractToFileCoreAsync(ZipArchiveEntry source, string destinationFileName, bool overwrite, FileStreamOptions fileStreamOptions, ReadOnlyMemory<char> password, bool usePassword, CancellationToken cancellationToken) 146internal static async Task ExtractRelativeToDirectoryAsync(this ZipArchiveEntry source, string destinationDirectoryName, bool overwrite, ReadOnlyMemory<char> password = default, CancellationToken cancellationToken = default)
System.IO.FileSystem.Watcher (1)
System\IO\FileSystemWatcher.Linux.cs (1)
1104private async Task DequeueEvents()
System.IO.Hashing (5)
System\IO\Hashing\NonCryptographicHashAlgorithm.cs (5)
124public Task AppendAsync(Stream stream, CancellationToken cancellationToken = default) 323public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 326return Task.CompletedTask; 347public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
System.IO.IsolatedStorage (2)
System\IO\IsolatedStorage\IsolatedStorageFileStream.cs (2)
236public override Task FlushAsync(CancellationToken cancellationToken) 288public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System.IO.Pipelines (23)
System\IO\Pipelines\Pipe.cs (4)
472return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken)); 802return new ValueTask<ReadResult>(Task.FromCanceled<ReadResult>(token)); 861return new ValueTask<ReadResult>(Task.FromCanceled<ReadResult>(token)); 1177return new ValueTask<FlushResult>(Task.FromCanceled<FlushResult>(cancellationToken));
System\IO\Pipelines\PipeReader.cs (6)
137return new ValueTask(Task.FromException(ex)); 177public virtual Task CopyToAsync(PipeWriter destination, CancellationToken cancellationToken = default) 186return Task.FromCanceled(cancellationToken); 199public virtual Task CopyToAsync(Stream destination, CancellationToken cancellationToken = default) 208return Task.FromCanceled(cancellationToken); 232private async Task CopyToAsyncCore<TStream>(TStream destination, Func<TStream, ReadOnlyMemory<byte>, CancellationToken, ValueTask<FlushResult>> writeAsync, CancellationToken cancellationToken)
System\IO\Pipelines\PipeReaderStream.cs (1)
151public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
System\IO\Pipelines\PipeWriter.cs (2)
31return new ValueTask(Task.FromException(ex)); 123protected internal virtual async Task CopyFromAsync(Stream source, CancellationToken cancellationToken = default)
System\IO\Pipelines\PipeWriterStream.cs (5)
72public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 93public override Task FlushAsync(CancellationToken cancellationToken) 100private static Task GetFlushResultAsTask(ValueTask<FlushResult> valueTask) 110return Task.CompletedTask; 113static async Task AwaitTask(ValueTask<FlushResult> valueTask)
System\IO\Pipelines\StreamPipeExtensions.cs (2)
17public static Task CopyToAsync(this Stream source, PipeWriter destination, CancellationToken cancellationToken = default) 30return Task.FromCanceled(cancellationToken);
System\IO\Pipelines\StreamPipeReader.cs (3)
220return new ValueTask<ReadResult>(Task.FromCanceled<ReadResult>(cancellationToken)); 309public override async Task CopyToAsync(PipeWriter destination, CancellationToken cancellationToken = default) 380public override async Task CopyToAsync(Stream destination, CancellationToken cancellationToken = default)
System.IO.Pipes (20)
System\IO\Pipes\NamedPipeClientStream.cs (7)
168public Task ConnectAsync() 175public Task ConnectAsync(int timeout) 180public Task ConnectAsync(CancellationToken cancellationToken) 185public Task ConnectAsync(int timeout, CancellationToken cancellationToken) 193return Task.FromCanceled(cancellationToken); 198return Task.Factory.StartNew(static state => 205public Task ConnectAsync(TimeSpan timeout, CancellationToken cancellationToken = default) =>
System\IO\Pipes\NamedPipeServerStream.cs (1)
157public Task WaitForConnectionAsync()
System\IO\Pipes\NamedPipeServerStream.Unix.cs (3)
68public Task WaitForConnectionAsync(CancellationToken cancellationToken) 77Task.FromCanceled(cancellationToken) : 80async Task WaitForConnectionAsyncCore()
System\IO\Pipes\PipeStream.cs (3)
132public override Task FlushAsync(CancellationToken cancellationToken) 137return Task.CompletedTask; 141return Task.FromException(ex);
System\IO\Pipes\PipeStream.Unix.cs (6)
68return Task.FromCanceled<int>(cancellationToken); 76return Task.FromResult(0); 134public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 144return Task.FromCanceled<int>(cancellationToken); 151return Task.CompletedTask; 315private async Task WriteAsyncCore(ReadOnlyMemory<byte> source, CancellationToken cancellationToken)
System.IO.Ports (5)
System\IO\Ports\SerialStream.Unix.cs (5)
32private Task _ioLoop; 481public override Task WriteAsync(byte[] array, int offset, int count, CancellationToken cancellationToken) 486return Task.CompletedTask; // return immediately if no bytes to write; no need for overhead. 563Task t = WriteAsync(array, offset, count, cts?.Token ?? CancellationToken.None); 682_ioLoop = Task.Factory.StartNew(
System.Linq.AsyncEnumerable (2)
System\Linq\OrderBy.cs (2)
280internal abstract Task ComputeKeysAsync(TElement[] elements, int count, CancellationToken cancellationToken); 318internal override async Task ComputeKeysAsync(TElement[] elements, int count, CancellationToken cancellationToken)
System.Linq.Expressions (1)
System\Linq\Expressions\StackGuard.cs (1)
68Task<R> task = Task.Factory.StartNew(action!, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
System.Linq.Parallel (15)
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (1)
171Task rootTask = new Task(
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (1)
87Task rootTask = new Task(
System\Linq\Parallel\Scheduling\QueryTask.cs (4)
60internal Task RunSynchronously(TaskScheduler taskScheduler) 64Task task = new Task(s_runTaskSynchronouslyDelegate, this, TaskCreationOptions.AttachedToParent); 79internal Task RunAsynchronously(TaskScheduler taskScheduler) 84return Task.Factory.StartNew(s_baseWorkDelegate, this, CancellationToken.None, TaskCreationOptions.AttachedToParent | TaskCreationOptions.PreferFairness, taskScheduler);
System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs (2)
24private Task? _rootTask; // The task under which all query tasks root. 71internal void QueryBegin(Task rootTask)
System\Linq\Parallel\Scheduling\SpoolingTask.cs (3)
40Task rootTask = new Task( 98Task rootTask = new Task( 139Task rootTask = new Task(
System\Linq\Parallel\Utils\PLINQETWProvider.cs (4)
87int taskId = Task.CurrentId ?? 0; 116int taskId = Task.CurrentId ?? 0; 146int taskId = Task.CurrentId ?? 0; 177int taskId = Task.CurrentId ?? 0;
System.Memory (10)
src\runtime\src\libraries\Common\src\System\Threading\Tasks\CachedCompletedInt32Task.cs (1)
33return _task = Task.FromResult(result);
System\Buffers\ReadOnlySequenceStream.cs (9)
110return Task.FromCanceled<int>(cancellationToken); 152public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 159return Task.FromCanceled(cancellationToken); 165return Task.CompletedTask; 171private async Task CopyToAsyncCore(ReadOnlySequence<byte> remaining, Stream destination, CancellationToken cancellationToken) 194public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => throw new NotSupportedException(SR.NotSupported_UnwritableStream); 210public override Task FlushAsync(CancellationToken cancellationToken) => 211cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : Task.CompletedTask;
System.Net.Http (198)
src\runtime\src\libraries\Common\src\System\IO\DelegatingStream.cs (3)
130public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 144public override Task FlushAsync(CancellationToken cancellationToken) 169public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\Net\Http\BrotliCompressedContent.cs (2)
60protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 63protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) =>
System\Net\Http\ByteArrayContent.cs (4)
43protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 46protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) => 52private protected Task SerializeToStreamAsyncCore(Stream stream, CancellationToken cancellationToken) => 65Task.FromResult<Stream>(CreateMemoryStreamForByteArray());
System\Net\Http\CompressedContentCore.cs (1)
50public static async Task SerializeToStreamAsync(HttpContent originalContent, Stream compressionStream, TransportContext? context, CancellationToken cancellationToken)
System\Net\Http\EmptyContent.cs (6)
22protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 23Task.CompletedTask; 25protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) => 26cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 33Task.FromResult<Stream>(EmptyReadStream.Instance); 36cancellationToken.IsCancellationRequested ? Task.FromCanceled<Stream>(cancellationToken) :
System\Net\Http\EmptyReadStream.cs (1)
28public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
System\Net\Http\FormUrlEncodedContent.cs (1)
89protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) =>
System\Net\Http\GZipCompressedContent.cs (2)
57protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 60protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) =>
System\Net\Http\HttpBaseStream.cs (5)
69public sealed override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 77public override Task FlushAsync(CancellationToken cancellationToken) => NopAsync(cancellationToken); 79protected static Task NopAsync(CancellationToken cancellationToken) => 80cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 81Task.CompletedTask;
System\Net\Http\HttpContent.cs (30)
253Task.FromResult<Stream>(CreateMemoryStreamFromBufferedContent()) : 265Task<Stream> ts = Task.FromResult((Stream)_contentReadStream); 299protected abstract Task SerializeToStreamAsync(Stream stream, TransportContext? context); 309protected virtual Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) => 341public Task CopyToAsync(Stream stream) => 344public Task CopyToAsync(Stream stream, CancellationToken cancellationToken) => 347public Task CopyToAsync(Stream stream, TransportContext? context) => 350public Task CopyToAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) 360return Task.FromException(GetStreamCopyException(e)); 363static async Task WaitAsync(ValueTask copyTask) 383Task task = SerializeToStreamAsync(stream, context, cancellationToken); 441public Task LoadIntoBufferAsync() => 447public Task LoadIntoBufferAsync(long maxBufferSize) => 456/// This operation will not block. The returned <see cref="Task"/> object will complete after all of the content has been serialized to the memory buffer. 461public Task LoadIntoBufferAsync(CancellationToken cancellationToken) => 471/// This operation will not block. The returned <see cref="Task"/> object will complete after all of the content has been serialized to the memory buffer. 476public Task LoadIntoBufferAsync(long maxBufferSize, CancellationToken cancellationToken) 483return Task.CompletedTask; 489return Task.FromException(error!); 495Task task = SerializeToStreamAsync(tempBuffer, null, cancellationToken); 506return Task.FromException(GetStreamCopyException(e)); 514private async Task LoadIntoBufferAsyncCore(Task serializeToStreamTask, LimitArrayPoolWriteStream tempBuffer) 676private void CheckTaskNotNull(Task task) 772private static async Task<TResult> WaitAndReturnAsync<TState, TResult>(Task waitTask, TState state, Func<TState, TResult> returnFunc) 1116public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 1120return Task.FromCanceled(cancellationToken); 1124return Task.CompletedTask; 1148public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
System\Net\Http\MultipartContent.cs (6)
193protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 196protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) => 202private protected async Task SerializeToStreamAsyncCore(Stream stream, TransportContext? context, CancellationToken cancellationToken) 619public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask; 624public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { throw new NotSupportedException(); }
System\Net\Http\MultipartFormDataContent.cs (1)
66protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) =>
System\Net\Http\ReadOnlyMemoryContent.cs (3)
22protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 25protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) => 38Task.FromResult<Stream>(new ReadOnlyMemoryStream(_content));
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (4)
244public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 249cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 250_connection == null ? Task.CompletedTask : 254private async Task CopyToAsyncCore(Stream destination, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\ChunkedEncodingWriteStream.cs (2)
76public override Task FinishAsync(bool async) 89return Task.CompletedTask;
System\Net\Http\SocketsHttpHandler\ConnectionCloseReadStream.cs (7)
90public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 96return Task.FromCanceled(cancellationToken); 103return Task.CompletedTask; 106Task copyTask = connection.CopyToUntilEofAsync(destination, async: true, bufferSize, cancellationToken); 110return Task.CompletedTask; 116private async Task CompleteCopyToAsync(Task copyTask, HttpConnection connection, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (1)
1145Task.Factory.StartNew(static s => ((List<HttpConnectionBase>)s!).ForEach(c => c.Dispose()), toDispose,
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (2)
250private async Task InjectNewHttp11ConnectionAsync(RequestQueue<HttpConnection>.QueueItem queueItem) 256await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http2.cs (4)
181private async Task InjectNewHttp2ConnectionAsync(RequestQueue<Http2Connection?>.QueueItem queueItem) 187await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); 310private async Task HandleHttp11Downgrade(HttpRequestMessage request, Stream stream, TransportContext? transportContext, Activity? activity, IPEndPoint? remoteEndPoint, long connectionId, CancellationToken cancellationToken) 524async Task DisableHttp2ConnectionAsync(Http2Connection connection)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (5)
246private async Task InjectNewHttp3ConnectionAsync(RequestQueue<Http3Connection?>.QueueItem queueItem) 254await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); 491async Task DisableHttp3ConnectionAsync(Http3Connection connection) 871_ = Task.Delay(AltSvcBlocklistTimeoutInMilliseconds, altSvcBlocklistTimerCt) 883_ = Task.Delay(AltSvcBlocklistTimeoutInMilliseconds, altSvcBlocklistTimerCt)
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (7)
119public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 125return Task.FromCanceled(cancellationToken); 131return Task.CompletedTask; 134Task copyTask = _connection.CopyToContentLengthAsync(destination, async: true, _contentBytesRemaining, bufferSize, cancellationToken); 138return Task.CompletedTask; 144private async Task CompleteCopyToAsync(Task copyTask, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\ContentLengthWriteStream.cs (3)
51public override Task FinishAsync(bool async) 55return Task.FromException(ExceptionDispatchInfo.SetCurrentStackTrace(new HttpRequestException(SR.Format(SR.net_http_request_content_length_mismatch, BytesWritten, _contentLength)))); 59return Task.CompletedTask;
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (5)
170protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 173protected override async Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) 308public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 312async Task Core(Stream destination, int bufferSize, CancellationToken cancellationToken) 420public override async Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (16)
368return Task.FromResult(false); 373return Task.FromResult(true); 396private async Task FlushOutgoingBytesAsync() 492private async Task ProcessIncomingFramesAsync() 1158internal Task FlushAsync(CancellationToken cancellationToken) => 1206private Task PerformWriteAsync<T>(int writeBytes, T state, Func<T, Memory<byte>, bool> writeAction, CancellationToken cancellationToken = default) 1214return Task.FromException(GetRequestAbortedException(_abortException)); 1221return Task.FromException(ExceptionDispatchInfo.SetCurrentStackTrace(new ObjectDisposedException(nameof(Http2Connection)))); 1227private async Task ProcessOutgoingFramesAsync() 1352private Task SendRstStreamAsync(int streamId, Http2ProtocolErrorCode errorCode) => 1769private async Task SendStreamDataAsync(int streamId, ReadOnlyMemory<byte> buffer, bool finalFlush, CancellationToken cancellationToken) 1816private Task SendEndStreamAsync(int streamId) => 1826private Task SendWindowUpdateAsync(int streamId, int amount) 2100Task requestBodyTask = http2Stream.SendRequestBodyAsync(requestBodyCancellationToken); 2103Task responseHeadersTask = http2Stream.ReadResponseHeadersAsync(cancellationToken); 2116await Task.WhenAny(requestBodyTask, responseHeadersTask).ConfigureAwait(false) == requestBodyTask ||
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (11)
176public async Task SendRequestBodyAsync(CancellationToken cancellationToken) 1050public async Task ReadResponseHeadersAsync(CancellationToken cancellationToken) 1222public async Task CopyToAsync(HttpResponseMessage responseMessage, Stream destination, int bufferSize, CancellationToken cancellationToken) 1529public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) => Task.FromException(ExceptionDispatchInfo.SetCurrentStackTrace(new NotSupportedException(SR.net_http_content_writeonly_stream))); 1629public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 1634http2Stream is null ? Task.FromException<int>(ExceptionDispatchInfo.SetCurrentStackTrace(new ObjectDisposedException(nameof(Http2ReadStream)))) : 1635cancellationToken.IsCancellationRequested ? Task.FromCanceled<int>(cancellationToken) : 1652public override Task FlushAsync(CancellationToken cancellationToken) 1656return Task.FromCanceled(cancellationToken); 1663return Task.CompletedTask;
System\Net\Http\SocketsHttpHandler\Http2StreamWindowManager.cs (2)
81Task sendWindowUpdateTask = connection.SendWindowUpdateAsync(stream.StreamId, windowUpdateIncrement); 130Task sendWindowUpdateTask = connection.SendWindowUpdateAsync(stream.StreamId, windowUpdateIncrement);
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (8)
26private Task? _connectionClosedTask; 36private Task? _sendSettingsTask; 253return Task.FromResult(false); 257return Task.FromResult(true); 488private async Task SendSettingsAsync() 537private async Task AcceptStreamsAsync() 582private async Task ProcessServerStreamAsync(QuicStream stream) 713private async Task ProcessServerControlStreamAsync(QuicStream stream, ArrayBuffer buffer)
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (8)
187Task sendRequestTask = _request.Content != null 189: Task.CompletedTask; 193Task readResponseTask = ReadResponseAsync(_requestBodyCancellationSource.Token); 201await Task.WhenAny(sendRequestTask, readResponseTask).ConfigureAwait(false) == sendRequestTask || 404private async Task ReadResponseAsync(CancellationToken cancellationToken) 446private async Task SendContentAsync(HttpContent content, CancellationToken cancellationToken) 1579public override Task FlushAsync(CancellationToken cancellationToken) 1585return Task.FromException(ExceptionDispatchInfo.SetCurrentStackTrace(new ObjectDisposedException(nameof(Http3WriteStream))));
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (7)
545Task? sendRequestContentTask = null; 768Task sendTask = sendRequestContentTask; 999private async Task SendRequestContentWithExpect100ContinueAsync( 1905private Task CopyToUntilEofAsync(Stream destination, bool async, int bufferSize, CancellationToken cancellationToken) 1920return Task.CompletedTask; 1923private async Task CopyToUntilEofWithExistingBufferedDataAsync(Stream destination, bool async, int bufferSize, CancellationToken cancellationToken) 1941private async Task CopyToContentLengthAsync(Stream destination, bool async, ulong length, int bufferSize, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (3)
257public async Task EvaluateForEvictionAsync() 313internal void LogExceptions(Task task) 328static void LogFaulted(HttpConnectionBase connection, Task task)
System\Net\Http\SocketsHttpHandler\HttpConnectionResponseContent.cs (4)
48protected sealed override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 51protected sealed override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) 56async Task Impl(Stream stream, CancellationToken cancellationToken) 76Task.FromResult<Stream>(ConsumeStream());
System\Net\Http\SocketsHttpHandler\HttpContentReadStream.cs (1)
72private async Task DrainOnDisposeAsync()
System\Net\Http\SocketsHttpHandler\HttpContentWriteStream.cs (3)
26public sealed override Task FlushAsync(CancellationToken ignored) 38public sealed override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) => throw new NotSupportedException(); 40public abstract Task FinishAsync(bool async);
System\Net\Http\SocketsHttpHandler\RawConnectionStream.cs (11)
93public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 99return Task.FromCanceled(cancellationToken); 106return Task.CompletedTask; 109Task copyTask = connection.CopyToUntilEofAsync(destination, async: true, bufferSize, cancellationToken); 113return Task.CompletedTask; 119private async Task CompleteCopyToAsync(Task copyTask, HttpConnection connection, CancellationToken cancellationToken) 191public override Task FlushAsync(CancellationToken cancellationToken) 195return Task.FromCanceled(cancellationToken); 201return Task.CompletedTask; 210private static async Task WaitWithConnectionCancellationAsync(ValueTask task, HttpConnection connection, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (3)
684return Task.FromCanceled<HttpResponseMessage>(cancellationToken); 690return Task.FromException<HttpResponseMessage>(error); 702_handlerChainSetupTask ??= Task.Run(SetupHandlerChain);
System\Net\Http\StreamContent.cs (7)
56protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 59protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) => 65private Task SerializeToStreamAsyncCore(Stream stream, CancellationToken cancellationToken) 110return Task.FromResult<Stream>(new ReadOnlyStream(_content)); 157public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask; 177public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
System\Net\Http\StreamToStreamCopy.cs (6)
50public static Task CopyAsync(Stream source, Stream destination, int bufferSize, bool disposeSource, CancellationToken cancellationToken = default(CancellationToken)) 58Task copyTask = bufferSize == 0 ? 71return Task.CompletedTask; 80static async Task DisposeSourceAsync(Task copyTask, Stream source) 91return Task.FromException(e);
System\Net\Http\StringContent.cs (1)
105protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) =>
System\Net\Http\ZstandardCompressedContent.cs (2)
92protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 95protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) =>
System.Net.Http.Json (5)
System\Net\Http\Json\JsonContent.cs (3)
104protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) 113private Task SerializeToStreamAsyncCore(Stream targetStream, CancellationToken cancellationToken) 122private async Task SerializeToStreamAsyncTranscoding(Stream targetStream, bool async, Encoding targetEncoding, CancellationToken cancellationToken)
System\Net\Http\Json\JsonContent.netcoreapp.cs (1)
26protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken)
System\Net\Http\Json\LengthLimitReadStream.cs (1)
86public override Task FlushAsync(CancellationToken cancellationToken) => _innerStream.FlushAsync(cancellationToken);
System.Net.Http.WinHttpHandler (25)
src\runtime\src\libraries\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs (2)
113Task.Run(c); 131Task.Run(continuation);
System\Net\Http\NoWriteNoSeekStreamContent.cs (4)
28protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) => 37Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken) 48Task copyTask = _content.CopyToAsync(stream, BufferSize, cancellationToken); 80protected override Task<Stream> CreateContentReadStreamAsync() => Task.FromResult(_content);
System\Net\Http\WinHttpHandler.cs (4)
645Task.Factory.StartNew(s => 857private async Task StartRequestAsync(WinHttpRequestState state) 878Task? sendRequestBodyTask = null; 1681private static async Task InternalSendRequestBodyAsync(WinHttpRequestState state, WinHttpChunkMode chunkedModeForSend)
System\Net\Http\WinHttpRequestStream.cs (8)
91public override Task FlushAsync(CancellationToken cancellationToken) 94Task.FromCanceled(cancellationToken) : 95Task.CompletedTask; 98public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken token) 164internal async Task EndUploadAsync() 192private Task InternalWriteAsync(byte[] buffer, int offset, int count) 196return Task.CompletedTask; 204private async Task InternalWriteChunkedModeAsync(byte[] buffer, int offset, int count)
System\Net\Http\WinHttpResponseStream.cs (7)
85public override Task FlushAsync(CancellationToken cancellationToken) 88Task.FromCanceled(cancellationToken) : 89Task.CompletedTask; 92public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 100return Task.FromCanceled(cancellationToken); 107private async Task CopyToAsyncCore(Stream destination, byte[] buffer, CancellationToken cancellationToken) 193return Task.FromCanceled<int>(token);
System.Net.HttpListener (14)
src\runtime\src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
353Task.Factory.StartNew(
System\Net\HttpListener.cs (1)
292return Task.Factory.FromAsync(
System\Net\HttpListenerRequest.cs (1)
256return Task.Factory.FromAsync(
System\Net\HttpRequestStream.cs (2)
40public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
System\Net\HttpResponseStream.cs (2)
20public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
System\Net\Managed\HttpResponseStream.Managed.cs (3)
92internal async Task WriteWebSocketHandshakeHeadersAsync() 157internal Task InternalWriteAsync(byte[] buffer, int offset, int count) => 160private async Task InternalWriteIgnoreErrorsAsync(byte[] buffer, int offset, int count)
System\Net\Managed\HttpStreamAsyncResult.cs (1)
75Task.Run(() => _callback(this));
System\Net\Managed\WebSockets\HttpWebSocket.Managed.cs (3)
109public override Task CloseAsync( 115public override Task CloseOutputAsync( 171public override Task SendAsync(
System.Net.Mail (46)
src\runtime\src\libraries\Common\src\System\ReadWriteAdapter.cs (15)
26static abstract Task FlushAsync(Stream stream, CancellationToken cancellationToken); 27static abstract Task WaitAsync(TaskCompletionSource<bool> waiter); 28static abstract Task WaitAsync(Task task); 51public static Task FlushAsync(Stream stream, CancellationToken cancellationToken) => stream.FlushAsync(cancellationToken); 53public static Task WaitAsync(TaskCompletionSource<bool> waiter) => waiter.Task; 54public static Task WaitAsync(Task task) => task; 90public static Task FlushAsync(Stream stream, CancellationToken cancellationToken) 93return Task.CompletedTask; 96public static Task WaitAsync(TaskCompletionSource<bool> waiter) 99return Task.CompletedTask; 102public static Task WaitAsync(Task task) 105return Task.CompletedTask;
System\Net\Base64Stream.cs (1)
150public override async Task FlushAsync(CancellationToken cancellationToken)
System\Net\DelegatedStream.cs (2)
98public override Task FlushAsync(CancellationToken cancellationToken) 197public sealed override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\Net\Mail\MailMessage.cs (1)
434internal async Task SendAsync<TIOAdapter>(BaseWriter writer, bool sendEnvelope, bool allowUnicode, CancellationToken cancellationToken = default)
System\Net\Mail\MailPriority.cs (1)
244internal async Task SendAsync<TIOAdapter>(BaseWriter writer, bool sendEnvelope, bool allowUnicode, CancellationToken cancellationToken = default)
System\Net\Mail\SmtpClient.cs (10)
639public Task SendMailAsync(string from, string recipients, string? subject, string? body) 645public Task SendMailAsync(MailMessage message) 650public Task SendMailAsync(string from, string recipients, string? subject, string? body, CancellationToken cancellationToken) 656public Task SendMailAsync(MailMessage message, CancellationToken cancellationToken) 660return Task.FromCanceled(cancellationToken); 677return Task.FromException(ex); 680return Task.CompletedTask; 684static async Task WaitAndRethrowIfNeeded(Task<(Exception? ex, bool _)> task) 742private Task EnsureConnection<TIOAdapter>(CancellationToken cancellationToken) where TIOAdapter : IReadWriteAdapter 746return Task.CompletedTask;
System\Net\Mail\SmtpCommands.cs (6)
82internal static async Task SendAsync<TIOAdapter>(SmtpConnection conn, CancellationToken cancellationToken = default) 125internal static async Task SendAsync<TIOAdapter>(SmtpConnection conn, CancellationToken cancellationToken = default) 216internal static async Task SendAsync<TIOAdapter>(SmtpConnection conn, string domain, CancellationToken cancellationToken = default) 259internal static async Task SendAsync<TIOAdapter>(SmtpConnection conn, CancellationToken cancellationToken = default) 303internal static Task SendAsync<TIOAdapter>(SmtpConnection conn, ReadOnlySpan<byte> command, MailAddress from, bool allowUnicode, CancellationToken cancellationToken = default) 412internal static async Task SendAsync<TIOAdapter>(SmtpConnection conn, CancellationToken cancellationToken = default)
System\Net\Mail\SmtpConnection.cs (3)
87internal async Task InitializeConnectionAsync(string host, int port) 93internal async Task GetConnectionAsync<TIOAdapter>(string host, int port, CancellationToken cancellationToken = default) 241internal async Task FlushAsync<TIOAdapter>(CancellationToken cancellationToken = default) where TIOAdapter : IReadWriteAdapter
System\Net\Mail\SmtpTransport.cs (2)
82internal async Task GetConnectionAsync(string host, int port, CancellationToken cancellationToken = default) 87internal Task GetConnectionAsync<TIOAdapter>(string host, int port, CancellationToken cancellationToken = default)
System\Net\Mime\MimeBasePart.cs (1)
191internal abstract Task SendAsync<TIOAdapter>(BaseWriter writer, bool allowUnicode, CancellationToken cancellationToken) where TIOAdapter : IReadWriteAdapter;
System\Net\Mime\MimeMultiPart.cs (1)
43internal override async Task SendAsync<TIOAdapter>(BaseWriter writer, bool allowUnicode, CancellationToken cancellationToken = default)
System\Net\Mime\MimePart.cs (1)
162internal override async Task SendAsync<TIOAdapter>(BaseWriter writer, bool allowUnicode, CancellationToken cancellationToken = default)
System\Net\Mime\QEncodedStream.cs (1)
194public override async Task FlushAsync(CancellationToken cancellationToken)
System\Net\Mime\QuotedPrintableStream.cs (1)
308public override async Task FlushAsync(CancellationToken cancellationToken)
System.Net.NameResolution (32)
System\Net\Dns.cs (28)
670private static Task GetHostEntryOrAddressesCoreAsync(string hostName, bool justReturnParsedIp, bool throwOnIIPAny, bool justAddresses, AddressFamily family, CancellationToken cancellationToken) 676return justAddresses ? (Task) 677Task.FromCanceled<IPAddress[]>(cancellationToken) : 678Task.FromCanceled<IPHostEntry>(cancellationToken); 683return justAddresses ? (Task) 684Task.FromResult((IPAddress[])resultOnFailure) : 685Task.FromResult((IPHostEntry)resultOnFailure); 701return justAddresses ? (Task) 702Task.FromResult(family == AddressFamily.Unspecified || ipAddress.AddressFamily == family ? new[] { ipAddress } : Array.Empty<IPAddress>()) : 703Task.FromResult(CreateHostEntryForAddress(ipAddress)); 718return justAddresses ? (Task) 719Task.FromException<IPAddress[]>(invalidDomainException!) : 720Task.FromException<IPHostEntry>(invalidDomainException!); 738Task? t; 789Task? task = NameResolutionPal.GetAddrInfoAsync(hostName, justAddresses, addressFamily, cancellationToken); 801static async Task<T> CompleteAsync(Task task, string hostName, bool justAddresses, AddressFamily addressFamily, bool shouldFallbackToLocalhost, long startingTimeStamp, CancellationToken cancellationToken) 863return await ((Task<T>)(Task)Dns.GetHostAddressesAsync(Localhost, family, cancellationToken)).ConfigureAwait(false); 868return await ((Task<T>)(Task)Dns.GetHostAddressesAsync(IPv6Localhost, family, cancellationToken)).ConfigureAwait(false); 876return await ((Task<T>)(Task)Dns.GetHostEntryAsync(Localhost, family, cancellationToken)).ConfigureAwait(false); 881return await ((Task<T>)(Task)Dns.GetHostEntryAsync(IPv6Localhost, family, cancellationToken)).ConfigureAwait(false); 921private static readonly Dictionary<object, Task> s_tasks = new Dictionary<object, Task>(); 950s_tasks.TryGetValue(key, out Task? prevTask); 951prevTask ??= Task.CompletedTask; 970((ICollection<KeyValuePair<object, Task>>)s_tasks).Remove(new KeyValuePair<object, Task>(key!, task!)); 983((ICollection<KeyValuePair<object, Task>>)s_tasks).Remove(new KeyValuePair<object, Task>(key!, task));
System\Net\DnsResolver.cs (1)
391await Task.WhenAll(aTask, aaaaTask).ConfigureAwait(false);
System\Net\DnsResolverPal.Managed.cs (2)
764private static async Task ReceiveExactAsync(DnsSocket socket, Memory<byte> buffer, CancellationToken cancellationToken) 796private static async Task SendExactAsync(DnsSocket socket, ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken)
System\Net\NameResolutionPal.Unix.cs (1)
24internal static Task? GetAddrInfoAsync(string hostName, bool justAddresses, AddressFamily family, CancellationToken cancellationToken) =>
System.Net.NetworkInformation (3)
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (2)
185private static async Task ReadEventsAsync(Socket socket) 187await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
System\Net\NetworkInformation\UnixIPGlobalProperties.cs (1)
56return Task.Factory.StartNew(s => ((UnixIPGlobalProperties)s!).GetUnicastAddresses(), this,
System.Net.Quic (19)
System\Net\Quic\Internal\ResettableValueTaskSource.cs (7)
123/// Gets a <see cref="Task"/> that will transition to a completed state with the last transition of this source, i.e. into <see cref="State.Completed"/>. 125/// <returns>The <see cref="Task"/> that will transition to a completed state with the last transition of this source.</returns> 126public Task GetFinalTask(object? keepAlive) 300private Task? _signaledTask; 310public Task GetTask(object? keepAlive) 316_signaledTask ??= _exception is null ? Task.CompletedTask : Task.FromException(_exception);
System\Net\Quic\QuicConnection.cs (1)
256await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
System\Net\Quic\QuicConnection.SslConnectionOptions.cs (1)
121await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
System\Net\Quic\QuicListener.cs (1)
221await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
System\Net\Quic\QuicStream.cs (6)
47/// <description>A <see cref="Task"/> that will get completed when the stream writing side has been closed (gracefully or abortively).</description> 51/// <description>A <see cref="Task"/> that will get completed when the stream reading side has been closed (gracefully or abortively).</description> 171/// A <see cref="Task"/> that will get completed once reading side has been closed. 176public Task ReadsClosed => _receiveTcs.GetFinalTask(this); 179/// A <see cref="Task"/> that will get completed once writing side has been closed. 185public Task WritesClosed => _sendTcs.GetFinalTask(this);
System\Net\Quic\QuicStream.Stream.cs (3)
201public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken = default) 214public override Task FlushAsync(CancellationToken cancellationToken = default) 216=> Task.CompletedTask;
System.Net.Requests (22)
src\runtime\src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
353Task.Factory.StartNew(
System\Net\FileWebRequest.cs (6)
160Task<Stream> t = Task.Factory.StartNew<Stream>(s => ((FileWebRequest)s!).CreateWriteStream(), 168return Task.Factory.StartNew<Stream>(s => 221Task<WebResponse> t = Task.Factory.StartNew(s => ((FileWebRequest)s!).CreateResponse(), 229return Task.Factory.StartNew(s => 436public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 450public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
System\Net\HttpWebRequest.cs (3)
1111Task result = await Task.WhenAny(getStreamTask, _sendRequestTask).ConfigureAwait(false); 1257Task.FromResult(_httpClient.Send(_sendRequestMessage, completionOption, _sendRequestCts.Token));
System\Net\NetworkStreamWrapper.cs (2)
208public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 223public override Task FlushAsync(CancellationToken cancellationToken)
System\Net\RequestBufferingStream.cs (4)
27public override Task FlushAsync(CancellationToken cancellationToken) 32Task.FromCanceled(cancellationToken) : 33Task.CompletedTask; 78public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\Net\RequestStream.cs (2)
54public override Task FlushAsync(CancellationToken cancellationToken) 102public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\Net\RequestStreamContent.cs (2)
14protected override Task SerializeToStreamAsync(Stream stream, TransportContext? context) 18protected override async Task SerializeToStreamAsync(Stream stream, TransportContext? context, CancellationToken cancellationToken)
System\Net\WebRequest.cs (2)
521await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding); 532await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
System.Net.Security (61)
src\runtime\src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (5)
67await ((Task)task).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing); 197Task sendTask = (Task)SendAsync(httpClient, requestMessage, cancellationToken); 236Task sendTask = (Task)SendAsync(httpClient, requestMessage, cancellationToken);
src\runtime\src\libraries\Common\src\System\ReadWriteAdapter.cs (15)
26static abstract Task FlushAsync(Stream stream, CancellationToken cancellationToken); 27static abstract Task WaitAsync(TaskCompletionSource<bool> waiter); 28static abstract Task WaitAsync(Task task); 51public static Task FlushAsync(Stream stream, CancellationToken cancellationToken) => stream.FlushAsync(cancellationToken); 53public static Task WaitAsync(TaskCompletionSource<bool> waiter) => waiter.Task; 54public static Task WaitAsync(Task task) => task; 90public static Task FlushAsync(Stream stream, CancellationToken cancellationToken) 93return Task.CompletedTask; 96public static Task WaitAsync(TaskCompletionSource<bool> waiter) 99return Task.CompletedTask; 102public static Task WaitAsync(Task task) 105return Task.CompletedTask;
System\Net\Security\NegotiateStream.cs (17)
180public virtual Task AuthenticateAsClientAsync() => 183public virtual Task AuthenticateAsClientAsync(NetworkCredential credential, string targetName) => 186public virtual Task AuthenticateAsClientAsync( 192public virtual Task AuthenticateAsClientAsync(NetworkCredential credential, ChannelBinding? binding, string targetName) => 195public virtual Task AuthenticateAsClientAsync( 203public virtual Task AuthenticateAsServerAsync() => 206public virtual Task AuthenticateAsServerAsync(ExtendedProtectionPolicy? policy) => 209public virtual Task AuthenticateAsServerAsync(NetworkCredential credential, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel) => 212public virtual Task AuthenticateAsServerAsync( 293public override Task FlushAsync(CancellationToken cancellationToken) => 482/// <returns>A <see cref="Task"/> that represents the asynchronous read operation.</returns> 483public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 508private async Task WriteAsync<TIOAdapter>(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken) 727private async Task AuthenticateAsync<TIOAdapter>(CancellationToken cancellationToken) 756private async Task SendBlobAsync<TIOAdapter>(byte[]? message, CancellationToken cancellationToken) 865private async Task ReceiveBlobAsync<TIOAdapter>(CancellationToken cancellationToken) 925private async Task SendAuthResetSignalAndThrowAsync<TIOAdapter>(byte[] message, Exception exception, CancellationToken cancellationToken)
System\Net\Security\SslStream.cs (14)
381public virtual Task AuthenticateAsClientAsync(string targetHost) => AuthenticateAsClientAsync(targetHost, null, false); 383public virtual Task AuthenticateAsClientAsync(string targetHost, X509CertificateCollection? clientCertificates, bool checkCertificateRevocation) => AuthenticateAsClientAsync(targetHost, clientCertificates, SslProtocols.None, checkCertificateRevocation); 385public virtual Task AuthenticateAsClientAsync(string targetHost, X509CertificateCollection? clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) 399public Task AuthenticateAsClientAsync(SslClientAuthenticationOptions sslClientAuthenticationOptions, CancellationToken cancellationToken = default) 408public virtual Task AuthenticateAsServerAsync(X509Certificate serverCertificate) => 411public virtual Task AuthenticateAsServerAsync(X509Certificate serverCertificate, bool clientCertificateRequired, bool checkCertificateRevocation) 424public virtual Task AuthenticateAsServerAsync(X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) 438public Task AuthenticateAsServerAsync(SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken = default) 445public Task AuthenticateAsServerAsync(ServerOptionsSelectionCallback optionsCallback, object? state, CancellationToken cancellationToken = default) 452public virtual Task ShutdownAsync() 463return Task.CompletedTask; 693public override Task FlushAsync(CancellationToken cancellationToken) => InnerStream.FlushAsync(cancellationToken); 698public virtual Task NegotiateClientCertificateAsync(CancellationToken cancellationToken = default) 878public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\Net\Security\SslStream.IO.cs (8)
92private Task ProcessAuthenticationAsync(bool isAsync = false, CancellationToken cancellationToken = default) 108private async Task ProcessAuthenticationWithTelemetryAsync(bool isAsync, CancellationToken cancellationToken) 125Task task = isAsync ? 159private async Task ReplyOnReAuthenticationAsync<TIOAdapter>(byte[]? buffer, CancellationToken cancellationToken) 174private async Task RenegotiateAsync<TIOAdapter>(CancellationToken cancellationToken) 263private async Task ForceAuthenticationAsync<TIOAdapter>(bool receiveFirst, byte[]? reAuthenticationData, CancellationToken cancellationToken) 739Task waiterTask = TIOAdapter.WaitAsync(waiter); 768async ValueTask WaitAndWriteAsync(ReadOnlyMemory<byte> buffer, Task waitTask, CancellationToken cancellationToken)
System\Net\Security\SslStreamCertificateContext.Linux.cs (1)
289return Task.FromResult<byte[]?>(null);
System\Net\StreamFramer.cs (1)
69public async Task WriteMessageAsync<TAdapter>(Stream stream, byte[] message, CancellationToken cancellationToken)
System.Net.ServerSentEvents (3)
System\Net\ServerSentEvents\SseFormatter.cs (3)
28public static Task WriteAsync(IAsyncEnumerable<SseItem<string>> source, Stream destination, CancellationToken cancellationToken = default) 53public static Task WriteAsync<T>(IAsyncEnumerable<SseItem<T>> source, Stream destination, Action<SseItem<T>, IBufferWriter<byte>> itemFormatter, CancellationToken cancellationToken = default) 73private static async Task WriteAsyncCore<T>(IAsyncEnumerable<SseItem<T>> source, Stream destination, Action<SseItem<T>, IBufferWriter<byte>> itemFormatter, CancellationToken cancellationToken)
System.Net.Sockets (23)
System\Net\Sockets\NetworkStream.cs (3)
624public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 673public override Task FlushAsync(CancellationToken cancellationToken) 675return Task.CompletedTask;
System\Net\Sockets\Socket.cs (2)
2658((Task)ti).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing).GetAwaiter().GetResult(); 4073private static SocketError GetSocketErrorFromFaultedTask(Task t)
System\Net\Sockets\Socket.Tasks.cs (6)
78public Task ConnectAsync(EndPoint remoteEP) => ConnectAsync(remoteEP, default).AsTask(); 113public Task ConnectAsync(IPAddress address, int port) => ConnectAsync(new IPEndPoint(address, port)); 130public Task ConnectAsync(IPAddress[] addresses, int port) => ConnectAsync(addresses, port, CancellationToken.None).AsTask(); 207public Task ConnectAsync(string host, int port) => ConnectAsync(host, port, default).AsTask(); 857t = Task.FromResult(fromNetworkStream & !isReceive ? 0 : saea.BytesTransferred); 861t = Task.FromException<int>(GetException(saea.SocketError, wrapExceptionsInIOExceptions: fromNetworkStream));
System\Net\Sockets\SocketAsyncEventArgs.cs (1)
740async Task Core(MultiConnectSocketAsyncEventArgs internalArgs, Task<IPAddress[]> addressesTask, int port, SocketType socketType, ProtocolType protocolType, ParallelMultiConnectSocketState? parallelState, CancellationToken cancellationToken)
System\Net\Sockets\SocketPal.Unix.cs (1)
2081public static async Task SendPacketsAsync(
System\Net\Sockets\SocketTaskExtensions.cs (4)
22public static Task ConnectAsync(this Socket socket, EndPoint remoteEP) => 28public static Task ConnectAsync(this Socket socket, IPAddress address, int port) => 34public static Task ConnectAsync(this Socket socket, IPAddress[] addresses, int port) => 40public static Task ConnectAsync(this Socket socket, string host, int port) =>
System\Net\Sockets\TCPClient.cs (6)
181public Task ConnectAsync(IPAddress address, int port) => 184public Task ConnectAsync(string host, int port) => 187public Task ConnectAsync(IPAddress[] addresses, int port) => 195public Task ConnectAsync(IPEndPoint remoteEP) => 198private async Task CompleteConnectAsync(Task task)
System.Net.WebClient (12)
src\runtime\src\libraries\Common\src\System\IO\ChunkedMemoryStream.cs (5)
63public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 67return Task.FromCanceled(cancellationToken); 71return Task.CompletedTask; 113public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask;
src\runtime\src\libraries\Common\src\System\IO\DelegatingStream.cs (3)
130public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 144public override Task FlushAsync(CancellationToken cancellationToken) 169public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
src\runtime\src\libraries\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs (2)
113Task.Run(c); 131Task.Run(continuation);
System\Net\WebClient.cs (2)
1672public Task DownloadFileTaskAsync(string address, string fileName) => 1675public Task DownloadFileTaskAsync(Uri address, string fileName)
System.Net.WebSockets (26)
System\Net\WebSockets\AsyncMutex.cs (5)
53public Task EnterAsync(CancellationToken cancellationToken) 61return Task.FromCanceled(cancellationToken); 67return Task.CompletedTask; 78Task Contended(CancellationToken cancellationToken) 99return Task.CompletedTask;
System\Net\WebSockets\ManagedWebSocket.cs (14)
263Task lockTask = mutex.EnterAsync(CancellationToken.None); 297public override Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) 366return Task.FromException<WebSocketReceiveResult>(exc); 387public override Task CloseAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) 400return Task.FromException(exc); 406public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) 414private async Task CloseOutputAsyncCore(WebSocketCloseStatus closeStatus, string? statusDescription, bool enterReceiveMutex, CancellationToken cancellationToken) 486Task lockTask = _sendMutex.EnterAsync(cancellationToken); 519Task flushTask = _stream.FlushAsync(); 600private async ValueTask SendFrameFallbackAsync(MessageOpcode opcode, bool endOfMessage, bool disableCompression, ReadOnlyMemory<byte> payloadBuffer, Task lockTask, CancellationToken cancellationToken) 1136Task? task = null; 1440private async Task CloseAsyncPrivate(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) 1888private void LogExceptions(Task t) 1907static void LogFaulted(Task task, object? thisObj)
System\Net\WebSockets\WebSocket.cs (3)
21public abstract Task CloseAsync(WebSocketCloseStatus closeStatus, 24public abstract Task CloseOutputAsync(WebSocketCloseStatus closeStatus, 30public abstract Task SendAsync(ArraySegment<byte> buffer,
System\Net\WebSockets\WebSocketStream.cs (4)
120public override Task FlushAsync(CancellationToken cancellationToken) => 121cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 122Task.CompletedTask; 145public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System.Net.WebSockets.Client (35)
_generated\0\JSImports.g.cs (8)
110public static partial global::System.Threading.Tasks.Task WebSocketOpen(global::System.Runtime.InteropServices.JavaScript.JSObject webSocket) 121global::System.Threading.Tasks.Task __retVal; 158public static partial global::System.Threading.Tasks.Task WebSocketSend(global::System.Runtime.InteropServices.JavaScript.JSObject webSocket, nint bufferPtr, int bufferLength, int messageType, bool endOfMessage) 173global::System.Threading.Tasks.Task __retVal; 218public static partial global::System.Threading.Tasks.Task WebSocketReceive(global::System.Runtime.InteropServices.JavaScript.JSObject webSocket, nint bufferPtr, int bufferLength) 231global::System.Threading.Tasks.Task __retVal; 272public static partial global::System.Threading.Tasks.Task WebSocketClose(global::System.Runtime.InteropServices.JavaScript.JSObject webSocket, int code, string reason, bool waitForCloseReceived) 286global::System.Threading.Tasks.Task __retVal;
System\Net\WebSockets\BrowserWebSockets\BrowserInterop.cs (6)
78public static partial Task WebSocketOpen( 82public static partial Task? WebSocketSend( 89public static unsafe Task? UnsafeSend(JSObject jsWs, MemoryHandle pinBuffer, int length, WebSocketMessageType messageType, bool endOfMessage) 95public static partial Task? WebSocketReceive( 100public static unsafe Task? ReceiveUnsafe(JSObject jsWs, MemoryHandle pinBuffer, int length) 106public static partial Task? WebSocketClose(
System\Net\WebSockets\BrowserWebSockets\BrowserWebSocket.cs (14)
136internal Task ConnectAsync(Uri uri, List<string>? requestedSubProtocols, CancellationToken cancellationToken) 154public override Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) 183public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) 193public override Task CloseAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) 316private async Task ConnectAsyncCore(CancellationToken cancellationToken) 318Task openTask; 369private async Task SendAsyncCore(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) 372Task? sendTask; 423Task? receiveTask; 509private async Task CloseAsyncCore(WebSocketCloseStatus closeStatus, string? statusDescription, bool fullClose, CancellationToken cancellationToken) 511Task? closeTask; 553private async Task CancellationHelper(Task promise, CancellationToken cancellationToken, WebSocketState previousState) 571CancelablePromise.CancelPromise((Task)s!);
System\Net\WebSockets\ClientWebSocket.cs (6)
78public Task ConnectAsync(Uri uri, CancellationToken cancellationToken) 90public Task ConnectAsync(Uri uri, HttpMessageInvoker? invoker, CancellationToken cancellationToken) 120private async Task ConnectAsyncCore(Uri uri, HttpMessageInvoker? invoker, CancellationToken cancellationToken) 141public override Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) => 156public override Task CloseAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) => 159public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) =>
System\Net\WebSockets\WebSocketHandle.Browser.cs (1)
37public Task ConnectAsync(Uri uri, HttpMessageInvoker? _ /*invoker*/, CancellationToken cancellationToken, ClientWebSocketOptions options)
System.Private.CoreLib (1637)
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncHelpers.CoreCLR.cs (27)
171public Task? CurrentTask; 368private static unsafe void Suspend(Task task, ConfigureAwaitOptions options) 458if (obj is Task t) 632private static unsafe void TransparentSuspend(Task task) 693private static void TransparentAwait(Task task) 899Task.ThrowAsync(ex, targetContext: null); 1246Task.ThrowAsync(ex, targetContext: null); 1329private static Task CreateRuntimeAsyncTask(ref RuntimeAsyncAwaitState state) 1359private static Task TaskFromException(Exception ex) 1361Task task = new(); 1584taskCont.Initialize(Task.CompletedTask); 1781public static void ResumeRuntimeAsyncContext(Task task, ref AsyncDispatcherInfo info, AsyncInstrumentation.Flags flags) 1948public static void CreateAsyncContext(Task task) 1950Task.AddToActiveTasks(task); 1954public static void ResumeAsyncContext(Task task) 1961Task.ReplaceOrAddRuntimeAsyncContinuationTimestamp(curContinuation, newContinuation); 1970public static void CompleteAsyncContext(Task? task) 1974Task.RemoveRuntimeAsyncTask(task); 1980public static void AsyncMethodUnhandledException(Task? task, Exception ex, Continuation curContinuation) 1984Task.RemoveRuntimeAsyncTask(task, curContinuation); 1992Task.RemoveRuntimeAsyncContinuationChainTimestamps(curContinuation, unwindedFrames); 1999Task.UpdateRuntimeAsyncTaskTimestamp(info.CurrentTask, curContinuation); 2005Task.RemoveRuntimeAsyncContinuationTimestamp(curContinuation); 2012Task.TryAddRuntimeAsyncContinuationChainTimestamps(nextContinuation); 2016public static void HandleSuspendedFailed(Task task, Continuation? nextContinuation) 2020Task.RemoveRuntimeAsyncTask(task, nextContinuation); 2024Task.RemoveRuntimeAsyncTask(task);
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncHelpers.RuntimeAsyncYielder.cs (5)
31Task raTask = (Task)continuationTarget; 36syncCtx.Post(static s => ((Task)s!).ExecuteDirectly(null), raTask); 47Task.Factory.StartNew(static s => ((Task)s!).ExecuteDirectly(null), raTask, default, TaskCreationOptions.PreferFairness, scheduler);
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.CoreCLR.cs (2)
16public static ulong GetDispatcherId(Task dispatcher) => (ulong)dispatcher.Id; 40public static void Create(Task dispatcher, Continuation nextContinuation)
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeAsyncTaskContinuation.cs (11)
12internal Task? Task; 13internal Task? RuntimeAsyncTask; 14private delegate*<Task, ref byte, void> _getResult; 85Task.ThrowAsync(ex, targetContext: null); 111Task task = Task; 117public void Initialize(Task task) 129private static void GetResult(Task task, ref byte result) 134private static void GetResult<T>(Task task, ref byte result) 138Task<T> taskOfT = Unsafe.As<Task, Task<T>>(ref task); 170Debug.Assert(state is Task); 171((Task)state).ExecuteDirectly(null);
src\runtime\src\libraries\Common\src\System\Threading\Tasks\CachedCompletedInt32Task.cs (1)
33return _task = Task.FromResult(result);
src\runtime\src\libraries\Common\src\System\Threading\Tasks\TaskToAsyncResult.cs (14)
9/// Provides methods for using <see cref="Task"/> to implement the Asynchronous Programming Model 19/// <summary>Creates a new <see cref="IAsyncResult"/> from the specified <see cref="Task"/>, optionally invoking <paramref name="callback"/> when the task has completed.</summary> 20/// <param name="task">The <see cref="Task"/> to be wrapped in an <see cref="IAsyncResult"/>.</param> 30/// implementing all of the core asynchronous logic via <see cref="Task"/>s and then easily implementing Begin/End methods around that functionality. 32public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state) 45/// <summary>Waits for the <see cref="Task"/> wrapped by the <see cref="IAsyncResult"/> returned by <see cref="Begin"/> to complete.</summary> 49/// <remarks>This will propagate any exception stored in the wrapped <see cref="Task"/>.</remarks> 63/// <summary>Extracts the underlying <see cref="Task"/> from an <see cref="IAsyncResult"/> created by <see cref="Begin"/>.</summary> 65/// <returns>The <see cref="Task"/> wrapped by the <see cref="IAsyncResult"/>.</returns> 68public static Task Unwrap(IAsyncResult asyncResult) 72if ((asyncResult as TaskAsyncResult)?._task is not Task task) 102/// <summary>Provides a simple <see cref="IAsyncResult"/> that wraps a <see cref="Task"/>.</summary> 111internal readonly Task _task; 119internal TaskAsyncResult(Task task, object? state, AsyncCallback? callback)
src\runtime\src\libraries\System.Private.CoreLib\src\System\CodeDom\Compiler\IndentedTextWriter.cs (33)
58public override Task FlushAsync() => _writer.FlushAsync(); 65/// <returns>A <see cref="Task"/> representing the asynchronous flush operation.</returns> 66public override Task FlushAsync(CancellationToken cancellationToken) => 67cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 86/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 87protected virtual async Task OutputTabsAsync() 203/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 204public override async Task WriteAsync(char value) 215/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 216public override async Task WriteAsync(Rune value) 230/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 231public override async Task WriteAsync(char[] buffer, int index, int count) 242/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 243public override async Task WriteAsync(string? value) 255/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 256public override async Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 268/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 269public override async Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = default) 284/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 285public Task WriteLineNoTabsAsync(string? s) 420public override async Task WriteLineAsync() 432/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 433public override async Task WriteLineAsync(char value) 445/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 446public override async Task WriteLineAsync(Rune value) 460/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 461public override async Task WriteLineAsync(char[] buffer, int index, int count) 473/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 474public override async Task WriteLineAsync(string? value) 487/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 488public override async Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 501/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> 502public override async Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = default)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.cs (1)
30private Task? m_dispatchTask;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.Threads.cs (3)
17Task? previousDispatchTask = m_dispatchTask; 18m_dispatchTask = Task.Factory.StartNew(() => DispatchEventsToEventListeners(sessionID, syncTimeUtc, syncTimeQPC, timeQPCFrequency, previousDispatchTask, m_dispatchTaskCancellationSource.Token), CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default); 21private void DispatchEventsToEventListeners(ulong sessionID, DateTime syncTimeUtc, long syncTimeQPC, long timeQPCFrequency, Task? previousDispatchTask, CancellationToken token)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (14)
303public override Task FlushAsync(CancellationToken cancellationToken) 306return Task.FromCanceled<int>(cancellationToken); 313private async Task FlushAsyncInternal(CancellationToken cancellationToken) 579return Task.FromCanceled<int>(cancellationToken); 589Task semaphoreLockTask = sem.WaitAsync(cancellationToken); 612: Task.FromException<int>(error); 640Task semaphoreLockTask = sem.WaitAsync(cancellationToken); 672Memory<byte> buffer, CancellationToken cancellationToken, int bytesAlreadySatisfied, Task semaphoreLockTask) 997public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 1017Task semaphoreLockTask = sem.WaitAsync(cancellationToken); 1056ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken, Task semaphoreLockTask) 1274public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 1281Task.FromCanceled<int>(cancellationToken) : 1285private async Task CopyToAsyncCore(Stream destination, int bufferSize, CancellationToken cancellationToken)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\File.cs (31)
857public static Task AppendAllBytesAsync(string path, byte[] bytes, CancellationToken cancellationToken = default) 875public static Task AppendAllBytesAsync(string path, ReadOnlyMemory<byte> bytes, CancellationToken cancellationToken = default) 880? Task.FromCanceled(cancellationToken) 883static async Task Core(string path, ReadOnlyMemory<byte> bytes, CancellationToken cancellationToken) 1119? Task.FromCanceled<string>(cancellationToken) 1156public static Task WriteAllTextAsync(string path, string? contents, CancellationToken cancellationToken = default) 1168public static Task WriteAllTextAsync(string path, ReadOnlyMemory<char> contents, CancellationToken cancellationToken = default) 1171public static Task WriteAllTextAsync(string path, string? contents, Encoding encoding, CancellationToken cancellationToken = default) 1184public static Task WriteAllTextAsync(string path, ReadOnlyMemory<char> contents, Encoding encoding, CancellationToken cancellationToken = default) 1190return Task.FromCanceled(cancellationToken); 1200return Task.FromCanceled<byte[]>(cancellationToken); 1211return Task.FromException<byte[]>(ExceptionDispatchInfo.SetCurrentStackTrace(new IOException(SR.IO_FileTooLong2GB))); 1289public static Task WriteAllBytesAsync(string path, byte[] bytes, CancellationToken cancellationToken = default) 1306public static Task WriteAllBytesAsync(string path, ReadOnlyMemory<byte> bytes, CancellationToken cancellationToken = default) 1311? Task.FromCanceled(cancellationToken) 1314static async Task Core(string path, ReadOnlyMemory<byte> bytes, CancellationToken cancellationToken) 1329? Task.FromCanceled<string[]>(cancellationToken) 1353public static Task WriteAllLinesAsync(string path, IEnumerable<string> contents, CancellationToken cancellationToken = default) 1356public static Task WriteAllLinesAsync(string path, IEnumerable<string> contents, Encoding encoding, CancellationToken cancellationToken = default) => 1359private static Task WriteAllLinesAsync(string path, IEnumerable<string> contents, Encoding encoding, bool append, CancellationToken cancellationToken) 1365return Task.FromCanceled(cancellationToken); 1377return Task.FromException(e); 1383private static async Task InternalWriteAllLinesAsync(StreamWriter writer, IEnumerable<string> contents, CancellationToken cancellationToken) 1399public static Task AppendAllTextAsync(string path, string? contents, CancellationToken cancellationToken = default) 1410public static Task AppendAllTextAsync(string path, ReadOnlyMemory<char> contents, CancellationToken cancellationToken = default) 1413public static Task AppendAllTextAsync(string path, string? contents, Encoding encoding, CancellationToken cancellationToken = default) 1425public static Task AppendAllTextAsync(string path, ReadOnlyMemory<char> contents, Encoding encoding, CancellationToken cancellationToken = default) 1431return Task.FromCanceled(cancellationToken); 1437public static Task AppendAllLinesAsync(string path, IEnumerable<string> contents, CancellationToken cancellationToken = default) 1440public static Task AppendAllLinesAsync(string path, IEnumerable<string> contents, Encoding encoding, CancellationToken cancellationToken = default) => 1613private static async Task WriteToFileAsync(string path, FileMode mode, ReadOnlyMemory<char> contents, Encoding encoding, CancellationToken cancellationToken)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileStream.cs (9)
250public override Task FlushAsync(CancellationToken cancellationToken) 254return Task.FromCanceled(cancellationToken); 279return Task.FromCanceled<int>(cancellationToken); 322public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 328return Task.FromCanceled(cancellationToken); 526public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 599internal Task BaseFlushAsync(CancellationToken cancellationToken) 612internal Task BaseWriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 621internal Task BaseCopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (19)
161public override Task FlushAsync(CancellationToken cancellationToken) 164return Task.FromCanceled(cancellationToken); 169return Task.CompletedTask; 173return Task.FromException(ex); 371return Task.FromCanceled<int>(cancellationToken); 380return Task.FromCanceled<int>(oce); 384return Task.FromException<int>(exception); 416return new ValueTask<int>(Task.FromCanceled<int>(oce)); 464public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 480return Task.FromCanceled(cancellationToken); 491return Task.CompletedTask; 501return Task.CompletedTask; 505return Task.FromException(ex); 659public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 665return Task.FromCanceled(cancellationToken); 670return Task.CompletedTask; 674return Task.FromCanceled(oce); 678return Task.FromException(exception); 705return new ValueTask(Task.FromCanceled(oce));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\ReadOnlyMemoryStream.cs (8)
80public override Task FlushAsync(CancellationToken cancellationToken) => 81cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : Task.CompletedTask; 134return Task.FromCanceled<int>(cancellationToken); 196public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 203return Task.FromCanceled(cancellationToken); 214return Task.CompletedTask; 240public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => throw new NotSupportedException(SR.NotSupported_UnwritableStream);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (11)
311Task semaphoreLockTask = semaphore.WaitAsync(cancellationToken); 392private async ValueTask<int> ReadAsyncSlowPath(Task semaphoreLockTask, Memory<byte> buffer, CancellationToken cancellationToken) 583public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 612Task semaphoreLockTask = semaphore.WaitAsync(cancellationToken); 676private async ValueTask WriteAsyncSlowPath(Task semaphoreLockTask, ReadOnlyMemory<byte> source, CancellationToken cancellationToken) 785public override Task FlushAsync(CancellationToken cancellationToken) 789return Task.FromCanceled<int>(cancellationToken); 797private async Task FlushAsyncInternal(CancellationToken cancellationToken) 834public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 840Task.FromCanceled<int>(cancellationToken) : 844private async Task CopyToAsyncCore(Stream destination, int bufferSize, CancellationToken cancellationToken)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\DerivedFileStreamStrategy.cs (3)
125public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 141public override Task FlushAsync(CancellationToken cancellationToken) 147public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (3)
135public sealed override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask; // no buffering = nothing to flush 253public sealed override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (34)
79public Task CopyToAsync(Stream destination) => CopyToAsync(destination, GetCopyBufferSize()); 81public Task CopyToAsync(Stream destination, int bufferSize) => CopyToAsync(destination, bufferSize, CancellationToken.None); 83public Task CopyToAsync(Stream destination, CancellationToken cancellationToken) => CopyToAsync(destination, GetCopyBufferSize(), cancellationToken); 85public virtual Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 100static async Task Core(Stream source, Stream destination, int bufferSize, CancellationToken cancellationToken) 189public Task FlushAsync() => FlushAsync(CancellationToken.None); 191public virtual Task FlushAsync(CancellationToken cancellationToken) => 192Task.Factory.StartNew( 218Task? semaphoreTask = null; 238var thisTask = Task.InternalCurrent as ReadWriteTask; 306Task.FromCanceled<int>(cancellationToken) : 478internal Task BeginWriteInternal( 494Task? semaphoreTask = null; 514var thisTask = Task.InternalCurrent as ReadWriteTask; 551private static void RunReadWriteTaskWhenReady(Task asyncWaiter, ReadWriteTask readWriteTask) 698void ITaskCompletionAction.Invoke(Task completingTask) 724public Task WriteAsync(byte[] buffer, int offset, int count) => WriteAsync(buffer, offset, count, CancellationToken.None); 726public virtual Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => 730Task.FromCanceled(cancellationToken) : 745private static async Task FinishWriteAsync(Task writeTask, byte[] localBuffer) 757private Task BeginEndWriteAsync(byte[] buffer, int offset, int count) 1019public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) => 1021Task.FromCanceled(cancellationToken) : 1022Task.CompletedTask; 1031public override Task FlushAsync(CancellationToken cancellationToken) => 1033Task.FromCanceled(cancellationToken) : 1034Task.CompletedTask; 1043TaskToAsyncResult.Begin(Task.CompletedTask, callback, state); 1054Task.FromCanceled<int>(cancellationToken) : 1055Task.FromResult(0); 1068public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => 1070Task.FromCanceled(cancellationToken) : 1071Task.CompletedTask;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (8)
84private Task _asyncReadTask = Task.CompletedTask; 1486public override Task<int> ReadAsync(char[] buffer, int index, int count) => Task.FromResult(0); 1495public override Task<int> ReadBlockAsync(char[] buffer, int index, int count) => Task.FromResult(0); 1502public override Task<string?> ReadLineAsync() => Task.FromResult<string?>(null); 1509public override Task<string> ReadToEndAsync() => Task.FromResult(""); 1512cancellationToken.IsCancellationRequested ? Task.FromCanceled<string>(cancellationToken) : Task.FromResult("");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (51)
55private Task _asyncWriteTask = Task.CompletedTask; 679public override Task WriteAsync(char value) 696private async Task WriteAsyncInternal(char value, bool appendNewLine) 726public override Task WriteAsync(string? value) 746return Task.CompletedTask; 750public override Task WriteAsync(char[] buffer, int index, int count) 776public override Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 789return Task.FromCanceled(cancellationToken); 795private async Task WriteAsyncInternal(ReadOnlyMemory<char> source, bool appendNewLine, CancellationToken cancellationToken) 834public override Task WriteLineAsync() 851public override Task WriteLineAsync(char value) 868public override Task WriteLineAsync(string? value) 890public override Task WriteLineAsync(char[] buffer, int index, int count) 916public override Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 928return Task.FromCanceled(cancellationToken); 934public override Task FlushAsync() 954/// <returns>A <see cref="Task"/> that represents the asynchronous flush operation.</returns> 955public override Task FlushAsync(CancellationToken cancellationToken) 961return Task.FromCanceled(cancellationToken); 978private async Task FlushAsyncInternalWithGuard(bool flushStream, bool flushEncoder, CancellationToken cancellationToken) 984private Task FlushAsyncInternal(bool flushStream, bool flushEncoder, CancellationToken cancellationToken = default) 988return Task.FromCanceled(cancellationToken); 994return Task.CompletedTask; 999async Task Core(bool flushStream, bool flushEncoder, CancellationToken cancellationToken) 1053public override Task FlushAsync() => Task.CompletedTask; 1054public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask; 1074public override Task WriteAsync(char value) => Task.CompletedTask; 1075public override Task WriteAsync(string? value) => Task.CompletedTask; 1076public override Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = default) => Task.CompletedTask; 1077public override Task WriteAsync(char[] buffer, int index, int count) => Task.CompletedTask; 1078public override Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) => Task.CompletedTask; 1099public override Task WriteLineAsync(char value) => Task.CompletedTask; 1100public override Task WriteLineAsync(string? value) => Task.CompletedTask; 1101public override Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = default) => Task.CompletedTask; 1102public override Task WriteLineAsync(char[] buffer, int index, int count) => Task.CompletedTask; 1103public override Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) => Task.CompletedTask; 1104public override Task WriteLineAsync() => Task.CompletedTask;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StringReader.cs (6)
216return Task.FromResult(ReadLine()); 254return Task.FromResult(ReadToEnd()); 284? Task.FromCanceled<string>(cancellationToken) 285: Task.FromResult(ReadToEnd()); 298return Task.FromResult(ReadBlock(buffer, index, count)); 316return Task.FromResult(Read(buffer, index, count));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StringStream.cs (8)
245return Task.FromCanceled<int>(cancellationToken); 250return Task.FromResult(Read(buffer, offset, count)); 254return Task.FromCanceled<int>(oce.CancellationToken); 258return Task.FromException<int>(ex); 307public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => throw new NotSupportedException(SR.NotSupported_UnwritableStream); 318public override Task FlushAsync(CancellationToken cancellationToken) => 319cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : Task.CompletedTask;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StringWriter.cs (26)
196public override Task WriteAsync(char value) 199return Task.CompletedTask; 202public override Task WriteAsync(string? value) 205return Task.CompletedTask; 208public override Task WriteAsync(char[] buffer, int index, int count) 211return Task.CompletedTask; 214public override Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 218return Task.FromCanceled(cancellationToken); 222return Task.CompletedTask; 225public override Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = default) 236return Task.FromCanceled(cancellationToken); 245return Task.CompletedTask; 248public override Task WriteLineAsync(char value) 251return Task.CompletedTask; 254public override Task WriteLineAsync(string? value) 257return Task.CompletedTask; 260public override Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = default) 271return Task.FromCanceled(cancellationToken); 281return Task.CompletedTask; 284public override Task WriteLineAsync(char[] buffer, int index, int count) 287return Task.CompletedTask; 290public override Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 294return Task.FromCanceled(cancellationToken); 298return Task.CompletedTask; 301public override Task FlushAsync() 303return Task.CompletedTask;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (6)
376public override Task<string?> ReadLineAsync() => Task.FromResult(ReadLine()); 383public override Task<string> ReadToEndAsync() => Task.FromResult(ReadToEnd()); 387=> cancellationToken.IsCancellationRequested ? Task.FromCanceled<string>(cancellationToken) : Task.FromResult(ReadToEnd()); 399return Task.FromResult(ReadBlock(buffer, index, count)); 412return Task.FromResult(Read(buffer, index, count));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.CreateBroadcasting.cs (15)
103public override async Task FlushAsync() 111public override async Task FlushAsync(CancellationToken cancellationToken) 463public override async Task WriteAsync(char value) 471public override async Task WriteAsync(Rune value) 479public override async Task WriteAsync(string? value) 487public override async Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = default) 495public override async Task WriteAsync(char[] buffer, int index, int count) 503public override async Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 511public override async Task WriteLineAsync(char value) 519public override async Task WriteLineAsync(Rune value) 527public override async Task WriteLineAsync(string? value) 535public override async Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = default) 543public override async Task WriteLineAsync(char[] buffer, int index, int count) 551public override async Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 559public override async Task WriteLineAsync()
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (106)
588public virtual Task WriteAsync(char value) => 589Task.Factory.StartNew(static state => 600public virtual unsafe Task WriteAsync(Rune value) 606return Task.Factory.StartNew(static state => 617public virtual Task WriteAsync(string? value) => 618Task.Factory.StartNew(static state => 630public Task WriteAsync(string? value, CancellationToken cancellationToken) => 639public virtual Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = default) 642cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 643value == null ? Task.CompletedTask : 646async Task WriteAsyncCore(StringBuilder sb, CancellationToken ct) 655public Task WriteAsync(char[]? buffer) 659return Task.CompletedTask; 665public virtual Task WriteAsync(char[] buffer, int index, int count) => 666Task.Factory.StartNew(static state => 672public virtual Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) => 673cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 676Task.Factory.StartNew(static state => 682public virtual Task WriteLineAsync(char value) => 683Task.Factory.StartNew(static state => 694public virtual unsafe Task WriteLineAsync(Rune value) 700return Task.Factory.StartNew(static state => 711public virtual Task WriteLineAsync(string? value) => 712Task.Factory.StartNew(static state => 724public Task WriteLineAsync(string? value, CancellationToken cancellationToken) => 733public virtual Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = default) 736cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 740async Task WriteLineAsyncCore(StringBuilder sb, CancellationToken ct) 750public Task WriteLineAsync(char[]? buffer) 760public virtual Task WriteLineAsync(char[] buffer, int index, int count) => 761Task.Factory.StartNew(static state => 767public virtual Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) => 768cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 771Task.Factory.StartNew(static state => 777public virtual Task WriteLineAsync() 787public Task WriteLineAsync(CancellationToken cancellationToken) => 790public virtual Task FlushAsync() 792return Task.Factory.StartNew(static state => ((TextWriter)state!).Flush(), this, 801/// <returns>A <see cref="Task"/> that represents the asynchronous flush operation.</returns> 804public virtual Task FlushAsync(CancellationToken cancellationToken) => 805cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : 821public override Task FlushAsync() => Task.CompletedTask; 822public override Task FlushAsync(CancellationToken cancellationToken) => Task.CompletedTask; 845public override Task WriteAsync(char value) => Task.CompletedTask; 846public override Task WriteAsync(Rune value) => Task.CompletedTask; 847public override Task WriteAsync(string? value) => Task.CompletedTask; 848public override Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = default) => Task.CompletedTask; 849public override Task WriteAsync(char[] buffer, int index, int count) => Task.CompletedTask; 850public override Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) => Task.CompletedTask; 873public override Task WriteLineAsync(char value) => Task.CompletedTask; 874public override Task WriteLineAsync(Rune value) => Task.CompletedTask; 875public override Task WriteLineAsync(string? value) => Task.CompletedTask; 876public override Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = default) => Task.CompletedTask; 877public override Task WriteLineAsync(char[] buffer, int index, int count) => Task.CompletedTask; 878public override Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) => Task.CompletedTask; 879public override Task WriteLineAsync() => Task.CompletedTask; 1068public override Task WriteAsync(char value) 1071return Task.CompletedTask; 1075public override Task WriteAsync(Rune value) 1078return Task.CompletedTask; 1082public override Task WriteAsync(string? value) 1085return Task.CompletedTask; 1089public override Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = default) 1093return Task.FromCanceled(cancellationToken); 1097return Task.CompletedTask; 1101public override Task WriteAsync(char[] buffer, int index, int count) 1104return Task.CompletedTask; 1108public override Task WriteAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 1112return Task.FromCanceled(cancellationToken); 1116return Task.CompletedTask; 1120public override Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default) 1124return Task.FromCanceled(cancellationToken); 1128return Task.CompletedTask; 1132public override Task WriteLineAsync(char value) 1135return Task.CompletedTask; 1139public override Task WriteLineAsync(Rune value) 1142return Task.CompletedTask; 1146public override Task WriteLineAsync() 1149return Task.CompletedTask; 1153public override Task WriteLineAsync(string? value) 1156return Task.CompletedTask; 1160public override Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = default) 1164return Task.FromCanceled(cancellationToken); 1168return Task.CompletedTask; 1172public override Task WriteLineAsync(char[] buffer, int index, int count) 1175return Task.CompletedTask; 1179public override Task FlushAsync() 1182return Task.CompletedTask; 1186public override Task FlushAsync(CancellationToken cancellationToken) 1190return Task.FromCanceled(cancellationToken); 1194return Task.CompletedTask;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (10)
234public override Task FlushAsync(CancellationToken cancellationToken) 237return Task.FromCanceled(cancellationToken); 242return Task.CompletedTask; 246return Task.FromException(ex); 427return Task.FromCanceled<int>(cancellationToken); 437return Task.FromException<int>(ex); 699public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 704return Task.FromCanceled(cancellationToken); 709return Task.CompletedTask; 714return Task.FromException(ex);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStreamWrapper.cs (3)
131public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 153public override Task FlushAsync(CancellationToken cancellationToken) 170public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\WritableMemoryStream.cs (10)
82public override Task FlushAsync(CancellationToken cancellationToken) => 83cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : Task.CompletedTask; 136return Task.FromCanceled<int>(cancellationToken); 198public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 205return Task.FromCanceled(cancellationToken); 216return Task.CompletedTask; 280public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 287return Task.FromCanceled(cancellationToken); 291return Task.CompletedTask;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncHelpers.cs (4)
141/// Awaits the specified <see cref="Task"/> and throws any exception produced by the operation. 148public static void Await(Task task) 216if (obj is Task t) 300if (obj is Task t)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncHelpers.NonBrowser.cs (1)
20public static void HandleAsyncEntryPoint(Task task)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncInstrumentation.cs (1)
167if (Task.s_asyncDebuggingEnabled)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncIteratorMethodBuilder.cs (1)
58m_task = Task.s_cachedCompleted;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs (10)
57public static void SetStateMachine(IAsyncStateMachine stateMachine, Task? task) 106internal static void LogTraceOperationBegin(Task t, Type stateMachineType) 111internal static Action CreateContinuationWrapper(Action continuation, Action<Action, Task> invokeAction, Task innerTask) => 125internal static Task? TryGetContinuationTask(Action continuation) => 128continuation.Target as Task; // The continuation targets a task directly, such as with AsyncStateMachineBox 154private readonly Action<Action, Task> _invokeAction; // This wrapper is an action that wraps another action, this is that Action. 156internal readonly Task _innerTask; // If the continuation is logically going to invoke a task, this is that task (may be null) 158internal ContinuationWrapper(Action continuation, Action<Action, Task> invokeAction, Task innerTask)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncStateMachineDispatcher.cs (4)
55if (last is Task task) 81Task? activeDispatcher = info != null ? info->Dispatcher : null; 110if (dispatcherBox is Task) 164Task? activeDispatcher = info != null ? info->Dispatcher : null;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilder.cs (7)
10/// Provides a builder for asynchronous methods that return <see cref="Threading.Tasks.Task"/>. 69/// <summary>Gets the <see cref="Threading.Tasks.Task"/> for this builder.</summary> 70/// <returns>The <see cref="Threading.Tasks.Task"/> representing the builder's asynchronous operation.</returns> 72public Task Task 91/// Completes the <see cref="Threading.Tasks.Task"/> in the 102m_task = Task.s_cachedCompleted; 112/// Completes the <see cref="Threading.Tasks.Task"/> in the
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (5)
77Threading.Tasks.Task.ThrowAsync(e, targetContext: null); 140Threading.Tasks.Task.ThrowAsync(e, targetContext: null); 160Threading.Tasks.Task.ThrowAsync(e, targetContext: null); 277Threading.Tasks.Task.AddToActiveTasks(box); 649m_task = Threading.Tasks.Task.FromResult(result);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncVoidMethodBuilder.cs (4)
130Task.ThrowAsync(exception, targetContext: context); 142Task.ThrowAsync(exception, targetContext: null); 161Task.ThrowAsync(exc, targetContext: null); 166private Task Task => _builder.Task;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConfiguredValueTaskAwaitable.cs (13)
16/// <summary>The wrapped <see cref="Task"/>.</summary> 55Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 57if (obj is Task t) 69Task.CompletedTask.ConfigureAwait(_value._continueOnCapturedContext).GetAwaiter().OnCompleted(continuation); 77Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 79if (obj is Task t) 90Task.CompletedTask.ConfigureAwait(_value._continueOnCapturedContext).GetAwaiter().UnsafeOnCompleted(continuation); 97Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 99if (obj is Task t) 118TaskAwaiter.UnsafeOnCompletedInternal(Task.CompletedTask, box, _value._continueOnCapturedContext); 182Task.CompletedTask.ConfigureAwait(_value._continueOnCapturedContext).GetAwaiter().OnCompleted(continuation); 203Task.CompletedTask.ConfigureAwait(_value._continueOnCapturedContext).GetAwaiter().UnsafeOnCompleted(continuation); 231TaskAwaiter.UnsafeOnCompletedInternal(Task.CompletedTask, box, _value._continueOnCapturedContext);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (1)
131Threading.Tasks.Task.ThrowAsync(e, targetContext: null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs (37)
19/// <summary>Provides an awaiter for awaiting a <see cref="Task"/>.</summary> 26internal readonly Task m_task; 29/// <param name="task">The <see cref="Task"/> to be awaited.</param> 30internal TaskAwaiter(Task task) 41/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 51/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 61/// <summary>Ends the await on the completed <see cref="Task"/>.</summary> 79internal static void ValidateEnd(Task task, ConfigureAwaitOptions options = ConfigureAwaitOptions.None) 98private static void HandleNonSuccessAndDebuggerNotification(Task task, ConfigureAwaitOptions options) 127private static void ThrowForNonSuccess(Task task) 166/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 174internal static void OnCompletedInternal(Task task, Action continuation, bool continueOnCapturedContext, bool flowExecutionContext) 192/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 196internal static void UnsafeOnCompletedInternal(Task task, IAsyncStateMachineBox stateMachineBox, bool continueOnCapturedContext) 243private static Action OutputWaitEtwEvents(Task task, Action continuation) 248if (Task.s_asyncDebuggingEnabled) 250Task.AddToActiveTasks(task); 258Task? currentTaskAtBegin = Task.InternalCurrent; 261Task? continuationTask = AsyncMethodBuilderCore.TryGetContinuationTask(continuation); 276if (Task.s_asyncDebuggingEnabled) 278Task.RemoveFromActiveTasks(innerTask); 288Task? currentTaskAtEnd = Task.InternalCurrent; 335/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 345/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 382/// <summary>Provides an awaitable object that allows for configured awaits on <see cref="Task"/>.</summary> 390/// <param name="task">The awaitable <see cref="Task"/>.</param> 392internal ConfiguredTaskAwaitable(Task task, ConfigureAwaitOptions options) 413internal readonly Task m_task; 418/// <param name="task">The <see cref="Task"/> to await.</param> 420internal ConfiguredTaskAwaiter(Task task, ConfigureAwaitOptions options) 433/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 443/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 453/// <summary>Ends the await on the completed <see cref="Task"/>.</summary> 515/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary> 525/// <summary>Schedules the continuation onto the <see cref="Task"/> associated with this <see cref="TaskAwaiter"/>.</summary>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ValueTaskAwaiter.cs (12)
50Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 52if (obj is Task t) 62Task.CompletedTask.GetAwaiter().OnCompleted(continuation); 70Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 72if (obj is Task t) 82Task.CompletedTask.GetAwaiter().UnsafeOnCompleted(continuation); 89Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 91if (obj is Task t) 109TaskAwaiter.UnsafeOnCompletedInternal(Task.CompletedTask, box, continueOnCapturedContext: true); 152Task.CompletedTask.GetAwaiter().OnCompleted(continuation); 172Task.CompletedTask.GetAwaiter().UnsafeOnCompleted(continuation); 199TaskAwaiter.UnsafeOnCompletedInternal(Task.CompletedTask, box, continueOnCapturedContext: true);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\YieldAwaitable.cs (2)
111Task.Factory.StartNew(continuation, default, TaskCreationOptions.PreferFairness, scheduler); 152Task.Factory.StartNew(static s => ((IAsyncStateMachineBox)s!).MoveNext(), box, default, TaskCreationOptions.PreferFairness, scheduler);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (2)
280public override Task FlushAsync(CancellationToken cancellationToken) 536public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (6)
292/// with the returned <see cref="Task"/> representing their eventual completion. 305public Task CancelAsync() 309return Task.FromException(new ObjectDisposedException(GetType().FullName, SR.CancellationTokenSource_Disposed)); 343return Task.Factory.StartNew(s => 354return Task.CompletedTask; 1151await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (7)
515public Task WaitAsync() 531public Task WaitAsync(CancellationToken cancellationToken) 679return Task.FromCanceled<bool>(cancellationToken); 688return Task.FromResult(true); 693return Task.FromResult(false); 772await ((Task)asyncWaiter.WaitAsync( 781await Task.CompletedTask.ConfigureAwait(ConfigureAwaitOptions.ForceYielding);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (23)
143/// <summary>Gets a <see cref="Task"/> that will complete when the scheduler has completed processing.</summary> 144public Task Completion => EnsureCompletionStateInitialized(); 228private void FaultWithTask(Task faultedTask) 284Task? processingTask = null; 303FaultWithTask(processingTask ?? Task.FromException(e)); 330FaultWithTask(processingTask ?? Task.FromException(e)); 378if (!m_exclusiveTaskScheduler.m_tasks.TryDequeue(out Task? exclusiveTask)) break; 425if (!m_concurrentTaskScheduler.m_tasks.TryDequeue(out Task? concurrentTask)) break; 516internal readonly IProducerConsumerQueue<Task> m_tasks; 536(IProducerConsumerQueue<Task>)new SingleProducerSingleConsumerQueue<Task>() : 537(IProducerConsumerQueue<Task>)new MultiProducerMultiConsumerQueue<Task>(); 545protected internal override void QueueTask(Task task) 561internal void ExecuteTask(Task task) 571protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) 623private bool TryExecuteTaskInlineOnTargetScheduler(Task task) 637var tuple = (TupleSlim<ConcurrentExclusiveTaskScheduler, Task>)s!; 639}, new TupleSlim<ConcurrentExclusiveTaskScheduler, Task>(this, task)); 656protected override IEnumerable<Task> GetScheduledTasks() { return m_tasks; } 678public IEnumerable<Task> ScheduledTasks => m_taskScheduler.m_tasks; 701public IEnumerable<Task> ScheduledExclusive => m_pair.m_exclusiveTaskScheduler.m_tasks; 703public IEnumerable<Task> ScheduledConcurrent => m_pair.m_concurrentTaskScheduler.m_tasks;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConfigureAwaitOptions.cs (10)
12/// <see cref="Task.ConfigureAwait(ConfigureAwaitOptions)"/> with a <see cref="None"/> argument behaves 13/// identically to using <see cref="Task.ConfigureAwait(bool)"/> with a <see langword="false"/> argument. 24/// <see cref="Task.ConfigureAwait(ConfigureAwaitOptions)"/> with a <see cref="ContinueOnCapturedContext"/> argument 25/// behaves identically to using <see cref="Task.ConfigureAwait(bool)"/> with a <see langword="true"/> argument. 30/// Avoids throwing an exception at the completion of awaiting a <see cref="Task"/> that ends 34/// This option is supported only for <see cref="Task.ConfigureAwait(ConfigureAwaitOptions)"/>, 37/// cast to the base <see cref="Task"/> type in order to use its <see cref="Task.ConfigureAwait(ConfigureAwaitOptions)"/>. 42/// Forces an await on an already completed <see cref="Task"/> to behave as if the <see cref="Task"/>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Sources\ManualResetValueTaskSourceCore.cs (1)
328Task.Factory.StartNew(continuation, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, scheduler);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task_T.cs (45)
48/// <see cref="Task.Start()">Start</see> 53/// <see cref="Task.Dispose()">Dispose</see>, are thread-safe 284internal Task(Func<TResult> valueSelector, Task? parent, CancellationToken cancellationToken, 300internal Task(Delegate valueSelector, object? state, Task? parent, CancellationToken cancellationToken, 308internal static Task<TResult> StartNew(Task? parent, Func<TResult> function, CancellationToken cancellationToken, 328internal static Task<TResult> StartNew(Task? parent, Func<object?, TResult> function, object? state, CancellationToken cancellationToken, 518/// <summary>Configures an awaiter used to await this <see cref="Task"/>.</summary> 549/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 557/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 567/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 576/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 618/// <returns>A new continuation <see cref="Task"/>.</returns> 620/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 627public Task ContinueWith(Action<Task<TResult>> continuationAction) 641/// <returns>A new continuation <see cref="Task"/>.</returns> 643/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 650public Task ContinueWith(Action<Task<TResult>> continuationAction, CancellationToken cancellationToken) 666/// <returns>A new continuation <see cref="Task"/>.</returns> 668/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 678public Task ContinueWith(Action<Task<TResult>> continuationAction, TaskScheduler scheduler) 697/// <returns>A new continuation <see cref="Task"/>.</returns> 699/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 711public Task ContinueWith(Action<Task<TResult>> continuationAction, TaskContinuationOptions continuationOptions) 735/// <returns>A new continuation <see cref="Task"/>.</returns> 737/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 751public Task ContinueWith(Action<Task<TResult>> continuationAction, CancellationToken cancellationToken, 758internal Task ContinueWith(Action<Task<TResult>> continuationAction, TaskScheduler scheduler, CancellationToken cancellationToken, 776Task continuationTask = new ContinuationTaskFromResultTask<TResult>( 799/// <returns>A new continuation <see cref="Task"/>.</returns> 801/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 808public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state) 823/// <returns>A new continuation <see cref="Task"/>.</returns> 825/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 832public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, CancellationToken cancellationToken) 849/// <returns>A new continuation <see cref="Task"/>.</returns> 851/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 861public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, TaskScheduler scheduler) 881/// <returns>A new continuation <see cref="Task"/>.</returns> 883/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 895public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, TaskContinuationOptions continuationOptions) 920/// <returns>A new continuation <see cref="Task"/>.</returns> 922/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 936public Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, CancellationToken cancellationToken, 943internal Task ContinueWith(Action<Task<TResult>, object?> continuationAction, object? state, TaskScheduler scheduler, CancellationToken cancellationToken, 961Task continuationTask = new ContinuationTaskFromResultTask<TResult>(
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (441)
25/// Represents the current stage in the lifecycle of a <see cref="Task"/>. 71/// <see cref="Task"/> instances may be created in a variety of ways. The most common approach is by 74/// purposes. For example, to create a <see cref="Task"/> that runs an action, the factory's StartNew 85/// The <see cref="Task"/> class also provides constructors that initialize the Task but that do not 92/// All members of <see cref="Task"/>, except for <see cref="Dispose()"/>, are thread-safe 117internal static Task? t_currentTask; // The currently executing task. 131private Task? ParentForDebugger => m_contingentProperties?.m_parent; // Private property used by a debugger to access this Task's parent 182private static Dictionary<int, Task>? s_currentActiveTasks; 193internal static bool AddToActiveTasks(Task task) 197Dictionary<int, Task> activeTasks = 199Interlocked.CompareExchange(ref s_currentActiveTasks, new Dictionary<int, Task>(), null) ?? 211internal static void RemoveFromActiveTasks(Task task) 213Dictionary<int, Task>? activeTasks = s_currentActiveTasks; 300internal static void UpdateRuntimeAsyncTaskTimestamp(Task task, Continuation timestampSource) 324internal static void RemoveRuntimeAsyncTask(Task task) 338internal static void RemoveRuntimeAsyncTask(Task task, Continuation continuationChain) 388internal volatile List<Task>? m_exceptionalChildren; 390internal Task? m_parent; 485Task? parent = InternalCurrent; 496/// Initializes a new <see cref="Task"/> with the specified action. 506/// Initializes a new <see cref="Task"/> with the specified action and <see cref="Threading.CancellationToken">CancellationToken</see>. 521/// Initializes a new <see cref="Task"/> with the specified action and creation options. 541/// Initializes a new <see cref="Task"/> with the specified action and creation options. 565/// Initializes a new <see cref="Task"/> with the specified action and state. 578/// Initializes a new <see cref="Task"/> with the specified action, state, and options. 595/// Initializes a new <see cref="Task"/> with the specified action, state, and options. 616/// Initializes a new <see cref="Task"/> with the specified action, state, and options. 650internal Task(Delegate action, object? state, Task? parent, CancellationToken cancellationToken, 730Task? parent = props.m_parent; 753private void AssignCancellationToken(CancellationToken cancellationToken, Task? antecedent, TaskContinuation? continuation) 781ctr = cancellationToken.UnsafeRegister(static t => ((Task)t!).InternalCancel(), this); 792var tuple = (TupleSlim<Task, Task, TaskContinuation>)t!; 794Task targetTask = tuple.Item1; 795Task antecedentTask = tuple.Item2; 799}, new TupleSlim<Task, Task, TaskContinuation>(this, antecedent, continuation)); 810Task? parent = m_contingentProperties?.m_parent; 922internal static bool AnyTaskRequiresNotifyDebuggerOfWaitCompletion(Task?[] tasks) 925foreach (Task? task in tasks) 1003Task? currentTask = InternalCurrent; 1004Task? parentTask = m_contingentProperties?.m_parent; 1050/// Starts the <see cref="Task"/>, scheduling it for execution to the current <see 1058/// The <see cref="Task"/> is not in a valid state to be started. It may have already been started, 1068/// Starts the <see cref="Task"/>, scheduling it for execution to the specified <see 1083/// The <see cref="Task"/> is not in a valid state to be started. It may have already been started, 1124/// Runs the <see cref="Task"/> synchronously on the current <see 1143/// The <see cref="Task"/> is not in a valid state to be started. It may have already been started, 1153/// Runs the <see cref="Task"/> synchronously on the <see 1168/// The <see cref="Task"/> is not in a valid state to be started. It may have already been started, 1289internal static Task InternalStartNew( 1290Task? creatingTask, Delegate action, object? state, CancellationToken cancellationToken, TaskScheduler scheduler, 1301Task t = new Task(action, state, creatingTask, cancellationToken, options, internalOptions | InternalTaskOptions.QueuedByRuntime, scheduler); 1308/// Gets a unique ID for a <see cref="Task">Task</see> or task continuation instance. 1332/// Gets a unique ID for this <see cref="Task">Task</see> instance. 1353/// Returns the unique ID of the currently executing <see cref="Task">Task</see>. 1359Task? currentTask = InternalCurrent; 1368/// Gets the <see cref="Task">Task</see> instance currently executing, or 1371internal static Task? InternalCurrent => t_currentTask; 1379internal static Task? InternalCurrentIfAttached(TaskCreationOptions creationOptions) 1386/// cref="Task">Task</see> to end prematurely. If the <see 1387/// cref="Task">Task</see> completed successfully or has not yet thrown any 1442/// Gets whether this <see cref="Task">Task</see> instance has completed 1446/// A <see cref="Task">Task</see> will complete in Canceled state either if its <see cref="CancellationToken">CancellationToken</see> 1510/// Gets whether this <see cref="Task"/> threw an OperationCanceledException while its CancellationToken was signaled. 1515/// Gets whether this <see cref="Task">Task</see> has completed. 1569/// The <see cref="Task"/> has been disposed. 1587/// Gets the state object supplied when the <see cref="Task">Task</see> was created, 1604/// Provides access to factory methods for creating <see cref="Task"/> and <see cref="Task{TResult}"/> instances. 1618public static Task CompletedTask 1667/// Gets whether the <see cref="Task"/> completed due to an unhandled exception. 1716/// Disposes the <see cref="Task"/>, releasing all of its unmanaged resources. 1719/// Unlike most of the members of <see cref="Task"/>, this method is not thread-safe. 1720/// Also, <see cref="Dispose()"/> may only be called on a <see cref="Task"/> that is in one of 1726/// The exception that is thrown if the <see cref="Task"/> is not in 1738/// Disposes the <see cref="Task"/>, releasing all of its unmanaged resources. 1745/// Unlike most of the members of <see cref="Task"/>, this method is not thread-safe. 2097Task? parent = m_contingentProperties?.m_parent; 2180List<Task>? exceptionalChildren = props.m_exceptionalChildren; 2292Task? parent = m_contingentProperties?.m_parent; 2304internal void ProcessChildCompletion(Task childTask) 2319Interlocked.CompareExchange(ref props.m_exceptionalChildren, new List<Task>(), null); 2326List<Task>? tmp = props.m_exceptionalChildren; 2357List<Task>? exceptionalChildren = props.m_exceptionalChildren; 2365foreach (Task task in exceptionalChildren) 2455private void ExecuteWithThreadLocal(ref Task? currentTaskSlot, Thread? threadPoolThread = null) 2458Task? previousTask = currentTaskSlot; 2536Debug.Assert(obj is Task); 2538Unsafe.As<Task>(obj).InnerInvoke(); 2592/// <summary>Gets an awaiter used to await this <see cref="Task"/>.</summary> 2599/// <summary>Configures an awaiter used to await this <see cref="Task"/>.</summary> 2610/// <summary>Configures an awaiter used to await this <see cref="Task"/>.</summary> 2628/// Sets a continuation onto the <see cref="Task"/>. 2632/// <param name="continuationAction">The action to invoke when the <see cref="Task"/> has completed.</param> 2701/// Sets a continuation onto the <see cref="Task"/>. 2705/// <param name="stateMachineBox">The action to invoke when the <see cref="Task"/> has completed.</param> 2771/// Waits for the <see cref="Task"/> to complete execution. 2774/// The <see cref="Task"/> was canceled -or- an exception was thrown during 2775/// the execution of the <see cref="Task"/>. 2790/// Waits for the <see cref="Task"/> to complete execution. 2797/// true if the <see cref="Task"/> completed execution within the allotted time; otherwise, false. 2800/// The <see cref="Task"/> was canceled -or- an exception was thrown during the execution of the <see 2801/// cref="Task"/>. 2811/// Waits for the <see cref="Task"/> to complete execution. 2818/// true if the <see cref="Task"/> completed execution within the allotted time; otherwise, false. 2821/// The <see cref="Task"/> was canceled -or- an exception was thrown during the execution of the <see 2822/// cref="Task"/>. 2845/// Waits for the <see cref="Task"/> to complete execution. 2854/// The <see cref="Task"/> was canceled -or- an exception was thrown during the execution of the <see 2855/// cref="Task"/>. 2863/// Waits for the <see cref="Task"/> to complete execution. 2868/// <returns>true if the <see cref="Task"/> completed execution within the allotted time; otherwise, 2876/// The <see cref="Task"/> was canceled -or- an exception was thrown during the execution of the <see 2877/// cref="Task"/>. 2885/// Waits for the <see cref="Task"/> to complete execution. 2895/// true if the <see cref="Task"/> completed execution within the allotted time; otherwise, false. 2898/// The <see cref="Task"/> was canceled -or- an exception was thrown during the execution of the <see 2899/// cref="Task"/>. 2946/// <summary>Gets a <see cref="Task"/> that will complete when this <see cref="Task"/> completes or when the specified <see cref="CancellationToken"/> has cancellation requested.</summary> 2948/// <returns>The <see cref="Task"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns> 2949public Task WaitAsync(CancellationToken cancellationToken) => WaitAsync(Timeout.UnsignedInfinite, TimeProvider.System, cancellationToken); 2951/// <summary>Gets a <see cref="Task"/> that will complete when this <see cref="Task"/> completes or when the specified timeout expires.</summary> 2952/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 2953/// <returns>The <see cref="Task"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns> 2954public Task WaitAsync(TimeSpan timeout) => WaitAsync(ValidateTimeout(timeout, ExceptionArgument.timeout), TimeProvider.System, default); 2956/// <summary>Gets a <see cref="Task"/> that will complete when this <see cref="Task"/> completes or when the specified timeout expires.</summary> 2957/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 2959/// <returns>The <see cref="Task"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns> 2961public Task WaitAsync(TimeSpan timeout, TimeProvider timeProvider) 2967/// <summary>Gets a <see cref="Task"/> that will complete when this <see cref="Task"/> completes, when the specified timeout expires, or when the specified <see cref="CancellationToken"/> has cancellation requested.</summary> 2968/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 2970/// <returns>The <see cref="Task"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns> 2971public Task WaitAsync(TimeSpan timeout, CancellationToken cancellationToken) => 2974/// <summary>Gets a <see cref="Task"/> that will complete when this <see cref="Task"/> completes, when the specified timeout expires, or when the specified <see cref="CancellationToken"/> has cancellation requested.</summary> 2975/// <param name="timeout">The timeout after which the <see cref="Task"/> should be faulted with a <see cref="TimeoutException"/> if it hasn't otherwise completed.</param> 2978/// <returns>The <see cref="Task"/> representing the asynchronous wait. It may or may not be the same instance as the current instance.</returns> 2980public Task WaitAsync(TimeSpan timeout, TimeProvider timeProvider, CancellationToken cancellationToken) 2986private Task WaitAsync(uint millisecondsTimeout, TimeProvider timeProvider, CancellationToken cancellationToken) 3010private readonly Task _task; 3016internal CancellationPromise(Task source, uint millisecondsDelay, TimeProvider timeProvider, CancellationToken token) 3071void ITaskCompletionAction.Invoke(Task completingTask) 3137Task? currentTask = InternalCurrent; 3170Task? currentTask = InternalCurrent; 3199public void Invoke(Task completingTask) { Set(); } 3324/// Cancels the <see cref="Task"/>. 3810/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3813/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 3816/// <returns>A new continuation <see cref="Task"/>.</returns> 3818/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 3825public Task ContinueWith(Action<Task> continuationAction) 3831/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3834/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 3838/// <returns>A new continuation <see cref="Task"/>.</returns> 3840/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 3847public Task ContinueWith(Action<Task> continuationAction, CancellationToken cancellationToken) 3853/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3856/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 3862/// <returns>A new continuation <see cref="Task"/>.</returns> 3864/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 3874public Task ContinueWith(Action<Task> continuationAction, TaskScheduler scheduler) 3880/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3883/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 3893/// <returns>A new continuation <see cref="Task"/>.</returns> 3895/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 3907public Task ContinueWith(Action<Task> continuationAction, TaskContinuationOptions continuationOptions) 3913/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3916/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 3931/// <returns>A new continuation <see cref="Task"/>.</returns> 3933/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 3947public Task ContinueWith(Action<Task> continuationAction, CancellationToken cancellationToken, 3954private Task ContinueWith(Action<Task> continuationAction, TaskScheduler scheduler, 3971Task continuationTask = new ContinuationTaskFromTask( 3987/// Creates a continuation that executes when the target <see cref="Task"/> completes. 3990/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 3994/// <returns>A new continuation <see cref="Task"/>.</returns> 3996/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 4003public Task ContinueWith(Action<Task, object?> continuationAction, object? state) 4009/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4012/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 4017/// <returns>A new continuation <see cref="Task"/>.</returns> 4019/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 4026public Task ContinueWith(Action<Task, object?> continuationAction, object? state, CancellationToken cancellationToken) 4032/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4035/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 4042/// <returns>A new continuation <see cref="Task"/>.</returns> 4044/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 4054public Task ContinueWith(Action<Task, object?> continuationAction, object? state, TaskScheduler scheduler) 4060/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4063/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 4074/// <returns>A new continuation <see cref="Task"/>.</returns> 4076/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 4088public Task ContinueWith(Action<Task, object?> continuationAction, object? state, TaskContinuationOptions continuationOptions) 4094/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4097/// An action to run when the <see cref="Task"/> completes. When run, the delegate will be 4113/// <returns>A new continuation <see cref="Task"/>.</returns> 4115/// The returned <see cref="Task"/> will not be scheduled for execution until the current task has 4129public Task ContinueWith(Action<Task, object?> continuationAction, object? state, CancellationToken cancellationToken, 4136private Task ContinueWith(Action<Task, object?> continuationAction, object? state, TaskScheduler scheduler, 4153Task continuationTask = new ContinuationTaskFromTask( 4170/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4176/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4188public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction) 4195/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4201/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4217public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, CancellationToken cancellationToken) 4223/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4229/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4247public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler) 4253/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4259/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4283public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions) 4289/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4295/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4329public Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, CancellationToken cancellationToken, 4336private Task<TResult> ContinueWith<TResult>(Func<Task, TResult> continuationFunction, TaskScheduler scheduler, 4369/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4375/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4388public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state) 4395/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4401/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4418public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, CancellationToken cancellationToken) 4424/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4430/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4449public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskScheduler scheduler) 4455/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4461/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4486public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskContinuationOptions continuationOptions) 4492/// Creates a continuation that executes when the target <see cref="Task"/> completes. 4498/// A function to run when the <see cref="Task"/> completes. When run, the delegate will be 4533public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, CancellationToken cancellationToken, 4540private Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continuationFunction, object? state, TaskScheduler scheduler, 4633internal void ContinueWithCore(Task continuationTask, 4873/// Waits for all of the provided <see cref="Task"/> objects to complete execution. 4876/// An array of <see cref="Task"/> instances on which to wait. 4885/// At least one of the <see cref="Task"/> instances was canceled -or- an exception was thrown during 4886/// the execution of at least one of the <see cref="Task"/> instances. 4890public static void WaitAll(params Task[] tasks) 4902/// Waits for all of the provided <see cref="Task"/> objects to complete execution. 4905/// An array of <see cref="Task"/> instances on which to wait. 4911/// At least one of the <see cref="Task"/> instances was canceled -or- an exception was thrown during 4912/// the execution of at least one of the <see cref="Task"/> instances. 4915public static void WaitAll(params ReadOnlySpan<Task> tasks) 4922/// Waits for all of the provided <see cref="Task"/> objects to complete execution. 4925/// true if all of the <see cref="Task"/> instances completed execution within the allotted time; 4929/// An array of <see cref="Task"/> instances on which to wait. 4942/// At least one of the <see cref="Task"/> instances was canceled -or- an exception was thrown during 4943/// the execution of at least one of the <see cref="Task"/> instances. 4952public static bool WaitAll(Task[] tasks, TimeSpan timeout) 4969/// Waits for all of the provided <see cref="Task"/> objects to complete execution. 4972/// true if all of the <see cref="Task"/> instances completed execution within the allotted time; 4978/// <param name="tasks">An array of <see cref="Task"/> instances on which to wait. 4987/// At least one of the <see cref="Task"/> instances was canceled -or- an exception was thrown during 4988/// the execution of at least one of the <see cref="Task"/> instances. 4996public static bool WaitAll(Task[] tasks, int millisecondsTimeout) 5007/// Waits for all of the provided <see cref="Task"/> objects to complete execution. 5010/// An array of <see cref="Task"/> instances on which to wait. 5022/// At least one of the <see cref="Task"/> instances was canceled -or- an exception was thrown during 5023/// the execution of at least one of the <see cref="Task"/> instances. 5030public static void WaitAll(Task[] tasks, CancellationToken cancellationToken) 5041/// Waits for all of the provided <see cref="Task"/> objects to complete execution. 5044/// true if all of the <see cref="Task"/> instances completed execution within the allotted time; 5048/// An array of <see cref="Task"/> instances on which to wait. 5064/// At least one of the <see cref="Task"/> instances was canceled -or- an exception was thrown during 5065/// the execution of at least one of the <see cref="Task"/> instances. 5076public static bool WaitAll(Task[] tasks, int millisecondsTimeout, CancellationToken cancellationToken) 5086/// <summary>Waits for all of the provided <see cref="Task"/> objects to complete execution unless the wait is cancelled.</summary> 5091/// <exception cref="ObjectDisposedException">One or more of the <see cref="Task"/> objects in tasks has been disposed.</exception> 5094/// At least one of the <see cref="Task"/> instances was canceled. If a task was canceled, the <see cref="AggregateException"/> 5098public static void WaitAll(IEnumerable<Task> tasks, CancellationToken cancellationToken = default) 5105ReadOnlySpan<Task> span = 5106tasks is List<Task> list ? CollectionsMarshal.AsSpan(list) : 5107tasks is Task[] array ? array : 5108CollectionsMarshal.AsSpan(new List<Task>(tasks)); 5116private static bool WaitAllCore(ReadOnlySpan<Task> tasks, int millisecondsTimeout, CancellationToken cancellationToken) 5132List<Task>? waitedOnTaskList = null; 5133List<Task>? notificationTasks = null; 5143Task task = tasks[i]; 5189foreach (Task task in waitedOnTaskList) 5206foreach (Task task in notificationTasks) 5223foreach (Task task in tasks) AddExceptionsForCompletedTask(ref exceptions, task); 5248private static bool WaitAllBlockingCore(List<Task> tasks, int millisecondsTimeout, CancellationToken cancellationToken) 5259foreach (Task task in tasks) 5269foreach (Task task in tasks) 5303public void Invoke(Task completingTask) 5317internal static void AddExceptionsForCompletedTask(ref List<Exception>? exceptions, Task t) 5333/// Waits for any of the provided <see cref="Task"/> objects to complete execution. 5336/// An array of <see cref="Task"/> instances on which to wait. 5346public static int WaitAny(params Task[] tasks) 5354/// Waits for any of the provided <see cref="Task"/> objects to complete execution. 5357/// An array of <see cref="Task"/> instances on which to wait. 5379public static int WaitAny(Task[] tasks, TimeSpan timeout) 5391/// Waits for any of the provided <see cref="Task"/> objects to complete execution. 5394/// An array of <see cref="Task"/> instances on which to wait. 5412public static int WaitAny(Task[] tasks, CancellationToken cancellationToken) 5418/// Waits for any of the provided <see cref="Task"/> objects to complete execution. 5421/// An array of <see cref="Task"/> instances on which to wait. 5442public static int WaitAny(Task[] tasks, int millisecondsTimeout) 5448/// Waits for any of the provided <see cref="Task"/> objects to complete execution. 5451/// An array of <see cref="Task"/> instances on which to wait. 5478public static int WaitAny(Task[] tasks, int millisecondsTimeout, CancellationToken cancellationToken) => 5483private static int WaitAnyCore(Task[] tasks, int millisecondsTimeout, CancellationToken cancellationToken) 5503Task task = tasks[taskIndex]; 5522Task<Task> firstCompleted = TaskFactory.CommonCWAnyLogic(tasks, isSyncBlocking: true); 5608public static Task FromException(Exception exception) 5612var task = new Task(); 5632/// <summary>Creates a <see cref="Task"/> that's completed due to cancellation with the specified token.</summary> 5635public static Task FromCanceled(CancellationToken cancellationToken) 5653/// <summary>Creates a <see cref="Task"/> that's completed due to cancellation with the specified exception.</summary> 5656internal static Task FromCanceled(OperationCanceledException exception) 5660var task = new Task(); 5692public static Task Run(Action action) 5710public static Task Run(Action action, CancellationToken cancellationToken) 5757public static Task Run(Func<Task?> function) 5775public static Task Run(Func<Task?> function, CancellationToken cancellationToken) 5784Task<Task?> task1 = Task<Task?>.Factory.StartNew(function, cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); 5852public static Task Delay(TimeSpan delay) => Delay(delay, TimeProvider.System, default); 5861public static Task Delay(TimeSpan delay, TimeProvider timeProvider) => Delay(delay, timeProvider, default); 5881public static Task Delay(TimeSpan delay, CancellationToken cancellationToken) => 5892public static Task Delay(TimeSpan delay, TimeProvider timeProvider, CancellationToken cancellationToken) 5909public static Task Delay(int millisecondsDelay) => Delay(millisecondsDelay, default); 5929public static Task Delay(int millisecondsDelay, CancellationToken cancellationToken) 5940private static Task Delay(uint millisecondsDelay, TimeProvider timeProvider, CancellationToken cancellationToken) => 6096public static Task WhenAll(IEnumerable<Task> tasks) 6104if (tasks is ICollection<Task> taskCollection) 6106if (tasks is Task[] taskArray) 6108return WhenAll((ReadOnlySpan<Task>)taskArray); 6111if (tasks is List<Task> taskList) 6121ValueListBuilder<Task> builder = count is > 8 ? 6122new ValueListBuilder<Task>(count.Value) : 6123new ValueListBuilder<Task>([null, null, null, null, null, null, null, null]); 6124foreach (Task task in tasks) 6129Task t = WhenAll(builder.AsSpan()); 6162public static Task WhenAll(params Task[] tasks) 6169return WhenAll((ReadOnlySpan<Task>)tasks); 6194        public static Task WhenAll(params ReadOnlySpan<Task> tasks) 6202Task t = tasks[0]; 6220internal WhenAllPromise(ReadOnlySpan<Task> tasks) 6231foreach (Task task in tasks) 6251foreach (Task task in tasks) 6264public void Invoke(Task? completedTask) 6288if (failedOrCanceled is List<Task> list) 6298Debug.Assert(failedOrCanceled is Task, $"Expected Task, got {failedOrCanceled}"); 6299Task first = (Task)failedOrCanceled; 6300failedOrCanceled = Interlocked.CompareExchange(ref m_stateObject, new List<Task> { first, completedTask }, first); 6307Debug.Assert(failedOrCanceled is List<Task>); 6336Task? canceledTask = null; 6338void HandleTask(Task task) 6353if (failedOrCanceled is List<Task> list) 6355foreach (Task task in list) 6362Debug.Assert(failedOrCanceled is Task); 6363HandleTask((Task)failedOrCanceled); 6595public void Invoke(Task ignored) 6606Task? canceledTask = null; 6692public static Task<Task> WhenAny(params Task[] tasks) 6696return WhenAnyCore((ReadOnlySpan<Task>)tasks); 6711public static Task<Task> WhenAny(params ReadOnlySpan<Task> tasks) => 6726private static Task<TTask> WhenAnyCore<TTask>(ReadOnlySpan<TTask> tasks) where TTask : Task 6764public static Task<Task> WhenAny(Task task1, Task task2) => 6765WhenAny<Task>(task1, task2); 6778private static Task<TTask> WhenAny<TTask>(TTask task1, TTask task2) where TTask : Task 6795private sealed class TwoTaskWhenAnyPromise<TTask> : Task<TTask>, ITaskCompletionAction where TTask : Task 6830public void Invoke(Task completingTask) 6832Task? task1; 6835Task? task2 = _task2; 6884public static Task<Task> WhenAny(IEnumerable<Task> tasks) => 6885WhenAny<Task>(tasks); 6900private static Task<TTask> WhenAny<TTask>(IEnumerable<TTask> tasks) where TTask : Task 7046public static IAsyncEnumerable<Task> WhenEach(params Task[] tasks) 7049return WhenEach((ReadOnlySpan<Task>)tasks); 7052/// <inheritdoc cref="WhenEach(Task[])"/> 7054public static IAsyncEnumerable<Task> WhenEach(params ReadOnlySpan<Task> tasks) => 7055WhenEachState.Iterate<Task>(WhenEachState.Create(tasks)); 7057/// <inheritdoc cref="WhenEach(Task[])"/> 7059public static IAsyncEnumerable<Task> WhenEach(IEnumerable<Task> tasks) => 7060WhenEachState.Iterate<Task>(WhenEachState.Create(tasks)); 7062/// <inheritdoc cref="WhenEach(Task[])"/> 7071/// <inheritdoc cref="WhenEach(Task[])"/> 7075WhenEachState.Iterate<Task<TResult>>(WhenEachState.Create(ReadOnlySpan<Task>.CastUp(tasks))); 7077/// <inheritdoc cref="WhenEach(Task[])"/> 7084private sealed class WhenEachState : Queue<Task>, IValueTaskSource, ITaskCompletionAction 7100void ITaskCompletionAction.Invoke(Task completingTask) 7124public static WhenEachState? Create(ReadOnlySpan<Task> tasks) 7131foreach (Task task in tasks) 7146/// <inheritdoc cref="Create(ReadOnlySpan{Task})"/> 7147public static WhenEachState? Create(IEnumerable<Task> tasks) 7153IEnumerator<Task> e = tasks.GetEnumerator(); 7159Task task = e.Current; 7175public static async IAsyncEnumerable<T> Iterate<T>(WhenEachState? waiter, [EnumeratorCancellation] CancellationToken cancellationToken = default) where T : Task 7192Task? next; 7229internal static Task<TResult> CreateUnwrapPromise<TResult>(Task outerTask, bool lookForOce) 7261if (continuationObject is Task continuationTask) 7272return [new Action<Task>(singleCompletionAction.Invoke)]; 7299private static Task? GetActiveTaskFromId(int taskId) 7301Task? task = null; 7310private readonly Task m_completingTask; 7312internal CompletionActionInvoker(ITaskCompletionAction action, Task completingTask) 7327private readonly Task m_task; 7329public SystemThreadingTasks_TaskDebugView(Task task) 7543void Invoke(Task completingTask); 7573public UnwrapPromise(Task outerTask, bool lookForOce) 7599public void Invoke(Task completingTask) 7619private void InvokeCore(Task completingTask) 7639private void InvokeCoreAsync(Task completingTask) 7648var tuple = (TupleSlim<UnwrapPromise<TResult>, Task>)state!; 7650}, new TupleSlim<UnwrapPromise<TResult>, Task>(this, completingTask)); 7655private void ProcessCompletedOuterTask(Task task) 7676taskOfTaskOfTResult.Result : ((Task<Task>)task).Result); 7685private bool TrySetFromTask(Task task, bool lookForOce) 7732private void ProcessInnerTask(Task? task)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskAsyncEnumerableExtensions.cs (1)
9/// <summary>Provides a set of static methods for configuring <see cref="Task"/>-related behaviors on asynchronous enumerables and disposables.</summary>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs (1)
11/// <summary>Provides a set of static methods for configuring <see cref="Task"/>-related behaviors on asynchronous enumerables and disposables.</summary>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCanceledException.cs (4)
26private readonly Task? _canceledTask; // The task which has been canceled. 69/// with a reference to the <see cref="Tasks.Task"/> that has been canceled. 72public TaskCanceledException(Task? task) : 98public Task? Task => _canceledTask;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCompletionSource.cs (39)
9/// Represents the producer side of a <see cref="Tasks.Task"/> unbound to a 10/// delegate, providing access to the consumer side through the <see cref="Tasks.Task"/> property. 14/// It is often the case that a <see cref="Tasks.Task"/> is desired to 31private readonly Task _task; 38/// The <see cref="Tasks.Task"/> created by this instance and accessible through its <see cref="Task"/> property 41/// <param name="creationOptions">The options to use when creating the underlying <see cref="Tasks.Task"/>.</param> 53/// <see cref="Tasks.Task"/>'s AsyncState.</param> 60/// <param name="creationOptions">The options to use when creating the underlying <see cref="Tasks.Task"/>.</param> 61/// <param name="state">The state to use as the underlying <see cref="Tasks.Task"/>'s AsyncState.</param> 67/// Gets the <see cref="Tasks.Task"/> created 76public Task Task => _task; 78/// <summary>Transitions the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.Faulted"/> state.</summary> 79/// <param name="exception">The exception to bind to this <see cref="Tasks.Task"/>.</param> 82/// The underlying <see cref="Tasks.Task"/> is already in one of the three final states: 95/// <summary>Transitions the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.Faulted"/> state.</summary> 96/// <param name="exceptions">The collection of exceptions to bind to this <see cref="Tasks.Task"/>.</param> 100/// The underlying <see cref="Tasks.Task"/> is already in one of the three final states: 114/// Attempts to transition the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.Faulted"/> state. 116/// <param name="exception">The exception to bind to this <see cref="Tasks.Task"/>.</param> 119/// This operation will return false if the <see cref="Tasks.Task"/> is already in one of the three final states: 142/// Attempts to transition the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.Faulted"/> state. 144/// <param name="exceptions">The collection of exceptions to bind to this <see cref="Tasks.Task"/>.</param> 147/// This operation will return false if the <see cref="Tasks.Task"/> is already in one of the three final states: 188/// Transitions the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.RanToCompletion"/> state. 191/// The underlying <see cref="Tasks.Task"/> is already in one of the three final states: 205/// Attempts to transition the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.RanToCompletion"/> state. 209/// This operation will return false if the <see cref="Tasks.Task"/> is already in one of the three final states: 226/// Transitions the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.Canceled"/> state. 229/// The underlying <see cref="Tasks.Task"/> is already in one of the three final states: 237/// Transitions the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.Canceled"/> state 240/// <param name="cancellationToken">The cancellation token with which to cancel the <see cref="Tasks.Task"/>.</param> 242/// The underlying <see cref="Tasks.Task"/> is already in one of the three final states: 256/// Attempts to transition the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.Canceled"/> state. 260/// This operation will return false if the <see cref="Tasks.Task"/> is already in one of the three final states: 268/// Attempts to transition the underlying <see cref="Tasks.Task"/> into the <see cref="TaskStatus.Canceled"/> state. 270/// <param name="cancellationToken">The cancellation token with which to cancel the <see cref="Tasks.Task"/>.</param> 273/// This operation will return false if the <see cref="Tasks.Task"/> is already in one of the three final states: 303public void SetFromTask(Task completedTask) 322public bool TrySetFromTask(Task completedTask)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (49)
12private Task? m_antecedent; 15Task antecedent, Delegate action, object? state, TaskCreationOptions creationOptions, InternalTaskOptions internalOptions) : 18Debug.Assert(action is Action<Task> || action is Action<Task, object?>, 30Task? antecedent = m_antecedent; 40if (m_action is Action<Task> action) 46if (m_action is Action<Task, object?> actionWithState) 58private Task? m_antecedent; 61Task antecedent, Delegate function, object? state, TaskCreationOptions creationOptions, InternalTaskOptions internalOptions) : 64Debug.Assert(function is Func<Task, TResult> || function is Func<Task, object?, TResult>, 76Task? antecedent = m_antecedent; 86if (m_action is Func<Task, TResult> func) 92if (m_action is Func<Task, object?, TResult> funcWithState) 207internal abstract void Run(Task completedTask, bool canInlineContinuationTask); 214protected static void InlineIfPossibleOrElseQueue(Task task, bool needsProtection) 229task.m_stateFlags |= (int)Task.TaskStateFlags.Started; 262internal Task? m_task; 272internal ContinueWithTaskContinuation(Task task, TaskContinuationOptions options, TaskScheduler scheduler) 282if (Task.s_asyncDebuggingEnabled) 283Task.AddToActiveTasks(m_task); 289internal override void Run(Task completedTask, bool canInlineContinuationTask) 294Task? continuationTask = m_task; 341Task.ContingentProperties? cp = continuationTask.m_contingentProperties; // no need to volatile read, as we only care about the token, which is only assignable at construction 392internal sealed override void Run(Task task, bool canInlineContinuationTask) 398RunCallback(GetInvokeActionCallback(), m_action, ref Task.t_currentTask); 406m_continuationId = Task.NewId(); 409RunCallback(GetPostActionCallback(), this, ref Task.t_currentTask); 473internal sealed override void Run(Task ignored, bool canInlineContinuationTask) 507Task task = CreateTask(static state => 515Task.ThrowAsync(exception, targetContext: null); 561protected static Task CreateTask(Action<object?> action, object? state, TaskScheduler scheduler, ExecutionContext? capturedContext) 577internal override void Run(Task task, bool canInlineContinuationTask) 586RunCallback(GetInvokeActionCallback(), m_action, ref Task.t_currentTask); // any exceptions from m_action will be handled by s_callbackRunAction 593m_continuationId = Task.NewId(); 695protected void RunCallback(ContextCallback callback, object? state, ref Task? currentTask) 698Debug.Assert(currentTask == Task.t_currentTask); 702Task? prevCurrentTask = currentTask; 721Task.ThrowAsync(exception, targetContext: null); 743ref Task? currentTask = ref Task.t_currentTask; 744Task? prevCurrentTask = currentTask; 761Task.ThrowAsync(exception, targetContext: null); 779ref Task? currentTask = ref Task.t_currentTask; 780Task? prevCurrentTask = currentTask; 820Task.ThrowAsync(exception, targetContext: null); 831internal static void UnsafeScheduleAction(Action action, Task? task) 838atc.m_continuationId = Task.NewId();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExceptionHolder.cs (2)
30private readonly Task m_task; 45internal TaskExceptionHolder(Task task)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExtensions.cs (9)
6/// <summary>Provides a set of static methods for working with specific kinds of <see cref="Task"/> instances.</summary> 9/// <summary>Creates a proxy <see cref="Task"/> that represents the asynchronous operation of a <see cref="Task{Task}"/>.</summary> 11/// <returns>A <see cref="Task"/> that represents the asynchronous operation of the provided <see cref="Task{Task}"/>.</returns> 12public static Task Unwrap(this Task<Task> task) 20!task.IsCompletedSuccessfully ? Task.CreateUnwrapPromise<VoidTaskResult>(task, lookForOce: false) : 22Task.FromCanceled(new CancellationToken(true)); 36!task.IsCompletedSuccessfully ? Task.CreateUnwrapPromise<TResult>(task, lookForOce: false) : 38Task.FromCanceled<TResult>(new CancellationToken(true));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory_T.cs (82)
42private TaskScheduler GetDefaultScheduler(Task? currTask) 253/// <see cref="Task.Start()">Start</see> to schedule it for execution. 259Task? currTask = Task.InternalCurrent; 280/// <see cref="Task.Start()">Start</see> to schedule it for execution. 286Task? currTask = Task.InternalCurrent; 309/// <see cref="Task.Start()">Start</see> to schedule it for execution. 315Task? currTask = Task.InternalCurrent; 349/// <see cref="Task.Start()">Start</see> to schedule it for execution. 356Task.InternalCurrentIfAttached(creationOptions), function, cancellationToken, 374/// <see cref="Task.Start()">Start</see> to schedule it for execution. 380Task? currTask = Task.InternalCurrent; 403/// <see cref="Task.Start()">Start</see> to schedule it for execution. 409Task? currTask = Task.InternalCurrent; 434/// <see cref="Task.Start()">Start</see> to schedule it for execution. 440Task? currTask = Task.InternalCurrent; 476/// <see cref="Task.Start()">Start</see> to schedule it for execution. 482return Task<TResult>.StartNew(Task.InternalCurrentIfAttached(creationOptions), function, state, cancellationToken, 532if (Task.s_asyncDebuggingEnabled) 533Task.RemoveFromActiveTasks(promise); 654if (Task.s_asyncDebuggingEnabled) 655Task.AddToActiveTasks(promise); 660Task t = new Task(new Action<object>(delegate 670if (Task.s_asyncDebuggingEnabled) 671Task.AddToActiveTasks(t); 773if (Task.s_asyncDebuggingEnabled) 774Task.AddToActiveTasks(promise); 795if (Task.s_asyncDebuggingEnabled) 796Task.RemoveFromActiveTasks(promise); 890if (Task.s_asyncDebuggingEnabled) 891Task.AddToActiveTasks(promise); 912if (Task.s_asyncDebuggingEnabled) 913Task.RemoveFromActiveTasks(promise); 1015if (Task.s_asyncDebuggingEnabled) 1016Task.AddToActiveTasks(promise); 1037if (Task.s_asyncDebuggingEnabled) 1038Task.RemoveFromActiveTasks(promise); 1148if (Task.s_asyncDebuggingEnabled) 1149Task.AddToActiveTasks(promise); 1170if (Task.s_asyncDebuggingEnabled) 1171Task.RemoveFromActiveTasks(promise); 1327Task.CreationOptionsFromContinuationOptions(continuationOptions, out TaskCreationOptions tco, out _); 1351public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction) 1379public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction, CancellationToken cancellationToken) 1413public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction, TaskContinuationOptions continuationOptions) 1434/// cref="Task">Task</see>.</param> 1457public Task<TResult> ContinueWhenAll(Task[] tasks, Func<Task[], TResult> continuationFunction, 1651internal static Task<TResult> ContinueWhenAllImpl(Task[] tasks, 1652Func<Task[], TResult>? continuationFunction, Action<Task[]>? continuationAction, 1662Task[] tasksCopy = TaskFactory.CheckMultiContinuationTasksAndCopy(tasks); 1673Task<Task[]> starter = TaskFactory.CommonCWAllLogic(tasksCopy); 1682Debug.Assert(state is Func<Task[], TResult>); 1683return ((Func<Task[], TResult>)state)(completedTasks.Result); 1694Debug.Assert(state is Action<Task[]>); 1695((Action<Task[]>)state)(completedTasks.Result); return default!; 1721public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction) 1749public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction, CancellationToken cancellationToken) 1783public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions) 1804/// cref="Task">Task</see>.</param> 1827public Task<TResult> ContinueWhenAny(Task[] tasks, Func<Task, TResult> continuationFunction, 1973internal static Task<TResult> ContinueWhenAnyImpl(Task[] tasks, 1974Func<Task, TResult>? continuationFunction, Action<Task>? continuationAction, 1986Task<Task> starter = TaskFactory.CommonCWAnyLogic(tasks); 2002Debug.Assert(state is Func<Task, TResult>); 2003return ((Func<Task, TResult>)state)(completedTask.Result); 2013Debug.Assert(state is Action<Task>); 2014((Action<Task>)state)(completedTask.Result);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (238)
21/// <see cref="Task">Tasks</see>. 31/// <see cref="Task.Factory">Task.Factory</see> property. 45private TaskScheduler GetDefaultScheduler(Task? currTask) 263/// Creates and starts a <see cref="Task">Task</see>. 266/// <returns>The started <see cref="Task">Task</see>.</returns> 272/// <see cref="Task.Start()">Start</see> to schedule it for execution. However, 276public Task StartNew(Action action) 278Task? currTask = Task.InternalCurrent; 279return Task.InternalStartNew(currTask, action, null, m_defaultCancellationToken, GetDefaultScheduler(currTask), 284/// Creates and starts a <see cref="Task">Task</see>. 288/// <returns>The started <see cref="Task">Task</see>.</returns> 297/// <see cref="Task.Start()">Start</see> to schedule it for execution. However, 301public Task StartNew(Action action, CancellationToken cancellationToken) 303Task? currTask = Task.InternalCurrent; 304return Task.InternalStartNew(currTask, action, null, cancellationToken, GetDefaultScheduler(currTask), 309/// Creates and starts a <see cref="Task">Task</see>. 314/// <see cref="Task">Task.</see></param> 315/// <returns>The started <see cref="Task">Task</see>.</returns> 325/// <see cref="Task.Start()">Start</see> to schedule it for execution. 329public Task StartNew(Action action, TaskCreationOptions creationOptions) 331Task? currTask = Task.InternalCurrent; 332return Task.InternalStartNew(currTask, action, null, m_defaultCancellationToken, GetDefaultScheduler(currTask), creationOptions, 337/// Creates and starts a <see cref="Task">Task</see>. 340/// <param name="cancellationToken">The <see cref="CancellationToken"/> that will be assigned to the new <see cref="Task"/></param> 343/// <see cref="Task">Task.</see></param> 347/// cref="Task">Task</see>.</param> 348/// <returns>The started <see cref="Task">Task</see>.</returns> 364/// <see cref="Task.Start()">Start</see> to schedule it for execution. 368public Task StartNew(Action action, CancellationToken cancellationToken, TaskCreationOptions creationOptions, TaskScheduler scheduler) 370return Task.InternalStartNew( 371Task.InternalCurrentIfAttached(creationOptions), action, null, cancellationToken, scheduler, creationOptions, 377/// Creates and starts a <see cref="Task">Task</see>. 382/// <returns>The started <see cref="Task">Task</see>.</returns> 389/// <see cref="Task.Start()">Start</see> to schedule it for execution. 393public Task StartNew(Action<object?> action, object? state) 395Task? currTask = Task.InternalCurrent; 396return Task.InternalStartNew(currTask, action, state, m_defaultCancellationToken, GetDefaultScheduler(currTask), 402/// Creates and starts a <see cref="Task">Task</see>. 407/// <param name="cancellationToken">The <see cref="CancellationToken"/> that will be assigned to the new <see cref="Task"/></param> 408/// <returns>The started <see cref="Task">Task</see>.</returns> 418/// <see cref="Task.Start()">Start</see> to schedule it for execution. 422public Task StartNew(Action<object?> action, object? state, CancellationToken cancellationToken) 424Task? currTask = Task.InternalCurrent; 425return Task.InternalStartNew(currTask, action, state, cancellationToken, GetDefaultScheduler(currTask), 430/// Creates and starts a <see cref="Task">Task</see>. 437/// <see cref="Task">Task.</see></param> 438/// <returns>The started <see cref="Task">Task</see>.</returns> 448/// <see cref="Task.Start()">Start</see> to schedule it for execution. 452public Task StartNew(Action<object?> action, object? state, TaskCreationOptions creationOptions) 454Task? currTask = Task.InternalCurrent; 455return Task.InternalStartNew(currTask, action, state, m_defaultCancellationToken, GetDefaultScheduler(currTask), 460/// Creates and starts a <see cref="Task">Task</see>. 468/// <see cref="Task">Task.</see></param> 472/// cref="Task">Task</see>.</param> 473/// <returns>The started <see cref="Task">Task</see>.</returns> 489/// <see cref="Task.Start()">Start</see> to schedule it for execution. 493public Task StartNew(Action<object?> action, object? state, CancellationToken cancellationToken, 496return Task.InternalStartNew( 497Task.InternalCurrentIfAttached(creationOptions), action, state, cancellationToken, scheduler, 516/// <see cref="Task.Start()">Start</see> to schedule it for execution. 522Task? currTask = Task.InternalCurrent; 536/// <param name="cancellationToken">The <see cref="CancellationToken"/> that will be assigned to the new <see cref="Task"/></param> 547/// <see cref="Task.Start()">Start</see> to schedule it for execution. 553Task? currTask = Task.InternalCurrent; 579/// <see cref="Task.Start()">Start</see> to schedule it for execution. 585Task? currTask = Task.InternalCurrent; 622/// <see cref="Task.Start()">Start</see> to schedule it for execution. 629Task.InternalCurrentIfAttached(creationOptions), function, cancellationToken, 650/// <see cref="Task.Start()">Start</see> to schedule it for execution. 656Task? currTask = Task.InternalCurrent; 672/// <param name="cancellationToken">The <see cref="CancellationToken"/> that will be assigned to the new <see cref="Task"/></param> 683/// <see cref="Task.Start()">Start</see> to schedule it for execution. 689Task? currTask = Task.InternalCurrent; 717/// <see cref="Task.Start()">Start</see> to schedule it for execution. 723Task? currTask = Task.InternalCurrent; 762/// <see cref="Task.Start()">Start</see> to schedule it for execution. 770Task.InternalCurrentIfAttached(creationOptions), function, state, cancellationToken, 779/// Creates a <see cref="Task">Task</see> that executes an end method action 790/// <returns>A <see cref="Task">Task</see> that represents the asynchronous 792public Task FromAsync( 800/// Creates a <see cref="Task">Task</see> that executes an end method action 808/// created <see cref="Task">Task</see>.</param> 816/// <returns>A <see cref="Task">Task</see> that represents the asynchronous 818public Task FromAsync( 827/// Creates a <see cref="Task">Task</see> that executes an end method action 837/// created <see cref="Task">Task</see>.</param> 847/// <returns>A <see cref="Task">Task</see> that represents the asynchronous 849public Task FromAsync( 859/// Creates a <see cref="Task">Task</see> that represents a pair of begin 870/// <returns>The created <see cref="Task">Task</see> that represents the 875public Task FromAsync( 884/// Creates a <see cref="Task">Task</see> that represents a pair of begin 890/// created <see cref="Task">Task</see>.</param> 900/// <returns>The created <see cref="Task">Task</see> that represents the 905public Task FromAsync( 913/// Creates a <see cref="Task">Task</see> that represents a pair of begin 929/// <returns>The created <see cref="Task">Task</see> that represents the 934public Task FromAsync<TArg1>( 944/// Creates a <see cref="Task">Task</see> that represents a pair of begin 955/// created <see cref="Task">Task</see>.</param> 965/// <returns>The created <see cref="Task">Task</see> that represents the 970public Task FromAsync<TArg1>( 979/// Creates a <see cref="Task">Task</see> that represents a pair of begin 999/// <returns>The created <see cref="Task">Task</see> that represents the 1004public Task FromAsync<TArg1, TArg2>( 1013/// Creates a <see cref="Task">Task</see> that represents a pair of begin 1028/// created <see cref="Task">Task</see>.</param> 1038/// <returns>The created <see cref="Task">Task</see> that represents the 1043public Task FromAsync<TArg1, TArg2>( 1052/// Creates a <see cref="Task">Task</see> that represents a pair of begin 1076/// <returns>The created <see cref="Task">Task</see> that represents the 1081public Task FromAsync<TArg1, TArg2, TArg3>( 1090/// Creates a <see cref="Task">Task</see> that represents a pair of begin 1109/// created <see cref="Task">Task</see>.</param> 1119/// <returns>The created <see cref="Task">Task</see> that represents the 1124public Task FromAsync<TArg1, TArg2, TArg3>( 1547private sealed class CompleteOnCountdownPromise : Task<Task[]>, ITaskCompletionAction 1549private readonly Task[] _tasks; 1552internal CompleteOnCountdownPromise(Task[] tasksCopy) 1565public void Invoke(Task completingTask) 1596internal static Task<Task[]> CommonCWAllLogic(Task[] tasksCopy) 1635public void Invoke(Task completingTask) 1683/// Creates a continuation <see cref="Task">Task</see> 1689/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 1698public Task ContinueWhenAll(Task[] tasks, Action<Task[]> continuationAction) 1706/// Creates a continuation <see cref="Task">Task</see> 1714/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 1726public Task ContinueWhenAll(Task[] tasks, Action<Task[]> continuationAction, CancellationToken cancellationToken) 1734/// Creates a continuation <see cref="Task">Task</see> 1742/// the created continuation <see cref="Task">Task</see>.</param> 1743/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 1760public Task ContinueWhenAll(Task[] tasks, Action<Task[]> continuationAction, TaskContinuationOptions continuationOptions) 1768/// Creates a continuation <see cref="Task">Task</see> 1778/// the created continuation <see cref="Task">Task</see>.</param> 1781/// cref="Task">Task</see>.</param> 1782/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 1804public Task ContinueWhenAll(Task[] tasks, Action<Task[]> continuationAction, CancellationToken cancellationToken, 1813/// Creates a continuation <see cref="Task">Task</see> 1820/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 1829public Task ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>[]> continuationAction) 1838/// Creates a continuation <see cref="Task">Task</see> 1847/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 1859public Task ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>[]> continuationAction, 1868/// Creates a continuation <see cref="Task">Task</see> 1877/// the created continuation <see cref="Task">Task</see>.</param> 1878/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 1895public Task ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>[]> continuationAction, 1904/// Creates a continuation <see cref="Task">Task</see> 1915/// the created continuation <see cref="Task">Task</see>.</param> 1918/// cref="Task">Task</see>.</param> 1919/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 1941public Task ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>[]> continuationAction, 1950/// Creates a continuation <see cref="Task">Task</see> 1969public Task<TResult> ContinueWhenAll<TResult>(Task[] tasks, Func<Task[], TResult> continuationFunction) 1978/// Creates a continuation <see cref="Task">Task</see> 2002public Task<TResult> ContinueWhenAll<TResult>(Task[] tasks, Func<Task[], TResult> continuationFunction, CancellationToken cancellationToken) 2040public Task<TResult> ContinueWhenAll<TResult>(Task[] tasks, Func<Task[], TResult> continuationFunction, TaskContinuationOptions continuationOptions) 2088public Task<TResult> ContinueWhenAll<TResult>(Task[] tasks, Func<Task[], TResult> continuationFunction, CancellationToken cancellationToken, 2264internal sealed class CompleteOnInvokePromise<TTask> : Task<TTask>, ITaskCompletionAction where TTask : Task 2290public void Invoke(Task completingTask) 2336internal static Task<TTask> CommonCWAnyLogic<TTask>(IList<TTask> tasks, bool isSyncBlocking = false) where TTask : Task 2349Task task = tasks[i] ?? throw new ArgumentException(SR.Task_MultiTaskContinuation_NullTask, nameof(tasks)); 2391internal static void CommonCWAnyLogicCleanup(Task<Task> continuation) 2395((CompleteOnInvokePromise<Task>)continuation).Invoke(null!); 2399/// Creates a continuation <see cref="Task">Task</see> 2405/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 2414public Task ContinueWhenAny(Task[] tasks, Action<Task> continuationAction) 2422/// Creates a continuation <see cref="Task">Task</see> 2430/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 2442public Task ContinueWhenAny(Task[] tasks, Action<Task> continuationAction, CancellationToken cancellationToken) 2450/// Creates a continuation <see cref="Task">Task</see> 2458/// the created continuation <see cref="Task">Task</see>.</param> 2459/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 2476public Task ContinueWhenAny(Task[] tasks, Action<Task> continuationAction, TaskContinuationOptions continuationOptions) 2484/// Creates a continuation <see cref="Task">Task</see> 2494/// the created continuation <see cref="Task">Task</see>.</param> 2497/// cref="Task">Task</see>.</param> 2498/// <returns>The new continuation <see cref="Task">Task</see>.</returns> 2520public Task ContinueWhenAny(Task[] tasks, Action<Task> continuationAction, CancellationToken cancellationToken, 2549public Task<TResult> ContinueWhenAny<TResult>(Task[] tasks, Func<Task, TResult> continuationFunction) 2581public Task<TResult> ContinueWhenAny<TResult>(Task[] tasks, Func<Task, TResult> continuationFunction, CancellationToken cancellationToken) 2619public Task<TResult> ContinueWhenAny<TResult>(Task[] tasks, Func<Task, TResult> continuationFunction, TaskContinuationOptions continuationOptions) 2667public Task<TResult> ContinueWhenAny<TResult>(Task[] tasks, Func<Task, TResult> continuationFunction, CancellationToken cancellationToken, 2829/// Creates a continuation <see cref="Task">Task</see> 2836/// <returns>The new continuation <see cref="Task"/>.</returns> 2845public Task ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>> continuationAction) 2853/// Creates a continuation <see cref="Task">Task</see> 2862/// <returns>The new continuation <see cref="Task"/>.</returns> 2874public Task ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>> continuationAction, 2883/// Creates a continuation <see cref="Task">Task</see> 2892/// the created continuation <see cref="Task">Task</see>.</param> 2893/// <returns>The new continuation <see cref="Task"/>.</returns> 2910public Task ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>> continuationAction, 2919/// Creates a continuation <see cref="Task">Task</see> 2930/// the created continuation <see cref="Task">Task</see>.</param> 2934/// <returns>The new continuation <see cref="Task"/>.</returns> 2956public Task ContinueWhenAny<TAntecedentResult>(Task<TAntecedentResult>[] tasks, Action<Task<TAntecedentResult>> continuationAction, 2966internal static Task[] CheckMultiContinuationTasksAndCopy(Task[] tasks) 2973Task[] tasksCopy = new Task[tasks.Length];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskScheduler.cs (35)
42/// Queues a <see cref="Task">Task</see> to the scheduler. 57/// <param name="task">The <see cref="Task">Task</see> to be queued.</param> 59protected internal abstract void QueueTask(Task task); 62/// Determines whether the provided <see cref="Task">Task</see> 90/// <param name="task">The <see cref="Task">Task</see> to be 101protected abstract bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued); 104/// Generates an enumerable of <see cref="Task">Task</see> instances 144protected abstract IEnumerable<Task>? GetScheduledTasks(); 165internal bool TryRunInline(Task task, bool taskWasPreviouslyQueued) 203/// Attempts to dequeue a <see cref="Task">Task</see> that was previously queued to 206/// <param name="task">The <see cref="Task">Task</see> to be dequeued.</param> 209protected internal virtual bool TryDequeue(Task task) 224internal void InternalQueueTask(Task task) 313Task? currentTask = Task.InternalCurrent; 325/// All <see cref="Task">Task</see> instances queued to 372/// Attempts to execute the provided <see cref="Task">Task</see> 377/// Scheduler implementations are provided with <see cref="Task">Task</see> 391/// A <see cref="Task">Task</see> object to be executed.</param> 398protected bool TryExecuteTask(Task task) 414/// Occurs when a faulted <see cref="Task"/>'s unobserved exception is about to trigger exception escalation 437/// Provides an array of all queued <see cref="Task">Task</see> instances 445/// <returns>An array of <see cref="Task">Task</see> instances.</returns> 449internal Task[]? GetScheduledTasksForDebugger() 453IEnumerable<Task>? activeTasksSource = GetScheduledTasks(); 459if (activeTasksSource is not Task[] activeTasksArray) 461activeTasksArray = (new List<Task>(activeTasksSource)).ToArray(); 465foreach (Task t in activeTasksArray) 527public IEnumerable<Task>? ScheduledTasks => m_taskScheduler.GetScheduledTasks(); 557protected internal override void QueueTask(Task task) 570protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) 582protected override IEnumerable<Task>? GetScheduledTasks() 599Debug.Assert(s is Task); 600((Task)s).ExecuteEntry(); // with double-execute check because SC could be buggy 605/// Provides data for the event that is raised when a faulted <see cref="Task"/>'s
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ThreadPoolTaskScheduler.cs (8)
35Debug.Assert(s is Task); 36((Task)s).ExecuteEntryUnsafe(threadPoolThread: null); 43protected internal override void QueueTask(Task task) 70protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) 89protected internal override bool TryDequeue(Task task) 95protected override IEnumerable<Task> GetScheduledTasks() 100private static IEnumerable<Task> FilterTasksFromWorkItems(IEnumerable<object> tpwItems) 104if (tpwi is Task t)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ValueTask.cs (41)
31/// <see cref="ValueTask"/> instances are meant to be directly awaited. To do more complicated operations with them, a <see cref="Task"/> 44/// <see cref="ValueTask"/> wraps a <code>T</code> or a <see cref="Task"/>, it may not work if the <see cref="ValueTask"/> 59private static volatile Task? s_canceledTask; 61/// <summary>null if representing a successful synchronous completion, otherwise a <see cref="Task"/> or a <see cref="IValueTaskSource"/>.</summary> 71/// <summary>Initialize the <see cref="ValueTask"/> with a <see cref="Task"/> that represents the operation.</summary> 75public ValueTask(Task task) 132new ValueTask(Task.FromCanceled(cancellationToken)); 138new ValueTask<TResult>(Task.FromCanceled<TResult>(cancellationToken)); 144new ValueTask(Task.FromException(exception)); 150new ValueTask<TResult>(Task.FromException<TResult>(exception)); 172/// Gets a <see cref="Task"/> object to represent this ValueTask. 179public Task AsTask() 182Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 184obj == null ? Task.CompletedTask : 185obj as Task ?? 192/// <summary>Creates a <see cref="Task"/> to represent the <see cref="IValueTaskSource"/>.</summary> 197private Task GetTaskForValueTaskSource(IValueTaskSource t) 207return Task.CompletedTask; 220var task = new Task(); 226return s_canceledTask ??= Task.FromCanceled(new CancellationToken(canceled: true)); 230return Task.FromException(exc); 238/// <summary>Type used to create a <see cref="Task"/> to represent a <see cref="IValueTaskSource"/>.</summary> 308Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 315if (obj is Task t) 331Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 338if (obj is Task t) 353Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 360if (obj is Task t) 372/// this will always return false. If it's backed by a <see cref="Task"/>, it'll return the 373/// value of the task's <see cref="Task.IsCanceled"/> property. 380Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 387if (obj is Task t) 401Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 405if (obj is Task t) 423Debug.Assert(valueTask._obj is null or Task or IValueTaskSource, "If the ValueTask<>'s backing object is an IValueTaskSource<TResult>, it must also be IValueTaskSource."); 590return Task.FromResult(_result!); 618return Task.FromResult(t.GetResult(_token)); 637return s_canceledTask ??= Task.FromCanceled<TResult>(new CancellationToken(true)); 641return Task.FromException<TResult>(exc); 782/// this will always return false. If it's backed by a <see cref="Task"/>, it'll return the 783/// value of the task's <see cref="Task.IsCanceled"/> property.
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (8)
612Debug.Assert((callback is IThreadPoolWorkItem) ^ (callback is Task)); 681Debug.Assert((workItem is IThreadPoolWorkItem) ^ (workItem is Task)); 1100if (workItem is Task task) 1368/// <summary>Shim used to invoke <see cref="Task.ExecuteDirectly"/> of a supplied <see cref="Task"/>.</summary> 1371if (state is Task t) 1604if (state is not Task) 1640if (callBack is Task)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (5)
644notifyWhenNoCallbacksRunning is Task); 651var t = new Task((object?)null, TaskCreationOptions.RunContinuationsAsynchronously, true); 657return new ValueTask((Task)notifyWhenNoCallbacksRunning); 693Debug.Assert(toSignal is WaitHandle || toSignal is Task); 701((Task)toSignal).TrySetResult();
System.Private.DataContractSerialization (74)
System\Xml\XmlBaseWriter.cs (17)
75public override Task FlushAsync() 364protected override Task WriteEndAttributeAsync() 375private async Task WriteEndAttributeAsyncImpl() 545private async Task StartElementAndWriteStartElementAsync(string? prefix, string localName, string? namespaceUri) 591public override Task WriteStartElementAsync(string? prefix, string localName, string? namespaceUri) 630public override Task WriteEndElementAsync() 641private async Task WriteEndElementAsyncImpl() 702private Task FlushElementAsync() 704return _writeState == WriteState.Element ? AutoCompleteAsync(WriteState.Content) : Task.CompletedTask; 723protected async Task StartContentAsync() 782private async Task AutoCompleteAsync(WriteState writeState) 797private Task EndStartElementAsync() 1512public override Task WriteBase64Async(byte[] buffer, int offset, int count) 1522private async Task WriteBase64AsyncImpl(byte[] buffer, int offset, int count) 1738private Task FlushBase64Async() 1740return _trailByteCount > 0 ? FlushTrailBytesAsync() : Task.CompletedTask; 1759private async Task FlushTrailBytesAsync()
System\Xml\XmlDictionaryAsyncCheckWriter.cs (29)
18private Task? _lastTask; 43private Task SetLastTask(Task task) 91public override Task FlushAsync() 109public override Task WriteAttributesAsync(XmlReader reader, bool defattr) 121public override Task WriteBase64Async(byte[] buffer, int index, int count) 133public override Task WriteBinHexAsync(byte[] buffer, int index, int count) 145public override Task WriteCDataAsync(string? text) 157public override Task WriteCharEntityAsync(char ch) 169public override Task WriteCharsAsync(char[] buffer, int index, int count) 181public override Task WriteCommentAsync(string? text) 193public override Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 211public override Task WriteEndDocumentAsync() 223public override Task WriteEndElementAsync() 235public override Task WriteEntityRefAsync(string name) 247public override Task WriteFullEndElementAsync() 259public override Task WriteNameAsync(string name) 271public override Task WriteNmTokenAsync(string name) 283public override Task WriteNodeAsync(XmlReader reader, bool defattr) 295public override Task WriteProcessingInstructionAsync(string name, string? text) 307public override Task WriteQualifiedNameAsync(string localName, string? ns) 325public override Task WriteRawAsync(string data) 331public override Task WriteRawAsync(char[] buffer, int index, int count) 355public override Task WriteStartDocumentAsync() 361public override Task WriteStartDocumentAsync(bool standalone) 373public override Task WriteStartElementAsync(string? prefix, string localName, string? ns) 385public override Task WriteStringAsync(string? text) 397public override Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 463public override Task WriteWhitespaceAsync(string? ws)
System\Xml\XmlDictionaryWriter.cs (4)
77public override Task WriteBase64Async(byte[] buffer, int index, int count) 80return Task.CompletedTask; 217public virtual Task WriteValueAsync(IStreamProvider value) 220return Task.CompletedTask;
System\Xml\XmlNodeWriter.cs (6)
20public virtual Task FlushAsync() 29public virtual Task WriteStartElementAsync(string? prefix, string localName) 39public virtual Task WriteEndStartElementAsync(bool isEmpty) 44public virtual Task WriteEndElementAsync(string? prefix, string localName) 65public virtual Task WriteEndAttributeAsync() 93public virtual Task WriteBase64TextAsync(byte[] trailBuffer, int trailCount, byte[] buffer, int offset, int count)
System\Xml\XmlStreamNodeWriter.cs (12)
134protected Task WriteByteAsync(byte b) 143return Task.CompletedTask; 147private async Task FlushBufferAndWriteByteAsync(byte b) 159protected Task WriteByteAsync(char ch) 179protected Task WriteBytesAsync(byte b1, byte b2) 189return Task.CompletedTask; 193private async Task FlushAndWriteBytesAsync(byte b1, byte b2) 206protected Task WriteBytesAsync(char ch1, char ch2) 404protected virtual Task FlushBufferAsync() 408var task = OutputStream.WriteAsync(_buffer, 0, _offset); 413return Task.CompletedTask; 422public override async Task FlushAsync()
System\Xml\XmlUTF8TextWriter.cs (6)
174public override async Task WriteStartElementAsync(string? prefix, string localName) 216public override async Task WriteEndStartElementAsync(bool isEmpty) 240public override async Task WriteEndElementAsync(string? prefix, string localName) 338public override async Task WriteEndAttributeAsync() 639public override async Task WriteBase64TextAsync(byte[] trailBytes, int trailByteCount, byte[] buffer, int offset, int count) 668private async Task InternalWriteBase64TextAsync(byte[] buffer, int offset, int count)
System.Private.Xml (538)
System\Xml\AsyncHelper.cs (19)
10public static readonly Task<bool> DoneTaskTrue = Task.FromResult(true); 12public static readonly Task<bool> DoneTaskFalse = Task.FromResult(false); 14public static readonly Task<int> DoneTaskZero = Task.FromResult(0); 16public static bool IsSuccess(this Task task) 21public static Task CallVoidFuncWhenFinishAsync<TArg>(this Task task, Action<TArg> func, TArg arg) 26return Task.CompletedTask; 34private static async Task CallVoidFuncWhenFinishCoreAsync<TArg>(this Task task, Action<TArg> func, TArg arg) 40public static Task<bool> ReturnTrueTaskWhenFinishAsync(this Task task) 47private static async Task<bool> ReturnTrueTaskWhenFinishCoreAsync(this Task task) 53public static Task CallTaskFuncWhenFinishAsync<TArg>(this Task task, Func<TArg, Task> func, TArg arg) 60private static async Task CallTaskFuncWhenFinishCoreAsync<TArg>(Task task, Func<TArg, Task> func, TArg arg) 66public static Task<bool> CallBoolTaskFuncWhenFinishAsync<TArg>(this Task task, Func<TArg, Task<bool>> func, TArg arg) 73private static async Task<bool> CallBoolTaskFuncWhenFinishCoreAsync<TArg>(this Task task, Func<TArg, Task<bool>> func, TArg arg)
System\Xml\Base64EncoderAsync.cs (6)
12internal abstract Task WriteCharsAsync(char[] chars, int index, int count); 14internal Task EncodeAsync(byte[] buffer, int index, int count) 23async Task Core(byte[] buffer, int index, int count) 76internal async Task FlushAsync() 89internal override Task WriteCharsAsync(char[] chars, int index, int count) 97internal override Task WriteCharsAsync(char[] chars, int index, int count)
System\Xml\BinHexEncoderAsync.cs (2)
10internal static Task EncodeAsync(byte[] buffer, int index, int count, XmlWriter writer) 19static async Task Core(byte[] buffer, int index, int count, XmlWriter writer)
System\Xml\Core\IDtdParserAdapterAsync.cs (2)
17Task ParsePIAsync(StringBuilder? sb); 18Task ParseCommentAsync(StringBuilder? sb);
System\Xml\Core\ReadContentAsBinaryHelperAsync.cs (1)
189internal async Task FinishAsync()
System\Xml\Core\XmlAsyncCheckReader.cs (4)
14private Task _lastTask = Task.CompletedTask; 843public override Task SkipAsync() 846var task = _coreReader.SkipAsync();
System\Xml\Core\XmlAsyncCheckWriter.cs (60)
12private Task _lastTask = Task.CompletedTask; 347public override Task WriteStartDocumentAsync() 350var task = _coreWriter.WriteStartDocumentAsync(); 355public override Task WriteStartDocumentAsync(bool standalone) 358var task = _coreWriter.WriteStartDocumentAsync(standalone); 363public override Task WriteEndDocumentAsync() 366var task = _coreWriter.WriteEndDocumentAsync(); 371public override Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 374var task = _coreWriter.WriteDocTypeAsync(name, pubid, sysid, subset); 379public override Task WriteStartElementAsync(string? prefix, string localName, string? ns) 382var task = _coreWriter.WriteStartElementAsync(prefix, localName, ns); 387public override Task WriteEndElementAsync() 390var task = _coreWriter.WriteEndElementAsync(); 395public override Task WriteFullEndElementAsync() 398var task = _coreWriter.WriteFullEndElementAsync(); 403protected internal override Task WriteStartAttributeAsync(string? prefix, string localName, string? ns) 406var task = _coreWriter.WriteStartAttributeAsync(prefix, localName, ns); 411protected internal override Task WriteEndAttributeAsync() 414var task = _coreWriter.WriteEndAttributeAsync(); 419public override Task WriteCDataAsync(string? text) 422var task = _coreWriter.WriteCDataAsync(text); 427public override Task WriteCommentAsync(string? text) 430var task = _coreWriter.WriteCommentAsync(text); 435public override Task WriteProcessingInstructionAsync(string name, string? text) 438var task = _coreWriter.WriteProcessingInstructionAsync(name, text); 443public override Task WriteEntityRefAsync(string name) 446var task = _coreWriter.WriteEntityRefAsync(name); 451public override Task WriteCharEntityAsync(char ch) 454var task = _coreWriter.WriteCharEntityAsync(ch); 459public override Task WriteWhitespaceAsync(string? ws) 462var task = _coreWriter.WriteWhitespaceAsync(ws); 467public override Task WriteStringAsync(string? text) 470var task = _coreWriter.WriteStringAsync(text); 475public override Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 478var task = _coreWriter.WriteSurrogateCharEntityAsync(lowChar, highChar); 483public override Task WriteCharsAsync(char[] buffer, int index, int count) 486var task = _coreWriter.WriteCharsAsync(buffer, index, count); 491public override Task WriteRawAsync(char[] buffer, int index, int count) 494var task = _coreWriter.WriteRawAsync(buffer, index, count); 499public override Task WriteRawAsync(string data) 502var task = _coreWriter.WriteRawAsync(data); 507public override Task WriteBase64Async(byte[] buffer, int index, int count) 510var task = _coreWriter.WriteBase64Async(buffer, index, count); 515public override Task WriteBinHexAsync(byte[] buffer, int index, int count) 518var task = _coreWriter.WriteBinHexAsync(buffer, index, count); 523public override Task FlushAsync() 526var task = _coreWriter.FlushAsync(); 531public override Task WriteNmTokenAsync(string name) 534var task = _coreWriter.WriteNmTokenAsync(name); 539public override Task WriteNameAsync(string name) 542var task = _coreWriter.WriteNameAsync(name); 547public override Task WriteQualifiedNameAsync(string localName, string? ns) 550var task = _coreWriter.WriteQualifiedNameAsync(localName, ns); 555public override Task WriteAttributesAsync(XmlReader reader, bool defattr) 558var task = _coreWriter.WriteAttributesAsync(reader, defattr); 563public override Task WriteNodeAsync(XmlReader reader, bool defattr) 566var task = _coreWriter.WriteNodeAsync(reader, defattr); 571public override Task WriteNodeAsync(XPathNavigator navigator, bool defattr) 574var task = _coreWriter.WriteNodeAsync(navigator, defattr);
System\Xml\Core\XmlCharCheckingReaderAsync.cs (2)
315return Task.FromResult(0); 369return Task.FromResult(0);
System\Xml\Core\XmlCharCheckingWriterAsync.cs (14)
19public override Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 58public override Task WriteStartElementAsync(string? prefix, string localName, string? ns) 74protected internal override Task WriteStartAttributeAsync(string? prefix, string localName, string? ns) 91public override async Task WriteCDataAsync(string? text) 116public override Task WriteCommentAsync(string? text) 133public override Task WriteProcessingInstructionAsync(string name, string? text) 156public override Task WriteEntityRefAsync(string name) 165public override Task WriteWhitespaceAsync(string? ws) 187public override Task WriteStringAsync(string? text) 205public override Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 210public override Task WriteCharsAsync(char[] buffer, int index, int count) 235public override Task WriteNmTokenAsync(string name) 245public override Task WriteNameAsync(string name) 254public override Task WriteQualifiedNameAsync(string localName, string? ns)
System\Xml\Core\XmlEncodedRawTextWriterAsync.cs (69)
33internal override async Task WriteXmlDeclarationAsync(XmlStandalone standalone) 63internal override Task WriteXmlDeclarationAsync(string xmldecl) 72return Task.CompletedTask; 132public override async Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 174public override Task WriteStartElementAsync(string? prefix, string localName, string? ns) 182Task task; 202internal override Task WriteEndElementAsync(string prefix, string localName, string ns) 233return Task.CompletedTask; 237internal override Task WriteFullEndElementAsync(string prefix, string localName, string ns) 259protected internal override Task WriteStartAttributeAsync(string? prefix, string localName, string? ns) 271Task task; 291protected internal override Task WriteEndAttributeAsync() 301return Task.CompletedTask; 304internal override async Task WriteNamespaceDeclarationAsync(string prefix, string namespaceName) 314internal override async Task WriteStartNamespaceDeclarationAsync(string prefix) 343internal override Task WriteEndNamespaceDeclarationAsync() 354return Task.CompletedTask; 359public override async Task WriteCDataAsync(string? text) 397public override async Task WriteCommentAsync(string? text) 417public override async Task WriteProcessingInstructionAsync(string name, string? text) 440public override async Task WriteEntityRefAsync(string name) 460public override async Task WriteCharEntityAsync(char ch) 489public override Task WriteWhitespaceAsync(string? ws) 508public override Task WriteStringAsync(string? text) 526public override async Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 545public override Task WriteCharsAsync(char[] buffer, int index, int count) 567public override async Task WriteRawAsync(char[] buffer, int index, int count) 583public override async Task WriteRawAsync(string data) 596public override async Task FlushAsync() 616protected virtual async Task FlushBufferAsync() 678private async Task EncodeCharsAsync(int startOffset, int endOffset, bool writeAllToStream) 702private Task FlushEncoderAsync() 716return Task.CompletedTask; 872protected async Task WriteAttributeTextBlockAsync(char[] chars, int index, int count) 889protected Task WriteAttributeTextBlockAsync(string text) 903return Task.CompletedTask; 906private async Task _WriteAttributeTextBlockAsync(string text, int curIndex, int leftCount) 1083protected async Task WriteElementTextBlockAsync(char[] chars, int index, int count) 1108protected Task WriteElementTextBlockAsync(string text) 1127return Task.CompletedTask; 1130private async Task _WriteElementTextBlockAsync(bool newLine, string text, int curIndex, int leftCount) 1246protected Task RawTextAsync(string text) 1251Task.CompletedTask; 1254protected Task RawTextAsync(string text1, string? text2 = null, string? text3 = null, string? text4 = null) 1307return Task.CompletedTask; 1310private async Task _RawTextAsync( 1482protected async Task WriteRawWithCharCheckingAsync(char[] chars, int index, int count) 1506protected async Task WriteRawWithCharCheckingAsync(string text) 1684protected async Task WriteCommentOrPiAsync(string text, int stopChar) 1868protected async Task WriteCDataSectionAsync(string text) 1905public override async Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 1916public override async Task WriteStartElementAsync(string? prefix, string localName, string? ns) 1932internal override async Task WriteEndElementAsync(string prefix, string localName, string ns) 1950internal override async Task WriteFullEndElementAsync(string prefix, string localName, string ns) 1969protected internal override async Task WriteStartAttributeAsync(string? prefix, string localName, string? ns) 1982internal override async Task WriteStartNamespaceDeclarationAsync(string prefix) 1994public override Task WriteCDataAsync(string? text) 2001public override async Task WriteCommentAsync(string? text) 2012public override async Task WriteProcessingInstructionAsync(string target, string? text) 2023public override Task WriteEntityRefAsync(string name) 2030public override Task WriteCharEntityAsync(char ch) 2037public override Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 2044public override Task WriteWhitespaceAsync(string? ws) 2051public override Task WriteStringAsync(string? text) 2058public override Task WriteCharsAsync(char[] buffer, int index, int count) 2065public override Task WriteRawAsync(char[] buffer, int index, int count) 2072public override Task WriteRawAsync(string data) 2079public override Task WriteBase64Async(byte[] buffer, int index, int count) 2087private async Task WriteIndentAsync()
System\Xml\Core\XmlRawWriterAsync.cs (32)
46public override Task WriteStartDocumentAsync() 51public override Task WriteStartDocumentAsync(bool standalone) 56public override Task WriteEndDocumentAsync() 61public override Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 63return Task.CompletedTask; 67public override Task WriteEndElementAsync() 73public override Task WriteFullEndElementAsync() 79public override Task WriteBase64Async(byte[] buffer, int index, int count) 88public override Task WriteNmTokenAsync(string name) 94public override Task WriteNameAsync(string name) 100public override Task WriteQualifiedNameAsync(string localName, string? ns) 106public override Task WriteCDataAsync(string? text) 112public override Task WriteCharEntityAsync(char ch) 118public override Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 124public override Task WriteWhitespaceAsync(string? ws) 130public override Task WriteCharsAsync(char[] buffer, int index, int count) 136public override Task WriteRawAsync(char[] buffer, int index, int count) 142public override Task WriteRawAsync(string data) 148public override Task WriteAttributesAsync(XmlReader reader, bool defattr) 153public override Task WriteNodeAsync(XmlReader reader, bool defattr) 158public override Task WriteNodeAsync(System.Xml.XPath.XPathNavigator navigator, bool defattr) 168internal virtual Task WriteXmlDeclarationAsync(XmlStandalone standalone) 170return Task.CompletedTask; 172internal virtual Task WriteXmlDeclarationAsync(string xmldecl) 174return Task.CompletedTask; 181internal virtual Task WriteEndElementAsync(string prefix, string localName, string ns) 186internal virtual Task WriteFullEndElementAsync(string prefix, string localName, string ns) 191internal virtual async Task WriteQualifiedNameAsync(string prefix, string localName, string? ns) 204internal virtual Task WriteNamespaceDeclarationAsync(string prefix, string ns) 209internal virtual Task WriteStartNamespaceDeclarationAsync(string prefix) 214internal virtual Task WriteEndNamespaceDeclarationAsync() 220internal virtual Task WriteEndBase64Async()
System\Xml\Core\XmlReaderAsync.cs (3)
119public virtual Task SkipAsync() 121return ReadState != ReadState.Interactive ? Task.CompletedTask : SkipSubtreeAsync(); 212private async Task WriteNodeAsync(XmlTextWriter xtw, bool defattr)
System\Xml\Core\XmlSubtreeReaderAsync.cs (3)
20return Task.FromResult(_curNode.value); 101public override async Task SkipAsync() 532return Task.FromResult(copyCount);
System\Xml\Core\XmlTextReaderImplAsync.cs (57)
37return Task.FromResult(_curNode.StringValue); 57private Task FinishInitAsync() 70return Task.CompletedTask; 75private async Task FinishInitUriStringAsync() 114private async Task FinishInitStreamAsync() 138private async Task FinishInitTextReaderAsync() 240return Task.FromResult(ParseFragmentAttribute()); 307public override async Task SkipAsync() 743internal async Task DtdParserProxy_ParsePIAsync(StringBuilder? sb) 759internal async Task DtdParserProxy_ParseCommentAsync(StringBuilder? sb) 860private Task InitStreamInputAsync(Uri baseUri, Stream stream, Encoding? encoding) 866private async Task InitStreamInputAsync(Uri? baseUri, string baseUriStr, Stream stream, byte[]? bytes, int byteCount, Encoding? encoding) 975private Task ProcessDtdFromParserContextAsync(XmlParserContext context) 995return Task.CompletedTask; 999private Task SwitchEncodingAsync(Encoding newEncoding) 1010return Task.CompletedTask; 1013private Task SwitchEncodingToUTF8Async() 1856private Task ParseElementAsync() 1926private Task ParseElementAsync_ContinueWithSetElement(Task<(int, int)> task) 1941private async Task _ParseElementAsync_ContinueWithSetElement(Task<(int, int)> task) 1949private Task ParseElementAsync_SetElement(int colonPos, int pos) 2001private Task ParseElementAsync_NoAttributes() 2047return Task.CompletedTask; 2050private async Task ParseElementAsync_ReadData(int pos) 2060private Task ParseEndElementAsync() 2075private async Task _ParseEndElmentAsync() 2081private async Task ParseEndElmentAsync_PrepareData() 2098private Task ParseEndElementAsync_CheckNameAndParse() 2138private Task ParseEndElementAsync_Finish(int nameLen, NodeData startTagNode, LineInfo endTagLineInfo) 2140Task task = ParseEndElementAsync_CheckEndTag(nameLen, startTagNode, endTagLineInfo); 2162private async Task ParseEndElementAsync_Finish(Task task, int nameLen, NodeData startTagNode, LineInfo endTagLineInfo) 2181private Task ParseEndElementAsync_CheckEndTag(int nameLen, NodeData startTagNode, LineInfo endTagLineInfo) 2193return Task.CompletedTask; 2242return Task.CompletedTask; 2267return Task.CompletedTask; 2270private async Task ParseEndElementAsync_ReadData() 2280private async Task ThrowTagMismatchAsync(NodeData startTag) 2305private async Task ParseAttributesAsync() 2603private async Task ParseAttributeValueSlowAsync(int curPos, char quoteChar, NodeData attr) 3164private readonly Task<(int, int, int, bool)> _parseText_dummyTask = Task.FromResult((0, 0, 0, false)); 3527private async Task FinishPartialValueAsync() 3560private async Task FinishOtherValueIteratorAsync() 3607private async Task SkipPartialTextValueAsync() 3623private Task FinishReadValueChunkAsync() 3638return Task.CompletedTask; 3642private async Task FinishReadContentAsBinaryAsync() 3663private async Task FinishReadElementContentAsBinaryAsync() 3716private async Task ParseEntityReferenceAsync() 4189private Task ParseCDataAsync() 4195private async Task ParseCDataOrCommentAsync(XmlNodeType type) 4467private async Task ParseDtdAsync() 4482private async Task SkipDtdAsync() 4591private Task SkipPublicOrSystemIdLiteralAsync() 4604private async Task SkipUntilAsync(char stopChar, bool recognizeLiterals) 5100private async Task PushExternalEntityOrSubsetAsync(string? publicId, string? systemId, Uri? baseUri, string? entityName) 5253private async Task ParseDtdFromParserContextAsync()
System\Xml\Core\XmlTextReaderImplHelpersAsync.cs (2)
40Task IDtdParserAdapter.ParsePIAsync(StringBuilder? sb) 45Task IDtdParserAdapter.ParseCommentAsync(StringBuilder? sb)
System\Xml\Core\XmlUtf8RawTextWriterAsync.cs (66)
33internal override async Task WriteXmlDeclarationAsync(XmlStandalone standalone) 62internal override Task WriteXmlDeclarationAsync(string xmldecl) 71return Task.CompletedTask; 110public override async Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 150public override Task WriteStartElementAsync(string? prefix, string localName, string? ns) 156Task task; 176internal override Task WriteEndElementAsync(string prefix, string localName, string ns) 205return Task.CompletedTask; 209internal override Task WriteFullEndElementAsync(string prefix, string localName, string ns) 229protected internal override Task WriteStartAttributeAsync(string? prefix, string localName, string? ns) 239Task task; 259protected internal override Task WriteEndAttributeAsync() 267return Task.CompletedTask; 270internal override async Task WriteNamespaceDeclarationAsync(string prefix, string namespaceName) 280internal override async Task WriteStartNamespaceDeclarationAsync(string prefix) 305internal override Task WriteEndNamespaceDeclarationAsync() 314return Task.CompletedTask; 319public override async Task WriteCDataAsync(string? text) 355public override async Task WriteCommentAsync(string? text) 373public override async Task WriteProcessingInstructionAsync(string name, string? text) 394public override async Task WriteEntityRefAsync(string name) 412public override async Task WriteCharEntityAsync(char ch) 439public override Task WriteWhitespaceAsync(string? ws) 456public override Task WriteStringAsync(string? text) 472public override async Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 489public override Task WriteCharsAsync(char[] buffer, int index, int count) 509public override async Task WriteRawAsync(char[] buffer, int index, int count) 523public override async Task WriteRawAsync(string data) 534public override async Task FlushAsync() 549protected virtual async Task FlushBufferAsync() 745protected async Task WriteAttributeTextBlockAsync(char[] chars, int index, int count) 762protected Task WriteAttributeTextBlockAsync(string text) 776return Task.CompletedTask; 779private async Task _WriteAttributeTextBlockAsync(string text, int curIndex, int leftCount) 955protected async Task WriteElementTextBlockAsync(char[] chars, int index, int count) 980protected Task WriteElementTextBlockAsync(string text) 999return Task.CompletedTask; 1002private async Task _WriteElementTextBlockAsync(bool newLine, string text, int curIndex, int leftCount) 1117protected Task RawTextAsync(string text) 1122Task.CompletedTask; 1125protected Task RawTextAsync(string text1, string? text2 = null, string? text3 = null, string? text4 = null) 1178return Task.CompletedTask; 1181private async Task _RawTextAsync( 1352protected async Task WriteRawWithCharCheckingAsync(char[] chars, int index, int count) 1376protected async Task WriteRawWithCharCheckingAsync(string text) 1553protected async Task WriteCommentOrPiAsync(string text, int stopChar) 1736protected async Task WriteCDataSectionAsync(string text) 1773public override async Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 1784public override async Task WriteStartElementAsync(string? prefix, string localName, string? ns) 1800internal override async Task WriteEndElementAsync(string prefix, string localName, string ns) 1818internal override async Task WriteFullEndElementAsync(string prefix, string localName, string ns) 1837protected internal override async Task WriteStartAttributeAsync(string? prefix, string localName, string? ns) 1850internal override async Task WriteStartNamespaceDeclarationAsync(string prefix) 1862public override Task WriteCDataAsync(string? text) 1869public override async Task WriteCommentAsync(string? text) 1880public override async Task WriteProcessingInstructionAsync(string target, string? text) 1891public override Task WriteEntityRefAsync(string name) 1898public override Task WriteCharEntityAsync(char ch) 1905public override Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 1912public override Task WriteWhitespaceAsync(string? ws) 1919public override Task WriteStringAsync(string? text) 1926public override Task WriteCharsAsync(char[] buffer, int index, int count) 1933public override Task WriteRawAsync(char[] buffer, int index, int count) 1940public override Task WriteRawAsync(string data) 1947public override Task WriteBase64Async(byte[] buffer, int index, int count) 1955private async Task WriteIndentAsync()
System\Xml\Core\XmlValidatingReaderImplAsync.cs (2)
173private async Task ParseDtdFromParserContextAsync() 191private async Task ResolveEntityInternallyAsync()
System\Xml\Core\XmlWellFormedWriterAsync.cs (84)
21public override Task WriteStartDocumentAsync() 26public override Task WriteStartDocumentAsync(bool standalone) 31public override async Task WriteEndDocumentAsync() 59public override async Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 125private Task TryReturnTask(Task task) 129return Task.CompletedTask; 137private async Task _TryReturnTask(Task task) 151private Task SequenceRun<TArg>(Task task, Func<TArg, Task> nextTaskFun, TArg arg) 163private async Task _SequenceRun<TArg>(Task task, Func<TArg, Task> nextTaskFun, TArg arg) 177public override Task WriteStartElementAsync(string? prefix, string localName, string? ns) 185Task task = AdvanceStateAsync(Token.StartElement); 202private Task WriteStartElementAsync_NoAdvanceState(string? prefix, string localName, string? ns) 241Task task = _writer.WriteStartElementAsync(prefix, localName, ns); 250return Task.CompletedTask; 259private async Task WriteStartElementAsync_NoAdvanceState(Task task, string? prefix, string localName, string? ns) 302private async Task WriteStartElementAsync_FinishWrite(Task t, string prefix, string localName, string ns) 316public override Task WriteEndElementAsync() 320Task task = AdvanceStateAsync(Token.EndElement); 331private Task WriteEndElementAsync_NoAdvanceState() 340Task task; 360private Task WriteEndElementAsync_FinishWrite() 392return Task.CompletedTask; 395public override Task WriteFullEndElementAsync() 399Task task = AdvanceStateAsync(Token.EndElement); 410private Task WriteFullEndElementAsync_NoAdvanceState() 419Task task; 439protected internal override Task WriteStartAttributeAsync(string? prefix, string localName, string? namespaceName) 458Task task = AdvanceStateAsync(Token.StartAttribute); 475private Task WriteStartAttributeAsync_NoAdvanceState(string? prefix, string localName, string? namespaceName) 585return Task.CompletedTask; 594private async Task WriteStartAttributeAsync_NoAdvanceState(Task task, string? prefix, string localName, string? namespaceName) 609protected internal override Task WriteEndAttributeAsync() 613Task task = AdvanceStateAsync(Token.EndAttribute); 623private Task WriteEndAttributeAsync_NoAdvance() 643private async Task WriteEndAttributeAsync_SepcialAtt() 753public override async Task WriteCDataAsync(string? text) 769public override async Task WriteCommentAsync(string? text) 785public override async Task WriteProcessingInstructionAsync(string name, string? text) 830public override async Task WriteEntityRefAsync(string name) 855public override async Task WriteCharEntityAsync(char ch) 881public override async Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 907public override async Task WriteWhitespaceAsync(string? ws) 935public override Task WriteStringAsync(string? text) 941return Task.CompletedTask; 944Task task = AdvanceStateAsync(Token.Text); 962private Task WriteStringAsync_NoAdvanceState(string text) 969return Task.CompletedTask; 983private async Task WriteStringAsync_NoAdvanceState(Task task, string text) 997public override async Task WriteCharsAsync(char[] buffer, int index, int count) 1023public override async Task WriteRawAsync(char[] buffer, int index, int count) 1049public override async Task WriteRawAsync(string data) 1075public override Task WriteBase64Async(byte[] buffer, int index, int count) 1084Task task = AdvanceStateAsync(Token.Base64); 1102private async Task WriteBase64Async_NoAdvanceState(Task task, byte[] buffer, int index, int count) 1116public override async Task FlushAsync() 1129public override async Task WriteQualifiedNameAsync(string localName, string? ns) 1174public override async Task WriteBinHexAsync(byte[] buffer, int index, int count) 1192private async Task WriteStartDocumentImplAsync(XmlStandalone standalone) 1229private Task AdvanceStateAsync_ReturnWhenFinish(Task task, State newState) 1234return Task.CompletedTask; 1242private async Task _AdvanceStateAsync_ReturnWhenFinish(Task task, State newState) 1248private Task AdvanceStateAsync_ContinueWhenFinish(Task task, State newState, Token token) 1261private async Task _AdvanceStateAsync_ContinueWhenFinish(Task task, State newState, Token token) 1269private Task AdvanceStateAsync(Token token) 1286Task task; 1374return Task.CompletedTask; 1378private async Task StartElementContentAsync_WithNS() 1392private Task StartElementContentAsync() 1401return Task.CompletedTask;
System\Xml\Core\XmlWellFormedWriterHelpersAsync.cs (4)
16internal Task WriteEndElementAsync(XmlRawWriter rawWriter) 21internal Task WriteFullEndElementAsync(XmlRawWriter rawWriter) 29internal async Task WriteDeclAsync(XmlWriter writer, XmlRawWriter? rawWriter) 54internal async Task ReplayAsync(XmlWriter writer)
System\Xml\Core\XmlWrappingReaderAsync.cs (1)
25public override Task SkipAsync()
System\Xml\Core\XmlWrappingWriterAsync.cs (22)
15public override Task WriteStartDocumentAsync() 20public override Task WriteStartDocumentAsync(bool standalone) 25public override Task WriteEndDocumentAsync() 30public override Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 35public override Task WriteStartElementAsync(string? prefix, string localName, string? ns) 40public override Task WriteEndElementAsync() 45public override Task WriteFullEndElementAsync() 50protected internal override Task WriteStartAttributeAsync(string? prefix, string localName, string? ns) 55protected internal override Task WriteEndAttributeAsync() 60public override Task WriteCDataAsync(string? text) 65public override Task WriteCommentAsync(string? text) 70public override Task WriteProcessingInstructionAsync(string name, string? text) 75public override Task WriteEntityRefAsync(string name) 80public override Task WriteCharEntityAsync(char ch) 85public override Task WriteWhitespaceAsync(string? ws) 90public override Task WriteStringAsync(string? text) 95public override Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 100public override Task WriteCharsAsync(char[] buffer, int index, int count) 105public override Task WriteRawAsync(char[] buffer, int index, int count) 110public override Task WriteRawAsync(string data) 115public override Task WriteBase64Async(byte[] buffer, int index, int count) 120public override Task FlushAsync()
System\Xml\Core\XmlWriterAsync.cs (39)
18public virtual Task WriteStartDocumentAsync() 25public virtual Task WriteStartDocumentAsync(bool standalone) 32public virtual Task WriteEndDocumentAsync() 39public virtual Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) 46public virtual Task WriteStartElementAsync(string? prefix, string localName, string? ns) 53public virtual Task WriteEndElementAsync() 60public virtual Task WriteFullEndElementAsync() 66public Task WriteAttributeStringAsync(string? prefix, string localName, string? ns, string? value) 68Task task = WriteStartAttributeAsync(prefix, localName, ns); 77private async Task WriteAttributeStringAsyncHelper(Task task, string? value) 86protected internal virtual Task WriteStartAttributeAsync(string? prefix, string localName, string? ns) 93protected internal virtual Task WriteEndAttributeAsync() 100public virtual Task WriteCDataAsync(string? text) 107public virtual Task WriteCommentAsync(string? text) 114public virtual Task WriteProcessingInstructionAsync(string name, string? text) 121public virtual Task WriteEntityRefAsync(string name) 128public virtual Task WriteCharEntityAsync(char ch) 135public virtual Task WriteWhitespaceAsync(string? ws) 142public virtual Task WriteStringAsync(string? text) 149public virtual Task WriteSurrogateCharEntityAsync(char lowChar, char highChar) 156public virtual Task WriteCharsAsync(char[] buffer, int index, int count) 163public virtual Task WriteRawAsync(char[] buffer, int index, int count) 170public virtual Task WriteRawAsync(string data) 177public virtual Task WriteBase64Async(byte[] buffer, int index, int count) 183public virtual Task WriteBinHexAsync(byte[] buffer, int index, int count) 190public virtual Task FlushAsync() 199public virtual Task WriteNmTokenAsync(string name) 207public virtual Task WriteNameAsync(string name) 213public virtual async Task WriteQualifiedNameAsync(string localName, string? ns) 231public virtual Task WriteAttributesAsync(XmlReader reader, bool defattr) 236async Task Core(XmlReader reader, bool defattr) 280public virtual Task WriteNodeAsync(XmlReader reader, bool defattr) 296internal async Task WriteNodeAsync_CallSyncReader(XmlReader reader, bool defattr) 358internal async Task WriteNodeAsync_CallAsyncReader(XmlReader reader, bool defattr) 419public virtual Task WriteNodeAsync(XPathNavigator navigator, bool defattr) 424async Task Core(XPathNavigator navigator, bool defattr) 545public async Task WriteElementStringAsync(string? prefix, string localName, string? ns, string value) 557private async Task WriteLocalNamespacesAsync(XPathNavigator nsNav)
System\Xml\Core\XsdCachingReaderAsync.cs (4)
22return Task.FromResult(_cachedNode!.OriginalStringValue!); 26return Task.FromResult(_cachedNode!.RawValue); 105public override async Task SkipAsync() 134internal Task SetToReplayModeAsync()
System\Xml\Core\XsdValidatingReaderAsync.cs (13)
25return Task.FromResult(_cachedNode.RawValue); 266private Task<bool> ReadAsync_ReadAhead(Task task) 279private async Task<bool> _ReadAsync_ReadAhead(Task task) 316Task task = ProcessReaderEventAsync(); 346public override async Task SkipAsync() 490private Task ProcessReaderEventAsync() 497return Task.CompletedTask; 535return Task.CompletedTask; 537static async Task ValidateWhitespace(Task<string> t, XmlSchemaValidator validator) => validator.ValidateWhitespace(await t.ConfigureAwait(false)); 539static async Task ValidateText(Task<string> t, XmlSchemaValidator validator) => validator.ValidateText(await t.ConfigureAwait(false)); 542private async Task ProcessElementEventAsync() 628private async Task ProcessEndElementEventAsync() 651private async Task ProcessInlineSchemaAsync()
System\Xml\Resolvers\XmlPreloadedResolverAsync.cs (2)
32return Task.FromResult<object>(data.AsStream()); 36return Task.FromResult<object>(data.AsTextReader());
System\Xml\Schema\DtdParserAsync.cs (22)
42private async Task ParseAsync(bool saveInternalSubset) 70private async Task ParseInDocumentDtdAsync(bool saveInternalSubset) 119private async Task ParseFreeFloatingDtdAsync() 134private Task ParseInternalSubsetAsync() 140private async Task ParseExternalSubsetAsync() 168private async Task ParseSubsetAsync() 288private async Task ParseAttlistDeclAsync() 396private async Task ParseAttlistTypeAsync(SchemaAttDef attrDef, SchemaElementDecl elementDecl, bool ignoreErrors) 525private async Task ParseAttlistDefaultAsync(SchemaAttDef attrDef, bool ignoreErrors) 572private async Task ParseElementDeclAsync() 659private async Task ParseElementOnlyContentAsync(ParticleContentValidator pcv, int startParenEntityId) 749private async Task ParseHowManyAsync(ParticleContentValidator pcv) 767private async Task ParseElementMixedContentAsync(ParticleContentValidator pcv, int startParenEntityId) 838private async Task ParseEntityDeclAsync() 935private async Task ParseNotationDeclAsync() 986private async Task ParseCommentAsync() 1016private async Task ParsePIAsync() 1032private async Task ParseCondSectionAsync() 2380private Task ScanNameAsync() 2385private Task ScanQNameAsync() 2390private async Task ScanQNameAsync(bool isQName) 2476private async Task ScanNmtokenAsync()
System\Xml\Schema\ParserAsync.cs (1)
16public async Task StartParsingAsync(XmlReader reader, string? targetNamespace)
System\Xml\XmlDownloadManager.cs (1)
32return Task.FromResult<Stream>(new FileStream(fileUri.LocalPath, FileMode.Open, FileAccess.Read, FileShare.Read, 1, useAsync: true));
System\Xml\XmlResolver.FileSystemResolver.cs (1)
48return Task.FromResult<object>(new FileStream(absoluteUri.LocalPath, FileMode.Open, FileAccess.Read, FileShare.Read, 1, useAsync: true));
System.Private.Xml.Linq (37)
System\Xml\Linq\XCData.cs (2)
67public override Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken) 72return Task.FromCanceled(cancellationToken);
System\Xml\Linq\XComment.cs (2)
108public override Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken) 113return Task.FromCanceled(cancellationToken);
System\Xml\Linq\XContainer.cs (4)
860internal async Task ReadContentFromAsync(XmlReader r, CancellationToken cancellationToken) 876internal async Task ReadContentFromAsync(XmlReader r, LoadOptions o, CancellationToken cancellationToken) 1407internal async Task WriteContentToAsync(XmlWriter writer, CancellationToken cancellationToken) 1417Task tWrite;
System\Xml\Linq\XDocument.cs (8)
464return Task.FromCanceled<XDocument>(cancellationToken); 627public async Task SaveAsync(Stream stream, SaveOptions options, CancellationToken cancellationToken) 712public async Task SaveAsync(TextWriter textWriter, SaveOptions options, CancellationToken cancellationToken) 759public Task SaveAsync(XmlWriter writer, CancellationToken cancellationToken) 833public override Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken) 838return Task.FromCanceled(cancellationToken); 842private async Task WriteToAsyncInternal(XmlWriter writer, CancellationToken cancellationToken) 844Task tStart;
System\Xml\Linq\XDocumentType.cs (2)
160public override Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken) 165return Task.FromCanceled(cancellationToken);
System\Xml\Linq\XElement.cs (9)
840return Task.FromCanceled<XElement>(cancellationToken); 1080public async Task SaveAsync(Stream stream, SaveOptions options, CancellationToken cancellationToken) 1142public async Task SaveAsync(TextWriter textWriter, SaveOptions options, CancellationToken cancellationToken) 1177public Task SaveAsync(XmlWriter writer, CancellationToken cancellationToken) 1182return Task.FromCanceled(cancellationToken); 1186private async Task SaveAsyncInternal(XmlWriter writer, CancellationToken cancellationToken) 1315public override Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken) 1320return Task.FromCanceled(cancellationToken); 2027private async Task ReadElementFromAsync(XmlReader r, LoadOptions o, CancellationToken cancellationTokentoken)
System\Xml\Linq\XLinq.cs (4)
250public async Task WriteElementAsync(XElement e, CancellationToken cancellationToken) 350private async Task WriteEndElementAsync(CancellationToken cancellationToken) 363private async Task WriteFullEndElementAsync(CancellationToken cancellationToken) 389private async Task WriteStartElementAsync(XElement e, CancellationToken cancellationToken)
System\Xml\Linq\XNode.cs (2)
466return Task.FromCanceled<XNode>(cancellationToken); 617public abstract Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken);
System\Xml\Linq\XProcessingInstruction.cs (2)
134public override Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken) 139return Task.FromCanceled(cancellationToken);
System\Xml\Linq\XText.cs (2)
106public override Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken) 111return Task.FromCanceled(cancellationToken);
System.Runtime (1)
src\runtime\artifacts\obj\System.Runtime\Release\net11.0\System.Runtime.Forwards.cs (1)
841[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.Task))]
System.Runtime.InteropServices.JavaScript (26)
System\Runtime\InteropServices\JavaScript\CancelablePromise.cs (1)
12public static unsafe void CancelPromise(Task promise)
System\Runtime\InteropServices\JavaScript\Interop\JavaScriptExports.CoreCLR.cs (1)
139var result = JSHostImplementation.BindAssemblyExports(assemblyName);
System\Runtime\InteropServices\JavaScript\JSHostImplementation.CoreCLR.cs (2)
18public static Task BindAssemblyExports(string? assemblyName) 34return Task.CompletedTask;
System\Runtime\InteropServices\JavaScript\JSHostImplementation.cs (7)
19public static bool GetTaskResultDynamic(Task task, out object? value) 22if (type == typeof(Task)) 237result = Task.FromResult(intResult); 239else if (method.ReturnType == typeof(Task)) 241Task methodResult = (Task)method.Invoke(null, argsToPass)!; 270return Task.FromException<int>(ex);
System\Runtime\InteropServices\JavaScript\JSMarshalerType.cs (1)
234/// <param name="result">Metadata about the type of the <see cref="System.Threading.Tasks.Task"/> result value.</param>
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Object.cs (3)
285else if (typeof(Task).IsAssignableFrom(type)) 287Task? val = value as Task;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Task.cs (11)
41public unsafe void ToManaged(out Task? value) 99/// <param name="marshaler">The generated callback which marshals the result value of the <see cref="Task"/>.</param> 100/// <typeparam name="T">Type of marshaled result of the <see cref="Task"/>.</typeparam> 158internal void ToJSDynamic(Task? value) 160Task? task = value; 224static void Complete(Task task, object? th) 255public void ToJS(Task? value) 257Task? task = value; 310static void Complete(Task task, object? th) 329/// <param name="marshaler">The generated callback which marshals the result value of the <see cref="System.Threading.Tasks.Task"/>.</param> 330/// <typeparam name="T">Type of marshaled result of the <see cref="System.Threading.Tasks.Task"/>.</typeparam>
System.Security.Cryptography (11)
src\runtime\src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (5)
67await ((Task)task).ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing); 197Task sendTask = (Task)SendAsync(httpClient, requestMessage, cancellationToken); 236Task sendTask = (Task)SendAsync(httpClient, requestMessage, cancellationToken);
System\Security\Cryptography\CryptoStream.cs (6)
192public override Task FlushAsync(CancellationToken cancellationToken) 202Task.FromCanceled(cancellationToken) : 203!_canWrite ? Task.CompletedTask : 456public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 713public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) 719private async Task CopyToAsyncInternal(Stream destination, int bufferSize, CancellationToken cancellationToken)
System.Security.Cryptography.Cose (4)
System\Security\Cryptography\Cose\CoseMessage.cs (1)
475internal static async Task AppendToBeSignedAsync(
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (3)
466private static async Task WriteSignatureAsync( 827public Task AddSignatureForDetachedAsync(Stream detachedContent, CoseSigner signer, ReadOnlyMemory<byte> associatedData = default, CancellationToken cancellationToken = default) 839private async Task AddSignatureCoreAsync(Stream content, CoseSigner signer, ReadOnlyMemory<byte> associatedData, CancellationToken cancellationToken)
System.Security.Principal.Windows (3)
System\Security\Principal\WindowsIdentity.cs (3)
714/// <returns>A <see cref="Task"/> that represents the asynchronous operation of the provided <see cref="System.Func{Task}"/>.</returns> 715public static Task RunImpersonatedAsync(SafeAccessTokenHandle safeAccessTokenHandle, Func<Task> func)
System.ServiceModel.Federation (27)
System\IdentityModel\Security\WrapperSecurityCommunicationObject.cs (10)
110internal Task OnCloseAsync(TimeSpan timeout) 115internal Task OnOpenAsync(TimeSpan timeout) 284public virtual Task OnCloseAsync(TimeSpan timeout) 286return Task.CompletedTask; 302public virtual Task OnOpenAsync(TimeSpan timeout) 304return Task.CompletedTask; 450public Task OnCloseAsync(TimeSpan timeout) 452return Task.CompletedTask; 482public Task OnOpenAsync(TimeSpan timeout) 484return Task.CompletedTask;
System\Runtime\OperationWithTimeoutAsyncResult.cs (1)
25_ = Task.Factory.StartNew(s_scheduledCallback, this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
System\Runtime\TaskHelpers.cs (6)
73public static Task ToApm(this Task task, AsyncCallback callback, object state) 139Task task = iar as Task; 148public static void WaitForCompletionNoSpin(this Task task) 161public static bool WaitForCompletionNoSpin(this Task task, TimeSpan timeout)
System\ServiceModel\Federation\WSTrustChannel.cs (1)
361Message response = await Task.Factory.FromAsync(RequestChannel.BeginRequest, RequestChannel.EndRequest, requestMessage, null, TaskCreationOptions.None).ConfigureAwait(false);
System\ServiceModel\Federation\WSTrustChannelSecurityTokenProvider.cs (7)
243await Task.Factory.FromAsync(channel.BeginOpen, channel.EndOpen, null, TaskCreationOptions.None); 247Message reply = await Task.Factory.FromAsync(channel.BeginRequest, channel.EndRequest, requestMessage, null, TaskCreationOptions.None); 254await Task.Factory.FromAsync(channel.BeginClose, channel.EndClose, null, TaskCreationOptions.None); 448async Task ISecurityCommunicationObject.OnCloseAsync(TimeSpan timeout) 452await Task.Factory.FromAsync(ChannelFactory.BeginClose, ChannelFactory.EndClose, timeout, null, TaskCreationOptions.None); 457async Task ISecurityCommunicationObject.OnOpenAsync(TimeSpan timeout) 469await Task.Factory.FromAsync(channelFactory.BeginOpen, channelFactory.EndOpen, null, TaskCreationOptions.None);
System\ServiceModel\Security\ISecurityCommunicationObject.cs (2)
15Task OnCloseAsync(TimeSpan timeout); 19Task OnOpenAsync(TimeSpan timeout);
System.ServiceModel.Http (48)
System\ServiceModel\Channels\ClientWebSocketTransportDuplexSessionChannel.cs (2)
57protected internal override async Task OnOpenAsync(TimeSpan timeout) 138private async Task ConfigureClientWebSocketAsync(ClientWebSocket clientWebSocket, TimeSpan timeout)
System\ServiceModel\Channels\HttpChannelFactory.cs (8)
598internal protected override Task OnOpenAsync(TimeSpan timeout) 604protected internal override Task OnCloseAsync(TimeSpan timeout) 764return Task.FromResult(result); 827private async Task CreateAndOpenTokenProvidersAsync(TimeSpan timeout) 868internal protected override Task OnOpenAsync(TimeSpan timeout) 900protected internal override async Task OnCloseAsync(TimeSpan timeout) 993public async Task SendRequestAsync(Message message, TimeoutHelper timeoutHelper) 1339private async Task SendPreauthenticationHeadRequestIfNeeded()
System\ServiceModel\Channels\HttpChannelHelpers.cs (1)
65return Task.FromResult(result);
System\ServiceModel\Channels\HttpsChannelFactory.cs (3)
147protected internal override async Task OnOpenAsync(TimeSpan timeout) 321private async Task CreateAndOpenTokenProviderAsync(TimeSpan timeout) 360internal protected override async Task OnOpenAsync(TimeSpan timeout)
System\ServiceModel\Channels\MessageContent.cs (6)
39internal Task WriteCompletionTask { get { return _writeCompletedTcs.Task; } } 186Task.Factory.StartNew(async (content) => 200return Task.FromResult<Stream>(resultStream); 203protected override async Task SerializeToStreamAsync(Stream stream, TransportContext context) 240return Task.FromResult(_stream); 253protected override async Task SerializeToStreamAsync(Stream stream, TransportContext context)
System\ServiceModel\Channels\TransportDuplexSessionChannel.cs (7)
223protected abstract Task CloseOutputSessionCoreAsync(TimeSpan timeout); 227protected async Task CloseOutputSessionAsync(TimeSpan timeout) 351protected internal override async Task OnCloseAsync(TimeSpan timeout) 445protected override async Task OnSendAsync(Message message, TimeSpan timeout) 612private async Task EnsureInputClosedAsync(TimeSpan timeout) 726public Task CloseOutputSessionAsync() 731public Task CloseOutputSessionAsync(TimeSpan timeout)
System\ServiceModel\Channels\WebSocketHelper.cs (2)
188internal static void ThrowExceptionOnTaskFailure(Task task, TimeSpan timeout, string operation) 201internal static Exception CreateExceptionOnTaskFailure(Task task, TimeSpan timeout, string operation)
System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (19)
82Task closeTask = CloseAsync(); 101Task task = CloseOutputAsync(CancellationToken.None); 105protected override async Task CloseOutputSessionCoreAsync(TimeSpan timeout) 149protected internal override async Task OnCloseAsync(TimeSpan timeout) 181Task task = WebSocket.SendAsync(messageData, outgoingMessageType, true, helper.GetCancellationToken()); 232Task task = CloseOutputAsync(helper.GetCancellationToken()); 273Task task = WebSocket.SendAsync(messageData, outgoingMessageType, true, helper.GetCancellationToken()); 336private Task CloseAsync() 342return Task.CompletedTask; // Nothing to do here. 358private Task CloseOutputAsync(CancellationToken cancellationToken) 380private async void HandleCloseOutputAsyncCompletion(Task task, TimeSpan timeout, Action<object> callback, object state) 396private async void HandleSendAsyncCompletion(Task task, TimeSpan timeout, Action<object> callback, object state) 533private async Task ReadBufferedMessageAsync() 1002return Task.FromResult(0); 1007return Task.FromResult(GetBytesFromInitialReadBuffer(buffer, offset, count)); 1014return Task.FromResult(0); 1095public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 1135private async Task WriteAsyncInternal(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 1155Task task = _webSocket.SendAsync(new ArraySegment<byte>(Array.Empty<byte>(), 0, 0), _outgoingMessageType, true, timeoutHelper.GetCancellationToken());
System.ServiceModel.NetFramingBase (45)
System\ServiceModel\Channels\Connection.cs (1)
191public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\ServiceModel\Channels\ConnectionPool.cs (2)
332var closeTasks = new List<Task>(itemsToClose.Count); 340await Task.WhenAll(closeTasks);
System\ServiceModel\Channels\FramingChannels.cs (2)
268internal protected override async Task OnOpenAsync(TimeSpan timeout) 374public static async Task DecodeFramingFaultAsync(ClientFramingDecoder decoder, IConnection connection,
System\ServiceModel\Channels\NetFramingTransportChannelFactory.cs (5)
331internal protected override Task OnOpenAsync(TimeSpan timeout) 336return Task.Factory.FromAsync(localUpgrade.BeginOpen, localUpgrade.EndOpen, timeout, null); 338return Task.CompletedTask; 341internal protected override async Task OnCloseAsync(TimeSpan timeout) 357await Task.Factory.FromAsync(localUpgrade.BeginClose, localUpgrade.EndClose, timeoutHelper.RemainingTime(), null);
System\ServiceModel\Channels\OutputChannel.cs (3)
68protected abstract Task OnSendAsync(Message message, TimeSpan timeout); 95public Task SendAsync(Message message) 100public Task SendAsync(Message message, TimeSpan timeout)
System\ServiceModel\Channels\SingletonConnectionReader.cs (2)
560public async static Task WriteMessageAsync(Message message, IConnection connection, bool isRequest, 634public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken = default)
System\ServiceModel\Channels\SslStreamSecurityUpgradeProvider.cs (2)
161protected internal override Task OnCloseAsync(TimeSpan timeout) 208protected internal override async Task OnOpenAsync(TimeSpan timeout)
System\ServiceModel\Channels\StreamedFramingRequestChannel.cs (6)
36protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) => Task.CompletedTask.ToApm(callback, state); 42protected internal override Task OnOpenAsync(TimeSpan timeout) => Task.CompletedTask; 110protected internal override Task OnCloseAsync(TimeSpan timeout) => Task.CompletedTask; 213public async Task SendRequestAsync(Message message, TimeoutHelper timeoutHelper)
System\ServiceModel\Channels\TransportDuplexSessionChannel.cs (6)
233protected async Task CloseOutputSessionAsync(TimeSpan timeout) 302protected internal override async Task OnCloseAsync(TimeSpan timeout) 392protected override async Task OnSendAsync(Message message, TimeSpan timeout) 530private async Task EnsureInputClosedAsync(TimeSpan timeout) 644public Task CloseOutputSessionAsync() 649public Task CloseOutputSessionAsync(TimeSpan timeout)
System\ServiceModel\Channels\WindowsStreamSecurityUpgradeProvider.cs (6)
71return Task.CompletedTask.ToApm(callback, state); 79protected internal override Task OnCloseAsync(TimeSpan timeout) 81return Task.CompletedTask; 90return Task.CompletedTask.ToApm(callback, state); 98protected internal override Task OnOpenAsync(TimeSpan timeout) 100return Task.CompletedTask;
System\ServiceModel\Security\SecurityUtilsEx.cs (10)
38internal static Task CloseTokenProviderIfRequiredAsync(SecurityTokenProvider tokenProvider, TimeSpan timeout) 43internal static Task OpenTokenProviderIfRequiredAsync(SecurityTokenProvider tokenProvider, TimeSpan timeout) 53internal static Task CloseTokenAuthenticatorIfRequiredAsync(SecurityTokenAuthenticator tokenAuthenticator, TimeSpan timeout) 58internal static Task OpenTokenAuthenticatorIfRequiredAsync(SecurityTokenAuthenticator tokenAuthenticator, TimeSpan timeout) 85private static Task CloseCommunicationObjectAsync(object obj, TimeSpan timeout) 92return Task.Factory.FromAsync(co.BeginClose, co.EndClose, timeout, null, TaskCreationOptions.None); 100return Task.CompletedTask; 103private static Task OpenCommunicationObjectAsync(ICommunicationObject obj, TimeSpan timeout) 107return Task.Factory.FromAsync(obj.BeginOpen, obj.EndOpen, timeout, null); 110return Task.CompletedTask;
System.ServiceModel.NetNamedPipe (2)
System\Runtime\BackoffTimeoutHelper.cs (2)
64public async Task WaitAndBackoffAsync() 66await Task.Delay(WaitTimeWithDrift());
System.ServiceModel.NetTcp (2)
System\ServiceModel\Channels\SocketAwaitableEventArgs.cs (2)
45: new ValueTask<int>(Task.FromException<int>(CreateException(error))); 62: new ValueTask(Task.FromException(CreateException(error)));
System.ServiceModel.Primitives (428)
Internals\System\Runtime\ActionItem.cs (13)
34public static void Schedule(Func<object, Task> callback, object state) 50protected abstract Task InvokeAsync(); 80private static void ScheduleCallback(Func<object, Task> callback, object state) 86Task<Task>.Factory.StartNew(callback, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, IOThreadScheduler.IOTaskScheduler); 94private void ScheduleCallback(Func<object, Task> callback) 102private static Func<object, Task> s_invokeAsyncCallback; 122public static Func<object, Task> InvokeAsyncCallbackFunc 128s_invokeAsyncCallback = new Func<object, Task>(InvokeAsyncCallback); 134private static async Task InvokeAsyncCallback(object state) 149private Func<object, Task> _asyncCallback; 171public DefaultActionItem(Func<object, Task> callback, object state) 204protected override Task InvokeAsync() 261private async Task TraceAndInvokeAsync()
Internals\System\Runtime\InputQueue.cs (3)
529return Task.FromResult(true); 534return Task.FromResult(true); 544return Task.FromResult(itemAvailable);
Internals\System\Runtime\IOThreadScheduler.cs (1)
131Task.Factory.StartNew(callback, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
Internals\System\Runtime\IOThreadTimer.cs (3)
36private Func<object, Task> asyncCallback; 44public IOThreadTimer(Func<object, Task> asyncCallback, object callbackState, bool isTypicallyCanceledShortlyAfterBeingSet) 55public IOThreadTimer(Action<object> callback, Func<object, Task> asyncCallback, object callbackState, bool isTypicallyCanceledShortlyAfterBeingSet, int maxSkewInMilliseconds)
Internals\System\Runtime\ServiceModelSynchronizationContext.cs (1)
16Task.Factory.StartNew((s) => d(s), state, default, TaskCreationOptions.RunContinuationsAsynchronously, IOThreadScheduler.IOTaskScheduler);
Internals\System\Runtime\TaskHelpers.cs (23)
16public static async Task AsyncWait<TException>(this Task task) 88public static Task ToApm(this Task task, AsyncCallback callback, object state) 154Task task = iar as Task; 191public static Task CloseHelperAsync(this ICommunicationObject communicationObject, TimeSpan timeout) 199return Task.Factory.FromAsync(communicationObject.BeginClose, communicationObject.EndClose, timeout, null); 203public static Task OpenHelperAsync(this ICommunicationObject communicationObject, TimeSpan timeout) 211return Task.Factory.FromAsync(communicationObject.BeginOpen, communicationObject.EndOpen, timeout, null); 219public static async Task<bool> AwaitWithTimeout(this Task task, TimeSpan timeout) 234var completedTask = await Task.WhenAny(task, Task.Delay(timeout, cts.Token)); 250public static void WaitForCompletion(this Task task) 262public static void WaitForCompletionNoSpin(this Task task) 297public static bool WaitForCompletionNoSpin(this Task task, TimeSpan timeout) 325public static void Wait(this Task task, TimeSpan timeout, Action<Exception, TimeSpan, string> exceptionConverter, string operationType) 349public static Task CompletedTask() 351return Task.FromResult(true); 383public static async Task CallActionAsync<TArg>(Action<TArg> action, TArg argument) 392await Task.Yield(); 452Task.Run(continuation);
Internals\System\Runtime\TimeoutHelper.cs (1)
337tokenTask = Task.FromResult(new CancellationTokenSource(millisecondsTimeout).Token);
Internals\System\Xml\XmlMtomWriter.cs (15)
211public override async Task WriteStartElementAsync(string prefix, string localName, string ns) 255public override async Task WriteEndElementAsync() 289public override Task WriteValueAsync(IStreamProvider value) 302return Task.CompletedTask; 355private Task WriteBase64InlineIfPresentAsync() 363return Task.CompletedTask; 386private async Task WriteBase64InlineAsync() 448private async Task WriteXOPIncludeAsync() 535private async Task WriteXOPBinaryPartsAsync() 585private async Task WriteMimeHeadersAsync(string contentID, string contentType, string contentTransferEncoding) 684public override Task FlushAsync() 689return Task.CompletedTask; 1235internal async Task StartPartAsync() 1283internal async Task CloseAsync() 1317private async Task FlushAsync()
System\IdentityModel\Selectors\KerberosSecurityTokenProvider.cs (1)
65return Task.FromResult(GetToken(timeout, null));
System\IdentityModel\Selectors\SecurityTokenProvider.cs (7)
93return Task.FromResult(GetTokenCore(timeout)); 178return Task.FromResult(RenewTokenCore(timeout, tokenToBeRenewed)); 213public async Task CancelTokenAsync(TimeSpan timeout, SecurityToken token) 238protected virtual Task CancelTokenCoreAsync(TimeSpan timeout, SecurityToken token) 240return Task.Factory.FromAsync(BeginCancelTokenCore, EndCancelTokenCore, timeout, token, null); 243internal virtual Task CancelTokenCoreInternalAsync(TimeSpan timeout, SecurityToken token) 246return Task.CompletedTask;
System\IdentityModel\Selectors\UserNameSecurityTokenProvider.cs (1)
33return Task.FromResult((SecurityToken)_userNameToken);
System\IdentityModel\Selectors\X509SecurityTokenProvider.cs (1)
45return Task.FromResult<SecurityToken>(GetTokenCore(timeout));
System\ServiceModel\ChannelFactory.cs (2)
285internal protected override async Task OnCloseAsync(TimeSpan timeout) 303protected internal override async Task OnOpenAsync(TimeSpan timeout)
System\ServiceModel\Channels\BodyWriter.cs (3)
92protected virtual Task OnWriteBodyContentsAsync(XmlDictionaryWriter writer) 95return Task.CompletedTask; 135internal Task WriteBodyContentsAsync(XmlDictionaryWriter writer)
System\ServiceModel\Channels\BufferedReadStream.cs (12)
149public override Task FlushAsync(CancellationToken cancellationToken) 152return Task.CompletedTask; 264t = Task.FromResult(val); 269public async Task PreReadBufferAsync(byte preBufferedByte, CancellationToken cancellationToken) 277public Task PreReadBufferAsync(CancellationToken cancellationToken) 284return Task.CompletedTask; 287private async Task PreReadBufferAsyncInternal(CancellationToken cancellationToken) 312return Task.FromCanceled<int>(cancellationToken); 322Task semaphoreLockTask = _sem.WaitAsync(cancellationToken); 344: Task.FromException<int>(error); 371Task semaphoreLockTask) 441public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\ServiceModel\Channels\BufferedWriteStream.cs (11)
174public override Task FlushAsync(CancellationToken cancellationToken) 178return Task.FromCanceled<int>(cancellationToken); 186private async Task FlushAsyncInternal(CancellationToken cancellationToken) 220private async Task FlushWriteAsync(CancellationToken cancellationToken) 405public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) 414return Task.FromCanceled<int>(cancellationToken); 423Task semaphoreLockTask = _sem.WaitAsync(cancellationToken); 441? Task.CompletedTask 442: Task.FromException(error); 459private async Task WriteToUnderlyingStreamAsync(byte[] array, int offset, int count, 461Task semaphoreLockTask)
System\ServiceModel\Channels\ChannelFactoryBase.cs (3)
67protected internal override Task OnCloseAsync(TimeSpan timeout) 190protected internal override Task OnCloseAsync(TimeSpan timeout) 205private async Task OnCloseAsyncInternal(TimeSpan timeout)
System\ServiceModel\Channels\ChannelReliableSession.cs (6)
129public abstract Task OpenAsync(TimeSpan timeout); 131public virtual async Task CloseAsync(TimeSpan timeout) 544public delegate Task PollingHandler(); 600public override async Task OpenAsync(TimeSpan timeout) 623public override async Task CloseAsync(TimeSpan timeout) 672private async Task OnPollingTimerElapsed(object state)
System\ServiceModel\Channels\ClientReliableChannelBinder.cs (10)
120protected override Task OnCloseAsync(TimeSpan timeout) 122return Task.CompletedTask; 125protected override Task OnOpenAsync(TimeSpan timeout) 127return Task.CompletedTask; 220return Task.FromResult(true); 272protected override Task OnSendAsync(TDuplexChannel channel, Message message, 281return Task.Factory.FromAsync(channel.BeginSend, channel.EndSend, message, timeout, null); 364protected override Task CloseChannelAsync(IDuplexSessionChannel channel, TimeSpan timeout) 458return Task.Factory.FromAsync(channel.BeginRequest, channel.EndRequest, message, timeout, null); 462protected override async Task OnSendAsync(TRequestChannel channel, Message message,
System\ServiceModel\Channels\ClientReliableDuplexSessionChannel.cs (26)
26protected static Func<object, Task> s_startReceivingAsyncStatic = new Func<object, Task>(StartReceivingAsyncStatic); 33_acknowledgementTimer = new IOThreadTimer(new Func<object, Task>(OnAcknowledgementTimeoutElapsedAsync), null, true); 82private Task CloseSequenceAsync(TimeSpan timeout) 192private async Task InternalCloseOutputSessionAsync(TimeSpan timeout) 237protected async Task ProcessDuplexMessageAsync(WsrmMessageInfo info) 620protected abstract Task ProcessMessageAsync(WsrmMessageInfo info); 647private async Task OnAcknowledgementTimeoutElapsedAsync(object state) 715protected internal override async Task OnCloseAsync(TimeSpan timeout) 750protected async Task OnCloseOutputSessionAsync(TimeSpan timeout) 824protected override async Task OnSendAsync(Message message, TimeSpan timeout) 830private async Task OnSendAsyncHandler(MessageAttemptInfo attemptInfo, TimeSpan timeout, bool maskUnhandledException) 876private async Task OnSendAckRequestedAsyncHandler(TimeSpan timeout) 923private static Task StartReceivingAsyncStatic(object state) 929protected async Task StartReceivingAsync() 981private async Task TerminateSequenceAsync(TimeSpan timeout) 1078private static Func<object, Task> s_onReconnectTimerElapsed = new Func<object, Task>(OnReconnectTimerElapsed); 1114protected internal override Task OnCloseAsync(TimeSpan timeout) 1149protected internal override async Task OnOpenAsync(TimeSpan timeout) 1181private static async Task OnReconnectTimerElapsed(object state) 1203private async Task PollingAsyncCallback() 1212protected override Task ProcessMessageAsync(WsrmMessageInfo info) 1215return Task.CompletedTask; 1218return Task.CompletedTask; 1223private async Task ReconnectAsync()
System\ServiceModel\Channels\CommunicationObject.cs (16)
223private async Task CloseAsyncInternal(TimeSpan timeout) 229async Task IAsyncCommunicationObject.CloseAsync(TimeSpan timeout) 306private async Task OnCloseAsyncInternal(TimeSpan timeout) 327await Task.Factory.FromAsync(OnBeginClose, OnEndClose, timeout, TaskCreationOptions.RunContinuationsAsynchronously); 501private Task OpenAsyncInternal(TimeSpan timeout) 506async Task IAsyncCommunicationObject.OpenAsync(TimeSpan timeout) 556private async Task OnOpenAsyncInternal(TimeSpan timeout) 576await Task.Factory.FromAsync(OnBeginOpen, OnEndOpen, timeout, TaskCreationOptions.RunContinuationsAsynchronously); 997internal protected virtual Task OnCloseAsync(TimeSpan timeout) 1006internal protected virtual Task OnOpenAsync(TimeSpan timeout) 1017internal Task OpenOtherAsync(ICommunicationObject other, TimeSpan timeout) 1041return Task.Factory.FromAsync(other.BeginOpen, other.EndOpen, timeout, null); 1047internal Task CloseOtherAsync(ICommunicationObject other, TimeSpan timeout) 1071return Task.Factory.FromAsync(other.BeginClose, other.EndClose, timeout, null); 1171public static async Task OnCloseAsyncInternal(CommunicationObject communicationObject, TimeSpan timeout) 1177public static async Task OnOpenAsyncInternal(CommunicationObject communicationObject, TimeSpan timeout)
System\ServiceModel\Channels\DelegatingStream.cs (3)
75public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) => BaseStream.CopyToAsync(destination, bufferSize, cancellationToken); 77public override Task FlushAsync(CancellationToken cancellationToken) => BaseStream.FlushAsync(cancellationToken); 104public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => BaseStream.WriteAsync(buffer, offset, count, cancellationToken);
System\ServiceModel\Channels\DuplexChannel.cs (3)
21public Task SendAsync(Message message) 26public Task SendAsync(Message message, TimeSpan timeout) 72protected abstract Task OnSendAsync(Message message, TimeSpan timeout);
System\ServiceModel\Channels\IDuplexSession.cs (2)
21Task CloseOutputSessionAsync(); 22Task CloseOutputSessionAsync(TimeSpan timeout);
System\ServiceModel\Channels\InputQueueChannel.cs (2)
135protected internal override Task OnCloseAsync(TimeSpan timeout) 138return Task.CompletedTask;
System\ServiceModel\Channels\IOutputChannel.cs (2)
23Task SendAsync(Message message); 24Task SendAsync(Message message, TimeSpan timeout);
System\ServiceModel\Channels\IReliableChannelBinder.cs (5)
26Task CloseAsync(TimeSpan timeout); 27Task CloseAsync(TimeSpan timeout, MaskingMode maskingMode); 28Task OpenAsync(TimeSpan timeout); 29Task SendAsync(Message message, TimeSpan timeout); 30Task SendAsync(Message message, TimeSpan timeout, MaskingMode maskingMode);
System\ServiceModel\Channels\LayeredChannel.cs (2)
51protected internal override Task OnCloseAsync(TimeSpan timeout) 62protected internal override Task OnOpenAsync(TimeSpan timeout)
System\ServiceModel\Channels\LayeredChannelFactory.cs (14)
57protected internal override async Task OnCloseAsync(TimeSpan timeout) 71protected internal override Task OnOpenAsync(TimeSpan timeout) 100private Task InternalOnReceiveAsync(Message message) 107return Task.CompletedTask; 110protected virtual Task OnReceiveAsync(Message message) 112return Task.CompletedTask; 129message = await Task.Factory.FromAsync(InnerChannel.BeginReceive, InnerChannel.EndReceive, timeout, null); 145message = await Task.Factory.FromAsync(InnerChannel.BeginReceive, InnerChannel.EndReceive, null); 216return Task.Factory.FromAsync(InnerChannel.BeginWaitForMessage, InnerChannel.EndWaitForMessage, timeout, null); 282protected internal override async Task OnCloseAsync(TimeSpan timeout) 295protected internal override async Task OnOpenAsync(TimeSpan timeout) 309public Task SendAsync(Message message) 314public Task SendAsync(Message message, TimeSpan timeout) 322return Task.Factory.FromAsync(_innerOutputChannel.BeginSend, _innerOutputChannel.EndSend, message, timeout, null);
System\ServiceModel\Channels\LifetimeManager.cs (2)
66public async Task CloseAsync(TimeSpan timeout) 245protected virtual async Task OnCloseAsync(TimeSpan timeout)
System\ServiceModel\Channels\MaxMessageSizeStream.cs (1)
60public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\ServiceModel\Channels\Message.cs (7)
451public Task WriteBodyContentsAsync(XmlDictionaryWriter writer) 470protected virtual Task OnWriteBodyContentsAsync(XmlDictionaryWriter writer) 714public virtual Task WriteMessageAsync(XmlWriter writer) 720public virtual async Task WriteMessageAsync(XmlDictionaryWriter writer) 726public virtual async Task OnWriteMessageAsync(XmlDictionaryWriter writer) 814internal async Task WriteMessagePostambleAsync(XmlDictionaryWriter writer) 1194protected override Task OnWriteBodyContentsAsync(XmlDictionaryWriter writer)
System\ServiceModel\Channels\OutputChannel.cs (3)
68protected abstract Task OnSendAsync(Message message, TimeSpan timeout); 95public Task SendAsync(Message message) 100public Task SendAsync(Message message, TimeSpan timeout)
System\ServiceModel\Channels\ProducerConsumerStream.cs (1)
107public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\ServiceModel\Channels\ReliableChannelBinder.cs (17)
236public Task CloseAsync(TimeSpan timeout) 241public async Task CloseAsync(TimeSpan timeout, MaskingMode maskingMode) 314protected virtual Task CloseChannelAsync(TChannel channel, TimeSpan timeout) 453protected abstract Task OnCloseAsync(TimeSpan timeout); 489protected abstract Task OnOpenAsync(TimeSpan timeout); 544protected virtual Task OnSendAsync(TChannel channel, Message message, TimeSpan timeout) 554public async Task OpenAsync(TimeSpan timeout) 601public Task SendAsync(Message message, TimeSpan timeout) 606public async Task SendAsync(Message message, TimeSpan timeout, MaskingMode maskingMode) 823internal Task WaitForPendingOperationsAsync(TimeSpan timeout) 1449public async Task StartSynchronizingAsync() 1665public async Task WaitForPendingOperationsAsync(TimeSpan timeout) 1895return Task.CompletedTask.ToApm(callback, state); 1967private async Task OnReplyAsync(Message message, TimeSpan timeout) 1976await Task.Factory.FromAsync(_innerContext.BeginReply, _innerContext.EndReply, message, timeout, null); 2004internal static async Task CloseDuplexSessionChannelAsync( 2085internal static async Task CloseReplySessionChannelAsync(
System\ServiceModel\Channels\ReliableChannelFactory.cs (2)
67protected internal override Task OnOpenAsync(TimeSpan timeout) 87protected internal override async Task OnCloseAsync(TimeSpan timeout)
System\ServiceModel\Channels\ReliableInputConnection.cs (1)
220public async Task CloseAsync(TimeSpan timeout)
System\ServiceModel\Channels\ReliableMessagingHelpers.cs (19)
16internal delegate Task OperationWithTimeoutAsyncCallback(TimeSpan timeout); 38public async Task CloseAsync(TimeSpan timeout) 109public delegate Task AsyncWaitCallback(object state); 115private static Func<object, Task> s_onTimerElapsedAsync = new Func<object, Task>(OnTimerElapsedAsync); 201private Task OnTimerElapsedAsync() 206return Task.CompletedTask; 220private static Task OnTimerElapsedAsync(object state) 471public abstract Task CloseAsync(TimeSpan timeout); 472public abstract Task SendFaultAsync(IReliableChannelBinder binder, RequestContext requestContext, Message faultMessage); 529private async Task AsyncCloseBinder(IReliableChannelBinder binder) 573public override async Task CloseAsync(TimeSpan timeout) 582protected abstract Task SendFaultAsync(IReliableChannelBinder binder, TState state, TimeSpan timeout); 607protected async Task SendFaultAsync(IReliableChannelBinder binder, TState state) 627public override async Task SendFaultAsync(IReliableChannelBinder binder, RequestContext requestContext, Message faultMessage) 694protected override async Task SendFaultAsync(IReliableChannelBinder binder, FaultState faultState, TimeSpan timeout) 697await Task.Factory.FromAsync(context.BeginReply, context.EndReply, faultState.FaultMessage, timeout, null); 724protected override async Task SendFaultAsync(IReliableChannelBinder binder, Message message, TimeSpan timeout) 857return Task.FromResult(true);
System\ServiceModel\Channels\ReliableOutputConnection.cs (10)
12internal delegate Task SendAsyncHandler(MessageAttemptInfo attemptInfo, TimeSpan timeout, bool maskUnhandledException); 15internal delegate Task RetryHandler(MessageAttemptInfo attemptInfo); 19private static Func<object, Task> s_sendRetries = new Func<object, Task>(SendRetries); 65private Task CompleteTransferAsync(TimeSpan timeout) 91return Task.CompletedTask; 104public async Task CloseAsync(TimeSpan timeout) 200private async Task OnRetryTimeoutElapsed(MessageAttemptInfo attemptInfo) 295private async Task SendRetries() 336private static Task SendRetries(object state)
System\ServiceModel\Channels\ReliableOutputSessionChannel.cs (18)
97private async Task CloseSequenceAsync(TimeSpan timeout) 244protected internal override async Task OnCloseAsync(TimeSpan timeout) 265protected abstract Task OnConnectionSendAsync(Message message, TimeSpan timeout, bool saveHandledException, bool maskUnhandledException); 267private async Task OnConnectionSendAckRequestedAsyncHandler(TimeSpan timeout) 277private async Task OnConnectionSendAsyncHandler(MessageAttemptInfo attemptInfo, TimeSpan timeout, bool maskUnhandledException) 299protected abstract Task OnConnectionSendMessageAsync(Message message, TimeSpan timeout, MaskingMode maskingMode); 333protected internal override async Task OnOpenAsync(TimeSpan timeout) 353protected override async Task OnSendAsync(Message message, TimeSpan timeout) 376private async Task PollingAsyncCallback() 428protected async Task ProcessMessageAsync(Message message) 574private async Task TerminateSequenceAsync(TimeSpan timeout) 655protected override async Task OnConnectionSendAsync(Message message, TimeSpan timeout, 694protected override async Task OnConnectionSendMessageAsync(Message message, TimeSpan timeout, MaskingMode maskingMode) 734protected override async Task OnConnectionSendAsync(Message message, TimeSpan timeout, bool saveHandledException, bool maskUnhandledException) 766protected override Task OnConnectionSendMessageAsync(Message message, TimeSpan timeout, MaskingMode maskingMode) 791ActionItem.Schedule(new Func<object, Task>(StartReceivingAsync), this); 810private async Task StartReceivingAsync() 851private static Task StartReceivingAsync(object state)
System\ServiceModel\Channels\ReliableRequestSessionChannel.cs (10)
77private async Task CloseSequenceAsync(TimeSpan timeout) 248protected internal override async Task OnCloseAsync(TimeSpan timeout) 275private async Task OnConnectionSendAsync(MessageAttemptInfo attemptInfo, TimeSpan timeout, bool maskUnhandledException) 328private Task OnConnectionSendAckAsyncRequested(TimeSpan timeout) 330return Task.CompletedTask; 361protected internal override async Task OnOpenAsync(TimeSpan timeout) 398private async Task PollingCallback() 631private async Task TerminateSequenceAsync(TimeSpan timeout) 669private Task WaitForShutdownAsync(TimeSpan timeout) 742public async Task SendRequestAsync(Message message, TimeoutHelper timeoutHelper)
System\ServiceModel\Channels\RequestChannel.cs (2)
83internal protected async Task WaitForPendingRequestsAsync(TimeSpan timeout) 313Task SendRequestAsync(Message message, TimeoutHelper timeoutHelper);
System\ServiceModel\Channels\SecurityChannelFactory.cs (11)
78private Task CloseProtocolFactoryAsync(bool aborted, TimeSpan timeout) 87return Task.CompletedTask; 124protected internal override async Task OnCloseAsync(TimeSpan timeout) 173protected internal override async Task OnOpenAsync(TimeSpan timeout) 223private Task OnOpenCoreAsync(TimeSpan timeout) 279protected internal override async Task OnOpenAsync(TimeSpan timeout) 357public Task SendAsync(Message message) 362public async Task SendAsync(Message message, TimeSpan timeout) 374await Task.Factory.FromAsync(InnerChannel.BeginSend, InnerChannel.EndSend, message, timeoutHelper.RemainingTime(), null); 471Message reply = await Task.Factory.FromAsync(InnerChannel.BeginRequest, InnerChannel.EndRequest, message, timeoutHelper.RemainingTime(), null); 649return Task.Factory.FromAsync(InnerDuplexChannel.BeginWaitForMessage, InnerDuplexChannel.EndWaitForMessage, timeout, null);
System\ServiceModel\Channels\ServiceChannel.cs (2)
1295protected internal override async Task OnCloseAsync(TimeSpan timeout) 1337protected internal override async Task OnOpenAsync(TimeSpan timeout)
System\ServiceModel\Channels\ServiceChannelFactory.cs (6)
281protected internal override Task OnCloseAsync(TimeSpan timeout) 395private async Task OnCloseAsyncInternal(TimeSpan timeout) 469protected internal override Task OnCloseAsync(TimeSpan timeout) 474protected internal override Task OnOpenAsync(TimeSpan timeout) 495private new async Task OnCloseAsyncInternal(TimeSpan timeout) 504await Task.Factory.FromAsync(base.OnBeginClose, base.OnEndClose, timeoutHelper.RemainingTime(), TaskCreationOptions.None);
System\ServiceModel\Channels\ServiceChannelProxy.cs (6)
163public static Task CreateTask(ServiceChannel channel, MethodCall methodCall, ProxyOperationRuntime operation) 172private static Task CreateGenericTask(ServiceChannel channel, ProxyOperationRuntime operation, object[] inputParameters) 211private static Task CreateTask(ServiceChannel channel, ProxyOperationRuntime operation, object[] inputParameters) 263public Task Task { get { return (Task)_tcsInfo.TaskProperty.GetValue(_tcsInstance); } } 329Task task = TaskCreator.CreateTask(_serviceChannel, methodCall, operation);
System\ServiceModel\Channels\TextMessageEncoder.cs (1)
547private async Task WriteMessageAsyncInternal(Message message, Stream stream)
System\ServiceModel\Channels\TimeoutStream.cs (1)
97public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
System\ServiceModel\Channels\TransmissionStrategy.cs (4)
95_retryTimer = new IOThreadTimer(new Func<object, Task>(OnRetryElapsed), null, true); 286public Task OnRetryElapsed(object state) 295return Task.CompletedTask; 328return Task.CompletedTask;
System\ServiceModel\Channels\TransportChannelFactory.cs (1)
127internal protected override Task OnCloseAsync(TimeSpan timeout)
System\ServiceModel\ClientBase.cs (4)
308public Task OpenAsync() 313private async Task OpenAsync(TimeSpan timeout) 361public Task CloseAsync() 367private async Task CloseAsync(TimeSpan timeout)
System\ServiceModel\Description\ServiceReflector.cs (1)
387internal static readonly Type taskType = typeof(Task);
System\ServiceModel\Dispatcher\ChannelDispatcher.cs (2)
454protected internal override Task OnCloseAsync(TimeSpan timeout) 460protected internal override Task OnOpenAsync(TimeSpan timeout)
System\ServiceModel\Dispatcher\DispatchRuntime.cs (2)
397return Task.FromResult((object)Message.CreateMessage(message.Version, fault, message.Version.Addressing.DefaultFaultAction)); 403return Task.FromResult((object)null);
System\ServiceModel\Dispatcher\DuplexChannelBinder.cs (1)
1202Task.Factory.StartNew(s_receiveThreadSchedulerCallback, result, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
System\ServiceModel\Dispatcher\ListenerHandler.cs (8)
63protected internal override async Task OnCloseAsync(TimeSpan timeout) 77protected internal override Task OnOpenAsync(TimeSpan timeout) 140private async Task CloseChannelAsync(IChannel channel, TimeSpan timeout) 150await Task.Factory.FromAsync(duplexSession.BeginCloseOutputSession, duplexSession.EndCloseOutputSession, timeout, null); 199private async Task CloseChannelsAsync(TimeSpan timeout) 209Task[] closeTasks = new Task[channels.Length]; 214await Task.WhenAll(closeTasks);
System\ServiceModel\Dispatcher\OperationFormatter.cs (4)
53protected virtual Task SerializeBodyAsync(XmlDictionaryWriter writer, MessageVersion version, string action, MessageDescription messageDescription, object returnValue, object[] parameters, bool isRequest) 56return Task.CompletedTask; 373private async Task SerializeBodyContentsAsync(XmlDictionaryWriter writer, MessageVersion version, object[] parameters, object returnValue, bool isRequest) 777protected override Task OnWriteBodyContentsAsync(XmlDictionaryWriter writer)
System\ServiceModel\Dispatcher\StreamFormatter.cs (2)
64internal async Task SerializeAsync(XmlDictionaryWriter writer, object[] parameters, object returnValue) 115private async Task WriteEndWrapperIfNecessaryAsync(XmlDictionaryWriter writer)
System\ServiceModel\Dispatcher\SyncMethodInvoker.cs (1)
184return Task.FromResult(Tuple.Create(returnValue, outputs));
System\ServiceModel\Dispatcher\TaskMethodInvoker.cs (4)
74Task task = null; 85task = tuple.Item1 as Task; 216var returnValueTask = returnValue as Task;
System\ServiceModel\ICommunicationObject.cs (2)
37Task CloseAsync(TimeSpan timeout); 38Task OpenAsync(TimeSpan timeout);
System\ServiceModel\InstanceContext.cs (2)
256protected internal override Task OnCloseAsync(TimeSpan timeout) 261protected internal override Task OnOpenAsync(TimeSpan timeout)
System\ServiceModel\Security\AcceleratedTokenProvider.cs (3)
89public override Task OnOpenAsync(TimeSpan timeout) 108public override Task OnCloseAsync(TimeSpan timeout) 168return Task.FromResult(new AcceleratedTokenProviderState(keyEntropy));
System\ServiceModel\Security\ClientCredentialsSecurityTokenManager.cs (1)
353return Task.FromResult(GetTokenCore(timeout));
System\ServiceModel\Security\ISecurityCommunicationObject.cs (2)
15Task OnCloseAsync(TimeSpan timeout); 19Task OnOpenAsync(TimeSpan timeout);
System\ServiceModel\Security\IssuanceTokenProviderBase.cs (6)
262public override Task OnOpenAsync(TimeSpan timeout) 275return Task.CompletedTask; 379return Task.FromResult(result); 382internal override Task CancelTokenCoreInternalAsync(TimeSpan timeout, SecurityToken token) 395return Task.CompletedTask; 404protected abstract Task InitializeChannelFactoriesAsync(EndpointAddress target, TimeSpan timeout);
System\ServiceModel\Security\NegotiationTokenProvider.cs (4)
76public override async Task OnCloseAsync(TimeSpan timeout) 98public override async Task OnOpenAsync(TimeSpan timeout) 151protected override Task InitializeChannelFactoriesAsync(EndpointAddress target, TimeSpan timeout) 153return Task.CompletedTask;
System\ServiceModel\Security\SecurityAppliedMessage.cs (2)
144protected override async Task OnWriteBodyContentsAsync(XmlDictionaryWriter writer) 230public override async Task OnWriteMessageAsync(XmlDictionaryWriter writer)
System\ServiceModel\Security\SecurityChannel.cs (1)
61protected internal override async Task OnCloseAsync(TimeSpan timeout)
System\ServiceModel\Security\SecurityProtocol.cs (6)
250private async Task MergeSupportingTokenProvidersAsync(TimeSpan timeout) 290public Task OpenAsync(TimeSpan timeout) 295public virtual async Task OnOpenAsync(TimeSpan timeout) 358public Task CloseAsync(bool aborted, TimeSpan timeout) 363return Task.CompletedTask; 390public virtual async Task OnCloseAsync(TimeSpan timeout)
System\ServiceModel\Security\SecurityProtocolFactory.cs (7)
412public virtual Task OnCloseAsync(TimeSpan timeout) 418return Task.CompletedTask; 467public virtual Task OnOpenAsync(TimeSpan timeout) 508return Task.CompletedTask; 511public Task OpenAsync(bool actAsInitiator, TimeSpan timeout) 517public Task CloseAsync(bool aborted, TimeSpan timeout) 522return Task.CompletedTask;
System\ServiceModel\Security\SecuritySessionClientSettings.cs (15)
199public Task OnCloseAsync(TimeSpan timeout) 206return Task.CompletedTask; 217public Task OnOpenAsync(TimeSpan timeout) 241internal Task CloseAsync(TimeSpan timeout) 251internal Task OpenAsync(SecurityChannelFactory<TChannel> securityChannelFactory, 440private async Task OpenCoreAsync(SecurityToken sessionToken, TimeSpan timeout) 478protected internal override async Task OnOpenAsync(TimeSpan timeout) 635protected async Task SendCloseResponseMessageAsync(TimeSpan timeout) 1000private async Task RenewKeyAsync(TimeSpan timeout) 1094protected virtual async Task CloseCoreAsync(TimeSpan timeout) 1261protected internal override async Task OnCloseAsync(TimeSpan timeout) 1628public Task SendAsync(Message message) => SendAsync(message, DefaultSendTimeout); 1632public async Task SendAsync(Message message, TimeSpan timeout) 1780public Task CloseOutputSessionAsync() 1787public async Task CloseOutputSessionAsync(TimeSpan timeout)
System\ServiceModel\Security\SecuritySessionSecurityTokenProvider.cs (4)
267public override async Task OnOpenAsync(TimeSpan timeout) 308public override async Task OnCloseAsync(TimeSpan timeout) 739protected internal override Task OnOpenAsync(TimeSpan timeout) 754protected internal override async Task OnCloseAsync(TimeSpan timeout)
System\ServiceModel\Security\SecurityUtils.cs (10)
506internal static Task OpenTokenProviderIfRequiredAsync(SecurityTokenProvider tokenProvider, TimeSpan timeout) 516return Task.Factory.FromAsync(communicationObject.BeginOpen, communicationObject.EndOpen, timeout, null, TaskCreationOptions.None); 519return Task.CompletedTask; 527internal static Task CloseTokenProviderIfRequiredAsync(SecurityTokenProvider tokenProvider, TimeSpan timeout) 537return Task.Factory.FromAsync(communicationObject.BeginClose, communicationObject.EndClose, timeout, null, TaskCreationOptions.None); 540return Task.CompletedTask; 563private static Task OpenCommunicationObjectAsync(IAsyncCommunicationObject obj, TimeSpan timeout) 570return Task.CompletedTask; 573private static Task CloseCommunicationObjectAsync(IAsyncCommunicationObject obj, bool aborted, TimeSpan timeout) 593return Task.CompletedTask;
System\ServiceModel\Security\SessionSymmetricTransportSecurityProtocolFactory.cs (1)
51public override async Task OnOpenAsync(TimeSpan timeout)
System\ServiceModel\Security\Tokens\SecurityTokenProviderContainer.cs (1)
28public Task OpenAsync(TimeSpan timeout)
System\ServiceModel\Security\WrapperSecurityCommunicationObject.cs (12)
110protected internal override Task OnCloseAsync(TimeSpan timeout) 115protected internal override Task OnOpenAsync(TimeSpan timeout) 200public Task CloseAsync(TimeSpan timeout) 230public Task OpenAsync(TimeSpan timeout) 265public virtual Task OnCloseAsync(TimeSpan timeout) 267return Task.CompletedTask; 283public virtual Task OnOpenAsync(TimeSpan timeout) 285return Task.CompletedTask; 431public Task OnCloseAsync(TimeSpan timeout) 433return Task.CompletedTask; 463public Task OnOpenAsync(TimeSpan timeout) 465return Task.CompletedTask;
System\ServiceModel\Security\WSSecurityTokenSerializer.cs (1)
495return Task.FromResult(ReadTokenCore(reader, tokenResolver));
System\ServiceModel\ServiceChannelManager.cs (2)
102public async Task CloseInputAsync(TimeSpan timeout) 255protected override async Task OnCloseAsync(TimeSpan timeout)
System.ServiceModel.Primitives.Tests (29)
Channels\CustomChannelTest.cs (4)
152Task openTask = Task.Factory.FromAsync(openResult, factory.EndOpen); 168Task task = Task.Factory.FromAsync(asyncResult, factory.EndClose);
Description\OperationBehaviorTest.cs (2)
34Task[] taskCollection = { MyOperationBehavior.validateMethodTcs.Task, MyOperationBehavior.addBindingParametersMethodTcs.Task, MyOperationBehavior.applyClientBehaviorMethodTcs.Task }; 35bool waitAll = Task.WaitAll(taskCollection, 250);
IdentityModel\SecurityTokenProviderTest.cs (9)
162var result = Task.FromResult<SecurityToken>(new DummySecurityToken()); 181var result = Task.FromResult<SecurityToken>(new DummySecurityToken()); 201var result = Task.CompletedTask; 208((Task)result).GetAwaiter().GetResult(); 223return Task.FromResult<SecurityToken>(new DummySecurityToken()); 235return Task.FromResult<SecurityToken>(new DummySecurityToken()); 244protected override Task CancelTokenCoreAsync(TimeSpan timeout, SecurityToken token) 248return Task.CompletedTask;
ServiceModel\ChannelFactoryTest.cs (4)
221Task.Factory.FromAsync(factory.BeginOpen(null, null), factory.EndOpen).GetAwaiter().GetResult(); 225Task.Factory.FromAsync(factory.BeginClose(null, null), factory.EndClose).GetAwaiter().GetResult(); 276public static async Task ChannelFactory_AsyncDisposable() 301public static async Task ChannelFactory_AsyncDisposable_NoThrow()
ServiceModel\ClientBaseTest.cs (2)
177public static async Task ClientBaseDisposeAsyncMethodClosesCorrectly() 194public static async Task ClientBaseDisposeAsyncNoThrow(bool channelThrows)
ServiceModel\DuplexClientBaseTest.cs (1)
84return Task.FromResult<Guid>(guid);
ServiceModel\ThrowingOnCloseBindingElement.cs (7)
79return ToApm(Task.Factory.FromAsync(_innerFactory.BeginOpen, _innerFactory.EndOpen, timeout, null), callback, state); 114private async Task OnCloseAsyncImpl(TimeSpan timeout) 121await Task.Factory.FromAsync(base.OnBeginClose, base.OnEndClose, timeout, null); 122await Task.Factory.FromAsync(_innerFactory.BeginClose, _innerFactory.EndClose, timeout, null); 160private static Task ToApm(Task task, AsyncCallback callback, object state) 181((Task)iar).GetAwaiter().GetResult();
System.ServiceModel.UnixDomainSocket (9)
System\ServiceModel\Channels\SocketAwaitableEventArgs.cs (2)
45: new ValueTask<int>(Task.FromException<int>(CreateException(error))); 62: new ValueTask(Task.FromException(CreateException(error)));
System\ServiceModel\Channels\UnixPosixIdentitySecurityUpgradeProvider.cs (7)
40return Task.CompletedTask.ToApm(callback, state); 48protected internal override Task OnCloseAsync(TimeSpan timeout) 50return Task.CompletedTask; 59return Task.CompletedTask.ToApm(callback, state); 67protected internal override Task OnOpenAsync(TimeSpan timeout) 69return Task.CompletedTask; 108return Task.FromResult(stream);
System.Text.Json (28)
System\Text\Json\Nodes\JsonNode.Parse.cs (1)
135/// A <see cref="Task"/> to produce a <see cref="JsonNode"/> representation of the JSON value.
System\Text\Json\Serialization\JsonSerializer.Write.Pipe.cs (8)
29public static Task SerializeAsync<TValue>( 60public static Task SerializeAsync<TValue>( 86public static Task SerializeAsync( 118public static Task SerializeAsync( 155public static Task SerializeAsync( 194public static Task SerializeAsyncEnumerable<TValue>( 236public static Task SerializeAsyncEnumerable<TValue>( 257private static async Task SerializeAsyncEnumerableAsJsonLines<TValue>(
System\Text\Json\Serialization\JsonSerializer.Write.Stream.cs (8)
43public static Task SerializeAsync<TValue>( 103public static Task SerializeAsync( 161public static Task SerializeAsync<TValue>( 210public static Task SerializeAsync( 266public static Task SerializeAsync( 336public static Task SerializeAsyncEnumerable<TValue>( 378public static Task SerializeAsyncEnumerable<TValue>( 399private static async Task SerializeAsyncEnumerableAsJsonLines<TValue>(
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (3)
1477internal abstract Task SerializeAsObjectAsync(PipeWriter pipeWriter, object? rootValue, int flushThreshold, CancellationToken cancellationToken); 1478internal abstract Task SerializeAsObjectAsync(Stream utf8Json, object? rootValue, CancellationToken cancellationToken); 1479internal abstract Task SerializeAsObjectAsync(PipeWriter utf8Json, object? rootValue, CancellationToken cancellationToken);
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.WriteHelpers.cs (6)
62internal Task SerializeAsync(Stream utf8Json, 74internal Task SerializeAsync(PipeWriter utf8Json, 85private async Task SerializeAsync( 337internal sealed override Task SerializeAsObjectAsync(PipeWriter pipeWriter, object? rootValue, int flushThreshold, CancellationToken cancellationToken) 340internal sealed override Task SerializeAsObjectAsync(Stream utf8Json, object? rootValue, CancellationToken cancellationToken) 343internal sealed override Task SerializeAsObjectAsync(PipeWriter utf8Json, object? rootValue, CancellationToken cancellationToken)
System\Text\Json\Serialization\WriteStack.cs (1)
78public Task? PendingTask;
System\Text\Json\Writer\Utf8JsonWriter.cs (1)
557public async Task FlushAsync(CancellationToken cancellationToken = default)
System.Text.RegularExpressions (11)
System\Threading\StackHelper.cs (11)
39Task.Run(() => action(arg1)) 50Task.Run(() => action(arg1, arg2)) 63Task.Run(() => action(arg1, arg2, arg3)) 78Task.Run(() => action(arg1, arg2, arg3, arg4)) 95Task.Run(() => action(arg1, arg2, arg3, arg4, arg5)) 114Task.Run(() => action(arg1, arg2, arg3, arg4, arg5, arg6)) 122Task.Run(() => func()) 132Task.Run(() => func(arg1)) 144Task.Run(() => func(arg1, arg2)) 158Task.Run(() => func(arg1, arg2, arg3)) 174Task.Run(() => func(arg1, arg2, arg3, arg4))
System.Text.RegularExpressions.Generator (12)
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Threading\StackHelper.cs (11)
39Task.Run(() => action(arg1)) 50Task.Run(() => action(arg1, arg2)) 63Task.Run(() => action(arg1, arg2, arg3)) 78Task.Run(() => action(arg1, arg2, arg3, arg4)) 95Task.Run(() => action(arg1, arg2, arg3, arg4, arg5)) 114Task.Run(() => action(arg1, arg2, arg3, arg4, arg5, arg6)) 122Task.Run(() => func()) 132Task.Run(() => func(arg1)) 144Task.Run(() => func(arg1, arg2)) 158Task.Run(() => func(arg1, arg2, arg3)) 174Task.Run(() => func(arg1, arg2, arg3, arg4))
UpgradeToGeneratedRegexCodeFixer.cs (1)
44public override async Task RegisterCodeFixesAsync(CodeFixContext context)
System.Threading.Channels (47)
System\Threading\Channels\AsyncOperation.cs (2)
254Task.Factory.StartNew(static s => ((AsyncOperation)s!).SetCompletionAndInvokeContinuation(), this, 404Task.Factory.StartNew(continuation, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, ts);
System\Threading\Channels\BoundedChannel.cs (8)
83public override Task Completion => _parent._completion.Task; 151return new ValueTask<T>(Task.FromCanceled<T>(cancellationToken)); 194return new ValueTask<bool>(Task.FromCanceled<bool>(cancellationToken)); 212new ValueTask<bool>(Task.FromException<bool>(parent._doneWriting)) : 471return new ValueTask<bool>(Task.FromCanceled<bool>(cancellationToken)); 483new ValueTask<bool>(Task.FromException<bool>(parent._doneWriting)) : 519return new ValueTask(Task.FromCanceled(cancellationToken)); 537return new ValueTask(Task.FromException(ChannelUtilities.CreateInvalidCompletionException(parent._doneWriting)));
System\Threading\Channels\ChannelReader.cs (4)
18/// Gets a <see cref="Task"/> that completes when no more data will ever 21public virtual Task Completion => ChannelUtilities.s_neverCompletingTask; 62return new ValueTask<T>(Task.FromCanceled<T>(cancellationToken)); 74return new ValueTask<T>(Task.FromException<T>(exc));
System\Threading\Channels\ChannelUtilities.cs (6)
16internal static readonly Task<bool> s_trueTask = Task.FromResult(result: true); 18internal static readonly Task<bool> s_falseTask = Task.FromResult(result: false); 20internal static readonly Task s_neverCompletingTask = new TaskCompletionSource<bool>().Task; 62error == s_doneWritingSentinel ? Task.FromException<T>(CreateInvalidCompletionException()) : 63error is OperationCanceledException oce ? Task.FromCanceled<T>(oce.CancellationToken.IsCancellationRequested ? oce.CancellationToken : new CancellationToken(true)) : 64Task.FromException<T>(CreateInvalidCompletionException(error));
System\Threading\Channels\ChannelWriter.cs (2)
44cancellationToken.IsCancellationRequested ? new ValueTask(Task.FromCanceled<T>(cancellationToken)) : 50return new ValueTask(Task.FromException(e));
System\Threading\Channels\RendezvousChannel.cs (8)
73public override Task Completion => _parent._completion.Task; 136return new ValueTask<T>(Task.FromCanceled<T>(cancellationToken)); 191return new ValueTask<bool>(Task.FromCanceled<bool>(cancellationToken)); 203new ValueTask<bool>(Task.FromException<bool>(parent._doneWriting)) : 340return new ValueTask<bool>(Task.FromCanceled<bool>(cancellationToken)); 352new ValueTask<bool>(Task.FromException<bool>(parent._doneWriting)) : 378return new ValueTask(Task.FromCanceled<T>(cancellationToken)); 391return new ValueTask(Task.FromException(ChannelUtilities.CreateInvalidCompletionException(parent._doneWriting)));
System\Threading\Channels\SingleConsumerUnboundedChannel.cs (8)
66public override Task Completion => _parent._completion.Task; 74return new ValueTask<T>(Task.FromCanceled<T>(cancellationToken)); 145return new ValueTask<bool>(Task.FromCanceled<bool>(cancellationToken)); 167new ValueTask<bool>(Task.FromException<bool>(parent._doneWriting)) : 341cancellationToken.IsCancellationRequested ? new ValueTask<bool>(Task.FromCanceled<bool>(cancellationToken)) : 343doneWriting != ChannelUtilities.s_doneWritingSentinel ? new ValueTask<bool>(Task.FromException<bool>(doneWriting)) : 350cancellationToken.IsCancellationRequested ? new ValueTask(Task.FromCanceled(cancellationToken)) : 352new ValueTask(Task.FromException(ChannelUtilities.CreateInvalidCompletionException(_parent._doneWriting)));
System\Threading\Channels\UnboundedChannel.cs (8)
60public override Task Completion => _parent._completion.Task; 72return new ValueTask<T>(Task.FromCanceled<T>(cancellationToken)); 140return new ValueTask<bool>(Task.FromCanceled<bool>(cancellationToken)); 164new ValueTask<bool>(Task.FromException<bool>(parent._doneWriting)) : 291cancellationToken.IsCancellationRequested ? new ValueTask<bool>(Task.FromCanceled<bool>(cancellationToken)) : 293doneWriting != ChannelUtilities.s_doneWritingSentinel ? new ValueTask<bool>(Task.FromException<bool>(doneWriting)) : 298cancellationToken.IsCancellationRequested ? new ValueTask(Task.FromCanceled(cancellationToken)) : 300new ValueTask(Task.FromException(ChannelUtilities.CreateInvalidCompletionException(_parent._doneWriting)));
System\Threading\Channels\UnboundedPriorityChannel.cs (1)
67public override Task Completion => _parent._completion.Task;
System.Threading.RateLimiting (6)
System\Threading\RateLimiting\DefaultPartitionedRateLimiter.cs (3)
30private readonly Task _timerTask; 52private async Task RunTimer() 223private async Task Heartbeat()
System\Threading\RateLimiting\PartitionedRateLimiter.T.cs (1)
68return new ValueTask<RateLimitLease>(Task.FromCanceled<RateLimitLease>(cancellationToken));
System\Threading\RateLimiting\RateLimiter.cs (1)
117return new ValueTask<RateLimitLease>(Task.FromCanceled<RateLimitLease>(cancellationToken));
System\Threading\RateLimiting\TimerAwaitable.cs (1)
98Task.Run(continuation);
System.Threading.Tasks (1)
System.Threading.Tasks.cs (1)
24[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Tasks.Task))]
System.Threading.Tasks.Dataflow (122)
Base\DataflowBlock.cs (26)
178Task IDataflowBlock.Completion { get { return _source.Completion; } } 511System.Threading.Tasks.Task.Factory.StartNew( 525System.Threading.Tasks.Task.Factory.StartNew( 709Task IDataflowBlock.Completion { get { return Task; } } 993return Task.FromResult<TOutput>(fastCheckedItem); 1290System.Threading.Tasks.Task.Factory.StartNew(static state => 1301System.Threading.Tasks.Task.Factory.StartNew(static state => 1322System.Threading.Tasks.Task.Factory.StartNew(state => 1357Task IDataflowBlock.Completion { get { throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); } } 1482Task IDataflowBlock.Completion => throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); 1553public Task Completion { get { return _source.Completion; } } 1887task = Task.Factory.StartNew(ChooseTarget<T>.s_processBranchFunction, 1918var boxedCompleted = new StrongBox<Task>(); 1940Task.Factory.ContinueWhenAll(branchTasks, tasks => 2002StrongBox<Task> boxedCompleted, CancellationTokenSource cts, 2080private readonly StrongBox<Task> _completed; 2085internal ChooseTarget(StrongBox<Task> completed, CancellationToken cancellationToken) 2137Task IDataflowBlock.Completion { get { throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); } } 2211Task? sourceCompletionTask = Common.GetPotentiallyNotSupportedCompletionTask(_source); 2226Task? sourceCompletionTask = Common.GetPotentiallyNotSupportedCompletionTask(_source); 2380Target = new ActionBlock<TOutput>((Func<TOutput, Task>)ProcessItemAsync, DataflowBlock._nonGreedyExecutionOptions); 2392Task? sourceCompletionTask = Common.GetPotentiallyNotSupportedCompletionTask(Observable._source); 2407private Task ProcessItemAsync(TOutput item) 2443Task<bool[]> allSendAsyncTasksConsolidated = Task.WhenAll(_tempSendAsyncTaskList); 2606private Task? _completion; 2633Task IDataflowBlock.Completion
Base\IDataflowBlock.cs (1)
21Task Completion { get; }
Blocks\ActionBlock.cs (7)
51public ActionBlock(Func<TInput, Task> action) : 60public ActionBlock(Func<TInput, Task> action, ExecutionDataflowBlockOptions dataflowBlockOptions) : 105var asyncAction = action as Func<TInput, Task>; 151private void ProcessMessageWithTask(Func<TInput, Task> action, KeyValuePair<TInput, long> messageWithId) 157Task? task = null; 196private void AsyncCompleteProcessMessageWithTask(Task completed) 248public Task Completion
Blocks\BatchBlock.cs (8)
139public Task Completion { get { return _source.Completion; } } 213public Task? TaskForInputProcessing { get { return _targetDebuggingInformation.TaskForInputProcessing; } } 215public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } } 281internal Task? TaskForInputProcessing; 470internal Task Completion { get { return _completionTask.Task; } } 522Task.Factory.StartNew(thisTargetCore => 654Task.Factory.StartNew(exc => Complete(exception: (Exception)exc!, dropPendingMessages: true, releaseReservedMessages: true, revertProcessingState: true), 1179public Task? TaskForInputProcessing { get { return _target._nonGreedyState?.TaskForInputProcessing; } }
Blocks\BatchedJoinBlock.cs (5)
144public Task Completion { get { return _source.Completion; } } 247public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } } 396public Task Completion { get { return _source.Completion; } } 504public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } } 624Task IDataflowBlock.Completion { get { throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); } }
Blocks\BroadcastBlock.cs (12)
157public Task Completion { get { return _source.Completion; } } 270Task.Factory.StartNew(exc => CompleteCore(exception: (Exception)exc!, storeExceptionEvenIfAlreadyCompleting: true, revertProcessingState: true), 281Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 327Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 382Task.Factory.StartNew(static state => 471public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } } 528private Task? _taskForOutputProcessing; 640Task.Factory.StartNew(static state => 854Task.Factory.StartNew(static state => 946Task.Factory.StartNew(static thisSourceCore => ((BroadcastingSourceCore<TOutput>)thisSourceCore!).CompleteBlockOncePossible(), 1174internal Task Completion { get { return _completionTask.Task; } } 1210public Task? TaskForOutputProcessing { get { return _source._taskForOutputProcessing; } }
Blocks\BufferBlock.cs (7)
195public Task Completion { get { return _source.Completion; } } 271Task.Factory.StartNew(exc => CompleteCore(exception: (Exception)exc!, storeExceptionEvenIfAlreadyCompleting: true, revertProcessingState: true), 283Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 329Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 385Task.Factory.StartNew(static state => 456public Task? TaskForInputProcessing { get { return _bufferBlock._boundingState?.TaskForInputProcessing; } } 458public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } }
Blocks\JoinBlock.cs (12)
83Task.Factory.ContinueWhenAll( 128public Task Completion { get { return _source.Completion; } } 216public Task? TaskForInputProcessing { get { return _joinBlock._sharedResources._taskForInputProcessing; } } 218public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } } 302Task.Factory.ContinueWhenAll( 347public Task Completion { get { return _source.Completion; } } 440public Task? TaskForInputProcessing { get { return _joinBlock._sharedResources._taskForInputProcessing; } } 442public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } } 933public Task Completion { get { throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); } } 935internal Task CompletionTaskInternal { get { return _completionTask.Task; } } 1060internal Task? _taskForInputProcessing; 1331Task.Factory.StartNew(static state =>
Blocks\TransformBlock.cs (2)
356public Task Completion { get { return _source.Completion; } } 433public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } }
Blocks\TransformManyBlock.cs (2)
565public Task Completion { get { return _source.Completion; } } 642public Task? TaskForOutputProcessing { get { return _sourceDebuggingInformation.TaskForOutputProcessing; } }
Blocks\TransformManyBlock.netstandard21.cs (5)
36Task t = ProcessMessageAsync(transform, messageWithId); 54private async Task ProcessMessageAsync(Func<TInput, IAsyncEnumerable<TOutput>> transformFunction, KeyValuePair<TInput, long> messageWithId) 88private async Task StoreOutputItemsAsync( 117private async Task StoreOutputItemsReorderedAsync(long id, IAsyncEnumerable<TOutput>? item) 193private async Task StoreOutputItemsNonReorderedWithIterationAsync(IAsyncEnumerable<TOutput> outputItems)
Blocks\WriteOnceBlock.cs (3)
120var taskForOutputProcessing = new Task(static state => ((WriteOnceBlock<T>)state!).OfferToTargetsAndCompleteBlock(), this, 137Task.Factory.StartNew(static state => 332public Task Completion { get { return CompletionTaskSource.Task; } }
Internal\Common.cs (9)
106Task? t = Common.GetPotentiallyNotSupportedCompletionTask(block); 176CancellationToken cancellationToken, Task completionTask, Action<object?, CancellationToken> completeAction, object completeState) 384internal static Task? GetPotentiallyNotSupportedCompletionTask(IDataflowBlock block) 452internal static Exception? StartTaskSafe(Task task, TaskScheduler scheduler) 470private static Exception? StartTaskSafeCore(Task task, TaskScheduler scheduler) 546internal static void PropagateCompletion(Task sourceCompletionTask, IDataflowBlock target, Action<Exception>? exceptionHandler) 569private static void PropagateCompletionAsContinuation(Task sourceCompletionTask, IDataflowBlock target) 580internal static void PropagateCompletionOnceCompleted(Task sourceCompletionTask, IDataflowBlock target) 675internal Task? TaskForInputProcessing;
Internal\DataflowEtwProvider.cs (2)
89IDataflowBlock block, Task task, TaskLaunchedReason reason, int availableMessages) 130Task? completionTask = Common.GetPotentiallyNotSupportedCompletionTask(block);
Internal\SourceCore.cs (8)
79private Task? _taskForOutputProcessing; // protected by ValueLock 272internal Task Completion { get { return _completionTask.Task; } } 513Task.Factory.StartNew(static state => 776Task.Factory.StartNew(static state => 794Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId, 852Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId, 919Task.Factory.StartNew(static state => ((SourceCore<TOutput>)state!).CompleteBlockOncePossible(), 1005internal Task? TaskForOutputProcessing { get { return _source._taskForOutputProcessing; } }
Internal\SpscTargetCore.cs (7)
66private volatile Task? _activeConsumer; 166var newConsumer = new Task( 194_activeConsumer != null && _activeConsumer.Id == Task.CurrentId, 255Task? previousConsumer = Interlocked.Exchange<Task?>(ref _activeConsumer, null); 256Debug.Assert(previousConsumer != null && previousConsumer.Id == Task.CurrentId, 355internal Task Completion { get { return CompletionSource.Task; } }
Internal\TargetCore.cs (4)
241internal Task Completion { get { return _completionSource.Task; } } 372var taskForInputProcessing = new Task(static thisTargetCore => ((TargetCore<TInput>)thisTargetCore!).ProcessMessagesLoopCore(), this, 388Task.Factory.StartNew(exc => Complete(exception: (Exception)exc!, dropPendingMessages: true, storeExceptionEvenIfAlreadyCompleting: true, 745Task.Factory.StartNew(static state => ((TargetCore<TInput>)state!).CompleteBlockOncePossible(),
Internal\TargetRegistry.cs (2)
197Task owningSourceCompletion = _owningSource.Completion; 346Task IDataflowBlock.Completion { get { return _owningSource.Completion; } }
System.Threading.Tasks.Parallel (45)
System\Threading\Tasks\Parallel.cs (14)
223ParallelEtwProvider.Log.ParallelInvokeBegin(TaskScheduler.Current.Id, Task.CurrentId ?? 0, 329Task[] tasks = new Task[actionsCopy.Length]; 337tasks[i] = Task.Factory.StartNew(actionsCopy[i], parallelOptions.CancellationToken, TaskCreationOptions.None, 348Task.WaitAll(tasks); 362ParallelEtwProvider.Log.ParallelInvokeEnd(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID); 968ParallelEtwProvider.Log.ParallelLoopBegin(TaskScheduler.Current.Id, Task.CurrentId ?? 0, 1005ParallelEtwProvider.Log.ParallelFork(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID); 1105ParallelEtwProvider.Log.ParallelJoin(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID); 1150ParallelEtwProvider.Log.ParallelLoopEnd(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID, long.CreateTruncating(nTotalIterations)); 2535ParallelEtwProvider.Log.ParallelLoopBegin(TaskScheduler.Current.Id, Task.CurrentId ?? 0, 2596ParallelEtwProvider.Log.ParallelFork(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID); 2741ParallelEtwProvider.Log.ParallelJoin(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID); 2789ParallelEtwProvider.Log.ParallelLoopEnd(TaskScheduler.Current.Id, Task.CurrentId ?? 0, forkJoinContextID, 0);
System\Threading\Tasks\Parallel.ForEachAsync.cs (29)
20public static Task ForAsync<T>(T fromInclusive, T toExclusive, Func<T, CancellationToken, ValueTask> body) 38public static Task ForAsync<T>(T fromInclusive, T toExclusive, CancellationToken cancellationToken, Func<T, CancellationToken, ValueTask> body) 56public static Task ForAsync<T>(T fromInclusive, T toExclusive, ParallelOptions parallelOptions, Func<T, CancellationToken, ValueTask> body) 77private static Task ForAsync<T>(T fromInclusive, T toExclusive, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<T, CancellationToken, ValueTask> body) 87return Task.FromCanceled(cancellationToken); 92return Task.CompletedTask; 96Func<object, Task> taskBody = static async o => 187return Task.FromException(e); 198public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 214public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 229public static Task ForEachAsync<TSource>(IEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 247private static Task ForEachAsync<TSource>(IEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 256return Task.FromCanceled(cancellationToken); 260Func<object, Task> taskBody = static async o => 342return Task.FromException(e); 353public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask> body) 369public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 384public static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, ParallelOptions parallelOptions, Func<TSource, CancellationToken, ValueTask> body) 402private static Task ForEachAsync<TSource>(IAsyncEnumerable<TSource> source, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 411return Task.FromCanceled(cancellationToken); 415Func<object, Task> taskBody = static async o => 497return Task.FromException(e); 519private readonly Func<object, Task> _taskBody; 540protected ForEachAsyncState(Func<object, Task> taskBody, bool needsLock, int dop, TaskScheduler scheduler, CancellationToken cancellationToken, Func<TSource, CancellationToken, ValueTask> body) 581Task.Factory.StartNew(_taskBody!, this, default(CancellationToken), TaskCreationOptions.DenyChildAttach, _scheduler); 591public Task AcquireLock() 691IEnumerable<TSource> source, Func<object, Task> taskBody, 713IAsyncEnumerable<TSource> source, Func<object, Task> taskBody, 736T fromExclusive, T toExclusive, Func<object, Task> taskBody,
System\Threading\Tasks\TaskReplicator.cs (2)
31protected volatile Task? _pendingTask; // the most recently queued Task for this replica, or null if we're done. 59Task? pendingTask;
System.Windows.Extensions (2)
System\Media\SoundPlayer.cs (2)
32private Task? _copyTask; 482private async Task CopyStreamAsync(CancellationToken cancellationToken)
System.Windows.Forms (13)
System\Windows\Forms\Control_InvokeAsync.cs (6)
50public async Task InvokeAsync(Action callback, CancellationToken cancellationToken = default) 152/// <b>Important:</b> If you pass a callback that returns a <see cref="Task"/> or <see cref="Task{T}"/>, 249/// To pass a callback that returns a <see cref="Task"/> instead of <see cref="ValueTask"/>, 274public async Task InvokeAsync( 301async Task WrappedCallbackAsync() 406async Task WrappedCallbackAsync()
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (2)
481Task.Run(async () => 595Task.Run(() =>
System\Windows\Forms\Form.cs (4)
5542/// A <see cref="Task"/> that completes when the form is closed or disposed. 5576/// The returned <see cref="Task"/> carries a <see cref="WeakReference{T}"/> to the <see cref="Form"/> in its 5577/// <see cref="Task.AsyncState"/> property. This is particularly useful when managing multiple forms (such as tool windows) 5630public Task ShowAsync(IWin32Window? owner = null)
System\Windows\Forms\OLE\DropTarget.cs (1)
263Task.Run(() =>
System.Windows.Forms.Analyzers.CodeFixes.CSharp (1)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (1)
30public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
System.Windows.Forms.Primitives (2)
System\Windows\Forms\Animation\HighPrecisionTimer.cs (2)
467private static async Task AwaitCallbackAsync( 719_ = Task.Factory.StartNew(
System.Windows.Presentation (3)
System\Windows\Threading\TaskExtensions.cs (3)
13public static bool IsDispatcherOperationTask(this Task @this) 21public static DispatcherOperationStatus DispatcherOperationWait(this Task @this) 29public static DispatcherOperationStatus DispatcherOperationWait(this Task @this, TimeSpan timeout)
testhost (5)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (2)
139Task.Delay(1000).GetAwaiter().GetResult(); 161Task.Delay(1000).Wait();
src\vstest\src\testhost.x86\DefaultEngineInvoker.cs (2)
303private static Task StartProcessingAsync(ITestRequestHandler requestHandler, ITestHostManagerFactory managerFactory) 305var task = new Task(
src\vstest\src\testhost.x86\UnitTestClient.cs (1)
28Task.Run(() => Program.Run(SplitArguments(arguments)));
testhost.arm64 (5)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (2)
139Task.Delay(1000).GetAwaiter().GetResult(); 161Task.Delay(1000).Wait();
src\vstest\src\testhost.x86\DefaultEngineInvoker.cs (2)
303private static Task StartProcessingAsync(ITestRequestHandler requestHandler, ITestHostManagerFactory managerFactory) 305var task = new Task(
src\vstest\src\testhost.x86\UnitTestClient.cs (1)
28Task.Run(() => Program.Run(SplitArguments(arguments)));
testhost.x86 (5)
DefaultEngineInvoker.cs (2)
303private static Task StartProcessingAsync(ITestRequestHandler requestHandler, ITestHostManagerFactory managerFactory) 305var task = new Task(
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (2)
139Task.Delay(1000).GetAwaiter().GetResult(); 161Task.Delay(1000).Wait();
UnitTestClient.cs (1)
28Task.Run(() => Program.Run(SplitArguments(arguments)));
Testing.Tests (18)
WaitFailures.cs (18)
23public async Task Container() 38public async Task Executable() 56public async Task WaitForResourceThatNeverCompletes() 66_ = Task.Run(async () => 76public async Task WaitForResourceThatNeverHitsState() 91public async Task WaitForResourceThatNeverHitsStates() 106public async Task WaitForResourceThatNeverHitsPredicate() 124public async Task WaitForHealthyOnResourceThatNeverStarts() 140public async Task WaitForHealthyOnResourceThatStartsButNeverGoesHealthy() 154_ = Task.Run(async () => 163public async Task WaitForHealthyOnResourceThatGoesHealthyButNeverCompletesResourceReady() 169.OnResourceReady((_, _, token) => Task.Delay(Timeout.Infinite, token)); 174_ = Task.Run(async () => 187public async Task DependencyNeverStarts() 210public async Task DependencyNeverGoesHealthy() 226_ = Task.Run(async () => 236public async Task DependencyNeverCompletes() 250_ = Task.Run(async () =>
TestingAppHost1.AppHost (4)
TestingAppHostEntryPointProbe.cs (4)
58public static async Task WaitAtBreakpointAsync(string[] args) 85public sealed class Probe(string id, Task exited) : IDisposable 89public Task Exited { get; } = exited; 110public Task Reached { get; }
TestProject.AppHost (5)
Program.cs (1)
8_ = Task.Run(async () =>
TestProgram.cs (4)
147public async Task RunAsync(CancellationToken cancellationToken = default) 172public async Task OnAfterResourcesCreated(AfterResourcesCreatedEvent @event, CancellationToken cancellationToken) 204public Task SubscribeAsync(IDistributedApplicationEventing eventing, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken) 208return Task.CompletedTask;
TestProject.WorkerA (2)
Worker.cs (2)
15protected override async Task ExecuteAsync(CancellationToken stoppingToken) 28await Task.Delay(1000, stoppingToken);
TestShop.AppHost (1)
AppHost.cs (1)
51return Task.CompletedTask;
UnitTests.Common (4)
TestHelpers.cs (1)
358return Task.FromResult<Guid>(guid);
TestTypes.cs (3)
337public static void Run(Func<Task> asyncMethod) 345var t = asyncMethod(); 702return Task.Run<Guid>(() => guid);
vbc (13)
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (3)
160public async Task WriteAsync(Stream outStream, CancellationToken cancellationToken = default(CancellationToken)) 282public async Task WriteAsync(Stream outStream, 675internal static async Task ReadAllAsync(
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (10)
163internal static async Task WaitForServerProcessExitAsync( 173await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken).ConfigureAwait(false); 240return Task.FromResult<NamedPipeClientStream?>(null); 251return Task.FromResult<NamedPipeClientStream?>(null); 271return Task.FromResult<NamedPipeClientStream?>(null); 315var monitorTask = MonitorDisconnectAsync(pipeStream, request.RequestId, logger, serverCts.Token); 316await Task.WhenAny(responseTask, monitorTask).ConfigureAwait(false); 352internal static async Task MonitorDisconnectAsync( 365await Task.Delay(millisecondsDelay: 100, cancellationToken).ConfigureAwait(false); 414await Task.Run(() => pipeStream.ConnectAsync(timeoutMs, cancellationToken), cancellationToken).ConfigureAwait(false);
VBCSCompiler (38)
src\roslyn\src\Compilers\Server\VBCSCompiler\ClientConnectionHandler.cs (1)
118await Task.WhenAny(compilationTask, clientConnection.DisconnectTask).ConfigureAwait(false);
src\roslyn\src\Compilers\Server\VBCSCompiler\IClientConnection.cs (3)
20Task DisconnectTask { get; } 30Task WriteBuildResponseAsync(BuildResponse response, CancellationToken cancellationToken); 47/// Returns a <see cref="Task"/> that completes when a new <see cref="IClientConnection"/> is
src\roslyn\src\Compilers\Server\VBCSCompiler\NamedPipeClientConnection.cs (3)
27public Task DisconnectTask => DisconnectTaskCompletionSource.Task; 70async Task MonitorDisconnectAsync() 87public Task WriteBuildResponseAsync(BuildResponse response, CancellationToken cancellationToken) => response.WriteAsync(Stream, cancellationToken);
src\roslyn\src\Compilers\Server\VBCSCompiler\NamedPipeClientConnectionHost.cs (11)
34private Task[]? _listenTasks; 70_listenTasks = new Task[listenCount]; 73var task = Task.Run(() => ListenCoreAsync(PipeName, Logger, _queue, _cancellationTokenSource.Token)); 111Task.WaitAll(_listenTasks); 167private static async Task ListenCoreAsync( 195var connectTask = pipeStream.WaitForConnectionAsync(cancellationToken); 198var cancelTask = Task.Delay(TimeSpan.FromMilliseconds(-1), cancellationToken); 199var completedTask = await Task.WhenAny(new[] { connectTask, cancelTask }).ConfigureAwait(false);
src\roslyn\src\Compilers\Server\VBCSCompiler\ServerDispatcher.cs (7)
59private Task? _timeoutTask; 60private Task? _gcTask; 189var all = new List<Task>(); 197Task.WaitAny(all.ToArray(), cancellationToken); 205void AddNonNull(Task? task) 252_timeoutTask = Task.Delay(_keepAlive); 260_gcTask = Task.Delay(GCTimeout);
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (3)
160public async Task WriteAsync(Stream outStream, CancellationToken cancellationToken = default(CancellationToken)) 282public async Task WriteAsync(Stream outStream, 675internal static async Task ReadAllAsync(
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (10)
163internal static async Task WaitForServerProcessExitAsync( 173await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken).ConfigureAwait(false); 240return Task.FromResult<NamedPipeClientStream?>(null); 251return Task.FromResult<NamedPipeClientStream?>(null); 271return Task.FromResult<NamedPipeClientStream?>(null); 315var monitorTask = MonitorDisconnectAsync(pipeStream, request.RequestId, logger, serverCts.Token); 316await Task.WhenAny(responseTask, monitorTask).ConfigureAwait(false); 352internal static async Task MonitorDisconnectAsync( 365await Task.Delay(millisecondsDelay: 100, cancellationToken).ConfigureAwait(false); 414await Task.Run(() => pipeStream.ConnectAsync(timeoutMs, cancellationToken), cancellationToken).ConfigureAwait(false);
vstest.console (5)
Publisher\MetricsPublisherFactory.cs (2)
26? await Task.FromResult<IMetricsPublisher>(new TextFileTelemetryPublisher()) 27: await Task.FromResult<IMetricsPublisher>(new NoOpMetricsPublisher());
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (2)
139Task.Delay(1000).GetAwaiter().GetResult(); 161Task.Delay(1000).Wait();
TestPlatformHelpers\TestRequestManager.cs (1)
458Task task = _attachmentsProcessingManager.ProcessTestRunAttachmentsAsync(
vstest.console.arm64 (5)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (2)
139Task.Delay(1000).GetAwaiter().GetResult(); 161Task.Delay(1000).Wait();
src\vstest\src\vstest.console\Publisher\MetricsPublisherFactory.cs (2)
26? await Task.FromResult<IMetricsPublisher>(new TextFileTelemetryPublisher()) 27: await Task.FromResult<IMetricsPublisher>(new NoOpMetricsPublisher());
src\vstest\src\vstest.console\TestPlatformHelpers\TestRequestManager.cs (1)
458Task task = _attachmentsProcessingManager.ProcessTestRunAttachmentsAsync(
WebPubSubWeb (2)
Program.cs (2)
80protected override async Task ExecuteAsync(CancellationToken stoppingToken) 84await Task.Delay(5000, stoppingToken);
WithDockerfile.AppHost (2)
AppHost.cs (2)
43await Task.Delay(1, context.CancellationToken); 73await Task.Delay(1, context.CancellationToken);