78 references to Single
Aspire.Hosting.Azure (1)
AzureResourcePreparer.cs (1)
134var command = AzureProvisioningController.EnvironmentCommandDefinitions.Single(
Aspire.Hosting.Azure.EntraId.Tests (4)
EntraIdInitializationTests.cs (4)
296Assert.Equal(TenantId, ready.Snapshot.Properties.Single(property => property.Name == "entra.tenant.id").Value); 344Assert.Equal(updatedTenant, ready.Snapshot.Properties.Single(property => property.Name == "entra.tenant.id").Value); 346ready.Snapshot.Urls.Single(url => url.Name == "OpenID Config").Url); 349ready.Snapshot.Urls.Single(url => url.Name == "Azure Portal").Url);
Aspire.Hosting.Azure.Tests (25)
AzureBicepProvisionerTests.cs (16)
854Assert.Equal("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/test-rg/providers/Microsoft.Resources/deployments/storage", resourceEvent.Snapshot.Properties.Single(p => p.Name == CustomResourceKnownProperties.Source).Value?.ToString()); 883Assert.Equal("87654321-4321-4321-4321-210987654321", resourceEvent.Snapshot.Properties.Single(p => p.Name == "azure.tenant.id").Value?.ToString()); 884Assert.Equal("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/test-rg/providers/Microsoft.Resources/deployments/storage2", resourceEvent.Snapshot.Properties.Single(p => p.Name == CustomResourceKnownProperties.Source).Value?.ToString()); 921Assert.Equal("87654321-4321-4321-4321-210987654321", resourceEvent.Snapshot.Properties.Single(p => p.Name == "azure.tenant.id").Value?.ToString()); 922Assert.Equal(expectedDeploymentId, resourceEvent.Snapshot.Properties.Single(p => p.Name == CustomResourceKnownProperties.Source).Value?.ToString()); 923Assert.Equal(BicepProvisioner.GetDeploymentUrl(new ResourceIdentifier(expectedDeploymentId)), resourceEvent.Snapshot.Urls.Single(u => u.Name == "deployment").Url); 1035Assert.Equal("12345678-1234-1234-1234-123456789012", resourceEvent.Snapshot.Properties.Single(p => p.Name == "azure.subscription.id").Value?.ToString()); 1036Assert.Equal("test-rg", resourceEvent.Snapshot.Properties.Single(p => p.Name == "azure.resource.group").Value?.ToString()); 1037Assert.Equal("87654321-4321-4321-4321-210987654321", resourceEvent.Snapshot.Properties.Single(p => p.Name == "azure.tenant.id").Value?.ToString()); 1038Assert.Equal("microsoft.onmicrosoft.com", resourceEvent.Snapshot.Properties.Single(p => p.Name == "azure.tenant.domain").Value?.ToString()); 1039Assert.Equal("westus2", resourceEvent.Snapshot.Properties.Single(p => p.Name == "azure.location").Value?.ToString()); 1040Assert.Equal("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/test-rg/providers/Microsoft.Resources/deployments/storage2", resourceEvent.Snapshot.Properties.Single(p => p.Name == CustomResourceKnownProperties.Source).Value?.ToString()); 1086Assert.Equal("scoped-rg", resourceEvent.Snapshot.Properties.Single(p => p.Name == "azure.resource.group").Value?.ToString()); 1394Assert.Equal(AzureProvisioningFailureDetails.LocationNotAvailableForResourceTypeErrorCode, resourceEvent.Snapshot.Properties.Single(p => p.Name == "azure.provisioning.error.code").Value); 1395Assert.Equal("australiacentral", resourceEvent.Snapshot.Properties.Single(p => p.Name == "azure.provisioning.error.current.location").Value); 1396var supportedLocations = Assert.IsType<string[]>(resourceEvent.Snapshot.Properties.Single(p => p.Name == "azure.provisioning.error.supported.locations").Value);
AzureEnvironmentResourceExtensionsTests.cs (9)
1318var resourceNameProperty = properties.Single(property => property.Name == "azure.provisioning.error.resource.name"); 1324var targetResourceIdProperty = properties.Single(property => property.Name == "azure.provisioning.error.target.resource.id"); 4359Assert.Equal(AzureProvisioningFailureDetails.KeyVaultDeletedStateTombstoneNotFoundReason, keyVaultEvent.Snapshot.Properties.Single(p => p.Name == "azure.provisioning.error.code").Value?.ToString()); 4360var snapshotRecommendedActions = Assert.IsType<string[]>(keyVaultEvent.Snapshot.Properties.Single(p => p.Name == "azure.provisioning.error.recommendedActions").Value); 4573Assert.Equal("Microsoft.ManagedIdentity", storageEvent.Snapshot.Properties.Single(p => p.Name == "azure.provisioning.error.provider").Value?.ToString()); 4574Assert.Equal("Microsoft.ManagedIdentity/userAssignedIdentities", storageEvent.Snapshot.Properties.Single(p => p.Name == "azure.provisioning.error.resource.type").Value?.ToString()); 4575Assert.Equal("LocationNotAvailableForResourceType", storageEvent.Snapshot.Properties.Single(p => p.Name == "azure.provisioning.error.code").Value?.ToString()); 4576Assert.Equal(400, storageEvent.Snapshot.Properties.Single(p => p.Name == "azure.provisioning.error.http.status").Value); 4577var snapshotRecommendedActions = Assert.IsType<string[]>(storageEvent.Snapshot.Properties.Single(p => p.Name == "azure.provisioning.error.recommendedActions").Value);
Aspire.Hosting.Browsers.Tests (3)
BrowserLogsBuilderExtensionsTests.cs (3)
1350Assert.Equal(ResourceCommandState.Disabled, initialEvent.Snapshot.Commands.Single(command => command.Name == BrowserLogsBuilderExtensions.OpenTrackedBrowserCommandName).State); 1366Assert.Equal(ResourceCommandState.Enabled, enabledEvent.Snapshot.Commands.Single(command => command.Name == BrowserLogsBuilderExtensions.OpenTrackedBrowserCommandName).State); 1752var property = snapshot.Properties.Single(property => property.Name == BrowserLogsBuilderExtensions.BrowserSessionsPropertyName);
Aspire.Hosting.Native.Core (1)
Runtime\DeclarativeApplication.cs (1)
342.All(key => resource.Declaration.SymbolicConfiguration.Single(entry => entry.Name == key).Value.References
Aspire.Hosting.Native.Core.Tests (1)
SymbolicValueTests.cs (1)
85Assert.False(runtime.Read().Resources.Single(resource => resource.Name == "source").Healthy);
Aspire.Hosting.Tests (11)
DistributedApplicationTests.cs (6)
259Assert.Contains("TestProject.ServiceA.csproj", notStartedResourceEvent.Snapshot.Properties.Single(p => p.Name == "project.path").Value?.ToString()); 260Assert.Contains("TestProject.ServiceB.csproj", dependentResourceEvent.Snapshot.Properties.Single(p => p.Name == "project.path").Value?.ToString()); 572Assert.Equal(RedisImageSource, notStartedResourceEvent.Snapshot.Properties.Single(p => p.Name == "container.image").Value?.ToString()); 573Assert.Contains("TestProject.ServiceB.csproj", dependentResourceEvent.Snapshot.Properties.Single(p => p.Name == "project.path").Value?.ToString()); 655Assert.Equal(RedisImageSource, notStartedResourceEvent.Snapshot.Properties.Single(p => p.Name == "container.image").Value?.ToString()); 656Assert.Contains("TestProject.ServiceB.csproj", dependentResourceEvent.Snapshot.Properties.Single(p => p.Name == "project.path").Value?.ToString());
ResourceNotificationTests.cs (5)
134Assert.Equal("value", c.Snapshot.Properties.Single(p => p.Name == "A").Value); 142Assert.Equal("value", c.Snapshot.Properties.Single(p => p.Name == "B").Value); 214Assert.Equal("value", c.Snapshot.Properties.Single(p => p.Name == "A").Value); 221Assert.Equal("value", c.Snapshot.Properties.Single(p => p.Name == "B").Value); 228Assert.Equal("value", c.Snapshot.Properties.Single(p => p.Name == "C").Value);
GenerateDocumentationAndConfigFiles (1)
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
1027/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Single{T}(ImmutableArray{T}, Func{T, bool})"/>
Microsoft.CodeAnalysis (1)
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
1027/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Single{T}(ImmutableArray{T}, Func{T, bool})"/>
Microsoft.CodeAnalysis.Analyzers (1)
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
1027/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Single{T}(ImmutableArray{T}, Func{T, bool})"/>
Microsoft.CodeAnalysis.AnalyzerUtilities (3)
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
1027/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Single{T}(ImmutableArray{T}, Func{T, bool})"/>
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\Extensions\ControlFlowGraphExtensions.cs (2)
12public static BasicBlock GetEntry(this ControlFlowGraph cfg) => cfg.Blocks.Single(b => b.Kind == BasicBlockKind.Entry); 13public static BasicBlock GetExit(this ControlFlowGraph cfg) => cfg.Blocks.Single(b => b.Kind == BasicBlockKind.Exit);
Microsoft.CodeAnalysis.CodeStyle (1)
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
1027/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Single{T}(ImmutableArray{T}, Func{T, bool})"/>
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder_Invocation.cs (1)
658var applicable = overloadResolutionResult.Results.Single(r => r.IsApplicable);
Lowering\SyntheticBoundNodeFactory.cs (3)
788var ctor = type.InstanceConstructors.Single(c => c.ParameterCount == args.Length); 797var ctor = type.InstanceConstructors.Single(c => c.ParameterCount == args.Length); 1248var ctor = baseType.InstanceConstructors.Single(c => c.ParameterCount == 0);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
80var helper = s_helpers.Single(h => h.DiagnosticId == diagnostic.Id);
Microsoft.CodeAnalysis.CSharp.Features (2)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
1018return recordType.InstanceConstructors.Single(ctor => ctor.DeclaringSyntaxReferences is [var syntaxRef] && syntaxRef.GetSyntax(cancellationToken) == declaration.Parent);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
80var helper = s_helpers.Single(h => h.DiagnosticId == diagnostic.Id);
Microsoft.CodeAnalysis.Features (3)
Completion\Providers\AbstractAggregateEmbeddedLanguageCompletionProvider.cs (1)
117return _languageProviders.Single(lang => lang.CompletionProvider?.Name == item.GetProperty(EmbeddedProviderName));
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (2)
5761SymbolKey.Create(oldType.InstanceConstructors.Single(c => c.Parameters is []), cancellationToken), 6465parameter = associatedSymbol.GetParameters().Single(p => p.Name == parameter.Name);
Microsoft.CodeAnalysis.NetAnalyzers (2)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\Extensions\ControlFlowGraphExtensions.cs (2)
13public static BasicBlock GetEntry(this ControlFlowGraph cfg) => cfg.Blocks.Single(b => b.Kind == BasicBlockKind.Entry); 14public static BasicBlock GetExit(this ControlFlowGraph cfg) => cfg.Blocks.Single(b => b.Kind == BasicBlockKind.Exit);
Microsoft.CodeAnalysis.Rebuild (1)
CompilationFactory.cs (1)
134var codeViewEntry = OptionsReader.PeReader.ReadDebugDirectory().Single(entry => entry.Type == DebugDirectoryEntryType.CodeView);
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
1027/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Single{T}(ImmutableArray{T}, Func{T, bool})"/>
Microsoft.CodeAnalysis.VisualBasic (2)
Lowering\SyntheticBoundNodeFactory.vb (2)
466Dim ctor = type.InstanceConstructors.Single(Function(c) c.ParameterCount = 0) 807Dim ctor = Me.CurrentMethod.MeParameter.Type.BaseTypeNoUseSiteDiagnostics.InstanceConstructors.Single(Function(c) c.ParameterCount = args.Length)
Microsoft.CodeAnalysis.Workspaces (1)
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
1027/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Single{T}(ImmutableArray{T}, Func{T, bool})"/>
Microsoft.DotNet.HotReload.Watch (1)
HotReload\ProjectUpdatesBuilder.cs (1)
220return instances.Single(instance => string.Equals(instance.GetTargetFramework(), tfm, StringComparison.OrdinalIgnoreCase));
Roslyn.Diagnostics.Analyzers (3)
AbstractApplyTraitToClass`1.cs (2)
86.Single(attributeData => attributeData.ApplicationSyntaxReference is not null && attribute.Span.Contains(attributeData.ApplicationSyntaxReference.Span)); 106.Single(attributeData => attributeData.ApplicationSyntaxReference is not null && attribute.Span.Contains(attributeData.ApplicationSyntaxReference.Span));
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
1027/// Variant of <see cref="System.Linq.ImmutableArrayExtensions.Single{T}(ImmutableArray{T}, Func{T, bool})"/>
System.Text.Json.SourceGeneration (4)
Helpers\RoslynExtensions.cs (4)
420.Single(t => SymbolEqualityComparer.Default.Equals(t.OriginalDefinition, named.OriginalDefinition)); 575.Single(t => SymbolEqualityComparer.Default.Equals(t.OriginalDefinition, typeDef)); 598return outer.GetTypeMembers(type.Name, 0).Single(t => SymbolEqualityComparer.Default.Equals(t.OriginalDefinition, type)); 614INamedTypeSymbol nestedDef = outer.GetTypeMembers(type.Name, paramCount).Single(t => SymbolEqualityComparer.Default.Equals(t.OriginalDefinition, type));