4351 references to None
Analyzer.Utilities.UnitTests (2)
aspire (3)
Aspire.Cli.Tests (29)
NuGet\NuGetPackageCacheTests.cs (5)
39var packages = await nuGetPackageCache.GetCliPackagesAsync(workspace.WorkspaceRoot, prerelease: true, nugetConfigFile: null, CancellationToken.None).WaitAsync(CliTestConstants.DefaultTimeout);
73var packages = await nuGetPackageCache.GetPackagesAsync(workspace.WorkspaceRoot, "Aspire.Hosting", null, prerelease: false, nugetConfigFile: null, CancellationToken.None).WaitAsync(CliTestConstants.DefaultTimeout);
111var packages = await nuGetPackageCache.GetPackagesAsync(workspace.WorkspaceRoot, "Aspire.Hosting", null, prerelease: false, nugetConfigFile: null, CancellationToken.None).WaitAsync(CliTestConstants.DefaultTimeout);
154CancellationToken.None).WaitAsync(CliTestConstants.DefaultTimeout);
189var packages = await nuGetPackageCache.GetPackagesAsync(workspace.WorkspaceRoot, "Aspire.Hosting", null, prerelease: false, nugetConfigFile: null, CancellationToken.None).WaitAsync(CliTestConstants.DefaultTimeout);
Aspire.Dashboard (3)
Aspire.Dashboard.Tests (9)
Aspire.Hosting (4)
Aspire.Hosting.Azure.Tests (59)
Aspire.Hosting.Docker (1)
Aspire.Hosting.Keycloak.Tests (2)
Aspire.Hosting.PostgreSQL.Tests (2)
Aspire.Hosting.Testing (1)
Aspire.Hosting.Tests (150)
DistributedApplicationTests.cs (15)
136await orchestrator.StartResourceAsync(resourceEvent.ResourceId, CancellationToken.None).DefaultTimeout(TestConstants.LongTimeoutTimeSpan);
140await orchestrator.StopResourceAsync(resourceEvent.ResourceId, CancellationToken.None).DefaultTimeout(TestConstants.LongTimeoutTimeSpan);
144var restartResourceTask = orchestrator.StartResourceAsync(resourceEvent.ResourceId, CancellationToken.None).DefaultTimeout(TestConstants.LongTimeoutTimeSpan);
148await orchestrator.StartResourceAsync(resourceEvent.ResourceId, CancellationToken.None).DefaultTimeout(TestConstants.LongTimeoutTimeSpan);
198await orchestrator.StartResourceAsync(notStartedResourceEvent.ResourceId, CancellationToken.None).DefaultTimeout(TestConstants.LongTimeoutTimeSpan);
215await orchestrator.StopResourceAsync(notStartedResourceEvent.ResourceId, CancellationToken.None).DefaultTimeout(TestConstants.LongTimeoutTimeSpan);
219await orchestrator.StartResourceAsync(notStartedResourceEvent.ResourceId, CancellationToken.None).DefaultTimeout(TestConstants.LongTimeoutTimeSpan);
272await orchestrator.StartResourceAsync(notStartedResourceEvent.ResourceId, CancellationToken.None).DefaultTimeout(TestConstants.LongTimeoutTimeSpan);
288await orchestrator.StopResourceAsync(notStartedResourceEvent.ResourceId, CancellationToken.None).DefaultTimeout(TestConstants.LongTimeoutTimeSpan);
292await orchestrator.StartResourceAsync(notStartedResourceEvent.ResourceId, CancellationToken.None).DefaultTimeout(TestConstants.LongTimeoutTimeSpan);
353await orchestrator.StartResourceAsync(notStartedResourceEvent.ResourceId, CancellationToken.None).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan);
371await orchestrator.StopResourceAsync(runningResourceEvent.ResourceId, CancellationToken.None).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan);
378await orchestrator.StartResourceAsync(runningResourceEvent.ResourceId, CancellationToken.None).DefaultTimeout(TestConstants.ExtraLongTimeoutTimeSpan);
677await orchestrator.StopResourceAsync(serviceA.Metadata.Name, CancellationToken.None).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
682await orchestrator.StartResourceAsync(serviceA.Metadata.Name, CancellationToken.None).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
Publishing\PublishingActivityReporterTests.cs (79)
27var step = await reporter.CreateStepAsync(title, CancellationToken.None);
58var step = await reporter.CreateStepAsync("Parent Step", CancellationToken.None);
65var task = await step.CreateTaskAsync(statusText, CancellationToken.None);
98() => nonExistentStep.CreateTaskAsync("Test Task", CancellationToken.None));
110var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
111await step.CompleteAsync("Completed", CompletionState.Completed, CancellationToken.None);
115() => step.CreateTaskAsync("Test Task", CancellationToken.None));
129var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
135await step.CompleteAsync(completionText, isError ? CompletionState.CompletedWithError : CompletionState.Completed, CancellationToken.None);
160var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
161var task = await step.CreateTaskAsync("Initial status", CancellationToken.None);
168await task.UpdateAsync(newStatusText, CancellationToken.None);
191var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
192var task = await step.CreateTaskAsync("Initial status", CancellationToken.None);
195var dummyStep = await reporter.CreateStepAsync("Dummy Step", CancellationToken.None);
202() => invalidTask.UpdateAsync("New status", CancellationToken.None));
213var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
214var task = await step.CreateTaskAsync("Initial status", CancellationToken.None);
215await step.CompleteAsync("Completed", CompletionState.Completed, CancellationToken.None);
219() => task.UpdateAsync("New status", CancellationToken.None));
232var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
233var task = await step.CreateTaskAsync("Test Task", CancellationToken.None);
240await task.CompleteAsync(completionMessage, cancellationToken: CancellationToken.None);
267var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
268var task = await step.CreateTaskAsync("Test Task", CancellationToken.None);
269await step.CompleteAsync("Completed", CompletionState.Completed, CancellationToken.None);
273() => task.CompleteAsync(null, cancellationToken: CancellationToken.None));
289await reporter.CompletePublishAsync(null, completionState, isDeploy: false, CancellationToken.None);
310await reporter.CompletePublishAsync(expectedStatusText, CompletionState.CompletedWithError, isDeploy: false, CancellationToken.None);
329var step1 = await reporter.CreateStepAsync("Step 1", CancellationToken.None);
330var step2 = await reporter.CreateStepAsync("Step 2", CancellationToken.None);
331var step3 = await reporter.CreateStepAsync("Step 3", CancellationToken.None);
333var task1 = await step1.CreateTaskAsync("Task 1", CancellationToken.None);
334await task1.CompleteAsync(null, cancellationToken: CancellationToken.None);
335await step1.CompleteAsync("Step 1 completed", CompletionState.Completed, CancellationToken.None);
337var task2 = await step2.CreateTaskAsync("Task 2", CancellationToken.None);
338await task2.CompleteAsync(null, cancellationToken: CancellationToken.None);
339await step2.CompleteAsync("Step 2 completed with warning", CompletionState.CompletedWithWarning, CancellationToken.None);
341var task3 = await step3.CreateTaskAsync("Task 3", CancellationToken.None);
342await task3.CompleteAsync(null, cancellationToken: CancellationToken.None);
343await step3.CompleteAsync("Step 3 failed", CompletionState.CompletedWithError, CancellationToken.None);
350await reporter.CompletePublishAsync(isDeploy: false, cancellationToken: CancellationToken.None);
366var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
367var task = await step.CreateTaskAsync("Test Task", CancellationToken.None);
370await task.CompleteAsync(null, cancellationToken: CancellationToken.None);
383var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
384var task = await step.CreateTaskAsync("Test Task", CancellationToken.None);
387await task.CompleteAsync(null, cancellationToken: CancellationToken.None);
391() => task.CompleteAsync(null, cancellationToken: CancellationToken.None));
403var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
406await step.CompleteAsync("Complete", cancellationToken: CancellationToken.None);
410() => step.CompleteAsync("Complete again", cancellationToken: CancellationToken.None));
422var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
423var task = await step.CreateTaskAsync("Test Task", CancellationToken.None);
426await task.CompleteAsync(null, cancellationToken: CancellationToken.None);
429await step.CompleteAsync("Step completed", CompletionState.Completed, CancellationToken.None);
434() => task.UpdateAsync("New status", CancellationToken.None));
440() => task.CompleteAsync(null, cancellationToken: CancellationToken.None));
445() => step.CreateTaskAsync("New Task", CancellationToken.None));
455await using var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
487await reporter.CompleteInteractionAsync(promptId, responses, CancellationToken.None).DefaultTimeout();
527await reporter.CompleteInteractionAsync(notificationId, responses, CancellationToken.None).DefaultTimeout();
540var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
555var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
583var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
584var task1 = await step.CreateTaskAsync("Task 1", CancellationToken.None);
585var task2 = await step.CreateTaskAsync("Task 2", CancellationToken.None);
588await task1.SucceedAsync(null, CancellationToken.None);
589await task2.SucceedAsync(null, CancellationToken.None);
617var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
620await step.CompleteAsync("Step completed manually", CompletionState.Completed, CancellationToken.None);
642var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
643var task = await step.CreateTaskAsync("Test Task", CancellationToken.None);
651await taskInternal.WarnAsync(completionMessage, CancellationToken.None);
677var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
678var task = await step.CreateTaskAsync("Test Task", CancellationToken.None);
686await taskInternal.FailAsync(completionMessage, CancellationToken.None);
715await reporter.CompletePublishAsync(null, completionState, isDeploy: true, CancellationToken.None);
736await reporter.CompletePublishAsync(expectedStatusText, CompletionState.CompletedWithError, isDeploy: true, CancellationToken.None);
Publishing\PublishingExtensionsTests.cs (16)
19await using var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
22var task = await step.CreateTaskAsync("Initial status", CancellationToken.None);
38await using var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
41var result = await step.SucceedAsync("Success message", CancellationToken.None);
56await using var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
57var task = await step.CreateTaskAsync("Initial status", CancellationToken.None);
60var result = await task.UpdateStatusAsync("Updated status", CancellationToken.None);
75await using var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
76var task = await step.CreateTaskAsync("Initial status", CancellationToken.None);
79var result = await task.SucceedAsync("Success message", CancellationToken.None);
93await using var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
94var task = await step.CreateTaskAsync("Initial status", CancellationToken.None);
97var result = await task.WarnAsync("Warning message", CancellationToken.None);
111await using var step = await reporter.CreateStepAsync("Test Step", CancellationToken.None);
112var task = await step.CreateTaskAsync("Initial status", CancellationToken.None);
115await task.FailAsync("Error message", CancellationToken.None);
Aspire.Hosting.Yarp.Tests (1)
Aspire.StackExchange.Redis.DistributedCaching.Tests (1)
Aspire.StackExchange.Redis.OutputCaching.Tests (1)
AuthSamples.FunctionalTests (1)
BuildActionTelemetryTable (4)
BuildValidator (1)
Client.ChannelLayer.IntegrationTests (2)
Client.TypedClient.IntegrationTests (5)
CodeStyleConfigFileGenerator (2)
ConfigurationSchemaGenerator (2)
ConfigurationSchemaGenerator.Tests (1)
Contract.Service.IntegrationTests (8)
ServiceContractTests.4.0.0.cs (4)
336Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_Async_Open_ChannelFactory(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
389Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_Async_Open_Proxy(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
440Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_Async_Close_ChannelFactory(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
490Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_Async_Close_Proxy(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
ServiceContractTests.4.1.0.cs (4)
210Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_DefaultSettings_Echo_RoundTrips_String_Streamed(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
224Task.Factory.StartNew(() => ServiceContractTests.BasicHttp_DefaultSettings_Echo_RoundTrips_String_Streamed_Async(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
614Task.Factory.StartNew(() => ServiceContractTests.NetTcp_NoSecurity_Streamed_RoundTrips_String(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
628Task.Factory.StartNew(() => ServiceContractTests.NetTcp_NoSecurity_Streamed_Async_RoundTrips_String(), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()).Wait();
dotnet-svcutil-lib (19)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TaskHelpers.cs (4)
47}, callback, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default);
68}, continuationState, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default);
92}, callback, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default);
124}, continuationState, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default);
dotnet-svcutil-lib.Tests (24)
MSBuildProjTests.cs (4)
41var build = await MSBuildProj.ParseAsync(projectText, TestDir + "/MSBuildProjTests/Sample", null, CancellationToken.None);
61var build = await MSBuildProj.ParseAsync(projectText, TestDir + "/MSBuildProjTests/Sample", null, CancellationToken.None);
80var build = await MSBuildProj.ParseAsync(projectText, TestDir + "/MSBuildProjTests/Sample", null, CancellationToken.None);
100var build = await MSBuildProj.ParseAsync(projectText, TestDir + "/MSBuildProjTests/Sample", null, CancellationToken.None);
ProjectUtils.cs (3)
17static readonly CancellationToken token = CancellationToken.None;
95result = ProcessRunner.RunAsync("dotnet-svcutil", options, project.DirectoryPath, redirectOutput: true, throwOnError: false, environmentVariables: envVars, logger: logger, cancellationToken: CancellationToken.None).Result;
156result = ProcessRunner.RunAsync("dotnet", $"run", project.DirectoryPath, redirectOutput: true, throwOnError: false, environmentVariables: envVars, logger: logger, cancellationToken: CancellationToken.None).Result;
TestInit.cs (4)
178ProcessRunner.ProcessResult ret = ProcessRunner.TryRunAsync("dotnet", "tool uninstall -g dotnet-svcutil", currentDirectory, null, CancellationToken.None).Result;
185ret = ProcessRunner.TryRunAsync("dotnet", $"tool install --global --add-source {pkgPath} dotnet-svcutil --version {g_SvcutilPkgVersion}", currentDirectory, null, CancellationToken.None).Result;
259this_TestCaseProject = MSBuildProj.FromPathAsync(projectPath, null, CancellationToken.None).Result;
589var rootSolutionFolder = PathHelper.TryFindFileAsync("dotnet-svcutil.sln", parentDir, null, CancellationToken.None).Result;
GenerateDocumentationAndConfigFiles (23)
http2cat (2)
IdeBenchmarks (10)
IdeCoreBenchmarks (22)
SyntacticChangeRangeBenchmark.cs (6)
91SyntacticChangeRangeComputer.ComputeSyntacticChangeRange(_root, newRoot, TimeSpan.MaxValue, CancellationToken.None);
98SyntacticChangeRangeComputer.ComputeSyntacticChangeRange(_root, newRoot, TimeSpan.MaxValue, CancellationToken.None);
104SyntacticChangeRangeComputer.ComputeSyntacticChangeRange(_root, _rootWithSimpleEdit, TimeSpan.MaxValue, CancellationToken.None);
110SyntacticChangeRangeComputer.ComputeSyntacticChangeRange(_root, _rootWithComplexEdit, TimeSpan.MaxValue, CancellationToken.None);
117SyntacticChangeRangeComputer.ComputeSyntacticChangeRange(_root, newRoot, TimeSpan.MaxValue, CancellationToken.None);
124SyntacticChangeRangeComputer.ComputeSyntacticChangeRange(_root, newRoot, TimeSpan.MaxValue, CancellationToken.None);
IIS.FunctionalTests (2)
IIS.LongTests (2)
IIS.NewHandler.FunctionalTests (2)
IIS.NewShim.FunctionalTests (2)
IIS.ShadowCopy.Tests (1)
IISExpress.FunctionalTests (2)
InMemory.FunctionalTests (14)
InProcessWebSite (4)
Interop.FunctionalTests (46)
Http3\Http3RequestTests.cs (35)
94var response1 = await client.SendAsync(request1, CancellationToken.None);
154var responseMessage = await client.SendAsync(request, CancellationToken.None).DefaultTimeout();
256var response = await client.SendAsync(request, CancellationToken.None);
300var responseTask = client.SendAsync(request, CancellationToken.None).DefaultTimeout();
380var responseTask = client.SendAsync(request, CancellationToken.None).DefaultTimeout();
424var responseTask = client.SendAsync(request, CancellationToken.None);
566var sendTask = client.SendAsync(request, CancellationToken.None);
625var sendTask = client.SendAsync(request, CancellationToken.None);
681var ex = await Assert.ThrowsAnyAsync<HttpRequestException>(() => client.SendAsync(request, CancellationToken.None)).DefaultTimeout();
820var response = await client.SendAsync(request, CancellationToken.None);
856var response1 = await client.SendAsync(request1, CancellationToken.None);
867var response2 = await client.SendAsync(request2, CancellationToken.None);
953var response2 = await client.SendAsync(request2, CancellationToken.None);
1004var responseTask1 = client.SendAsync(request1, CancellationToken.None);
1020var response2 = await client.SendAsync(request2, CancellationToken.None);
1070var response1 = await client.SendAsync(request1, CancellationToken.None);
1083var response2 = await client.SendAsync(request2, CancellationToken.None);
1099var response3 = await client.SendAsync(request3, CancellationToken.None);
1529var response = await client.SendAsync(request, CancellationToken.None);
1581var response1 = await client.SendAsync(request1, CancellationToken.None);
1591var response2 = await client.SendAsync(request2, CancellationToken.None);
1648var response1 = await client.SendAsync(request1, CancellationToken.None);
1659var response2 = await client.SendAsync(request2, CancellationToken.None);
1705await client.SendAsync(request1, CancellationToken.None);
1719var response2 = await client.SendAsync(request2, CancellationToken.None);
1762var response1 = await client.SendAsync(request1, CancellationToken.None);
1822var response1 = await client.SendAsync(request1, CancellationToken.None);
1878var response1 = await client.SendAsync(request1, CancellationToken.None);
1935var responseTask1 = client.SendAsync(CreateHttp3Request(HttpMethod.Get, $"https://127.0.0.1:{port}/1"), CancellationToken.None);
1985var response3 = await client.SendAsync(CreateHttp3Request(HttpMethod.Get, $"https://127.0.0.1:{port}/3"), CancellationToken.None);
2044var responseTask = client.SendAsync(request1, CancellationToken.None);
2121var response1 = await client.SendAsync(request1, CancellationToken.None);
2199var responseTask = client.SendAsync(request, CancellationToken.None);
2299var responseTask = client.SendAsync(request, CancellationToken.None);
2351var response = await client.SendAsync(request, CancellationToken.None).DefaultTimeout();
Metrics (29)
Metrics.Legacy (29)
Microsoft.Analyzers.Extra.Tests (17)
Microsoft.Analyzers.Local.Tests (7)
Microsoft.Arcade.Common (2)
Microsoft.AspNetCore.Analyzer.Testing (2)
Microsoft.AspNetCore.App.Analyzers.Test (10)
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
Microsoft.AspNetCore.Components.Forms (1)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
Microsoft.AspNetCore.Components.Server (2)
Microsoft.AspNetCore.Components.Server.Tests (15)
Circuits\CircuitHostTest.cs (4)
765var updateTask = circuitHost.UpdateRootComponents(batch, store, false, CancellationToken.None);
799await circuitHost.UpdateRootComponents(new() { Operations = [addOperation] }, null, false, CancellationToken.None);
815await circuitHost.UpdateRootComponents(new() { Operations = [updateOperation] }, null, false, CancellationToken.None);
827await circuitHost.UpdateRootComponents(new() { Operations = [removeOperation] }, null, false, CancellationToken.None);
Circuits\RemoteJSDataStreamTest.cs (10)
24var remoteJSDataStream = await RemoteJSDataStream.CreateRemoteJSDataStreamAsync(_jsRuntime, jsStreamReference, totalLength: 100, signalRMaximumIncomingBytes: 10_000, jsInteropDefaultCallTimeout: TimeSpan.FromMinutes(1), cancellationToken: CancellationToken.None).DefaultTimeout();
162var remoteJSDataStream = await RemoteJSDataStream.CreateRemoteJSDataStreamAsync(jsRuntime, jsStreamReference, totalLength: 100, signalRMaximumIncomingBytes: 10_000, jsInteropDefaultCallTimeout: TimeSpan.FromMinutes(1), cancellationToken: CancellationToken.None);
182var remoteJSDataStream = await RemoteJSDataStream.CreateRemoteJSDataStreamAsync(jsRuntime, jsStreamReference, totalLength: 100, signalRMaximumIncomingBytes: 10_000, jsInteropDefaultCallTimeout: TimeSpan.FromMinutes(1), cancellationToken: CancellationToken.None);
219cancellationToken: CancellationToken.None);
260cancellationToken: CancellationToken.None);
296var token1 = isToken1Cancelable ? cts.Token : CancellationToken.None;
297var token2 = isToken1Cancelable ? CancellationToken.None : cts.Token;
313CancellationToken.None,
314CancellationToken.None);
348var remoteJSDataStream = await RemoteJSDataStream.CreateRemoteJSDataStreamAsync(jsRuntime ?? _jsRuntime, jsStreamReference, totalLength: 100, signalRMaximumIncomingBytes: 10_000, jsInteropDefaultCallTimeout: TimeSpan.FromMinutes(1), cancellationToken: CancellationToken.None);
Microsoft.AspNetCore.Components.Web (1)
Microsoft.AspNetCore.Components.Web.Tests (1)
Microsoft.AspNetCore.Components.WebAssembly (1)
Microsoft.AspNetCore.Components.WebAssembly.Tests (3)
Microsoft.AspNetCore.Components.WebView.Photino (2)
Microsoft.AspNetCore.Connections.Abstractions (2)
Microsoft.AspNetCore.DataProtection (3)
Microsoft.AspNetCore.DataProtection.Tests (22)
KeyManagement\KeyRingBasedDataProtectorTests.cs (5)
263var keyRing = new CacheableKeyRing(CancellationToken.None, DateTimeOffset.MaxValue, key, new[] { key });
294var keyRing = new CacheableKeyRing(CancellationToken.None, DateTimeOffset.MaxValue, key, new[] { key });
298var keyRing2 = new CacheableKeyRing(CancellationToken.None, DateTimeOffset.MaxValue, key, new[] { key2 });
330var keyRing = new CacheableKeyRing(CancellationToken.None, DateTimeOffset.MaxValue, key, new[] { key });
334var keyRing2 = new CacheableKeyRing(CancellationToken.None, DateTimeOffset.MaxValue, key, new[] { key2 });
KeyManagement\KeyRingProviderTests.cs (16)
163getCacheExpirationTokenReturnValues: new[] { CancellationToken.None, CancellationToken.None },
248getCacheExpirationTokenReturnValues: new[] { CancellationToken.None },
501getCacheExpirationTokenReturnValues: new[] { CancellationToken.None, CancellationToken.None },
536getCacheExpirationTokenReturnValues: new[] { CancellationToken.None, CancellationToken.None },
582expirationToken: CancellationToken.None,
609expirationToken: CancellationToken.None,
615expirationToken: CancellationToken.None,
621expirationToken: CancellationToken.None,
650expirationToken: CancellationToken.None,
656expirationToken: CancellationToken.None,
701expirationToken: CancellationToken.None,
738.Returns(new CacheableKeyRing(CancellationToken.None, StringToDateTime("2015-03-02 00:00:00Z"), updatedKeyRing));
831expirationToken: CancellationToken.None,
Microsoft.AspNetCore.Grpc.JsonTranscoding (4)
Microsoft.AspNetCore.Hosting.Abstractions (1)
Microsoft.AspNetCore.Http (1)
Microsoft.AspNetCore.Http.Connections (1)
Microsoft.AspNetCore.Http.Connections.Client (3)
Microsoft.AspNetCore.Http.Connections.Tests (18)
WebSocketsTests.cs (8)
51cancellationToken: CancellationToken.None);
52await feature.Client.CloseAsync(WebSocketCloseStatus.NormalClosure, "", CancellationToken.None);
100await feature.Client.CloseAsync(WebSocketCloseStatus.NormalClosure, "", CancellationToken.None);
193await feature.Client.CloseAsync(WebSocketCloseStatus.NormalClosure, "", CancellationToken.None);
298await feature.Client.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, null, CancellationToken.None).DefaultTimeout();
332await feature.Client.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, null, CancellationToken.None).DefaultTimeout();
376var transport = ws.ProcessRequestAsync(context, CancellationToken.None);
386await feature.Client.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, null, CancellationToken.None).DefaultTimeout();
Microsoft.AspNetCore.Http.Extensions.Tests (5)
SendFileResponseExtensionsTests.cs (5)
26await response.SendFileAsync("bob", 1, 3, CancellationToken.None);
31Assert.Equal(CancellationToken.None, fakeFeature.Token);
42await response.SendFileAsync("testfile1kb.txt", 1, 3, CancellationToken.None);
82await response.SendFileAsync("testfile1kb.txt", 1, 3, CancellationToken.None);
97await response.SendFileAsync("testfile1kb.txt", 1, 3, CancellationToken.None);
Microsoft.AspNetCore.Http.Results.Tests (5)
Microsoft.AspNetCore.HttpOverrides (1)
Microsoft.AspNetCore.Identity (4)
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Microsoft.AspNetCore.Identity.Test (91)
RoleManagerTest.cs (9)
17store.Setup(s => s.CreateAsync(role, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
18store.Setup(s => s.GetRoleNameAsync(role, CancellationToken.None)).Returns(Task.FromResult(role.Name)).Verifiable();
19store.Setup(s => s.SetNormalizedRoleNameAsync(role, normalizer.NormalizeName(role.Name), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
37store.Setup(s => s.UpdateAsync(role, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
38store.Setup(s => s.GetRoleNameAsync(role, CancellationToken.None)).Returns(Task.FromResult(role.Name)).Verifiable();
39store.Setup(s => s.SetNormalizedRoleNameAsync(role, normalizer.NormalizeName(role.Name), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
65store.Setup(s => s.FindByNameAsync(normalizer.NormalizeName("Foo"), CancellationToken.None)).Returns(Task.FromResult(role)).Verifiable();
82store.Setup(s => s.FindByNameAsync(role.Name, CancellationToken.None)).Returns(Task.FromResult(role)).Verifiable();
101store.Setup(s => s.FindByNameAsync(normalizer.NormalizeName("Foo"), CancellationToken.None)).Returns(Task.FromResult(role)).Verifiable();
UserManagerTest.cs (82)
72store.Setup(s => s.CreateAsync(user, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
73store.Setup(s => s.GetUserNameAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.UserName)).Verifiable();
74store.Setup(s => s.SetNormalizedUserNameAsync(user, normalizer.NormalizeName(user.UserName), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
91store.Setup(s => s.CreateAsync(user, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
92store.Setup(s => s.GetSecurityStampAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.SecurityStamp)).Verifiable();
93store.Setup(s => s.SetSecurityStampAsync(user, It.IsAny<string>(), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
111store.Setup(s => s.CreateAsync(user, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
112store.Setup(s => s.GetUserNameAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.UserName)).Verifiable();
113store.Setup(s => s.GetEmailAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.Email)).Verifiable();
114store.Setup(s => s.SetNormalizedEmailAsync(user, normalizer.NormalizeEmail(user.Email), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
115store.Setup(s => s.SetNormalizedUserNameAsync(user, normalizer.NormalizeName(user.UserName), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
135store.Setup(s => s.DeleteAsync(user, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
162store.Setup(s => s.DeleteAsync(user, CancellationToken.None)).ReturnsAsync(IdentityResult.Failed(new IdentityErrorDescriber().ConcurrencyFailure())).Verifiable();
188store.Setup(s => s.GetUserNameAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.UserName)).Verifiable();
189store.Setup(s => s.SetNormalizedUserNameAsync(user, normalizer.NormalizeName(user.UserName), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
190store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
208store.Setup(s => s.GetUserNameAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.UserName)).Verifiable();
209store.Setup(s => s.GetEmailAsync(user, CancellationToken.None)).Returns(Task.FromResult(user.Email)).Verifiable();
210store.Setup(s => s.SetNormalizedUserNameAsync(user, normalizer.NormalizeName(user.UserName), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
211store.Setup(s => s.SetNormalizedEmailAsync(user, normalizer.NormalizeEmail(user.Email), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
212store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
230store.Setup(s => s.SetUserNameAsync(user, "foo", CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
231store.Setup(s => s.GetUserNameAsync(user, CancellationToken.None)).Returns(Task.FromResult("foo")).Verifiable();
232store.Setup(s => s.SetNormalizedUserNameAsync(user, normalizer.NormalizeName("foo"), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
233store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).Returns(Task.FromResult(IdentityResult.Success)).Verifiable();
250store.Setup(s => s.FindByIdAsync(user.Id, CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable();
268store.Setup(s => s.FindByNameAsync(normalizer.NormalizeName(user.UserName), CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable();
285store.Setup(s => s.FindByNameAsync(user.UserName, CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable();
304store.Setup(s => s.FindByEmailAsync(normalizer.NormalizeEmail(user.Email), CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable();
321store.Setup(s => s.FindByEmailAsync(user.Email, CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable();
345store.Setup(s => s.FindByEmailAsync("@Foo", CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable();
363store.Setup(s => s.FindByNameAsync("#Foo", CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable();
383store.Setup(s => s.AddToRoleAsync(user, normalizer.NormalizeName("A"), CancellationToken.None))
386store.Setup(s => s.AddToRoleAsync(user, normalizer.NormalizeName("B"), CancellationToken.None))
389store.Setup(s => s.AddToRoleAsync(user, normalizer.NormalizeName("C"), CancellationToken.None))
393store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
394store.Setup(s => s.IsInRoleAsync(user, normalizer.NormalizeName("A"), CancellationToken.None))
397store.Setup(s => s.IsInRoleAsync(user, normalizer.NormalizeName("B"), CancellationToken.None))
400store.Setup(s => s.IsInRoleAsync(user, normalizer.NormalizeName("C"), CancellationToken.None))
411store.Verify(s => s.AddToRoleAsync(user, normalizer.NormalizeName("C"), CancellationToken.None), Times.Once());
421store.Setup(s => s.AddToRoleAsync(user, "#A", CancellationToken.None))
424store.Setup(s => s.AddToRoleAsync(user, "#B", CancellationToken.None))
427store.Setup(s => s.AddToRoleAsync(user, "#C", CancellationToken.None))
431store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
432store.Setup(s => s.IsInRoleAsync(user, "#A", CancellationToken.None))
435store.Setup(s => s.IsInRoleAsync(user, "#B", CancellationToken.None))
438store.Setup(s => s.IsInRoleAsync(user, "#C", CancellationToken.None))
450store.Verify(s => s.AddToRoleAsync(user, "#C", CancellationToken.None), Times.Once());
461store.Setup(s => s.AddToRoleAsync(user, normalizer.NormalizeName("A"), CancellationToken.None))
464store.Setup(s => s.IsInRoleAsync(user, normalizer.NormalizeName("B"), CancellationToken.None))
485store.Setup(s => s.RemoveFromRoleAsync(user, normalizer.NormalizeName("A"), CancellationToken.None))
488store.Setup(s => s.RemoveFromRoleAsync(user, normalizer.NormalizeName("B"), CancellationToken.None))
491store.Setup(s => s.RemoveFromRoleAsync(user, normalizer.NormalizeName("C"), CancellationToken.None))
494store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
495store.Setup(s => s.IsInRoleAsync(user, normalizer.NormalizeName("A"), CancellationToken.None))
498store.Setup(s => s.IsInRoleAsync(user, normalizer.NormalizeName("B"), CancellationToken.None))
501store.Setup(s => s.IsInRoleAsync(user, normalizer.NormalizeName("C"), CancellationToken.None))
522store.Setup(s => s.RemoveFromRoleAsync(user, normalizer.NormalizeName("A"), CancellationToken.None))
525store.Setup(s => s.IsInRoleAsync(user, normalizer.NormalizeName("A"), CancellationToken.None))
528store.Setup(s => s.IsInRoleAsync(user, normalizer.NormalizeName("B"), CancellationToken.None))
548store.Setup(s => s.AddClaimsAsync(user, claims, CancellationToken.None))
551store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
572store.Setup(s => s.AddClaimsAsync(user, It.IsAny<IEnumerable<Claim>>(), CancellationToken.None))
575store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
604store.Setup(s => s.ReplaceClaimAsync(user, It.IsAny<Claim>(), It.IsAny<Claim>(), CancellationToken.None))
607store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).Returns(Task.FromResult(IdentityResult.Success)).Verifiable();
640store.Setup(s => s.GetPasswordHashAsync(user, CancellationToken.None))
643store.Setup(s => s.SetPasswordHashAsync(user, It.IsAny<string>(), CancellationToken.None)).Returns(Task.FromResult(0)).Verifiable();
736store.Setup(s => s.RemoveClaimsAsync(user, claims, CancellationToken.None))
739store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
767store.Setup(s => s.RemoveClaimsAsync(user, It.IsAny<IEnumerable<Claim>>(), CancellationToken.None))
770store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
795store.Setup(s => s.AddOrUpdatePasskeyAsync(user, passkey, CancellationToken.None)).Returns(Task.CompletedTask).Verifiable();
796store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
815store.Setup(s => s.GetPasskeysAsync(user, CancellationToken.None)).Returns(Task.FromResult(passkeys)).Verifiable();
833store.Setup(s => s.FindByPasskeyIdAsync(credentialId, CancellationToken.None)).Returns(Task.FromResult(user)).Verifiable();
851store.Setup(s => s.RemovePasskeyAsync(user, credentialId, CancellationToken.None)).Returns(Task.CompletedTask).Verifiable();
852store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(IdentityResult.Success).Verifiable();
2160store.Setup(s => s.FindByEmailAsync("DUPE@EMAIL.COM", CancellationToken.None))
2163store.Setup(s => s.GetUserIdAsync(user2, CancellationToken.None))
2166store.Setup(s => s.GetUserNameAsync(user, CancellationToken.None))
2169store.Setup(s => s.GetEmailAsync(user, CancellationToken.None))
Microsoft.AspNetCore.Identity.UI (8)
Microsoft.AspNetCore.Mvc.Core.Test (5)
Microsoft.AspNetCore.Mvc.Formatters.Xml (4)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (2)
Microsoft.AspNetCore.OutputCaching (1)
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (6)
EndToEndBenchmarks.cs (6)
130await OutputCacheEntryFormatter.StoreAsync(Key, entry, _tags, _options.DefaultExpirationTimeSpan, _store, NullLogger.Instance, CancellationToken.None);
140await WriteInRandomChunksAsync(Payload, oc, CancellationToken.None);
146await OutputCacheEntryFormatter.StoreAsync(Key, entry, _tags, _options.DefaultExpirationTimeSpan, _store, NullLogger.Instance, CancellationToken.None);
157await WriteInRandomChunks(Payload, pipe, CancellationToken.None);
163await OutputCacheEntryFormatter.StoreAsync(Key, entry, _tags, _options.DefaultExpirationTimeSpan, _store, NullLogger.Instance, CancellationToken.None);
174var entry = await OutputCacheEntryFormatter.GetAsync(Key, _store, CancellationToken.None);
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (1)
Microsoft.AspNetCore.OutputCaching.Tests (1)
Microsoft.AspNetCore.Owin (3)
Microsoft.AspNetCore.Owin.Tests (1)
Microsoft.AspNetCore.ResponseCaching (2)
Microsoft.AspNetCore.ResponseCaching.Microbenchmarks (2)
Microsoft.AspNetCore.ResponseCompression (1)
Microsoft.AspNetCore.ResponseCompression.Tests (4)
Microsoft.AspNetCore.Server.HttpSys (5)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (33)
ResponseSendFileTests.cs (17)
45await sendFile.SendFileAsync(string.Empty, 0, null, CancellationToken.None);
68return sendFile.SendFileAsync(AbsoluteFilePath, 0, null, CancellationToken.None);
87return sendFile.SendFileAsync(RelativeFilePath, 0, null, CancellationToken.None);
106return sendFile.SendFileAsync(AbsoluteFilePath, 0, null, CancellationToken.None);
125sendFile.SendFileAsync(AbsoluteFilePath, 0, null, CancellationToken.None).Wait();
126return sendFile.SendFileAsync(AbsoluteFilePath, 0, null, CancellationToken.None);
145return sendFile.SendFileAsync(AbsoluteFilePath, 0, FileLength / 2, CancellationToken.None);
166sendFile.SendFileAsync(AbsoluteFilePath, 1234567, null, CancellationToken.None));
185sendFile.SendFileAsync(AbsoluteFilePath, 0, 1234567, CancellationToken.None));
202return sendFile.SendFileAsync(AbsoluteFilePath, 0, 0, CancellationToken.None);
222return sendFile.SendFileAsync(AbsoluteFilePath, 0, null, CancellationToken.None);
243return sendFile.SendFileAsync(AbsoluteFilePath, 0, 10, CancellationToken.None);
264return sendFile.SendFileAsync(AbsoluteFilePath, 0, 0, CancellationToken.None);
291return sendFile.SendFileAsync(AbsoluteFilePath, 0, 10, CancellationToken.None);
315await httpContext.Response.SendFileAsync(emptyFilePath, 0, null, CancellationToken.None);
317await httpContext.Response.Body.WriteAsync(new byte[10], 0, 10, CancellationToken.None);
650await httpContext.Response.SendFileAsync(AbsoluteFilePath, 0, null, CancellationToken.None);
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (1)
Microsoft.AspNetCore.Server.IIS (1)
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (25)
AddressBinderTests.cs (5)
193AddressBinder.BindAsync(options.GetListenOptions(), addressBindContext, _noopUseHttps, CancellationToken.None));
214var bindTask = AddressBinder.BindAsync(options.GetListenOptions(), addressBindContext, _noopUseHttps, CancellationToken.None);
242var bindTask = AddressBinder.BindAsync(options.GetListenOptions(), addressBindContext, _noopUseHttps, CancellationToken.None);
305await AddressBinder.BindAsync(options.GetListenOptions(), addressBindContext, _noopUseHttps, CancellationToken.None);
336await AddressBinder.BindAsync(options.GetListenOptions(), addressBindContext, _noopUseHttps, CancellationToken.None);
KestrelServerTests.cs (15)
352async () => await server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None));
371await server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None);
393async () => await server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None));
416await server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None);
442await server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None);
469await server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None);
500await server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None);
528await server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None);
577await server.StartAsync(new DummyApplication(), CancellationToken.None);
635await server.StartAsync(new DummyApplication(), CancellationToken.None);
826await server.StartAsync(new DummyApplication(), CancellationToken.None).DefaultTimeout();
905await server.StopAsync(CancellationToken.None).DefaultTimeout();
964await server.StartAsync(new DummyApplication(), CancellationToken.None).DefaultTimeout();
971await server.StopAsync(CancellationToken.None).DefaultTimeout();
986server.StartAsync(new DummyApplication(context => Task.CompletedTask), CancellationToken.None).GetAwaiter().GetResult();
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (5)
Microsoft.AspNetCore.Shared.Tests (2)
Microsoft.AspNetCore.SignalR.Client.Core (66)
Microsoft.AspNetCore.SignalR.Core (37)
Microsoft.AspNetCore.SignalR.Tests (16)
EndToEndTests.cs (10)
100await ws.ConnectAsync(new Uri(socketUrl), CancellationToken.None).DefaultTimeout();
104await ws.SendAsync(new ArraySegment<byte>(bytes), WebSocketMessageType.Binary, endOfMessage: true, CancellationToken.None).DefaultTimeout();
108var result = await ws.ReceiveAsync(buffer, CancellationToken.None).DefaultTimeout();
114await ws.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "", CancellationToken.None).DefaultTimeout();
116result = await ws.ReceiveAsync(buffer, CancellationToken.None).DefaultTimeout();
138await ws.ConnectAsync(new Uri(socketUrl), CancellationToken.None).DefaultTimeout();
143await ws.SendAsync(new ArraySegment<byte>(bytes), WebSocketMessageType.Binary, endOfMessage: false, CancellationToken.None).DefaultTimeout();
147var result = await ws.ReceiveAsync(buffer, CancellationToken.None).DefaultTimeout();
153await ws.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "", CancellationToken.None).DefaultTimeout();
155result = await ws.ReceiveAsync(buffer, CancellationToken.None).DefaultTimeout();
Microsoft.AspNetCore.SpaServices.Extensions (1)
Microsoft.AspNetCore.SpaServices.Extensions.Tests (2)
Microsoft.AspNetCore.TestHost (1)
Microsoft.AspNetCore.TestHost.Tests (31)
TestClientTests.cs (25)
340var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => client.SendAsync(message, CancellationToken.None));
723var receiveResult = await websocket.ReceiveAsync(new System.ArraySegment<byte>(receiveArray), CancellationToken.None);
726await websocket.CloseAsync(WebSocketCloseStatus.NormalClosure, "Normal Closure", CancellationToken.None);
732await websocket.SendAsync(sendBuffer, receiveResult.MessageType, receiveResult.EndOfMessage, CancellationToken.None);
762var clientSocket = await client.ConnectAsync(new System.Uri("http://localhost"), CancellationToken.None);
764await clientSocket.SendAsync(new System.ArraySegment<byte>(hello), WebSocketMessageType.Text, true, CancellationToken.None);
766await clientSocket.SendAsync(new System.ArraySegment<byte>(world), WebSocketMessageType.Binary, true, CancellationToken.None);
767await clientSocket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "Normal Closure", CancellationToken.None);
773var result = await clientSocket.ReceiveAsync(new System.ArraySegment<byte>(buffer), CancellationToken.None);
778result = await clientSocket.ReceiveAsync(new System.ArraySegment<byte>(buffer), CancellationToken.None);
783result = await clientSocket.ReceiveAsync(new System.ArraySegment<byte>(buffer), CancellationToken.None);
805await websocket.CloseAsync(WebSocketCloseStatus.NormalClosure, "Normal Closure", CancellationToken.None);
814await websocket.CloseAsync(WebSocketCloseStatus.InternalServerError, closeReason, CancellationToken.None);
834var clientSocket = await client.ConnectAsync(new Uri("wss://localhost"), CancellationToken.None);
836var result = await clientSocket.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None);
861var receiveResult = await websocket.ReceiveAsync(new ArraySegment<byte>(receiveArray), CancellationToken.None);
864await websocket.CloseAsync(WebSocketCloseStatus.NormalClosure, "Normal Closure", CancellationToken.None);
870await websocket.SendAsync(sendBuffer, receiveResult.MessageType, receiveResult.EndOfMessage, CancellationToken.None);
946var clientSocket = await client.ConnectAsync(new System.Uri("http://localhost"), CancellationToken.None);
948await Assert.ThrowsAsync<IOException>(async () => await clientSocket.ReceiveAsync(new System.ArraySegment<byte>(buffer), CancellationToken.None));
965var receiveResult = await websocket.ReceiveAsync(new System.ArraySegment<byte>(receiveArray), CancellationToken.None);
967await websocket.SendAsync(sendBuffer, receiveResult.MessageType, receiveResult.EndOfMessage, CancellationToken.None);
986var clientSocket = await client.ConnectAsync(new System.Uri("http://localhost"), CancellationToken.None);
988await clientSocket.SendAsync(new System.ArraySegment<byte>(hello), WebSocketMessageType.Text, true, CancellationToken.None);
995var result = await clientSocket.ReceiveAsync(new System.ArraySegment<byte>(buffer), CancellationToken.None);
Microsoft.AspNetCore.WebSockets.Tests (74)
SendReceiveTests.cs (11)
19await pair.ClientSocket.SendAsync(new ArraySegment<byte>(sendBuffer), WebSocketMessageType.Text, endOfMessage: true, cancellationToken: CancellationToken.None);
22var result = await pair.ServerSocket.ReceiveAsync(new ArraySegment<byte>(receiveBuffer), CancellationToken.None);
36await pair.ServerSocket.SendAsync(new ArraySegment<byte>(sendBuffer), WebSocketMessageType.Text, endOfMessage: true, cancellationToken: CancellationToken.None);
39var result = await pair.ClientSocket.ReceiveAsync(new ArraySegment<byte>(receiveBuffer), CancellationToken.None);
51await pair.ClientSocket.SendAsync(new ArraySegment<byte>(sendBuffer), WebSocketMessageType.Binary, endOfMessage: true, cancellationToken: CancellationToken.None);
54var result = await pair.ServerSocket.ReceiveAsync(new ArraySegment<byte>(receiveBuffer), CancellationToken.None);
66await pair.ServerSocket.SendAsync(new ArraySegment<byte>(sendBuffer), WebSocketMessageType.Binary, endOfMessage: true, cancellationToken: CancellationToken.None);
69var result = await pair.ClientSocket.ReceiveAsync(new ArraySegment<byte>(receiveBuffer), CancellationToken.None);
81await pair.ServerSocket.SendAsync(new ArraySegment<byte>(sendBuffer), WebSocketMessageType.Binary, endOfMessage: true, cancellationToken: CancellationToken.None);
84var result = await pair.ClientSocket.ReceiveAsync(new ArraySegment<byte>(receiveBuffer), CancellationToken.None);
94await pair.ClientSocket.ReceiveAsync(new ArraySegment<byte>(receiveBuffer), CancellationToken.None);
WebSocketMiddlewareTests.cs (61)
29await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
49await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
71var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
79await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
81await client.SendAsync(new ArraySegment<byte>(originalData), WebSocketMessageType.Binary, true, CancellationToken.None);
96var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
105await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
106await client.SendAsync(new ArraySegment<byte>(originalData), WebSocketMessageType.Binary, true, CancellationToken.None);
121var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
130await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
131await client.SendAsync(new ArraySegment<byte>(originalData), WebSocketMessageType.Binary, true, CancellationToken.None);
147var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
158await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
159await client.SendAsync(new ArraySegment<byte>(originalData), WebSocketMessageType.Binary, true, CancellationToken.None);
178var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
186new ArraySegment<byte>(serverBuffer, totalReceived, serverBuffer.Length - totalReceived), CancellationToken.None);
194new ArraySegment<byte>(serverBuffer, totalReceived, serverBuffer.Length - totalReceived), CancellationToken.None);
205await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
206await client.SendAsync(new ArraySegment<byte>(originalData, 0, 2), WebSocketMessageType.Binary, false, CancellationToken.None);
209await client.SendAsync(new ArraySegment<byte>(originalData, 2, 2), WebSocketMessageType.Binary, false, CancellationToken.None);
212await client.SendAsync(new ArraySegment<byte>(originalData, 4, 7), WebSocketMessageType.Binary, true, CancellationToken.None);
226await webSocket.SendAsync(new ArraySegment<byte>(originalData), WebSocketMessageType.Binary, true, CancellationToken.None);
231await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
233var result = await client.ReceiveAsync(new ArraySegment<byte>(clientBuffer), CancellationToken.None);
251await webSocket.SendAsync(new ArraySegment<byte>(originalData), WebSocketMessageType.Binary, true, CancellationToken.None);
256await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
258var result = await client.ReceiveAsync(new ArraySegment<byte>(clientBuffer), CancellationToken.None);
276await webSocket.SendAsync(new ArraySegment<byte>(originalData), WebSocketMessageType.Binary, true, CancellationToken.None);
281await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
287result = await client.ReceiveAsync(new ArraySegment<byte>(clientBuffer, receivedCount, clientBuffer.Length - receivedCount), CancellationToken.None);
309await webSocket.SendAsync(new ArraySegment<byte>(originalData, 0, 2), WebSocketMessageType.Binary, false, CancellationToken.None);
310await webSocket.SendAsync(new ArraySegment<byte>(originalData, 2, 2), WebSocketMessageType.Binary, false, CancellationToken.None);
311await webSocket.SendAsync(new ArraySegment<byte>(originalData, 4, 7), WebSocketMessageType.Binary, true, CancellationToken.None);
316await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
318var result = await client.ReceiveAsync(new ArraySegment<byte>(clientBuffer), CancellationToken.None);
325new ArraySegment<byte>(clientBuffer, totalReceived, clientBuffer.Length - totalReceived), CancellationToken.None);
332new ArraySegment<byte>(clientBuffer, totalReceived, clientBuffer.Length - totalReceived), CancellationToken.None);
353var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
363await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
364await client.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, closeDescription, CancellationToken.None);
380await webSocket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, closeDescription, CancellationToken.None);
385await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
387var result = await client.ReceiveAsync(new ArraySegment<byte>(clientBuffer), CancellationToken.None);
409var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
416await webSocket.CloseAsync(result.CloseStatus.Value, result.CloseStatusDescription, CancellationToken.None);
421await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
422await client.CloseAsync(WebSocketCloseStatus.NormalClosure, closeDescription, CancellationToken.None);
439var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
446await webSocket.CloseAsync(result.CloseStatus.Value, result.CloseStatusDescription, CancellationToken.None);
451await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
452await client.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, closeDescription, CancellationToken.None);
455await client.CloseAsync(WebSocketCloseStatus.NormalClosure, closeDescription, CancellationToken.None);
470await webSocket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, closeDescription, CancellationToken.None);
473var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
483await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
485var result = await client.ReceiveAsync(new ArraySegment<byte>(clientBuffer), CancellationToken.None);
494await client.CloseAsync(result.CloseStatus.Value, result.CloseStatusDescription, CancellationToken.None);
558await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
625await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
735await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
793await client.ConnectAsync(new Uri($"ws://127.0.0.1:{port}/"), CancellationToken.None);
Microsoft.AspNetCore.WebUtilities (2)
Microsoft.Build.Framework (2)
Microsoft.Build.Tasks.CodeAnalysis (2)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (2)
Microsoft.CodeAnalysis (12)
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (7)
67public CancellationToken CancellationToken => CancellationToken.None;
235return GetAnalyzerDiagnosticsAsync(CancellationToken.None);
286return GetAllDiagnosticsAsync(CancellationToken.None);
1199var effectiveDiagnostic = compilation.Options.FilterDiagnostic(diagnostic, CancellationToken.None);
1241catch (Exception ex) when (AnalyzerExecutor.HandleAnalyzerException(ex, analyzer, info: null, wrappedOnAnalyzerException, analyzerExceptionFilter: null, CancellationToken.None))
1253catch (Exception ex) when (AnalyzerExecutor.HandleAnalyzerException(ex, suppressor, info: null, wrappedOnAnalyzerException, analyzerExceptionFilter: null, CancellationToken.None))
1260isEnabledWithAnalyzerConfigOptions: _ => false, getSupportedDiagnosticDescriptors, getSupportedSuppressionDescriptors, CancellationToken.None); ;
Microsoft.CodeAnalysis.Analyzers (23)
Microsoft.CodeAnalysis.AnalyzerUtilities (23)
Microsoft.CodeAnalysis.BannedApiAnalyzers (23)
Microsoft.CodeAnalysis.CodeStyle (19)
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (2)
Microsoft.CodeAnalysis.Collections.Package (2)
Microsoft.CodeAnalysis.Contracts.Package (2)
Microsoft.CodeAnalysis.CSharp (7)
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (6)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (123)
EditAndContinue\ActiveStatementTrackingServiceTests.cs (7)
72Assert.Same(snapshot1, document1.GetTextSynchronously(CancellationToken.None).FindCorrespondingEditorTextSnapshot());
73Assert.Same(snapshot2, document2.GetTextSynchronously(CancellationToken.None).FindCorrespondingEditorTextSnapshot());
88var spans2 = await trackingSession.GetSpansAsync(solution, document1.Id, document1.FilePath, CancellationToken.None);
91var spans3 = await trackingSession.GetSpansAsync(solution, document2.Id, document2.FilePath, CancellationToken.None);
95var spans4 = await trackingSession.GetAdjustedTrackingSpansAsync(document1, snapshot1, CancellationToken.None);
102AssertEx.Empty(await trackingSession.GetAdjustedTrackingSpansAsync(document2, snapshot2, CancellationToken.None));
119var spans6 = await trackingSession.GetAdjustedTrackingSpansAsync(document1, snapshot1, CancellationToken.None);
ExtractMethod\ExtractMethodBase.cs (7)
130CodeCleanupOptions = await document.GetCodeCleanupOptionsAsync(CancellationToken.None),
134document, testDocument.SelectedSpans.Single(), localFunction, options, CancellationToken.None);
150var (doc, _) = await result.GetDocumentAsync(CancellationToken.None);
167var semanticDocument = await SemanticDocument.CreateAsync(document, CancellationToken.None);
170var (result, status) = await validator.GetValidSelectionAsync(CancellationToken.None);
192var semanticDocument = await SemanticDocument.CreateAsync(document, CancellationToken.None);
199var (_, status) = await validator.GetValidSelectionAsync(CancellationToken.None);
PdbSourceDocument\PdbSourceDocumentLoaderServiceTests.cs (4)
45var result = await service.LoadSourceDocumentAsync(path, sourceDocument, Encoding.UTF8, new TelemetryMessage(CancellationToken.None), useExtendedTimeout: false, CancellationToken.None);
73var result = await service.LoadSourceDocumentAsync(path, sourceDocument, Encoding.UTF8, new TelemetryMessage(CancellationToken.None), useExtendedTimeout: false, CancellationToken.None);
PdbSourceDocument\PdbSourceDocumentTests.cs (8)
787var file = await service.GetGeneratedFileAsync(workspace, project, symbol, signaturesOnly: false, options: options, cancellationToken: CancellationToken.None).ConfigureAwait(false);
845var mainCompilation = await project.GetRequiredCompilationAsync(CancellationToken.None).ConfigureAwait(false);
868var file = await service.GetGeneratedFileAsync(project.Solution.Workspace, project, symbol, signaturesOnly: false, options: MetadataAsSourceOptions.Default, cancellationToken: CancellationToken.None);
889var file = await service.GetGeneratedFileAsync(project.Solution.Workspace, project, symbol, signaturesOnly: false, options: MetadataAsSourceOptions.Default, cancellationToken: CancellationToken.None);
911var file = await service.GetGeneratedFileAsync(project.Solution.Workspace, project, symbol, signaturesOnly: false, options: MetadataAsSourceOptions.Default, cancellationToken: CancellationToken.None);
932var fileOne = await service.GetGeneratedFileAsync(project.Solution.Workspace, project, symbol, signaturesOnly: false, options: MetadataAsSourceOptions.Default, cancellationToken: CancellationToken.None);
937var compilation = await project.GetCompilationAsync(CancellationToken.None);
939var fileTwo = await service.GetGeneratedFileAsync(project.Solution.Workspace, project, symbolTwo, signaturesOnly: false, MetadataAsSourceOptions.Default, CancellationToken.None);
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (7)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (12)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (6)
Emit\EditAndContinue\AssemblyReferencesTests.cs (2)
84compilation1.EmitDifference(baseline, edits, s => false, mdStream, ilStream, pdbStream, EmitDifferenceOptions.Default, CancellationToken.None);
160compilation1.EmitDifference(baseline, edits, s => false, mdStream, ilStream, pdbStream, EmitDifferenceOptions.Default, CancellationToken.None);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (50)
Diagnostics\DiagnosticAnalyzerTests.cs (34)
3270var analysisResult = await compilationWithAnalyzers.GetAnalysisResultAsync(semanticModel1, filterSpan: null, analyzers, CancellationToken.None);
3316var analysisResult = await compilationWithAnalyzers.GetAnalysisResultAsync(semanticModel1, filterSpan: null, analyzers, CancellationToken.None);
3357var tree1SemanticDiagnostics = await compilationWithAnalyzers.GetAnalyzerSemanticDiagnosticsAsync(semanticModel1, filterSpan: null, ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1), CancellationToken.None);
3608var diagnostics = await compWithAnalyzers.GetAnalyzerSemanticDiagnosticsAsync(model, filterSpan: null, CancellationToken.None);
3700await compilationWithAnalyzers.GetAnalysisResultAsync(tree1, analyzersToQuery, CancellationToken.None) :
3701await compilationWithAnalyzers.GetAnalysisResultAsync(semanticModel1, filterSpan: null, analyzersToQuery, CancellationToken.None);
3706await compilationWithAnalyzers.GetAnalysisResultAsync(tree1, CancellationToken.None) :
3707await compilationWithAnalyzers.GetAnalysisResultAsync(semanticModel1, filterSpan: null, CancellationToken.None);
3762CancellationToken.None);
3777CancellationToken.None);
3818CancellationToken.None);
3889var diagnostics = await compilation.WithAnalyzers(analyzers, options).GetAnalyzerDiagnosticsAsync(CancellationToken.None);
3892var analysisResult = await compilation.WithAnalyzers(analyzers, options).GetAnalysisResultAsync(additionalFile, CancellationToken.None);
3896analysisResult = await compilation.WithAnalyzers(analyzers, options).GetAnalysisResultAsync(CancellationToken.None);
3931var diagnostics = await compilation.WithAnalyzers(analyzers, options).GetAnalyzerDiagnosticsAsync(CancellationToken.None);
3934var analysisResult = await compilation.WithAnalyzers(analyzers, options).GetAnalysisResultAsync(additionalFile1, CancellationToken.None);
3936analysisResult = await compilation.WithAnalyzers(analyzers, options).GetAnalysisResultAsync(additionalFile2, CancellationToken.None);
3940analysisResult = await compilation.WithAnalyzers(analyzers, options).GetAnalysisResultAsync(additionalFile1, singleAnalyzerArray, CancellationToken.None);
3942analysisResult = await compilation.WithAnalyzers(analyzers, options).GetAnalysisResultAsync(additionalFile2, singleAnalyzerArray, CancellationToken.None);
3945analysisResult = await compilation.WithAnalyzers(analyzers, options).GetAnalysisResultAsync(CancellationToken.None);
4338? await compilationWithAnalyzers.GetAnalysisResultAsync(semanticModel.SyntaxTree, filterSpan, analyzers, CancellationToken.None)
4339: await compilationWithAnalyzers.GetAnalysisResultAsync(semanticModel.SyntaxTree, filterSpan, CancellationToken.None);
4344? await compilationWithAnalyzers.GetAnalyzerSyntaxDiagnosticsAsync(semanticModel.SyntaxTree, filterSpan, analyzers, CancellationToken.None)
4345: await compilationWithAnalyzers.GetAnalyzerSyntaxDiagnosticsAsync(semanticModel.SyntaxTree, filterSpan, CancellationToken.None);
4352? await compilationWithAnalyzers.GetAnalysisResultAsync(additionalTextFile, filterSpan, analyzers, CancellationToken.None)
4353: await compilationWithAnalyzers.GetAnalysisResultAsync(additionalTextFile, filterSpan, CancellationToken.None);
4360? await compilationWithAnalyzers.GetAnalysisResultAsync(semanticModel, filterSpan, analyzers, CancellationToken.None)
4361: await compilationWithAnalyzers.GetAnalysisResultAsync(semanticModel, filterSpan, CancellationToken.None);
4366? await compilationWithAnalyzers.GetAnalyzerSemanticDiagnosticsAsync(semanticModel, filterSpan, analyzers, CancellationToken.None)
4367: await compilationWithAnalyzers.GetAnalyzerSemanticDiagnosticsAsync(semanticModel, filterSpan, CancellationToken.None);
4400analyzerExceptionFilter: null, reportAnalyzer: false, severityFilter, trackSuppressedDiagnosticIds: false, out var newCompilation, CancellationToken.None);
4403_ = newCompilation.GetDiagnostics(CancellationToken.None);
4404_ = await driver.GetDiagnosticsAsync(newCompilation, CancellationToken.None);
4441var diagnostics = await compWithAnalyzers.GetAnalyzerSemanticDiagnosticsAsync(model, filterSpan: null, CancellationToken.None);
Diagnostics\GetDiagnosticsTests.cs (13)
800tasks[i] = Task.Run(() => compilationWithAnalyzers.GetAnalyzerSemanticDiagnosticsAsync(model, null, CancellationToken.None));
853tasks[i] = Task.Run(() => compilationWithAnalyzers.GetAnalyzerSemanticDiagnosticsAsync(model, null, CancellationToken.None));
881var diagnostics = await compilationWithAnalyzers.GetAnalyzerSyntaxDiagnosticsAsync(tree, CancellationToken.None);
911_ = await compilationWithAnalyzers.GetAnalysisResultAsync(semanticModel, span, CancellationToken.None);
920_ = await compilationWithAnalyzers.GetAnalysisResultAsync(semanticModel, filterSpan: null, CancellationToken.None);
964var result = await compilationWithAnalyzers.GetAnalysisResultAsync(CancellationToken.None);
1190var result = await compilationWithAnalyzers.GetAnalysisResultAsync(semanticModel, span, CancellationToken.None);
1198result = await compilationWithAnalyzers.GetAnalysisResultAsync(semanticModel, filterSpan: null, CancellationToken.None);
1207result = await compilationWithAnalyzers.GetAnalysisResultAsync(semanticModel, span, CancellationToken.None);
1251var result = await compilationWithAnalyzers.GetAnalysisResultAsync(CancellationToken.None);
1649var syntaxResult = await compilationWithAnalyzers.GetAnalysisResultAsync(tree1, CancellationToken.None);
1678var result = await compilationWithAnalyzers.GetAnalysisResultAsync(model1, filterSpan: localDecl.Span, CancellationToken.None);
1824var result = await compilationWithAnalyzers.GetAnalysisResultAsync(CancellationToken.None);
Microsoft.CodeAnalysis.CSharp.Features (2)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (17)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (2)
124return await analyzer.AnalyzeDocumentAsync(newDocument.Id, oldProject, newDocument.Project, baseActiveStatements, newActiveStatementSpans.NullToEmpty(), lazyCapabilities, log, CancellationToken.None);
758var result = await analyzer.AnalyzeDocumentAsync(newDocument.Id, oldProject, newDocument.Project, baseActiveStatements, [], capabilities, log, CancellationToken.None);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (18)
Semantics\SemanticErrorTests.cs (6)
25163}, CancellationToken.None)
25171comp.GetDiagnostics(CompilationStage.Declare, includeEarlierStages: true, symbolFilter: null, CancellationToken.None)
25232}, CancellationToken.None)
25242comp.GetDiagnostics(CompilationStage.Declare, includeEarlierStages: true, symbolFilter: null, CancellationToken.None)
25322}, CancellationToken.None)
25336comp.GetDiagnostics(CompilationStage.Declare, includeEarlierStages: true, symbolFilter: null, CancellationToken.None)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (29)
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (32)
CodeGeneration\AddImportsTests.cs (12)
90? await ImportAdder.AddImportsFromSymbolAnnotationAsync(doc, addImportOptions, CancellationToken.None)
91: await ImportAdder.AddImportsFromSyntaxesAsync(doc, addImportOptions, CancellationToken.None);
95var formatted = await Formatter.FormatAsync(imported, SyntaxAnnotation.ElasticAnnotation, formattingOptions, CancellationToken.None);
102var reduced = await Simplifier.ReduceAsync(imported, simplifierOptions, CancellationToken.None);
103var formatted = await Formatter.FormatAsync(reduced, SyntaxAnnotation.ElasticAnnotation, formattingOptions, CancellationToken.None);
868var compilation = await document.Project.GetCompilationAsync(CancellationToken.None);
869var compilerDiagnostics = compilation.GetDiagnostics(CancellationToken.None);
874var syntaxRoot = await document.GetSyntaxRootAsync(CancellationToken.None).ConfigureAwait(false);
878var editor = await DocumentEditor.CreateAsync(document, CancellationToken.None).ConfigureAwait(false);
889? await ImportAdder.AddImportsFromSymbolAnnotationAsync(documentWithAttribute, addImportOptions, CancellationToken.None).ConfigureAwait(false)
890: await ImportAdder.AddImportsFromSyntaxesAsync(documentWithAttribute, addImportOptions, CancellationToken.None).ConfigureAwait(false);
892var formatted = await Formatter.FormatAsync(imported, formattingOptions, CancellationToken.None);
Formatting\FormattingElasticTriviaTests.cs (5)
71var newCompilation = Formatter.Format(compilation, workspace.Services.SolutionServices, CSharpSyntaxFormattingOptions.Default, CancellationToken.None);
130var formatted = Formatter.Format(newRoot, workspace.Services.SolutionServices, options, CancellationToken.None).ToFullString();
133var elasticOnlyFormatted = Formatter.Format(newRoot, SyntaxAnnotation.ElasticAnnotation, workspace.Services.SolutionServices, options, CancellationToken.None).ToFullString();
136var annotationFormatted = Formatter.Format(newRoot, Formatter.Annotation, workspace.Services.SolutionServices, options, CancellationToken.None).ToFullString();
180var newCompilation = Formatter.Format(compilation, workspace.Services.SolutionServices, CSharpSyntaxFormattingOptions.Default, CancellationToken.None);
Microsoft.CodeAnalysis.Debugging.Package (2)
Microsoft.CodeAnalysis.EditorFeatures (51)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (54)
Classification\AbstractClassifierTests.cs (4)
267await service.AddSemanticClassificationsAsync(document, spans, options, result, CancellationToken.None);
268await service.AddEmbeddedLanguageClassificationsAsync(document, spans, options, result, CancellationToken.None);
274var root = await document.GetRequiredSyntaxRootAsync(CancellationToken.None);
278service.AddSyntacticClassifications(root, spans, results, CancellationToken.None);
Formatting\CoreFormatterTestsBase.cs (4)
183var documentSyntax = await ParsedDocument.CreateAsync(document, CancellationToken.None).ConfigureAwait(false);
214var newRootNode = Formatter.Format(root, spans, workspace.Services.SolutionServices, options, rules, CancellationToken.None);
227var result = Formatter.GetFormattedTextChanges(root, spans, workspace.Services.SolutionServices, options, rules, CancellationToken.None);
289var result = Formatter.Format(node, workspace.Services.SolutionServices, options, CancellationToken.None);
SignatureHelp\AbstractSignatureHelpProviderTests.cs (5)
160var items = await signatureHelpProvider.GetItemsAsync(document, cursorPosition, triggerInfo, options, CancellationToken.None);
177_ = await signatureHelpProvider.GetItemsAsync(document, cursorPosition, triggerInfo, options, CancellationToken.None);
229Assert.Equal(expectedTestItem.MethodDocumentation, actualSignatureHelpItem.DocumentationFactory(CancellationToken.None).GetFullText());
249var classifiedSpans = actualSignatureHelpItem.DocumentationFactory(CancellationToken.None).ToClassifiedSpans().ToList();
401var items = await signatureHelpProvider.GetItemsAsync(document, cursorPosition, triggerInfo, options, CancellationToken.None);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (199)
CodeFixes\CodeFixServiceTests.cs (21)
60document, TextSpan.FromBounds(0, 0), new DefaultCodeActionRequestPriorityProvider(), CancellationToken.None);
85_ = await tuple.codeFixService.GetFixesAsync(document, TextSpan.FromBounds(0, 0), CancellationToken.None);
112var fixCollections = await tuple.codeFixService.GetFixesAsync(document, TextSpan.FromBounds(0, 0), CancellationToken.None);
145cancellationToken: CancellationToken.None);
152cancellationToken: CancellationToken.None);
181cancellationToken: CancellationToken.None);
211cancellationToken: CancellationToken.None);
280var fixes = await tuple.codeFixService.GetFixesAsync(document, TextSpan.FromBounds(0, 0), CancellationToken.None);
305document, TextSpan.FromBounds(0, 0), new DefaultCodeActionRequestPriorityProvider(), CancellationToken.None);
752return await fixService.GetFixesAsync(document, TextSpan.FromBounds(0, 0), CancellationToken.None);
853var txtDocumentCodeFixes = await tuple.codeFixService.GetFixesAsync(txtDocument, TextSpan.FromBounds(0, 1), CancellationToken.None);
861var solution = await codeAction.GetChangedSolutionInternalAsync(txtDocument.Project.Solution, CodeAnalysisProgress.None, CancellationToken.None);
863Assert.Equal("Additional Document", txtDocument.GetTextSynchronously(CancellationToken.None).ToString());
864Assert.Equal($"Additional Document{fixer1.Title}", changedtxtDocument.GetTextSynchronously(CancellationToken.None).ToString());
870var logDocumentCodeFixes = await tuple.codeFixService.GetFixesAsync(logDocument, TextSpan.FromBounds(0, 1), CancellationToken.None);
1020var root = await sourceDocument.GetRequiredSyntaxRootAsync(CancellationToken.None);
1030var diagnostics = await analyzerService.ForceAnalyzeProjectAsync(sourceDocument.Project, CancellationToken.None);
1055root = await sourceDocument.GetRequiredSyntaxRootAsync(CancellationToken.None);
1063includeLocalDocumentDiagnostics: true, CancellationToken.None);
1068var normalPriFixes = await tuple.codeFixService.GetFixesAsync(sourceDocument, testSpan, priorityProvider, CancellationToken.None);
1070var lowPriFixes = await tuple.codeFixService.GetFixesAsync(sourceDocument, testSpan, priorityProvider, CancellationToken.None);
CodeGeneration\CodeGenerationTests.cs (30)
52CancellationToken.None);
86CancellationToken.None);
91var options = await testContext.Document.GetCodeGenerationOptionsAsync(CancellationToken.None);
93var newRoot = testContext.Service.AddField(root, field, info, CancellationToken.None);
128CancellationToken.None);
173CancellationToken.None);
217CancellationToken.None);
252CancellationToken.None);
298CancellationToken.None);
315var options = await testContext.Document.GetCodeGenerationOptionsAsync(CancellationToken.None);
317var newSyntax = testContext.Service.AddStatements(oldSyntax, parsedStatements, info, CancellationToken.None);
330var options = await testContext.Document.GetCodeGenerationOptionsAsync(CancellationToken.None);
333var newMemberSyntax = testContext.Service.AddParameters(oldMemberSyntax, parameterSymbols, info, CancellationToken.None);
366CancellationToken.None);
406CancellationToken.None);
499CancellationToken.None);
528CancellationToken.None);
556var options = await testContext.Document.GetCodeGenerationOptionsAsync(CancellationToken.None);
558var newNode = codeGenerator.AddAttributes(oldNode, [attributeData], target, info, CancellationToken.None)
575var options = await testContext.Document.GetCodeGenerationOptionsAsync(CancellationToken.None);
577var newNode = codeGenerator.RemoveAttribute(declarationNode, attribute, info, CancellationToken.None)
597var options = await testContext.Document.GetCodeGenerationOptionsAsync(CancellationToken.None);
601updatedDeclarationNode = codeGenerator.UpdateDeclarationAccessibility(declarationNode, accessibility.Value, info, CancellationToken.None);
605updatedDeclarationNode = codeGenerator.UpdateDeclarationModifiers(declarationNode, modifiers, info, CancellationToken.None);
609updatedDeclarationNode = codeGenerator.UpdateDeclarationType(declarationNode, getType(testContext.SemanticModel), info, CancellationToken.None);
627updatedDeclarationNode = codeGenerator.UpdateDeclarationMembers(declarationNode, allMembers, info, CancellationToken.None);
664testContext.Result = await testContext.Service.AddMembersAsync(solutionContext, (INamedTypeSymbol)destination, members, CancellationToken.None);
668testContext.Result = await testContext.Service.AddNamespaceOrTypeAsync(solutionContext, (INamespaceSymbol)destination, symbol, CancellationToken.None);
976var simplified = Simplifier.ReduceAsync(this.Document, Simplifier.Annotation, simplifierOptions, CancellationToken.None).Result;
977var actual = Formatter.FormatAsync(simplified, Formatter.Annotation, formattingOptions, CancellationToken.None).Result.GetSyntaxRootAsync().Result.ToFullString();
CodeRefactorings\CodeRefactoringServiceTest.cs (13)
51var refactorings = await refactoringService.GetRefactoringsAsync(document, TextSpan.FromBounds(0, 0), CancellationToken.None);
90var refactorings = await refactoringService.GetRefactoringsAsync(document, TextSpan.FromBounds(0, 0), CancellationToken.None);
111var result = await refactoringService.GetRefactoringsAsync(document, TextSpan.FromBounds(0, 0), CancellationToken.None);
174var txtRefactorings = await refactoringService.GetRefactoringsAsync(txtAdditionalDocument, TextSpan.FromBounds(0, 0), CancellationToken.None);
182var solution = await codeAction.GetChangedSolutionInternalAsync(project.Solution, CodeAnalysisProgress.None, CancellationToken.None);
184Assert.Empty(txtAdditionalDocument.GetTextSynchronously(CancellationToken.None).ToString());
185Assert.Equal(refactoring1.Title, changedtxtDocument.GetTextSynchronously(CancellationToken.None).ToString());
189var logRefactorings = await refactoringService.GetRefactoringsAsync(logAdditionalDocument, TextSpan.FromBounds(0, 0), CancellationToken.None);
213var editorConfigRefactorings = await refactoringService.GetRefactoringsAsync(editorConfig, TextSpan.FromBounds(0, 0), CancellationToken.None);
221var solution = await codeAction.GetChangedSolutionInternalAsync(project.Solution, CodeAnalysisProgress.None, CancellationToken.None);
223Assert.Empty(editorConfig.GetTextSynchronously(CancellationToken.None).ToString());
224Assert.Equal(refactoring1.Title, changedEditorConfig.GetTextSynchronously(CancellationToken.None).ToString());
228var globalConfigRefactorings = await refactoringService.GetRefactoringsAsync(globalConfig, TextSpan.FromBounds(0, 0), CancellationToken.None);
Completion\FileSystemCompletionHelperTests.cs (13)
60AssertItemsEqual(fsc.GetTestAccessor().GetItems("", CancellationToken.None),
71AssertItemsEqual(fsc.GetTestAccessor().GetItems(@"X:\A\", CancellationToken.None),
76AssertItemsEqual(fsc.GetTestAccessor().GetItems(@"X:\B\", CancellationToken.None),
79AssertItemsEqual(fsc.GetTestAccessor().GetItems(@"Z:\", CancellationToken.None),
83AssertItemsEqual(fsc.GetTestAccessor().GetItems(@"Z:", CancellationToken.None),
86AssertItemsEqual(fsc.GetTestAccessor().GetItems(@"\", CancellationToken.None),
117AssertItemsEqual(fsc.GetTestAccessor().GetItems(@"", CancellationToken.None),
153AssertItemsEqual(fsc.GetTestAccessor().GetItems(@"", CancellationToken.None),
179AssertItemsEqual(fsc.GetTestAccessor().GetItems(@"\\server\share\", CancellationToken.None),
183AssertItemsEqual(fsc.GetTestAccessor().GetItems(@"\\server\share\C\", CancellationToken.None),
218AssertItemsEqual(fsc.GetTestAccessor().GetItems(@"", CancellationToken.None),
227AssertItemsEqual(fsc.GetTestAccessor().GetItems(@"/", CancellationToken.None),
233AssertItemsEqual(fsc.GetTestAccessor().GetItems(@"/B/", CancellationToken.None),
Diagnostics\DiagnosticAnalyzerServiceTests.cs (19)
69includeLocalDocumentDiagnostics: true, CancellationToken.None);
186var diagnostics = await service.ForceAnalyzeProjectAsync(document.Project, CancellationToken.None);
220var diagnostics = await service.ForceAnalyzeProjectAsync(document.Project, CancellationToken.None);
260var diagnostics = await service.ForceAnalyzeProjectAsync(project, CancellationToken.None);
343var diagnostics = await service.ForceAnalyzeProjectAsync(project, CancellationToken.None);
392var diagnostics = await service.ForceAnalyzeProjectAsync(project, CancellationToken.None);
473var diagnostics = await service.ForceAnalyzeProjectAsync(project, CancellationToken.None);
560var document = isSourceGenerated ? (await project.GetSourceGeneratedDocumentsAsync(CancellationToken.None)).Single() : project.Documents.Single();
595var diagnostics = await service.ForceAnalyzeProjectAsync(project, CancellationToken.None);
640cancellationToken: CancellationToken.None);
676cancellationToken: CancellationToken.None);
712cancellationToken: CancellationToken.None);
747cancellationToken: CancellationToken.None);
801cancellationToken: CancellationToken.None);
845var root = await document.GetRequiredSyntaxRootAsync(CancellationToken.None);
867CancellationToken.None);
871var expectedText = additionalDocument.GetTextSynchronously(CancellationToken.None).ToString();
935logPerformanceInfo: false, getTelemetryInfo: false, cancellationToken: CancellationToken.None);
966var diagnostics = await service.ForceAnalyzeProjectAsync(project, CancellationToken.None);
FindSymbols\SymbolTreeInfoTests.cs (16)
28solution, reference1, checksum: null, CancellationToken.None);
31solution, reference2, checksum: null, CancellationToken.None);
34Assert.Equal(info1.Checksum, SymbolTreeInfo.GetMetadataChecksum(solution.Services, reference1, CancellationToken.None));
35Assert.Equal(info2.Checksum, SymbolTreeInfo.GetMetadataChecksum(solution.Services, reference2, CancellationToken.None));
48var checksum1 = SymbolTreeInfo.GetMetadataChecksum(solution.Services, reference1, CancellationToken.None);
50solution, reference1, checksum1, CancellationToken.None);
52var checksum2 = SymbolTreeInfo.GetMetadataChecksum(solution.Services, reference2, CancellationToken.None);
54solution, reference2, checksum2, CancellationToken.None);
71var checksum1 = SymbolTreeInfo.GetMetadataChecksum(solution.Services, reference1, CancellationToken.None);
73solution, reference1, checksum1, CancellationToken.None);
76solution, reference2, checksum: null, CancellationToken.None);
80Assert.Equal(info2.Checksum, SymbolTreeInfo.GetMetadataChecksum(solution.Services, reference2, CancellationToken.None));
94solution, reference1, checksum: null, CancellationToken.None);
96var checksum2 = SymbolTreeInfo.GetMetadataChecksum(solution.Services, reference2, CancellationToken.None);
98solution, reference2, checksum2, CancellationToken.None);
101Assert.Equal(info1.Checksum, SymbolTreeInfo.GetMetadataChecksum(solution.Services, reference1, CancellationToken.None));
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (6)
91return _metadataAsSourceService.GetGeneratedFileAsync(Workspace, project, symbol, signaturesOnly, MetadataAsSourceOptions.Default, CancellationToken.None);
103var compilation = await project.GetRequiredCompilationAsync(CancellationToken.None);
132var result = await _metadataAsSourceService.GetGeneratedFileAsync(Workspace, project, symbol, signaturesOnly, MetadataAsSourceOptions.Default, CancellationToken.None);
171compilation = await this.DefaultProject.GetRequiredCompilationAsync(CancellationToken.None);
317var syntaxRoot = await document.GetRequiredSyntaxRootAsync(CancellationToken.None);
318var semanticModel = await document.GetRequiredSemanticModelAsync(CancellationToken.None);
Snippets\RoslynLSPSnippetConvertTests.cs (3)
320[], new TextChange(new TextSpan(8, 0), "quux"), triggerLocation: 12, CancellationToken.None).Result;
331[], new TextChange(new TextSpan(4, 4), "bar quux"), triggerLocation: 12, CancellationToken.None).Result;
401var lspSnippetString = await RoslynLSPSnippetConverter.GenerateLSPSnippetAsync(document, cursorPosition!.Value, placeholders, textChange, stringSpan.Start, CancellationToken.None).ConfigureAwait(false);
StackTraceExplorer\StackTraceExplorerTests.cs (13)
25var result = await StackTraceAnalyzer.AnalyzeAsync(inputLine, CancellationToken.None);
32var reparsedResult = await StackTraceAnalyzer.AnalyzeAsync(stackFrame.ToString(), CancellationToken.None);
40var definition = await service.TryFindDefinitionAsync(workspace.CurrentSolution, stackFrame, StackFrameSymbolPart.Method, CancellationToken.None);
47var root = await doc.GetRequiredSyntaxRootAsync(CancellationToken.None);
49var semanticModel = await doc.GetRequiredSemanticModelAsync(CancellationToken.None);
791var result = await StackTraceAnalyzer.AnalyzeAsync(line, CancellationToken.None);
813var result = await StackTraceAnalyzer.AnalyzeAsync(line, CancellationToken.None);
818var definition = await service.TryFindDefinitionAsync(workspace.CurrentSolution, parsedFrame, StackFrameSymbolPart.Method, CancellationToken.None);
827var result = await StackTraceAnalyzer.AnalyzeAsync(activityLogException, CancellationToken.None);
843var result = await StackTraceAnalyzer.AnalyzeAsync("at System.String.ToLower()", CancellationToken.None);
848var definition = await service.TryFindDefinitionAsync(workspace.CurrentSolution, frame, StackFrameSymbolPart.Method, CancellationToken.None);
881var result = await StackTraceAnalyzer.AnalyzeAsync("at Path.To.Component.M() in C:/path/to/Component.razor:line 5", CancellationToken.None);
920var result = await StackTraceAnalyzer.AnalyzeAsync("at Path.To.Component.M() in Component.razor:line 5", CancellationToken.None);
SymbolFinder\SymbolFinderTests.cs (7)
657var results = await SymbolFinder.FindDerivedClassesArrayAsync(firstType, solution, transitive: true, ImmutableHashSet.Create(csProject), CancellationToken.None);
662results = await SymbolFinder.FindDerivedClassesArrayAsync(firstType, solution, transitive: true, ImmutableHashSet.Create(otherProject), CancellationToken.None);
768var interfaceMembers = await SymbolFinder.FindImplementedInterfaceMembersArrayAsync(methodSymbol, solution, CancellationToken.None);
798var implementedMembers = await SymbolFinder.FindImplementedInterfaceMembersArrayAsync(namespaceSymbol, solution, CancellationToken.None);
828var sourceDefinition = await SymbolFinder.FindSourceDefinitionAsync(classInSource, solution, CancellationToken.None);
867.Project.Solution.WithFrozenPartialCompilations(CancellationToken.None);
876var sourceDefinition = await SymbolFinder.FindSourceDefinitionAsync(classInSource, solution, CancellationToken.None);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (2)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (2)
Microsoft.CodeAnalysis.Extensions.Package (2)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (2)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (1)
Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler (1)
Microsoft.CodeAnalysis.Features (17)
Microsoft.CodeAnalysis.Features.Test.Utilities (18)
EditAndContinue\EditAndContinueTestVerifier.cs (3)
102CancellationToken.None);
191var result = Analyzer.AnalyzeDocumentAsync(newDocument.Id, oldProject, newProject, lazyOldActiveStatementMap, newActiveStatementSpans, lazyCapabilities, log, CancellationToken.None).Result;
278EditSession.MergePartialEdits(oldProject.GetCompilationAsync().Result!, newProject.GetCompilationAsync().Result!, allEdits, out var mergedEdits, out _, CancellationToken.None);
Snippets\AbstractSnippetProviderTests.cs (9)
36var metadataReferences = await referenceAssemblies.ResolveAsync(LanguageName, CancellationToken.None);
64var semanticModel = await document.GetRequiredSemanticModelAsync(CancellationToken.None);
65var syntaxContext = syntaxContextService.CreateContext(document, semanticModel, snippetRequestPosition, CancellationToken.None);
68var isValidSnippetLocation = snippetProvider.IsValidSnippetLocation(snippetContext, CancellationToken.None);
71var snippetChange = await snippetProvider.GetSnippetChangeAsync(document, snippetRequestPosition, CancellationToken.None);
126var metadataReferences = await referenceAssemblies.ResolveAsync(LanguageName, CancellationToken.None);
141var semanticModel = await document.GetRequiredSemanticModelAsync(CancellationToken.None);
142var syntaxContext = syntaxContextService.CreateContext(document, semanticModel, snippetRequestPosition, CancellationToken.None);
145var isValidSnippetLocation = snippetProvider.IsValidSnippetLocation(snippetContext, CancellationToken.None);
Microsoft.CodeAnalysis.Features.UnitTests (211)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (137)
139var sessionId = await service.StartDebuggingSessionAsync(solution, _debuggerService, NullPdbMatchingSourceTextProvider.Instance, captureMatchingDocuments, captureAllDocuments, reportDiagnostics: true, CancellationToken.None);
174var diagnostics = await service.GetDocumentDiagnosticsAsync(document1, s_noActiveSpans, CancellationToken.None);
181diagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
218var diagnostics2 = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
249var diagnostics = await service.GetDocumentDiagnosticsAsync(document1, s_noActiveSpans, CancellationToken.None);
262diagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
335var diagnostics1 = await service.GetDocumentDiagnosticsAsync(generatedDocument, s_noActiveSpans, CancellationToken.None);
415var diagnostics = await service.GetDocumentDiagnosticsAsync(solution.GetRequiredDocument(documentId), s_noActiveSpans, CancellationToken.None);
500var diagnostics = await service.GetDocumentDiagnosticsAsync(solution.GetRequiredDocument(documentId), s_noActiveSpans, CancellationToken.None);
576var diagnostics = await service.GetDocumentDiagnosticsAsync(solution.GetRequiredDocument(documentId), s_noActiveSpans, CancellationToken.None);
680var diagnostics = await service.GetDocumentDiagnosticsAsync(solution.GetRequiredDocument(documentId), s_noActiveSpans, CancellationToken.None);
846var diagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
944var sessionId = await service.StartDebuggingSessionAsync(solution, _debuggerService, NullPdbMatchingSourceTextProvider.Instance, captureMatchingDocuments: openDocumentIds, captureAllMatchingDocuments: false, reportDiagnostics: true, CancellationToken.None);
970var activeStatementMap = await debuggingSession.EditSession.BaseActiveStatements.GetValueAsync(CancellationToken.None);
974var asSpans = await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [designTimeOnlyDocumentId], CancellationToken.None);
978Assert.Empty(await service.GetDocumentDiagnosticsAsync(designTimeOnlyDocument2, s_noActiveSpans, CancellationToken.None));
1036var docDiagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
1118var docDiagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
1167var docDiagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
1231var diagnostics2 = await service.GetDocumentDiagnosticsAsync(documentB, s_noActiveSpans, CancellationToken.None);
1320var diagnostics = await service.GetDocumentDiagnosticsAsync(solution.GetRequiredDocument(document2Id), s_noActiveSpans, CancellationToken.None);
1479var docDiagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
1545var (document, state) = await debuggingSession.LastCommittedSolution.GetDocumentAndStateAsync(solution.GetRequiredDocument(documentId), CancellationToken.None);
1577var docDiagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
1651var diagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
1658diagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
1665diagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
1683diagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
1722var docDiagnostics = await service.GetDocumentDiagnosticsAsync(generatedDocument, s_noActiveSpans, CancellationToken.None);
1774var docDiagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
1791docDiagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
1858var docDiagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
1902var docDiagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
1918docDiagnostics = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
1980var docDiagnostics = await service.GetDocumentDiagnosticsAsync(solution.GetRequiredDocument(documentId), s_noActiveSpans, CancellationToken.None);
2011Assert.Empty(await service.GetDocumentDiagnosticsAsync(solution.GetRequiredDocument(documentId), s_noActiveSpans, CancellationToken.None));
2017Assert.Empty(await service.GetDocumentDiagnosticsAsync(solution.GetRequiredDocument(documentId), s_noActiveSpans, CancellationToken.None));
2064var diagnostics1 = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
2104var diagnostics1 = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
2171Assert.True(await EditSession.HasChangesAsync(oldSolution, solution, CancellationToken.None));
2173Assert.False(await EditSession.HasChangesAsync(oldSolution, solution, sourceFilePath: pathCommon, CancellationToken.None));
2174Assert.False(await EditSession.HasChangesAsync(oldSolution, solution, sourceFilePath: pathB, CancellationToken.None));
2175Assert.True(await EditSession.HasChangesAsync(oldSolution, solution, sourceFilePath: pathC, CancellationToken.None));
2176Assert.False(await EditSession.HasChangesAsync(oldSolution, solution, sourceFilePath: "NonexistentFile.cs", CancellationToken.None));
2188Assert.True(await EditSession.HasChangesAsync(oldSolution, solution, CancellationToken.None));
2191Assert.True(await EditSession.HasChangesAsync(solution, solution.RemoveProject(projectD.Id), CancellationToken.None));
2199Assert.False(await EditSession.HasChangesAsync(oldSolution, solution, CancellationToken.None));
2202Assert.False(await EditSession.HasChangesAsync(solution, oldSolution, CancellationToken.None));
2274Assert.True(await EditSession.HasChangesAsync(oldSolution, solution, CancellationToken.None));
2275Assert.True(await EditSession.HasChangesAsync(oldSolution, solution, pathX, CancellationToken.None));
2278Assert.False(await EditSession.HasChangesAsync(oldSolution, solution, generatedDocument.FilePath, CancellationToken.None));
2284await EditSession.GetChangedDocumentsAsync(log, oldSolution.GetProject(projectId), solution.GetProject(projectId), CancellationToken.None).ToImmutableArrayAsync(CancellationToken.None));
2287await EditSession.GetProjectDifferencesAsync(log, oldSolution.GetProject(projectId), solution.GetProject(projectId), projectDifferences, diagnostics, CancellationToken.None);
2308Assert.False(await EditSession.HasChangesAsync(oldSolution, solution, CancellationToken.None));
2309Assert.False(await EditSession.HasChangesAsync(oldSolution, solution, pathX, CancellationToken.None));
2315await EditSession.GetChangedDocumentsAsync(log, oldSolution.GetProject(projectId), solution.GetProject(projectId), CancellationToken.None).ToImmutableArrayAsync(CancellationToken.None));
2317await EditSession.GetProjectDifferencesAsync(log, oldSolution.GetProject(projectId), solution.GetProject(projectId), projectDifferences, diagnostics, CancellationToken.None);
2336Assert.True(await EditSession.HasChangesAsync(oldSolution, solution, CancellationToken.None));
2337Assert.True(await EditSession.HasChangesAsync(oldSolution, solution, pathX, CancellationToken.None));
2340await EditSession.GetChangedDocumentsAsync(log, oldSolution.GetProject(projectId), solution.GetProject(projectId), CancellationToken.None).ToImmutableArrayAsync(CancellationToken.None));
2342await EditSession.GetProjectDifferencesAsync(log, oldSolution.GetProject(projectId), solution.GetProject(projectId), projectDifferences, diagnostics, CancellationToken.None);
2362Assert.True(await EditSession.HasChangesAsync(oldSolution, solution, CancellationToken.None));
2363Assert.True(await EditSession.HasChangesAsync(oldSolution, solution, pathX, CancellationToken.None));
2368await EditSession.GetChangedDocumentsAsync(log, oldSolution.GetProject(projectId), solution.GetProject(projectId), CancellationToken.None).ToImmutableArrayAsync(CancellationToken.None));
2370await EditSession.GetProjectDifferencesAsync(log, oldSolution.GetProject(projectId), solution.GetProject(projectId), projectDifferences, diagnostics, CancellationToken.None);
2423var generatedDocuments = await project.Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(project.State, CancellationToken.None);
2425var generatedText = generatedDocuments.States.Single().Value.GetTextSynchronously(CancellationToken.None).ToString();
2429var generatorDiagnostics = await solution.CompilationState.GetSourceGeneratorDiagnosticsAsync(project.State, CancellationToken.None);
2447Assert.True(await EditSession.HasChangesAsync(oldSolution, solution, CancellationToken.None));
2450AssertEx.Empty(await EditSession.GetChangedDocumentsAsync(log, oldProject, project, CancellationToken.None).ToImmutableArrayAsync(CancellationToken.None));
2453await EditSession.GetProjectDifferencesAsync(log, oldProject, project, diffences, diagnostics, CancellationToken.None);
2460generatedDocuments = await solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(project.State, CancellationToken.None);
2463generatorDiagnostics = await solution.CompilationState.GetSourceGeneratorDiagnosticsAsync(project.State, CancellationToken.None);
2486Assert.True(await EditSession.HasChangesAsync(oldSolution, solution, CancellationToken.None));
2487Assert.False(await EditSession.HasChangesAsync(oldSolution, solution, sourceFilePath: sourcePath, CancellationToken.None));
2506Assert.True(await EditSession.HasChangesAsync(solution0, solution1, CancellationToken.None));
2510Assert.True(await EditSession.HasChangesAsync(solution1, solution2, CancellationToken.None));
2514Assert.True(await EditSession.HasChangesAsync(solution2, solution3, CancellationToken.None));
2548var results = await debuggingSession.EmitSolutionUpdateAsync(solution, runningProjects, s_noActiveSpans, CancellationToken.None);
2589var results = await debuggingSession.EmitSolutionUpdateAsync(solution, runningProjects, s_noActiveSpans, CancellationToken.None);
2654var baseSpans = await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [documentAId, documentBId], CancellationToken.None);
2664var currentSpans = await debuggingSession.GetAdjustedActiveStatementSpansAsync(documentB2, (_, _, _) => new(trackedActiveSpans), CancellationToken.None);
2669var diagnostics = await service.GetDocumentDiagnosticsAsync(documentB2, s_noActiveSpans, CancellationToken.None);
2710var diagnostics = await service.GetDocumentDiagnosticsAsync(solution.GetDocument(documentId), s_noActiveSpans, CancellationToken.None);
2718diagnostics = await service.GetDocumentDiagnosticsAsync(solution.GetDocument(documentId), s_noActiveSpans, CancellationToken.None);
2738diagnostics = await service.GetDocumentDiagnosticsAsync(solution.GetDocument(documentId), s_noActiveSpans, CancellationToken.None);
2747diagnostics = await service.GetDocumentDiagnosticsAsync(solution.GetDocument(documentId), s_noActiveSpans, CancellationToken.None);
2763diagnostics = await service.GetDocumentDiagnosticsAsync(solution.GetDocument(documentId), s_noActiveSpans, CancellationToken.None);
2860var diagnostics = await service.GetDocumentDiagnosticsAsync(solution.GetDocument(documentId), s_noActiveSpans, CancellationToken.None);
2893var diagnostics1 = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
3060var diagnostics = await service.GetDocumentDiagnosticsAsync(document3, s_noActiveSpans, CancellationToken.None);
3077var (doc, state) = await debuggingSession.LastCommittedSolution.GetDocumentAndStateAsync(currentDocument, CancellationToken.None);
3143var diagnostics = await service.GetDocumentDiagnosticsAsync(document1, s_noActiveSpans, CancellationToken.None);
3200var diagnostics = await service.GetDocumentDiagnosticsAsync(document3, s_noActiveSpans, CancellationToken.None);
3233var diagnostics1 = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
3567var docDiagnostics = await service.GetDocumentDiagnosticsAsync(documentB, s_noActiveSpans, CancellationToken.None);
3648var diagnostics = await service.GetDocumentDiagnosticsAsync(documentB, s_noActiveSpans, CancellationToken.None);
3660var results = await debuggingSession.EmitSolutionUpdateAsync(solution, runningProjects, s_noActiveSpans, CancellationToken.None);
3702_ = await solution.Projects.Single().GetCompilationAsync(CancellationToken.None);
3759_ = await solution.Projects.Single().GetCompilationAsync(CancellationToken.None);
4057var diagnostics1 = await service.GetDocumentDiagnosticsAsync(document2, s_noActiveSpans, CancellationToken.None);
4101var diagnostics = await service.GetDocumentDiagnosticsAsync(solution.GetDocument(documentId), s_noActiveSpans, CancellationToken.None);
4517var sourceTextV1 = document1.GetTextSynchronously(CancellationToken.None);
4530Assert.True((await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [document1.Id], CancellationToken.None)).IsDefault);
4553var baseSpans = await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [document1.Id], CancellationToken.None);
4562var currentSpans = await debuggingSession.GetAdjustedActiveStatementSpansAsync(document1, (_, _, _) => new(trackedActiveSpans1), CancellationToken.None);
4574currentSpans = await debuggingSession.GetAdjustedActiveStatementSpansAsync(document2, (_, _, _) => new(trackedActiveSpans2), CancellationToken.None);
4597var sourceTextV1 = await document1.GetTextAsync(CancellationToken.None);
4626var baseSpans = (await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [documentId], CancellationToken.None)).Single();
4638var currentSpans = await debuggingSession.GetAdjustedActiveStatementSpansAsync(document2, (_, _, _) => ValueTask.FromResult(baseSpans), CancellationToken.None);
4674var currentSpans = await debuggingSession.GetAdjustedActiveStatementSpansAsync(document, s_noActiveSpans, CancellationToken.None);
4677var baseSpans = await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [document.Id], CancellationToken.None);
4683baseSpans = await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [document.Id], CancellationToken.None);
4742var baseActiveStatementsMap = await debuggingSession.EditSession.BaseActiveStatements.GetValueAsync(CancellationToken.None).ConfigureAwait(false);
4773var spans = await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [doc1.Id, doc2.Id, docId3, docId4, docId5], CancellationToken.None);
4846var baseActiveStatementMap = await debuggingSession.EditSession.BaseActiveStatements.GetValueAsync(CancellationToken.None).ConfigureAwait(false);
4865var baseSpans = await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [document.Id], CancellationToken.None);
4872baseSpans = await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [document.Id], CancellationToken.None);
5030var docDiagnostics = await service.GetDocumentDiagnosticsAsync(document, s_noActiveSpans, CancellationToken.None);
5050docDiagnostics = await service.GetDocumentDiagnosticsAsync(document, s_noActiveSpans, CancellationToken.None);
5168var spans = (await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [documentId], CancellationToken.None)).Single();
5257var spans = (await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [documentId], CancellationToken.None)).Single();
5283spans = (await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [documentId], CancellationToken.None)).Single();
5292var diagnostics = await service.GetDocumentDiagnosticsAsync(document1, s_noActiveSpans, CancellationToken.None);
5381var spans = (await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [documentId], CancellationToken.None)).Single();
5506CancellationToken.None);
5510var result1 = await encService.EmitSolutionUpdateAsync(sessionId, solution1, runningProjects: ImmutableDictionary<ProjectId, RunningProjectOptions>.Empty, s_noActiveSpans, CancellationToken.None);
5517var result2 = await encService.EmitSolutionUpdateAsync(sessionId, solution2, runningProjects: ImmutableDictionary<ProjectId, RunningProjectOptions>.Empty, s_noActiveSpans, CancellationToken.None);
5540await Assert.ThrowsAsync<ObjectDisposedException>(async () => await debuggingSession.EmitSolutionUpdateAsync(solution, runningProjects: ImmutableDictionary<ProjectId, RunningProjectOptions>.Empty, s_noActiveSpans, CancellationToken.None));
5547Assert.Empty(await debuggingSession.GetDocumentDiagnosticsAsync(document, s_noActiveSpans, CancellationToken.None));
5548Assert.Empty(await debuggingSession.GetAdjustedActiveStatementSpansAsync(document, s_noActiveSpans, CancellationToken.None));
5549Assert.True((await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [], CancellationToken.None)).IsDefault);
EditAndContinue\EditSessionActiveStatementsTests.cs (9)
189var baseActiveStatementsMap = await editSession.BaseActiveStatements.GetValueAsync(CancellationToken.None).ConfigureAwait(false);
235var oldActiveStatements1 = await baseActiveStatementsMap.GetOldActiveStatementsAsync(analyzer, document1, CancellationToken.None).ConfigureAwait(false);
243var oldActiveStatements2 = await baseActiveStatementsMap.GetOldActiveStatementsAsync(analyzer, document2, CancellationToken.None).ConfigureAwait(false);
353var baseActiveStatementMap = await editSession.BaseActiveStatements.GetValueAsync(CancellationToken.None).ConfigureAwait(false);
368var oldActiveStatements = await baseActiveStatementMap.GetOldActiveStatementsAsync(analyzer, document, CancellationToken.None).ConfigureAwait(false);
533var baseActiveStatementMap = await editSession.BaseActiveStatements.GetValueAsync(CancellationToken.None).ConfigureAwait(false);
551var oldActiveStatements = await baseActiveStatementMap.GetOldActiveStatementsAsync(analyzer, document, CancellationToken.None).ConfigureAwait(false);
674var baseActiveStatementMap = await editSession.BaseActiveStatements.GetValueAsync(CancellationToken.None).ConfigureAwait(false);
703var oldActiveStatements = await baseActiveStatementMap.GetOldActiveStatementsAsync(analyzer, document, CancellationToken.None).ConfigureAwait(false);
EditAndContinue\RemoteEditAndContinueServiceTests.cs (17)
93var syntaxTree = await document.GetRequiredSyntaxTreeAsync(CancellationToken.None);
154CancellationToken.None);
165await sessionProxy.BreakStateOrCapabilitiesChangedAsync(inBreakState: true, CancellationToken.None);
167var activeStatement = (await remoteDebuggeeModuleMetadataProvider!.GetActiveStatementsAsync(CancellationToken.None)).Single();
172var availability = await remoteDebuggeeModuleMetadataProvider!.GetAvailabilityAsync(moduleId1, CancellationToken.None);
204var syntaxTree = solution.GetRequiredDocument(documentId).GetSyntaxTreeSynchronously(CancellationToken.None)!;
226var results = await sessionProxy.EmitSolutionUpdateAsync(localWorkspace.CurrentSolution, runningProjects1, activeStatementSpanProvider, CancellationToken.None);
255await sessionProxy.CommitSolutionUpdateAsync(CancellationToken.None);
261await sessionProxy.DiscardSolutionUpdateAsync(CancellationToken.None);
274var baseActiveSpans = await sessionProxy.GetBaseActiveStatementSpansAsync(localWorkspace.CurrentSolution, [documentId, inProcOnlyDocumentId], CancellationToken.None);
282AssertEx.Equal(activeSpans1, activeStatementSpanProvider(documentId, "test.cs", CancellationToken.None).AsTask().Result);
286Assert.Empty(await sessionProxy.GetAdjustedActiveStatementSpansAsync(inProcOnlyDocument, activeStatementSpanProvider, CancellationToken.None));
288var documentActiveSpans = await sessionProxy.GetAdjustedActiveStatementSpansAsync(document, activeStatementSpanProvider, CancellationToken.None);
295documentActiveSpans = await sessionProxy.GetAdjustedActiveStatementSpansAsync(document, activeStatementSpanProvider, CancellationToken.None);
302Assert.Empty(await proxy.GetDocumentDiagnosticsAsync(inProcOnlyDocument, activeStatementSpanProvider, CancellationToken.None));
303Assert.Equal(diagnostic.GetMessage(), (await proxy.GetDocumentDiagnosticsAsync(document, activeStatementSpanProvider, CancellationToken.None)).Single().Message);
307await sessionProxy.EndDebuggingSessionAsync(CancellationToken.None);
EditAndContinue\UnitTestingHotReloadServiceTests.cs (4)
48await hotReload.StartSessionAsync(solution, ["Baseline", "AddDefinitionToExistingType", "NewTypeDefinition"], CancellationToken.None);
61var result = await hotReload.EmitSolutionUpdateAsync(solution, commitUpdates: true, CancellationToken.None);
68result = await hotReload.EmitSolutionUpdateAsync(solution, commitUpdates: true, CancellationToken.None);
78result = await hotReload.EmitSolutionUpdateAsync(solution, commitUpdates: true, CancellationToken.None);
EditAndContinue\WatchHotReloadServiceTests.cs (11)
67await hotReload.StartSessionAsync(solution, CancellationToken.None);
80var result = await hotReload.GetUpdatesAsync(solution, runningProjects: ImmutableDictionary<ProjectId, WatchHotReloadService.RunningProjectInfo>.Empty, CancellationToken.None);
94result = await hotReload.GetUpdatesAsync(solution, runningProjects: ImmutableDictionary<ProjectId, WatchHotReloadService.RunningProjectInfo>.Empty, CancellationToken.None);
109result = await hotReload.GetUpdatesAsync(solution, runningProjects, CancellationToken.None);
128result = await hotReload.GetUpdatesAsync(solution, runningProjects, CancellationToken.None);
142result = await hotReload.GetUpdatesAsync(solution, runningProjects, CancellationToken.None);
195var generatedDocuments = await project.Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(project.State, CancellationToken.None);
197var generatedText = generatedDocuments.States.Single().Value.GetTextSynchronously(CancellationToken.None).ToString();
201var generatorDiagnostics = await solution.CompilationState.GetSourceGeneratorDiagnosticsAsync(project.State, CancellationToken.None);
206await hotReload.StartSessionAsync(solution, CancellationToken.None);
213var result = await hotReload.GetUpdatesAsync(solution, runningProjects, CancellationToken.None);
FindUsages\DefinitionItemFactoryTests.cs (29)
140var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(a, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
176var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(m, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
218var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(m, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
254var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(m, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
296var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(symbol, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
338var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(n, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
391var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(n, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
445var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(symbol, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
485var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(symbol, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
525var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(c, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
567var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(c, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
625var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(c, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
671var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(c, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
711var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(tuple, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
773var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(tuple, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
829var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(type, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
883var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(type, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
943var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(p, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
987var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(m, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
1042var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(m, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
1094var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(p, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
1158var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(g, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
1215var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(g, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
1270var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(p, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
1350var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(p, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
1409var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(p, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
1461var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(f, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
1528var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(x, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
1599var item = await DefinitionItemFactory.ToClassifiedDefinitionItemAsync(r, classificationOptions, solution, searchOptions, isPrimary: true, includeHiddenLocations: true, CancellationToken.None);
Microsoft.CodeAnalysis.InteractiveHost (10)
Microsoft.CodeAnalysis.LanguageServer (18)
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (208)
CodeLens\AbstractCodeLensTests.cs (4)
30var actualCodeLenses = await testLspServer.ExecuteRequestAsync<LSP.CodeLensParams, LSP.CodeLens[]?>(LSP.Methods.TextDocumentCodeLensName, codeLensParams, CancellationToken.None);
48var resolvedCodeLens = await testLspServer.ExecuteRequestAsync<LSP.CodeLens, LSP.CodeLens>(LSP.Methods.CodeLensResolveName, matchingCodeLens, CancellationToken.None);
65var actualCodeLenses = await testLspServer.ExecuteRequestAsync<LSP.CodeLensParams, LSP.CodeLens[]?>(LSP.Methods.TextDocumentCodeLensName, codeLensParams, CancellationToken.None);
88var actualCodeLenses = await testLspServer.ExecuteRequestAsync<LSP.CodeLensParams, LSP.CodeLens[]?>(LSP.Methods.TextDocumentCodeLensName, codeLensParams, CancellationToken.None);
Completion\CompletionFeaturesTests.cs (28)
94var results = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None);
128var completionResult = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None).ConfigureAwait(false);
150var resolvedItem = await testLspServer.ExecuteRequestAsync<LSP.CompletionItem, LSP.CompletionItem>(LSP.Methods.TextDocumentCompletionResolveName, actualItem, CancellationToken.None).ConfigureAwait(false);
215var completionResult = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None).ConfigureAwait(false);
237var resolvedItem = await testLspServer.ExecuteRequestAsync<LSP.CompletionItem, LSP.CompletionItem>(LSP.Methods.TextDocumentCompletionResolveName, actualItem, CancellationToken.None).ConfigureAwait(false);
279var completionResult = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None).ConfigureAwait(false);
300var resolvedItem = await testLspServer.ExecuteRequestAsync<LSP.CompletionItem, LSP.CompletionItem>(LSP.Methods.TextDocumentCompletionResolveName, actualItem, CancellationToken.None).ConfigureAwait(false);
343var results = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None).ConfigureAwait(false);
366results = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None).ConfigureAwait(false);
421var results = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None);
471var results = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None);
540var completionResult = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None).ConfigureAwait(false);
562var resolvedItem = await testLspServer.ExecuteRequestAsync<LSP.CompletionItem, LSP.CompletionItem>(LSP.Methods.TextDocumentCompletionResolveName, actualItem, CancellationToken.None).ConfigureAwait(false);
665var results = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None);
709var completionResult = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None).ConfigureAwait(false);
725var resolvedItem1 = await testLspServer.ExecuteRequestAsync<LSP.CompletionItem, LSP.CompletionItem>(LSP.Methods.TextDocumentCompletionResolveName, itemFromNS1, CancellationToken.None).ConfigureAwait(false);
733var resolvedItem2 = await testLspServer.ExecuteRequestAsync<LSP.CompletionItem, LSP.CompletionItem>(LSP.Methods.TextDocumentCompletionResolveName, itemFromNS2, CancellationToken.None).ConfigureAwait(false);
772var results = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None);
806var results = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None);
821results = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None).ConfigureAwait(false);
859var results = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None).ConfigureAwait(false);
875results = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None).ConfigureAwait(false);
975var results = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None);
979var resolvedItem = await testLspServer.ExecuteRequestAsync<LSP.CompletionItem, LSP.CompletionItem>(LSP.Methods.TextDocumentCompletionResolveName, item, CancellationToken.None).ConfigureAwait(false);
1045var results = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None);
1052var resolvedItem = await testLspServer.ExecuteRequestAsync<LSP.CompletionItem, LSP.CompletionItem>(LSP.Methods.TextDocumentCompletionResolveName, item, CancellationToken.None).ConfigureAwait(false);
1103var results = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None);
1118results = await testLspServer.ExecuteRequestAsync<LSP.CompletionParams, LSP.CompletionList>(LSP.Methods.TextDocumentCompletionName, completionParams, CancellationToken.None);
HandlerTests.cs (12)
48var response = await server.ExecuteRequestAsync<TestRequestTypeOne, string>(TestDocumentHandler.MethodName, request, CancellationToken.None);
57var response = await server.ExecuteRequest0Async<string>(TestRequestHandlerWithNoParams.MethodName, CancellationToken.None);
95var response = await server.ExecuteRequestAsync<TestRequestTypeOne, string>(TestDocumentHandler.MethodName, request, CancellationToken.None);
108var response = await server.ExecuteRequestAsync<TestRequestTypeTwo, string>(TestDocumentHandler.MethodName, request, CancellationToken.None);
123await Assert.ThrowsAsync<StreamJsonRpc.RemoteInvocationException>(async () => await server.ExecuteRequestAsync<TestRequestTypeThree, string>(TestNonMutatingDocumentHandler.MethodName, request, CancellationToken.None));
133await Assert.ThrowsAnyAsync<Exception>(async () => await server.ExecuteRequestAsync<TestRequestTypeThree, string>(TestDocumentHandler.MethodName, request, CancellationToken.None));
160=> await server.ExecuteRequestAsync<TestRequestWithDocument, TestConfigurableResponse>(TestConfigurableDocumentHandler.MethodName, request, CancellationToken.None));
188=> await server.ExecuteRequestAsync<TestRequestWithDocument, TestConfigurableResponse>(TestConfigurableDocumentHandler.MethodName, request, CancellationToken.None));
216=> await server.ExecuteRequestAsync<TestRequestWithDocument, TestConfigurableResponse>(TestConfigurableDocumentHandler.MethodName, request, CancellationToken.None));
246=> await server.ExecuteRequestAsync<TestRequestWithDocument, TestConfigurableResponse>(TestConfigurableDocumentHandler.MethodName, request, CancellationToken.None));
274=> await server.ExecuteRequestAsync<TestRequestWithDocument, TestConfigurableResponse>(TestConfigurableDocumentHandler.MethodName, request, CancellationToken.None));
293await Assert.ThrowsAnyAsync<Exception>(async () => await testLspServer.ExecuteRequestAsync<TestRequestTypeOne, string>(TestDocumentHandler.MethodName, request, CancellationToken.None)).ConfigureAwait(false);
Initialize\LocaleTests.cs (5)
32var result = await testLspServer.ExecuteRequestAsync<Request, Response>(LocaleTestHandler.MethodName, new Request(), CancellationToken.None);
49var resultOne = await testLspServerOne.ExecuteRequestAsync<Request, Response>(LocaleTestHandler.MethodName, new Request(), CancellationToken.None);
50var resultTwo = await testLspServerTwo.ExecuteRequestAsync<Request, Response>(LocaleTestHandler.MethodName, new Request(), CancellationToken.None);
64var result = await testLspServer.ExecuteRequestAsync<Request, Response>(LocaleTestHandler.MethodName, new Request(), CancellationToken.None);
77var result = await testLspServer.ExecuteRequestAsync<Request, Response>(LocaleTestHandler.MethodName, new Request(), CancellationToken.None);
InlayHint\CSharpInlayHintTests.cs (5)
123var actualInlayHints = await testLspServer.ExecuteRequestAsync<LSP.InlayHintParams, LSP.InlayHint[]?>(LSP.Methods.TextDocumentInlayHintName, inlayHintParams, CancellationToken.None);
135await testLspServer.ExecuteRequestAsync<LSP.InlayHintParams, LSP.InlayHint[]?>(LSP.Methods.TextDocumentInlayHintName, inlayHintParams, CancellationToken.None);
136await testLspServer.ExecuteRequestAsync<LSP.InlayHintParams, LSP.InlayHint[]?>(LSP.Methods.TextDocumentInlayHintName, inlayHintParams, CancellationToken.None);
137var lastInlayHints = await testLspServer.ExecuteRequestAsync<LSP.InlayHintParams, LSP.InlayHint[]?>(LSP.Methods.TextDocumentInlayHintName, inlayHintParams, CancellationToken.None);
145var firstResolvedHint = await testLspServer.ExecuteRequestAsync<LSP.InlayHint, LSP.InlayHint>(LSP.Methods.InlayHintResolveName, firstInlayHint, CancellationToken.None);
SemanticTokens\SemanticTokensRangeTests.cs (6)
130document, spans, isVS, options, CancellationToken.None);
186document, spans, isVS, options, CancellationToken.None);
238document, spans, isVS, options, CancellationToken.None);
299document, spans, isVS, options, CancellationToken.None);
382document, spans, isVS, options, CancellationToken.None);
493document, spans: [text.Lines.GetLinePositionSpan(new(0, text.Length))], isVS, options: options, cancellationToken: CancellationToken.None);
UriTests.cs (23)
53var (_, _, document) = await testLspServer.GetManager().GetLspDocumentInfoAsync(new LSP.TextDocumentIdentifier { DocumentUri = looseFileUri }, CancellationToken.None);
79var (_, _, document) = await testLspServer.GetManager().GetLspDocumentInfoAsync(new LSP.TextDocumentIdentifier { DocumentUri = looseFileUri }, CancellationToken.None);
111var (workspace, _, document) = await testLspServer.GetManager().GetLspDocumentInfoAsync(new LSP.TextDocumentIdentifier { DocumentUri = expectedDocumentUri }, CancellationToken.None);
122var (_, _, document) = await testLspServer.GetManager().GetLspDocumentInfoAsync(new LSP.TextDocumentIdentifier { DocumentUri = lowercaseUri }, CancellationToken.None);
149var (workspace, _, fileDocument) = await testLspServer.GetManager().GetLspDocumentInfoAsync(new LSP.TextDocumentIdentifier { DocumentUri = fileDocumentUri }, CancellationToken.None);
156var (gitWorkspace, _, gitDocument) = await testLspServer.GetManager().GetLspDocumentInfoAsync(new LSP.TextDocumentIdentifier { DocumentUri = gitDocumentUri }, CancellationToken.None);
185var (workspace, _, lspDocument) = await testLspServer.GetManager().GetLspDocumentInfoAsync(new LSP.TextDocumentIdentifier { DocumentUri = unencodedUri }, CancellationToken.None).ConfigureAwait(false);
189var originalText = await lspDocument.GetTextAsync(CancellationToken.None);
196new CustomResolveParams(new LSP.TextDocumentIdentifier { DocumentUri = encodedUri }), CancellationToken.None);
200var (encodedWorkspace, _, encodedDocument) = await testLspServer.GetManager().GetLspDocumentInfoAsync(new LSP.TextDocumentIdentifier { DocumentUri = encodedUri }, CancellationToken.None).ConfigureAwait(false);
204var encodedText = await encodedDocument.GetTextAsync(CancellationToken.None);
233var (workspace, _, lspDocument) = await testLspServer.GetManager().GetLspDocumentInfoAsync(new LSP.TextDocumentIdentifier { DocumentUri = upperCaseUri }, CancellationToken.None).ConfigureAwait(false);
237var originalText = await lspDocument.GetTextAsync(CancellationToken.None);
242new CustomResolveParams(new LSP.TextDocumentIdentifier { DocumentUri = lowerCaseUri }), CancellationToken.None);
246var (lowerCaseWorkspace, _, lowerCaseDocument) = await testLspServer.GetManager().GetLspDocumentInfoAsync(new LSP.TextDocumentIdentifier { DocumentUri = lowerCaseUri }, CancellationToken.None).ConfigureAwait(false);
250var lowerCaseText = await lowerCaseDocument.GetTextAsync(CancellationToken.None);
279var (workspace, _, lspDocument) = await testLspServer.GetManager().GetLspDocumentInfoAsync(new LSP.TextDocumentIdentifier { DocumentUri = upperCaseUri }, CancellationToken.None).ConfigureAwait(false);
283var originalText = await lspDocument.GetTextAsync(CancellationToken.None);
289new CustomResolveParams(new LSP.TextDocumentIdentifier { DocumentUri = lowerCaseUri }), CancellationToken.None));
303var (workspace, _, document) = await testLspServer.GetManager().GetLspDocumentInfoAsync(new LSP.TextDocumentIdentifier { DocumentUri = looseFileUri }, CancellationToken.None);
315new CustomResolveParams(new LSP.TextDocumentIdentifier { DocumentUri = looseFileUri }), CancellationToken.None));
345new CustomResolveParams(new LSP.TextDocumentIdentifier { DocumentUri = invalidUri }), CancellationToken.None);
351var (workspace, _, document) = await testLspServer.GetManager().GetLspDocumentInfoAsync(new LSP.TextDocumentIdentifier { DocumentUri = invalidUri }, CancellationToken.None);
Workspaces\LspWorkspaceManagerTests.cs (31)
37Assert.Equal("LSP text", (await lspDocument.GetTextAsync(CancellationToken.None)).ToString());
43Assert.Equal("More textLSP text", (await lspDocument.GetTextAsync(CancellationToken.None)).ToString());
63var firstDocumentInitialVersion = await firstDocument.GetSyntaxVersionAsync(CancellationToken.None);
64var secondDocumentInitialVersion = await secondDocument.GetSyntaxVersionAsync(CancellationToken.None);
93Assert.NotEqual(firstDocumentInitialVersion, await firstDocumentWithChange.GetSyntaxVersionAsync(CancellationToken.None));
94Assert.Equal($"Some more text{markupOne}", (await firstDocumentWithChange.GetTextAsync(CancellationToken.None)).ToString());
97Assert.Equal(secondDocumentInitialVersion, await secondDocumentUnchanged.GetSyntaxVersionAsync(CancellationToken.None));
124Assert.Equal("LSP text", (await openedDocument.GetTextAsync(CancellationToken.None)).ToString());
162Assert.Equal(markup, (await openedDocument.GetTextAsync(CancellationToken.None)).ToString());
195Assert.Equal("LSP text", (await openedDocument.GetTextAsync(CancellationToken.None)).ToString());
354var changedFirstDocumentText = await changedFirstDocument.GetTextAsync(CancellationToken.None);
355var firstDocumentText = await firstDocument.GetTextAsync(CancellationToken.None);
450Assert.Equal("Server one text", (await documentServerTwo.GetTextAsync(CancellationToken.None)).ToString());
454Assert.Equal("Original text", (await documentServerTwo.GetTextAsync(CancellationToken.None)).ToString());
486Assert.Equal("Text", (await lspDocument.GetTextAsync(CancellationToken.None)).ToString());
511Assert.Equal("Text", (await document1.GetTextAsync(CancellationToken.None)).ToString());
521(await document1.GetTextAsync(CancellationToken.None)).ToString(),
530Assert.Equal("Text", (await document1.GetTextAsync(CancellationToken.None)).ToString());
534(await document1.GetTextAsync(CancellationToken.None)).ToString(),
538Assert.Empty(await testLspServer.GetManagerAccessor().GetMiscellaneousDocumentsAsync(static p => p.Documents).ToImmutableArrayAsync(CancellationToken.None));
548Assert.Equal("Text", (await document1.GetTextAsync(CancellationToken.None)).ToString());
569Assert.Equal("Text", (await document.GetTextAsync(CancellationToken.None)).ToString());
583Assert.Equal("Text", (await document.GetTextAsync(CancellationToken.None)).ToString());
608var originalSourceText = await originalDocument.GetTextAsync(CancellationToken.None);
609var originalRoot = await originalDocument.GetRequiredSyntaxRootAsync(CancellationToken.None);
619var newSourceText = await newDocument.GetTextAsync(CancellationToken.None);
620var newRoot = await newDocument.GetRequiredSyntaxRootAsync(CancellationToken.None);
706Assert.Equal(generatorText, (await sourceGeneratedDocument.GetTextAsync(CancellationToken.None)).ToString());
717Assert.Equal(openText, (await lspDocument.GetTextAsync(CancellationToken.None)).ToString());
728var (workspace, _, document) = await testLspServer.GetManager().GetLspDocumentInfoAsync(CreateTextDocumentIdentifier(uri), CancellationToken.None).ConfigureAwait(false);
734return testLspServer.GetManager().GetLspSolutionInfoAsync(CancellationToken.None);
Workspaces\SourceGeneratedDocumentTests.cs (17)
33new SourceGeneratorGetTextParams(new LSP.TextDocumentIdentifier { DocumentUri = sourceGeneratorDocumentUri }, ResultId: null), CancellationToken.None);
49new SourceGeneratorGetTextParams(new LSP.TextDocumentIdentifier { DocumentUri = sourceGeneratorDocumentUri }, ResultId: null), CancellationToken.None);
74new SourceGeneratorGetTextParams(new LSP.TextDocumentIdentifier { DocumentUri = sourceGeneratorDocumentUri }, ResultId: null), CancellationToken.None);
97CreateTextDocumentPositionParams(location), CancellationToken.None);
118new SourceGeneratorGetTextParams(new LSP.TextDocumentIdentifier { DocumentUri = sourceGeneratorDocumentUri }, ResultId: null), CancellationToken.None);
134new SourceGeneratorGetTextParams(new LSP.TextDocumentIdentifier { DocumentUri = sourceGeneratorDocumentUri }, ResultId: null), CancellationToken.None);
141new SourceGeneratorGetTextParams(new LSP.TextDocumentIdentifier { DocumentUri = sourceGeneratorDocumentUri }, ResultId: text.ResultId), CancellationToken.None);
163new SourceGeneratorGetTextParams(new LSP.TextDocumentIdentifier { DocumentUri = sourceGeneratorDocumentUri }, ResultId: null), CancellationToken.None);
176new SourceGeneratorGetTextParams(new LSP.TextDocumentIdentifier { DocumentUri = sourceGeneratorDocumentUri }, ResultId: text.ResultId), CancellationToken.None);
210new SourceGeneratorGetTextParams(new LSP.TextDocumentIdentifier { DocumentUri = sourceGeneratorDocumentUri }, ResultId: null), CancellationToken.None);
220new SourceGeneratorGetTextParams(new LSP.TextDocumentIdentifier { DocumentUri = sourceGeneratorDocumentUri }, ResultId: text.ResultId), CancellationToken.None);
249new SourceGeneratorGetTextParams(new LSP.TextDocumentIdentifier { DocumentUri = sourceGeneratorDocumentUri }, ResultId: null), CancellationToken.None);
265new SourceGeneratorGetTextParams(new LSP.TextDocumentIdentifier { DocumentUri = sourceGeneratorDocumentUri }, ResultId: text.ResultId), CancellationToken.None);
335new SourceGeneratorGetTextParams(new LSP.TextDocumentIdentifier { DocumentUri = sourceGeneratorDocumentUri }, ResultId: null), CancellationToken.None);
343new SourceGeneratorGetTextParams(new LSP.TextDocumentIdentifier { DocumentUri = sourceGeneratorDocumentUri }, ResultId: text.ResultId), CancellationToken.None);
361new SourceGeneratorGetTextParams(new LSP.TextDocumentIdentifier { DocumentUri = sourceGeneratorDocumentUri }, ResultId: null), CancellationToken.None);
373new SourceGeneratorGetTextParams(new LSP.TextDocumentIdentifier { DocumentUri = sourceGeneratorDocumentUri }, ResultId: text.ResultId), CancellationToken.None);
Microsoft.CodeAnalysis.LanguageServer.UnitTests (21)
Utilities\LspClientExtensions.cs (4)
13=> lspClient.ExecuteRequestAsync<InitializedParams, object>(Methods.InitializedName, new InitializedParams(), CancellationToken.None);
17return await lspClient.ExecuteRequestAsync<InitializeParams, InitializeResult>(Methods.InitializeName, new InitializeParams { Capabilities = clientCapabilities }, CancellationToken.None);
27var result = await lspClient.ExecuteRequestAsync<CodeActionParams, CodeAction[]>(Methods.TextDocumentCodeActionName, codeActionParams, CancellationToken.None);
36var result = (VSInternalCodeAction?)await lspClient.ExecuteRequestAsync<CodeAction, CodeAction>(Methods.CodeActionResolveName, unresolvedCodeAction, CancellationToken.None);
VirtualProjectXmlProviderTests.cs (5)
71var contentNullable = await projectProvider.GetVirtualProjectContentAsync(appFile.Path, LoggerFactory.CreateLogger<VirtualProjectXmlProviderTests>(), CancellationToken.None);
96var contentNullable = await projectProvider.GetVirtualProjectContentAsync(appFile.Path, logger, CancellationToken.None);
128var contentNullable = await projectProvider.GetVirtualProjectContentAsync(appFile.Path, LoggerFactory.CreateLogger<VirtualProjectXmlProviderTests>(), CancellationToken.None);
153var content = await projectProvider.GetVirtualProjectContentAsync(Path.Combine(tempDir.Path, "BAD"), LoggerFactory.CreateLogger<VirtualProjectXmlProviderTests>(), CancellationToken.None);
179var contentNullable = await projectProvider.GetVirtualProjectContentAsync(appFile.Path, LoggerFactory.CreateLogger<VirtualProjectXmlProviderTests>(), CancellationToken.None);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (23)
Microsoft.CodeAnalysis.PooledObjects.Package (2)
Microsoft.CodeAnalysis.PublicApiAnalyzers (23)
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
Microsoft.CodeAnalysis.Remote.ServiceHub (12)
Host\TestUtils.cs (6)
50var assetMapFromNewSolution = await solutionFromScratch.GetAssetMapAsync(projectConeId, CancellationToken.None).ConfigureAwait(false);
51var assetMapFromIncrementalSolution = await incrementalSolutionBuilt.GetAssetMapAsync(projectConeId, CancellationToken.None).ConfigureAwait(false);
108AssetPath.FullLookupForTesting, checksum, CancellationToken.None).ConfigureAwait(false)));
119AssetPathKind.SolutionCompilationStateChecksums, solutionChecksum, CancellationToken.None).ConfigureAwait(false);
121AssetPathKind.SolutionStateChecksums, solutionCompilationChecksums.SolutionState, CancellationToken.None).ConfigureAwait(false);
129assetPath: projectId, projectChecksum, CancellationToken.None).ConfigureAwait(false);
Microsoft.CodeAnalysis.Remote.ServiceHub.UnitTests (2)
TelemetryLoggerTests.cs (2)
67logger.LogBlockStart(FunctionId.Debugging_EncSession_EditSession_EmitDeltaErrorId, KeyValueLogMessage.Create(p => p.Add("test", "start"), logLevel: LogLevel.Information), blockId: 1, CancellationToken.None);
72logger.LogBlockEnd(FunctionId.Debugging_EncSession_EditSession_EmitDeltaErrorId, KeyValueLogMessage.Create(p => p.Add("test", "end")), blockId: 1, delta: 100, CancellationToken.None);
Microsoft.CodeAnalysis.Remote.Workspaces (1)
Microsoft.CodeAnalysis.ResxSourceGenerator (23)
Microsoft.CodeAnalysis.Test.Utilities (4)
Microsoft.CodeAnalysis.Threading.Package (2)
Microsoft.CodeAnalysis.UnitTests (3)
Microsoft.CodeAnalysis.VisualBasic (9)
Microsoft.CodeAnalysis.Workspaces (73)
Microsoft.CodeAnalysis.Workspaces.MSBuild (16)
MSBuild\MSBuildWorkspace.cs (15)
355var buildHost = _applyChangesBuildHostProcessManager.GetBuildHostWithFallbackAsync(projectPath, CancellationToken.None).Result;
356_applyChangesProjectFile = buildHost.LoadProjectFileAsync(projectPath, languageName, CancellationToken.None).Result;
373_applyChangesProjectFile.SaveAsync(CancellationToken.None).Wait();
477_applyChangesProjectFile.AddDocumentAsync(relativePath, logicalPath: null, CancellationToken.None).Wait();
518_applyChangesProjectFile.RemoveDocumentAsync(document.FilePath, CancellationToken.None).Wait();
589_applyChangesProjectFile.AddMetadataReferenceAsync(identity.GetDisplayName(), metadataReference.Properties.Aliases, hintPath: null, CancellationToken.None).Wait();
595_applyChangesProjectFile.AddMetadataReferenceAsync(fileName, metadataReference.Properties.Aliases, hintPath: null, CancellationToken.None).Wait();
601_applyChangesProjectFile.AddMetadataReferenceAsync(fileName, metadataReference.Properties.Aliases, relativePath, CancellationToken.None).Wait();
621_applyChangesProjectFile.RemoveMetadataReferenceAsync(identity.Name, identity.GetDisplayName(), peRef.FilePath, CancellationToken.None).Wait();
640var compilation = project.GetCompilationAsync(CancellationToken.None).WaitAndGetResult_CanCallOnBackground(CancellationToken.None);
659_applyChangesProjectFile.AddProjectReferenceAsync(project.Name, reference, CancellationToken.None).Wait();
672_applyChangesProjectFile.RemoveProjectReferenceAsync(project.Name, project.FilePath, CancellationToken.None).Wait();
684_applyChangesProjectFile.AddAnalyzerReferenceAsync(fileRef.FullPath, CancellationToken.None).Wait();
696_applyChangesProjectFile.RemoveAnalyzerReferenceAsync(fileRef.FullPath, CancellationToken.None).Wait();
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (4)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (34)
RpcTests.cs (13)
73var result = await rpcPair.Client.InvokeAsync<string>(targetObject: 0, nameof(ObjectWithHelloMethod.Hello), [s], CancellationToken.None);
84var result = await rpcPair.Client.InvokeAsync<int>(targetObject: 0, nameof(ObjectWithAddMethod.Add), [1, 1], CancellationToken.None);
97var result = await rpcPair.Client.InvokeNullableAsync<string>(targetObject: 0, nameof(ObjectWithNullableHelloMethod.TryHello), ["World"], CancellationToken.None);
101result = await rpcPair.Client.InvokeNullableAsync<string>(targetObject: 0, nameof(ObjectWithNullableHelloMethod.TryHello), [null], CancellationToken.None);
113await rpcPair.Client.InvokeAsync(targetObject: 0, nameof(ObjectWithVoidMethod.SetMessage), ["Hello, World!"], CancellationToken.None);
125var result = await rpcPair.Client.InvokeAsync<string>(targetObject: 0, nameof(ObjectWithAsyncHelloMethods.HelloAsync), ["World"], CancellationToken.None);
128result = await rpcPair.Client.InvokeAsync<string>(targetObject: 0, nameof(ObjectWithAsyncHelloMethods.HelloWithCancellationAsync), ["World"], CancellationToken.None);
140var call1 = rpcPair.Client.InvokeAsync(targetObject: 0, nameof(ObjectWithRealAsyncMethod.WaitAsync), [], CancellationToken.None);
147var call2 = rpcPair.Client.InvokeAsync(targetObject: 0, nameof(ObjectWithRealAsyncMethod.WaitAsync), [], CancellationToken.None);
170var call1 = rpcPair.Client.InvokeAsync(targetObject: 0, nameof(ObjectWithRealAsyncMethod.WaitAsync), [], CancellationToken.None);
177var call2 = rpcPair.Client.InvokeAsync(targetObject: 0, nameof(ObjectWithRealAsyncMethod.WaitAsync), [], CancellationToken.None);
199var exception = await Assert.ThrowsAsync<RemoteInvocationException>(() => rpcPair.Client.InvokeAsync(targetObject: 0, nameof(ObjectWithThrowingMethod.ThrowException), [], CancellationToken.None));
227await rpcPair.Client.InvokeAsync(targetObject: 0, nameof(ObjectWithMethodThatShutsDownServer.Shutdown), [], CancellationToken.None);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (5)
Microsoft.CodeAnalysis.Workspaces.UnitTests (352)
CodeCleanup\CodeCleanupTests.cs (14)
41var cleanDocument = await CodeCleaner.CleanupAsync(document, [], await document.GetCodeCleanupOptionsAsync(CancellationToken.None));
50var cleanDocument = await CodeCleaner.CleanupAsync(document, await document.GetCodeCleanupOptionsAsync(CancellationToken.None));
60var cleanDocument = await CodeCleaner.CleanupAsync(document, root.FullSpan, await document.GetCodeCleanupOptionsAsync(CancellationToken.None));
70var cleanDocument = await CodeCleaner.CleanupAsync(document, [root.FullSpan], await document.GetCodeCleanupOptionsAsync(CancellationToken.None));
97var cleanDocument = await CodeCleaner.CleanupAsync(document, [], await document.GetCodeCleanupOptionsAsync(CancellationToken.None));
109var cleanDocument = await CodeCleaner.CleanupAsync(document, await document.GetCodeCleanupOptionsAsync(CancellationToken.None));
122var cleanDocument = await CodeCleaner.CleanupAsync(document, root.FullSpan, await document.GetCodeCleanupOptionsAsync(CancellationToken.None));
135var cleanDocument = await CodeCleaner.CleanupAsync(document, [root.FullSpan], await document.GetCodeCleanupOptionsAsync(CancellationToken.None));
147var cleanDocument = await CodeCleaner.CleanupAsync(document, annotation, await document.GetCodeCleanupOptionsAsync(CancellationToken.None));
162var cleanDocument = await CodeCleaner.CleanupAsync(document, annotation, await document.GetCodeCleanupOptionsAsync(CancellationToken.None));
313var newSemanticModel = await document.ReuseExistingSpeculativeModelAsync(accessor.Statements[0], CancellationToken.None);
323newSemanticModel = await document.ReuseExistingSpeculativeModelAsync(accessor.Statements[0], CancellationToken.None);
327var cleanDocument = await CodeCleaner.CleanupAsync(document, await document.GetCodeCleanupOptionsAsync(CancellationToken.None));
409await document.GetCodeCleanupOptionsAsync(CancellationToken.None),
Formatter\FormatterTests.cs (8)
55var formattedDocument = await Formatter.FormatAsync(document, spans: null, options: null, CancellationToken.None);
92var formattedDocument = await Formatter.FormatAsync(document, spans: null, options, CancellationToken.None);
121ValidateCSharpOptions((CSharpSyntaxFormattingOptions)(await Formatter.GetFormattingOptionsAsync(csDocument, updatedOptions, CancellationToken.None)).Syntax!);
122ValidateVisualBasicOptions((VisualBasicSyntaxFormattingOptions)(await Formatter.GetFormattingOptionsAsync(vbDocument, updatedOptions, CancellationToken.None)).Syntax!);
131ValidateCSharpOptions((CSharpSyntaxFormattingOptions)(await Formatter.GetFormattingOptionsAsync(csDocumentWithUpdatedOptions, optionSet: null, CancellationToken.None)).Syntax!);
132ValidateVisualBasicOptions((VisualBasicSyntaxFormattingOptions)(await Formatter.GetFormattingOptionsAsync(vbDocumentWithUpdatedOptions, optionSet: null, CancellationToken.None)).Syntax!);
133ValidateOrganizeImportsOptions(await Formatter.GetOrganizeImportsOptionsAsync(csDocumentWithUpdatedOptions, CancellationToken.None));
134ValidateOrganizeImportsOptions(await Formatter.GetOrganizeImportsOptionsAsync(vbDocumentWithUpdatedOptions, CancellationToken.None));
SemanticModelReuse\SemanticModelReuseTests.cs (53)
42var model = await document.ReuseExistingSpeculativeModelAsync(null, CancellationToken.None);
54var model1 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
55var model2 = await document.ReuseExistingSpeculativeModelAsync(null, CancellationToken.None);
68var model1 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
69var model2 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
88var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
94var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
105var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
111var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
117var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
128var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
134var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
140var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
151var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
157var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
163var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
174var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
180var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
186var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
197var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
203var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
209var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
221var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
227var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
231CSharpSyntaxContext.CreateContext(document2, model2, source.IndexOf("void"), CancellationToken.None);
248var model1 = await document1.ReuseExistingSpeculativeModelAsync(source1.IndexOf("return"), CancellationToken.None);
254var model2 = await document2.ReuseExistingSpeculativeModelAsync(source2.IndexOf("{ return"), CancellationToken.None);
258CSharpSyntaxContext.CreateContext(document2, model2, source2.IndexOf("{ return"), CancellationToken.None);
271var model = await document.ReuseExistingSpeculativeModelAsync(null, CancellationToken.None);
289var model1 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
290var model2 = await document.ReuseExistingSpeculativeModelAsync(null, CancellationToken.None);
309var model1 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
310var model2 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
335var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
347var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
364var model1 = await document1.ReuseExistingSpeculativeModelAsync(source1.IndexOf("return"), CancellationToken.None);
377var model2 = await document2.ReuseExistingSpeculativeModelAsync(source2.IndexOf("return"), CancellationToken.None);
389var model3 = await document3.ReuseExistingSpeculativeModelAsync(source2.IndexOf("return"), CancellationToken.None);
406var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
418var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
430var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
449var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
463var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
477var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
496var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
510var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
524var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
542var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
554var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
558VisualBasicSyntaxContext.CreateContext(document2, model2, source.IndexOf("sub"), CancellationToken.None);
575var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
588var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None);
592VisualBasicSyntaxContext.CreateContext(document2, model2, source.IndexOf("return"), CancellationToken.None);
SolutionTests\SolutionTests.cs (126)
338Assert.Throws<ArgumentException>(() => provider.TryGetDiagnosticValue(tree, "CA1234", CancellationToken.None, out _));
439var root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
440var root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
462root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
463root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
483root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
484root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
527var root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
528var root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
550root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
551root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
571root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
572root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
606var root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
607var root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
633root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
634root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
657root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
658root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
692var root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
693var root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
716root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
717root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
737root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
738root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
769var root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
770var root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
792root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
793root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
813root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
814root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
857var root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
858var root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
879root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
880root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
902root1 = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
903root2 = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
1013Assert.Equal("new text", newSolution1.GetDocument(documentId)!.GetTextSynchronously(CancellationToken.None).ToString());
1035Assert.Equal("new text", newSolution1.GetAdditionalDocument(documentId)!.GetTextSynchronously(CancellationToken.None).ToString());
1057Assert.Equal("new text", newSolution1.GetAnalyzerConfigDocument(documentId)!.GetTextSynchronously(CancellationToken.None).ToString());
1230var newText1 = newDocument1.GetTextSynchronously(CancellationToken.None);
1239var newText3 = newDocument3.GetTextSynchronously(CancellationToken.None);
1243Assert.Equal("class NewD3;", newDocument3.GetTextSynchronously(CancellationToken.None).ToString());
1251var newAddText1 = newAddDocument1.GetTextSynchronously(CancellationToken.None);
1260var newAddText3 = newAddDocument3.GetTextSynchronously(CancellationToken.None);
1264Assert.Equal("new text3", newAddDocument3.GetTextSynchronously(CancellationToken.None).ToString());
1272var newConfigText1 = newConfigDocument1.GetTextSynchronously(CancellationToken.None);
1281var newConfigText3 = newConfigDocument3.GetTextSynchronously(CancellationToken.None);
1285Assert.Equal("#new empty3", newConfigDocument3.GetTextSynchronously(CancellationToken.None).ToString());
1789var oldTree = await document.GetRequiredSyntaxTreeAsync(CancellationToken.None);
1795var newTree = await document.GetRequiredSyntaxTreeAsync(CancellationToken.None);
1827var oldTree = await document.GetRequiredSyntaxTreeAsync(CancellationToken.None);
1842var newTree = await document.GetRequiredSyntaxTreeAsync(CancellationToken.None);
1865var oldTree = await document.GetRequiredSyntaxTreeAsync(CancellationToken.None);
1867var newTree = await newDocument.GetRequiredSyntaxTreeAsync(CancellationToken.None);
1884var oldTree = await document.GetRequiredSyntaxTreeAsync(CancellationToken.None);
1886var newTree = await newDocument.GetRequiredSyntaxTreeAsync(CancellationToken.None);
1903var oldTree = await document.GetRequiredSyntaxTreeAsync(CancellationToken.None);
1905var newTree = await newDocument.GetRequiredSyntaxTreeAsync(CancellationToken.None);
2333var sourcePathOptions = project2.State.GetAnalyzerOptionsForPath(Path.Combine(s_projectDir, "x.cs"), CancellationToken.None);
2344sourcePathOptions = project2.State.GetAnalyzerOptionsForPath(Path.Combine(s_projectDir, "subfolder", "x.cs"), CancellationToken.None);
2892referenced, solution.GetProjectState(project.Id), includeCrossLanguage: true, CancellationToken.None);
2963await solution.GetProject(projectIds[0]).GetCompilationAsync(CancellationToken.None);
2964await solution.GetProject(projectIds[2]).GetCompilationAsync(CancellationToken.None);
2979var namespacesAndTypes = assemblyReference.GlobalNamespace.GetAllNamespacesAndTypes(CancellationToken.None);
3193var newRoot = await Formatter.FormatAsync(document, CSharpSyntaxFormattingOptions.Default, CancellationToken.None).Result.GetSyntaxRootAsync();
3259var syntaxRoot = await document.GetSyntaxRootAsync(CancellationToken.None);
3275var tree = await documentWithAttribute.GetSyntaxTreeAsync(CancellationToken.None);
3276var root = await documentWithAttribute.GetRequiredSyntaxRootAsync(CancellationToken.None);
3461var tree = CSharp.SyntaxFactory.ParseSyntaxTree("public class C {}").GetRoot(CancellationToken.None);
3951var exceptionMessage = await doc.State.GetFailedToLoadExceptionMessageAsync(CancellationToken.None).ConfigureAwait(false);
3957var compilation = await doc.Project.GetCompilationAsync(CancellationToken.None).ConfigureAwait(false);
4049Assert.False(await project.HasSuccessfullyLoadedAsync(CancellationToken.None));
4080Assert.True(await project1.HasSuccessfullyLoadedAsync(CancellationToken.None));
4081Assert.True(await project2.HasSuccessfullyLoadedAsync(CancellationToken.None));
4109Assert.True(await project1.HasSuccessfullyLoadedAsync(CancellationToken.None));
4110Assert.False(await project2.HasSuccessfullyLoadedAsync(CancellationToken.None));
4122var frozenDocument = documentToFreeze.WithFrozenPartialSemantics(CancellationToken.None);
4147var frozenDocument = documentToFreeze.WithFrozenPartialSemantics(CancellationToken.None);
4163var frozenDocument2 = frozenDocument.WithFrozenPartialSemantics(CancellationToken.None);
4182var frozenDocument = documentToFreezeChanged.WithFrozenPartialSemantics(CancellationToken.None);
4227var frozenDocument = documentToFreezeChanged.WithFrozenPartialSemantics(CancellationToken.None);
4288var frozenSolution = document.WithFrozenPartialSemantics(CancellationToken.None).Project.Solution;
4290Assert.True(await frozenSolution.GetProject(project1.Id).HasSuccessfullyLoadedAsync(CancellationToken.None));
4291Assert.True(await frozenSolution.GetProject(project2.Id).HasSuccessfullyLoadedAsync(CancellationToken.None));
4307var frozenDocument = project.Documents.Single().WithFrozenPartialSemantics(CancellationToken.None);
4321var frozenDocument = project.Documents.First().WithFrozenPartialSemantics(CancellationToken.None);
4340var frozenDocument = forkedProject.Documents.Single().WithFrozenPartialSemantics(CancellationToken.None);
4364var frozenDocument = forkedProject.Documents.Single().WithFrozenPartialSemantics(CancellationToken.None);
4391var frozenDocument = document.WithFrozenPartialSemantics(CancellationToken.None);
4423var frozen = solution.GetRequiredDocument(documentIdToFreeze).WithFrozenPartialSemantics(CancellationToken.None);
4476var doc1Root = await document1.GetRequiredSyntaxRootAsync(CancellationToken.None);
4477var doc2Root = await document2.GetRequiredSyntaxRootAsync(CancellationToken.None);
4484var frozenDoc1 = document1.WithFrozenPartialSemantics(CancellationToken.None);
4487var frozenDoc1Root = await frozenDoc1.GetRequiredSyntaxRootAsync(CancellationToken.None);
4488var frozenDoc2Root = await frozenDoc2.GetRequiredSyntaxRootAsync(CancellationToken.None);
4499var frozenDoc2 = document2.WithFrozenPartialSemantics(CancellationToken.None);
4502var frozenDoc1Root = await frozenDoc1.GetRequiredSyntaxRootAsync(CancellationToken.None);
4503var frozenDoc2Root = await frozenDoc2.GetRequiredSyntaxRootAsync(CancellationToken.None);
4519Assert.False(await csBrokenProject.HasSuccessfullyLoadedAsync(CancellationToken.None));
4522Assert.True(await vbNormalProject.HasSuccessfullyLoadedAsync(CancellationToken.None));
4525Assert.True(await dependsOnBrokenProject.HasSuccessfullyLoadedAsync(CancellationToken.None));
4528Assert.True(await dependsOnVbNormalProject.HasSuccessfullyLoadedAsync(CancellationToken.None));
4532Assert.True(await transitivelyDependsOnBrokenProjects.HasSuccessfullyLoadedAsync(CancellationToken.None));
4536Assert.True(await transitivelyDependsOnNormalProjects.HasSuccessfullyLoadedAsync(CancellationToken.None));
4566var unused = await loader.LoadTextAndVersionAsync(new LoadTextOptions(SourceHashAlgorithms.Default), CancellationToken.None);
4580var unused = loader.LoadTextAndVersionSynchronously(new LoadTextOptions(SourceHashAlgorithms.Default), CancellationToken.None);
4603var strongTree = factory.ParseSyntaxTree("dummy", dummyProject.ParseOptions, text, CancellationToken.None);
4728Assert.True(provider.TryGetDiagnosticValue(newSyntaxTree, "CA1234", CancellationToken.None, out var severity));
4757Assert.True(provider.TryGetDiagnosticValue(syntaxTreeAfterAddingEditorConfig, "CA1234", CancellationToken.None, out var severity));
4766Assert.False(provider.TryGetDiagnosticValue(syntaxTreeAfterAddingEditorConfig, "CA1234", CancellationToken.None, out _));
4798Assert.True(provider.TryGetDiagnosticValue(syntaxTreeBeforeEditorConfigChange, "CA1234", CancellationToken.None, out var severity));
4811Assert.True(provider.TryGetDiagnosticValue(syntaxTreeBeforeEditorConfigChange, "CA6789", CancellationToken.None, out severity));
4916Assert.Null(document.GetSyntaxTreeSynchronously(CancellationToken.None));
5569var documentOptions = await document.GetOptionsAsync(CancellationToken.None);
5628var frozenSolution = project.Solution.WithFrozenPartialCompilations(CancellationToken.None);
5647var frozenSolution = project.Solution.WithFrozenPartialCompilations(CancellationToken.None);
5669var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None);
5699var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None);
5729var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None);
5759var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None);
5794Assert.Equal("// source1", generatedDocuments.Single().GetTextSynchronously(CancellationToken.None).ToString());
5797? project1.Solution.WithFrozenPartialCompilations(CancellationToken.None)
5816Assert.Equal("// source1", forkedGeneratedDocuments.Single().GetTextSynchronously(CancellationToken.None).ToString());
5820Assert.Equal("// source2", forkedGeneratedDocuments.Single().GetTextSynchronously(CancellationToken.None).ToString());
5832var frozenSolution = project.Solution.WithFrozenPartialCompilations(CancellationToken.None);
SolutionTests\TextLoaderTests.cs (8)
110await Assert.ThrowsAsync<NotImplementedException>(() => loader.LoadTextAndVersionAsync(new LoadTextOptions(SourceHashAlgorithms.Default), CancellationToken.None));
111await Assert.ThrowsAsync<NotImplementedException>(() => loader.LoadTextAndVersionAsync(workspace: null, documentId: null, CancellationToken.None));
118Assert.Same(LoaderOverridesObsolete.Value, await loader.LoadTextAndVersionAsync(new LoadTextOptions(SourceHashAlgorithms.Default), CancellationToken.None));
119Assert.Same(LoaderOverridesObsolete.Value, await loader.LoadTextAndVersionAsync(workspace: null, documentId: null, CancellationToken.None));
126Assert.Same(LoaderOverridesObsolete2.Value, await loader.LoadTextAndVersionAsync(new LoadTextOptions(SourceHashAlgorithms.Default), CancellationToken.None));
127Assert.Same(LoaderOverridesObsolete2.Value, await loader.LoadTextAndVersionAsync(workspace: null, documentId: null, CancellationToken.None));
134Assert.Same(LoaderOverridesNew.Value, await loader.LoadTextAndVersionAsync(new LoadTextOptions(SourceHashAlgorithms.Default), CancellationToken.None));
135Assert.Same(LoaderOverridesNew.Value, await loader.LoadTextAndVersionAsync(workspace: null, documentId: null, CancellationToken.None));
SyntaxPathTests.cs (23)
83Assert.True(path.TryResolve(tree, CancellationToken.None, out SyntaxNode node));
97Assert.True(path.TryResolve(newTree, CancellationToken.None, out SyntaxNode node));
111Assert.True(path.TryResolve(newTree, CancellationToken.None, out SyntaxNode node));
124Assert.True(path.TryResolve(tree, CancellationToken.None, out SyntaxNode node));
161Assert.True(path1.TryResolve(tree, CancellationToken.None, out SyntaxNode n1));
162Assert.True(path2.TryResolve(tree, CancellationToken.None, out SyntaxNode n2));
163Assert.True(path3.TryResolve(tree, CancellationToken.None, out SyntaxNode n3));
197Assert.True(path1.TryResolve(tree, CancellationToken.None, out SyntaxNode n1));
198Assert.True(path2.TryResolve(tree, CancellationToken.None, out SyntaxNode n2));
234Assert.True(path1.TryResolve(tree, CancellationToken.None, out SyntaxNode n1));
235Assert.True(path2.TryResolve(tree, CancellationToken.None, out SyntaxNode n2));
266Assert.True(path1.TryResolve(tree, CancellationToken.None, out SyntaxNode n1));
267Assert.False(path2.TryResolve(tree, CancellationToken.None, out SyntaxNode _));
298Assert.True(path1.TryResolve(tree, CancellationToken.None, out SyntaxNode n1));
299Assert.False(path2.TryResolve(tree, CancellationToken.None, out SyntaxNode _));
300Assert.False(path3.TryResolve(tree, CancellationToken.None, out SyntaxNode _));
329Assert.True(path1.TryResolve(tree, CancellationToken.None, out SyntaxNode n1));
330Assert.True(path2.TryResolve(tree, CancellationToken.None, out SyntaxNode n2));
360Assert.True(path1.TryResolve(tree, CancellationToken.None, out SyntaxNode n1));
361Assert.True(path2.TryResolve(tree, CancellationToken.None, out SyntaxNode n2));
399Assert.True(path1.TryResolve(tree, CancellationToken.None, out SyntaxNode n1));
400Assert.True(path2.TryResolve(tree, CancellationToken.None, out SyntaxNode n2));
418Assert.True(path.TryResolve(newTree, CancellationToken.None, out SyntaxNode node));
Microsoft.CommonLanguageServerProtocol.Framework.Example (2)
Microsoft.CommonLanguageServerProtocol.Framework.Package (4)
Microsoft.CommonLanguageServerProtocol.Framework.UnitTests (10)
RequestExecutionQueueTests.cs (8)
56await Assert.ThrowsAsync<NotImplementedException>(() => requestExecutionQueue.ExecuteAsync(JToken.FromObject(new MockRequest(1)), ThrowingHandler.Name, lspServices, CancellationToken.None));
82await requestExecutionQueue.ExecuteAsync(JToken.FromObject(new MockRequest(1)), MutatingHandler.Name, lspServices, CancellationToken.None);
105var response = (MockResponse?)await requestExecutionQueue.ExecuteAsync(JToken.FromObject(new MockRequest(1)), TestMethodHandler.Name, lspServices, CancellationToken.None);
115var response = (MockResponse?)await requestExecutionQueue.ExecuteAsync(serializedRequest: null, TestParameterlessMethodHandler.Name, lspServices, CancellationToken.None);
125var response = await requestExecutionQueue.ExecuteAsync(JToken.FromObject(new MockRequest(1)), TestNotificationHandler.Name, lspServices, CancellationToken.None);
135var response = await requestExecutionQueue.ExecuteAsync(serializedRequest: null, TestParameterlessNotificationHandler.Name, lspServices, CancellationToken.None);
146var task1 = requestExecutionQueue.ExecuteAsync(request, TestMethodHandler.Name, lspServices, CancellationToken.None);
147var task2 = requestExecutionQueue.ExecuteAsync(request, TestMethodHandler.Name, lspServices, CancellationToken.None);
Microsoft.DotNet.Build.Tasks.Feed.Tests (1)
Microsoft.DotNet.Build.Tasks.Packaging (3)
Microsoft.DotNet.Helix.Sdk (2)
Microsoft.DotNet.SignCheckLibrary (1)
Microsoft.Extensions.AI (7)
Microsoft.Extensions.AI.Abstractions (24)
Microsoft.Extensions.AI.Abstractions.Tests (7)
Microsoft.Extensions.AI.OpenAI (3)
Microsoft.Extensions.AI.Tests (18)
Microsoft.Extensions.Caching.Hybrid (2)
Microsoft.Extensions.Caching.Hybrid.Tests (14)
Microsoft.Extensions.Caching.Memory (3)
Microsoft.Extensions.DependencyInjection (1)
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (16)
ManualHealthCheckTests.cs (11)
20var healthCheckResult = await manualHealthCheckService.CheckHealthAsync(context, CancellationToken.None);
38Assert.Equal(HealthStatus.Unhealthy, (await manualHealthCheckService.CheckHealthAsync(context, CancellationToken.None)).Status);
42var healthCheckResultUnhealthy = await manualHealthCheckService.CheckHealthAsync(context, CancellationToken.None);
47var healthCheckResultHealthy = await manualHealthCheckService.CheckHealthAsync(context, CancellationToken.None);
62Assert.Equal(HealthStatus.Unhealthy, (await manualHealthCheckService.CheckHealthAsync(context, CancellationToken.None)).Status);
67var healthCheckResultUnhealthy = await manualHealthCheckService.CheckHealthAsync(context, CancellationToken.None);
73var healthCheckResultHealthy = await manualHealthCheckService.CheckHealthAsync(context, CancellationToken.None);
89Assert.Equal(HealthStatus.Unhealthy, (await manualHealthCheckService.CheckHealthAsync(context, CancellationToken.None)).Status);
96var healthCheckResult2Unhealthy = await manualHealthCheckService.CheckHealthAsync(context, CancellationToken.None);
103var healthCheckResult1Unhealthy = await manualHealthCheckService.CheckHealthAsync(context, CancellationToken.None);
110var healthCheckResultHealthy = await manualHealthCheckService.CheckHealthAsync(context, CancellationToken.None);
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (18)
Microsoft.Extensions.FileProviders.Physical (1)
Microsoft.Extensions.Hosting.Abstractions (1)
Microsoft.Extensions.Hosting.Testing.Tests (4)
Microsoft.Extensions.Http.Diagnostics (1)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (48)
Microsoft.Extensions.Http.Diagnostics.Tests (32)
Logging\HttpRequestReaderTest.cs (15)
102await reader.ReadRequestAsync(logRecord, httpRequestMessage, requestHeadersBuffer, CancellationToken.None);
103await reader.ReadResponseAsync(logRecord, httpResponseMessage, responseHeadersBuffer, CancellationToken.None);
159await reader.ReadRequestAsync(actualRecord, httpRequestMessage, requestHeadersBuffer, CancellationToken.None);
160await reader.ReadResponseAsync(actualRecord, httpResponseMessage, responseHeadersBuffer, CancellationToken.None);
230await reader.ReadRequestAsync(actualRecord, httpRequestMessage, requestHeadersBuffer, CancellationToken.None);
231await reader.ReadResponseAsync(actualRecord, httpResponseMessage, responseHeadersBuffer, CancellationToken.None);
305await reader.ReadRequestAsync(actualRecord, httpRequestMessage, requestHeadersBuffer, CancellationToken.None);
306await reader.ReadResponseAsync(actualRecord, httpResponseMessage, responseHeadersBuffer, CancellationToken.None);
365await reader.ReadRequestAsync(actualRecord, httpRequestMessage, requestHeadersBuffer, CancellationToken.None);
435await reader.ReadRequestAsync(actualRecord, httpRequestMessage, requestHeadersBuffer, CancellationToken.None);
436await reader.ReadResponseAsync(actualRecord, httpResponseMessage, responseHeadersBuffer, CancellationToken.None);
502await reader.ReadRequestAsync(actualRecord, httpRequestMessage, requestHeadersBuffer, CancellationToken.None);
503await reader.ReadResponseAsync(actualRecord, httpResponseMessage, responseHeadersBuffer, CancellationToken.None);
570await reader.ReadRequestAsync(actualRecord, httpRequestMessage, requestHeadersBuffer, CancellationToken.None);
571await reader.ReadResponseAsync(actualRecord, httpResponseMessage, responseHeadersBuffer, CancellationToken.None);
Microsoft.Extensions.Http.Polly.Tests (11)
PolicyHttpMessageHandlerTest.cs (11)
49var response = await handler.SendAsync(new HttpRequestMessage(), CancellationToken.None);
94var response = await handler.SendAsync(expectedRequest, CancellationToken.None);
142var response = await invoke.SendAsync(new HttpRequestMessage(), CancellationToken.None);
194var response = await invoke.SendAsync(new HttpRequestMessage(), CancellationToken.None);
216await handler.SendAsync(new HttpRequestMessage(), CancellationToken.None);
264var response = await handler.SendAsync(new HttpRequestMessage(), CancellationToken.None);
291var response = await handler.SendAsync(request, CancellationToken.None);
322var response = await handler.SendAsync(request, CancellationToken.None);
344await handler.SendAsync(request, CancellationToken.None);
370await handler.SendAsync(request, CancellationToken.None);
403handler.SendAsync(request, CancellationToken.None).GetAwaiter().GetResult();
Microsoft.Extensions.Http.Resilience.PerformanceTests (6)
Microsoft.Extensions.Identity.Core (2)
Microsoft.Extensions.Options.Contextual.Tests (2)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (3)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests.Fuzzing (1)
Microsoft.Extensions.ServiceDiscovery.Tests (9)
Microsoft.Extensions.ServiceDiscovery.Yarp.Tests (7)
Microsoft.Extensions.TimeProvider.Testing.Tests (7)
FakeTimeProviderTests.cs (7)
292var t = timeProvider.Delay(TimeSpan.Zero, CancellationToken.None);
303var delay = timeProvider.Delay(TimeSpan.FromMilliseconds(1), CancellationToken.None);
364await Assert.ThrowsAsync<ArgumentOutOfRangeException>(() => source.Task.WaitAsync(TimeSpan.FromTicks(-1), timeProvider, CancellationToken.None));
366await Assert.ThrowsAsync<ArgumentOutOfRangeException>(() => source.Task.WaitAsync(TimeSpan.FromMilliseconds(-2), timeProvider, CancellationToken.None));
375var t = source.Task.WaitAsync(TimeSpan.FromSeconds(100000), timeProvider, CancellationToken.None);
395var t = source.Task.WaitAsync(TimeSpan.FromMilliseconds(-1), timeProvider, CancellationToken.None);
414var t = source.Task.WaitAsync(TimeSpan.FromMilliseconds(1), timeProvider, CancellationToken.None);
Microsoft.Extensions.Validation.GeneratorTests (34)
ValidationsGenerator.SkipValidation.cs (10)
128await validatableTypeInfo.ValidateAsync(instance, context, CancellationToken.None);
146await validatableTypeInfo.ValidateAsync(instance, context, CancellationToken.None);
168await validatableTypeInfo.ValidateAsync(instance, context, CancellationToken.None);
192await validatableTypeInfo.ValidateAsync(rootInstance, context, CancellationToken.None);
220await validatableTypeInfo.ValidateAsync(rootInstance, context, CancellationToken.None);
240await validatableTypeInfo.ValidateAsync(instance, context, CancellationToken.None);
269await validatableTypeInfo.ValidateAsync(instance, context, CancellationToken.None);
346await validatableTypeInfo.ValidateAsync(instance, context, CancellationToken.None);
370await validatableTypeInfo.ValidateAsync(instance, context, CancellationToken.None);
388await validatableTypeInfo.ValidateAsync(instance, context, CancellationToken.None);
ValidationsGenerator.ValidatableType.cs (20)
108await validatableTypeInfo.ValidateAsync(instance, context, CancellationToken.None);
127await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
146await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
168await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
197await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
249await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
279await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
298await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
325await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
375await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
477await validatableTypeInfo.ValidateAsync(instance, context, CancellationToken.None);
496await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
515await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
537await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
566await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
618await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
648await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
667await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
694await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
744await validatableInfo.ValidateAsync(instance, context, CancellationToken.None);
Microsoft.Gen.ComplianceReports.Unit.Tests (4)
Microsoft.Gen.ContextualOptions.Unit.Tests (9)
Microsoft.Gen.Logging.Unit.Tests (9)
Microsoft.Gen.MetadataExtractor.Unit.Tests (4)
Microsoft.Gen.Metrics.Unit.Tests (4)
Microsoft.Gen.MetricsReports.Unit.Tests (8)
Microsoft.JSInterop (11)
Microsoft.JSInterop.Tests (4)
Microsoft.Maui.Controls (1)
Microsoft.VisualStudio.LanguageServices (66)
Library\AbstractObjectList.cs (6)
150() => TryFillDescriptionAsync(index, (_VSOBJDESCOPTIONS)grfOptions, pobDesc, CancellationToken.None));
159GetBrowseObjectAsync(index, CancellationToken.None));
212() => GetExpandableAsync(index, listTypeExcluded, CancellationToken.None)) ? 1 : 0;
237() => GetListAsync(index, listType, flags, pobSrch, CancellationToken.None));
251var ppNavInfo = await GetNavInfoAsync(index, CancellationToken.None).ConfigureAwait(true);
272TryGetPropertyAsync(index, (_VSOBJLISTELEMPROPID)propid, CancellationToken.None));
Microsoft.VisualStudio.LanguageServices.CSharp (25)
CodeModel\CSharpCodeModelService.cs (13)
651var compilation = project.GetRequiredCompilationAsync(CancellationToken.None).Result;
1274var text = memberDeclaration.SyntaxTree.GetText(CancellationToken.None);
1354var text = memberDeclaration.SyntaxTree.GetText(CancellationToken.None);
1412var text = memberDeclaration.SyntaxTree.GetText(CancellationToken.None);
2764return document.ReplaceNodeSynchronously(fieldDeclaration, newFieldDeclaration, CancellationToken.None);
2785return document.ReplaceNodeSynchronously(enumDeclaration, newEnumDeclaration, CancellationToken.None);
2796var text = document.GetTextSynchronously(CancellationToken.None);
2811return document.ReplaceNodeSynchronously(attributeList, newAttributeList, CancellationToken.None);
2822return document.ReplaceNodeSynchronously(argumentList, newArgumentList, CancellationToken.None);
2832return document.ReplaceNodeSynchronously(parameterList, newParameterList, CancellationToken.None);
2837var text = document.GetTextSynchronously(CancellationToken.None);
3778var typeInfo = semanticModel.GetTypeInfo(type.Type, CancellationToken.None);
3866var typeInfo = semanticModel.GetTypeInfo(type.Type, CancellationToken.None);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (20)
DocumentOutline\DocumentOutlineTests.cs (6)
62mocks.TextBuffer, mocks.LanguageServiceBrokerCallback, mocks.FilePath, CancellationToken.None);
127var searchedSymbols = DocumentOutlineViewModel.SearchDocumentSymbolData(model.DocumentSymbolData, string.Empty, CancellationToken.None);
131searchedSymbols = DocumentOutlineViewModel.SearchDocumentSymbolData(model.DocumentSymbolData, "foo", CancellationToken.None);
136searchedSymbols = DocumentOutlineViewModel.SearchDocumentSymbolData(model.DocumentSymbolData, "Method", CancellationToken.None);
142searchedSymbols = DocumentOutlineViewModel.SearchDocumentSymbolData(model.DocumentSymbolData, "app", CancellationToken.None);
148searchedSymbols = DocumentOutlineViewModel.SearchDocumentSymbolData(model.DocumentSymbolData, "xyz", CancellationToken.None);
Microsoft.VisualStudio.LanguageServices.Implementation (48)
CodeModel\AbstractCodeModelObject_CodeGen.cs (9)
47var method = CodeGenerationService.CreateMethodDeclaration(newMethodSymbol, destination, info, CancellationToken.None);
61var method = CodeGenerationService.CreateMethodDeclaration(newMethodSymbol, destination, info, CancellationToken.None);
80return CodeGenerationService.CreateNamedTypeDeclaration(newTypeSymbol, destination, info, CancellationToken.None);
126return CodeGenerationService.CreateEventDeclaration(newEventSymbol, destination, info, CancellationToken.None);
141return CodeGenerationService.CreateFieldDeclaration(newFieldSymbol, destination, info, CancellationToken.None);
167var method = CodeGenerationService.CreateMethodDeclaration(newMethodSymbol, destination, info, CancellationToken.None);
227return CodeGenerationService.CreatePropertyDeclaration(newPropertySymbol, destination, info, CancellationToken.None);
236return CodeGenerationService.CreateNamespaceDeclaration(newNamespaceSymbol, destination, info, CancellationToken.None);
263return CodeGenerationService.CreateNamedTypeDeclaration(newTypeSymbol, destination, codeGenOptions, CancellationToken.None);
CodeModel\FileCodeModel.cs (13)
346var formattingOptions = await result.GetSyntaxFormattingOptionsAsync(CancellationToken.None).ConfigureAwait(false);
347var formatted = await Formatter.FormatAsync(result, Formatter.Annotation, formattingOptions, CancellationToken.None).ConfigureAwait(true);
348formatted = await Formatter.FormatAsync(formatted, SyntaxAnnotation.ElasticAnnotation, formattingOptions, CancellationToken.None).ConfigureAwait(true);
415() => Workspace.CurrentSolution.GetSourceGeneratedDocumentAsync(GetDocumentId(), CancellationToken.None).AsTask());
427return GetDocument().GetRequiredSyntaxTreeSynchronously(CancellationToken.None);
432return GetDocument().GetRequiredSyntaxRootSynchronously(CancellationToken.None);
439.GetRequiredSemanticModelAsync(CancellationToken.None).AsTask();
446.GetCodeGenerationOptionsAsync(CancellationToken.None).AsTask();
453.GetRequiredCompilationAsync(CancellationToken.None);
553var line = GetDocument().GetTextSynchronously(CancellationToken.None).Lines[lineNumber];
703var simplifierOptions = await _batchDocument.GetSimplifierOptionsAsync(CancellationToken.None).ConfigureAwait(false);
704return await Simplifier.ReduceAsync(_batchDocument, Simplifier.Annotation, simplifierOptions, CancellationToken.None).ConfigureAwait(false);
723elementAndPath.Item1.ReacquireNodeKey(elementAndPath.Item2, CancellationToken.None);
CodeModel\FileCodeModel_CodeGen.cs (6)
28document, IsBatchOpen, insertionIndex, containerNode, attributeNode, CancellationToken.None, out var newDocument);
39document, IsBatchOpen, insertionIndex, containerNode, attributeArgumentNode, CancellationToken.None, out var newDocument);
50document, IsBatchOpen, insertionIndex, containerNode, importNode, CancellationToken.None, out var newDocument);
61document, IsBatchOpen, insertionIndex, containerNode, memberNode, CancellationToken.None, out var newDocument);
72document, IsBatchOpen, insertionIndex, containerNode, parameterNode, CancellationToken.None, out var newDocument);
97return CodeModelService.UpdateNode(document, node, updatedNode, CancellationToken.None);
Microsoft.VisualStudio.LanguageServices.LiveShare (6)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Replay (4)
Roslyn.Diagnostics.Analyzers (23)
Roslyn.Diagnostics.CSharp.Analyzers (1)
Roslyn.VisualStudio.DiagnosticsWindow (4)
Roslyn.VisualStudio.Next.UnitTests (307)
Remote\SerializationValidator.cs (9)
85var data = await AssetStorage.GetTestAccessor().GetRequiredAssetAsync(checksum, CancellationToken.None).ConfigureAwait(false);
98Serializer.Serialize(data.Value, writer, CancellationToken.None);
106var result = Serializer.Deserialize(data.Kind, reader, CancellationToken.None);
114scope.SolutionChecksum, this.Services.SolutionServices, CancellationToken.None).ConfigureAwait(false);
145(v, k, s) => new SolutionAsset(s.CreateChecksum(v, CancellationToken.None), v));
149(v, k, s) => new SolutionAsset(s.CreateChecksum(v, CancellationToken.None), v));
155(v, k, s) => new SolutionAsset(s.CreateChecksum(v, CancellationToken.None), v));
162(v, k, s) => new SolutionAsset(s.CreateChecksum(v, CancellationToken.None), v));
169(v, k, s) => new SolutionAsset(s.CreateChecksum(v, CancellationToken.None), v));
Remote\SnapshotSerializationTests.cs (49)
75var data = await scope.GetTestAccessor().GetAssetAsync(checksum, CancellationToken.None);
88using var scope = await validator.AssetStorage.StoreAssetsAsync(solution, CancellationToken.None);
108using var scope = await validator.AssetStorage.StoreAssetsAsync(solution, CancellationToken.None);
121using var scope = await validator.AssetStorage.StoreAssetsAsync(project.Solution, CancellationToken.None);
143using var snapshot = await validator.AssetStorage.StoreAssetsAsync(project.Solution, CancellationToken.None);
157using var scope = await validator.AssetStorage.StoreAssetsAsync(document.Project.Solution, CancellationToken.None);
177using var scope = await validator.AssetStorage.StoreAssetsAsync(document.Project.Solution, CancellationToken.None);
187var firstProjectChecksum = await solution.GetProject(solution.ProjectIds[0]).State.GetChecksumAsync(CancellationToken.None);
188var secondProjectChecksum = await solution.GetProject(solution.ProjectIds[1]).State.GetChecksumAsync(CancellationToken.None);
192using var scope = await validator.AssetStorage.StoreAssetsAsync(solution, CancellationToken.None);
211using var scope = await validator.AssetStorage.StoreAssetsAsync(solution, CancellationToken.None);
223using var scope = await validator.AssetStorage.StoreAssetsAsync(solution, CancellationToken.None);
237using var scope = await validator.AssetStorage.StoreAssetsAsync(solution, CancellationToken.None);
258using (var scope1 = await validator.AssetStorage.StoreAssetsAsync(solution, CancellationToken.None).ConfigureAwait(false))
264using (var scope2 = await validator.AssetStorage.StoreAssetsAsync(solution, CancellationToken.None).ConfigureAwait(false))
285var assetFromFile = new SolutionAsset(serializer.CreateChecksum(reference, CancellationToken.None), reference);
299var scope1 = await validator.AssetStorage.StoreAssetsAsync(solution, CancellationToken.None);
307using var scope2 = await validator.AssetStorage.StoreAssetsAsync(recovered, CancellationToken.None);
321using var scope3 = await validator.AssetStorage.StoreAssetsAsync(roundtrip, CancellationToken.None);
339var scope1 = await validator.AssetStorage.StoreAssetsAsync(solution, CancellationToken.None);
347using var scope2 = await validator.AssetStorage.StoreAssetsAsync(recovered, CancellationToken.None);
362using var scope3 = await validator.AssetStorage.StoreAssetsAsync(roundtrip, CancellationToken.None);
381var assetFromFile = new SolutionAsset(serializer.CreateChecksum(reference, CancellationToken.None), reference);
395var assetFromFile = new SolutionAsset(serializer.CreateChecksum(reference, CancellationToken.None), reference);
409var assetFromFile = new SolutionAsset(serializer.CreateChecksum(reference, CancellationToken.None), reference);
430var assetFromFile = new SolutionAsset(serializer.CreateChecksum(reference, CancellationToken.None), reference);
451var assetFromFile = new SolutionAsset(serializer.CreateChecksum(reference, CancellationToken.None), reference);
466var assetFromFile = new SolutionAsset(serializer.CreateChecksum(reference, CancellationToken.None), reference);
491using var snapshot = await validator.AssetStorage.StoreAssetsAsync(project.Solution, CancellationToken.None);
511using var snapshot = await validator.AssetStorage.StoreAssetsAsync(project.Solution, CancellationToken.None);
524using var snapshot = await validator.AssetStorage.StoreAssetsAsync(project.Solution, CancellationToken.None);
537var metadata = serializer.CreateChecksum(new MissingMetadataReference(), CancellationToken.None);
538var analyzer = serializer.CreateChecksum(new AnalyzerFileReference(Path.Combine(TempRoot.Root, "missing"), new MissingAnalyzerLoader()), CancellationToken.None);
552var checksum = await project.State.GetChecksumAsync(CancellationToken.None);
590using var scope = await validator.AssetStorage.StoreAssetsAsync(solution, CancellationToken.None);
594var compilation = await recovered.Projects.First().GetCompilationAsync(CancellationToken.None);
615serializer.Serialize(serializableSourceText, objectWriter, CancellationToken.None);
622var newText = (SerializableSourceText)serializer.Deserialize(serializableSourceText.GetWellKnownSynchronizationKind(), objectReader, CancellationToken.None);
623Assert.Equal(sourceText.ToString(), newText.GetText(CancellationToken.None).ToString());
633serializer.Serialize(serializableSourceText, objectWriter, CancellationToken.None);
640var newText = (SerializableSourceText)serializer.Deserialize(serializableSourceText.GetWellKnownSynchronizationKind(), objectReader, CancellationToken.None);
641Assert.Equal(sourceText.ToString(), newText.GetText(CancellationToken.None).ToString());
662serializer.Serialize(originalOptions, objectWriter, CancellationToken.None);
667var recoveredOptions = (CompilationOptions)serializer.Deserialize(originalOptions.GetWellKnownSynchronizationKind(), objectReader, CancellationToken.None);
669var original = serializer.CreateChecksum(originalOptions, CancellationToken.None);
670var recovered = serializer.CreateChecksum(recoveredOptions, CancellationToken.None);
681serializer.Serialize(asset.Value, writer, CancellationToken.None);
686var recovered = serializer.Deserialize(asset.Kind, reader, CancellationToken.None);
687var checksum = recovered is SerializableSourceText text ? text.ContentChecksum : serializer.CreateChecksum(recovered, CancellationToken.None);
Services\AssetProviderTests.cs (18)
54var stored = await provider.GetAssetAsync<object>(AssetPath.FullLookupForTesting, checksum, CancellationToken.None);
58await provider.GetAssetsAsync<object, VoidResult>(AssetPath.FullLookupForTesting, [checksum], (checksum, asset, _) => stored2.Add((checksum, asset)), default, CancellationToken.None);
74await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
76var map = await solution.GetAssetMapAsync(projectConeId: null, CancellationToken.None);
85await service.GetAssetsAsync<object>(AssetPath.FullLookupForTesting, [.. map.Keys], CancellationToken.None);
102await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
104var map = await solution.GetAssetMapAsync(projectConeId: null, CancellationToken.None);
113await service.SynchronizeSolutionAssetsAsync(await solution.CompilationState.GetChecksumAsync(CancellationToken.None), CancellationToken.None);
127await project.State.GetChecksumAsync(CancellationToken.None);
129var map = await project.GetAssetMapAsync(CancellationToken.None);
140allProjectChecksums.Add(await project.State.GetStateChecksumsAsync(CancellationToken.None));
142await service.SynchronizeProjectAssetsAsync(allProjectChecksums, CancellationToken.None);
156await project.State.GetChecksumAsync(CancellationToken.None);
158var map = await project.GetAssetMapAsync(CancellationToken.None);
169var stateChecksums = await project.State.GetStateChecksumsAsync(CancellationToken.None);
175AssetPath.FullLookupForTesting, textChecksums, CancellationToken.None);
180AssetPath.FullLookupForTesting, textChecksumsReversed, CancellationToken.None);
Services\ServiceHubServicesTests.cs (48)
82await solution.CompilationState.GetChecksumAsync(CancellationToken.None),
83await remoteWorkpace.CurrentSolution.CompilationState.GetChecksumAsync(CancellationToken.None));
104var oldState = await oldDocument.State.GetStateChecksumsAsync(CancellationToken.None);
112var newState = await newDocument.State.GetStateChecksumsAsync(CancellationToken.None);
117CancellationToken.None);
121Assert.Equal(newText.ToString(), (await serializableRemoteText.GetTextAsync(CancellationToken.None)).ToString());
127await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
130await solution.AppendAssetMapAsync(map, CancellationToken.None);
155var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
156await remoteWorkspace.UpdatePrimaryBranchSolutionAsync(assetProvider, solutionChecksum, CancellationToken.None);
206var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
207await remoteWorkspace.UpdatePrimaryBranchSolutionAsync(assetProvider, solutionChecksum, CancellationToken.None);
218CancellationToken.None);
252await solution.CompilationState.GetChecksumAsync(CancellationToken.None),
253await remoteWorkspace.CurrentSolution.CompilationState.GetChecksumAsync(CancellationToken.None));
258await solution.CompilationState.GetChecksumAsync(CancellationToken.None),
259await remoteWorkspace.CurrentSolution.CompilationState.GetChecksumAsync(CancellationToken.None));
278await solution.CompilationState.GetChecksumAsync(CancellationToken.None),
279await remoteWorkspace.CurrentSolution.CompilationState.GetChecksumAsync(CancellationToken.None));
286await solution.CompilationState.GetChecksumAsync(CancellationToken.None),
287await remoteWorkspace.CurrentSolution.CompilationState.GetChecksumAsync(CancellationToken.None));
294await solution.CompilationState.GetChecksumAsync(CancellationToken.None),
295await remoteWorkspace.CurrentSolution.CompilationState.GetChecksumAsync(CancellationToken.None));
328await solution.CompilationState.GetChecksumAsync(CancellationToken.None),
329await remoteWorkspace.CurrentSolution.CompilationState.GetChecksumAsync(CancellationToken.None));
342await solution.CompilationState.GetChecksumAsync(CancellationToken.None),
343await remoteWorkspace.CurrentSolution.CompilationState.GetChecksumAsync(CancellationToken.None));
356await solution.CompilationState.GetChecksumAsync(CancellationToken.None),
357await remoteWorkspace.CurrentSolution.CompilationState.GetChecksumAsync(CancellationToken.None));
733CancellationToken.None).ConfigureAwait(false);
757Assert.Equal("// generated document 2", sourceGeneratedDocuments.Single().GetTextSynchronously(CancellationToken.None).ToString());
762Assert.Equal("// generated document 1", sourceGeneratedDocuments.Single().GetTextSynchronously(CancellationToken.None).ToString());
817CancellationToken.None).ConfigureAwait(false);
842Assert.Equal("// generated document 1", sourceGeneratedDocuments.Single().GetTextSynchronously(CancellationToken.None).ToString());
872CancellationToken.None).ConfigureAwait(false);
896Assert.Equal("// generated document 2", sourceGeneratedDocuments.Single().GetTextSynchronously(CancellationToken.None).ToString());
1428CancellationToken.None).ConfigureAwait(false);
1498CancellationToken.None).ConfigureAwait(false);
1582CancellationToken.None).ConfigureAwait(false);
1661CancellationToken.None).ConfigureAwait(false);
1787await solution.CompilationState.GetChecksumAsync(CancellationToken.None),
1788await remoteSolution.CompilationState.GetChecksumAsync(CancellationToken.None));
1869""")], CancellationToken.None);
1882using (CopilotChangeAnalysisUtilities.LogCopilotChangeAnalysis("TestCode", accepted: true, "TestProposalId", result, CancellationToken.None))
1967var map = await solution.GetAssetMapAsync(projectConeId: null, CancellationToken.None);
1985return SourceText.From(document.State.GetTextSynchronously(CancellationToken.None).ToString() + csAddition);
1988return SourceText.From(document.State.GetTextSynchronously(CancellationToken.None).ToString() + vbAddition);
2012CancellationToken.None);
Services\ServiceHubServicesTests_ExtensionMessageHandler.cs (40)
41await extensionMessageHandlerService.RegisterExtensionAsync("TempPath", CancellationToken.None);
44await extensionMessageHandlerService.RegisterExtensionAsync("TempPath", CancellationToken.None);
61await extensionMessageHandlerService.UnregisterExtensionAsync("TempPath", CancellationToken.None);
79workspace.CurrentSolution, "MessageName", "JsonMessage", CancellationToken.None);
102workspace.CurrentSolution.Projects.Single().Documents.Single(), "MessageName", "JsonMessage", CancellationToken.None);
119await extensionMessageHandlerService.GetExtensionMessageNamesAsync("TempPath", CancellationToken.None);
136await extensionMessageHandlerService.RegisterExtensionAsync("TempPath", CancellationToken.None);
138await extensionMessageHandlerService.UnregisterExtensionAsync("TempPath", CancellationToken.None);
141await extensionMessageHandlerService.GetExtensionMessageNamesAsync("TempPath", CancellationToken.None);
178await extensionMessageHandlerService.RegisterExtensionAsync("TempPath", CancellationToken.None);
181var result = await extensionMessageHandlerService.GetExtensionMessageNamesAsync("TempPath", CancellationToken.None);
207await extensionMessageHandlerService.RegisterExtensionAsync("TempPath", CancellationToken.None);
210var result = await extensionMessageHandlerService.GetExtensionMessageNamesAsync("TempPath", CancellationToken.None);
235await extensionMessageHandlerService.RegisterExtensionAsync("TempPath", CancellationToken.None);
239async () => await extensionMessageHandlerService.GetExtensionMessageNamesAsync("TempPath", CancellationToken.None));
272await extensionMessageHandlerService.RegisterExtensionAsync("TempPath", CancellationToken.None);
275var result = await extensionMessageHandlerService.GetExtensionMessageNamesAsync("TempPath", CancellationToken.None);
351"NonRegisteredHandlerName", jsonMessage: "0", CancellationToken.None);
377"HandlerName", jsonMessage: "[]", CancellationToken.None);
412"HandlerName", jsonMessage: "0", CancellationToken.None);
450"HandlerName", jsonMessage: "0", CancellationToken.None);
497"HandlerName", jsonMessage: "0", CancellationToken.None);
508"HandlerName", jsonMessage: "0", CancellationToken.None);
542"HandlerName", jsonMessage: "0", CancellationToken.None));
573"HandlerName", jsonMessage: "0", CancellationToken.None);
603await extensionMessageHandlerService.UnregisterExtensionAsync("TempPath", CancellationToken.None);
609"HandlerName", jsonMessage: "0", CancellationToken.None);
644await extensionMessageHandlerService.RegisterExtensionAsync("TempPath1", CancellationToken.None);
647await extensionMessageHandlerService.RegisterExtensionAsync("TempPath2", CancellationToken.None);
650var messageNames1 = await extensionMessageHandlerService.GetExtensionMessageNamesAsync("TempPath1", CancellationToken.None);
653var messageNames2 = await extensionMessageHandlerService.GetExtensionMessageNamesAsync("TempPath2", CancellationToken.None);
662"HandlerName", jsonMessage: "0", CancellationToken.None);
686"HandlerName", jsonMessage: "0", CancellationToken.None);
692"HandlerName", jsonMessage: "0", CancellationToken.None);
729await extensionMessageHandlerService.RegisterExtensionAsync(@"TempPath\a.dll", CancellationToken.None);
730await extensionMessageHandlerService.GetExtensionMessageNamesAsync(@"TempPath\a.dll", CancellationToken.None);
734await extensionMessageHandlerService.RegisterExtensionAsync(@"TempPath\b.dll", CancellationToken.None);
735await extensionMessageHandlerService.GetExtensionMessageNamesAsync(@"TempPath\b.dll", CancellationToken.None);
739await extensionMessageHandlerService.UnregisterExtensionAsync(@"TempPath\a.dll", CancellationToken.None);
744await extensionMessageHandlerService.UnregisterExtensionAsync(@"TempPath\b.dll", CancellationToken.None);
Services\SolutionServiceTests.cs (135)
53var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
54var synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None);
56Assert.Equal(solutionChecksum, await synched.CompilationState.GetChecksumAsync(CancellationToken.None));
68var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
71var synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch, cancellationToken: CancellationToken.None);
72Assert.Equal(solutionChecksum, await synched.CompilationState.GetChecksumAsync(CancellationToken.None));
92var solutionChecksum = await workspace.CurrentSolution.CompilationState.GetChecksumAsync(CancellationToken.None);
93var solution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None);
121var solutionChecksum = await workspace.CurrentSolution.CompilationState.GetChecksumAsync(CancellationToken.None);
122var solution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None);
144var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
146var first = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None);
147var second = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None);
444await solution1.CompilationState.GetChecksumAsync(CancellationToken.None),
446CancellationToken.None);
457var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
458await remoteWorkspace.UpdatePrimaryBranchSolutionAsync(assetProvider, solutionChecksum, CancellationToken.None);
461return await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None);
467Assert.Equal(await givenSolution.CompilationState.GetChecksumAsync(CancellationToken.None), await remoteSolution.CompilationState.GetChecksumAsync(CancellationToken.None));
481var solutionChecksum1 = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
491var solutionChecksum2 = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
507var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
508var synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None);
509Assert.Equal(solutionChecksum, await synched.CompilationState.GetChecksumAsync(CancellationToken.None));
517solutionChecksum = await frozenSolution1.CompilationState.GetChecksumAsync(CancellationToken.None);
518synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None);
519Assert.Equal(solutionChecksum, await synched.CompilationState.GetChecksumAsync(CancellationToken.None));
526solutionChecksum = await frozenSolution2.CompilationState.GetChecksumAsync(CancellationToken.None);
527synched = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None);
528Assert.Equal(solutionChecksum, await synched.CompilationState.GetChecksumAsync(CancellationToken.None));
551await solution.AppendAssetMapAsync(map, CancellationToken.None);
553var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
554var syncedFullSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None);
556Assert.Equal(solutionChecksum, await syncedFullSolution.CompilationState.GetChecksumAsync(CancellationToken.None));
560var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None);
561await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None);
562var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None);
566var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None);
567await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None);
568var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None);
592await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None);
593var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None);
594var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None);
599await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None);
600var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None);
601var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None);
605await solution.AppendAssetMapAsync(map, CancellationToken.None);
606var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
607var syncedFullSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None);
609Assert.Equal(solutionChecksum, await syncedFullSolution.CompilationState.GetChecksumAsync(CancellationToken.None));
633await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None);
634var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None);
635var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None);
640await solution.AppendAssetMapAsync(map, project3.Id, CancellationToken.None);
641var project3Checksum = await solution.CompilationState.GetChecksumAsync(project3.Id, CancellationToken.None);
642var project3SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project3Checksum, updatePrimaryBranch: false, CancellationToken.None);
667await solution.AppendAssetMapAsync(map, project3.Id, CancellationToken.None);
668var project3Checksum = await solution.CompilationState.GetChecksumAsync(project3.Id, CancellationToken.None);
669var project3SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project3Checksum, updatePrimaryBranch: false, CancellationToken.None);
673await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None);
674var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None);
675var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None);
680await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None);
681var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None);
682var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None);
709await solution.AppendAssetMapAsync(map, project3.Id, CancellationToken.None);
710var project3Checksum = await solution.CompilationState.GetChecksumAsync(project3.Id, CancellationToken.None);
711var project3SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project3Checksum, updatePrimaryBranch: false, CancellationToken.None);
715await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None);
716var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None);
717var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None);
721await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None);
722var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None);
723var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None);
749await solution.AppendAssetMapAsync(map, project3.Id, CancellationToken.None);
750var project3Checksum = await solution.CompilationState.GetChecksumAsync(project3.Id, CancellationToken.None);
751var project3SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project3Checksum, updatePrimaryBranch: false, CancellationToken.None);
755await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None);
756var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None);
757var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None);
761await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None);
762var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None);
763var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None);
787await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None);
788var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None);
789var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None);
794await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None);
795var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None);
796var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None);
820await solution.AppendAssetMapAsync(map, CancellationToken.None);
821var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
822var fullSyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None);
832await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None);
833var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None);
834var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None);
844await solution.AppendAssetMapAsync(map, project2.Id, CancellationToken.None);
845var project2Checksum = await solution.CompilationState.GetChecksumAsync(project2.Id, CancellationToken.None);
846var project2SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project2Checksum, updatePrimaryBranch: false, CancellationToken.None);
875await solution.AppendAssetMapAsync(map, CancellationToken.None);
876var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
877var fullSyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None);
888await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None);
889var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None);
890var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None);
921var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None);
944await solution.AppendAssetMapAsync(map, CancellationToken.None);
945var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
946var fullSyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: true, CancellationToken.None);
957await solution.AppendAssetMapAsync(map, project1.Id, CancellationToken.None);
958var project1Checksum = await solution.CompilationState.GetChecksumAsync(project1.Id, CancellationToken.None);
959var project1SyncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, project1Checksum, updatePrimaryBranch: false, CancellationToken.None);
1103var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
1104var syncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None);
1132var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
1133var syncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch, CancellationToken.None);
1159var checksumUpdater = new SolutionChecksumUpdater(workspace, listenerProvider, CancellationToken.None);
1163var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
1164var syncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch, CancellationToken.None);
1213var checksumUpdater = new SolutionChecksumUpdater(workspace, listenerProvider, CancellationToken.None);
1217var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
1218var syncedSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch, CancellationToken.None);
1278var solutionChecksum = await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
1281await remoteWorkspace.UpdatePrimaryBranchSolutionAsync(assetProvider, solutionChecksum, CancellationToken.None);
1282var recoveredSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, solutionChecksum, updatePrimaryBranch: false, CancellationToken.None);
1286Assert.Equal(solutionChecksum, await recoveredSolution.CompilationState.GetChecksumAsync(CancellationToken.None));
1290var newSolutionChecksum = await newSolution.CompilationState.GetChecksumAsync(CancellationToken.None);
1291await newSolution.AppendAssetMapAsync(map, CancellationToken.None);
1294var recoveredNewSolution = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, newSolutionChecksum, updatePrimaryBranch: false, CancellationToken.None);
1296Assert.Equal(newSolutionChecksum, await recoveredNewSolution.CompilationState.GetChecksumAsync(CancellationToken.None));
1299await remoteWorkspace.UpdatePrimaryBranchSolutionAsync(assetProvider, newSolutionChecksum, CancellationToken.None);
1300var third = await remoteWorkspace.GetTestAccessor().GetSolutionAsync(assetProvider, newSolutionChecksum, updatePrimaryBranch: false, CancellationToken.None);
1302Assert.Equal(newSolutionChecksum, await third.CompilationState.GetChecksumAsync(CancellationToken.None));
1310await solution.CompilationState.GetChecksumAsync(CancellationToken.None);
1313await solution.AppendAssetMapAsync(map, CancellationToken.None);
Security.TransportSecurity.IntegrationTests (2)
SemanticSearch.BuildTask (2)
System.Collections.Concurrent (16)
System\Collections\Concurrent\BlockingCollection.cs (16)
255TryAddWithNoTimeValidation(item, Timeout.Infinite, CancellationToken.None);
304return TryAddWithNoTimeValidation(item, 0, CancellationToken.None);
328return TryAddWithNoTimeValidation(item, (int)timeout.TotalMilliseconds, CancellationToken.None);
350return TryAddWithNoTimeValidation(item, millisecondsTimeout, CancellationToken.None);
513if (!TryTake(out item, Timeout.Infinite, CancellationToken.None))
557return TryTake(out item, 0, CancellationToken.None);
580return TryTakeWithNoTimeValidation(out item, (int)timeout.TotalMilliseconds, CancellationToken.None, null);
601return TryTakeWithNoTimeValidation(out item, millisecondsTimeout, CancellationToken.None, null);
765TryAddToAny(collections, item, Timeout.Infinite, CancellationToken.None);
835return TryAddToAny(collections, item, 0, CancellationToken.None);
865return TryAddToAnyCore(collections, item, (int)timeout.TotalMilliseconds, CancellationToken.None);
892return TryAddToAnyCore(collections, item, millisecondsTimeout, CancellationToken.None);
1138return TakeFromAny(collections, out item, CancellationToken.None);
1227return TryTakeFromAnyCore(collections, out item, (int)timeout.TotalMilliseconds, false, CancellationToken.None);
1257return TryTakeFromAnyCore(collections, out item, millisecondsTimeout, false, CancellationToken.None);
1600return GetConsumingEnumerable(CancellationToken.None);
System.ComponentModel.EventBasedAsync (1)
System.Data.Common (12)
System.Diagnostics.Process (2)
System.Formats.Tar (8)
System.IO.Compression (6)
System\IO\Compression\DeflateZLib\DeflateStream.cs (3)
394TaskToAsyncResult.Begin(ReadAsync(buffer, offset, count, CancellationToken.None), asyncCallback, asyncState);
801TaskToAsyncResult.Begin(WriteAsync(buffer, offset, count, CancellationToken.None), asyncCallback, asyncState);
915this(deflateStream, destination, bufferSize, CancellationToken.None)
System\IO\Compression\GZipStream.cs (2)
87TaskToAsyncResult.Begin(ReadAsync(buffer, offset, count, CancellationToken.None), asyncCallback, asyncState);
115TaskToAsyncResult.Begin(WriteAsync(buffer, offset, count, CancellationToken.None), asyncCallback, asyncState);
System.IO.Compression.Brotli (8)
System.IO.Hashing (1)
System.IO.Pipelines (6)
System.IO.Pipes (6)
System\IO\Pipes\PipeStream.Unix.cs (2)
106=> TaskToAsyncResult.Begin(ReadAsync(buffer, offset, count, CancellationToken.None), callback, state);
180=> TaskToAsyncResult.Begin(WriteAsync(buffer, offset, count, CancellationToken.None), callback, state);
System.IO.Ports (3)
System.Linq.AsyncEnumerable (97)
System.Linq.Expressions (1)
System.Linq.Parallel (2)
System.Net.Http (39)
System\Net\Http\HttpClient.cs (10)
163GetStringAsync(requestUri, CancellationToken.None);
235GetByteArrayAsync(requestUri, CancellationToken.None);
313GetStreamAsync(requestUri, CancellationToken.None);
366GetAsync(requestUri, completionOption, CancellationToken.None);
384PostAsync(requestUri, content, CancellationToken.None);
400PutAsync(requestUri, content, CancellationToken.None);
416PatchAsync(requestUri, content, CancellationToken.None);
432DeleteAsync(requestUri, CancellationToken.None);
497SendAsync(request, DefaultCompletionOption, CancellationToken.None);
503SendAsync(request, completionOption, CancellationToken.None);
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (10)
174}, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
497}, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Current);
499await _clientControl.WriteAsync(_pool.Settings.Http3SettingsFrame, CancellationToken.None).ConfigureAwait(false);
549streamTask = _connection!.AcceptInboundStreamAsync(CancellationToken.None);
598bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
674bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
808bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
841bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
892bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
921int bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
System.Net.Http.Json (1)
System.Net.HttpListener (1)
System.Net.Mail (2)
System\Net\DelegatedStream.cs (2)
61return TaskToAsyncResult.Begin(ReadAsync(buffer, offset, count, CancellationToken.None), callback, state);
70return TaskToAsyncResult.Begin(WriteAsync(buffer, offset, count, CancellationToken.None), callback, state);
System.Net.NameResolution (7)
System\Net\Dns.cs (7)
95GetHostEntryAsync(hostNameOrAddress, AddressFamily.Unspecified, CancellationToken.None);
143}, hostNameOrAddress, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
170}, address, CancellationToken.None);
225(Task<IPAddress[]>)GetHostEntryOrAddressesCoreAsync(hostNameOrAddress, justReturnParsedIp: true, throwOnIIPAny: true, justAddresses: true, AddressFamily.Unspecified, CancellationToken.None);
279TaskToAsyncResult.Begin(GetHostEntryCoreAsync(hostName, justReturnParsedIp: true, throwOnIIPAny: true, AddressFamily.Unspecified, CancellationToken.None), requestCallback, stateObject);
348TaskToAsyncResult.Begin(GetHostEntryCoreAsync(hostName, justReturnParsedIp: false, throwOnIIPAny: false, AddressFamily.Unspecified, CancellationToken.None), requestCallback, stateObject);
778}, key, CancellationToken.None, TaskContinuationOptions.OnlyOnCanceled | TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
System.Net.NetworkInformation (1)
System.Net.Ping (5)
System\Net\NetworkInformation\Ping.cs (5)
530}, AsyncOperationManager.CreateOperation(userToken), CancellationToken.None, TaskContinuationOptions.DenyChildAttach, TaskScheduler.Default);
565return SendPingAsync(address, timeout, buffer, options, CancellationToken.None);
581/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param>
605return SendPingAsync(hostNameOrAddress, timeout, buffer, options, CancellationToken.None);
624/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param>
System.Net.Quic (2)
System.Net.Requests (6)
System\Net\FileWebRequest.cs (4)
161this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
174}, this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
222this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
235}, this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
System.Net.Security (4)
System\Net\Security\SslStream.cs (4)
254return BeginAuthenticateAsClient(options, CancellationToken.None, asyncCallback, asyncState);
293return BeginAuthenticateAsServer(options, CancellationToken.None, asyncCallback, asyncState);
847return TaskToAsyncResult.Begin(ReadAsync(buffer, offset, count, CancellationToken.None), asyncCallback, asyncState);
859return TaskToAsyncResult.Begin(WriteAsync(buffer, offset, count, CancellationToken.None), asyncCallback, asyncState);
System.Net.Sockets (6)
System.Net.WebSockets (5)
System.Private.CoreLib (40)
src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (2)
728TaskToAsyncResult.Begin(ReadAsync(buffer, offset, count, CancellationToken.None), callback, state);
1141TaskToAsyncResult.Begin(WriteAsync(buffer, offset, count, CancellationToken.None), callback, state);
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (2)
459=> TaskToAsyncResult.Begin(ReadAsync(buffer, offset, count, CancellationToken.None), callback, state);
742=> TaskToAsyncResult.Begin(WriteAsync(buffer, offset, count, CancellationToken.None), callback, state);
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (5)
81public Task CopyToAsync(Stream destination, int bufferSize) => CopyToAsync(destination, bufferSize, CancellationToken.None);
189public Task FlushAsync() => FlushAsync(CancellationToken.None);
301public Task<int> ReadAsync(byte[] buffer, int offset, int count) => ReadAsync(buffer, offset, count, CancellationToken.None);
657base(function, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach)
721public Task WriteAsync(byte[] buffer, int offset, int count) => WriteAsync(buffer, offset, count, CancellationToken.None);
src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (7)
543}, new TupleSlim<TextWriter, char>(this, value), CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
550}, new TupleSlim<TextWriter, string?>(this, value), CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
589}, new TupleSlim<TextWriter, char[], int, int>(this, buffer, index, count), CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
606}, new TupleSlim<TextWriter, char>(this, value), CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
613}, new TupleSlim<TextWriter, string?>(this, value), CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
653}, new TupleSlim<TextWriter, char[], int, int>(this, buffer, index, count), CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
673CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (2)
86=> TaskToAsyncResult.Begin(ReadAsync(buffer, offset, count, CancellationToken.None), callback, state);
89=> TaskToAsyncResult.Begin(WriteAsync(buffer, offset, count, CancellationToken.None), callback, state);
System.Security.Cryptography (64)
System\Security\Cryptography\CryptoStream.cs (3)
125/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param>
252TaskToAsyncResult.Begin(ReadAsync(buffer, offset, count, CancellationToken.None), callback, state);
491TaskToAsyncResult.Begin(WriteAsync(buffer, offset, count, CancellationToken.None), callback, state);
System.Security.Cryptography.Cose (7)
System.ServiceModel.Federation (5)
System\Runtime\TaskHelpers.cs (4)
33}, callback, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default);
63}, continuationState, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default);
87}, callback, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default);
119}, continuationState, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default);
System.ServiceModel.Http (4)
System.ServiceModel.Primitives (12)
Internals\System\Runtime\TaskHelpers.cs (4)
48}, callback, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default);
78}, continuationState, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default);
102}, callback, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default);
134}, continuationState, CancellationToken.None, TaskContinuationOptions.HideScheduler, TaskScheduler.Default);
System.ServiceModel.Primitives.Tests (1)
System.Text.RegularExpressions (11)
System\Threading\StackHelper.cs (11)
40.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
51.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
64.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
79.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
96.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
115.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
123.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
133.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
145.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
159.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
175.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
System.Text.RegularExpressions.Generator (11)
src\libraries\System.Text.RegularExpressions\src\System\Threading\StackHelper.cs (11)
40.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
51.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
64.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
79.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
96.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
115.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
123.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
133.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
145.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
159.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
175.ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default)
System.Threading (6)
System.Threading.Channels (2)
System.Threading.Tasks.Dataflow (57)
Base\DataflowBlock.cs (17)
261return SendAsync<TInput>(target, item, CancellationToken.None);
513CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
527CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
788return ReceiveAsync(source, Common.InfiniteTimeSpan, CancellationToken.None);
825return ReceiveAsync(source, timeout, CancellationToken.None);
866return Receive(source, Common.InfiniteTimeSpan, CancellationToken.None);
905return Receive(source, timeout, CancellationToken.None);
1296}, this, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default);
1307}, this, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default);
1328}, this, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default);
1384return OutputAvailableAsync<TOutput>(source, CancellationToken.None);
1889CancellationToken.None, Common.GetCreationOptionsForTask(), scheduler);
1923CancellationTokenSource cts = CancellationTokenSource.CreateLinkedTokenSource(dataflowBlockOptions.CancellationToken, CancellationToken.None);
1988}, CancellationToken.None, Common.GetContinuationOptions(), TaskScheduler.Default);
2057}, CancellationToken.None, Common.GetContinuationOptions(), scheduler);
2386CancellationToken.None,
2399CancellationToken.None,
Blocks\BatchBlock.cs (4)
75CancellationToken.None, Common.GetContinuationOptions(), TaskScheduler.Default);
86}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default);
547}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
655exception, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
Blocks\BroadcastBlock.cs (6)
93}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default);
271exception, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
404}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
650}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
864}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
947this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
Blocks\BufferBlock.cs (3)
75}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default);
272exception, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
407}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
Blocks\JoinBlock.cs (5)
86CancellationToken.None, Common.GetContinuationOptions(), TaskScheduler.Default);
97}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default);
305CancellationToken.None, Common.GetContinuationOptions(), TaskScheduler.Default);
316}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default);
1335}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
Blocks\TransformBlock.cs (3)
145}, _source, CancellationToken.None, Common.GetContinuationOptions(), TaskScheduler.Default);
156}, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default);
261}, Tuple.Create(this, messageWithId), CancellationToken.None,
Internal\SourceCore.cs (3)
523}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
786}, this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
920this, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
System.Threading.Tasks.Parallel (3)
System.Windows.Forms.Tests (2)
Test.Utilities (24)
TestDiscoveryWorker (1)
Text.Analyzers (23)
VBCSCompiler (2)
VBCSCompiler.UnitTests (4)
Wasm.Performance.Driver (1)
WebSocketSample (5)
WebTransportInteractiveSampleApp (2)
WebTransportSampleApp (3)