548 references to Single
Aspire.Dashboard.Tests (4)
Integration\FrontendBrowserTokenAuthTests.cs (2)
101var log = testSink.Writes.Single(s => s.LoggerName == typeof(FrontendCompositeAuthenticationHandler).FullName && s.EventId.Name == "AuthenticationSchemeNotAuthenticatedWithFailure"); 235var loginLinkLog = l.Single(w => "Login to the dashboard at {DashboardLoginUrl}" == (string?)GetValue(w.State, "{OriginalFormat}"));
Integration\FrontendOpenIdConnectAuthTests.cs (1)
90var log = testSink.Writes.Single(s => s.LoggerName == typeof(FrontendCompositeAuthenticationHandler).FullName && s.EventId.Name == "AuthenticationSchemeNotAuthenticatedWithFailure");
TelemetryRepositoryTests\MetricsTests.cs (1)
386var dimension = instrumentData.Dimensions.Single(d => d.Attributes.Length == 0);
Aspire.EndToEnd.Tests (2)
tests\Shared\WorkloadTesting\ProjectInfo.cs (2)
22var allocatedEndpoint = Endpoints.Single(e => e.Name == bindingName); 33var allocatedEndpoint = Endpoints.Single(e => e.Name == bindingName);
Aspire.Hosting.Azure.AppContainers (1)
ContainerAppExtensions.cs (1)
65var containerAppManagedEnvironmentIdParameter = module.GetProvisionableResources().OfType<ProvisioningParameter>().Single(
Aspire.Hosting.Azure.Tests (9)
AzureEventHubsExtensionsTests.cs (4)
109var volumeAnnotation = eventHubs.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(a => !a.Target.Contains("Config.json")); 126var volumeAnnotation = eventHubs.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(a => !a.Target.Contains("Config.json")); 143var volumeAnnotation = eventHubs.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(a => !a.Target.Contains("Config.json")); 160var volumeAnnotation = eventHubs.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(a => !a.Target.Contains("Config.json"));
AzurePostgresExtensionsTests.cs (2)
372var postgresResourceInModel = builder.Resources.Single(r => r.Name == "postgres-data"); 373var dbResourceInModel = builder.Resources.Single(r => r.Name == "db1");
AzureRedisExtensionsTests.cs (1)
181var cacheInModel = builder.Resources.Single(r => r.Name == "cache");
AzureSqlExtensionsTests.cs (2)
220var sqlResourceInModel = builder.Resources.Single(r => r.Name == "sql"); 221var dbResourceInModel = builder.Resources.Single(r => r.Name == "db1");
Aspire.Hosting.Milvus.Tests (1)
AddMilvusTests.cs (1)
198var grpcEndpoint = milvusResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc");
Aspire.Hosting.MySql.Tests (3)
AddMySqlTests.cs (3)
245var myAdmin = builder.Resources.Single(r => r.Name.EndsWith("-phpmyadmin")); 260var container = builder.Resources.Single(r => r.Name == "mySql-phpmyadmin"); 278var myAdmin = builder.Resources.Single(r => r.Name.EndsWith("-phpmyadmin"));
Aspire.Hosting.PostgreSQL.Tests (5)
AddPostgresTests.cs (5)
380var container = builder.Resources.Single(r => r.Name == "mypostgres-pgadmin"); 435var container = builder.Resources.Single(r => r.Name == "mypostgres-pgadmin"); 448builder.Resources.Single(r => r.Name.EndsWith("-pgadmin")); 463var pgadmin = builder.Resources.Single(r => r.Name.EndsWith("-pgadmin")); 510var pgadmin = builder.Resources.Single(r => r.Name.EndsWith("-pgweb"));
Aspire.Hosting.Qdrant.Tests (2)
AddQdrantTests.cs (2)
294var grpcEndpoint = qdrantResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc"); 302var httpEndpoint = qdrantResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "http");
Aspire.Hosting.Redis.Tests (2)
AddRedisTests.cs (2)
218var commander = builder.Resources.Single(r => r.Name.EndsWith("-commander")); 242var commander = builder.Resources.Single(r => r.Name.EndsWith("-commander"));
Aspire.Hosting.Testing (1)
DistributedApplicationFactory.cs (1)
393var hostDescriptor = applicationBuilder.Services.Single(s => s.ServiceType == typeof(IHost) && s.ServiceKey is null);
Aspire.Hosting.Tests (19)
AddParameterTests.cs (4)
151var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "pass")).DefaultTimeout(); 201var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "pass")).DefaultTimeout(); 259var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "pass")).DefaultTimeout(); 314var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "val")).DefaultTimeout();
Dcp\ApplicationExecutorTests.cs (14)
124var svc = kubernetesService.CreatedResources.OfType<Service>().Single(s => s.Name() == "CoolProgram"); 156var svc = kubernetesService.CreatedResources.OfType<Service>().Single(s => s.Name() == "CoolProgram"); 188var svc = kubernetesService.CreatedResources.OfType<Service>().Single(s => s.Name() == "CoolProgram"); 221var svc = kubernetesService.CreatedResources.OfType<Service>().Single(s => s.Name() == "CoolProgram"); 277var svc = kubernetesService.CreatedResources.OfType<Service>().Single(s => s.Name() == "CoolProgram"); 311var svc = kubernetesService.CreatedResources.OfType<Service>().Single(s => s.Name() == "CoolProgram"); 345var svc = kubernetesService.CreatedResources.OfType<Service>().Single(s => s.Name() == "CoolProgram"); 676var svc = kubernetesService.CreatedResources.OfType<Service>().Single(s => s.Name() == "ServiceA-NoPortNoTargetPort"); 721var svc = kubernetesService.CreatedResources.OfType<Service>().Single(s => s.Name() == "ServiceA-PortSetNoTargetPort"); 754var svc = kubernetesService.CreatedResources.OfType<Service>().Single(s => s.Name() == "database"); 789var svc = kubernetesService.CreatedResources.OfType<Service>().Single(s => s.Name() == "database"); 869var svc = kubernetesService.CreatedResources.OfType<Service>().Single(s => s.Name() == "database"); 905var svc = kubernetesService.CreatedResources.OfType<Service>().Single(s => s.Name() == "database"); 942var svc = kubernetesService.CreatedResources.OfType<Service>().Single(s => s.Name() == "database");
ResourceCommandAnnotationTests.cs (1)
43var startCommand = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == commandName);
Aspire.Workload.Tests (2)
tests\Shared\WorkloadTesting\ProjectInfo.cs (2)
22var allocatedEndpoint = Endpoints.Single(e => e.Name == bindingName); 33var allocatedEndpoint = Endpoints.Single(e => e.Name == bindingName);
BoundTreeGenerator (1)
BoundNodeClassWriter.cs (1)
724return _tree.Types.Single(t => t.Name == name);
CdkSample.AppHost (3)
Program.cs (3)
57var queue = infrastructure.GetProvisionableResources().OfType<ServiceBusQueue>().Single(q => q.BicepIdentifier == "queue1"); 64var topic = infrastructure.GetProvisionableResources().OfType<ServiceBusTopic>().Single(q => q.BicepIdentifier == "topic1"); 71var subscription = infrastructure.GetProvisionableResources().OfType<ServiceBusSubscription>().Single(q => q.BicepIdentifier == "subscription1");
CSharpSyntaxGenerator (1)
AbstractFileWriter.cs (1)
385}).Single(f => f.Name == field.Name);
dotnet-dev-certs (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
839.Single(c => c.SerialNumber == certificate.SerialNumber);
IdeCoreBenchmarks (2)
IncrementalSourceGeneratorBenchmarks.cs (2)
145var project = _workspace.CurrentSolution.Projects.Single(p => p.Name == "Microsoft.CodeAnalysis.Workspaces(netstandard2.0)"); 158var syntaxTree = compilation.SyntaxTrees.Single(t => t.FilePath.Contains("AbstractCaseCorrectionService"));
IIS.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestPathBaseTests.cs (1)
101var length = int.Parse(headers.Single(h => h.StartsWith("Content-Length: ", StringComparison.Ordinal))["Content-Length: ".Length..], CultureInfo.InvariantCulture);
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (1)
809var length = int.Parse(headers.Single(h => h.StartsWith("Content-Length: ", StringComparison.Ordinal)).Substring("Content-Length: ".Length), CultureInfo.InvariantCulture);
IISExpress.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestPathBaseTests.cs (1)
101var length = int.Parse(headers.Single(h => h.StartsWith("Content-Length: ", StringComparison.Ordinal))["Content-Length: ".Length..], CultureInfo.InvariantCulture);
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (1)
809var length = int.Parse(headers.Single(h => h.StartsWith("Content-Length: ", StringComparison.Ordinal)).Substring("Content-Length: ".Length), CultureInfo.InvariantCulture);
InMemory.FunctionalTests (2)
Http2\Http2ConnectionTests.cs (2)
5308var logMessage = LogMessages.Single(m => m.EventId == 20); 5326var logMessage = LogMessages.Single(m => m.LogLevel >= LogLevel.Information);
Interop.FunctionalTests (10)
Http2\Http2RequestTests.cs (7)
78Assert.Equal("http", (string)tags.Single(t => t.Key == "network.protocol.name").Value); 79Assert.Equal("2", (string)tags.Single(t => t.Key == "network.protocol.version").Value); 80Assert.Equal("tcp", (string)tags.Single(t => t.Key == "network.transport").Value); 81Assert.Equal("ipv4", (string)tags.Single(t => t.Key == "network.type").Value); 82Assert.Equal("127.0.0.1", (string)tags.Single(t => t.Key == "server.address").Value); 83Assert.Equal(host.GetPort(), (int)tags.Single(t => t.Key == "server.port").Value); 84Assert.Equal("invalid_handshake", (string)tags.Single(t => t.Key == "error.type").Value);
Http3\Http3RequestTests.cs (3)
917var request1Headers = requestHeaders.Single(i => i["id"] == "1"); 930var request2Headers = requestHeaders.Single(i => i["id"] == "2"); 946var request3Headers = requestHeaders.Single(i => i["id"] == "3");
IOperationGenerator (1)
IOperationClassWriter.cs (1)
615var baseProp = baseProperties.Single(p => p.Name == prop.Name);
Microsoft.AspNetCore.App.Analyzers.Test (1)
TestData.cs (1)
15=> typeof(TestData).Assembly.GetCustomAttributes<TestDataAttribute>().Single(d => d.Key == key).Value;
Microsoft.AspNetCore.App.UnitTests (1)
TestData.cs (1)
349=> typeof(TestData).Assembly.GetCustomAttributes<TestDataAttribute>().Single(d => d.Key == key).Value;
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
52.Single(c => c.GetParameters().First().ParameterType == typeof(ConsoleSpecialKey));
Microsoft.AspNetCore.Authentication.Test (2)
BearerTokenTests.cs (1)
18return services.Select(d => d.ServiceType).Single(typeof(AuthenticationHandler<BearerTokenOptions>).IsAssignableFrom);
OpenIdConnect\OpenIdConnectChallengeTests.cs (1)
322var actual = res.Headers.Location.Query.Trim('?').Split('&').Single(seg => seg.StartsWith($"{OpenIdConnectParameterNames.ClientId}=", StringComparison.Ordinal));
Microsoft.AspNetCore.Components.Tests (21)
CascadingParameterTest.cs (1)
900var componentFrame = batch.ReferenceFrames.Single(
RendererTest.cs (20)
75.Single(frame => frame.FrameType == RenderTreeFrameType.Component); 144.Single(frame => frame.FrameType == RenderTreeFrameType.Component); 799.Single(frame => frame.FrameType == RenderTreeFrameType.Component); 971.Single(frame => frame.FrameType == RenderTreeFrameType.Component); 2049.Single(frame => frame.FrameType == RenderTreeFrameType.Component); 2090.Single(frame => frame.FrameType == RenderTreeFrameType.Component); 2126.Single(frame => frame.FrameType == RenderTreeFrameType.Component) 2164.Single(frame => frame.FrameType == RenderTreeFrameType.Component) 2204.Single(frame => frame.FrameType == RenderTreeFrameType.Component) 2651.Single(f => f.AttributeEventHandlerId != 0) 2685.Single(f => f.AttributeEventHandlerId != 0) 2727.Single(f => f.AttributeEventHandlerId != 0) 2778.Single(f => f.AttributeEventHandlerId != 0) 2813.Single(f => f.AttributeEventHandlerId != 0) 2860.Single(f => f.Component is EventComponent); 3058.Single(f => f.AttributeEventHandlerId != 0) 4220.Single(frame => frame.FrameType == RenderTreeFrameType.Component); 4669.Single(f => f.FrameType == RenderTreeFrameType.Attribute && f.AttributeName == "onmakeerror") 4708.Single(f => f.FrameType == RenderTreeFrameType.Attribute && f.AttributeName == "onmakeerror") 4757.Single(f => f.FrameType == RenderTreeFrameType.Attribute && f.AttributeName == "onmakeerror")
Microsoft.AspNetCore.Components.Web.Tests (1)
Forms\InputNumberTest.cs (1)
88var typeAttributeFrame = frames.Array.Single(frame =>
Microsoft.AspNetCore.DeveloperCertificates.XPlat (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
839.Single(c => c.SerialNumber == certificate.SerialNumber);
Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests (7)
CertificateManagerTests.cs (7)
143var httpsCertificate = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject); 175var httpsCertificate = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject); 208var httpsCertificate = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject); 239var httpsCertificate = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject); 272var httpsCertificate = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject); 299var httpsCertificate = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject); 339var httpsCertificate = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject);
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (10)
JsonTranscodingServiceMethodProviderTests.cs (2)
117var write = testSink.Writes.Single(w => 124if ((string)values.Single(v => v.Key == "MethodName").Value! != "SayHello")
ServerStreamingServerCallHandlerTests.cs (3)
119var exceptionWrite = TestSink.Writes.Single(w => w.EventId.Name == "ErrorExecutingServiceMethod"); 161var exceptionWrite = TestSink.Writes.Single(w => w.EventId.Name == "RpcConnectionError"); 198var exceptionWrite = TestSink.Writes.Single(w => w.EventId.Name == "ErrorExecutingServiceMethod");
ServiceDescriptorHelpersTests.cs (1)
15var method = HelloService.Descriptor.Methods.Single(m => m.Name == "Say");
UnaryServerCallHandlerTests.cs (4)
869var exceptionWrite = TestSink.Writes.Single(w => w.EventId.Name == "RpcConnectionError"); 1056var exceptionWrite = TestSink.Writes.Single(w => w.EventId.Name == "ErrorExecutingServiceMethod"); 1086var exceptionWrite = TestSink.Writes.Single(w => w.EventId.Name == "ErrorExecutingServiceMethod"); 1626var exceptionWrite = TestSink.Writes.Single(w => w.EventId.Name == "RpcConnectionError");
Microsoft.AspNetCore.Http.Extensions.Tests (4)
PropertyAsParameterInfoTests.cs (1)
183return parameters.Single(p => p.Name.Equals(parameterName, StringComparison.OrdinalIgnoreCase));
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
355.GetCustomAttributes<AssemblyMetadataAttribute>().Single(d => d.Key == "RequestDelegateGeneratorTestBaselines").Value;
RequestDelegateGenerator\RequestDelegateCreationTests.Metadata.cs (2)
152_ = endpoint.Metadata.OfType<CustomMetadata>().Single(m => m.Value == 42); 153_ = endpoint.Metadata.OfType<CustomMetadata>().Single(m => m.Value == 24);
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
355.GetCustomAttributes<AssemblyMetadataAttribute>().Single(d => d.Key == "RequestDelegateGeneratorTestBaselines").Value;
Microsoft.AspNetCore.Http.Tests (1)
DefaultHttpContextTests.cs (1)
339.Single(f =>
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
DbUtil.cs (1)
46foreach (var property in context.Model.GetEntityTypes().Single(e => e.GetTableName() == table).GetProperties())
Microsoft.AspNetCore.Identity.FunctionalTests (6)
ManagementTests.cs (5)
172Assert.NotNull(principals[1].Identities.Single().Claims.Single(c => c.Type == ClaimTypes.AuthenticationMethod).Value); 367var expectedPrincipalClaim = expectedPrincipal.Identities.Single().Claims.Single(c => c.Type == claimType).Value; 368var actualPrincipalClaim = actualPrincipal.Identities.Single().Claims.Single(c => c.Type == claimType).Value; 374var expectedPrincipalClaim = expectedPrincipal.Identities.Single().Claims.Single(c => c.Type == claimType).Value; 375var actualPrincipalClaim = actualPrincipal.Identities.Single().Claims.Single(c => c.Type == claimType).Value;
MapIdentityApiTests.cs (1)
1356=> claims.EnumerateArray().Single(e => e.GetProperty("type").GetString() == name).GetProperty("value").GetString();
Microsoft.AspNetCore.Identity.Test (1)
IdentityUIScriptsTest.cs (1)
165.Single(a => a.Key == "Microsoft.AspNetCore.InternalTesting.DefaultUIProjectPath").Value;
Microsoft.AspNetCore.Mvc.Core.Test (1)
ApplicationModels\ControllerActionDescriptorProviderTests.cs (1)
45var descriptor = descriptors.Single(ad => ad.ActionName == nameof(PersonController.GetPerson));
Microsoft.AspNetCore.Mvc.IntegrationTests (2)
ActionParametersIntegrationTest.cs (2)
973.Single(p => p.Name.Equals(parameterName, StringComparison.Ordinal)); 996.Single(p => p.Name.Equals(parameterName, StringComparison.Ordinal));
Microsoft.AspNetCore.Server.Kestrel.Core (1)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
839.Single(c => c.SerialNumber == certificate.SerialNumber);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (3)
HeartbeatTests.cs (2)
136var warningMessage = TestSink.Writes.Single(message => message.LogLevel == LogLevel.Warning).Message; 197Assert.Equal(ex, TestSink.Writes.Single(message => message.LogLevel == LogLevel.Error).Exception);
KestrelServerTests.cs (1)
152var warning = testLogger.Messages.Single(log => log.LogLevel == LogLevel.Warning);
Microsoft.AspNetCore.Shared.Tests (6)
PropertyHelperTest.cs (6)
491.Single(p => p.Name == nameof(BaseClass.PropA)); 505.Single(p => p.Name == nameof(MyProperties.StringProp)); 519.Single(p => p.Name == nameof(BaseClass.PropA)); 536.Single(p => p.Name == nameof(MyProperties.StringProp)); 553.Single(p => p.Name == nameof(BaseClass.PropA)); 570.Single(p => p.Name == nameof(MyProperties.StringProp));
Microsoft.AspNetCore.SignalR.Client.Core (2)
HubConnection.cs (2)
71private static readonly MethodInfo _sendStreamItemsMethod = typeof(HubConnection).GetMethods(BindingFlags.NonPublic | BindingFlags.Instance).Single(m => m.Name.Equals(nameof(SendStreamItems))); 72private static readonly MethodInfo _sendIAsyncStreamItemsMethod = typeof(HubConnection).GetMethods(BindingFlags.NonPublic | BindingFlags.Instance).Single(m => m.Name.Equals(nameof(SendIAsyncEnumerableStreamItems)));
Microsoft.AspNetCore.SignalR.Client.Tests (6)
HubConnectionTests.Tracing.cs (6)
47Assert.Equal("example.com", clientActivity.TagObjects.Single(t => t.Key == "server.address").Value); 159Assert.Equal("example.net", clientActivity.TagObjects.Single(t => t.Key == "server.address").Value); 199Assert.Equal("example.com", clientActivity.TagObjects.Single(t => t.Key == "server.address").Value); 200Assert.Equal(80, (int)clientActivity.TagObjects.Single(t => t.Key == "server.port").Value); 209Assert.Equal("example.net", clientActivity.TagObjects.Single(t => t.Key == "server.address").Value); 210Assert.Equal(5050, (int)clientActivity.TagObjects.Single(t => t.Key == "server.port").Value);
Microsoft.AspNetCore.SignalR.Core (3)
Internal\HubMethodDescriptor.cs (2)
22.Single(m => m.Name.Equals(nameof(AsyncEnumerableAdapters.MakeAsyncEnumerator)) && m.IsGenericMethod); 26.Single(m => m.Name.Equals(nameof(AsyncEnumerableAdapters.MakeAsyncEnumeratorFromChannel)) && m.IsGenericMethod);
StreamTracker.cs (1)
17private static readonly MethodInfo _buildConverterMethod = typeof(StreamTracker).GetMethods(BindingFlags.NonPublic | BindingFlags.Static).Single(m => m.Name.Equals(nameof(BuildStream)));
Microsoft.AspNetCore.SignalR.Tests (1)
HubConnectionHandlerTestUtils\Hubs.cs (1)
977_knownTypes.Single(type => type.Name == typeName);
Microsoft.Build.Engine.OM.UnitTests (3)
Construction\ProjectFormatting_Tests.cs (2)
286var itemToRemove = project.GetItems("Compile").Single(item => item.EvaluatedInclude == "Class2.cs"); 325var itemToEdit = project.GetItems("Compile").Single(item => item.EvaluatedInclude == "Class2.cs");
Definition\ProjectItem_Tests.cs (1)
3759var itemB = projectInstance.Items.Single(i => i.ItemType == "B").EvaluatedInclude;
Microsoft.Build.Engine.UnitTests (7)
Graph\ProjectGraph_Tests.cs (7)
868ProjectGraphNode project1Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project1Path); 874ProjectGraphNode project2Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project2Path); 880ProjectGraphNode project3Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project3Path); 887ProjectGraphNode project4Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project4Path); 893ProjectGraphNode project5Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project5Path); 899ProjectGraphNode project6Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project6Path); 907ProjectGraphNode project8Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project8Path);
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (1)
TargetTests.cs (1)
917.Single(a => a.Key == "CurrentCompilerApiVersion")
Microsoft.CodeAnalysis (1)
CodeGen\CompilationTestData.cs (1)
60return Methods.Single(p => predicate(p.Key)).Value.ILBuilder;
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
80.Single(m => containingType.Equals(m.Parameters.FirstOrDefault()?.Type));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (2)
224.Single(c => c.HasAnnotation(annotation)); 238currentNodeOrToken = newRoot.DescendantNodes().Single(c => c.HasAnnotation(marker));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
76var otherAccessor = currentAccessorList.Accessors.Single(a => a != currentAccessor);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (62)
CodeActions\ApplyChangesOperationTests.cs (10)
79var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 84var document2 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program2")); 111var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 116var document2 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program2")); 143var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 148var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 174var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 179var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 206var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 211var document2 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program2"));
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (1)
146var dependentProject = workspace.Projects.Single(proj => proj.Id != project.Id);
CodeGeneration\SyntaxGeneratorTests.cs (2)
42var statement = root.DescendantNodes().Single(n => n is ReturnStatementSyntax); 76var statement = root.DescendantNodes().Single(n => n is ReturnStatementSyntax);
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (6)
2464var testDocument = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument"); 2469var documentId = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument").Id; 2717var testDocument = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument2"); 2722var documentId = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument2").Id; 2772var testDocument = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument"); 2777var documentId = testWorkspace.Documents.Single(d => d.Name == "CSharpDocument").Id;
EditAndContinue\ActiveStatementTrackingServiceTests.cs (2)
65var document1 = project.Documents.Single(d => d.Name == "1.cs"); 66var document2 = project.Documents.Single(d => d.Name == "2.cs");
EncapsulateField\EncapsulateFieldTestState.cs (1)
34_testDocument = Workspace.Documents.Single(d => d.CursorPosition.HasValue || d.SelectedSpans.Any());
Intents\IntentTestsBase.cs (1)
105var testDocument = workspace.Documents.Single(d => d.Name == "test1.cs");
Interactive\NavigateTo\InteractiveNavigateToTests.cs (12)
49var item = (await _aggregator.GetItemsAsync("Goo")).Single(x => x.Kind != "Method"); 71var item = (await _aggregator.GetItemsAsync("DogBed")).Single(x => x.Kind != "Method"); 114var item = (await _aggregator.GetItemsAsync("Goo")).Single(x => x.Kind != "Method"); 196var item = (await _aggregator.GetItemsAsync("Goo")).Single(x => x.Kind != "Method"); 212var item = (await _aggregator.GetItemsAsync("B")).Single(x => x.Kind != "Method"); 231var item = (await _aggregator.GetItemsAsync("Colors")).Single(x => x.Kind != "Method"); 380var item = (await _aggregator.GetItemsAsync("Goo")).Single(t => t.Kind == NavigateToItemKind.Method); 399var item = (await _aggregator.GetItemsAsync("Goo")).Single(t => t.Kind == NavigateToItemKind.Method); 418var item = (await _aggregator.GetItemsAsync("Goo")).Single(t => t.Kind == NavigateToItemKind.Method && t.Name != ".ctor"); 513var item = (await _aggregator.GetItemsAsync("DoStuff")).Single(x => x.Kind != "Method"); 613var item = (await _aggregator.GetItemsAsync("G")).Single(x => x.Kind != "Method"); 620var descriptionItem = descriptionItems.Single(i => i.Category.Single().Text == label);
MoveToNamespace\MoveToNamespaceTests.cs (1)
1445var testDocument = workspace.Projects.Single(p => p.Name == "Proj1").Documents.Single();
NavigateTo\NavigateToTests.cs (21)
49var item = (await _aggregator.GetItemsAsync("Goo")).Single(x => x.Kind != "Method"); 64var item = (await _aggregator.GetItemsAsync("Goo")).Single(x => x.Kind != "Method"); 79var item = (await _aggregator.GetItemsAsync("Goo")).Single(x => x.Kind != "Method"); 100var item = (await _aggregator.GetItemsAsync("Goo")).Single(x => x.Kind != "Method"); 120var item = (await _aggregator.GetItemsAsync("Goo")).Single(x => x.Kind != "Method"); 135var item = (await _aggregator.GetItemsAsync("static")).Single(x => x.Kind != "Method"); 139item = (await _aggregator.GetItemsAsync("@static")).Single(x => x.Kind != "Method"); 160var item = (await _aggregator.GetItemsAsync("DogBed")).Single(x => x.Kind != "Method"); 201var item = (await _aggregator.GetItemsAsync("Goo")).Single(x => x.Kind != "Method"); 279var item = (await _aggregator.GetItemsAsync("Goo")).Single(x => x.Kind != "Method"); 294var item = (await _aggregator.GetItemsAsync("B")).Single(x => x.Kind != "Method"); 312var item = (await _aggregator.GetItemsAsync("Colors")).Single(x => x.Kind != "Method"); 554var item = (await _aggregator.GetItemsAsync("Goo")).Single(t => t.Kind == NavigateToItemKind.Method); 572var item = (await _aggregator.GetItemsAsync("Goo")).Single(t => t.Kind == NavigateToItemKind.Method); 590var item = (await _aggregator.GetItemsAsync("Goo")).Single(t => t.Kind == NavigateToItemKind.Method && t.Name != ".ctor"); 823var item = (await _aggregator.GetItemsAsync("DoStuff")).Single(x => x.Kind != "Method"); 1003var item = (await _aggregator.GetItemsAsync("G")).Single(x => x.Kind != "Method"); 1010var descriptionItem = descriptionItems.Single(i => i.Category.Single().Text == label); 1676var item = (await _aggregator.GetItemsAsync("Member")).Single(x => x.Kind == NavigateToItemKind.Property); 1693var item = (await _aggregator.GetItemsAsync("Member")).Single(x => x.Kind == NavigateToItemKind.Property); 1710var item = (await _aggregator.GetItemsAsync("Member")).Single(x => x.Kind == NavigateToItemKind.Field);
QuickInfo\SemanticQuickInfoSourceTests.cs (1)
130var sourceDocument = workspace.Documents.Single(d => d.Name == "SourceDocument");
SymbolKey\SymbolKeyTests.cs (2)
196var bodyProject = solution.Projects.Single(p => p.AssemblyName == "BodyProject"); 197var referenceProject = solution.Projects.Single(p => p.AssemblyName == "ReferenceProject");
Workspaces\WorkspaceTests_EditorFeatures.cs (2)
1418var originalDocumentId = workspace.GetOpenDocumentIds().Single(id => !workspace.GetTestDocument(id).IsLinkFile); 1419var linkedDocumentId = workspace.GetOpenDocumentIds().Single(id => workspace.GetTestDocument(id).IsLinkFile);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (6)
CodeGen\CodeGenAsyncIteratorTests.cs (1)
4216var type = metadataReader.TypeDefinitions.Single(t => metadataReader.GetString(metadataReader.GetTypeDefinition(t).Name) == methodName);
CodeGen\DestructorTests.cs (4)
776Single(pair => peFileReader.GetString(pair.row.Name) == "A" && 783Single(handle => peFileReader.GetString(peFileReader.GetMethodDefinition(handle).Name) == WellKnownMemberNames.DestructorName); 788Single(pair => peFileReader.GetString(pair.row.Name) == "Object" && 794Single(pair => pair.row.Parent == (EntityHandle)handleObject &&
CodeGen\SwitchTests.cs (1)
3042var pid = ((NamedTypeSymbol)comp.GlobalNamespace.GetMembers().Single(s => s.Name.StartsWith("<PrivateImplementationDetails>", StringComparison.Ordinal)));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
Emit\NumericIntPtrTests.cs (2)
6621var expr = tree.GetRoot().DescendantNodes().Single(n => n.Kind() == kind); 6853var expr = tree.GetRoot().DescendantNodes().Single(n => n.Kind() == kind);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (32)
Attributes\AttributeTests_NativeInteger.cs (1)
1599return reader.GetTypeDefinition(reader.TypeDefinitions.Single(h => reader.StringComparer.Equals(reader.GetTypeDefinition(h).Name, name)));
Attributes\AttributeTests_Nullable.cs (8)
191_ = reader.TypeDefinitions.Single(h => reader.StringComparer.Equals(reader.GetTypeDefinition(h).Name, name)); 4752var field = fieldDefs.Single(f => reader.StringComparer.Equals(f.Name, "Nested")); 4761field = fieldDefs.Single(f => reader.StringComparer.Equals(f.Name, "Long")); 4868var field = typeDef.GetFields().Select(f => reader.GetFieldDefinition(f)).Single(f => reader.StringComparer.Equals(f.Name, "Field")); 4871var @event = typeDef.GetEvents().Select(e => reader.GetEventDefinition(e)).Single(e => reader.StringComparer.Equals(e.Name, "Event")); 4874var method = typeDef.GetMethods().Select(m => reader.GetMethodDefinition(m)).Single(m => reader.StringComparer.Equals(m.Name, "Method")); 4879var property = typeDef.GetProperties().Select(p => reader.GetPropertyDefinition(p)).Single(p => reader.StringComparer.Equals(p.Name, "Property")); 5408return reader.GetTypeDefinition(reader.TypeDefinitions.Single(h => reader.StringComparer.Equals(reader.GetTypeDefinition(h).Name, name)));
Attributes\AttributeTests_RefReadOnly.cs (4)
1379var userFunction = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(method => method.Identifier.Text == "User"); 1421var userFunction = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(method => method.Identifier.Text == "User"); 1450var userFunction = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(method => method.Identifier.Text == "User"); 1477var userFunction = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(method => method.Identifier.Text == "User");
Semantics\CollectionExpressionTests.cs (17)
7534var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create"); 8257var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create"); 8328var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create"); 8412var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create"); 8497var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create"); 26013var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create"); 26139var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create"); 26253var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create"); 26311var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create"); 26382var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create"); 26464var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create"); 26530var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create"); 26591var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create"); 26661var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create"); 26836var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create"); 26901var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "CreateCollection"); 26957var method = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.Text == "Create");
Semantics\OutVarTests.cs (1)
35668var identifierAfter = statementAfter.DescendantNodes().OfType<IdentifierNameSyntax>().Single(id => id.Identifier.ValueText == "G");
Semantics\RecordTests.cs (1)
8610var xId = withExpr.DescendantNodes().Single(id => id.ToString() == "X");
Microsoft.CodeAnalysis.CSharp.Features (4)
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
357var interpolation = stringExpression.Contents.OfType<InterpolationSyntax>().Single(i => i.Span.Contains(start));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (2)
309var firstAffectedStatement = block.Statements.Single(s => firstAffectedExpression.GetAncestorOrThis<StatementSyntax>().Contains(s)); 322var firstAffectedGlobalStatement = compilationUnit.Members.OfType<GlobalStatementSyntax>().Single(s => firstAffectedExpression.GetAncestorOrThis<GlobalStatementSyntax>().Contains(s));
src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
76var otherAccessor = currentAccessorList.Accessors.Single(a => a != currentAccessor);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (13)
EditAndContinue\SyntaxUtilitiesTests.cs (13)
184var m0 = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.ValueText == "M0"); 185var m1 = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.ValueText == "M1"); 186var m2 = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.ValueText == "M2"); 187var m3 = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.ValueText == "M3"); 189var f1 = tree.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Single(m => m.Identifier.ValueText == "f1"); 190var f2 = tree.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Single(m => m.Identifier.ValueText == "f2"); 192var l1 = m3.DescendantNodes().OfType<VariableDeclaratorSyntax>().Single(m => m.Identifier.ValueText == "l1").Initializer. 195var l2 = m3.DescendantNodes().OfType<VariableDeclaratorSyntax>().Single(m => m.Identifier.ValueText == "l2").Initializer. 198var l3 = m3.DescendantNodes().OfType<VariableDeclaratorSyntax>().Single(m => m.Identifier.ValueText == "l3").Initializer. 252var x = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Single(m => m.Identifier.ValueText == "X"); 253var m1 = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.ValueText == "M1"); 254var m2 = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.ValueText == "M2"); 255var f = m2.DescendantNodes().OfType<LocalFunctionStatementSyntax>().Single(m => m.Identifier.ValueText == "f");
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_IObjectCreationExpression.cs (1)
2400var m = comp.SyntaxTrees[0].GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single(m => m.Identifier.ValueText == "M");
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (18)
Semantics\BindingTests.cs (1)
3939var lambda = tree.GetRoot().DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().Single(s => s.Parameter.Identifier.Text == "x");
Semantics\ColorColorTests.cs (1)
1817var memberAccess = syntaxRoot.DescendantNodes().Single(node => node.IsKind(SyntaxKind.SimpleMemberAccessExpression)) as MemberAccessExpressionSyntax;
Semantics\InitOnlyMemberTests.cs (1)
3156.Single(s => s.Identifier.ValueText == "_p");
Semantics\InterceptorsTests.cs (3)
2097var node2 = root.DescendantNodes().Single(node => node is ObjectCreationExpressionSyntax); 8360var node = source.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().Single(i => i.ToString() == "RS().M()"); 8424var node = source.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().Single(i => i.ToString() == "new S().M()");
Semantics\NativeIntegerTests.cs (2)
10107var expr = tree.GetRoot().DescendantNodes().Single(n => n.Kind() == kind); 10332var expr = tree.GetRoot().DescendantNodes().Single(n => n.Kind() == kind);
Semantics\NullableReferenceTypesTests.cs (1)
65900.Single(s => s.Keyword.ValueText == "object");
Semantics\RefEscapingTests.cs (1)
71.Single(n => n.Identifier.ValueText == name);
Semantics\SuppressAccessibilityChecksTests.cs (1)
231.Single(s => s.Identifier.ValueText == "_p");
Semantics\SyntaxTreeRootTests.cs (1)
81var syntaxTreeField = typeof(CSharpSyntaxNode).GetFields(BindingFlags.NonPublic | BindingFlags.Instance).Single(f => f.FieldType == typeof(SyntaxTree));
Semantics\TopLevelStatementsTests.cs (4)
9707model.TryGetSpeculativeSemanticModel(root.DescendantNodes().Single(n => n is ExpressionStatementSyntax { Parent: GlobalStatementSyntax }).Span.End, nodeToSpeculate, out var speculativeModelInTopLevel); 9708var conversionInTopLevel = speculativeModelInTopLevel.GetConversion(nodeToSpeculate.DescendantTokens().Single(n => n.ValueText == "x").Parent); 9712model.TryGetSpeculativeSemanticModel(root.DescendantNodes().Single(n => n is ExpressionStatementSyntax { Parent: BlockSyntax }).Span.End, nodeToSpeculate, out var speculativeModelOutsideTopLevel); 9713var conversionOutsideTopLevel = speculativeModelOutsideTopLevel.GetConversion(nodeToSpeculate.DescendantTokens().Single(n => n.ValueText == "x").Parent);
Semantics\UnsafeTests.cs (2)
6331.Single(n => n.Identifier.ValueText == name); 6390.Single(n => n.Identifier.ValueText == name);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (28)
Compilation\GetSemanticInfoBrokenCodeTests.cs (1)
300var identifierSyntax = tree.GetCompilationUnitRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Single(n => n.Identifier.ValueText == "CompletionItem");
Compilation\GetSemanticInfoTests.cs (2)
4885Single(e => e.ToString() == "Instance.GetList().OfType<D>"); 5914var expr = tokens.Single(t => t.Kind() == SyntaxKind.TrueKeyword).Parent;
Compilation\SemanticModelAPITests.cs (8)
43var m = root.DescendantNodes().OfType<MethodDeclarationSyntax>().Single(decl => decl.Identifier.ValueText == "M"); 4644var identifier = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Single(i => i.Identifier.Text == "M"); 4661var identifier = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Single(i => i.Identifier.Text == "M2"); 4676var identifier = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Single(i => i.Identifier.Text == "M2"); 4692var identifier = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Single(i => i.Identifier.Text == "NotNullWhen"); 4708var identifier = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Single(i => i.Identifier.Text == "M2"); 4727var identifier = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Single(i => i.Identifier.Text == "M2"); 4743var identifier = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Single(i => i.Identifier.Text == "M2");
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (2)
3686var globalStmt = tree.GetCompilationUnitRoot().FindToken(tree.GetCompilationUnitRoot().ToFullString().IndexOf('/')).Parent.AncestorsAndSelf().Single(x => x.IsKind(SyntaxKind.GlobalStatement)); 5206var node = tree.GetRoot().DescendantNodes().Single(node => node is IdentifierNameSyntax { Identifier: { ValueText: "b" } });
Compilation\SemanticModelGetSemanticInfoTests.cs (1)
15434var syntax = tree.GetCompilationUnitRoot().DescendantNodes().Single(n => n.Kind() == SyntaxKind.ThisExpression);
DocumentationComments\CrefTests.cs (1)
6333var nonCrefPosition = tree.GetRoot().DescendantTrivia().Single(t => t.IsKind(SyntaxKind.SingleLineDocumentationCommentTrivia)).SpanStart;
SymbolDisplay\SymbolDisplayTests.cs (7)
7175var declaration = (BaseTypeDeclarationSyntax)semanticModel.SyntaxTree.GetRoot().DescendantNodes().Single(n => n.Kind() == SyntaxKind.StructDeclaration); 7247var declaration = (BaseTypeDeclarationSyntax)semanticModel.SyntaxTree.GetRoot().DescendantNodes().Single(n => n.Kind() == SyntaxKind.StructDeclaration); 7507var declaration = (BaseTypeDeclarationSyntax)semanticModel.SyntaxTree.GetRoot().DescendantNodes().Single(n => n.Kind() == SyntaxKind.StructDeclaration); 7660var declaration = (BaseTypeDeclarationSyntax)semanticModel.SyntaxTree.GetRoot().DescendantNodes().Single(n => n.Kind() == SyntaxKind.StructDeclaration); 7688var structure = semanticModel.SyntaxTree.GetRoot().DescendantNodes().Single(n => n.RawKind == (int)VisualBasic.SyntaxKind.StructureStatement); 8399var declaration = (LocalDeclarationStatementSyntax)semanticModel.SyntaxTree.GetRoot().DescendantNodes().Single(n => n.Kind() == SyntaxKind.LocalDeclarationStatement); 8450var declaration = (LocalDeclarationStatementSyntax)semanticModel.SyntaxTree.GetRoot().DescendantNodes().Single(n => n.Kind() == SyntaxKind.LocalDeclarationStatement);
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (1)
1042var explicitInterfaceImplementation = nodes.OfType<MethodDeclarationSyntax>().Single(d => d.ExplicitInterfaceSpecifier != null);
Symbols\EnumTests.cs (1)
353var expr = tree.GetRoot().DescendantNodes().Single(n => n.Kind() == SyntaxKind.BitwiseNotExpression);
Symbols\Source\NullablePublicAPITests.cs (4)
3667var o2Reference = localFunction.DescendantNodes().OfType<IdentifierNameSyntax>().Single(id => id.Identifier.ValueText == "o2"); 3863var innerO2Reference = innerLambda.DescendantNodes().OfType<IdentifierNameSyntax>().Single(id => id.Identifier.ValueText == "o2"); 3915var o1Reference = fieldLambda.DescendantNodes().OfType<IdentifierNameSyntax>().Single(id => id.Identifier.ValueText == "o1"); 3929var o3Reference = propertyLambda.DescendantNodes().OfType<IdentifierNameSyntax>().Single(id => id.Identifier.ValueText == "o3");
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (17)
IncrementalParsing\IncrementalParsingTests.cs (4)
565var localFunc1 = tree.GetRoot().DescendantNodesAndSelf().Single(n => n is LocalFunctionStatementSyntax); 566var innerConditionalExpr1 = localFunc1.DescendantNodesAndSelf().Single(n => n is ConditionalExpressionSyntax); 582var localFunc2 = tree.GetRoot().DescendantNodesAndSelf().Single(n => n is LocalFunctionStatementSyntax); 583var innerConditionalExpr2 = localFunc2.DescendantNodesAndSelf().Single(n => n is ConditionalExpressionSyntax);
LexicalAndXml\PreprocessorTests.cs (1)
2382var classDeclaration = node.ChildNodes().Single(n => n is ClassDeclarationSyntax);
Parsing\LineSpanDirectiveParsingTests.cs (1)
32UsingNode(node.GetDirectives().Single(d => d.Kind() is SyntaxKind.LineDirectiveTrivia or SyntaxKind.LineSpanDirectiveTrivia));
Parsing\ParserErrorMessageTests.cs (7)
3767var methodDeclaration = (MethodDeclarationSyntax)tree.GetRoot().DescendantNodes().Single(node => node is MethodDeclarationSyntax); 3770var delegateDeclaration = (DelegateDeclarationSyntax)tree.GetRoot().DescendantNodes().Single(node => node is DelegateDeclarationSyntax); 3773var localFunctionStatement = (LocalFunctionStatementSyntax)tree.GetRoot().DescendantNodes().Single(node => node is LocalFunctionStatementSyntax); 3776var lambdaExpression = (ParenthesizedLambdaExpressionSyntax)tree.GetRoot().DescendantNodes().Single(node => node is ParenthesizedLambdaExpressionSyntax); 3779var anonymousMethodExpression = (AnonymousMethodExpressionSyntax)tree.GetRoot().DescendantNodes().Single(node => node is AnonymousMethodExpressionSyntax); 3782var indexerDeclaration = (IndexerDeclarationSyntax)tree.GetRoot().DescendantNodes().Single(node => node is IndexerDeclarationSyntax); 3785var operatorDeclaration = (OperatorDeclarationSyntax)tree.GetRoot().DescendantNodes().Single(node => node is OperatorDeclarationSyntax);
Syntax\StructuredTriviaTests.cs (2)
167var trivia = tree.GetCompilationUnitRoot().DescendantTrivia().Single(t => t.Kind() == SyntaxKind.SingleLineDocumentationCommentTrivia); 183var trivia = tree.GetCompilationUnitRoot().DescendantTrivia().Single(t => t.Kind() == SyntaxKind.MultiLineDocumentationCommentTrivia);
Syntax\SyntaxNodeTests.cs (2)
735var identifier = root.DescendantNodes(descendIntoTrivia: true).Single(n => n is IdentifierNameSyntax); 2368var token = cu.DescendantTokens().Single(t => t.Kind() == SyntaxKind.EndOfFileToken);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
Extensions.cs (2)
203return type.GetMembers("Equals").OfType<IMethodSymbol>().Single(m => m.Parameters is [{ Type: var parameterType }] && parameterType.Equals(type, SymbolEqualityComparer.Default)); 214return primaryConstructor.ContainingType.GetMembers("Deconstruct").OfType<IMethodSymbol>().Single(
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (6)
CodeGeneration\SyntaxGeneratorTests.cs (5)
989var conversion = gcHandleType.GetMembers().OfType<IMethodSymbol>().Single(m => 997conversion = doubleType.GetMembers().OfType<IMethodSymbol>().Single(m => 4278var method = symbolC.GetMembers().OfType<IMethodSymbol>().Single(m => m.MethodKind == MethodKind.Ordinary); 4279var indexer = symbolC.GetMembers().OfType<IPropertySymbol>().Single(m => m.IsIndexer); 4280var property = symbolC.GetMembers().OfType<IPropertySymbol>().Single(m => !m.IsIndexer);
EmbeddedLanguages\VirtualChars\CSharpVirtualCharServiceTests.cs (1)
124var skippedTrivia = namespaceDeclaration.OpenBraceToken.TrailingTrivia.Single(t => t.Kind() is SyntaxKind.SkippedTokensTrivia);
Microsoft.CodeAnalysis.EditorFeatures (1)
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (1)
331var originalDocument = _baseDocuments.Single(d => d.Id == newDocument.Id);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (9)
AutomaticCompletion\AbstractAutomaticLineEnderTests.cs (1)
82view.Caret.MoveTo(new SnapshotPoint(buffer.CurrentSnapshot, workspace.Documents.Single(d => d.CursorPosition.HasValue).CursorPosition.Value));
Completion\AbstractCompletionProviderTests.cs (5)
956var position = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").CursorPosition.Value; 958var documentId = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").Id; 1012var position = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").CursorPosition.Value; 1014var documentId = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").Id; 1052var item = completionList.ItemsList.Single(c => c.DisplayText == expectedItem);
SignatureHelp\AbstractSignatureHelpProviderTests.cs (3)
384var signatureHelpProvider = workspace.ExportProvider.GetExportedValues<ISignatureHelpProvider>().Single(provider => provider.GetType() == signatureHelpProviderType); 467var cursorPosition = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").CursorPosition.Value; 475var selectedSpans = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").SelectedSpans;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (34)
CodeRefactorings\CodeRefactoringServiceTest.cs (4)
171var txtAdditionalDocument = project.AdditionalDocuments.Single(t => t.Name == "test.txt"); 186var logAdditionalDocument = project.AdditionalDocuments.Single(t => t.Name == "test.log"); 210var editorConfig = project.AnalyzerConfigDocuments.Single(t => t.Name == ".editorconfig"); 225var globalConfig = project.AnalyzerConfigDocuments.Single(t => t.Name == ".globalconfig");
InheritanceMargin\InheritanceMarginTests.cs (2)
211var testHostDocument1 = testWorkspace.Documents.Single(doc => doc.Project.AssemblyName.Equals("Assembly1")); 212var testHostDocument2 = testWorkspace.Documents.Single(doc => doc.Project.AssemblyName.Equals("Assembly2"));
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (3)
77var documentId = workspace.Documents.Single(d => !d.IsLinkFile).Id; 80var linkedDocumentId = workspace.Documents.Single(d => d.IsLinkFile).Id; 103var linkedDocument = document.Project.Solution.Projects.Single(p => p != document.Project).Documents.Single();
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
310var testDocument = Workspace.Documents.Single(d => d.FilePath == "SourceDocument");
SymbolFinder\DependentTypeFinderTests.cs (17)
78var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 119var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 132=> solution.Projects.Single(p => p.Name == "PortableProject"); 135=> solution.Projects.Single(p => p.Name == "NormalProject"); 170var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 211var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 253var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 295var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 336var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 377var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 417var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 640var csProject = solution.Projects.Single(p => p.Language == LanguageNames.CSharp); 641var otherProject = solution.Projects.Single(p => p != csProject); 698var normalProject2 = solution.Projects.Single(p => p != normalProject1); 740var portableProject1 = solution.Projects.Single(p => p.Name == "PortableProject1"); 754var compilation1 = await solution.Projects.Single(p => p.Name == "PortableProject1").GetCompilationAsync(); 755var compilation2 = await solution.Projects.Single(p => p.Name == "PortableProject2").GetCompilationAsync();
SymbolFinder\FindSymbolAtPositionTests.cs (1)
20var position = workspace.Documents.Single(d => d.CursorPosition.HasValue).CursorPosition!.Value;
SymbolKey\SymbolKeyCrossLanguageTests.cs (2)
41var csDocument = solution.Projects.Single(p => p.Language == LanguageNames.CSharp).Documents.Single(); 49var vbProject = solution.Projects.Single(p => p.Language == LanguageNames.VisualBasic);
Utilities\SymbolEquivalenceComparerTests.cs (4)
1718var namespace1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetNamespaceMembers().Single(n => n.Name == "N").GetNamespaceMembers().Single(n => n.Name == "M"); 1719var namespace2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetNamespaceMembers().Single(n => n.Name == "N").GetNamespaceMembers().Single(n => n.Name == "M");
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Lightup\LightupHelpers.cs (1)
256var method = type.GetTypeInfo().GetDeclaredMethods(methodName).Single(method => method.GetParameters().Length == 0);
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
RelatedDocuments\AbstractRelatedDocumentsTests.cs (1)
28var caretDocument = workspace.Documents.Single(d => d.CursorPosition.HasValue);
Microsoft.CodeAnalysis.Features.UnitTests (7)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (1)
1558var documentC = projectC.Documents.Single(d => d.Name == "C.cs");
EditAndContinue\EditSessionActiveStatementsTests.cs (2)
178var document1 = project.Documents.Single(d => d.Name == "test1.cs"); 179var document2 = project.Documents.Single(d => d.Name == "test2.cs");
FindUsages\DefinitionItemFactoryTests.cs (4)
616var project = solution.Projects.Single(p => p.Name == "P1"); 1452var f = model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().Single(n => n is LocalFunctionStatementSyntax)); 1518var x = model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().Single(n => n is VariableDeclaratorSyntax)); 1589var r = model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().Single(n => n is FromClauseSyntax));
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Handler\CodeActions\CodeActionHelpers.cs (1)
445matchingAction = matchingActions.Single(action => isFixAllAction ? action is FixAllCodeAction : action is CodeAction);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
SemanticTokens\AbstractSemanticTokensTests.cs (1)
124var kind = tokenTypeToIndex.Single(kvp => kvp.Value == data[i + 3]).Key;
Microsoft.CodeAnalysis.Rebuild.UnitTests (2)
CompilationRebuildArtifactResolver.cs (2)
24.Single(x => 32.Single(x => x.GetChecksum().SequenceEqual(sourceTextInfo.Hash));
Microsoft.CodeAnalysis.Test.Utilities (4)
CompilationVerifier.cs (3)
99var mainModule = moduleDatas.Single(md => md.FullName == mainModuleFullName); 232var mainModule = moduleData.Single(md => md.FullName == mainModuleFullName); 647ILValidation.GetSequencePointMarkers(xmlMethod, id => _compilation.SyntaxTrees.Single(tree => tree.FilePath == documentMap[id]).GetText()) :
PDB\DeterministicBuildCompilationTestHelpers.cs (1)
89var testReference = references.Single(x => x.MetadataReferenceInfo.Mvid == info.Mvid);
Microsoft.CodeAnalysis.UnitTests (5)
Collections\ImmutableSegmentedDictionaryBuilderTest.cs (1)
253PropertyInfo itemProperty = info.Properties.Single(pr => pr.GetCustomAttribute<DebuggerBrowsableAttribute>()!.State == DebuggerBrowsableState.RootHidden);
Collections\ImmutableSegmentedDictionaryTest.cs (1)
253PropertyInfo itemProperty = info.Properties.Single(pr => pr.GetCustomAttribute<DebuggerBrowsableAttribute>()!.State == DebuggerBrowsableState.RootHidden);
Collections\ImmutableSegmentedHashSetTest.cs (1)
189PropertyInfo itemProperty = info.Properties.Single(pr => pr.GetCustomAttribute<DebuggerBrowsableAttribute>()?.State == DebuggerBrowsableState.RootHidden);
Collections\ImmutableSegmentedListBuilderTest.cs (1)
363PropertyInfo itemProperty = info.Properties.Single(pr => pr.GetCustomAttribute<DebuggerBrowsableAttribute>()!.State == DebuggerBrowsableState.RootHidden);
Collections\ImmutableSegmentedListTest.cs (1)
778PropertyInfo itemProperty = info.Properties.Single(pr => pr.GetCustomAttribute<DebuggerBrowsableAttribute>()!.State == DebuggerBrowsableState.RootHidden);
Microsoft.CodeAnalysis.Workspaces (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
80.Single(m => containingType.Equals(m.Parameters.FirstOrDefault()?.Type));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (2)
224.Single(c => c.HasAnnotation(annotation)); 238currentNodeOrToken = newRoot.DescendantNodes().Single(c => c.HasAnnotation(marker));
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
687.Single(m => m.FilePath == path && m.Properties == properties);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (14)
VisualStudioMSBuildWorkspaceTests.cs (14)
1993var fooDoc = documents.Single(d => d.Name == "Foo.cs"); 2022var document2 = documents.Single(d => d.Name == "Bar.cs"); 2041var documentB = documentsB.Single(d => d.Name == "Bar.cs"); 2054var document = project.Documents.Single(d => d.Name == "CSharpClass.cs"); 2065var document2 = documents.Single(d => d.Name == "CSharpClass.cs"); 2088var document = project.Documents.Single(d => d.Name == "CSharpClass.cs"); 2115var document = documents.Single(d => d.Name.Contains("CSharpClass")); 2142var document = documents.Single(d => d.Name.Contains("ValidAdditionalFile")); 2370var document = project.Documents.Single(d => d.Name == "CSharpClass.cs"); 2374var additionalDocument = project.AdditionalDocuments.Single(a => a.Name == "XamlFile.xaml"); 3212var project = solution.Projects.Single(p => p.FilePath.EndsWith("CSharpProject_ProjectReference.csproj")); 3326var document = project.Documents.Single(d => d.Name == "MyClass.cs"); 3339var linkedDocument = project.Documents.Single(d => d.Name == "Foo.cs"); 3352var linkedDocument = project.Documents.Single(d => d.Name == "MyClass.cs");
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestWorkspace`1.cs (1)
243=> Documents.Single(d => d.CursorPosition.HasValue && !d.IsLinkFile);
Microsoft.CodeAnalysis.Workspaces.UnitTests (20)
FindReferencesTests.cs (10)
386}", NetCoreApp.References, solution.Projects.Single(pid => pid.Name == "NetStandardProject").Id); 476", Net40.References.mscorlib, solution.Projects.Single(pid => pid.Name == "PortableProject").Id); 479var portableCompilation = await solution.Projects.Single(p => p.Name == "PortableProject").GetCompilationAsync(); 483var normalCompilation = await solution.Projects.Single(p => p.Name == "NormalProject").GetCompilationAsync(); 547var typeResult = result.Single(r => r.Definition.Kind == SymbolKind.NamedType); 548var constructorResult = result.Single(r => r.Definition.Kind == SymbolKind.Method); 580var typeResult = result.Single(r => r.Definition.Kind == SymbolKind.NamedType); 581var constructorResult = result.Single(r => r.Definition.Kind == SymbolKind.Method); 622var typeResult = result.Single(r => r.Definition.Kind == SymbolKind.NamedType); 623var constructorResult = result.Single(r => r.Definition.Kind == SymbolKind.Method);
SolutionTests\ProjectDependencyGraphTests.cs (4)
508var aToB = a.ProjectReferences.Single(reference => reference.ProjectId == b.Id); 536var aToB = a.ProjectReferences.Single(reference => reference.ProjectId == b.Id); 566var aToB = a.ProjectReferences.Single(reference => reference.ProjectId == b.Id); 620var remainingBToC = b.ProjectReferences.Single(reference => reference.ProjectId == c.Id);
SolutionTests\SolutionTests.cs (4)
2866compilation.References.Single(r => 5302solution = solution.RemoveProject(solution.Projects.Single(p => p.Name == "CS2").Id); 5308solution = solution.RemoveProject(solution.Projects.Single(p => p.Name == "NC1").Id); 5404var s4 = s2.RemoveProject(s2.Projects.Single(p => p.Name == "P1").Id);
SolutionTests\SolutionWithSourceGeneratorTests.cs (1)
467project = project.Documents.Single(d => d.Name == "RegularDocument.cs").WithFrozenPartialSemantics(CancellationToken.None).Project;
SymbolKeyTests.cs (1)
783var a = GetDeclaredSymbols(compilation).OfType<INamedTypeSymbol>().Single(s => s.Name == "A");
Microsoft.DotNet.Arcade.Sdk.Tests (3)
Utilities\TestProjectFixture.cs (3)
34_logOutputDir = GetType().Assembly.GetCustomAttributes<AssemblyMetadataAttribute>().Single(m => m.Key == "LogOutputDir").Value; 51var nugetRoot = GetType().Assembly.GetCustomAttributes<AssemblyMetadataAttribute>().Single(m => m.Key == "NuGetPackageRoot").Value; 52var pkgVersion = GetType().Assembly.GetCustomAttributes<AssemblyMetadataAttribute>().Single(m => m.Key == "PackageVersion").Value;
Microsoft.DotNet.Build.Tasks.Feed.Tests (1)
PublishToSymbolServerTest.cs (1)
165var message = buildEngine.BuildMessageEvents.Single(x => x.Message.StartsWith("Publishing Symbols to Symbol server"));
Microsoft.DotNet.Open.Api.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
52.Single(c => c.GetParameters().First().ParameterType == typeof(ConsoleSpecialKey));
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (3)
HelperFactory.cs (1)
221.Single(
Modeler\MethodModel.cs (2)
57public ParameterModel PageParameter => Paginated == null ? null : NonConstantParameters.Single(p => p.Name == Paginated.PageParameterName); 59public ParameterModel PageSizeParameter => Paginated == null ? null : NonConstantParameters.Single(p => p.Name == Paginated.PageSizeParameterName);
Microsoft.Extensions.ApiDescription.Client.Tests (1)
TargetTest.cs (1)
21.Single(m => m.Key == "TargetFramework")
Microsoft.Extensions.ApiDescription.Tool.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
52.Single(c => c.GetParameters().First().ParameterType == typeof(ConsoleSpecialKey));
Microsoft.Extensions.Http (2)
DependencyInjection\DefaultHttpClientBuilder.cs (1)
14var tracker = (DefaultHttpClientConfigurationTracker?)services.Single(sd => sd.ServiceType == typeof(DefaultHttpClientConfigurationTracker)).ImplementationInstance;
DependencyInjection\HttpClientBuilderExtensions.cs (1)
788var registry = (HttpClientMappingRegistry?)services.Single(sd => sd.ServiceType == typeof(HttpClientMappingRegistry)).ImplementationInstance;
Microsoft.Extensions.Http.Diagnostics.Tests (14)
Logging\AcceptanceTests.cs (14)
115var logRecord = collector.GetSnapshot().Single(logRecord => logRecord.Category == LoggingCategory); 127state!.Single(kvp => kvp.Key == enricher2!.KvpRequest.Key).Value.Should().Be(enricher2!.KvpRequest.Value!.ToString()); 172var logRecord = collector.GetSnapshot().Single(l => l.Category == LoggingCategory); 188logRecord = collector.GetSnapshot().Single(l => l.Category == LoggingCategory); 258var logRecord = collector.GetSnapshot().Single(l => l.Category == LoggingCategory); 280logRecord = collector.GetSnapshot().Single(l => l.Category == LoggingCategory); 323var logRecord = collector.GetSnapshot().Single(logRecord => logRecord.Category == LoggingCategory); 326state!.Single(kvp => kvp.Key == HttpClientLoggingTagNames.Path).Value.Should().Be(redactedPath); 366var logRecord = collector.GetSnapshot().Single(logRecord => logRecord.Category == LoggingCategory); 435var logRecord = collector.GetSnapshot().Single(logRecord => logRecord.Category == LoggingCategory); 438state!.Single(kvp => kvp.Key == HttpClientLoggingTagNames.Path).Value.Should().Be(redactedPath); 595var logRecord = collector.GetSnapshot().Single(l => l.Category == LoggingCategory); 644var logRecord = collector.GetSnapshot().Single(l => l.Category == LoggingCategory); 699var logRecord = collector.GetSnapshot().Single(l => l.Category == LoggingCategory);
Microsoft.Extensions.SecretManager.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
52.Single(c => c.GetParameters().First().ParameterType == typeof(ConsoleSpecialKey));
Microsoft.Maui.Controls (1)
Interactivity\EventTrigger.cs (1)
15 static readonly MethodInfo s_handlerinfo = typeof(EventTrigger).GetRuntimeMethods().Single(mi => mi.Name == "OnEventTriggered" && mi.IsPublic == false);
Microsoft.Maui.Controls.Build.Tasks (1)
PerformanceProvider.cs (1)
56 long start = stats.StartTimes.Single(s => s.Item1 == reference).Item2;
Microsoft.ML.OnnxConverter (2)
OnnxContextImpl.cs (2)
119string columnName = _columnNameMap.Single(kvp => kvp.Value == variableName).Key; 268_inputs.Remove(_inputs.Single(modelArg => modelArg.Name == variableName));
Microsoft.ML.TimeSeries (1)
RootCauseAnalyzer.cs (1)
71MetricSlice slice = src.Slices.Single(slice => slice.TimeStamp.Equals(src.AnomalyTimestamp));
Microsoft.VisualStudio.LanguageServices (1)
DebuggerIntelliSense\DebuggerTextView.HACK_CompletionSession.cs (1)
51var shimController = propertyList.Single(x => x.Value != null && x.Value.GetType().Name == "ShimCompletionController").Value;
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Extensions.cs (1)
34return document.Project.Solution.Projects.Single(p => p.SupportsCompilation && p.FilePath == document.Project.FilePath);
MSBuild (1)
XMake.cs (1)
1619result = graphResult.ResultsByNode.Single(
Roslyn.Test.PdbUtilities (1)
EditAndContinue\EditAndContinueTest.GenerationVerifier.cs (1)
137.Single(e => e.Key.ToString() == typeName).Value.Where(s => s.Kind == SymbolKind.Field)
Roslyn.VisualStudio.Next.UnitTests (6)
Services\ServiceHubServicesTests.cs (2)
293projectId1 = solution.Projects.Single(p => p.Name == "Project0").Id; 294projectId2 = solution.Projects.Single(p => p.Name == "Project1").Id;
Services\SolutionServiceTests.cs (4)
636solution = project3.Solution.AddProjectReference(project3.Id, new(project3.Solution.Projects.Single(p => p.Name == "P2").Id)); 669solution = project3.Solution.AddProjectReference(project3.Id, new(project3.Solution.Projects.Single(p => p.Name == "P2").Id)); 1077var project1 = solution.Projects.Single(p => p.AssemblyName == "Assembly1"); 1078var project2 = solution.Projects.Single(p => p.AssemblyName == "Assembly2");
System.Drawing.Common.Tests (1)
System\Drawing\ImageTests.cs (1)
649ImageCodecInfo codec = codecs.Single(c => c.FormatID == format.Guid);
System.Reflection.DispatchProxy (2)
src\libraries\Common\src\System\Reflection\Emit\IgnoreAccessChecksToAttributeBuilder.cs (2)
79.Single(c => c.GetParameters().Length == 1 && 85.Single(f => string.Equals(f.Name, "AllowMultiple"));
System.Windows.Forms.Tests (6)
System\Windows\Forms\BindingContextTests.cs (6)
43WeakReference reference1 = Assert.IsType<WeakReference>(array.Single(p => ((WeakReference)p.Value).Target == manager1).Value); 44WeakReference reference2 = Assert.IsType<WeakReference>(array.Single(p => ((WeakReference)p.Value).Target == manager2).Value); 189WeakReference reference1 = Assert.IsType<WeakReference>(array.Single(p => ((WeakReference)p.Value).Target == manager1).Value); 190WeakReference reference2 = Assert.IsType<WeakReference>(array.Single(p => ((WeakReference)p.Value).Target == manager2).Value); 218WeakReference reference1 = Assert.IsType<WeakReference>(array.Single(p => ((WeakReference)p.Value).Target == manager1).Value); 219WeakReference reference2 = Assert.IsType<WeakReference>(array.Single(p => ((WeakReference)p.Value).Target == manager2).Value);
Templates.Blazor.Tests (4)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
66.Single(a => a.Key == "TestTemplateCreationFolder")
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
46.Single(s => s.Key == "CustomTemplateHivePath").Value 88.Single(a => a.Key == "ArtifactsShippingPackagesDir").Value;
src\Shared\CertificateGeneration\CertificateManager.cs (1)
839.Single(c => c.SerialNumber == certificate.SerialNumber);
Templates.Blazor.WebAssembly.Auth.Tests (5)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
66.Single(a => a.Key == "TestTemplateCreationFolder")
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
46.Single(s => s.Key == "CustomTemplateHivePath").Value 88.Single(a => a.Key == "ArtifactsShippingPackagesDir").Value;
src\Shared\CertificateGeneration\CertificateManager.cs (1)
839.Single(c => c.SerialNumber == certificate.SerialNumber);
src\Shared\E2ETesting\SauceConnectServer.cs (1)
255.Single(a => a.Key == "Microsoft.AspNetCore.InternalTesting.SauceConnect.ProcessTracking").Value;
Templates.Blazor.WebAssembly.Tests (5)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
66.Single(a => a.Key == "TestTemplateCreationFolder")
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
46.Single(s => s.Key == "CustomTemplateHivePath").Value 88.Single(a => a.Key == "ArtifactsShippingPackagesDir").Value;
src\Shared\CertificateGeneration\CertificateManager.cs (1)
839.Single(c => c.SerialNumber == certificate.SerialNumber);
src\Shared\E2ETesting\SauceConnectServer.cs (1)
255.Single(a => a.Key == "Microsoft.AspNetCore.InternalTesting.SauceConnect.ProcessTracking").Value;
Templates.Mvc.Tests (5)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
66.Single(a => a.Key == "TestTemplateCreationFolder")
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
46.Single(s => s.Key == "CustomTemplateHivePath").Value 88.Single(a => a.Key == "ArtifactsShippingPackagesDir").Value;
src\Shared\CertificateGeneration\CertificateManager.cs (1)
839.Single(c => c.SerialNumber == certificate.SerialNumber);
src\Shared\E2ETesting\SauceConnectServer.cs (1)
255.Single(a => a.Key == "Microsoft.AspNetCore.InternalTesting.SauceConnect.ProcessTracking").Value;
Templates.Tests (5)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
66.Single(a => a.Key == "TestTemplateCreationFolder")
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
46.Single(s => s.Key == "CustomTemplateHivePath").Value 88.Single(a => a.Key == "ArtifactsShippingPackagesDir").Value;
src\Shared\CertificateGeneration\CertificateManager.cs (1)
839.Single(c => c.SerialNumber == certificate.SerialNumber);
src\Shared\E2ETesting\SauceConnectServer.cs (1)
255.Single(a => a.Key == "Microsoft.AspNetCore.InternalTesting.SauceConnect.ProcessTracking").Value;
xunit.assert (1)
Sdk\CollectionTracker.cs (1)
73 .Single(m => m.Name == nameof(CompareTypedSets));