51 references to Single
Aspire.Hosting.Tests (5)
ResourceNotificationTests.cs (5)
83Assert.Equal("value", c.Snapshot.Properties.Single(p => p.Name == "A").Value); 91Assert.Equal("value", c.Snapshot.Properties.Single(p => p.Name == "B").Value); 138Assert.Equal("value", c.Snapshot.Properties.Single(p => p.Name == "A").Value); 145Assert.Equal("value", c.Snapshot.Properties.Single(p => p.Name == "B").Value); 152Assert.Equal("value", c.Snapshot.Properties.Single(p => p.Name == "C").Value);
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
309=> NamingStyles.Single(s => s.ID == namingStyleID);
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder_Invocation.cs (1)
649var applicable = overloadResolutionResult.Results.Single(r => r.IsApplicable);
Lowering\SyntheticBoundNodeFactory.cs (3)
733var ctor = type.InstanceConstructors.Single(c => c.ParameterCount == args.Length); 742var ctor = type.InstanceConstructors.Single(c => c.ParameterCount == args.Length); 1188var ctor = baseType.InstanceConstructors.Single(c => c.ParameterCount == 0);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (1)
CommandLineTests.cs (1)
2258var entry = peReader.ReadDebugDirectory().Single(e => e.Type == DebugDirectoryEntryType.EmbeddedPortablePdb);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (3)
PDB\PDBEmbeddedSourceTests.cs (1)
114var embeddedEntry = peReader.ReadDebugDirectory().Single(e => e.Type == DebugDirectoryEntryType.EmbeddedPortablePdb);
PDB\PDBSourceLinkTests.cs (1)
87var embeddedEntry = peReader.ReadDebugDirectory().Single(e => e.Type == DebugDirectoryEntryType.EmbeddedPortablePdb);
PDB\PortablePdbTests.cs (1)
348var embeddedEntry = peReader.ReadDebugDirectory().Single(e => e.Type == DebugDirectoryEntryType.EmbeddedPortablePdb);
Microsoft.CodeAnalysis.CSharp.Features (1)
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
81var helper = _helpers.Single(h => h.DiagnosticId == diagnostic.Id);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_ILocalFunctionStatement.cs (1)
1874return graph.LocalFunctions.Single(l => l.Name == name);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (2)
InteractiveSessionReferencesTests.cs (2)
155var missingB = m.ReferencedAssemblySymbols.Single(a => a.Name == "libA").Modules.Single().ReferencedAssemblySymbols.Single(a => a.Name == "libB");
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (9)
Semantics\NullableReferenceTypesTests.cs (9)
158065var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 158234var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 158274var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 158315var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 158350var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 158484var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Get"); 158526var found = model.LookupSymbols(item.SpanStart, i3.GetPublicSymbol()).Single(s => s.Name == "Item"); 158570var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item"); 158607var found = model.LookupSymbols(item.SpanStart, t.GetPublicSymbol()).Single(s => s.Name == "Item");
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
Extensions.cs (3)
185return type.InstanceConstructors.Single(c => c.Parameters is [{ Type: var parameterType }] && parameterType.Equals(type, SymbolEqualityComparer.Default)); 191return type.InstanceConstructors.Single(c => c.DeclaringSyntaxReferences.Any(r => r.GetSyntax() is TypeDeclarationSyntax)); 197return type.InstanceConstructors.Single(c => c.Parameters is []);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (4)
CodeGeneration\SyntaxGeneratorTests.cs (4)
2495var method = type.GetMembers().Single(m => m is IMethodSymbol { MethodKind: MethodKind.ExplicitInterfaceImplementation }); 2496var property = type.GetMembers().Single(m => m is IPropertySymbol { IsIndexer: false }); 2497var indexer = type.GetMembers().Single(m => m is IPropertySymbol { IsIndexer: true }); 2498var ev = type.GetMembers().Single(m => m is IEventSymbol);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Completion\AbstractArgumentProviderTests`1.cs (1)
106? arguments.IndexOf(arguments.Single(argument => argument.FullSpan.Start <= position && argument.FullSpan.End >= position))
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeGeneration\CodeGenerationTests.cs (1)
555var attribute = attributeTarget.GetAttributes().Single(attr => Equals(attr.AttributeClass, attributeType));
Microsoft.CodeAnalysis.Features (1)
Completion\Providers\AbstractAggregateEmbeddedLanguageCompletionProvider.cs (1)
119return _languageProviders.Single(lang => lang.CompletionProvider?.Name == item.GetProperty(EmbeddedProviderName));
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Handler\InlineCompletions\XmlSnippetParser.CodeSnippet.cs (1)
69var matchingSnippet = snippets.Value.Single(s => string.Equals(s.Title, snippetTitle, StringComparison.OrdinalIgnoreCase));
Microsoft.CodeAnalysis.Rebuild (1)
CompilationFactory.cs (1)
134var codeViewEntry = OptionsReader.PeReader.ReadDebugDirectory().Single(entry => entry.Type == DebugDirectoryEntryType.CodeView);
Microsoft.CodeAnalysis.Test.Utilities (3)
Diagnostics\CommonDiagnosticAnalyzers.cs (2)
450var descriptor1Info = descriptorsWithInfo.Single(d => d.Descriptor.Id == Descriptor1.Id).Info; 454var descriptor2Info = descriptorsWithInfo.Single(d => d.Descriptor.Id == Descriptor2.Id).Info;
MarkedSource\SourceWithMarkedNodes.cs (1)
118=> GetNode(Root, MarkedSpans.Single(s => s.TagName == tag && s.Id == id));
Microsoft.CodeAnalysis.UnitTests (4)
Collections\ImmutableArrayExtensionsTests.cs (4)
150Assert.Throws<NullReferenceException>(() => default(ImmutableArray<int>).Single(isOdd)); 151Assert.Throws<InvalidOperationException>(() => ImmutableArray.Create<int>().Single(isOdd)); 152Assert.Equal(1, ImmutableArray.Create<int>(1, 2).Single(isOdd)); 153Assert.Throws<InvalidOperationException>(() => ImmutableArray.Create<int>(1, 2, 3).Single(isOdd));
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
309=> NamingStyles.Single(s => s.ID == namingStyleID);
Microsoft.CodeAnalysis.Workspaces.UnitTests (4)
SymbolKeyTests.cs (4)
785var a_b_m = a_b.GetMembers().Single(s => s.Name == "M"); 793var a_string_b_m = a_string_b.GetMembers().Single(s => s.Name == "M"); 799var a_string_b_int_m = a_string_b_int.GetMembers().Single(s => s.Name == "M"); 807var a_b_int_m = a_b_int.GetMembers().Single(s => s.Name == "M");