4049 references to Single
Microsoft.AspNetCore.App.Analyzers (1)
RouteHandlers\RouteHandlerAnalyzer.cs (1)
126var syntaxReference = methodReference.Method.DeclaringSyntaxReferences.Single();
Microsoft.AspNetCore.App.Analyzers.Test (5)
RouteEmbeddedLanguage\Infrastructure\CompletionTestHelpers.cs (1)
22Assert.Equal(textSpans.Single(), results.CompletionListSpan);
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (3)
244textSpan = spans.Length == 0 ? null : spans.Single(); 250textSpan = spans.Single(); 261textSpan = spans.Single();
RouteEmbeddedLanguage\RoutePatternClassifierTests.cs (1)
31var actual = await Runner.GetClassificationSpansAsync(spans.Single(), rewrittenCode);
Microsoft.AspNetCore.App.SourceGenerators (1)
PublicTopLevelProgramGenerator.cs (1)
32.Select(static (symbol, _) => symbol is { DeclaringSyntaxReferences: { Length: 1 } declaringSyntaxReferences } ? declaringSyntaxReferences.Single() : null)
Microsoft.CodeAnalysis (1)
Operations\ControlFlowGraphBuilder.cs (1)
5741HandleVariableDeclarations((VariableDeclarationGroupOperation)initialization.Single());
Microsoft.CodeAnalysis.CodeStyle (4)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
483var getterField = getterFields.TrivialField ?? getterFields.NonTrivialFields.Single();
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
243var parameter = method.Parameters.Single();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
205var typeArgument = typeArguments.Single().ToDisplayParts().Last().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
69return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
918var local = localDeclarationOperation.GetDeclaredVariables().Single();
Microsoft.CodeAnalysis.CSharp (47)
Binder\Binder_Expressions.cs (3)
2576Error(diagnostics, ErrorCode.ERR_ValConstraintNotSatisfied, node, nullableType, nullableType.TypeParameters.Single(), indexType); 2656Error(diagnostics, ErrorCode.ERR_ValConstraintNotSatisfied, node, nullableType, nullableType.TypeParameters.Single(), rangeType); 2683Error(diagnostics, ErrorCode.ERR_ValConstraintNotSatisfied, operand, nullableType, nullableType.TypeParameters.Single(), indexType);
Binder\Binder_Operators.cs (1)
883namedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().Type.SpecialType is SpecialType.System_Byte;
Binder\Binder_Statements.cs (3)
154block.Statements.Single().WasCompilerGenerated == false), "Synthetic node would not get cached"); 3101? retType.GetMemberTypeArgumentsNoUseSiteDiagnostics().Single() 3149returnType = returnType.GetMemberTypeArgumentsNoUseSiteDiagnostics().Single();
Binder\ForEachLoopBinder.cs (2)
544(builder.ElementType.IsNullableType() && builder.ElementType.GetMemberTypeArgumentsNoUseSiteDiagnostics().Single().IsErrorType() && collectionExpr.Type.IsArray())); 1077builder.ElementTypeWithAnnotations = collectionType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single();
Binder\Semantics\Operators\UnaryOperatorSignature.cs (1)
58return Method.ParameterRefKinds.Single();
BoundTree\LengthBasedStringSwitchData.cs (1)
175return casesWithGivenLength.Single().label;
Compilation\BuiltInOperators.cs (1)
693Debug.Assert(((NamedTypeSymbol)readonlySpanOfByte).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().Type.SpecialType is SpecialType.System_Byte);
Compilation\MemberSemanticModel.cs (1)
881lambdaSymbol = symbolInfo.CandidateSymbols.Single().GetSymbol<LambdaSymbol>();
FlowAnalysis\FlowAnalysisPass.cs (1)
125Debug.Assert(elementField == implicitlyInitializedFields.Single());
FlowAnalysis\NullableWalker.cs (2)
3003type = ((NamedTypeSymbol)returnType.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single(); 9269|| handlerData.ArgumentPlaceholders.Single().ArgumentIndex == BoundInterpolatedStringArgumentPlaceholder.TrailingConstructorValidityParameter);
Lowering\AsyncRewriter\AsyncMethodBuilderMemberCollection.cs (1)
256var resultType = returnType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().Type;
Lowering\Instrumentation\DebugInfoInjector.cs (1)
126return block.Update(block.Locals, block.LocalFunctions, block.HasUnsafeModifier, block.Instrumentation, ImmutableArray.Create(InstrumentFieldOrPropertyInitializer(block.Statements.Single(), syntax)));
Lowering\LocalRewriter\LocalRewriter.cs (1)
713var statement = RewriteExpressionStatement((BoundExpressionStatement)block.Statements.Single(), suppressInstrumentation: true);
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (3)
405var elementType = collectionType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single(); 440SynthesizedReadOnlyListKind.SingleElement => this.VisitExpression((BoundExpression)elements.Single()), 449arrayOrList = new BoundObjectCreationExpression(syntax, synthesizedType.Constructors.Single(), fieldValue) { WasCompilerGenerated = true };
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (2)
96var byteType = ((NamedTypeSymbol)node.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().Type; 611createSpan = createSpan.Construct(rewrittenOperand.Type, spanType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().Type);
Symbols\Metadata\PE\PETypeParameterSymbol.cs (1)
278ModifierInfo<TypeSymbol> m = modifiers.Single();
Symbols\NamedTypeSymbol.cs (3)
444return (SynthesizedInstanceConstructor)InstanceConstructors.Single(); 450return (SynthesizedInteractiveInitializerMethod)GetMembers(SynthesizedInteractiveInitializerMethod.InitializerName).Single(); 457return (SynthesizedEntryPointSymbol)GetMembers(name).Single();
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
84yield return (forwardingMethod.ImplementingMethod, forwardingMethod.ExplicitInterfaceImplementations.Single());
Symbols\SymbolExtensions.cs (1)
195return type.IsScriptClass ? type.InstanceConstructors.Single().ThisParameter : null;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListConstructor.cs (2)
29var baseConstructor = ContainingType.BaseTypeNoUseSiteDiagnostics.InstanceConstructors.Single(); 31var parameter = Parameters.Single();
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorConstructor.cs (2)
29var baseConstructor = ContainingType.BaseTypeNoUseSiteDiagnostics.InstanceConstructors.Single(); 31var parameter = Parameters.Single();
Symbols\Synthesized\SynthesizedEmbeddedNativeIntegerAttributeSymbol.cs (3)
79_fields.Single()), 96_fields.Single()), 97factory.Parameter(parameters.Single())
Symbols\Synthesized\SynthesizedEmbeddedNullableAttributeSymbol.cs (4)
83_fields.Single()), 84factory.Parameter(parameters.Single()) 97_fields.Single()), 101factory.Parameter(parameters.Single())
Symbols\Synthesized\SynthesizedEmbeddedNullableContextAttributeSymbol.cs (2)
65factory.Field(factory.This(), _fields.Single()), 66factory.Parameter(parameters.Single()))));
Symbols\Synthesized\SynthesizedEmbeddedNullablePublicOnlyAttributeSymbol.cs (2)
62factory.Field(factory.This(), _fields.Single()), 63factory.Parameter(parameters.Single()))));
Symbols\Synthesized\SynthesizedEmbeddedRefSafetyRulesAttributeSymbol.cs (2)
57factory.Field(factory.This(), _fields.Single()), 58factory.Parameter(parameters.Single()))));
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
109semanticModel.Compilation, ienumerableType.TypeArguments.Single()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
1050return iface.TypeArguments.Single();
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
804return expressions.Single();
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (7)
CommandLineTests.cs (7)
1130resourceDescription = parsedArgs.ManifestResources.Single(); 1137resourceDescription = parsedArgs.ManifestResources.Single(); 1144resourceDescription = parsedArgs.ManifestResources.Single(); 1151resourceDescription = parsedArgs.ManifestResources.Single(); 1287Assert.Equal("a", parsedArgs.MetadataReferences.Single().Properties.Aliases.Single()); 1288Assert.Equal("b", parsedArgs.MetadataReferences.Single().Reference);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (31)
CodeActions\ApplyChangesOperationTests.cs (1)
253var operation = operations.Single();
Completion\CompletionProviders\CrefCompletionProviderTests.cs (1)
450var provider = Assert.IsType<CrefCompletionProvider>(service.GetTestAccessor().GetImportedAndBuiltInProviders(ImmutableHashSet<string>.Empty).Single());
ExtractMethod\ExtractMethodBase.cs (2)
171var validator = new CSharpSelectionValidator(semanticDocument, textSpanOverride ?? namedSpans["b"].Single(), localFunction: false); 184Assert.Equal(namedSpans["r"].Single(), result.FinalSpan);
FixInterpolatedVerbatimString\FixInterpolatedVerbatimStringCommandHandlerTests.cs (1)
67Assert.Equal(expectedSpans.Single().Start, view.Caret.Position.BufferPosition.Position);
Intents\IntentTestsBase.cs (1)
109var priorSelection = testDocument.AnnotatedSpans["priorSelection"].Single();
SymbolKey\SymbolKeyCompilationsTests.cs (4)
228var type = compilation.SourceModule.GlobalNamespace.GetTypeMembers("C").Single(); 468var typeSym02 = namespace2.GetTypeMembers("C2").Single(); 546var typeSym1 = comp1.SourceModule.GlobalNamespace.GetTypeMembers("Test").Single(); 549var typeSym2 = comp2.SourceModule.GlobalNamespace.GetTypeMembers("Test").Single();
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (8)
74var member01 = (typesym.GetMembers("myEvent").Single() as IEventSymbol).Type; 77var member02 = (typesym.GetMembers("Prop").Single() as IPropertySymbol).Type; 83var member04 = (typesym.GetMembers("M").Single() as IMethodSymbol).Parameters[0].Type; 86var member05 = (typesym.GetMembers(WellKnownMemberNames.Indexer).Single() as IPropertySymbol).Type; 239var typeA = comp20.SourceModule.GlobalNamespace.GetTypeMembers("A").Single(); 240var mem20_1 = typeA.GetMembers("GetFileInfo").Single() as IMethodSymbol; 241var mem20_2 = typeA.GetMembers("PrintInfo").Single() as IMethodSymbol; 255var mem40 = typeTest.GetMembers("Main").Single() as IMethodSymbol;
SymbolKey\SymbolKeyTests.cs (1)
122var type = compilation.GlobalNamespace.GetMembers("C").Single().GetMembers("Inner").Single();
Workspaces\WorkspaceTests_EditorFeatures.cs (12)
438var classD = compilation2.SourceModule.GlobalNamespace.GetTypeMembers("D").Single(); 466var classD = compilation2.SourceModule.GlobalNamespace.GetTypeMembers("D").Single(); 500var classD = compilation2.SourceModule.GlobalNamespace.GetTypeMembers("D").Single(); 518var classDz = compilation2Z.SourceModule.GlobalNamespace.GetTypeMembers("D").Single(); 554var classDy = compilation2y.SourceModule.GlobalNamespace.GetTypeMembers("D").Single(); 622var classDy = compilation2y.SourceModule.GlobalNamespace.GetTypeMembers("D").Single(); 652var classDz = compilation2Z.SourceModule.GlobalNamespace.GetTypeMembers("D").Single(); 673var classDz = compilation2Z.SourceModule.GlobalNamespace.GetTypeMembers("D").Single(); 1366Assert.Equal(document.Id, documentIdsWithFilePath.Single()); 1370Assert.Equal(additionalDoc.Id, documentIdsWithFilePath.Single()); 1386Assert.Equal(document.Id, documentIdsWithFilePath.Single()); 1390Assert.Equal(analyzerConfigDoc.Id, documentIdsWithFilePath.Single());
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (99)
CodeGen\CodeGenAsyncIteratorTests.cs (2)
8745var tree = comp.SyntaxTrees.Single(); 8811var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenAsyncMethodBuilderOverrideTests.cs (2)
893var tree = compilation.SyntaxTrees.Single(); 945var tree = compilation.SyntaxTrees.Single();
CodeGen\CodeGenAwaitForeachTests.cs (22)
934var tree = comp.SyntaxTrees.Single(); 1659var tree = comp.SyntaxTrees.Single(); 1719var tree = comp.SyntaxTrees.Single(); 1863var tree = comp.SyntaxTrees.Single(); 1900var tree = comp.SyntaxTrees.Single(); 1940var tree = comp.SyntaxTrees.Single(); 1977var tree = comp.SyntaxTrees.Single(); 2011var tree = comp.SyntaxTrees.Single(); 2967var tree = comp.SyntaxTrees.Single(); 3290var tree = comp.SyntaxTrees.Single(); 3348var tree = comp.SyntaxTrees.Single(); 3544var tree = comp.SyntaxTrees.Single(); 3592var tree = comp.SyntaxTrees.Single(); 4237var tree = comp.SyntaxTrees.Single(); 4460var tree = comp.SyntaxTrees.Single(); 4534var tree = comp.SyntaxTrees.Single(); 4644var tree = comp.SyntaxTrees.Single(); 4743var tree = comp.SyntaxTrees.Single(); 5047var tree = comp.SyntaxTrees.Single(); 5128var tree = comp.SyntaxTrees.Single(); 5354var tree = comp.SyntaxTrees.Single(); 6437var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenCheckedTests.cs (2)
2913var tree = comp.SyntaxTrees.Single(); 2945var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenDeconstructTests.cs (6)
3583Assert.Same(symbol, model.LookupSymbols(decl.SpanStart, name: decl.Identifier.ValueText).Single()); 3603Assert.Same(symbol, model.LookupSymbols(reference.SpanStart, name: decl.Identifier.ValueText).Single()); 3615Assert.Same(field, model.LookupSymbols(decl.SpanStart, name: decl.Identifier.ValueText).Single()); 3622Assert.Same(field, model.LookupSymbols(reference.SpanStart, name: decl.Identifier.ValueText).Single()); 7065var tree = comp.SyntaxTrees.Single(); 8357var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenExprLambdaTests.cs (2)
1847var tree = comp.SyntaxTrees.Single(); 1884var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenForEachTests.cs (1)
1756var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenFunctionPointersTests.cs (1)
7423Assert.True(lambdaSymbol.Parameters.Single().Type.IsErrorType());
CodeGen\CodeGenInterpolatedString.cs (1)
36var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenLocalFunctionTests.cs (1)
144var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenOperators.cs (2)
5694var tree = compilation.SyntaxTrees.Single(); 5732var tree = compilation.SyntaxTrees.Single();
CodeGen\CodeGenRefLocalTests.cs (3)
4030var tree = comp.SyntaxTrees.Single(); 4067var tree = comp.SyntaxTrees.Single(); 4101var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenTupleTest.cs (51)
4837var tree = comp.SyntaxTrees.Single(); 5073var tree = comp.SyntaxTrees.Single(); 5117var tree = comp.SyntaxTrees.Single(); 5158var tree = comp.SyntaxTrees.Single(); 5202var tree = comp.SyntaxTrees.Single(); 5920Assert.Equal(loc1, tuple.GetMembers("i1").Single().Locations.Single()); 5921Assert.Equal(loc2, tuple.GetMembers("i2").Single().Locations.Single()); 6374Assert.True(tupleWithoutNames.GetMembers("Item1").Single().Locations.IsEmpty); 6399Assert.Equal(loc1, tuple.GetMembers("Item1").Single().Locations.Single()); 6400Assert.Equal(loc2, tuple.GetMembers("Item2").Single().Locations.Single()); 7495var tree = comp.SyntaxTrees.Single(); 7528var tree = comp.SyntaxTrees.Single(); 7565var tree = comp.SyntaxTrees.Single(); 7628var tree = comp.SyntaxTrees.Single(); 12690var tree = c.SyntaxTrees.Single(); 13971var tree = c.SyntaxTrees.Single(); 14242var tree = c.SyntaxTrees.Single(); 14333var m5Tuple = ((IMethodSymbol)symbolInfo.Symbol).TypeParameters[0].ConstraintTypes.Single(); 14435e1Tuple = (INamedTypeSymbol)((IEventSymbol)symbolInfo.CandidateSymbols.Single()).Type; 16537var tree = comp.SyntaxTrees.Single(); 24257var tree = comp.SyntaxTrees.Single(); 24320var tree = comp.SyntaxTrees.Single(); 24384var tree = comp.SyntaxTrees.Single(); 24457var tree = comp.SyntaxTrees.Single(); 24530var tree = comp.SyntaxTrees.Single(); 24604var tree = comp.SyntaxTrees.Single(); 25022var tree = comp.SyntaxTrees.Single(); 25050var tree = comp.SyntaxTrees.Single(); 25081var tree = comp.SyntaxTrees.Single(); 25701var tree = comp.SyntaxTrees.Single(); 25772var tree = comp.SyntaxTrees.Single(); 25837var tree = comp.SyntaxTrees.Single(); 25879var tree = comp.SyntaxTrees.Single(); 25909var tree = comp.SyntaxTrees.Single(); 27396var containingType = comp.GlobalNamespace.GetTypeMembers("Program").Single(); 27397VerifyTypeFromCSharp((NamedTypeSymbol)((FieldSymbol)containingType.GetMembers("F0").Single()).Type, TupleUnderlyingTypeValue.Same, TupleUnderlyingTypeValue.Null, TupleUnderlyingTypeValue.Same, TupleUnderlyingTypeValue.Null, "System.ValueTuple", "()"); 27398VerifyTypeFromCSharp((NamedTypeSymbol)((FieldSymbol)containingType.GetMembers("F1").Single()).Type, TupleUnderlyingTypeValue.Same, TupleUnderlyingTypeValue.Null, TupleUnderlyingTypeValue.Same, TupleUnderlyingTypeValue.Null, "(System.Int32, System.Int32)", "(System.Int32, System.Int32)"); 27399VerifyTypeFromCSharp((NamedTypeSymbol)((FieldSymbol)containingType.GetMembers("F2").Single()).Type, TupleUnderlyingTypeValue.Distinct, TupleUnderlyingTypeValue.Distinct, TupleUnderlyingTypeValue.Same, TupleUnderlyingTypeValue.Null, "(System.Int32 A, System.Int32 B)", "(A As System.Int32, B As System.Int32)"); 27400VerifyTypeFromCSharp((NamedTypeSymbol)((FieldSymbol)containingType.GetMembers("F3").Single()).Type, TupleUnderlyingTypeValue.Same, TupleUnderlyingTypeValue.Null, TupleUnderlyingTypeValue.Null, TupleUnderlyingTypeValue.Null, "(System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object)", "(System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object)"); 27401VerifyTypeFromCSharp((NamedTypeSymbol)((FieldSymbol)containingType.GetMembers("F4").Single()).Type, TupleUnderlyingTypeValue.Distinct, TupleUnderlyingTypeValue.Distinct, TupleUnderlyingTypeValue.Null, TupleUnderlyingTypeValue.Null, "(System.Object, System.Object B, System.Object, System.Object D, System.Object, System.Object F, System.Object, System.Object H)", "(System.Object, B As System.Object, System.Object, D As System.Object, System.Object, F As System.Object, System.Object, H As System.Object)"); 27418var containingType = comp.GlobalNamespace.GetTypeMembers("Program").Single(); 27419VerifyTypeFromVisualBasic((INamedTypeSymbol)((IFieldSymbol)containingType.GetMembers("F0").Single()).Type, TupleUnderlyingTypeValue.Null, "System.ValueTuple", "System.ValueTuple"); 27420VerifyTypeFromVisualBasic((INamedTypeSymbol)((IFieldSymbol)containingType.GetMembers("F1").Single()).Type, TupleUnderlyingTypeValue.Distinct, "(System.Int32, System.Int32)", "(System.Int32, System.Int32)"); 27421VerifyTypeFromVisualBasic((INamedTypeSymbol)((IFieldSymbol)containingType.GetMembers("F2").Single()).Type, TupleUnderlyingTypeValue.Distinct, "(System.Int32 A, System.Int32 B)", "(A As System.Int32, B As System.Int32)"); 27422VerifyTypeFromVisualBasic((INamedTypeSymbol)((IFieldSymbol)containingType.GetMembers("F3").Single()).Type, TupleUnderlyingTypeValue.Distinct, "(System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object)", "(System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object, System.Object)"); 27423VerifyTypeFromVisualBasic((INamedTypeSymbol)((IFieldSymbol)containingType.GetMembers("F4").Single()).Type, TupleUnderlyingTypeValue.Distinct, "(System.Object, System.Object B, System.Object, System.Object D, System.Object, System.Object F, System.Object, System.Object H)", "(System.Object, B As System.Object, System.Object, D As System.Object, System.Object, F As System.Object, System.Object, H As System.Object)"); 27565var tree = comp.SyntaxTrees.Single();
Emit\CompilationEmitTests.cs (2)
5214var err = result.Diagnostics.Single(); 5225err = result.Diagnostics.Single();
Emit\InAttributeModifierTests.cs (1)
4565var modifier = modifiers.Single();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (15)
CodeGen\IndexAndRangeTests.cs (10)
89var tree = comp.SyntaxTrees.Single(); 330var tree = comp.SyntaxTrees.Single(); 417var tree = comp.SyntaxTrees.Single(); 504var tree = comp.SyntaxTrees.Single(); 622var tree = comp.SyntaxTrees.Single(); 1571var tree = comp.SyntaxTrees.Single(); 1806var tree = comp.SyntaxTrees.Single(); 2261var tree = comp.SyntaxTrees.Single(); 3017var tree = comp.SyntaxTrees.Single(); 3131var tree = comp.SyntaxTrees.Single();
Emit\NumericIntPtrTests.cs (5)
11171var tree = comp.SyntaxTrees.Single(); 11194var tree = comp.SyntaxTrees.Single(); 11222var tree = comp.SyntaxTrees.Single(); 11247var tree = comp.SyntaxTrees.Single(); 11292var tree = comp.SyntaxTrees.Single();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (992)
Attributes\AttributeTests.cs (6)
654Assert.Equal(TypedConstantKind.Array, attributeData.ConstructorArguments.Single().Kind); 655Assert.Equal(new object[] { 1, 2, 3 }, attributeData.ConstructorArguments.Single().Values.Select(arg => arg.Value)); 712Assert.Equal("M0", attrs.Single().ConstructorArguments.Single().Value); 7534var tree = compilation.SyntaxTrees.Single(); 7575var tree = compilation.SyntaxTrees.Single();
Attributes\AttributeTests_CallerInfoAttributes.cs (1)
2299var arguments = compilation.GetTypeByMetadataName("Program").GetAttributes().Single().CommonConstructorArguments;
Attributes\AttributeTests_Dynamic.cs (1)
538Assert.Equal("System.Boolean[]", dynamicAttribute.AttributeConstructor.Parameters.Single().TypeWithAnnotations.ToTestDisplayString());
Attributes\AttributeTests_RefReadOnly.cs (4)
1376var tree = compilation.SyntaxTrees.Single(); 1418var tree = compilation.SyntaxTrees.Single(); 1447var tree = compilation.SyntaxTrees.Single(); 1474var tree = compilation.SyntaxTrees.Single();
Attributes\AttributeTests_Synthesized.cs (2)
65Assert.Equal("System.Int32", attribute.AttributeConstructor.Parameters.Single().TypeWithAnnotations.ToTestDisplayString()); 93Assert.Equal("System.Diagnostics.DebuggableAttribute.DebuggingModes", attribute.AttributeConstructor.Parameters.Single().TypeWithAnnotations.ToTestDisplayString());
Attributes\AttributeTests_Tuples.cs (1)
629Assert.Equal("System.String[]", tupleAttr.AttributeConstructor.Parameters.Single().TypeWithAnnotations.ToTestDisplayString());
Attributes\AttributeTests_WellKnownAttributes.cs (17)
8297var diag = diags.Single(); 8330var diag = diags.Single(); 8361var diag = diags.Single(); 8392var diag = diags.Single(); 8463var diag = diags.Single(); 8708var diag = diags.Single(); 8751var diag = diags.Single(); 8853var diag = diags.Single(); 8955var diag = diags.Single(); 9138var diag = diags.Single(); 9189var diag = diags.Single(); 9330var diag = diags.Single(); 9468var diag = diags.Single(); 9518var diag = diags.Single(); 9547var tree = comp.SyntaxTrees.Single(); 9596var tree = comp.SyntaxTrees.Single(); 9652var tree = comp2.SyntaxTrees.Single();
Attributes\InternalsVisibleToAndStrongNameTests.cs (2)
399var err = other.GetDiagnostics().Single(); 1611var err = other.GetDiagnostics().Single();
Diagnostics\DiagnosticAnalyzerTests.cs (2)
1012var treeInAnotherCompilation = anotherCompilation.SyntaxTrees.Single(); 1102var treeInAnotherCompilation = compilation.SyntaxTrees.Single();
Diagnostics\DiagnosticSuppressorTests.cs (1)
647Assert.Equal(suppression, suppressionInfo.ProgrammaticSuppressions.Single());
Diagnostics\GetDiagnosticsTests.cs (12)
44var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 79var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 94var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 118var diag = compilation.GetDiagnostics().Single(); 517Assert.False(diagnostics.Single().IsSuppressed); 529Assert.False(analyzerDiagnostics.Single().IsSuppressed); 560ImmutableDictionary<object, AnalyzerConfigOptions>.Empty.Add(compilation.SyntaxTrees.Single(), analyzerConfigOptions), 572var diagnostic = diagnostics.Single(); 620var diagnostic = analyzerDiagnostics.Single(); 1436var compilationDiagnostic = compilationDiagnostics.Single(); 1441var analyzerDiagnostic = analyzerDiagnostics.Single(); 1462analyzerDiagnostic = analyzerDiagnostics.Single();
FieldKeywordTests.cs (4)
1273var tree = comp.SyntaxTrees.Single(); 1331var tree = comp.SyntaxTrees.Single(); 10488var tree = comp.SyntaxTrees.Single(); 10522var tree = comp.SyntaxTrees.Single();
FirstClassSpanTests.cs (4)
2820var tree = comp.SyntaxTrees.Single(); 2853var tree = comp.SyntaxTrees.Single(); 4998var tree = comp.SyntaxTrees.Single(); 5006AssertEx.Equal("System.Int32 System.Span<System.Int32>.M(System.Int32 y)", lookupResult.Single().ToTestDisplayString());
FlowAnalysis\RegionAnalysisTests.cs (14)
1460Assert.Equal("System.Int32 y", dataFlows.DataFlowsIn.Single().ToTestDisplayString()); 1461Assert.Equal("System.Int32 y", dataFlows.ReadInside.Single().ToTestDisplayString()); 1478Assert.Equal("System.Int32 y", dataFlows.DataFlowsIn.Single().ToTestDisplayString()); 1479Assert.Equal("System.Int32 y", dataFlows.ReadInside.Single().ToTestDisplayString()); 1515Assert.Equal("this", dataFlows.ReadInside.Single().Name); 5532var tree = comp.SyntaxTrees.Single(); 5576var tree = comp.SyntaxTrees.Single(); 6214var tree = comp.SyntaxTrees.Single(); 6222Assert.Equal("MyClass this", flowAnalysis.DataFlowsIn.Single().ToTestDisplayString()); 6224Assert.Equal("MyClass this", flowAnalysis.ReadInside.Single().ToTestDisplayString()); 6226Assert.Equal("MyClass this", flowAnalysis.WrittenOutside.Single().ToTestDisplayString()); 6230Assert.Equal("MyClass this", flowAnalysis.Captured.Single().ToTestDisplayString()); 6231Assert.Equal("MyClass this", flowAnalysis.DataFlowsIn.Single().ToTestDisplayString()); 6233Assert.Equal("MyClass this", flowAnalysis.ReadInside.Single().ToTestDisplayString());
OverloadResolutionPriorityTests.cs (1)
906var attr = c!.GetAttributes().Single();
RefReadonlyParameterTests.cs (4)
7100var tree = comp.SyntaxTrees.Single(); 7106Assert.Equal(refKind, methodFromCref!.Parameters.Single().RefKind); 7128var tree = comp.SyntaxTrees.Single(); 7134Assert.Equal(RefKind.RefReadOnlyParameter, methodFromCref!.Parameters.Single().RefKind);
RefStructInterfacesTests.cs (65)
6627var tree = comp.SyntaxTrees.Single(); 6764var tree = comp.SyntaxTrees.Single(); 6880var tree = comp.SyntaxTrees.Single(); 7012var tree = comp.SyntaxTrees.Single(); 7141var tree = comp.SyntaxTrees.Single(); 7471var tree = comp.SyntaxTrees.Single(); 7661var tree = comp.SyntaxTrees.Single(); 7880var tree = comp.SyntaxTrees.Single(); 8074var tree = comp.SyntaxTrees.Single(); 8267var tree = comp.SyntaxTrees.Single(); 8440var tree = comp.SyntaxTrees.Single(); 8546var tree = comp.SyntaxTrees.Single(); 8930var tree = comp.SyntaxTrees.Single(); 9134var tree = comp.SyntaxTrees.Single(); 9330var tree = comp.SyntaxTrees.Single(); 9498var tree = comp.SyntaxTrees.Single(); 9713var tree = comp.SyntaxTrees.Single(); 9934var tree = comp.SyntaxTrees.Single(); 10149var tree = comp.SyntaxTrees.Single(); 10346var tree = comp.SyntaxTrees.Single(); 10441var tree = comp.SyntaxTrees.Single(); 10541var tree = comp.SyntaxTrees.Single(); 10738var tree = comp.SyntaxTrees.Single(); 10978var tree = comp.SyntaxTrees.Single(); 11197var tree = comp.SyntaxTrees.Single(); 11421var tree = comp.SyntaxTrees.Single(); 11604var tree = comp.SyntaxTrees.Single(); 11699var tree = comp.SyntaxTrees.Single(); 12147var tree = comp1.SyntaxTrees.Single(); 12415var tree = comp1.SyntaxTrees.Single(); 12660var tree = comp1.SyntaxTrees.Single(); 12923var tree = comp1.SyntaxTrees.Single(); 13190var tree = comp1.SyntaxTrees.Single(); 13452var tree = comp1.SyntaxTrees.Single(); 14150var tree = comp.SyntaxTrees.Single(); 14491var tree = comp.SyntaxTrees.Single(); 14853var tree = comp.SyntaxTrees.Single(); 15204var tree = comp.SyntaxTrees.Single(); 15552var tree = comp.SyntaxTrees.Single(); 15731var tree = comp.SyntaxTrees.Single(); 15986var tree = comp.SyntaxTrees.Single(); 16757var tree = comp.SyntaxTrees.Single(); 16822var tree = comp.SyntaxTrees.Single(); 16887var tree = comp.SyntaxTrees.Single(); 16971var tree = comp.SyntaxTrees.Single(); 17059var tree = comp.SyntaxTrees.Single(); 17152var tree = comp.SyntaxTrees.Single(); 17249var tree = comp.SyntaxTrees.Single(); 17333var tree = comp.SyntaxTrees.Single(); 17654var tree = comp.SyntaxTrees.Single(); 17851var tree = comp.SyntaxTrees.Single(); 18074var tree = comp.SyntaxTrees.Single(); 18274var tree = comp.SyntaxTrees.Single(); 18475var tree = comp.SyntaxTrees.Single(); 18651var tree = comp.SyntaxTrees.Single(); 18759var tree = comp.SyntaxTrees.Single(); 19127var tree = comp.SyntaxTrees.Single(); 19298var tree = comp.SyntaxTrees.Single(); 19471var tree = comp.SyntaxTrees.Single(); 19623var tree = comp.SyntaxTrees.Single(); 19861var tree = comp.SyntaxTrees.Single(); 19965var tree = comp.SyntaxTrees.Single(); 21235var tree = comp2.SyntaxTrees.Single(); 21303var tree = comp.SyntaxTrees.Single(); 21705var tree = comp.SyntaxTrees.Single();
Semantics\CollectionExpressionTests.cs (4)
31479var tree = comp.SyntaxTrees.Single(); 31527var tree = comp.SyntaxTrees.Single(); 31585var tree = comp.SyntaxTrees.Single(); 31683var tree = comp.SyntaxTrees.Single();
Semantics\ExperimentalAttributeTests.cs (13)
63var diag = comp.GetDiagnostics().Single(); 1070var diag = comp.GetDiagnostics().Single(); 1099var diag = comp.GetDiagnostics().Single(); 1130var diag = comp.GetDiagnostics().Single(); 1161var diag = comp.GetDiagnostics().Single(); 1192var diag = comp.GetDiagnostics().Single(); 1811var diag = comp.GetDiagnostics().Single(); 1852var diag = comp.GetDiagnostics().Single(); 1893var diag = comp.GetDiagnostics().Single(); 1919var diag = comp.GetDiagnostics().Single(); 1945var diag = comp.GetDiagnostics().Single(); 1976var diag = comp.GetDiagnostics().Single(); 2002var diag = comp.GetDiagnostics().Single();
Semantics\OutVarTests.cs (452)
56var tree = compilation.SyntaxTrees.Single(); 100var tree = compilation.SyntaxTrees.Single(); 123tree = compilation.SyntaxTrees.Single(); 178Assert.False(compilation.SyntaxTrees.Single().GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Any()); 216var tree = compilation.SyntaxTrees.Single(); 269var tree = compilation.SyntaxTrees.Single(); 332var tree = compilation.SyntaxTrees.Single(); 386Assert.False(compilation.SyntaxTrees.Single().GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Any()); 423Assert.False(compilation.SyntaxTrees.Single().GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Any()); 461Assert.False(compilation.SyntaxTrees.Single().GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Any()); 499Assert.False(compilation.SyntaxTrees.Single().GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Any()); 537Assert.False(compilation.SyntaxTrees.Single().GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Any()); 575Assert.False(compilation.SyntaxTrees.Single().GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Any()); 622Assert.False(compilation.SyntaxTrees.Single().GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Any()); 659Assert.False(compilation.SyntaxTrees.Single().GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Any()); 697Assert.False(compilation.SyntaxTrees.Single().GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Any()); 737Assert.False(compilation.SyntaxTrees.Single().GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Any()); 776Assert.False(compilation.SyntaxTrees.Single().GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Any()); 816Assert.False(compilation.SyntaxTrees.Single().GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Any()); 907var tree = compilation.SyntaxTrees.Single(); 968Assert.Equal(variableDeclaratorSyntax, symbol.DeclaringSyntaxReferences.Single().GetSyntax()); 973var other = model.LookupSymbols(decl.SpanStart, name: decl.Identifier().ValueText).Single(); 992Assert.Same(symbol, model.LookupSymbols(reference.SpanStart, name: decl.Identifier().ValueText).Single()); 1142Assert.Equal(variableDesignationSyntax, symbol.DeclaringSyntaxReferences.Single().GetSyntax()); 1145Assert.NotEqual(symbol, model.LookupSymbols(decl.SpanStart, name: decl.Identifier().ValueText).Single()); 1166Assert.Same(symbol, model.LookupSymbols(reference.SpanStart, name: reference.Identifier.ValueText).Single()); 1197Assert.Same(symbol, model.LookupSymbols(reference.SpanStart, name: reference.Identifier.ValueText).Single()); 1404var tree = compilation.SyntaxTrees.Single(); 1462var tree = compilation.SyntaxTrees.Single(); 1496var tree = compilation.SyntaxTrees.Single(); 1531var tree = compilation.SyntaxTrees.Single(); 1565var tree = compilation.SyntaxTrees.Single(); 1599var tree = compilation.SyntaxTrees.Single(); 1639var tree = compilation.SyntaxTrees.Single(); 1677var tree = compilation.SyntaxTrees.Single(); 1714var tree = compilation.SyntaxTrees.Single(); 1750var tree = compilation.SyntaxTrees.Single(); 1883var tree = compilation.SyntaxTrees.Single(); 2004var tree = compilation.SyntaxTrees.Single(); 2114var tree = compilation.SyntaxTrees.Single(); 2225var tree = compilation.SyntaxTrees.Single(); 2335var tree = compilation.SyntaxTrees.Single(); 2470var tree = compilation.SyntaxTrees.Single(); 2637var tree = compilation.SyntaxTrees.Single(); 2854var tree = compilation.SyntaxTrees.Single(); 2949var tree = compilation.SyntaxTrees.Single(); 3201var tree = compilation.SyntaxTrees.Single(); 3303var tree = compilation.SyntaxTrees.Single(); 3375var tree = compilation.SyntaxTrees.Single(); 3427var tree = compilation.SyntaxTrees.Single(); 3461var tree = compilation.SyntaxTrees.Single(); 3502var tree = compilation.SyntaxTrees.Single(); 3643var tree = compilation.SyntaxTrees.Single(); 3864var tree = compilation.SyntaxTrees.Single(); 3961var tree = compilation.SyntaxTrees.Single(); 3997var tree = compilation.SyntaxTrees.Single(); 4052var tree = compilation.SyntaxTrees.Single(); 4096var tree = compilation.SyntaxTrees.Single(); 4147var tree = compilation.SyntaxTrees.Single(); 4207var tree = compilation.SyntaxTrees.Single(); 4273var tree = compilation.SyntaxTrees.Single(); 4496var tree = compilation.SyntaxTrees.Single(); 4675var tree = compilation.SyntaxTrees.Single(); 4916var tree = compilation.SyntaxTrees.Single(); 5018var tree = compilation.SyntaxTrees.Single(); 5065var tree = compilation.SyntaxTrees.Single(); 5103var tree = compilation.SyntaxTrees.Single(); 5180var tree = compilation.SyntaxTrees.Single(); 5283var tree = compilation.SyntaxTrees.Single(); 5410var tree = compilation.SyntaxTrees.Single(); 5512var tree = compilation.SyntaxTrees.Single(); 5576var tree = compilation.SyntaxTrees.Single(); 5708var tree = compilation.SyntaxTrees.Single(); 5748var tree = compilation.SyntaxTrees.Single(); 5909var tree = compilation.SyntaxTrees.Single(); 6050var tree = compilation.SyntaxTrees.Single(); 6327var tree = compilation.SyntaxTrees.Single(); 6562var tree = compilation.SyntaxTrees.Single(); 6818var tree = compilation.SyntaxTrees.Single(); 7064var tree = compilation.SyntaxTrees.Single(); 7302var tree = compilation.SyntaxTrees.Single(); 7624var tree = compilation.SyntaxTrees.Single(); 7773var tree = compilation.SyntaxTrees.Single(); 7833var tree = compilation.SyntaxTrees.Single(); 7895var tree = compilation.SyntaxTrees.Single(); 7961var tree = compilation.SyntaxTrees.Single(); 8025var tree = compilation.SyntaxTrees.Single(); 8092var tree = compilation.SyntaxTrees.Single(); 8154var tree = compilation.SyntaxTrees.Single(); 8209var tree = compilation.SyntaxTrees.Single(); 8387var tree = compilation.SyntaxTrees.Single(); 8487var tree = compilation.SyntaxTrees.Single(); 8659var tree = compilation.SyntaxTrees.Single(); 8761var tree = compilation.SyntaxTrees.Single(); 8797var tree = compilation.SyntaxTrees.Single(); 8869var tree = compilation.SyntaxTrees.Single(); 8919var tree = compilation.SyntaxTrees.Single(); 9161var tree = compilation.SyntaxTrees.Single(); 9263var tree = compilation.SyntaxTrees.Single(); 9334var tree = compilation.SyntaxTrees.Single(); 9427var tree = compilation.SyntaxTrees.Single(); 9507var tree = compilation.SyntaxTrees.Single(); 9583var tree = compilation.SyntaxTrees.Single(); 9636var tree = compilation.SyntaxTrees.Single(); 9654Assert.Equal("System.Int64 y1", model.LookupSymbols(x1Ref[0].SpanStart, name: "y1").Single().ToTestDisplayString()); 9693var tree = compilation.SyntaxTrees.Single(); 9758var tree = compilation.SyntaxTrees.Single(); 9815var tree = compilation.SyntaxTrees.Single(); 9890var tree = compilation.SyntaxTrees.Single(); 9985var tree = compilation.SyntaxTrees.Single(); 10067var tree = compilation.SyntaxTrees.Single(); 10148var tree = compilation.SyntaxTrees.Single(); 10204var tree = compilation.SyntaxTrees.Single(); 10222Assert.Equal("System.Boolean y1", model.LookupSymbols(x1Ref[0].SpanStart, name: "y1").Single().ToTestDisplayString()); 10260var tree = compilation.SyntaxTrees.Single(); 10327var tree = compilation.SyntaxTrees.Single(); 10386var tree = compilation.SyntaxTrees.Single(); 10458var tree = compilation.SyntaxTrees.Single(); 10542var tree = compilation.SyntaxTrees.Single(); 10720var tree = compilation.SyntaxTrees.Single(); 10817var tree = compilation.SyntaxTrees.Single(); 10853var tree = compilation.SyntaxTrees.Single(); 10908var tree = compilation.SyntaxTrees.Single(); 10958var tree = compilation.SyntaxTrees.Single(); 11046var tree = compilation.SyntaxTrees.Single(); 11183var tree = compilation.SyntaxTrees.Single(); 11265var tree = compilation.SyntaxTrees.Single(); 11334var tree = compilation.SyntaxTrees.Single(); 11427var tree = compilation.SyntaxTrees.Single(); 11467var tree = compilation.SyntaxTrees.Single(); 11715var tree = compilation.SyntaxTrees.Single(); 11972var tree = compilation.SyntaxTrees.Single(); 12124var tree = compilation.SyntaxTrees.Single(); 12274var tree = compilation.SyntaxTrees.Single(); 12351var tree = compilation.SyntaxTrees.Single(); 12420var tree = compilation.SyntaxTrees.Single(); 12496var tree = compilation.SyntaxTrees.Single(); 12658var tree = compilation.SyntaxTrees.Single(); 12778var tree = compilation.SyntaxTrees.Single(); 12865var tree = compilation.SyntaxTrees.Single(); 12920var tree = compilation.SyntaxTrees.Single(); 12962var tree = compilation.SyntaxTrees.Single(); 13017var tree = compilation.SyntaxTrees.Single(); 13201var tree = compilation.SyntaxTrees.Single(); 13295var tree = compilation.SyntaxTrees.Single(); 13333var tree = compilation.SyntaxTrees.Single(); 13385var tree = compilation.SyntaxTrees.Single(); 13439var tree = compilation.SyntaxTrees.Single(); 13605var tree = compilation.SyntaxTrees.Single(); 13696var tree = compilation.SyntaxTrees.Single(); 13732var tree = compilation.SyntaxTrees.Single(); 13796var tree = compilation.SyntaxTrees.Single(); 13846var tree = compilation.SyntaxTrees.Single(); 14127var tree = compilation.SyntaxTrees.Single(); 14256var tree = compilation.SyntaxTrees.Single(); 14303var tree = compilation.SyntaxTrees.Single(); 14352var tree = compilation.SyntaxTrees.Single(); 14394var tree = compilation.SyntaxTrees.Single(); 14436var tree = compilation.SyntaxTrees.Single(); 14481var tree = compilation.SyntaxTrees.Single(); 14523var tree = compilation.SyntaxTrees.Single(); 14568var tree = compilation.SyntaxTrees.Single(); 14617var tree = compilation.SyntaxTrees.Single(); 14671var tree = compilation.SyntaxTrees.Single(); 14730var tree = compilation.SyntaxTrees.Single(); 14777var tree = compilation.SyntaxTrees.Single(); 14827var tree = compilation.SyntaxTrees.Single(); 14942var tree = compilation.SyntaxTrees.Single(); 15122var tree = compilation.SyntaxTrees.Single(); 15215var tree = compilation.SyntaxTrees.Single(); 15253var tree = compilation.SyntaxTrees.Single(); 15311var tree = compilation.SyntaxTrees.Single(); 15369var tree = compilation.SyntaxTrees.Single(); 15530var tree = compilation.SyntaxTrees.Single(); 15743var tree = compilation.SyntaxTrees.Single(); 15956var tree = compilation.SyntaxTrees.Single(); 16071var tree = compilation.SyntaxTrees.Single(); 16158var tree = compilation.SyntaxTrees.Single(); 16399var tree = compilation.SyntaxTrees.Single(); 16495var tree = compilation.SyntaxTrees.Single(); 16531var tree = compilation.SyntaxTrees.Single(); 16588var tree = compilation.SyntaxTrees.Single(); 16642var tree = compilation.SyntaxTrees.Single(); 16702var tree = compilation.SyntaxTrees.Single(); 16762var tree = compilation.SyntaxTrees.Single(); 16825var tree = compilation.SyntaxTrees.Single(); 16959var tree = compilation.SyntaxTrees.Single(); 17051var tree = compilation.SyntaxTrees.Single(); 17090var tree = compilation.SyntaxTrees.Single(); 17148var tree = compilation.SyntaxTrees.Single(); 17202var tree = compilation.SyntaxTrees.Single(); 17386var tree = compilation.SyntaxTrees.Single(); 17488var tree = compilation.SyntaxTrees.Single(); 17526var tree = compilation.SyntaxTrees.Single(); 17589var tree = compilation.SyntaxTrees.Single(); 17642var tree = compilation.SyntaxTrees.Single(); 17677var tree = compilation.SyntaxTrees.Single(); 17710var tree = compilation.SyntaxTrees.Single(); 17743var tree = compilation.SyntaxTrees.Single(); 17754Assert.Equal("System.Int32 x2", dataFlow.VariablesDeclared.Single().ToTestDisplayString()); 17755Assert.Equal("System.Int32 x1", dataFlow.WrittenOutside.Single().ToTestDisplayString()); 17782var tree = compilation.SyntaxTrees.Single(); 17829var tree = compilation.SyntaxTrees.Single(); 17859var tree = compilation.SyntaxTrees.Single(); 17890var tree = compilation.SyntaxTrees.Single(); 17919var tree = compilation.SyntaxTrees.Single(); 17951var tree = compilation.SyntaxTrees.Single(); 17993var tree = compilation.SyntaxTrees.Single(); 18030var tree = compilation.SyntaxTrees.Single(); 18067var tree = compilation.SyntaxTrees.Single(); 18102var tree = compilation.SyntaxTrees.Single(); 18141var tree = compilation.SyntaxTrees.Single(); 18182var tree = compilation.SyntaxTrees.Single(); 18225var tree = compilation.SyntaxTrees.Single(); 18268var tree = compilation.SyntaxTrees.Single(); 18307var tree = compilation.SyntaxTrees.Single(); 18348var tree = compilation.SyntaxTrees.Single(); 18383var tree = compilation.SyntaxTrees.Single(); 18429var tree = compilation.SyntaxTrees.Single(); 18493var tree = compilation.SyntaxTrees.Single(); 18542var tree = compilation.SyntaxTrees.Single(); 18587var tree = compilation.SyntaxTrees.Single(); 18639var tree = compilation.SyntaxTrees.Single(); 18683var tree = compilation.SyntaxTrees.Single(); 18725var tree = compilation.SyntaxTrees.Single(); 18779var tree = compilation.SyntaxTrees.Single(); 18872var tree = compilation.SyntaxTrees.Single(); 18916var tree = compilation.SyntaxTrees.Single(); 18958var tree = compilation.SyntaxTrees.Single(); 19011var tree = compilation.SyntaxTrees.Single(); 19056var tree = compilation.SyntaxTrees.Single(); 19099var tree = compilation.SyntaxTrees.Single(); 19153var tree = compilation.SyntaxTrees.Single(); 19202var tree = compilation.SyntaxTrees.Single(); 19249var tree = compilation.SyntaxTrees.Single(); 19287var tree = compilation.SyntaxTrees.Single(); 19328var tree = compilation.SyntaxTrees.Single(); 19362var tree = compilation.SyntaxTrees.Single(); 19423var tree = compilation.SyntaxTrees.Single(); 19468var tree = compilation.SyntaxTrees.Single(); 19506var tree = compilation.SyntaxTrees.Single(); 19545var tree = compilation.SyntaxTrees.Single(); 19589var tree = compilation.SyntaxTrees.Single(); 19658var tree = compilation.SyntaxTrees.Single(); 19686var tree = compilation.SyntaxTrees.Single(); 19729var tree = compilation.SyntaxTrees.Single(); 19767var tree = compilation.SyntaxTrees.Single(); 19840var tree = compilation.SyntaxTrees.Single(); 19873var tree = compilation.SyntaxTrees.Single(); 19906var tree = compilation.SyntaxTrees.Single(); 19941var tree = compilation.SyntaxTrees.Single(); 19976var tree = compilation.SyntaxTrees.Single(); 20014var tree = compilation.SyntaxTrees.Single(); 20046var tree = compilation.SyntaxTrees.Single(); 20220var tree = compilation.SyntaxTrees.Single(); 20248var tree = compilation.SyntaxTrees.Single(); 20613var tree = compilation.SyntaxTrees.Single(); 20656var tree = compilation.SyntaxTrees.Single(); 20773var tree = compilation.SyntaxTrees.Single(); 20826var tree = compilation.SyntaxTrees.Single(); 20917var tree = compilation.SyntaxTrees.Single(); 21036var tree = compilation.SyntaxTrees.Single(); 21131var tree = compilation.SyntaxTrees.Single(); 21235var tree = compilation.SyntaxTrees.Single(); 21292var tree = compilation.SyntaxTrees.Single(); 21311var y1 = model.LookupSymbols(x1Ref[0].SpanStart, name: "y1").Single(); 21360var tree = compilation.SyntaxTrees.Single(); 21410var tree = compilation.SyntaxTrees.Single(); 21644var tree = compilation.SyntaxTrees.Single(); 21817var tree = compilation.SyntaxTrees.Single(); 22011var tree = compilation.SyntaxTrees.Single(); 22138var tree = compilation.SyntaxTrees.Single(); 22236var tree = compilation.SyntaxTrees.Single(); 22424var tree = compilation.SyntaxTrees.Single(); 22579var tree = compilation.SyntaxTrees.Single(); 22658var tree = compilation.SyntaxTrees.Single(); 22781var tree = compilation.SyntaxTrees.Single(); 22863var tree = compilation.SyntaxTrees.Single(); 22947var tree = compilation.SyntaxTrees.Single(); 23014var tree = compilation.SyntaxTrees.Single(); 23053var tree = compilation.SyntaxTrees.Single(); 23209var tree = compilation.SyntaxTrees.Single(); 23303var tree = compilation.SyntaxTrees.Single(); 23393var tree = compilation.SyntaxTrees.Single(); 23441var tree = compilation.SyntaxTrees.Single(); 23474var tree = compilation.SyntaxTrees.Single(); 23525var tree = compilation.SyntaxTrees.Single(); 23669var tree = compilation.SyntaxTrees.Single(); 23767var tree = compilation.SyntaxTrees.Single(); 23865var tree = compilation.SyntaxTrees.Single(); 24007var tree = compilation.SyntaxTrees.Single(); 24111var tree = compilation.SyntaxTrees.Single(); 24206var tree = compilation.SyntaxTrees.Single(); 24294var tree = compilation.SyntaxTrees.Single(); 24400var tree = compilation.SyntaxTrees.Single(); 24493var tree = compilation.SyntaxTrees.Single(); 24524var tree = compilation.SyntaxTrees.Single(); 24726var tree = compilation.SyntaxTrees.Single(); 24985var tree = compilation.SyntaxTrees.Single(); 25176var tree = compilation.SyntaxTrees.Single(); 25289var tree = compilation.SyntaxTrees.Single(); 25388var tree = compilation.SyntaxTrees.Single(); 25567var tree = compilation.SyntaxTrees.Single(); 25611var tree = compilation.SyntaxTrees.Single(); 25692var tree = compilation.SyntaxTrees.Single(); 25736var tree = compilation.SyntaxTrees.Single(); 25791var tree = compilation.SyntaxTrees.Single(); 25872var tree = compilation.SyntaxTrees.Single(); 25932var tree = compilation.SyntaxTrees.Single(); 26029var tree = compilation.SyntaxTrees.Single(); 26086var tree = compilation.SyntaxTrees.Single(); 26153var tree = compilation.SyntaxTrees.Single(); 26201var tree = compilation.SyntaxTrees.Single(); 26282var tree = compilation.SyntaxTrees.Single(); 26329var tree = compilation.SyntaxTrees.Single(); 26424var tree = compilation.SyntaxTrees.Single(); 26472var tree = compilation.SyntaxTrees.Single(); 26556var tree = compilation.SyntaxTrees.Single(); 26616var tree = compilation.SyntaxTrees.Single(); 26700var tree = compilation.SyntaxTrees.Single(); 26760var tree = compilation.SyntaxTrees.Single(); 26821var tree = compilation.SyntaxTrees.Single(); 26891var tree = compilation.SyntaxTrees.Single(); 26935var tree = compilation.SyntaxTrees.Single(); 27021var tree = compilation.SyntaxTrees.Single(); 27066var tree = compilation.SyntaxTrees.Single(); 27158var tree = compilation.SyntaxTrees.Single(); 27212var tree = compilation.SyntaxTrees.Single(); 27311var tree = compilation.SyntaxTrees.Single(); 27365var tree = compilation.SyntaxTrees.Single(); 27434var tree = compilation.SyntaxTrees.Single(); 27511var tree = compilation.SyntaxTrees.Single(); 27584var tree = compilation.SyntaxTrees.Single(); 27688var tree = compilation.SyntaxTrees.Single(); 27761var tree = compilation.SyntaxTrees.Single(); 27824var tree = compilation.SyntaxTrees.Single(); 27901var tree = compilation.SyntaxTrees.Single(); 27974var tree = compilation.SyntaxTrees.Single(); 28079var tree = compilation.SyntaxTrees.Single(); 28152var tree = compilation.SyntaxTrees.Single(); 28225var tree = compilation.SyntaxTrees.Single(); 28300var tree = compilation.SyntaxTrees.Single(); 28354var tree = compilation.SyntaxTrees.Single(); 28451var tree = compilation.SyntaxTrees.Single(); 28505var tree = compilation.SyntaxTrees.Single(); 28572var tree = compilation.SyntaxTrees.Single(); 28620var tree = compilation.SyntaxTrees.Single(); 28704var tree = compilation.SyntaxTrees.Single(); 28765var tree = compilation.SyntaxTrees.Single(); 28872var tree = compilation.SyntaxTrees.Single(); 28928var tree = compilation.SyntaxTrees.Single(); 29023var tree = compilation.SyntaxTrees.Single(); 29079var tree = compilation.SyntaxTrees.Single(); 29144var tree = compilation.SyntaxTrees.Single(); 29230var tree = compilation.SyntaxTrees.Single(); 29297var tree = compilation.SyntaxTrees.Single(); 29406var tree = compilation.SyntaxTrees.Single(); 29473var tree = compilation.SyntaxTrees.Single(); 29546var tree = compilation.SyntaxTrees.Single(); 29595var tree = compilation.SyntaxTrees.Single(); 29693var tree = compilation.SyntaxTrees.Single(); 29769var tree = compilation.SyntaxTrees.Single(); 29894var tree = compilation.SyntaxTrees.Single(); 29970var tree = compilation.SyntaxTrees.Single(); 30048var tree = compilation.SyntaxTrees.Single(); 30134var tree = compilation.SyntaxTrees.Single(); 30195var tree = compilation.SyntaxTrees.Single(); 30306var tree = compilation.SyntaxTrees.Single(); 30367var tree = compilation.SyntaxTrees.Single(); 30431var tree = compilation.SyntaxTrees.Single(); 30486var tree = compilation.SyntaxTrees.Single(); 30530var tree = compilation.SyntaxTrees.Single(); 30574var tree = compilation.SyntaxTrees.Single(); 30615var tree = compilation.SyntaxTrees.Single(); 30695var tree = compilation.SyntaxTrees.Single(); 30764var tree = compilation.SyntaxTrees.Single(); 30866var tree = compilation.SyntaxTrees.Single(); 30935var tree = compilation.SyntaxTrees.Single(); 30999var tree = compilation.SyntaxTrees.Single(); 31054var tree = compilation.SyntaxTrees.Single(); 31098var tree = compilation.SyntaxTrees.Single(); 31142var tree = compilation.SyntaxTrees.Single(); 31226var tree = compilation.SyntaxTrees.Single(); 31285var tree = compilation.SyntaxTrees.Single(); 31399var tree = compilation.SyntaxTrees.Single(); 31458var tree = compilation.SyntaxTrees.Single(); 31527var tree = compilation.SyntaxTrees.Single(); 31582var tree = compilation.SyntaxTrees.Single(); 31626var tree = compilation.SyntaxTrees.Single(); 31670var tree = compilation.SyntaxTrees.Single(); 31711var tree = compilation.SyntaxTrees.Single(); 31765var tree = compilation.SyntaxTrees.Single(); 31799var tree = compilation.SyntaxTrees.Single(); 31852var tree = compilation.SyntaxTrees.Single(); 31892var tree = compilation.SyntaxTrees.Single(); 31942var tree = compilation.SyntaxTrees.Single(); 31976var tree = compilation.SyntaxTrees.Single(); 32032var tree = compilation.SyntaxTrees.Single(); 32072var tree = compilation.SyntaxTrees.Single(); 32117var tree = compilation.SyntaxTrees.Single(); 32161var tree = compilation.SyntaxTrees.Single(); 32195var tree = compilation.SyntaxTrees.Single(); 32229var tree = compilation.SyntaxTrees.Single(); 32269var tree = compilation.SyntaxTrees.Single(); 32309var tree = compilation.SyntaxTrees.Single(); 32327tree = compilation.SyntaxTrees.Single(); 32364var tree = compilation.SyntaxTrees.Single(); 32380tree = compilation.SyntaxTrees.Single(); 32433var tree = compilation.SyntaxTrees.Single(); 32480var tree = compilation.SyntaxTrees.Single(); 32546var tree = compilation.SyntaxTrees.Single(); 32574var tree = compilation.SyntaxTrees.Single(); 32602var tree = compilation.SyntaxTrees.Single(); 32628var tree = compilation.SyntaxTrees.Single(); 32666var tree = compilation.SyntaxTrees.Single(); 32702var tree = compilation.SyntaxTrees.Single(); 32735Assert.Equal(variableDesignationSyntax, symbol.DeclaringSyntaxReferences.Single().GetSyntax()); 32748Assert.Same(symbol, symbols.Single()); 32778Assert.Same(symbol, symbols.Single()); 32946var tree = compilation.SyntaxTrees.Single(); 33060var tree = comp.SyntaxTrees.Single(); 33129var tree = comp.SyntaxTrees.Single(); 33174var tree = comp.SyntaxTrees.Single(); 33238var tree = comp.SyntaxTrees.Single(); 33779var tree = compilation.SyntaxTrees.Single(); 33877var tree = compilation.SyntaxTrees.Single(); 33976var tree = compilation.SyntaxTrees.Single(); 34074var tree = compilation.SyntaxTrees.Single(); 34147var tree = compilation.SyntaxTrees.Single(); 34203var tree = compilation.SyntaxTrees.Single(); 34269var tree = compilation.SyntaxTrees.Single(); 34396var tree = compilation.SyntaxTrees.Single(); 34487var tree = compilation.SyntaxTrees.Single(); 34594var tree = compilation.SyntaxTrees.Single(); 34715var tree = compilation.SyntaxTrees.Single(); 35555var tree = compilation.SyntaxTrees.Single(); 35660var tree = comp.SyntaxTrees.Single(); 35695var tree = comp.SyntaxTrees.Single(); 35774var tree = compilation.SyntaxTrees.Single(); 35816var tree = compilation.SyntaxTrees.Single(); 35845var tree = compilation.SyntaxTrees.Single(); 35891var tree = compilation.SyntaxTrees.Single(); 35979var tree = compilation.SyntaxTrees.Single(); 36119var tree = compilation.SyntaxTrees.Single(); 36227var tree = compilation.SyntaxTrees.Single(); 36320var tree = compilation.SyntaxTrees.Single(); 36359var tree = comp.SyntaxTrees.Single(); 36405var tree = comp.SyntaxTrees.Single(); 36445var tree = comp.SyntaxTrees.Single(); 36487var tree = comp.SyntaxTrees.Single(); 36522var tree = comp.SyntaxTrees.Single(); 36560var tree = comp.SyntaxTrees.Single();
Semantics\ParamsCollectionTests.cs (26)
118var tree = comp.SyntaxTrees.Single(); 217var tree = comp.SyntaxTrees.Single(); 239var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 333var tree = comp.SyntaxTrees.Single(); 355var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 516var tree = comp.SyntaxTrees.Single(); 538var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 661var tree = comp.SyntaxTrees.Single(); 683var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 1405var tree = comp.SyntaxTrees.Single(); 1427var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 2529var tree = comp.SyntaxTrees.Single(); 2551var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 2665var tree = comp.SyntaxTrees.Single(); 2687var attributeData1 = comp.GetTypeByMetadataName(name).GetAttributes().Single(); 2754var tree = comp.SyntaxTrees.Single(); 2788tree = comp.SyntaxTrees.Single(); 2952var tree = comp.SyntaxTrees.Single(); 2983tree = comp.SyntaxTrees.Single(); 3595var tree = comp.SyntaxTrees.Single(); 3885var tree = comp.SyntaxTrees.Single(); 4337var tree = comp2.SyntaxTrees.Single(); 5891var tree = comp.SyntaxTrees.Single(); 5973var tree = comp.SyntaxTrees.Single(); 9070var tree = comp.SyntaxTrees.Single(); 12532var tree = comp.SyntaxTrees.Single();
Semantics\PatternMatchingTestBase.cs (14)
83Assert.Equal(designation, symbol.DeclaringSyntaxReferences.Single().GetSyntax()); 87var other = model.LookupSymbols(designation.SpanStart, name: designation.Identifier.ValueText).Single(); 126Assert.Same(symbol, model.LookupSymbols(reference.SpanStart, name: designation.Identifier.ValueText).Single()); 144Assert.Equal(designation, symbol.DeclaringSyntaxReferences.Single().GetSyntax()); 147Assert.NotEqual(symbol, model.LookupSymbols(designation.SpanStart, name: designation.Identifier.ValueText).Single()); 170Assert.Equal(declarator, symbol.DeclaringSyntaxReferences.Single().GetSyntax()); 173Assert.NotEqual(symbol, model.LookupSymbols(declarator.SpanStart, name: declarator.Identifier.ValueText).Single()); 184Assert.Equal(designation, symbol.DeclaringSyntaxReferences.Single().GetSyntax()); 187Assert.NotEqual(symbol, model.LookupSymbols(designation.SpanStart, name: designation.Identifier.ValueText).Single()); 197Assert.Same(symbol, model.LookupSymbols(reference.SpanStart, name: reference.Identifier.ValueText).Single()); 210var other = model.LookupSymbols(reference.SpanStart, name: reference.Identifier.ValueText).Single(); 247Assert.Equal(designation, symbol.DeclaringSyntaxReferences.Single().GetSyntax()); 260Assert.Same(symbol, symbols.Single()); 314Assert.Same(symbol, symbols.Single());
Semantics\PatternMatchingTests.cs (51)
692var tree = compilation.SyntaxTrees.Single(); 736var tree = compilation.SyntaxTrees.Single(); 776var tree = compilation.SyntaxTrees.Single(); 842var tree = compilation.SyntaxTrees.Single(); 889var tree = compilation.SyntaxTrees.Single(); 1151var tree = compilation.SyntaxTrees.Single(); 1220var tree = compilation.SyntaxTrees.Single(); 1270var tree = compilation.SyntaxTrees.Single(); 1314var tree = compilation.SyntaxTrees.Single(); 1429var tree = compilation.SyntaxTrees.Single(); 1479var tree = compilation.SyntaxTrees.Single(); 1536var tree = compilation.SyntaxTrees.Single(); 1588var tree = compilation.SyntaxTrees.Single(); 1653var tree = compilation.SyntaxTrees.Single(); 1730var tree = compilation.SyntaxTrees.Single(); 1783var tree = compilation.SyntaxTrees.Single(); 1827var tree = compilation.SyntaxTrees.Single(); 1881var tree = compilation.SyntaxTrees.Single(); 1935var tree = compilation.SyntaxTrees.Single(); 1992var tree = compilation.SyntaxTrees.Single(); 2030var tree = compilation.SyntaxTrees.Single(); 2076var tree = compilation.SyntaxTrees.Single(); 2130var tree = compilation.SyntaxTrees.Single(); 2178var tree = compilation.SyntaxTrees.Single(); 2234var tree = compilation.SyntaxTrees.Single(); 2294var tree = compilation.SyntaxTrees.Single(); 2352var tree = compilation.SyntaxTrees.Single(); 2413var tree = compilation.SyntaxTrees.Single(); 2458var tree = compilation.SyntaxTrees.Single(); 2497var tree = compilation.SyntaxTrees.Single(); 2541var tree = compilation.SyntaxTrees.Single(); 2613var tree = compilation.SyntaxTrees.Single(); 2661var tree = compilation.SyntaxTrees.Single(); 2699var tree = compilation.SyntaxTrees.Single(); 2744var tree = compilation.SyntaxTrees.Single(); 2788var tree = compilation.SyntaxTrees.Single(); 2840var tree = compilation.SyntaxTrees.Single(); 2882var tree = compilation.SyntaxTrees.Single(); 3037var tree = compilation.SyntaxTrees.Single(); 3084var tree = compilation.SyntaxTrees.Single(); 3477var tree = compilation.SyntaxTrees.Single(); 3576var tree = compilation.SyntaxTrees.Single(); 4247var tree = compilation.SyntaxTrees.Single(); 4288var tree = compilation.SyntaxTrees.Single(); 4789var tree = compilation.SyntaxTrees.Single(); 4827var tree = compilation.SyntaxTrees.Single(); 6572var tree = compilation.SyntaxTrees.Single(); 11363var tree = comp.SyntaxTrees.Single(); 11387var tree = comp.SyntaxTrees.Single(); 11408var tree = comp.SyntaxTrees.Single(); 11465var tree = comp.SyntaxTrees.Single();
Semantics\PatternMatchingTests_Global.cs (123)
76var tree = compilation.SyntaxTrees.Single(); 120var tree = compilation.SyntaxTrees.Single(); 198var tree = compilation.SyntaxTrees.Single(); 242var tree = compilation.SyntaxTrees.Single(); 292var tree = compilation.SyntaxTrees.Single(); 368var tree = compilation.SyntaxTrees.Single(); 428var tree = compilation.SyntaxTrees.Single(); 520var tree = compilation.SyntaxTrees.Single(); 577var tree = compilation.SyntaxTrees.Single(); 639var tree = compilation.SyntaxTrees.Single(); 681var tree = compilation.SyntaxTrees.Single(); 757var tree = compilation.SyntaxTrees.Single(); 804var tree = compilation.SyntaxTrees.Single(); 894var tree = compilation.SyntaxTrees.Single(); 942var tree = compilation.SyntaxTrees.Single(); 1021var tree = compilation.SyntaxTrees.Single(); 1074var tree = compilation.SyntaxTrees.Single(); 1153var tree = compilation.SyntaxTrees.Single(); 1206var tree = compilation.SyntaxTrees.Single(); 1262var tree = compilation.SyntaxTrees.Single(); 1327var tree = compilation.SyntaxTrees.Single(); 1371var tree = compilation.SyntaxTrees.Single(); 1452var tree = compilation.SyntaxTrees.Single(); 1497var tree = compilation.SyntaxTrees.Single(); 1584var tree = compilation.SyntaxTrees.Single(); 1638var tree = compilation.SyntaxTrees.Single(); 1732var tree = compilation.SyntaxTrees.Single(); 1786var tree = compilation.SyntaxTrees.Single(); 1850var tree = compilation.SyntaxTrees.Single(); 1924var tree = compilation.SyntaxTrees.Single(); 1994var tree = compilation.SyntaxTrees.Single(); 2095var tree = compilation.SyntaxTrees.Single(); 2165var tree = compilation.SyntaxTrees.Single(); 2224var tree = compilation.SyntaxTrees.Single(); 2298var tree = compilation.SyntaxTrees.Single(); 2368var tree = compilation.SyntaxTrees.Single(); 2470var tree = compilation.SyntaxTrees.Single(); 2540var tree = compilation.SyntaxTrees.Single(); 2609var tree = compilation.SyntaxTrees.Single(); 2679var tree = compilation.SyntaxTrees.Single(); 2733var tree = compilation.SyntaxTrees.Single(); 2825var tree = compilation.SyntaxTrees.Single(); 2879var tree = compilation.SyntaxTrees.Single(); 2941var tree = compilation.SyntaxTrees.Single(); 2987var tree = compilation.SyntaxTrees.Single(); 3068var tree = compilation.SyntaxTrees.Single(); 3127var tree = compilation.SyntaxTrees.Single(); 3227var tree = compilation.SyntaxTrees.Single(); 3283var tree = compilation.SyntaxTrees.Single(); 3373var tree = compilation.SyntaxTrees.Single(); 3429var tree = compilation.SyntaxTrees.Single(); 3489var tree = compilation.SyntaxTrees.Single(); 3570var tree = compilation.SyntaxTrees.Single(); 3637var tree = compilation.SyntaxTrees.Single(); 3741var tree = compilation.SyntaxTrees.Single(); 3808var tree = compilation.SyntaxTrees.Single(); 3872var tree = compilation.SyntaxTrees.Single(); 3966var tree = compilation.SyntaxTrees.Single(); 4042var tree = compilation.SyntaxTrees.Single(); 4164var tree = compilation.SyntaxTrees.Single(); 4240var tree = compilation.SyntaxTrees.Single(); 4311var tree = compilation.SyntaxTrees.Single(); 4392var tree = compilation.SyntaxTrees.Single(); 4453var tree = compilation.SyntaxTrees.Single(); 4559var tree = compilation.SyntaxTrees.Single(); 4620var tree = compilation.SyntaxTrees.Single(); 4675var tree = compilation.SyntaxTrees.Single(); 4721var tree = compilation.SyntaxTrees.Single(); 4760var tree = compilation.SyntaxTrees.Single(); 4799var tree = compilation.SyntaxTrees.Single(); 4831var tree = compilation.SyntaxTrees.Single(); 4906var tree = compilation.SyntaxTrees.Single(); 4975var tree = compilation.SyntaxTrees.Single(); 5072var tree = compilation.SyntaxTrees.Single(); 5141var tree = compilation.SyntaxTrees.Single(); 5196var tree = compilation.SyntaxTrees.Single(); 5242var tree = compilation.SyntaxTrees.Single(); 5281var tree = compilation.SyntaxTrees.Single(); 5320var tree = compilation.SyntaxTrees.Single(); 5399var tree = compilation.SyntaxTrees.Single(); 5475var tree = compilation.SyntaxTrees.Single(); 5584var tree = compilation.SyntaxTrees.Single(); 5660var tree = compilation.SyntaxTrees.Single(); 5725var tree = compilation.SyntaxTrees.Single(); 5776var tree = compilation.SyntaxTrees.Single(); 5815var tree = compilation.SyntaxTrees.Single(); 5854var tree = compilation.SyntaxTrees.Single(); 5891var tree = compilation.SyntaxTrees.Single(); 5937var tree = compilation.SyntaxTrees.Single(); 5975var tree = compilation.SyntaxTrees.Single(); 6025var tree = compilation.SyntaxTrees.Single(); 6062var tree = compilation.SyntaxTrees.Single(); 6109var tree = compilation.SyntaxTrees.Single(); 6141var tree = compilation.SyntaxTrees.Single(); 6195var tree = compilation.SyntaxTrees.Single(); 6233var tree = compilation.SyntaxTrees.Single(); 6268var tree = compilation.SyntaxTrees.Single(); 6297var tree = compilation.SyntaxTrees.Single(); 6319var tree = compilation.SyntaxTrees.Single(); 6348var tree = compilation.SyntaxTrees.Single(); 6372var tree = compilation.SyntaxTrees.Single(); 6395var tree = compilation.SyntaxTrees.Single(); 6512var tree = compilation.SyntaxTrees.Single(); 6600var tree = compilation.SyntaxTrees.Single(); 6684var tree = compilation.SyntaxTrees.Single(); 6727var tree = compilation.SyntaxTrees.Single(); 6760var tree = compilation.SyntaxTrees.Single(); 6802var tree = compilation.SyntaxTrees.Single(); 6940var tree = compilation.SyntaxTrees.Single(); 7038var tree = compilation.SyntaxTrees.Single(); 7130var tree = compilation.SyntaxTrees.Single(); 7257var tree = compilation.SyntaxTrees.Single(); 7361var tree = compilation.SyntaxTrees.Single(); 7450var tree = compilation.SyntaxTrees.Single(); 7526var tree = compilation.SyntaxTrees.Single(); 7620var tree = compilation.SyntaxTrees.Single(); 7707var tree = compilation.SyntaxTrees.Single(); 7732var tree = compilation.SyntaxTrees.Single(); 7928var tree = compilation.SyntaxTrees.Single(); 8187var tree = compilation.SyntaxTrees.Single(); 8372var tree = compilation.SyntaxTrees.Single(); 8479var tree = compilation.SyntaxTrees.Single(); 8578var tree = compilation.SyntaxTrees.Single();
Semantics\PatternMatchingTests_ListPatterns.cs (1)
4403var tree = compilation.SyntaxTrees.Single();
Semantics\PatternMatchingTests_Scope.cs (123)
202var tree = compilation.SyntaxTrees.Single(); 283var tree = compilation.SyntaxTrees.Single(); 329var tree = compilation.SyntaxTrees.Single(); 370var tree = compilation.SyntaxTrees.Single(); 400var tree = compilation.SyntaxTrees.Single(); 587var tree = compilation.SyntaxTrees.Single(); 675var tree = compilation.SyntaxTrees.Single(); 705var tree = compilation.SyntaxTrees.Single(); 857var tree = compilation.SyntaxTrees.Single(); 944var tree = compilation.SyntaxTrees.Single(); 974var tree = compilation.SyntaxTrees.Single(); 1155var tree = compilation.SyntaxTrees.Single(); 1248var tree = compilation.SyntaxTrees.Single(); 1278var tree = compilation.SyntaxTrees.Single(); 1518var tree = compilation.SyntaxTrees.Single(); 1818var tree = compilation.SyntaxTrees.Single(); 2069var tree = compilation.SyntaxTrees.Single(); 2215var tree = compilation.SyntaxTrees.Single(); 2351var tree = compilation.SyntaxTrees.Single(); 2416var tree = compilation.SyntaxTrees.Single(); 2479var tree = compilation.SyntaxTrees.Single(); 2549var tree = compilation.SyntaxTrees.Single(); 2705var tree = compilation.SyntaxTrees.Single(); 2788var tree = compilation.SyntaxTrees.Single(); 2984var tree = compilation.SyntaxTrees.Single(); 3153var tree = compilation.SyntaxTrees.Single(); 3268var tree = compilation.SyntaxTrees.Single(); 3357var tree = compilation.SyntaxTrees.Single(); 3445var tree = compilation.SyntaxTrees.Single(); 3532var tree = compilation.SyntaxTrees.Single(); 3608var tree = compilation.SyntaxTrees.Single(); 3705var tree = compilation.SyntaxTrees.Single(); 3796var tree = compilation.SyntaxTrees.Single(); 3886var tree = compilation.SyntaxTrees.Single(); 3978var tree = compilation.SyntaxTrees.Single(); 4074var tree = compilation.SyntaxTrees.Single(); 4220var tree = compilation.SyntaxTrees.Single(); 4502var tree = compilation.SyntaxTrees.Single(); 4902var tree = compilation.SyntaxTrees.Single(); 5211var tree = compilation.SyntaxTrees.Single(); 5304var tree = compilation.SyntaxTrees.Single(); 5334var tree = compilation.SyntaxTrees.Single(); 5499var tree = compilation.SyntaxTrees.Single(); 5706var tree = compilation.SyntaxTrees.Single(); 5913var tree = compilation.SyntaxTrees.Single(); 6022var tree = compilation.SyntaxTrees.Single(); 6103var tree = compilation.SyntaxTrees.Single(); 6186var tree = compilation.SyntaxTrees.Single(); 6273var tree = compilation.SyntaxTrees.Single(); 6347var tree = compilation.SyntaxTrees.Single(); 6417var tree = compilation.SyntaxTrees.Single(); 6464var tree = compilation.SyntaxTrees.Single(); 6484Assert.Equal("System.Int64 y1", model.LookupSymbols(x1Ref[0].SpanStart, name: "y1").Single().ToTestDisplayString()); 6517var tree = compilation.SyntaxTrees.Single(); 6587var tree = compilation.SyntaxTrees.Single(); 6676var tree = compilation.SyntaxTrees.Single(); 6752var tree = compilation.SyntaxTrees.Single(); 6827var tree = compilation.SyntaxTrees.Single(); 6877var tree = compilation.SyntaxTrees.Single(); 6895Assert.Equal("System.Boolean y1", model.LookupSymbols(x1Ref[0].SpanStart, name: "y1").Single().ToTestDisplayString()); 6927var tree = compilation.SyntaxTrees.Single(); 7084var tree = compilation.SyntaxTrees.Single(); 7174var tree = compilation.SyntaxTrees.Single(); 7204var tree = compilation.SyntaxTrees.Single(); 7406var tree = compilation.SyntaxTrees.Single(); 7497var tree = compilation.SyntaxTrees.Single(); 7527var tree = compilation.SyntaxTrees.Single(); 7721var tree = compilation.SyntaxTrees.Single(); 7950var tree = compilation.SyntaxTrees.Single(); 8200var tree = compilation.SyntaxTrees.Single(); 8440var tree = compilation.SyntaxTrees.Single(); 8672var tree = compilation.SyntaxTrees.Single(); 8988var tree = compilation.SyntaxTrees.Single(); 9131var tree = compilation.SyntaxTrees.Single(); 9303var tree = compilation.SyntaxTrees.Single(); 9512var tree = compilation.SyntaxTrees.Single(); 9603var tree = compilation.SyntaxTrees.Single(); 9633var tree = compilation.SyntaxTrees.Single(); 9798var tree = compilation.SyntaxTrees.Single(); 9927var tree = compilation.SyntaxTrees.Single(); 10075var tree = compilation.SyntaxTrees.Single(); 10163var tree = compilation.SyntaxTrees.Single(); 10196var tree = compilation.SyntaxTrees.Single(); 10365var tree = compilation.SyntaxTrees.Single(); 10586var tree = compilation.SyntaxTrees.Single(); 10682var tree = compilation.SyntaxTrees.Single(); 10712var tree = compilation.SyntaxTrees.Single(); 10999var tree = compilation.SyntaxTrees.Single(); 11129var tree = compilation.SyntaxTrees.Single(); 11177var tree = compilation.SyntaxTrees.Single(); 11227var tree = compilation.SyntaxTrees.Single(); 11270var tree = compilation.SyntaxTrees.Single(); 11313var tree = compilation.SyntaxTrees.Single(); 11359var tree = compilation.SyntaxTrees.Single(); 11402var tree = compilation.SyntaxTrees.Single(); 11448var tree = compilation.SyntaxTrees.Single(); 11494var tree = compilation.SyntaxTrees.Single(); 11546var tree = compilation.SyntaxTrees.Single(); 11609var tree = compilation.SyntaxTrees.Single(); 11664var tree = compilation.SyntaxTrees.Single(); 11724var tree = compilation.SyntaxTrees.Single(); 11804var tree = compilation.SyntaxTrees.Single(); 11901var tree = compilation.SyntaxTrees.Single(); 11990var tree = compilation.SyntaxTrees.Single(); 12088var tree = compilation.SyntaxTrees.Single(); 12139var tree = compilation.SyntaxTrees.Single(); 12158var y1 = model.LookupSymbols(x1Ref[0].SpanStart, name: "y1").Single(); 12201var tree = compilation.SyntaxTrees.Single(); 12245var tree = compilation.SyntaxTrees.Single(); 12474var tree = compilation.SyntaxTrees.Single(); 12641var tree = compilation.SyntaxTrees.Single(); 12832var tree = compilation.SyntaxTrees.Single(); 12953var tree = compilation.SyntaxTrees.Single(); 13045var tree = compilation.SyntaxTrees.Single(); 13227var tree = compilation.SyntaxTrees.Single(); 13370var tree = compilation.SyntaxTrees.Single(); 13444var tree = compilation.SyntaxTrees.Single(); 13532var tree = compilation.SyntaxTrees.Single(); 13609var tree = compilation.SyntaxTrees.Single(); 13688var tree = compilation.SyntaxTrees.Single(); 13755var tree = compilation.SyntaxTrees.Single(); 13785var tree = compilation.SyntaxTrees.Single(); 14017var tree = compilation.SyntaxTrees.Single();
Semantics\PatternMatchingTests3.cs (3)
1610var tree = compilation.SyntaxTrees.Single(); 1886var tree = compilation.SyntaxTrees.Single(); 1934var tree = compilation.SyntaxTrees.Single();
Semantics\PatternMatchingTests4.cs (2)
4016var tree = comp.SyntaxTrees.Single(); 4085var tree = comp.SyntaxTrees.Single();
Semantics\PatternMatchingTests5.cs (5)
425var tree = comp.SyntaxTrees.Single(); 562var tree = comp.SyntaxTrees.Single(); 793var tree = comp.SyntaxTrees.Single(); 839var tree = comp.SyntaxTrees.Single(); 893var tree = comp.SyntaxTrees.Single();
Semantics\PatternSwitchTests.cs (3)
1513var tree = compilation.SyntaxTrees.Single(); 1896var tree = compilation.SyntaxTrees.Single(); 1931var tree = compilation.SyntaxTrees.Single();
Semantics\PrimaryConstructorTests.cs (22)
1013Assert.Same(symbol, model.LookupSymbols(x.SpanStart, name: "X").Single()); 1903Assert.Equal("System.Int32 X", model.LookupSymbols(x.SpanStart, name: "X").Single().ToTestDisplayString()); 3379Assert.Equal("A", c.GetAttributes().Single().ToString()); 3400Assert.Equal("A", c.GetAttributes().Single().ToString()); 3802Assert.Same(literal.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3828Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3846Assert.Same(initializer.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3877Assert.Same(baseType.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3904Assert.Same(@class.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 5291Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 5309Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 5327Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 5356Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 6089var tree = comp.SyntaxTrees.Single(); 7792var tree = comp.SyntaxTrees.Single(); 7819symbol = symbolInfo.CandidateSymbols.Single(); 7833Assert.Same(symbol, model.LookupSymbols(p1.SpanStart, name: "p1").Single()); 20596var tree = comp.SyntaxTrees.Single(); 20629var tree = comp.SyntaxTrees.Single(); 20673var tree = comp.SyntaxTrees.Single(); 20720var tree = comp.SyntaxTrees.Single(); 20770var tree = comp.SyntaxTrees.Single();
Semantics\RecordTests.cs (9)
12525Assert.Equal("System.Type! B.EqualityContract { get; }", GetProperties(comp, "B").Single().ToTestDisplayString(includeNonNullable: true)); 21971Assert.Equal("System.Int32 X", model.LookupSymbols(x.SpanStart, name: "X").Single().ToTestDisplayString()); 26242Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26268Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26286Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26317Assert.Same(baseType.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26340Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 28185var tree = comp.SyntaxTrees.Single(); 28342var tree = comp.SyntaxTrees.Single();
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (2)
EndToEndTests.cs (2)
489var tree = comp.SyntaxTrees.Single(); 819step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C1" }));
Microsoft.CodeAnalysis.CSharp.Features (8)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
65IBlockOperation op => AsExpressionSyntax(op.Operations.Single()),
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (1)
285var memberDeclarationSyntax = memberDeclarationSymbol.DeclaringSyntaxReferences.Single().GetSyntax();
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
781return declaredSymbol.DeclaringSyntaxReferences.Single().GetSyntax();
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
994|| ((BaseTypeDeclarationSyntax)syntaxRefs.Single().GetSyntax()).Modifiers.Any(SyntaxKind.PartialKeyword);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (1)
373return node.WithInitializer((ConstructorInitializerSyntax)_statementsOrMemberOrAccessorToInsert.Single());
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (1)
43if (statements.Single() is not BlockSyntax block)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
109semanticModel.Compilation, ienumerableType.TypeArguments.Single()))
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
804return expressions.Single();
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (76)
IOperation\IOperationTests.cs (7)
181var m = comp.SyntaxTrees.Single().GetRoot().DescendantNodes().OfType<BlockSyntax>().Single(); 312Assert.Equal(RefKind.RefReadOnly, op.Locals.Single().RefKind); 380Assert.Equal(RefKind.RefReadOnly, op.Locals.Single().RefKind); 412var tree = compilation.SyntaxTrees.Single(); 460var tree = compilation.SyntaxTrees.Single(); 508var tree = compilation.SyntaxTrees.Single(); 554var tree = comp.SyntaxTrees.Single();
IOperation\IOperationTests_IAnonymousFunctionExpression.cs (6)
413var variableTreeLambdaOperation = ((IDelegateCreationOperation)variableDeclarationGroupOperation.Declarations.Single().Declarators.Single().Initializer.Value).Target; 421var variableTreeLambdaOperationSecondRequest = ((IDelegateCreationOperation)variableDeclarationGroupOperationSecondRequest.Declarations.Single().Declarators.Single().Initializer.Value).Target; 845var tree = compilation.SyntaxTrees.Single(); 900var tree = compilation.SyntaxTrees.Single();
IOperation\IOperationTests_ICoalesceOperation.cs (11)
35var tree = compilation.SyntaxTrees.Single(); 146var tree = compilation.SyntaxTrees.Single(); 261var tree = compilation.SyntaxTrees.Single(); 376var tree = compilation.SyntaxTrees.Single(); 492var tree = compilation.SyntaxTrees.Single(); 605var tree = compilation.SyntaxTrees.Single(); 720var tree = compilation.SyntaxTrees.Single(); 836var tree = compilation.SyntaxTrees.Single(); 950var tree = compilation.SyntaxTrees.Single(); 1052var tree = compilation.SyntaxTrees.Single(); 1167var tree = compilation.SyntaxTrees.Single();
IOperation\IOperationTests_IConstructorBodyOperation.cs (19)
37var tree = compilation.SyntaxTrees.Single(); 66var tree = compilation.SyntaxTrees.Single(); 122var tree = compilation.SyntaxTrees.Single(); 188var tree = compilation.SyntaxTrees.Single(); 256var tree = compilation.SyntaxTrees.Single(); 322var tree = compilation.SyntaxTrees.Single(); 397var tree = compilation.SyntaxTrees.Single(); 484var tree = compilation.SyntaxTrees.Single(); 513var tree = compilation.SyntaxTrees.Single(); 588var tree = compilation.SyntaxTrees.Single(); 650var tree = compilation.SyntaxTrees.Single(); 720var tree = compilation.SyntaxTrees.Single(); 795var tree = compilation.SyntaxTrees.Single(); 864var tree = compilation.SyntaxTrees.Single(); 954var tree = compilation.SyntaxTrees.Single(); 1069var tree = compilation.SyntaxTrees.Single(); 1089var tree = compilation.SyntaxTrees.Single(); 1122var tree = compilation.SyntaxTrees.Single(); 1160var tree = compilation.SyntaxTrees.Single();
IOperation\IOperationTests_IConversionExpression.cs (1)
5335((IVariableDeclarationGroupOperation)operation).Declarations.Single().Initializer;
IOperation\IOperationTests_IFieldReferenceExpression.cs (1)
709var fieldSym = classSym.GetMembers("_field").Single();
IOperation\IOperationTests_ILocalFunctionStatement.cs (3)
1791var tree = compilation.SyntaxTrees.Single(); 1823return graph.LocalFunctions.Single(); 1846var tree = compilation.SyntaxTrees.Single();
IOperation\IOperationTests_IMethodBodyOperation.cs (27)
32var tree = compilation.SyntaxTrees.Single(); 55var tree = compilation.SyntaxTrees.Single(); 108var tree = compilation.SyntaxTrees.Single(); 170var tree = compilation.SyntaxTrees.Single(); 242var tree = compilation.SyntaxTrees.Single(); 284var tree = compilation.SyntaxTrees.Single(); 332var tree = compilation.SyntaxTrees.Single(); 399var tree = compilation.SyntaxTrees.Single(); 443var tree = compilation.SyntaxTrees.Single(); 505var tree = compilation.SyntaxTrees.Single(); 559var tree = compilation.SyntaxTrees.Single(); 580var tree = compilation.SyntaxTrees.Single(); 612var tree = compilation.SyntaxTrees.Single(); 656var tree = compilation.SyntaxTrees.Single(); 701var tree = compilation.SyntaxTrees.Single(); 722var tree = compilation.SyntaxTrees.Single(); 754var tree = compilation.SyntaxTrees.Single(); 798var tree = compilation.SyntaxTrees.Single(); 843var tree = compilation.SyntaxTrees.Single(); 864var tree = compilation.SyntaxTrees.Single(); 896var tree = compilation.SyntaxTrees.Single(); 937var tree = compilation.SyntaxTrees.Single(); 975var tree = compilation.SyntaxTrees.Single(); 999var tree = compilation.SyntaxTrees.Single(); 1034var tree = compilation.SyntaxTrees.Single(); 1079var tree = compilation.SyntaxTrees.Single(); 1121var tree = compilation.SyntaxTrees.Single();
IOperation\IOperationTests_ISymbolInitializer.cs (1)
32var tree = compilation.SyntaxTrees.Single();
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (4)
InteractiveSessionTests.cs (4)
511return lookupType(c, typeName).GetMembers(memberName).Single(); 1184var scope = scopes.Single(); 1190var import = scope.Imports.Single(); 1442Assert.Equal(ErrorCode.ERR_GlobalSingleTypeNameNotFound, (ErrorCode)e.Diagnostics.Single().Code);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1063)
Semantics\AccessCheckTests.cs (21)
747INamedTypeSymbol classK = classA.GetMembers("K").Single() as INamedTypeSymbol; 748IFieldSymbol privField = classA.GetMembers("priv").Single() as IFieldSymbol; 749IFieldSymbol pubField = classA.GetMembers("pub").Single() as IFieldSymbol; 750IFieldSymbol protField = classA.GetMembers("prot").Single() as IFieldSymbol; 751ITypeSymbol karrayType = (classA.GetMembers("karray").Single() as IFieldSymbol).Type; 752ITypeSymbol aarrayType = (classA.GetMembers("aarray").Single() as IFieldSymbol).Type; 753ITypeSymbol kptrType = (classA.GetMembers("kptr").Single() as IFieldSymbol).Type; 754ITypeSymbol aptrType = (classA.GetMembers("aptr").Single() as IFieldSymbol).Type; 755ITypeSymbol kinreturnfuncptrType = (classA.GetMembers("kinreturnfuncptr").Single() as IFieldSymbol).Type; 756ITypeSymbol kinparamfuncptr1Type = (classA.GetMembers("kinparamfuncptr1").Single() as IFieldSymbol).Type; 757ITypeSymbol kinparamfuncptr2Type = (classA.GetMembers("kinparamfuncptr2").Single() as IFieldSymbol).Type; 758ITypeSymbol afuncptrType = (classA.GetMembers("afuncptr").Single() as IFieldSymbol).Type; 759ITypeSymbol kenumType = (classA.GetMembers("kenum").Single() as IFieldSymbol).Type; 760ITypeSymbol aenumType = (classA.GetMembers("aenum").Single() as IFieldSymbol).Type; 764ITypeSymbol unknownType = (classA.GetMembers("unknowntype").Single() as IFieldSymbol).Type; 902INamedTypeSymbol Outer_Inner = Outer.GetMembers("Inner").Single() as INamedTypeSymbol; 903IFieldSymbol Outer_Inner_Field = Outer_Inner.GetMembers("Field").Single() as IFieldSymbol; 904IFieldSymbol Outer_Pointer = Outer.GetMembers("Pointer").Single() as IFieldSymbol; 905IFieldSymbol Outer_Protected = Outer.GetMembers("Protected").Single() as IFieldSymbol; 906IFieldSymbol Outer_ProtectedInternal = Outer.GetMembers("ProtectedInternal").Single() as IFieldSymbol; 907IFieldSymbol Outer_PrivateProtected = Outer.GetMembers("PrivateProtected").Single() as IFieldSymbol;
Semantics\AnonymousFunctionTests.cs (2)
978var syntaxTree = compilation.SyntaxTrees.Single(); 1012var syntaxTree = compilation.SyntaxTrees.Single();
Semantics\AwaitExpressionTests.cs (1)
81var tree = csCompilation.SyntaxTrees.Single();
Semantics\BindingAsyncTests.cs (2)
34var method = (SourceMemberMethodSymbol)compilation.GlobalNamespace.GetTypeMembers("C").Single().GetMembers("M").Single();
Semantics\BindingTests.cs (20)
2599var c = comp.GlobalNamespace.GetTypeMembers("C").Single(); 2600var t = (FieldSymbol)c.GetMembers("T").Single(); 2601var foo = (MethodSymbol)c.GetMembers("Foo").Single(); 2630var c = comp.GlobalNamespace.GetTypeMembers("C").Single(); 2631var t = (FieldSymbol)c.GetMembers("T").Single(); 2632var foo = (MethodSymbol)c.GetMembers("Foo").Single(); 2659var c = comp.GlobalNamespace.GetTypeMembers("C").Single(); 2660var t = (FieldSymbol)c.GetMembers("T").Single(); 2661var foo = (MethodSymbol)c.GetMembers("Foo").Single(); 2719var tree = compilation.SyntaxTrees.Single(); 2775var tree = compilation.SyntaxTrees.Single(); 2830var tree = compilation.SyntaxTrees.Single(); 3048Assert.Equal("IApplicationBuilder IApplicationBuilder.Use(System.Func<RequestDelegate, RequestDelegate> middleware)", symbolInfo1.CandidateSymbols.Single().ToTestDisplayString()); 3057Assert.Equal("System.Threading.Tasks.Task<AuthenticationResult> AuthenticationManager.AuthenticateAsync(System.String authenticationScheme)", group.Single().ToTestDisplayString()); 3128Assert.Equal("IApplicationBuilder IApplicationBuilder.Use(System.Func<HttpContext, System.Func<System.Threading.Tasks.Task>, System.Threading.Tasks.Task> middleware)", symbolInfo1.CandidateSymbols.Single().ToTestDisplayString()); 3137Assert.Equal("System.Threading.Tasks.Task<AuthenticationResult> AuthenticationManager.AuthenticateAsync(System.String authenticationScheme)", group.Single().ToTestDisplayString()); 3211Assert.Equal("System.Threading.Tasks.Task<AuthenticationResult> AuthenticationManager.AuthenticateAsync(System.String authenticationScheme)", group.Single().ToTestDisplayString()); 3296Assert.Equal("System.Threading.Tasks.Task<AuthenticationResult> AuthenticationManager.AuthenticateAsync(System.String authenticationScheme)", group.Single().ToTestDisplayString()); 3741Assert.Equal("event System.EventHandler Program.E1", symbolInfo2.CandidateSymbols.Single().ToTestDisplayString()); 3936var tree = compilation.SyntaxTrees.Single();
Semantics\ColorColorTests.cs (1)
1250var candidate = info.CandidateSymbols.Single();
Semantics\ConditionalOperatorTests.cs (3)
1345var tree = compilation.SyntaxTrees.Single(); 1399var tree = compilation.SyntaxTrees.Single(); 1446var tree = compilation.SyntaxTrees.Single();
Semantics\ConstantTests.cs (2)
4079var tree = comp.SyntaxTrees.Single(); 4100var tree = comp.SyntaxTrees.Single();
Semantics\DeconstructionTests.cs (1)
4720var tree = comp1.SyntaxTrees.Single();
Semantics\DelegateTypeTests.cs (2)
19757var tree = comp.SyntaxTrees.Single(); 19799var tree = comp.SyntaxTrees.Single();
Semantics\DynamicTests.cs (110)
4975var tree = comp1.SyntaxTrees.Single(); 5058tree = comp3.SyntaxTrees.Single(); 5099var tree = comp1.SyntaxTrees.Single(); 5181tree = comp3.SyntaxTrees.Single(); 5222var tree = comp1.SyntaxTrees.Single(); 5305tree = comp3.SyntaxTrees.Single(); 5340var tree = comp1.SyntaxTrees.Single(); 5381var tree = comp1.SyntaxTrees.Single(); 5425var tree = comp1.SyntaxTrees.Single(); 5469var tree = comp1.SyntaxTrees.Single(); 5513var tree = comp1.SyntaxTrees.Single(); 5577var tree = comp.SyntaxTrees.Single(); 5615var tree = comp.SyntaxTrees.Single(); 5654var tree = comp.SyntaxTrees.Single(); 5690var tree = comp.SyntaxTrees.Single(); 5731var tree = comp1.SyntaxTrees.Single(); 5776var tree = comp1.SyntaxTrees.Single(); 5821var tree = comp1.SyntaxTrees.Single(); 5866var tree = comp1.SyntaxTrees.Single(); 5934var tree = comp.SyntaxTrees.Single(); 5973var tree = comp.SyntaxTrees.Single(); 6021var tree = comp.SyntaxTrees.Single(); 6103tree = comp3.SyntaxTrees.Single(); 6144var tree = comp.SyntaxTrees.Single(); 6226tree = comp3.SyntaxTrees.Single(); 6264var tree = comp.SyntaxTrees.Single(); 6346tree = comp3.SyntaxTrees.Single(); 6376var tree = comp1.SyntaxTrees.Single(); 6418var tree = comp1.SyntaxTrees.Single(); 6465var tree = comp1.SyntaxTrees.Single(); 6509var tree = comp1.SyntaxTrees.Single(); 6551var tree = comp.SyntaxTrees.Single(); 6605var tree = comp.SyntaxTrees.Single(); 6670var tree = comp.SyntaxTrees.Single(); 6735tree = comp3.SyntaxTrees.Single(); 6779var tree = comp.SyntaxTrees.Single(); 6844tree = comp3.SyntaxTrees.Single(); 6889var tree = comp.SyntaxTrees.Single(); 6955tree = comp3.SyntaxTrees.Single(); 6990var tree = comp.SyntaxTrees.Single(); 7058var tree = comp.SyntaxTrees.Single(); 7117tree = comp3.SyntaxTrees.Single(); 7161var tree = comp.SyntaxTrees.Single(); 7229tree = comp3.SyntaxTrees.Single(); 7274var tree = comp.SyntaxTrees.Single(); 7345tree = comp3.SyntaxTrees.Single(); 7390var tree = comp.SyntaxTrees.Single(); 7462tree = comp3.SyntaxTrees.Single(); 7503var tree = comp.SyntaxTrees.Single(); 7580var tree = comp.SyntaxTrees.Single(); 7641tree = comp3.SyntaxTrees.Single(); 7685var tree = comp.SyntaxTrees.Single(); 7747tree = comp3.SyntaxTrees.Single(); 7791var tree = comp.SyntaxTrees.Single(); 7853tree = comp3.SyntaxTrees.Single(); 7894var tree = comp.SyntaxTrees.Single(); 7966var tree = comp.SyntaxTrees.Single(); 8028tree = comp3.SyntaxTrees.Single(); 8072var tree = comp.SyntaxTrees.Single(); 8134tree = comp3.SyntaxTrees.Single(); 8177var tree = comp.SyntaxTrees.Single(); 8238tree = comp3.SyntaxTrees.Single(); 8282var tree = comp.SyntaxTrees.Single(); 8347tree = comp3.SyntaxTrees.Single(); 8391var tree = comp.SyntaxTrees.Single(); 8456tree = comp3.SyntaxTrees.Single(); 8500var tree = comp.SyntaxTrees.Single(); 8565tree = comp3.SyntaxTrees.Single(); 8610var tree = comp.SyntaxTrees.Single(); 8676tree = comp3.SyntaxTrees.Single(); 8723var tree = comp.SyntaxTrees.Single(); 8792var tree = comp.SyntaxTrees.Single(); 8860var tree = comp.SyntaxTrees.Single(); 8923var tree = comp.SyntaxTrees.Single(); 9013var tree = comp.SyntaxTrees.Single(); 9104var tree = comp.SyntaxTrees.Single(); 9194var tree = comp.SyntaxTrees.Single(); 9250var tree = comp.SyntaxTrees.Single(); 9311var tree = comp.SyntaxTrees.Single(); 9432var tree = comp.SyntaxTrees.Single(); 9552var tree = comp.SyntaxTrees.Single(); 9666var tree = comp.SyntaxTrees.Single(); 9777var tree = comp.SyntaxTrees.Single(); 9888var tree = comp.SyntaxTrees.Single(); 10008var tree = comp.SyntaxTrees.Single(); 10091tree = comp3.SyntaxTrees.Single(); 10136var tree = comp.SyntaxTrees.Single(); 10219tree = comp3.SyntaxTrees.Single(); 10264var tree = comp.SyntaxTrees.Single(); 10347tree = comp3.SyntaxTrees.Single(); 10418var tree = comp.SyntaxTrees.Single(); 10499tree = comp3.SyntaxTrees.Single(); 10552var tree = comp.SyntaxTrees.Single(); 10646tree = comp3.SyntaxTrees.Single(); 10700var tree = comp.SyntaxTrees.Single(); 10796tree = comp3.SyntaxTrees.Single(); 10970var tree = comp.SyntaxTrees.Single(); 11062tree = comp3.SyntaxTrees.Single(); 11099var tree = comp.SyntaxTrees.Single(); 11183var tree = comp.SyntaxTrees.Single(); 11261var tree = comp.SyntaxTrees.Single(); 11316var tree = comp1.SyntaxTrees.Single(); 11369var tree = comp1.SyntaxTrees.Single(); 11416var tree = comp1.SyntaxTrees.Single(); 11449var tree = comp1.SyntaxTrees.Single(); 11493var tree = comp.SyntaxTrees.Single(); 11534var tree = comp1.SyntaxTrees.Single(); 11583var tree = comp.SyntaxTrees.Single(); 11635var tree = comp.SyntaxTrees.Single(); 11679var tree = comp1.SyntaxTrees.Single();
Semantics\ExpressionBodiedMemberTests.cs (1)
1027Assert.Equal($"System.Int32 y{i}", model.LookupSymbols(nodes[i].SpanStart, name: $"y{i}").Single().ToTestDisplayString());
Semantics\ForEachTests.cs (6)
2126var tree = comp.SyntaxTrees.Single(); 2178var tree = comp.SyntaxTrees.Single(); 2882var tree = comp.SyntaxTrees.Single(); 3324var tree = comp.SyntaxTrees.Single(); 3358var tree = comp.SyntaxTrees.Single(); 3420var tree = compilation.SyntaxTrees.Single();
Semantics\FunctionPointerTests.cs (6)
2228.Select(s => model.GetSymbolInfo(s).CandidateSymbols.Single()) 2230.Select(m => m!.TypeArguments.Single().ToTestDisplayString()) 2288return symbolInfo.Symbol ?? symbolInfo.CandidateSymbols.Single(); 2291.Select(m => m!.TypeArguments.Single().ToTestDisplayString()) 2361return symbolInfo.Symbol ?? symbolInfo.CandidateSymbols.Single(); 2364.Select(m => m!.TypeArguments.Single().ToTestDisplayString())
Semantics\GenericConstraintsTests.cs (9)
2875var tree = compilation.SyntaxTrees.Single(); 3137var tree = compilation.SyntaxTrees.Single(); 3145Assert.Equal(declaredMethod.TypeParameters.Single().GetPublicSymbol(), inferredMethod.TypeArguments.Single()); 3167var tree = compilation.SyntaxTrees.Single(); 3175Assert.Equal(SpecialType.System_Int32, inferredMethod.TypeArguments.Single().SpecialType); 3193var tree = compilation.SyntaxTrees.Single(); 3201Assert.Equal(declaredMethod.TypeParameters.Single().GetPublicSymbol(), inferredMethod.TypeArguments.Single()); 3222var tree = compilation.SyntaxTrees.Single(); 3230Assert.Equal(SpecialType.System_Int32, inferredMethod.TypeArguments.Single().SpecialType);
Semantics\ImplicitlyTypeArraysTests.cs (2)
36var method = (SourceMemberMethodSymbol)compilation.GlobalNamespace.GetTypeMembers("C").Single().GetMembers("F").Single();
Semantics\ImplicitObjectCreationTests.cs (2)
4528var tree = compilation.SyntaxTrees.Single(); 4571var tree = compilation.SyntaxTrees.Single();
Semantics\ImportsTests.cs (1)
112var tree = comp.SyntaxTrees.Single();
Semantics\IndexAndRangeTests.cs (9)
895var tree = compilation.SyntaxTrees.Single(); 915var tree = compilation.SyntaxTrees.Single(); 936var tree = compilation.SyntaxTrees.Single(); 1119var tree = compilation.SyntaxTrees.Single(); 1248var tree = compilation.SyntaxTrees.Single(); 1281var tree = compilation.SyntaxTrees.Single(); 1314var tree = compilation.SyntaxTrees.Single(); 1338var tree = compilation.SyntaxTrees.Single(); 1381var tree = compilation.SyntaxTrees.Single();
Semantics\InteractiveUsingTests.cs (1)
115var tree = sub4.SyntaxTrees.Single();
Semantics\IteratorTests.cs (1)
577var tree = comp.SyntaxTrees.Single();
Semantics\LambdaDiscardParametersTests.cs (6)
67var tree = comp.SyntaxTrees.Single(); 416var tree = comp.SyntaxTrees.Single(); 446var tree = comp.SyntaxTrees.Single(); 480var tree = comp.SyntaxTrees.Single(); 511var tree = comp.SyntaxTrees.Single(); 565var tree = comp.SyntaxTrees.Single();
Semantics\LambdaTests.cs (22)
938var tree = compilation.SyntaxTrees.Single(); 1030var tree = compilation.SyntaxTrees.Single(); 1084var tree = compilation.SyntaxTrees.Single(); 1119var tree = compilation.SyntaxTrees.Single(); 1183Assert.Equal("void System.Collections.Generic.ICollection<C>.Add(C item)", symbolInfo.CandidateSymbols.Single().ToTestDisplayString()); 1211Assert.Equal("void System.Collections.Generic.ICollection<C>.Add(C item)", symbolInfo.CandidateSymbols.Single().ToTestDisplayString()); 1512var tree = compilation.SyntaxTrees.Single(); 1547var tree = compilation.SyntaxTrees.Single(); 1581var tree = compilation.SyntaxTrees.Single(); 1613var tree = compilation.SyntaxTrees.Single(); 1983Assert.Equal("void System.EventHandler.Invoke(System.Object sender, System.EventArgs e)", model.GetTypeInfo(node1).ConvertedType.GetMembers("Invoke").Single().ToTestDisplayString()); 3935var tree = comp.SyntaxTrees.Single(); 3946var expectedAttributeConstructor = comp.GetTypeByMetadataName(expectedAttributeName).InstanceConstructors.Single().GetPublicSymbol(); 3975var tree = comp.SyntaxTrees.Single(); 4095Assert.Equal("System.ObsoleteAttribute", symbol.GetAttributes().Single().ToString()); 6507var tree = comp.SyntaxTrees.Single(); 6817var tree = comp.SyntaxTrees.Single(); 6846var tree = comp.SyntaxTrees.Single(); 8080var tree = comp.SyntaxTrees.Single(); 8089var newParam = newLambdaSymbol.Parameters.Single(); 8116var tree = comp.SyntaxTrees.Single(); 8153var tree = comp.SyntaxTrees.Single();
Semantics\LocalFunctionTests.cs (35)
490var tree = comp.SyntaxTrees.Single(); 538var tree = comp.SyntaxTrees.Single(); 555var attributeData = attributes.Single(); 558Assert.Equal(aAttribute.InstanceConstructors.Single(), attributeData.AttributeConstructor.GetSymbol()); 559Assert.Equal(42, attributeData.ConstructorArguments.Single().Value); 615var tree = comp.SyntaxTrees.Single(); 668var tree = comp.SyntaxTrees.Single(); 722var tree = comp.SyntaxTrees.Single(); 802var tree = comp.SyntaxTrees.Single(); 819var attributeData = returnAttributes.Single(); 822Assert.Equal(aAttribute.InstanceConstructors.Single(), attributeData.AttributeConstructor.GetSymbol()); 849var tree = comp.SyntaxTrees.Single(); 857var attr = attrs.Single(); 967var tree = comp.SyntaxTrees.Single(); 1019var tree = comp.SyntaxTrees.Single(); 1025var attributeConstructor = comp.GetTypeByMetadataName("A").InstanceConstructors.Single(); 1057var tree = comp.SyntaxTrees.Single(); 1799clsCompliantSymbolInfo.CandidateSymbols.Single()); 1807model.LookupNamespacesAndTypes(clsCompliant.SpanStart, name: "CLSCompliantAttribute").Single()); 1874clsCompliantSymbolInfo.CandidateSymbols.Single()); 1882model.LookupNamespacesAndTypes(clsCompliant.SpanStart, name: "CLSCompliantAttribute").Single()); 2371var tree = comp.SyntaxTrees.Single(); 4959var tree = compilation.SyntaxTrees.Single(); 5102var tree = comp.SyntaxTrees.Single(); 7342var tree = comp.SyntaxTrees.Single(); 7430var tree = comp.SyntaxTrees.Single(); 7495var tree = comp.SyntaxTrees.Single(); 7519tree = comp.SyntaxTrees.Single(); 7569var tree = comp.SyntaxTrees.Single(); 8735var tree = comp.SyntaxTrees.Single(); 8777var tree = comp.SyntaxTrees.Single(); 8925var tree = comp.SyntaxTrees.Single(); 9429var tree = comp.SyntaxTrees.Single(); 9747var tree = comp.SyntaxTrees.Single(); 10426var tree = comp.SyntaxTrees.Single();
Semantics\LockTests.cs (7)
42var tree = compilation.SyntaxTrees.Single(); 486var tree = compilation.SyntaxTrees.Single(); 548var tree = compilation.SyntaxTrees.Single(); 572var tree = compilation.SyntaxTrees.Single(); 602var tree = compilation.SyntaxTrees.Single(); 626var tree = compilation.SyntaxTrees.Single(); 696var tree = compilation.SyntaxTrees.Single();
Semantics\LookupPositionTests.cs (2)
2271var tree = compilation.SyntaxTrees.Single(); 2299var tree = compilation.SyntaxTrees.Single();
Semantics\LookupTests.cs (27)
28var tree = compilation.SyntaxTrees.Single(); 425var tree = comp.SyntaxTrees.Single(); 581var tree = comp.SyntaxTrees.Single(); 695Assert.Equal("void A.Goo()", symbols.Single().ToTestDisplayString()); 1503Assert.Equal("void I1.M()", symbolInfo.CandidateSymbols.Single().ToTestDisplayString()); 1507Assert.Equal("void I1.M()", symbolInfo.CandidateSymbols.Single().ToTestDisplayString()); 1529INamedTypeSymbol typeInnerZ = namespaceY.GetTypeMembers("InnerZ").Single(); 1534INamedTypeSymbol typeB = typeA.GetTypeMembers("B").Single(); 1722var tree = comp.SyntaxTrees.Single(); 1736Assert.Equal(propertyLP.GetPublicSymbol(), model.LookupSymbols(position, interfaceB.GetPublicSymbol(), "P").Single()); 1737Assert.Equal(propertyRQ.GetPublicSymbol(), model.LookupSymbols(position, interfaceB.GetPublicSymbol(), "Q").Single()); 1756var tree = comp.SyntaxTrees.Single(); 1787var tree = comp.SyntaxTrees.Single(); 1793Assert.Equal(methodT.GetPublicSymbol(), symbols.Single()); // Hides type parameter. 1796Assert.Equal(classC.TypeParameters.Single().GetPublicSymbol(), symbols.Single()); // Ignore intervening method. 1819var tree = comp.SyntaxTrees.Single(); 1980var tree = comp.SyntaxTrees.Single(); 2008var ms = comp.GlobalNamespace.GetTypeMembers("Program").Single().GetMembers("M").OfType<MethodSymbol>(); 2011var tree = comp.SyntaxTrees.Single(); 2039var m = comp.GlobalNamespace.GetTypeMembers("Program").Single().GetMembers("M").Single(); 2041var tree = comp.SyntaxTrees.Single(); 2069var m = comp.GlobalNamespace.GetTypeMembers("Program").Single().GetMembers("M").Single(); 2071var tree = comp.SyntaxTrees.Single(); 2097var tree = comp.SyntaxTrees.Single(); 2120var tree = comp.SyntaxTrees.Single();
Semantics\MethodTypeInferenceTests.cs (10)
699var tree = comp.SyntaxTrees.Single(); 754var tree = comp.SyntaxTrees.Single(); 800var tree = comp.SyntaxTrees.Single(); 1044var tree = comp.SyntaxTrees.Single(); 1050Assert.Equal(SpecialType.System_Char, method.TypeArguments.Single().SpecialType); 1074var tree = comp.SyntaxTrees.Single(); 1080Assert.Equal(SpecialType.System_Char, method.TypeArguments.Single().SpecialType); 1116var tree = compilation.SyntaxTrees.Single(); 1157var tree = compilation.SyntaxTrees.Single(); 1198var tree = compilation.SyntaxTrees.Single();
Semantics\NameOfTests.cs (5)
974var tree = comp.SyntaxTrees.Single(); 1046var tree = comp.SyntaxTrees.Single(); 1128var tree = comp.SyntaxTrees.Single(); 1209var tree = comp.SyntaxTrees.Single(); 3038var tree = compilation.SyntaxTrees.Single();
Semantics\NativeIntegerTests.cs (7)
4073var tree = comp.SyntaxTrees.Single(); 15315var tree = comp.SyntaxTrees.Single(); 15336var tree = comp.SyntaxTrees.Single(); 15359var tree = comp.SyntaxTrees.Single(); 15387var tree = comp.SyntaxTrees.Single(); 15410var tree = comp.SyntaxTrees.Single(); 15440var tree = comp.SyntaxTrees.Single();
Semantics\NonTrailingNamedArgumentsTests.cs (2)
541Assert.Equal("void C.M(params System.Int32[] x)", symbolInfo.CandidateSymbols.Single().ToTestDisplayString()); 716model.GetSymbolInfo(firstInvocation).CandidateSymbols.Single().ToTestDisplayString());
Semantics\NullableReferenceTypesTests.cs (103)
1751var tree = comp.SyntaxTrees.Single(); 1785var tree = comp.SyntaxTrees.Single(); 1838var tree = comp.SyntaxTrees.Single(); 1865var tree = comp.SyntaxTrees.Single(); 1890var tree = comp.SyntaxTrees.Single(); 1960var tree = comp.SyntaxTrees.Single(); 2273var tree = comp.SyntaxTrees.Single(); 2312var tree = comp.SyntaxTrees.Single(); 2345var tree = comp.SyntaxTrees.Single(); 2378var tree = comp.SyntaxTrees.Single(); 2477var tree = comp.SyntaxTrees.Single(); 4524var tree = comp.SyntaxTrees.Single(); 4560var tree = comp.SyntaxTrees.Single(); 4592var tree = comp.SyntaxTrees.Single(); 6468var attribute = c.GetAttributes().Single(); 6490var attribute = c.GetAttributes().Single(); 10532var tree = compilation.SyntaxTrees.Single(); 56074var tree = comp.SyntaxTrees.Single(); 56104var tree = comp.SyntaxTrees.Single(); 56137var tree = comp.SyntaxTrees.Single(); 56174var tree = comp.SyntaxTrees.Single(); 56209var tree = comp.SyntaxTrees.Single(); 56243var tree = comp.SyntaxTrees.Single(); 56274var tree = comp.SyntaxTrees.Single(); 56302var tree = comp.SyntaxTrees.Single(); 56341var tree = comp.SyntaxTrees.Single(); 56375var tree = comp.SyntaxTrees.Single(); 56406var tree = comp.SyntaxTrees.Single(); 56435var tree = comp.SyntaxTrees.Single(); 56470var tree = comp.SyntaxTrees.Single(); 56506var tree = comp.SyntaxTrees.Single(); 56585var tree = comp.SyntaxTrees.Single(); 56617var tree = comp.SyntaxTrees.Single(); 62838var syntaxTree = comp.SyntaxTrees.Single(); 65887var tree1 = comp1.SyntaxTrees.Single(); 71779var tree = comp.SyntaxTrees.Single(); 71872var tree = comp.SyntaxTrees.Single(); 71919var tree = comp.SyntaxTrees.Single(); 71958var tree = comp.SyntaxTrees.Single(); 73759var tree = comp.SyntaxTrees.Single(); 113591var tree = comp.SyntaxTrees.Single(); 113622var tree = comp.SyntaxTrees.Single(); 113800var tree = comp.SyntaxTrees.Single(); 114025var tree = comp.SyntaxTrees.Single(); 125133Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125142Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125151Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125162Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125171Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125182Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125192Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125217Assert.Equal(DiagnosticSeverity.Hidden, diagnostics.Single().Severity); 125228Assert.Equal(DiagnosticSeverity.Hidden, diagnostics.Single().Severity); 125238Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125249Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125468Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125477Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125486Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125497Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125506Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125517Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125527Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125552Assert.Equal(DiagnosticSeverity.Hidden, diagnostics.Single().Severity); 125563Assert.Equal(DiagnosticSeverity.Hidden, diagnostics.Single().Severity); 125573Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125584Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 145374var tree = comp.SyntaxTrees.Single(); 145415var tree = comp.SyntaxTrees.Single(); 145455var tree = comp.SyntaxTrees.Single(); 145493var tree = comp.SyntaxTrees.Single(); 145531var tree = comp.SyntaxTrees.Single(); 145570var tree = comp.SyntaxTrees.Single(); 145603var tree = comp.SyntaxTrees.Single(); 145635var tree = comp.SyntaxTrees.Single(); 145674var tree = comp.SyntaxTrees.Single(); 145950var tree = comp.SyntaxTrees.Single(); 145981var tree = comp.SyntaxTrees.Single(); 146014var tree = comp.SyntaxTrees.Single(); 146297var tree = comp.SyntaxTrees.Single(); 146336var tree = comp.SyntaxTrees.Single(); 146376var tree = comp.SyntaxTrees.Single(); 146415var tree = comp.SyntaxTrees.Single(); 146450var tree = comp.SyntaxTrees.Single(); 155995var tree = comp.SyntaxTrees.Single(); 156744var tree = comp.SyntaxTrees.Single(); 157579var tree = comp.SyntaxTrees.Single(); 157627var tree = comp.SyntaxTrees.Single(); 158059var tree = comp.SyntaxTrees.Single(); 158095var tree = comp.SyntaxTrees.Single(); 158190var tree = comp.SyntaxTrees.Single(); 158228var tree = comp.SyntaxTrees.Single(); 158269var tree = comp.SyntaxTrees.Single(); 158309var tree = comp.SyntaxTrees.Single(); 158343var tree = comp.SyntaxTrees.Single(); 158380var tree = comp.SyntaxTrees.Single(); 158475var tree = comp.SyntaxTrees.Single(); 158523var tree = comp.SyntaxTrees.Single(); 158565var tree = comp.SyntaxTrees.Single(); 158602var tree = comp.SyntaxTrees.Single(); 158813var tree = comp.SyntaxTrees.Single(); 160688var tree = comp.SyntaxTrees.Single(); 161238var syntaxTree = comp.SyntaxTrees.Single(); 161284var syntaxTree = comp.SyntaxTrees.Single();
Semantics\NullCoalesceAssignmentTests.cs (5)
35var syntaxTree = comp.SyntaxTrees.Single(); 73var syntaxTree = comp.SyntaxTrees.Single(); 116var syntaxTree = comp.SyntaxTrees.Single(); 155var syntaxTree = comp.SyntaxTrees.Single(); 181var syntaxTree = comp.SyntaxTrees.Single();
Semantics\ObjectAndCollectionInitializerTests.cs (15)
3468var tree = compilation.SyntaxTrees.Single(); 3516var tree = compilation.SyntaxTrees.Single(); 3573var tree = compilation.SyntaxTrees.Single(); 3586Assert.Equal("void X.Add(System.String x)", symbolInfo.CandidateSymbols.Single().ToTestDisplayString()); 3609var tree = compilation.SyntaxTrees.Single(); 3646var tree = compilation.SyntaxTrees.Single(); 3687var tree = compilation.SyntaxTrees.Single(); 3737var tree = compilation.SyntaxTrees.Single(); 3781var tree = compilation.SyntaxTrees.Single(); 3932var tree = compilation.SyntaxTrees.Single(); 4014var tree = compilation.SyntaxTrees.Single(); 4056var tree = compilation.SyntaxTrees.Single(); 4134var tree = compilation.SyntaxTrees.Single(); 4224var tree = comp.SyntaxTrees.Single(); 4278var tree = comp.SyntaxTrees.Single();
Semantics\OperatorTests.cs (17)
44var tree = compilation.SyntaxTrees.Single(); 2982var tree = compilation.SyntaxTrees.Single(); 3202var method = (SourceMemberMethodSymbol)compilation.GlobalNamespace.GetTypeMembers("C").Single().GetMembers("M").Single(); 6936var tree = comp.SyntaxTrees.Single(); 7053var tree = comp.SyntaxTrees.Single(); 7208var tree = comp.SyntaxTrees.Single(); 7485var tree = compilation.SyntaxTrees.Single(); 7701var tree = compilation.SyntaxTrees.Single(); 7854var tree = compilation.SyntaxTrees.Single(); 8014var tree = compilation.SyntaxTrees.Single(); 8551var tree = compilation.SyntaxTrees.Single(); 8586var tree = compilation.SyntaxTrees.Single(); 8630var tree = compilation.SyntaxTrees.Single(); 8680var tree = compilation.SyntaxTrees.Single(); 8754var tree = compilation.SyntaxTrees.Single(); 11336var tree = compilation.SyntaxTrees.Single();
Semantics\OverloadResolutionPerfTests.cs (2)
980var tree = comp.SyntaxTrees.Single(); 1058var tree = comp.SyntaxTrees.Single();
Semantics\OverloadResolutionTestBase.cs (2)
35var method = (SourceMemberMethodSymbol)compilation.GlobalNamespace.GetTypeMembers("C").Single().GetMembers("M").Single();
Semantics\OverloadResolutionTests.cs (7)
7146var tree = comp.SyntaxTrees.Single(); 7256var tree = comp.SyntaxTrees.Single(); 7262Assert.Equal(SpecialType.System_Int32, methodSymbol.TypeArguments.Single().SpecialType); 7430var tree = comp.SyntaxTrees.Single(); 7471var tree = comp.SyntaxTrees.Single(); 9068var tree = compilation.SyntaxTrees.Single(); 9416var tree = comp.SyntaxTrees.Single();
Semantics\ReadOnlyStructsTests.cs (3)
1227static IMethodSymbol getMethod(INamedTypeSymbol symbol, string name) => (IMethodSymbol)symbol.GetMembers(name).Single(); 1228static IPropertySymbol getProperty(INamedTypeSymbol symbol, string name) => (IPropertySymbol)symbol.GetMembers(name).Single(); 1229static IEventSymbol getEvent(INamedTypeSymbol symbol, string name) => (IEventSymbol)symbol.GetMembers(name).Single();
Semantics\RecordStructTests.cs (11)
2305var tree = comp.SyntaxTrees.Single(); 2329var tree = comp.SyntaxTrees.Single(); 3241var tree = comp.SyntaxTrees.Single(); 3283var tree = comp.SyntaxTrees.Single(); 3331var tree = comp.SyntaxTrees.Single(); 3382var tree = comp.SyntaxTrees.Single(); 5990Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 6008Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 6026Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 6055Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 8809var tree = comp.SyntaxTrees.Single();
Semantics\RefExtensionMethodsTests.cs (4)
2142var tree = comp.SyntaxTrees.Single(); 2161var tree = comp.SyntaxTrees.Single(); 2180var tree = comp.SyntaxTrees.Single(); 2199var tree = comp.SyntaxTrees.Single();
Semantics\RefFieldTests.cs (4)
16548var tree = comp.SyntaxTrees.Single(); 16589var tree = comp.SyntaxTrees.Single(); 16628var tree = comp.SyntaxTrees.Single(); 16724var tree = comp.SyntaxTrees.Single();
Semantics\RefLocalsAndReturnsTests.cs (7)
4749var tree = compilation.SyntaxTrees.Single(); 4777var tree = compilation.SyntaxTrees.Single(); 4805var tree = compilation.SyntaxTrees.Single(); 4833var tree = compilation.SyntaxTrees.Single(); 4861var tree = compilation.SyntaxTrees.Single(); 4889var tree = compilation.SyntaxTrees.Single(); 4923var tree = compilation.SyntaxTrees.Single();
Semantics\ScriptSemanticsTests.cs (4)
236var tree = compilation.SyntaxTrees.Single(); 509var model = submission.GetSemanticModel(submission.SyntaxTrees.Single()); 553var tree = compilation.SyntaxTrees.Single(); 589var tree = compilation.SyntaxTrees.Single();
Semantics\SemanticErrorTests.cs (6)
3343var typeArgSymbol = constructedMethodSymbol.TypeArguments.Single(); 3347var paramTypeSymbol = constructedMethodSymbol.Parameters.Single().Type; 7487var tree = compilation.SyntaxTrees.Single(); 13326var tree = compilation2.SyntaxTrees.Single(); 16645compilation.GetDiagnosticsForSyntaxTree(CompilationStage.Compile, compilation.SyntaxTrees.Single(), filterSpanWithinTree: null, includeEarlierStages: true).Verify(expected); 24223var tree = compilation.SyntaxTrees.Single();
Semantics\StackAllocInitializerTests.cs (8)
364var tree = comp.SyntaxTrees.Single(); 440var tree = comp.SyntaxTrees.Single(); 1042var tree = comp.SyntaxTrees.Single(); 1144var tree = comp.SyntaxTrees.Single(); 2356var tree = comp.SyntaxTrees.Single(); 2462var tree = comp.SyntaxTrees.Single(); 2562var tree = comp.SyntaxTrees.Single(); 2646var tree = comp.SyntaxTrees.Single();
Semantics\StackAllocSpanExpressionsTests.cs (2)
50var tree = comp.SyntaxTrees.Single(); 124var tree = comp.SyntaxTrees.Single();
Semantics\StructConstructorTests.cs (3)
1048var tree = comp.SyntaxTrees.Single(); 1143var tree = comp.SyntaxTrees.Single(); 1240var tree = comp.SyntaxTrees.Single();
Semantics\SuppressAccessibilityChecksTests.cs (1)
64Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).CandidateSymbols.Single().Name);
Semantics\TopLevelStatementsTests.cs (93)
199Assert.Same(refSymbol, model1.LookupSymbols(localRef.SpanStart, name: refSymbol.Name).Single()); 242Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 365Assert.Same(declSymbol, model2.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 486Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 495Assert.Same(declSymbol, model1.LookupSymbols(localFuncRef.SpanStart, name: declSymbol.Name).Single()); 538Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 549Assert.Same(declSymbol, model1.LookupSymbols(localRef.SpanStart, name: declSymbol.Name).Single()); 578Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 587Assert.Same(declSymbol, model1.LookupSymbols(localFuncRef.SpanStart, name: declSymbol.Name).Single()); 596Assert.Same(refSymbol, model1.LookupSymbols(localRef.SpanStart, name: refSymbol.Name).Single()); 696var tree = comp.SyntaxTrees.Single(); 1519var tree = comp.SyntaxTrees.Single(); 1692Assert.Same(getHashCode, model1.LookupSymbols(localDecl.SpanStart, name: getHashCode.Name).Single()); 1697Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: "Test").Single()); 1702Assert.Same(testType, model1.LookupNamespacesAndTypes(localDecl.SpanStart, name: "Test").Single()); 1730Assert.Same(testType, model.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 1767Assert.Same(declSymbol, model.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 1772Assert.Same(testType, model.LookupNamespacesAndTypes(nameRef.SpanStart, name: "Test").Single()); 1865Assert.Same(getHashCode, model1.LookupSymbols(localDecl.SpanStart, name: getHashCode.Name).Single()); 1870Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: "Test").Single()); 1875Assert.Same(testType, model1.LookupNamespacesAndTypes(localDecl.SpanStart, name: "Test").Single()); 1898Assert.Same(testType, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 1935Assert.Same(declSymbol, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 1940Assert.Same(testType, model2.LookupNamespacesAndTypes(nameRef.SpanStart, name: "Test").Single()); 2093Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: "Test").Single()); 2098Assert.Same(testType, model1.LookupNamespacesAndTypes(localDecl.SpanStart, name: "Test").Single()); 2113Assert.Same(testType, model1.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2148Assert.Same(declSymbol, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2153Assert.Same(testType, model2.LookupNamespacesAndTypes(nameRef.SpanStart, name: "Test").Single()); 2257Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: "Test").Single()); 2262Assert.Same(testType, model1.LookupNamespacesAndTypes(localDecl.SpanStart, name: "Test").Single()); 2279Assert.Same(testType, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2314Assert.Same(declSymbol, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2319Assert.Same(testType, model2.LookupNamespacesAndTypes(nameRef.SpanStart, name: "Test").Single()); 2436Assert.Same(testType, model1.LookupSymbols(labelDecl.SpanStart, name: "Test").Single()); 2441Assert.Same(testType, model1.LookupNamespacesAndTypes(labelDecl.SpanStart, name: "Test").Single()); 2443Assert.Same(declSymbol, model1.LookupLabels(labelDecl.SpanStart).Single()); 2444Assert.Same(declSymbol, model1.LookupLabels(labelDecl.SpanStart, name: "Test").Single()); 2459Assert.Same(testType, model1.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2474Assert.Same(testType, model1.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2475Assert.Same(declSymbol, model1.LookupLabels(nameRef.SpanStart).Single()); 2476Assert.Same(declSymbol, model1.LookupLabels(nameRef.SpanStart, name: "Test").Single()); 2511Assert.Same(testType, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2516Assert.Same(testType, model2.LookupNamespacesAndTypes(nameRef.SpanStart, name: "Test").Single()); 3953Assert.Same(testType, model.LookupSymbols(nameRef.SpanStart, name: "args").Single()); 3967Assert.Same(parameter, model.LookupSymbols(nameRef.SpanStart, name: "args").Single()); 3972Assert.Same(testType, model.LookupNamespacesAndTypes(nameRef.SpanStart, name: "args").Single()); 4007Assert.Same(testType, model.LookupSymbols(nameRef.SpanStart, name: "args").Single()); 4012Assert.Same(testType, model.LookupNamespacesAndTypes(nameRef.SpanStart, name: "args").Single()); 4102Assert.Same(testType, model.LookupSymbols(nameRef.SpanStart, name: "args").Single()); 4137Assert.Same(testType, model.LookupSymbols(nameRef.SpanStart, name: "args").Single()); 4142Assert.Same(testType, model.LookupNamespacesAndTypes(nameRef.SpanStart, name: "args").Single()); 4213var tree = comp.SyntaxTrees.Single(); 4891var tree = comp.SyntaxTrees.Single(); 4976var tree = comp.SyntaxTrees.Single(); 6043Assert.Same(declSymbol, model1.LookupSymbols(localRef.SpanStart, name: declSymbol.Name).Single()); 6231var syntaxTree = comp.SyntaxTrees.Single(); 6238Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).CandidateSymbols.Single().Name); 6275var syntaxTree = comp.SyntaxTrees.Single(); 6282Assert.Same(x, semanticModel.LookupSymbols(localDecl.SpanStart, name: "x").Single()); 6284Assert.Same(x, semanticModel.LookupSymbols(localRef.SpanStart, name: "x").Single()); 6315var syntaxTree1 = comp.SyntaxTrees.Single(); 6327Assert.Same(xDecl, semanticModel1.LookupSymbols(localDecl.SpanStart, name: "x").Single()); 6329Assert.Same(xRef, semanticModel1.LookupSymbols(localRef.SpanStart, name: "x").Single()); 6378Assert.Same(xDecl, semanticModel1.LookupSymbols(localDecl.SpanStart, name: "x").Single()); 6384Assert.Same(xRef, semanticModel2.LookupSymbols(localRef.SpanStart, name: "x").Single()); 6455Assert.Same(globalStatement.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 6537switch (context.Symbol.DeclaringSyntaxReferences.Single().GetSyntax().ToString()) 6613switch (context.Symbol.DeclaringSyntaxReferences.Single().GetSyntax().ToString()) 6656Assert.Equal("System.Console.WriteLine(1);", context.Symbol.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 6663Assert.Equal("System.Console.WriteLine(2);", context.Symbol.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 6721Assert.Same(context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree, context.Operation.Syntax.SyntaxTree); 6742Assert.Same(context.ContainingSymbol.DeclaringSyntaxReferences.Single().GetSyntax(), context.Operation.Syntax); 6801Assert.Equal(SyntaxKind.CompilationUnit, context.OperationBlocks.Single().Syntax.Kind()); 6803switch (context.OperationBlocks.Single().Syntax.ToString()) 6859Assert.Equal(SyntaxKind.CompilationUnit, context.OperationBlocks.Single().Syntax.Kind()); 6861switch (context.OperationBlocks.Single().Syntax.ToString()) 7086var decl = (CSharpSyntaxNode)context.ContainingSymbol.DeclaringSyntaxReferences.Single().GetSyntax(); 7353Assert.Equal(SyntaxKind.CompilationUnit, context.OperationBlocks.Single().Syntax.Kind()); 7355switch (context.OperationBlocks.Single().Syntax.ToString()) 7420Assert.Same(context.ContainingSymbol.DeclaringSyntaxReferences.Single().GetSyntax(), context.Operation.Syntax); 8576var tree = comp.SyntaxTrees.Single(); 8583Assert.Equal("System.String[] args", symbols.Single().ToTestDisplayString()); 8586Assert.Equal("System.String[] args", symbols.Single().ToTestDisplayString()); 8588Assert.Equal("System.String[] args", symbols.Single().ToTestDisplayString()); 8591Assert.Equal("System.String[] args", symbols.Single().ToTestDisplayString()); 8593Assert.Equal("System.String[] args", symbols.Single().ToTestDisplayString()); 8649var tree = comp.SyntaxTrees.Single(); 8656Assert.Equal("System.String[] args", symbols.Single().ToTestDisplayString()); 8671var tree = comp.SyntaxTrees.Single(); 8678Assert.Equal("System.String[] args", symbols.Single().ToTestDisplayString()); 8693var tree = comp.SyntaxTrees.Single(); 8700Assert.Equal("System.String[] args", symbols.Single().ToTestDisplayString());
Semantics\TryCatchTests.cs (1)
42var tree = compilation.SyntaxTrees.Single();
Semantics\UninitializedNonNullableFieldTests.cs (2)
2752var actualAdditionalLocations = comp.GetDiagnostics().Single().AdditionalLocations; 2773var actualAdditionalLocations = comp.GetDiagnostics().Single().AdditionalLocations;
Semantics\UnsafeTests.cs (28)
5196var tree = compilation.SyntaxTrees.Single(); 5380var tree = compilation.SyntaxTrees.Single(); 7254var tree = compilation.SyntaxTrees.Single(); 7291var tree = compilation.SyntaxTrees.Single(); 7320var tree = compilation.SyntaxTrees.Single(); 7358var tree = compilation.SyntaxTrees.Single(); 7401var tree = compilation.SyntaxTrees.Single(); 7410Assert.Equal("void C.M()", symbolInfo.CandidateSymbols.Single().ToTestDisplayString()); 7532var tree = compilation.SyntaxTrees.Single(); 7842var tree = compilation.SyntaxTrees.Single(); 7909var tree = compilation.SyntaxTrees.Single(); 8155var tree = compilation.SyntaxTrees.Single(); 8222var tree = compilation.SyntaxTrees.Single(); 8280var tree = compilation.SyntaxTrees.Single(); 8340var tree = compilation.SyntaxTrees.Single(); 8376var tree = compilation.SyntaxTrees.Single(); 8852var tree = compilation.SyntaxTrees.Single(); 8906var tree = compilation.SyntaxTrees.Single(); 9318var tree = compilation.SyntaxTrees.Single(); 10174var tree = compilation.SyntaxTrees.Single(); 10215var tree = compilation.SyntaxTrees.Single(); 10287var tree = compilation.SyntaxTrees.Single(); 10623var tree = compilation.SyntaxTrees.Single(); 10685var tree = compilation.SyntaxTrees.Single(); 10745var tree = compilation.SyntaxTrees.Single(); 11302var tree = compilation.SyntaxTrees.Single(); 11834var tree = comp.SyntaxTrees.Single(); 11874var tree = compilation.SyntaxTrees.Single();
Semantics\UseSiteErrorTests.cs (1)
2449var actualAssemblyId = compilation.GetUnreferencedAssemblyIdentities(diagnostic).Single();
Semantics\UsingStatementTests.cs (9)
57var tree = compilation.SyntaxTrees.Single(); 75var lookupSymbol = model.LookupSymbols(memberAccessExpression.SpanStart, name: declaredLocal.Name).Single(); 1338var tree = compilation.SyntaxTrees.Single(); 1373var tree = compilation.SyntaxTrees.Single(); 1850var tree = compilation.SyntaxTrees.Single(); 1862var tree = compilation.SyntaxTrees.Single(); 1878var tree = compilation.SyntaxTrees.Single(); 1892var tree = compilation.SyntaxTrees.Single(); 1896var actualSymbol = model.LookupSymbols(usingStatements[index - 1].SpanStart, name: symbol.Name).Single();
Semantics\Utf8StringsLiteralsTests.cs (14)
2968var tree = comp.SyntaxTrees.Single(); 2996var tree = comp.SyntaxTrees.Single(); 3024var tree = comp.SyntaxTrees.Single(); 3052var tree = comp.SyntaxTrees.Single(); 3080var tree = comp.SyntaxTrees.Single(); 3108var tree = comp.SyntaxTrees.Single(); 3136var tree = comp.SyntaxTrees.Single(); 3164var tree = comp.SyntaxTrees.Single(); 3192var tree = comp.SyntaxTrees.Single(); 3220var tree = comp.SyntaxTrees.Single(); 3248var tree = comp.SyntaxTrees.Single(); 3276var tree = comp.SyntaxTrees.Single(); 3304var tree = comp.SyntaxTrees.Single(); 4078var tree = comp.SyntaxTrees.Single();
SourceGeneration\GeneratorDriverTests.cs (38)
140var generatedClass = outputCompilation.GlobalNamespace.GetTypeMembers("GeneratedClass").Single(); 141Assert.True(generatedClass.Locations.Single().IsInSource); 287VerifyGeneratorExceptionDiagnostic<InvalidOperationException>(generatorDiagnostics.Single(), nameof(CallbackGenerator), "init error", initialization: true); 331VerifyGeneratorExceptionDiagnostic<InvalidOperationException>(generatorDiagnostics.Single(), nameof(CallbackGenerator), "generate error"); 357VerifyGeneratorExceptionDiagnostic<InvalidOperationException>(generatorDiagnostics.Single(), nameof(CallbackGenerator), "generate error"); 392VerifyGeneratorExceptionDiagnostic<InvalidOperationException>(generatorDiagnostics.Single(), nameof(CallbackGenerator), "generate error"); 418Assert.Contains(exception.ToString(), generatorDiagnostics.Single().ToString()); 511VerifyArgumentExceptionDiagnostic(generatorDiagnostics.Single(), nameof(PipelineCallbackGenerator), "The hintName 'test.cs' of the added source file must be unique within a generator.", "hintName"); 597var result = results.Results.Single(); 602Assert.Equal(results.GeneratedTrees.Single(), result.GeneratedSources.Single().SyntaxTree); 786VerifyArgumentExceptionDiagnostic(outputDiagnostics.Single(), nameof(CallbackGenerator), "The SourceText with hintName 'a.cs' must have an explicit encoding set.", "source"); 1014VerifyGeneratorExceptionDiagnostic<InvalidOperationException>(generatorDiagnostics.Single(), nameof(CallbackGenerator), "post init error", initialization: true); 1049VerifyGeneratorExceptionDiagnostic<InvalidOperationException>(generatorDiagnostics.Single(), nameof(CallbackGenerator), "init error", initialization: true); 1350var syntaxTree = compilation.SyntaxTrees.Single(); 1512Assert.Equal("// generated", runResults.Results.Single().GeneratedSources.Single().SourceText.ToString()); 1523VerifyGeneratorExceptionDiagnostic<InvalidOperationException>(runResults.Diagnostics.Single(), nameof(PipelineCallbackGenerator), "abc"); 1525Assert.Equal(e, runResults.Results.Single().Exception); 2023Assert.Equal(texts[0], value.Item2.Single()); 2052Assert.Equal(texts[0], value.Item2.Single()); 2067Assert.Equal(texts[0], value.Item2.Single()); 2075Assert.Equal(texts[0], value.Item2.Single()); 2162var generatedTree = driver.GetRunResult().GeneratedTrees.Single(); 2335driver.GetRunResult().Results.Single().TrackedSteps["Select"].Select(r => r.Outputs.Single())); 2356driver.GetRunResult().Results.Single().TrackedSteps["Select"].Select(r => r.Outputs.Single())); 3632VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(PipelineCallbackGenerator), "Reported diagnostic 'TEST0001' has a source location in file '/detached', which is not part of the compilation being analyzed.", "diagnostic"); 3666VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(PipelineCallbackGenerator), "Reported diagnostic 'TEST0001' has a source location in file '/detached', which is not part of the compilation being analyzed.", "diagnostic"); 3695VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(CallbackGenerator), "Reported diagnostic 'TEST0001' has a source location in file '/detached', which is not part of the compilation being analyzed.", "diagnostic"); 3726VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(CallbackGenerator), "Reported diagnostic 'TEST0001' has a source location in file '/detached', which is not part of the compilation being analyzed.", "diagnostic"); 3758VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(PipelineCallbackGenerator), "Reported diagnostic 'TEST0001' has a source location '[0..100)' in file '/original', which is outside of the given file.", "diagnostic"); 3791VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(PipelineCallbackGenerator), "Reported diagnostic 'TEST0001' has a source location '[0..100)' in file '/original', which is outside of the given file.", "diagnostic"); 3820VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(CallbackGenerator), "Reported diagnostic 'TEST0001' has a source location '[0..100)' in file '/original', which is outside of the given file.", "diagnostic"); 3850VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(CallbackGenerator), "Reported diagnostic 'TEST0001' has a source location '[0..100)' in file '/original', which is outside of the given file.", "diagnostic"); 3882VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(PipelineCallbackGenerator), "Reported diagnostic has an ID 'TEST 0001', which is not a valid identifier.", "diagnostic"); 3911VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(CallbackGenerator), "Reported diagnostic has an ID 'TEST 0001', which is not a valid identifier.", "diagnostic");
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.cs (162)
83step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C1" })); 162step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C2" })); 192step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.Single())); 222step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.Single())); 249step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.First())); 276step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.Last())); 304step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.First()), 305step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.Last())); 335step => Assert.True(step.Outputs.Single().Value is LocalFunctionStatementSyntax { Identifier.ValueText: "LocalFunc" })); 371step => Assert.True(step.Outputs.Single().Value is LocalFunctionStatementSyntax { Identifier.ValueText: "LocalFunc" })); 410step => Assert.True(step.Outputs.Single().Value is LocalFunctionStatementSyntax { Identifier.ValueText: "LocalFunc" })); 439step => Assert.True(step.Outputs.Single().Value is TypeParameterSyntax { Identifier.ValueText: "T" })); 472step => Assert.True(step.Outputs.Single().Value is MethodDeclarationSyntax { Identifier.ValueText: "M" })); 505step => Assert.True(step.Outputs.Single().Value is MethodDeclarationSyntax { Identifier.ValueText: "M" })); 537step => Assert.True(step.Outputs.Single().Value is MethodDeclarationSyntax { Identifier.ValueText: "M", Body: null, ExpressionBody: null })); 569step => Assert.True(step.Outputs.Single().Value is MethodDeclarationSyntax { Identifier.ValueText: "M", Body: not null })); 600step => Assert.True(step.Outputs.Single().Value is VariableDeclaratorSyntax { Identifier.ValueText: "m" })); 664step => Assert.True(step.Outputs.Single().Value is VariableDeclaratorSyntax { Identifier.ValueText: "m" })); 724step => Assert.True(step.Outputs.Single().Value is LambdaExpressionSyntax)); 758step => Assert.True(step.Outputs.Single().Value is AccessorDeclarationSyntax { RawKind: (int)SyntaxKind.GetAccessorDeclaration })); 787step => Assert.True(step.Outputs.Single().Value is TypeParameterSyntax { Identifier.ValueText: "T" })); 824step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C1" })); 861step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C2" })); 898step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C1" })); 935step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C2" })); 1043step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1080step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1118step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1156step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1194step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1232step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1294Assert.Equal(expectedGeneratedSources, driver.GetRunResult().Results.Single().GeneratedSources.Select(s => (s.HintName, s.SourceText.ToString()))); 1429step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1436step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1439Assert.Equal(IncrementalStepRunReason.Unchanged, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1440Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1441Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1442Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs.Single().Reason); 1443Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1444Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["result_ForAttributeInternal"].Single().Outputs.Single().Reason); 1445Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationAndGroupedNodes_ForAttributeWithMetadataName"].Single().Outputs.Single().Reason); 1446Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["result_ForAttributeWithMetadataName"].Single().Outputs.Single().Reason); 1476step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1483step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1486Assert.Equal(IncrementalStepRunReason.Unchanged, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1487Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1488Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1489Assert.Equal(IncrementalStepRunReason.Unchanged, runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs.Single().Reason); 1490Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1491Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["result_ForAttributeInternal"].Single().Outputs.Single().Reason); 1492Assert.Equal(IncrementalStepRunReason.Modified, runResult.TrackedSteps["compilationAndGroupedNodes_ForAttributeWithMetadataName"].Single().Outputs.Single().Reason); 1493Assert.Equal(IncrementalStepRunReason.Unchanged, runResult.TrackedSteps["result_ForAttributeWithMetadataName"].Single().Outputs.Single().Reason); 1523step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1529step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1532Assert.Equal(IncrementalStepRunReason.Unchanged, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1533Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1534Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1535Assert.Collection(runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs, 1537Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1538Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["result_ForAttributeInternal"].Single().Outputs.Single().Reason); 1539Assert.Equal(IncrementalStepRunReason.Modified, runResult.TrackedSteps["compilationAndGroupedNodes_ForAttributeWithMetadataName"].Single().Outputs.Single().Reason); 1540Assert.Equal(IncrementalStepRunReason.Unchanged, runResult.TrackedSteps["result_ForAttributeWithMetadataName"].Single().Outputs.Single().Reason); 1575step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1578Assert.Equal(IncrementalStepRunReason.Unchanged, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1579Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1580Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1581Assert.Collection(runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs, 1583Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1584Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["result_ForAttributeInternal"].Single().Outputs.Single().Reason); 1585Assert.Equal(IncrementalStepRunReason.Modified, runResult.TrackedSteps["compilationAndGroupedNodes_ForAttributeWithMetadataName"].Single().Outputs.Single().Reason); 1586Assert.Equal(IncrementalStepRunReason.New, runResult.TrackedSteps["result_ForAttributeWithMetadataName"].Single().Outputs.Single().Reason); 1628Assert.Equal(IncrementalStepRunReason.Unchanged, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1629Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1630Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1631Assert.Collection(runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs, 1633Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1634Assert.Collection(runResult.TrackedSteps["result_ForAttributeInternal"].Single().Outputs, 1636Assert.Equal(IncrementalStepRunReason.Modified, runResult.TrackedSteps["compilationAndGroupedNodes_ForAttributeWithMetadataName"].Single().Outputs.Single().Reason); 1637Assert.Collection(runResult.TrackedSteps["result_ForAttributeWithMetadataName"].Single().Outputs, 1680Assert.Equal(IncrementalStepRunReason.Unchanged, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1681Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1682Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1683Assert.Collection(runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs, 1687s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason), 1688s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason)); 1690s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason), 1691s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason)); 1693s => Assert.Equal(IncrementalStepRunReason.Modified, s.Outputs.Single().Reason), 1694s => Assert.Equal(IncrementalStepRunReason.Modified, s.Outputs.Single().Reason)); 1696s => Assert.Equal(IncrementalStepRunReason.New, s.Outputs.Single().Reason), 1697s => Assert.Equal(IncrementalStepRunReason.New, s.Outputs.Single().Reason)); 1740step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1743Assert.Equal(IncrementalStepRunReason.Unchanged, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1744Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1745Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1746Assert.Equal(IncrementalStepRunReason.New, runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs.Single().Reason); 1747Assert.Equal(IncrementalStepRunReason.New, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1748Assert.Equal(IncrementalStepRunReason.New, runResult.TrackedSteps["result_ForAttributeInternal"].Single().Outputs.Single().Reason); 1749Assert.Equal(IncrementalStepRunReason.New, runResult.TrackedSteps["compilationAndGroupedNodes_ForAttributeWithMetadataName"].Single().Outputs.Single().Reason); 1750Assert.Equal(IncrementalStepRunReason.New, runResult.TrackedSteps["result_ForAttributeWithMetadataName"].Single().Outputs.Single().Reason); 1788step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1791Assert.Equal(IncrementalStepRunReason.Unchanged, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1792Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1793Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1794Assert.Collection(runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs, 1796Assert.Equal(IncrementalStepRunReason.New, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1797Assert.Equal(IncrementalStepRunReason.New, runResult.TrackedSteps["result_ForAttributeInternal"].Single().Outputs.Single().Reason); 1798Assert.Equal(IncrementalStepRunReason.New, runResult.TrackedSteps["compilationAndGroupedNodes_ForAttributeWithMetadataName"].Single().Outputs.Single().Reason); 1799Assert.Equal(IncrementalStepRunReason.New, runResult.TrackedSteps["result_ForAttributeWithMetadataName"].Single().Outputs.Single().Reason);
SourceGeneration\GeneratorDriverTests_Attributes_SimpleName.cs (177)
54step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 86step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 162step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 347step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 373step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 399step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 432step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 460step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 546step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 579step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 611step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 810step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 841step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 871step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 956step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 985step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1017step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1024step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1027Assert.Equal(IncrementalStepRunReason.Unchanged, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1028Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1029Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs.Single().Reason); 1030Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1031Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["result_ForAttribute"].Single().Outputs.Single().Reason); 1057step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1064step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1067Assert.Equal(IncrementalStepRunReason.Unchanged, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1068Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1069Assert.Equal(IncrementalStepRunReason.Unchanged, runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs.Single().Reason); 1070Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1071Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["result_ForAttribute"].Single().Outputs.Single().Reason); 1103step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1110s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason), 1111s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason)); 1114Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1117Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1119Assert.Collection(runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs, 1123Assert.Equal(IncrementalStepRunReason.Removed, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1124Assert.Equal(IncrementalStepRunReason.Removed, runResult.TrackedSteps["result_ForAttribute"].Single().Outputs.Single().Reason); 1156step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1166s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason), 1167s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason)); 1168Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1169Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1171Assert.Collection(runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs, 1175Assert.Equal(IncrementalStepRunReason.Removed, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1176Assert.Equal(IncrementalStepRunReason.Removed, runResult.TrackedSteps["result_ForAttribute"].Single().Outputs.Single().Reason); 1217s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason), 1218s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason)); 1219Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1220Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1222Assert.Collection(runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs, 1226Assert.Equal(IncrementalStepRunReason.New, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1227Assert.Equal(IncrementalStepRunReason.New, runResult.TrackedSteps["result_ForAttribute"].Single().Outputs.Single().Reason); 1230step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1262step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1273s => Assert.Equal(IncrementalStepRunReason.Unchanged, s.Outputs.Single().Reason), 1274s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason)); 1275Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1276Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1278Assert.Collection(runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs, 1282Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1283Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["result_ForAttribute"].Single().Outputs.Single().Reason); 1315step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1324Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" }); 1325Assert.Equal(IncrementalStepRunReason.Removed, step.Outputs.Single().Reason); 1329s => Assert.Equal(IncrementalStepRunReason.Modified, s.Outputs.Single().Reason), 1330s => Assert.Equal(IncrementalStepRunReason.Removed, s.Outputs.Single().Reason)); 1331Assert.Equal(IncrementalStepRunReason.Modified, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1332Assert.Equal(IncrementalStepRunReason.Modified, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1334Assert.Collection(runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs, 1338Assert.Equal(IncrementalStepRunReason.Removed, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1339Assert.Equal(IncrementalStepRunReason.Removed, runResult.TrackedSteps["result_ForAttribute"].Single().Outputs.Single().Reason); 1373step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1380step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1383s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason), 1384s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason)); 1385Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1386Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1388Assert.Collection(runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs, 1392Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1393Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["result_ForAttribute"].Single().Outputs.Single().Reason); 1429s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason), 1430s => Assert.Equal(IncrementalStepRunReason.New, s.Outputs.Single().Reason)); 1431Assert.Equal(IncrementalStepRunReason.Modified, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1432Assert.Equal(IncrementalStepRunReason.Modified, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1434Assert.Collection(runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs, 1438Assert.Equal(IncrementalStepRunReason.Modified, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1439Assert.Equal(IncrementalStepRunReason.New, runResult.TrackedSteps["result_ForAttribute"].Single().Outputs.Single().Reason); 1442step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1474s => Assert.Equal(IncrementalStepRunReason.New, s.Outputs.Single().Reason)); 1475Assert.Equal(IncrementalStepRunReason.Modified, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1476Assert.Equal(IncrementalStepRunReason.Modified, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1478Assert.Collection(runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs, 1481Assert.Equal(IncrementalStepRunReason.Modified, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1482Assert.Equal(IncrementalStepRunReason.New, runResult.TrackedSteps["result_ForAttribute"].Single().Outputs.Single().Reason); 1485step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1517step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1526s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason), 1527s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason)); 1528Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1529Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1531Assert.Collection(runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs, 1535Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1536Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["result_ForAttribute"].Single().Outputs.Single().Reason); 1568step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1578s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason), 1579s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason)); 1580Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1581Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1583Assert.Collection(runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs, 1589s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason), 1590s => Assert.Equal(IncrementalStepRunReason.New, s.Outputs.Single().Reason)); 1592s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason), 1593s => Assert.Equal(IncrementalStepRunReason.New, s.Outputs.Single().Reason)); 1596step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" }), 1597step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "D" })); 1629step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C" })); 1640s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason), 1641s => Assert.Equal(IncrementalStepRunReason.Cached, s.Outputs.Single().Reason)); 1642Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["collectedGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1643Assert.Equal(IncrementalStepRunReason.Cached, runResult.TrackedSteps["allUpGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1645Assert.Collection(runResult.TrackedSteps["compilationUnit_ForAttribute"].Single().Outputs, 1649Assert.Equal(IncrementalStepRunReason.Modified, runResult.TrackedSteps["compilationUnitAndGlobalAliases_ForAttribute"].Single().Outputs.Single().Reason); 1650Assert.Equal(IncrementalStepRunReason.Modified, runResult.TrackedSteps["result_ForAttribute"].Single().Outputs.Single().Reason); 1653step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "D" }));
SourceGeneration\SyntaxAwareGeneratorTests.cs (8)
393GeneratorDriverTests.VerifyGeneratorExceptionDiagnostic<Exception>(outputDiagnostics.Single(), nameof(CallbackGenerator), "Test Exception"); 435GeneratorDriverTests.VerifyGeneratorExceptionDiagnostic<Exception>(outputDiagnostics.Single(), nameof(CallbackGenerator), "Test Exception"); 531GeneratorDriverTests.VerifyGeneratorExceptionDiagnostic<Exception>(outputDiagnostics.Single(), nameof(CallbackGenerator), "Test Exception"); 568GeneratorDriverTests.VerifyGeneratorExceptionDiagnostic<Exception>(outputDiagnostics.Single(), nameof(CallbackGenerator), "test exception", initialization: true); 640GeneratorDriverTests.VerifyGeneratorExceptionDiagnostic<Exception>(outputDiagnostics.Single(), nameof(CallbackGenerator), "test exception", initialization: true); 1872GeneratorDriverTests.VerifyGeneratorExceptionDiagnostic<Exception>(outputDiagnostics.Single(), nameof(PipelineCallbackGenerator), "Test Exception"); 1913GeneratorDriverTests.VerifyGeneratorExceptionDiagnostic<Exception>(outputDiagnostics.Single(), nameof(PipelineCallbackGenerator), "Test Exception"); 1962GeneratorDriverTests.VerifyGeneratorExceptionDiagnostic<Exception>(outputDiagnostics.Single(), nameof(PipelineCallbackGenerator), "Test Exception");
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1093)
Compilation\CompilationAPITests.cs (8)
1904Assert.Equal("alias", comp.References.Last().Properties.Aliases.Single()); 2633Assert.Equal(loc1, type.GetMembers("m1").Single().Locations.Single()); 2634Assert.Equal(loc2, type.GetMembers("m2").Single().Locations.Single()); 2839var syntaxTree = compilation.SyntaxTrees.Single(); 2874var syntaxTree = compilation.SyntaxTrees.Single(); 2906var syntaxTree = compilation.SyntaxTrees.Single();
Compilation\ForEachStatementInfoTests.cs (8)
38var ge1 = (IMethodSymbol)e1.GetMembers("GetEnumerator").Single(); 39var mn1 = (IMethodSymbol)e1.GetMembers("MoveNext").Single(); 40var cur1 = (IPropertySymbol)e1.GetMembers("Current").Single(); 41var disp1 = (IMethodSymbol)e1.GetMembers("Dispose").Single(); 45var ge2 = (IMethodSymbol)e2.GetMembers("GetEnumerator").Single(); 46var mn2 = (IMethodSymbol)e2.GetMembers("MoveNext").Single(); 47var cur2 = (IPropertySymbol)e2.GetMembers("Current").Single(); 48var disp2 = (IMethodSymbol)e2.GetMembers("Dispose").Single();
Compilation\GetImportScopesTests.cs (224)
54Assert.Single(scopes.Single().Imports); 55Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 56Assert.True(scopes.Single().Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax); 57Assert.Empty(scopes.Single().Aliases); 58Assert.Empty(scopes.Single().ExternAliases); 59Assert.Empty(scopes.Single().XmlNamespaces); 70Assert.Single(scopes.Single().Imports); 71Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 72Assert.True(scopes.Single().Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax); 73Assert.Empty(scopes.Single().Aliases); 74Assert.Empty(scopes.Single().ExternAliases); 75Assert.Empty(scopes.Single().XmlNamespaces); 101Assert.Single(scopes.Single().Imports); 102Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 103Assert.True(scopes.Single().Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax); 104Assert.Empty(scopes.Single().Aliases); 105Assert.Empty(scopes.Single().ExternAliases); 106Assert.Empty(scopes.Single().XmlNamespaces); 129Assert.Single(scopes.Single().Imports); 130Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 131Assert.True(scopes.Single().Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax); 132Assert.Empty(scopes.Single().Aliases); 133Assert.Empty(scopes.Single().ExternAliases); 134Assert.Empty(scopes.Single().XmlNamespaces); 146Assert.Equal(2, scopes.Single().Imports.Length); 147Assert.True(scopes.Single().Imports.Any(i => i.NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) })); 148Assert.True(scopes.Single().Imports.Any(i => i.NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) })); 149Assert.True(scopes.Single().Imports.Any(i => i.DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(System) } })); 150Assert.True(scopes.Single().Imports.Any(i => i.DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } })); 151Assert.Empty(scopes.Single().Aliases); 152Assert.Empty(scopes.Single().ExternAliases); 153Assert.Empty(scopes.Single().XmlNamespaces); 174Assert.Single(scopes.Single().Imports); 175Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 176Assert.True(scopes.Single().Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(System) } }); 198Assert.True(scopes[0].Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) }); 199Assert.True(scopes[0].Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } }); 200Assert.True(scopes[1].Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 201Assert.True(scopes[1].Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(System) } }); 226Assert.True(scopes[0].Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) }); 227Assert.True(scopes[0].Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } }); 228Assert.True(scopes[1].Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 229Assert.True(scopes[1].Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(System) } }); 243Assert.Single(scopes.Single().Aliases); 244Assert.True(scopes.Single().Aliases.Single() is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 245Assert.True(scopes.Single().Aliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax); 246Assert.Empty(scopes.Single().Imports); 247Assert.Empty(scopes.Single().ExternAliases); 248Assert.Empty(scopes.Single().XmlNamespaces); 259Assert.Single(scopes.Single().Aliases); 260Assert.True(scopes.Single().Aliases.Single() is { Name: "S", Target: { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 261Assert.True(scopes.Single().Aliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax); 262Assert.Empty(scopes.Single().Imports); 263Assert.Empty(scopes.Single().ExternAliases); 264Assert.Empty(scopes.Single().XmlNamespaces); 290Assert.Single(scopes.Single().Aliases); 291Assert.True(scopes.Single().Aliases.Single() is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 292Assert.True(scopes.Single().Aliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax); 293Assert.Empty(scopes.Single().Imports); 294Assert.Empty(scopes.Single().ExternAliases); 295Assert.Empty(scopes.Single().XmlNamespaces); 318Assert.Single(scopes.Single().Aliases); 319Assert.True(scopes.Single().Aliases.Single() is { Name: "S", Target: { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 320Assert.True(scopes.Single().Aliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax); 321Assert.Empty(scopes.Single().Imports); 322Assert.Empty(scopes.Single().ExternAliases); 323Assert.Empty(scopes.Single().XmlNamespaces); 335Assert.Equal(2, scopes.Single().Aliases.Length); 336Assert.True(scopes.Single().Aliases.Any(a => a is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } })); 337Assert.True(scopes.Single().Aliases.Any(a => a is { Name: "M", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) } })); 338Assert.True(scopes.Single().Aliases.Any(a => a.DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(System) } })); 339Assert.True(scopes.Single().Aliases.Any(a => a.DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } })); 340Assert.Empty(scopes.Single().Imports); 341Assert.Empty(scopes.Single().ExternAliases); 342Assert.Empty(scopes.Single().XmlNamespaces); 363Assert.Single(scopes.Single().Aliases); 364Assert.True(scopes.Single().Aliases.Single() is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 365Assert.True(scopes.Single().Aliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(System) } }); 387Assert.True(scopes[0].Aliases.Single() is { Name: "M", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) } }); 388Assert.True(scopes[0].Aliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } }); 389Assert.True(scopes[1].Aliases.Single() is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 390Assert.True(scopes[1].Aliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(System) } }); 417Assert.Single(scopes.Single().ExternAliases); 418Assert.True(scopes.Single().ExternAliases.Single() is { Name: "CORE" }); 419Assert.True(scopes.Single().ExternAliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is ExternAliasDirectiveSyntax); 420Assert.Empty(scopes.Single().Imports); 421Assert.Empty(scopes.Single().Aliases); 422Assert.Empty(scopes.Single().XmlNamespaces); 436Assert.Single(scopes.Single().ExternAliases); 437Assert.True(scopes.Single().ExternAliases.Single() is { Name: "CORE", Target: INamespaceSymbol { IsGlobalNamespace: true } }); 438Assert.True(scopes.Single().ExternAliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is ExternAliasDirectiveSyntax); 439Assert.Empty(scopes.Single().Imports); 440Assert.Empty(scopes.Single().Aliases); 441Assert.Empty(scopes.Single().XmlNamespaces); 458Assert.Single(scopes.Single().ExternAliases); 459Assert.True(scopes.Single().ExternAliases.Single() is { Name: "CORE", Target: INamespaceSymbol { IsGlobalNamespace: true } }); 460Assert.True(scopes.Single().ExternAliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is ExternAliasDirectiveSyntax); 461Assert.Empty(scopes.Single().Imports); 462Assert.Empty(scopes.Single().Aliases); 463Assert.Empty(scopes.Single().XmlNamespaces); 479Assert.Single(scopes.Single().ExternAliases); 480Assert.True(scopes.Single().ExternAliases.Single() is { Name: "CORE", Target: INamespaceSymbol { IsGlobalNamespace: true } }); 481Assert.True(scopes.Single().ExternAliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is ExternAliasDirectiveSyntax); 482Assert.Empty(scopes.Single().Imports); 483Assert.Empty(scopes.Single().Aliases); 484Assert.Empty(scopes.Single().XmlNamespaces); 498Assert.Single(scopes.Single().ExternAliases); 499Assert.True(scopes.Single().ExternAliases.Single() is { Name: "CORE", Target: INamespaceSymbol { IsGlobalNamespace: true } }); 500Assert.True(scopes.Single().ExternAliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is ExternAliasDirectiveSyntax); 515Assert.Single(scopes.Single().ExternAliases); 516Assert.True(scopes.Single().ExternAliases.Single() is { Name: "CORE", Target: INamespaceSymbol { IsGlobalNamespace: true } }); 517Assert.True(scopes.Single().ExternAliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is ExternAliasDirectiveSyntax); 518Assert.Empty(scopes.Single().Imports); 519Assert.Empty(scopes.Single().Aliases); 520Assert.Empty(scopes.Single().XmlNamespaces); 535Assert.Equal(2, scopes.Single().ExternAliases.Length); 536Assert.True(scopes.Single().ExternAliases.Any(a => a is { Name: "CORE1", Target: INamespaceSymbol { IsGlobalNamespace: true } })); 537Assert.True(scopes.Single().ExternAliases.Any(a => a is { Name: "CORE2", Target: INamespaceSymbol { IsGlobalNamespace: true } })); 538Assert.True(scopes.Single().ExternAliases.Any(a => a.DeclaringSyntaxReferences.Single().GetSyntax() is ExternAliasDirectiveSyntax { Identifier.Text: "CORE1" })); 539Assert.True(scopes.Single().ExternAliases.Any(a => a.DeclaringSyntaxReferences.Single().GetSyntax() is ExternAliasDirectiveSyntax { Identifier.Text: "CORE2" })); 540Assert.Empty(scopes.Single().Imports); 541Assert.Empty(scopes.Single().Aliases); 542Assert.Empty(scopes.Single().XmlNamespaces); 566Assert.Single(scopes.Single().ExternAliases); 567Assert.True(scopes.Single().ExternAliases.Single() is { Name: "CORE1", Target: INamespaceSymbol { IsGlobalNamespace: true } }); 568Assert.True(scopes.Single().ExternAliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is ExternAliasDirectiveSyntax { Identifier.Text: "CORE1" }); 593Assert.True(scopes[0].ExternAliases.Single() is { Name: "CORE2", Target: INamespaceSymbol { IsGlobalNamespace: true } }); 594Assert.True(scopes[0].ExternAliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is ExternAliasDirectiveSyntax { Identifier.Text: "CORE2" }); 595Assert.True(scopes[1].ExternAliases.Single() is { Name: "CORE1", Target: INamespaceSymbol { IsGlobalNamespace: true } }); 596Assert.True(scopes[1].ExternAliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is ExternAliasDirectiveSyntax { Identifier.Text: "CORE1" }); 617Assert.Single(scopes.Single().Aliases); 618Assert.Single(scopes.Single().Imports); 619Assert.Empty(scopes.Single().ExternAliases); 620Assert.Empty(scopes.Single().XmlNamespaces); 622Assert.True(scopes.Single().Aliases.Single() is { Name: "M", Target: INamespaceSymbol { Name: nameof(Microsoft) } }); 623Assert.True(scopes.Single().Aliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Alias.Name.Identifier.Text: "M" }); 625Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 626Assert.True(scopes.Single().Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(System) } }); 647Assert.Single(scopes.Single().Imports); 648Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 649Assert.True(scopes.Single().Imports.Single().DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax); 651Assert.Single(scopes.Single().Aliases); 652Assert.True(scopes.Single().Aliases.Single() is { Name: "M", Target: INamespaceSymbol { Name: nameof(Microsoft) } }); 653Assert.True(scopes.Single().Aliases.Single().DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Alias.Name.Identifier.Text: "M" }); 655Assert.Empty(scopes.Single().ExternAliases); 656Assert.Empty(scopes.Single().XmlNamespaces); 681Assert.Equal(2, scopes.Single().Imports.Length); 682Assert.True(scopes.Single().Imports.Any(i => i.NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) })); 683Assert.True(scopes.Single().Imports.Any(i => i.DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(System) } })); 684Assert.True(scopes.Single().Imports.Any(i => i.NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: false, Name: nameof(System.IO) })); 685Assert.True(scopes.Single().Imports.Any(i => i.DeclaringSyntaxReference!.GetSyntax() is UsingDirectiveSyntax { Name: QualifiedNameSyntax { Right: IdentifierNameSyntax { Identifier.Text: nameof(System.IO) } } })); 687Assert.Equal(2, scopes.Single().Aliases.Length); 688Assert.True(scopes.Single().Aliases.Any(i => i is { Name: "M", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) } })); 689Assert.True(scopes.Single().Aliases.Any(i => i.DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Name: IdentifierNameSyntax { Identifier.Text: nameof(Microsoft) } })); 690Assert.True(scopes.Single().Aliases.Any(i => i is { Name: "T", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: false, Name: nameof(System.Threading) } })); 691Assert.True(scopes.Single().Aliases.Any(i => i.DeclaringSyntaxReferences.Single().GetSyntax() is UsingDirectiveSyntax { Name: QualifiedNameSyntax { Right: IdentifierNameSyntax { Identifier.Text: nameof(System.Threading) } } })); 693Assert.Empty(scopes.Single().ExternAliases); 694Assert.Empty(scopes.Single().XmlNamespaces);
Compilation\GetSemanticInfoBrokenCodeTests.cs (4)
197var tree = comp.SyntaxTrees.Single(); 221var tree = comp.SyntaxTrees.Single(); 264var tree = comp.SyntaxTrees.Single(); 297var tree = comp.SyntaxTrees.Single();
Compilation\GetSemanticInfoTests.cs (52)
1532var candidate = bindInfo.CandidateSymbols.Single(); 1713Assert.Equal(symbol, lookupSymbols.Single()); 1748Assert.Equal(symbol, lookupSymbols.Single()); 1816var candidate = (IMethodSymbol)bindInfo.CandidateSymbols.Single(); 2476var tree = comp.SyntaxTrees.Single(); 2563var tree = compilation.SyntaxTrees.Single(); 3463var tree = compilation.SyntaxTrees.Single(); 3517var tree = compilation.SyntaxTrees.Single(); 3549var tree = compilation.SyntaxTrees.Single(); 3577var tree = compilation.SyntaxTrees.Single(); 3604var tree = compilation.SyntaxTrees.Single(); 3629var tree = compilation.SyntaxTrees.Single(); 3662var tree = compilation.SyntaxTrees.Single(); 3698var tree = compilation.SyntaxTrees.Single(); 3754var tree = compilation.SyntaxTrees.Single(); 3790Assert.Equal(compilation.GlobalNamespace.GetMember<INamedTypeSymbol>("C").GetMember<IMethodSymbol>("M"), info.CandidateSymbols.Single()); 3815var tree = compilation.SyntaxTrees.Single(); 3850Assert.Equal(compilation.GlobalNamespace.GetMember<INamedTypeSymbol>("C").GetMember<IMethodSymbol>("M"), info.CandidateSymbols.Single()); 3869var tree = compilation.SyntaxTrees.Single(); 3949var tree = compilation.SyntaxTrees.Single(); 3995var tree = compilation.SyntaxTrees.Single(); 4104var tree = comp.SyntaxTrees.Single(); 4117Assert.Equal(SpecialType.System_Int32, ((INamedTypeSymbol)info0.Symbol).TypeArguments.Single().SpecialType); 4125Assert.Equal(SpecialType.System_Int32, ((INamedTypeSymbol)info2.Symbol).TypeArguments.Single().SpecialType); 4159var tree = comp.SyntaxTrees.Single(); 4176Assert.Equal(SpecialType.System_Int32, ((INamedTypeSymbol)info2.Symbol).TypeArguments.Single().SpecialType); 4208var tree = compilation.SyntaxTrees.Single(); 4238var tree = compilation.SyntaxTrees.Single(); 4268var tree = compilation.SyntaxTrees.Single(); 4289var tree = compilation.SyntaxTrees.Single(); 4319var tree = compilation.SyntaxTrees.Single(); 4352var tree = compilation.SyntaxTrees.Single(); 4373var tree = compilation.SyntaxTrees.Single(); 4397var tree = compilation.SyntaxTrees.Single(); 4444Assert.Equal(classNested, leftInfo.CandidateSymbols.Single()); 4448Assert.Equal(classAnother, rightInfo.CandidateSymbols.Single()); 4494Assert.Equal(propertyP.GetMethod, info.CandidateSymbols.Single()); 4541Assert.Equal(classNested, typeInfo.CandidateSymbols.Single()); 4586var tree = compilation.SyntaxTrees.Single(); 4600Assert.Equal("System.Int32 C.GetHashCode()", classInfo.CandidateSymbols.Single().ToTestDisplayString()); 4602Assert.Equal("System.Int32 S.GetHashCode()", structInfo.CandidateSymbols.Single().ToTestDisplayString()); 4638var tree = compilation.SyntaxTrees.Single(); 4647Assert.Equal("void C.M()", info.CandidateSymbols.Single().ToTestDisplayString()); 4749var tree = comp.SyntaxTrees.Single(); 4782var tree = comp.SyntaxTrees.Single(); 4825var tree = comp.SyntaxTrees.Single(); 4871var tree = comp.SyntaxTrees.Single(); 4907var tree = comp.SyntaxTrees.Single(); 5475var tree = comp.SyntaxTrees.Single(); 5911var tree = comp.SyntaxTrees.Single(); 5984var tree = comp.SyntaxTrees.Single(); 6008var tree = compilation.SyntaxTrees.Single();
Compilation\LoadDirectiveTests.cs (1)
118Assert.Equal(external4, compilation.SyntaxTrees.Single());
Compilation\ReferenceManagerTests.cs (2)
1771var tree1 = comp1.SyntaxTrees.Single(); 1821var tree1 = comp1.SyntaxTrees.Single();
Compilation\SemanticModelAPITests.cs (73)
173var tree = comp.SyntaxTrees.Single(); 200var tree = comp.SyntaxTrees.Single(); 232var tree = comp.SyntaxTrees.Single(); 462var a = global.GetTypeMembers("A", 0).Single(); 466var b = global.GetTypeMembers("B", 0).Single(); 467var r = b.GetTypeMembers("R", 0).Single(); 468var q = r.GetTypeMembers("Q", 0).Single(); 469var v = a.GetMembers("v").Single() as FieldSymbol; 539var a = comp.GlobalNamespace.GetTypeMembers("A", 0).Single().ISymbol; 565var b = comp.GlobalNamespace.GetTypeMembers("B", 0).Single().ISymbol; 593var c = comp.GlobalNamespace.GetTypeMembers("C", 1).Single(); 617var a = comp.GlobalNamespace.GetTypeMembers("A", 1).Single(); 619var b = comp.GlobalNamespace.GetTypeMembers("B", 1).Single(); 679Assert.Equal(compilation.GlobalNamespace.GetTypeMembers("Program", 0).Single(), info.Symbol); 734var a = comp.GlobalNamespace.GetTypeMembers("A", 0).Single(); 758var a2 = global.GetTypeMembers("A", 0).Single(); 759var b2 = a2.GetTypeMembers("B", 0).Single(); 824var bOuter = comp.GlobalNamespace.GetTypeMembers("B", 0).Single(); 825var bInner = (comp.GlobalNamespace.GetMembers("N").Single() as INamespaceSymbol).GetTypeMembers("B", 0).Single(); 867var pTypeSym = comp.SourceModule.GlobalNamespace.GetTypeMembers("PC").Single(); 868var pMethodSym = pTypeSym.GetMembers("PM").Single(); 1262var tree = comp2.SyntaxTrees.Single(); 1303var tree = comp.SyntaxTrees.Single(); 1335var tree = comp.SyntaxTrees.Single(); 1387var tree = comp.SyntaxTrees.Single(); 2017var tree = comp.SyntaxTrees.Single(); 2138var tree = comp.SyntaxTrees.Single(); 2307var tree = comp.SyntaxTrees.Single(); 3124var tree = comp.SyntaxTrees.Single(); 3154var tree = comp.SyntaxTrees.Single(); 3189var tree = comp.SyntaxTrees.Single(); 3219var tree = comp.SyntaxTrees.Single(); 3256var tree = comp.SyntaxTrees.Single(); 3297var tree = comp.SyntaxTrees.Single(); 3338var tree = comp.SyntaxTrees.Single(); 3372var tree = comp.SyntaxTrees.Single(); 3414var tree = comp.SyntaxTrees.Single(); 3455var tree = comp.SyntaxTrees.Single(); 3496var tree = comp.SyntaxTrees.Single(); 3521var tree = compilation.SyntaxTrees.Single(); 3542var tree = compilation.SyntaxTrees.Single(); 3581var tree = comp.SyntaxTrees.Single(); 3754var firstParamType = ((ISymbol)exprInfo.CandidateSymbols.Single()).GetParameters().First().Type; 3816var tree = comp.SyntaxTrees.Single(); 3843var tree = comp.SyntaxTrees.Single(); 3848var symbol = model.LookupSymbols(syntax.SpanStart, name: "Alias").Single(); 3871var tree = comp.SyntaxTrees.Single(); 3875var symbol = model.LookupSymbols(endPosition, name: "M0").Single(); 4028var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4055var tree = compilation.SyntaxTrees.Single(); 4084var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4104var tree = comp.SyntaxTrees.Single(); 4141var tree = comp.SyntaxTrees.Single(); 4184var tree = comp.SyntaxTrees.Single(); 4208var tree = comp.SyntaxTrees.Single(); 4236var tree = comp.SyntaxTrees.Single(); 4274var tree = comp.SyntaxTrees.Single(); 4326var tree = comp.SyntaxTrees.Single(); 4452var method = (IMethodSymbol)comp.GetTypeByMetadataName("C").GetMembers("M").Single().GetPublicSymbol(); 4453var attribute = method.GetAttributes().Single(); 4456var tree = comp.SyntaxTrees.Single(); 4473var tree = comp.SyntaxTrees.Single(); 4537var tree = comp.SyntaxTrees.Single(); 4610var tree = compilation.SyntaxTrees.Single(); 4624var tree = compilation.SyntaxTrees.Single(); 4643var tree = compilation.SyntaxTrees.Single(); 4660var tree = compilation.SyntaxTrees.Single(); 4675var tree = compilation.SyntaxTrees.Single(); 4691var tree = compilation.SyntaxTrees.Single(); 4707var tree = compilation.SyntaxTrees.Single(); 4726var tree = compilation.SyntaxTrees.Single(); 4742var tree = compilation.SyntaxTrees.Single(); 4757var tree = compilation.SyntaxTrees.Single();
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (65)
36var tree = comp.SyntaxTrees.Single(); 58var tree = comp.SyntaxTrees.Single(); 1030var tree = compilation.SyntaxTrees.Single(); 1051var tree = compilation.SyntaxTrees.Single(); 1080var tree = compilation.SyntaxTrees.Single(); 1121var tree = compilation.SyntaxTrees.Single(); 1146var container = (INamespaceOrTypeSymbol)symbols.Single(); 1170var tree = compilation.SyntaxTrees.Single(); 1207var tree = compilation.SyntaxTrees.Single(); 1243var tree = compilation.SyntaxTrees.Single(); 1277var tree = compilation.SyntaxTrees.Single(); 1327var tree = compilation.SyntaxTrees.Single(); 1377var tree = compilation.SyntaxTrees.Single(); 1430var tree = compilation.SyntaxTrees.Single(); 1479var tree = compilation.SyntaxTrees.Single(); 1527var tree = compilation.SyntaxTrees.Single(); 1590var tree = compilation.SyntaxTrees.Single(); 1624var tree = compilation.SyntaxTrees.Single(); 1662var tree = compilation.SyntaxTrees.Single(); 1866var tree = compilation.SyntaxTrees.Single(); 2003var tree = compilation.SyntaxTrees.Single(); 2047var tree = compilation.SyntaxTrees.Single(); 2077var tree = compilation.SyntaxTrees.Single(); 2164var tree = compilation.SyntaxTrees.Single(); 3174var tree = compilation.SyntaxTrees.Single(); 3934Assert.NotEqual(alias1.Locations.Single(), alias2.Locations.Single()); 4124var tree = comp.SyntaxTrees.Single(); 4142tree = comp.SyntaxTrees.Single(); 4166var tree = compilation.SyntaxTrees.Single(); 4244var tree = compilation.SyntaxTrees.Single(); 4447Assert.Equal(declaredSymbol, lookupSymbols.Single()); //conversions can't be referenced by name, but the user asked for it specifically 4478Assert.Equal(declaredSymbol, lookupSymbols.Single()); //conversions can't be referenced by name, but the user asked for it specifically 4509Assert.Equal(declaredSymbol, lookupSymbols.Single()); //operators can't be referenced by name, but the user asked for it specifically 4541var alias = (IAliasSymbol)symbols.Single(); 4578var alias = (IAliasSymbol)symbols.Single(); 4602var tree = compilation.SyntaxTrees.Single(); 4740var tree = compilation.SyntaxTrees.Single(); 4766var tree = compilation.SyntaxTrees.Single(); 4801Assert.Equal("(1, 2)", type.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 4802Assert.True(type.Locations.Single().IsInSource); 4824Assert.Equal("(Alice: 1, Bob: 2)", type.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 4825Assert.True(type.Locations.Single().IsInSource); 4847Assert.Equal("(1, 1)", type.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 4848Assert.True(type.Locations.Single().IsInSource); 4870Assert.Equal("(1, null)", type.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 4871Assert.True(type.Locations.Single().IsInSource); 4893Assert.Equal("(Alice:1, Bob:null)", type.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 4894Assert.True(type.Locations.Single().IsInSource); 4916Assert.Equal("Bob", element.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 4917Assert.True(element.Locations.Single().IsInSource); 4939Assert.Equal("Bob", element.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 4940Assert.True(element.Locations.Single().IsInSource); 4962Assert.Equal("Bob", element.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 4963Assert.True(element.Locations.Single().IsInSource); 4997Assert.Equal("Bob", element.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 4998Assert.True(element.Locations.Single().IsInSource); 5043Assert.Equal("Bob", element.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 5044Assert.True(element.Locations.Single().IsInSource); 5092Assert.Equal("Bob", element.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 5093Assert.True(element.Locations.Single().IsInSource); 5115Assert.Equal("Bob", element.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 5116Assert.True(element.Locations.Single().IsInSource); 5170var tree = compilation.SyntaxTrees.Single(); 5203var tree = comp.SyntaxTrees.Single();
Compilation\SemanticModelGetSemanticInfoTests.cs (11)
8266var tree = compilation.SyntaxTrees.Single(); 8431var tree = compilation.SyntaxTrees.Single(); 8455var tree = compilation.SyntaxTrees.Single(); 8691Assert.Equal("System.Int32 Test.M()", semanticInfo.CandidateSymbols.Single().ToTestDisplayString()); 9069Assert.Equal("System.Int32 Test.M()", semanticInfo.CandidateSymbols.Single().ToTestDisplayString()); 9281Assert.Equal(constructedFrom, a.GetTypeMembers("B").Single()); 14595Utils.CheckSymbol(semanticInfo.CandidateSymbols.Single(), "void C.M<T>(T t)"); 14653var tree = comp.SyntaxTrees.Single(); 14786SyntaxTree tree = compilation.SyntaxTrees.Single(); 14882SyntaxTree tree = compilation.SyntaxTrees.Single(); 14993SyntaxTree tree = compilation.SyntaxTrees.Single();
DocumentationComments\CrefTests.cs (57)
304var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 1814var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 2942var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 2964var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 2996var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3014actualJ = (ITypeParameterSymbol)actualTypeA.TypeArguments.Single(); 3026actualK = (ITypeParameterSymbol)actualTypeB.TypeArguments.Single(); 3041actualL = (ITypeParameterSymbol)actualMethod.TypeArguments.Single(); 3071var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3096var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3123var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3154var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3177var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3200var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3223var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3247var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3271var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3295var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3319var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3342var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3369var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 3401Assert.Equal(typeInner.GetPublicSymbol(), model.LookupSymbols(position, typeOuter.GetPublicSymbol(), typeInner.Name).Single()); 4556var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4574var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4592var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4609var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4645var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4697var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4753var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4819var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4908var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5044var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5175var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5197var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5283var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5309var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5335var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5361var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5423var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5511var tree = compilation.SyntaxTrees.Single(); 5556var tree = compilation.SyntaxTrees.Single(); 5563var crefTypeParam = referencedType.TypeArguments.Single(); 5566var sourceTypeParam = referencedType.TypeParameters.Single(); 5656var tree = compilation.SyntaxTrees.Single(); 5695var tree = compilation.SyntaxTrees.Single(); 5714var tree = compilation.SyntaxTrees.Single(); 5747var tree = compilation.SyntaxTrees.Single(); 5790var tree = compilation.SyntaxTrees.Single(); 6351Assert.Equal(accessor, nonCrefInfo.CandidateSymbols.Single()); 6366Assert.Equal(inheritedType, nonCrefInfo.CandidateSymbols.Single()); 6540Assert.Equal(TypeKind.Error, ((INamedTypeSymbol)actualSymbol1).TypeArguments.Single().TypeKind); 6701var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 6708var parameterSymbol = ((IMethodSymbol)model.GetSymbolInfo(cref).Symbol).Parameters.Single(); 6744var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 6751var parameterSymbol = ((IMethodSymbol)model.GetSymbolInfo(cref).Symbol).Parameters.Single(); 6894var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 7063var model = comp.GetSemanticModel(comp.SyntaxTrees.Single());
DocumentationComments\DocumentationCommentIDTests.cs (4)
29var tree = comp.SyntaxTrees.Single(); 142var tree = comp.SyntaxTrees.Single(); 163var tree = comp.SyntaxTrees.Single(); 307var tree = comp.SyntaxTrees.Single();
DocumentationComments\ParameterTests.cs (24)
34var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 57var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 81var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 105var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 134var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 159var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 184var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 205var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 226var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 247var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 272var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 298var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 326var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 349var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 373var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 404var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 431var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 458var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 485var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 512var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 539var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 690var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 740var tree = compilation.SyntaxTrees.Single(); 787var tree = compilation.SyntaxTrees.Single();
DocumentationComments\PartialTypeDocumentationCommentTests.cs (1)
51_gooClass = _compilation.GlobalNamespace.GetTypeMembers("Goo").Single();
DocumentationComments\TypeDocumentationCommentTests.cs (1)
53Assert.Equal("T:Color", _compilation.GlobalNamespace.GetTypeMembers("Color").Single().GetDocumentationCommentId());
SymbolDisplay\SymbolDisplayTests.cs (36)
2285var goo = a.GetMembers("_Prop").Single(); 4847var goo = a.GetMembers("Goo").Single(); 5039var type = outer.GetMembers("Inner").Single(); 5040var method = outer.GetMembers("M").Single(); 5041var property = outer.GetMembers("P").Single(); 5042var field = outer.GetMembers("F").Single(); 5043var @event = outer.GetMembers("E").Single(); 5044var @delegate = outer.GetMembers("D").Single(); 5045var error = outer.GetMembers("Error").Single(); 5620var tree = comp.SyntaxTrees.Single(); 5687var type = global.GetTypeMembers("C").Single(); 5688var method = type.GetMembers("F").Single(); 5689var property = type.GetMembers("P").Single(); 5691var @delegate = global.GetTypeMembers("D").Single(); 5891var type = global.GetTypeMembers("C").Single(); 5892var method = type.GetMembers("F").Single(); 5893var property = type.GetMembers("P").Single(); 5895var @delegate = global.GetTypeMembers("D").Single(); 6608var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 6685var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 6747var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 6780var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 6841var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 6874var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 6919var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7037var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7075var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7113var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7173var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7245var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7505var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7658var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7686var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 8397var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 8448var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 8482var tree = comp.SyntaxTrees.Single();
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (1)
1053var disposeMethod = (IMethodSymbol)compilation.GetSpecialType(SpecialType.System_IDisposable).GetMembers("Dispose").Single();
Symbols\AnonymousTypesSymbolTests.cs (1)
1681var programType = (NamedTypeSymbol)(comp.GlobalNamespace.GetTypeMembers("Program").Single());
Symbols\CheckedUserDefinedOperatorsTests.cs (5)
7207var tree = compilation1.SyntaxTrees.Single(); 7279var tree = compilation1.SyntaxTrees.Single(); 7350var tree = compilation1.SyntaxTrees.Single(); 7423var tree = compilation1.SyntaxTrees.Single(); 7487var tree = compilation1.SyntaxTrees.Single();
Symbols\CompilationCreationTests.cs (3)
74TypeSymbol c107 = c1.GlobalNamespace.GetTypeMembers("C107").Single(); 103Assert.Equal(SpecialType.None, c2.GlobalNamespace.GetTypeMembers("C107").Single().SpecialType); 2524var typeC5 = c5.Assembly.GlobalNamespace.GetTypeMembers("C5").Single();
Symbols\ConversionTests.cs (13)
451var tree = comp.SyntaxTrees.Single(); 482var tree = comp.SyntaxTrees.Single(); 517var tree = comp.SyntaxTrees.Single(); 553var tree = comp.SyntaxTrees.Single(); 589var tree = comp.SyntaxTrees.Single(); 623var tree = comp.SyntaxTrees.Single(); 658var tree = comp.SyntaxTrees.Single(); 683var tree = comp.SyntaxTrees.Single(); 714var tree = comp.SyntaxTrees.Single(); 740var tree = comp.SyntaxTrees.Single(); 763var tree = comp.SyntaxTrees.Single(); 2146Assert.Equal(SpecialType.System_Byte, method.Parameters.Single().Type.SpecialType); 2180Assert.Equal(SpecialType.System_Byte, method.Parameters.Single().Type.SpecialType);
Symbols\CorLibrary\CorTypes.cs (2)
293var tree = comp.SyntaxTrees.Single(); 358var tree = comp1.SyntaxTrees.Single();
Symbols\CustomModifiersTests.cs (1)
68Assert.Equal("System.Runtime.CompilerServices.IsLong", type.GetTypeArgumentCustomModifiers(0).Single().Modifier.ToTestDisplayString());
Symbols\ExtensionMethodTests.cs (8)
225var syntaxTree = compilation.SyntaxTrees.Single(); 3775var syntaxTree = compilation.SyntaxTrees.Single(); 3863var tree = compilation.SyntaxTrees.Single(); 3871var setMember = model.LookupSymbols(instance.Position, baseClass, "SetMember", includeReducedExtensionMethods: true).Single(); 3910var tree = compilation.SyntaxTrees.Single(); 3955var tree = compilation.SyntaxTrees.Single(); 3963var setMember = model.LookupSymbols(instance.Position, baseClass, "SetMember", includeReducedExtensionMethods: true).Single(); 4005var tree = compilation.SyntaxTrees.Single();
Symbols\FunctionPointerTypeSymbolTests.cs (3)
1623Assert.Equal("System.Runtime.InteropServices.InAttribute[missing]", ptr.Signature.RefCustomModifiers.Single().Modifier.ToTestDisplayString()); 1624Assert.Equal("System.Runtime.InteropServices.OutAttribute[missing]", ptr.Signature.Parameters.Single().RefCustomModifiers.Single().Modifier.ToTestDisplayString());
Symbols\GenericConstraintTests.cs (2)
7391var tree = comp.SyntaxTrees.Single(); 7416var tree = comp.SyntaxTrees.Single();
Symbols\ImplicitClassTests.cs (2)
70var tree = c.SyntaxTrees.Single(); 113var tree = comp.SyntaxTrees.Single();
Symbols\IndexerTests.cs (3)
2403NamedTypeSymbol type01 = comp.SourceModule.GlobalNamespace.GetTypeMembers("Test").Single(); 2559Assert.True(((TypeSymbol)compilation.GlobalNamespace.GetTypeMembers("C").Single()).GetMembers().Any(x => x.IsIndexer())); 2563Assert.True(((TypeSymbol)compilation.GlobalNamespace.GetTypeMembers("C").Single()).GetMembers().Any(x => x.IsIndexer()));
Symbols\InterfaceImplementationTests.cs (9)
1060var classD = global.GetTypeMembers("CustomModifierOverridingD").Single(); 1062var classDMethod1 = (MethodSymbol)classD.GetMembers("Method1").Single(); 1063var classDMethod2 = (MethodSymbol)classD.GetMembers("Method2").Single(); 1066var @interface = global.GetTypeMembers("Interface").Single(); 1067var interfaceMethod1 = (MethodSymbol)@interface.GetMembers("Method1").Single(); 1068var interfaceMethod2 = (MethodSymbol)@interface.GetMembers("Method2").Single(); 1070var @class = (SourceNamedTypeSymbol)global.GetTypeMembers("Class").Single(); 1149var type = comp.GlobalNamespace.GetTypeMembers("c2").Single(); 1590var typeSymbol = comp.GlobalNamespace.GetTypeMembers("C1").Single();
Symbols\LookupSymbolsInfoTests.cs (1)
93var tree = compilation.SyntaxTrees.Single();
Symbols\Metadata\MetadataMemberTests.cs (1)
396var classC = compilation.SourceModule.GlobalNamespace.GetTypeMembers("C").Single();
Symbols\Metadata\PE\HasUnsupportedMetadata.cs (8)
166var f1 = c3.GetMembers("F1").Single(); 170var m1 = c3.GetMembers("M1").Single(); 178var e1 = c3.GetMembers("E1").Single(); 182var p1 = c3.GetMembers("P1").Single(); 370var f1 = c3.GetMembers("F1").Single(); 374var m1 = c3.GetMembers("M1").Single(); 382var e1 = c3.GetMembers("E1").Single(); 386var p1 = c3.GetMembers("P1").Single();
Symbols\Metadata\PE\LoadingAttributes.cs (1)
1514Assert.Equal(expected, c.GetTypeByMetadataName("Test").GetAttributes().Single().ToString());
Symbols\Metadata\PE\NoPia.cs (4)
1235var varI5 = varC_Pia5.SourceModule.GlobalNamespace.GetTypeMembers("I5").Single(); 1237var varI6 = varC_Pia5.SourceModule.GlobalNamespace.GetTypeMembers("I6").Single(); 1245var varI7 = varC_Library2.SourceModule.GlobalNamespace.GetTypeMembers("I7").Single(); 1257var varI1 = varC_Pia1.SourceModule.GlobalNamespace.GetTypeMembers("I1").Single();
Symbols\Metadata\PE\NoPiaInstantiationOfGenericClassAndStruct.cs (22)
33NamedTypeSymbol classLocalType1 = localConsumer1.SourceModule.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 52NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 72NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 91NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 115NamedTypeSymbol classLocalType1 = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 133NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 162NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 180NamedTypeSymbol classLocalType1 = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 199NamedTypeSymbol classLocalType1 = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 218NamedTypeSymbol classLocalType1 = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 237NamedTypeSymbol classLocalType1 = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 256NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 275NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 294NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 313NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 332NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 351NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 368NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 388NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 409NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").Single(); 439NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("DrivedClass").Single(); 466NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("Interface1Impl2").Single();
Symbols\Metadata\PE\NoPiaLocalHideAndTypeSubstitutionTests.cs (6)
98NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("LocalType1").Single(); 135NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("TypeSubstitution").Single(); 195NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("TypeSubstitution").Single(); 231NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("TypeSubstitution").Single(); 266NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("TypeSubstitution").Single(); 299NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("TypeSubstitution").Single();
Symbols\MethodEqualityTests.cs (13)
36var class1 = global.GetTypeMembers("Class1").Single(); 37var class1Method1 = (MethodSymbol)class1.GetMembers("Method1").Single(); 38var class1Method2 = (MethodSymbol)class1.GetMembers("Method2").Single(); 40var class2 = global.GetTypeMembers("Class2").Single(); 41var class2Method1 = (MethodSymbol)class2.GetMembers("Method1").Single(); 83var baseClass = global.GetTypeMembers("Base").Single(); 87var derivedClass1 = global.GetTypeMembers("Derived1").Single(); 92var derivedClass2 = global.GetTypeMembers("Derived2").Single(); 143var baseClass = global.GetTypeMembers("Base").Single(); 147var derivedClass1 = global.GetTypeMembers("Derived1").Single(); 152var derivedClass2 = global.GetTypeMembers("Derived2").Single(); 202var @class = global.GetTypeMembers("Class").Single(); 203var classMethodDeclaration = (IMethodSymbol)@class.GetMembers("Method").Single();
Symbols\OverriddenOrHiddenMembersTests.cs (6)
903var classA = (NamedTypeSymbol)global.GetTypeMembers("CustomModifierOverridingA").Single(); 904var classB = (NamedTypeSymbol)global.GetTypeMembers("CustomModifierOverridingB").Single(); 905var classC = (NamedTypeSymbol)global.GetTypeMembers("CustomModifierOverridingC").Single(); 906var classD = (NamedTypeSymbol)global.GetTypeMembers("CustomModifierOverridingD").Single(); 936var classE = (NamedTypeSymbol)global.GetTypeMembers("CustomModifierOverridingE").Single(); 2868var finalize = (MethodSymbol)obj.GetMembers("Finalize").Single();
Symbols\RelaxedShiftOperatorTests.cs (6)
100var tree = compilation1.SyntaxTrees.Single(); 144var tree = compilation1.SyntaxTrees.Single(); 188var tree = compilation1.SyntaxTrees.Single(); 232var tree = compilation1.SyntaxTrees.Single(); 276var tree = compilation1.SyntaxTrees.Single(); 320var tree = compilation1.SyntaxTrees.Single();
Symbols\Retargeting\RetargetCustomAttributes.cs (9)
199var testClass = test.c2.Compilation.GlobalNamespace.GetTypeMembers("TestClass").Single(); 208var testClass = test.c2.Compilation.GlobalNamespace.GetTypeMembers("TestClass").Single(); 218var testClass = test.c2.Compilation.GlobalNamespace.GetTypeMembers("TestClass").Single(); 232var testClass = test.c2.Compilation.GlobalNamespace.GetTypeMembers("TestClass").Single(); 242var testClass = test.c2.Compilation.GlobalNamespace.GetTypeMembers("TestClass").Single(); 254var testClass = test.c2.Compilation.GlobalNamespace.GetTypeMembers("TestClass").Single(); 266var testClass = test.c2.Compilation.GlobalNamespace.GetTypeMembers("TestClass").Single(); 350var a = c1.GetAttributes().Single(); 392var a = c1.GetAttributes().Single();
Symbols\Retargeting\RetargetCustomModifiers.cs (2)
43var modifiers = c2.GlobalNamespace.GetTypeMembers("Modifiers").Single(); 161var modifiers = c2.GlobalNamespace.GetTypeMembers("Modifiers").Single();
Symbols\Retargeting\RetargetExplicitInterfaceImplementation.cs (35)
57var classC = globalNamespace1.GetTypeMembers("C").Single(); 59var interfaceV1 = globalNamespace1.GetTypeMembers("Interface1").Single(); 61var interfaceV1Method1 = (MethodSymbol)interfaceV1.GetMembers("Method1").Single(); 62var interfaceV1Method2 = (MethodSymbol)interfaceV1.GetMembers("Method2").Single(); 63var interfaceV1Method3 = (MethodSymbol)interfaceV1.GetMembers("Method3").Single(); 64var interfaceV1Method4 = (MethodSymbol)interfaceV1.GetMembers("Method4").Single(); 66var interfaceV1Property1 = (PropertySymbol)interfaceV1.GetMembers("Property1").Single(); 67var interfaceV1Property2 = (PropertySymbol)interfaceV1.GetMembers("Property2").Single(); 68var interfaceV1Property3 = (PropertySymbol)interfaceV1.GetMembers("Property3").Single(); 69var interfaceV1Property4 = (PropertySymbol)interfaceV1.GetMembers("Property4").Single(); 76var interfaceV1Event1 = (EventSymbol)interfaceV1.GetMembers("Event1").Single(); 77var interfaceV1Event2 = (EventSymbol)interfaceV1.GetMembers("Event2").Single(); 78var interfaceV1Event3 = (EventSymbol)interfaceV1.GetMembers("Event3").Single(); 79var interfaceV1Event4 = (EventSymbol)interfaceV1.GetMembers("Event4").Single(); 124var interfaceV2 = globalNamespace2.GetTypeMembers("Interface1").Single(); 127var interfaceV2Method1 = (MethodSymbol)interfaceV2.GetMembers("Method1").Single(); 129var interfaceV2Method3 = (MethodSymbol)interfaceV2.GetMembers("Method3").Single(); 130var interfaceV2Method4 = (MethodSymbol)interfaceV2.GetMembers("Method4").Single(); 132var interfaceV2Property1 = (PropertySymbol)interfaceV2.GetMembers("Property1").Single(); 134var interfaceV2Property3 = (PropertySymbol)interfaceV2.GetMembers("Property3").Single(); 135var interfaceV2Property4 = (PropertySymbol)interfaceV2.GetMembers("Property4").Single(); 142var interfaceV2Event1 = (EventSymbol)interfaceV2.GetMembers("Event1").Single(); 144var interfaceV2Event3 = (EventSymbol)interfaceV2.GetMembers("Event3").Single(); 145var interfaceV2Event4 = (EventSymbol)interfaceV2.GetMembers("Event4").Single(); 147var classD = globalNamespace2.GetTypeMembers("D").Single(); 353var classC1 = globalNamespace1.GetTypeMembers("C1").Single(); 354var classC2 = globalNamespace1.GetTypeMembers("C2").Single(); 355var classC3 = globalNamespace1.GetTypeMembers("C3").Single(); 388var interfaceV2 = globalNamespace2.GetTypeMembers("Interface2").Single(); 389var interfaceV2Method1 = interfaceV2.GetMembers("Method1").Single(); 390var interfaceV2Property1 = interfaceV2.GetMembers("Property1").Single(); 391var interfaceV2Event1 = interfaceV2.GetMembers("Event1").Single(); 393var classD1 = globalNamespace2.GetTypeMembers("D1").Single(); 394var classD2 = globalNamespace2.GetTypeMembers("D2").Single(); 395var classD3 = globalNamespace2.GetTypeMembers("D3").Single();
Symbols\Retargeting\RetargetingTests.cs (3)
733NamedTypeSymbol c1 = comp1.Assembly.GlobalNamespace.GetTypeMembers("C1").Single(); 737NamedTypeSymbol c1r = comp2.GlobalNamespace.GetTypeMembers("C1").Single(); 911=> ((CSharpCustomModifier)modifiers.Single()).ModifierSymbol;
Symbols\Source\BaseClassTests.cs (62)
36var x = global.GetTypeMembers("X", 0).Single(); 37var y = global.GetTypeMembers("Y", 0).Single(); 56var x = global.GetTypeMembers("X", 0).Single(); 57var y = global.GetTypeMembers("Y", 0).Single(); 79var x = global.GetTypeMembers("C4", 0).Single(); 103var a = global.GetTypeMembers("A", 1).Single(); 104var b = a.GetTypeMembers("B", 0).Single(); 105var e = a.GetTypeMembers("E", 0).Single(); 132var a = global.GetTypeMembers("A", 1).Single(); 133var b = global.GetTypeMembers("B", 0).Single(); 134var d = b.GetTypeMembers("D", 0).Single(); 158var a = global.GetTypeMembers("A", 0).Single(); 159var ic = a.GetTypeMembers("IC", 0).Single(); 181var a = global.GetTypeMembers("A", 0).Single(); 182var b = a.GetTypeMembers("B", 0).Single(); 183var ic = b.GetTypeMembers("IC", 0).Single(); 234var z = global.GetTypeMembers("Z", 0).Single(); 235var w = global.GetTypeMembers("W", 0).Single(); 263var a = global.GetTypeMembers("A", 0).Single(); 300var a = global.GetTypeMembers("A", 0).Single(); 463var c = global.GetTypeMembers("C", 0).Single(); 481var e = global.GetTypeMembers("E", 0).Single(); 499var g = global.GetTypeMembers("G", 0).Single(); 519var j = global.GetTypeMembers("J", 0).Single(); 533var m = global.GetTypeMembers("M", 0).Single(); 548var o = global.GetTypeMembers("O", 0).Single(); 566var p = global.GetTypeMembers("P", 0).Single(); 586var r = global.GetTypeMembers("R", 0).Single(); 605var u = global.GetTypeMembers("U", 0).Single(); 625var c = global.GetTypeMembers("C", 0).Single(); 650var x = global.GetTypeMembers("X", 0).Single(); 669var b = global.GetTypeMembers("B", 0).Single(); 686var z = global.GetTypeMembers("Z", 1).Single(); 995var x = global.GetTypeMembers("I4", 0).Single(); 1016var B1 = global1.GetTypeMembers("ClassB", 0).Single(); 1017var A1 = global1.GetTypeMembers("ClassA", 0).Single(); 1034var B2 = global.GetTypeMembers("ClassB", 0).Single(); 1035var C = global.GetTypeMembers("ClassC", 0).Single(); 1048var A2 = global.GetTypeMembers("ClassA", 0).Single(); 1073var A1 = global1.GetTypeMembers("ClassA", 0).Single(); 1094var B2 = global.GetTypeMembers("ClassB", 0).Single(); 1095var C = global.GetTypeMembers("ClassC", 0).Single(); 1109var A2 = global.GetTypeMembers("ClassA", 0).Single(); 1130var B1 = global1.GetTypeMembers("ClassB", 0).Single(); 1131var A1 = global1.GetTypeMembers("ClassA", 0).Single(); 1163var A2 = global.GetTypeMembers("ClassA", 0).Single(); 1164var B2 = global.GetTypeMembers("ClassB", 0).Single(); 1165var C = global.GetTypeMembers("ClassC", 0).Single(); 1189var A1 = global1.GetTypeMembers("ClassA", 0).Single(); 1220var B2 = global.GetTypeMembers("ClassB", 0).Single(); 1221var C = global.GetTypeMembers("ClassC", 0).Single(); 1229var A2 = global.GetTypeMembers("ClassA", 0).Single(); 1336var g = global.GetTypeMembers("G", 1).Single(); 1337var c = global.GetTypeMembers("C", 0).Single(); 1384var x = global.GetTypeMembers("X", 0).Single(); 1385var a1 = x.GetTypeMembers("A1", 0).Single(); 1387var b1 = x.GetTypeMembers("B1", 0).Single(); 1389var broken = global.GetTypeMembers("Broken", 0).Single(); 1390var a2 = broken.GetTypeMembers("A2", 0).Single(); 1393var b2 = broken.GetTypeMembers("B2", 0).Single(); 1412var a = global.GetTypeMembers("A", 0).Single(); 1413var b = global.GetTypeMembers("B", 0).Single();
Symbols\Source\ClsComplianceTests.cs (2)
3189Assert.Equal(ErrorCode.WRN_CLS_BadArgType, (ErrorCode)comp.GetDeclarationDiagnostics().Single().Code); 3461var tree = comp.SyntaxTrees.Single();
Symbols\Source\CustomModifierCopyTests.cs (1)
480Assert.Equal(ConstModOptType, customModifiers.Single().Modifier.ToTestDisplayString());
Symbols\Source\DeclaringSyntaxNodeTests.cs (13)
201var c1 = n1.GetTypeMembers("C1").Single() as INamedTypeSymbol; 202var s1 = n1.GetTypeMembers("S1").Single() as INamedTypeSymbol; 203var f = s1.GetMembers("f").Single() as IFieldSymbol; 235var c1 = n1.GetTypeMembers("C1").Single() as INamedTypeSymbol; 450var c1 = n1.GetTypeMembers("C1").Single() as INamedTypeSymbol; 451var c2 = c1.GetTypeMembers("C2").Single() as INamedTypeSymbol; 452var c3 = c1.GetTypeMembers("C3").Single() as INamedTypeSymbol; 517var c1 = n1.GetTypeMembers("C1").Single() as INamedTypeSymbol; 518var c2 = n1.GetTypeMembers("C2").Single() as INamedTypeSymbol; 519var e1 = n1.GetTypeMembers("E1").Single() as INamedTypeSymbol; 529var ev1 = c1.GetMembers("ev1").Single() as IEventSymbol; 530var prop3 = c1.GetMembers("Prop3").Single() as IPropertySymbol; 552var fieldT = c1.GetMembers("t").Single() as IFieldSymbol;
Symbols\Source\DelegateTests.cs (6)
72var a = global.GetTypeMembers("A", 0).Single(); 107var a = global.GetTypeMembers("A", 0).Single(); 127var v = comp.GlobalNamespace.GetTypeMembers("MyDel", 0).Single(); 156var myDel = global.GetTypeMembers("MyDel", 0).Single() as NamedTypeSymbol; 734var syntaxTree = comp.SyntaxTrees.Single(); 761var syntaxTree = comp.SyntaxTrees.Single();
Symbols\Source\EventTests.cs (1)
324NamedTypeSymbol type01 = comp.SourceModule.GlobalNamespace.GetTypeMembers("C").Single();
Symbols\Source\ExternAliasTests.cs (1)
492Assert.Same(externAliasSyntax, externAliasSymbol.DeclaringSyntaxReferences.Single().GetSyntax());
Symbols\Source\FieldTests.cs (18)
62var a = global.GetTypeMembers("A", 0).Single(); 63var sym = a.GetMembers("F").Single() as FieldSymbol; 90var a = global.GetTypeMembers("A", 0).Single(); 91var f = a.GetMembers("F").Single() as FieldSymbol; 103var one = errors.Single(); 119var a = global.GetTypeMembers("A", 0).Single(); 143var a = global.GetTypeMembers("A", 0).Single(); 144var n1 = a.GetMembers("N1").Single() as FieldSymbol; 150var n2 = a.GetMembers("N2").Single() as FieldSymbol; 159var n3 = a.GetMembers("N3").Single() as FieldSymbol; 177var a = global.GetTypeMembers("A", 0).Single(); 178var sym = a.GetMembers("F").Single() as FieldSymbol; 200var type1 = comp.GlobalNamespace.GetTypeMembers("C", 1).Single(); 201var type2 = type1.GetTypeMembers("S").Single(); 203var s = type2.GetMembers("M").Single() as MethodSymbol; 207var sym = type2.GetMembers("field1").Single() as FieldSymbol; 212sym = type2.GetMembers("field2").Single() as FieldSymbol; 217sym = type2.GetMembers("field3").Single() as FieldSymbol;
Symbols\Source\MethodTests.cs (49)
35var a = global.GetTypeMembers("A", 0).Single(); 36var m = a.GetMembers("M").Single() as MethodSymbol; 70var a = global.GetTypeMembers(className, 0).Single(); 115var a = global.GetTypeMembers("A", 0).Single(); 116var m = a.InstanceConstructors.Single(); 140var a = global.GetTypeMembers("A", 0).Single(); 141var m = a.GetMembers("M").Single() as MethodSymbol; 167var a = global.GetTypeMembers("A", 0).Single(); 168var m1 = a.GetMembers("M1").Single() as MethodSymbol; 169var b = global.GetTypeMembers("B", 0).Single(); 170var m2 = b.GetMembers("M2").Single() as MethodSymbol; 189var mylist = global.GetTypeMembers("MyList", 1).Single(); 191var add = mylist.GetMembers("Add").Single() as MethodSymbol; 211var a = global.GetTypeMembers("A", 0).Single(); 230var a = global.GetTypeMembers("A", 0).Single(); 231var m = (MethodSymbol)a.GetMembers("M").Single(); 235var tree = comp.SyntaxTrees.Single(); 258var a = global.GetTypeMembers("A", 0).Single(); 259var m = (MethodSymbol)a.GetMembers("M").Single(); 263var tree = comp.SyntaxTrees.Single(); 283var a = global.GetTypeMembers("A", 0).Single(); 284var m = (MethodSymbol)a.GetMembers("M").Single(); 288var tree = comp.SyntaxTrees.Single().GetRoot(); 304var a = global.GetTypeMembers("A", 0).Single(); 305var m = (MethodSymbol)a.GetMembers("M").Single(); 309var tree = comp.SyntaxTrees.Single().GetRoot(); 326var a = global.GetTypeMembers("A", 0).Single(); 327var m = a.GetMembers("M").Single() as MethodSymbol; 342var a = global.GetTypeMembers("A", 0).Single(); 343var m = a.GetMembers("M").Single() as MethodSymbol; 359var a = global.GetTypeMembers("A", 0).Single(); 360var m = a.GetMembers("M").Single() as MethodSymbol; 403var a = global.GetTypeMembers("A", 0).Single(); 404var m = a.GetMembers("M").Single() as MethodSymbol; 426var classTest = comp.GlobalNamespace.GetTypeMembers("Test", 0).Single(); 445var classTest = comp.GlobalNamespace.GetTypeMembers("Test", 0).Single(); 446var method = classTest.GetMembers("MethodWithRefOutArray").Single() as MethodSymbol; 1409var c = comp.GlobalNamespace.GetTypeMembers("C").Single(); 1410var f1 = c.GetMembers("F1").Single() as MethodSymbol; 1566var test = comp.GlobalNamespace.GetTypeMembers("Test").Single() as NamedTypeSymbol; 1594var a = comp.GlobalNamespace.GetTypeMembers("A").Single() as NamedTypeSymbol; 1595var b = comp.GlobalNamespace.GetTypeMembers("B").Single() as NamedTypeSymbol; 1666var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I").Single(); 1671var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("C").Single(); 1715var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("F").Single(); 1755var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I").Single(); 1761var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("C").Single(); 1811var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IC").Single(); 1856var @class = (NamedTypeSymbol)comp.GlobalNamespace.GetTypeMembers("C").Single();
Symbols\Source\ModifierTests.cs (25)
49var a = global.GetTypeMembers("A", 0).Single(); 50var m1 = a.GetMembers("M1").Single() as MethodSymbol; 53var m2 = a.GetMembers("M2").Single() as MethodSymbol; 55var m3 = a.GetMembers("M3").Single() as MethodSymbol; 57var m4 = a.GetMembers("M4").Single() as MethodSymbol; 59var m5 = a.GetMembers("M5").Single() as MethodSymbol; 61var m5_1 = a.GetMembers("M5_1").Single() as MethodSymbol; 64var m5_2 = a.GetMembers("M5_2").Single() as MethodSymbol; 67var m6 = a.GetMembers("M6").Single() as MethodSymbol; 69var m7 = a.GetMembers("M7").Single() as MethodSymbol; 71var m8 = a.GetMembers("M8").Single() as MethodSymbol; 75var m8_1 = a.GetMembers("M8_1").Single() as MethodSymbol; 79var m8_2 = a.GetMembers("M8_2").Single() as MethodSymbol; 83var m9 = a.GetMembers("M9").Single() as MethodSymbol; 86var m10 = a.GetMembers("M10").Single() as MethodSymbol; 89var m11 = a.GetMembers("M11").Single() as MethodSymbol; 92var m12 = a.GetMembers("M12").Single() as MethodSymbol; 113var m1 = script.GetMembers("M1").Single() as MethodSymbol; 115var m2 = script.GetMembers("M2").Single() as MethodSymbol; 117var m3 = script.GetMembers("M3").Single() as MethodSymbol; 119var m4 = script.GetMembers("M4").Single() as MethodSymbol; 121var m5 = script.GetMembers("M5").Single() as MethodSymbol; 123var m6 = script.GetMembers("M6").Single() as MethodSymbol; 125var m7 = script.GetMembers("M7").Single() as MethodSymbol; 127var m12 = script.GetMembers("M12").Single() as MethodSymbol;
Symbols\Source\NullablePublicAPITests.cs (26)
825ITypeParameterSymbol typeParameterSymbol = ((INamedTypeSymbol)((INamedTypeSymbol)method.ReturnType).GetMembers("B").Single()).TypeParameters.Single(); 826var result = typeParameterSymbol.ConstraintTypes.Single().NullableAnnotation; 827Assert.Equal(result, typeParameterSymbol.ConstraintNullableAnnotations.Single()); 892var result = ((INamedTypeSymbol)method.ReturnType).TypeArguments.Single().NullableAnnotation; 893Assert.Equal(result, ((INamedTypeSymbol)method.ReturnType).TypeArgumentNullableAnnotations.Single()); 949var result = method.TypeArguments.Single().NullableAnnotation; 950Assert.Equal(result, method.TypeArgumentNullableAnnotations.Single()); 1769var tree = (CSharpSyntaxTree)comp.SyntaxTrees.Single(); 1860Assert.Equal(expectedAnnotation, methodSymbol.TypeArgumentNullableAnnotations.Single()); 1861Assert.Equal(expectedAnnotation, methodSymbol.TypeArguments.Single().NullableAnnotation); 1862Assert.Equal(expectedAnnotation, methodSymbol.Parameters.Single().NullableAnnotation); 1863Assert.Equal(expectedAnnotation, methodSymbol.Parameters.Single().Type.NullableAnnotation); 1903Assert.Equal(expectedAnnotation, methodSymbol.TypeArgumentNullableAnnotations.Single()); 1904Assert.Equal(expectedAnnotation, methodSymbol.TypeArguments.Single().NullableAnnotation); 1905Assert.Equal(expectedAnnotation, methodSymbol.Parameters.Single().NullableAnnotation); 1906Assert.Equal(expectedAnnotation, methodSymbol.Parameters.Single().Type.NullableAnnotation); 1907Assert.Equal(expectedAnnotation, ((INamedTypeSymbol)methodSymbol.ReturnType).TypeArgumentNullableAnnotations.Single()); 4703Assert.Equal(PublicNullableAnnotation.NotAnnotated, symbol2.Parameters.Single().Type.NullableAnnotation); 4813var tree = comp.SyntaxTrees.Single(); 4899var tree = comp.SyntaxTrees.Single(); 5100var tree = comp.SyntaxTrees.Single(); 5132var tree = comp.SyntaxTrees.Single(); 5160var tree = comp.SyntaxTrees.Single(); 5195var tree = comp.SyntaxTrees.Single(); 5230var tree = comp.SyntaxTrees.Single();
Symbols\Source\PropertyTests.cs (14)
359var a = global.GetTypeMembers("A", 0).Single(); 360var i = global.GetTypeMembers("I", 0).Single(); 392var type01 = global.GetTypeMembers("C").Single(); 393var type02 = type01.GetTypeMembers("S").Single(); 410var prop = type01.GetMembers("Prop").Single() as PropertySymbol; 429prop = type02.GetMembers("Prop").Single() as PropertySymbol; 1749var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I").Single(); 1754var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("C").Single(); 1783var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I").Single(); 1788var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("C").Single(); 1826var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("C").Single(); 1924var a = global.GetTypeMembers("A", 0).Single(); 1933var one = errors.Single(); 1956var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Test").Single();
Symbols\Source\SourcePlusMetadataTests.cs (13)
28var x = global.GetTypeMembers("X", 0).Single(); 30var y = global.GetTypeMembers("Y", 0).Single(); 45var x = global.GetTypeMembers("X", 0).Single(); 61var x = global.GetTypeMembers("X", 0).Single(); 63var y = global.GetTypeMembers("Y", 0).Single(); 65var z = global.GetTypeMembers("Z", 0).Single(); 188var srcSym = compilation.GlobalNamespace.GetTypeMembers("BaseTypeSpecifierClass").Single(); 204var srcSym = compilation.GlobalNamespace.GetTypeMembers("FooAttribute").Single(); 231var classC = compilation.GlobalNamespace.GetTypeMembers("Test").Single(); 232var srcSym = classC.GetMembers("I1.Method").Single(); 236var metaType = comp2.GlobalNamespace.GetTypeMembers("Test").Single(); 251var a = global.GetTypeMembers("A", 0).Single(); 252var b = global.GetTypeMembers("B", 0).Single();
Symbols\Source\TypeMapTests.cs (9)
55var at = global.GetTypeMembers("A", 1).Single(); // A<T> 57Assert.Equal(t, TypeArg(at.GetTypeMembers("TBox", 0).Single().BaseType())); 58var atbu = at.GetTypeMembers("B", 1).Single(); // A<T>.B<U> 60var c = atbu.GetTypeMembers("C", 0).Single(); // A<T>.B<U>.C 65var e = global.GetTypeMembers("E", 0).Single(); // E 66var f = global.GetTypeMembers("F", 0).Single(); // F 67var top = global.GetTypeMembers("Top", 0).Single(); // Top 72var bf = top.GetTypeMembers("BF", 0).Single(); // Top.BF 114var c = global.GetTypeMembers("C", 0).Single() as NamedTypeSymbol;
Symbols\Source\UsingAliasTests.cs (2)
695var tree = compilation.SyntaxTrees.Single(); 738var tree = compilation.SyntaxTrees.Single();
Symbols\StaticAbstractMembersInInterfacesTests.cs (46)
8451var tree = compilation1.SyntaxTrees.Single(); 8466Assert.Equal("void I1.M01()", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "M01").Single().ToTestDisplayString()); 8468Assert.Equal("void I1.M01()", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "M01").Single().ToTestDisplayString()); 8471Assert.Equal("void I1.M01()", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "M01").Single().ToTestDisplayString()); 8473Assert.Equal("void I1.M01()", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "M01").Single().ToTestDisplayString()); 9039var tree = compilation1.SyntaxTrees.Single(); 9354var tree = compilation1.SyntaxTrees.Single(); 9753var tree = compilation1.SyntaxTrees.Single(); 10750var tree = compilation1.SyntaxTrees.Single(); 10943var tree = compilation1.SyntaxTrees.Single(); 11133var tree = compilation1.SyntaxTrees.Single(); 11327var tree = compilation1.SyntaxTrees.Single(); 11581var tree = compilation1.SyntaxTrees.Single(); 11958var tree = compilation1.SyntaxTrees.Single(); 12137var tree = compilation1.SyntaxTrees.Single(); 13178var tree = compilation1.SyntaxTrees.Single(); 13192Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13193Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13197Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13198Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13264var tree = compilation1.SyntaxTrees.Single(); 13278Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13279Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13283Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13284Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13386var tree = compilation1.SyntaxTrees.Single(); 13400Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13401Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13405Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13406Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 14087var tree = compilation1.SyntaxTrees.Single(); 14110Assert.Equal("event System.Action I1.E01", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "E01").Single().ToTestDisplayString()); 14111Assert.Equal("event System.Action I1.E01", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "E01").Single().ToTestDisplayString()); 14115Assert.Equal("event System.Action I1.E01", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "E01").Single().ToTestDisplayString()); 14116Assert.Equal("event System.Action I1.E01", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "E01").Single().ToTestDisplayString()); 14712var tree = compilation1.SyntaxTrees.Single(); 15118var tree = compilation1.SyntaxTrees.Single(); 15386var tree = compilation1.SyntaxTrees.Single(); 19558var tree = compilation1.SyntaxTrees.Single(); 19641var tree = compilation1.SyntaxTrees.Single(); 19733var tree = compilation1.SyntaxTrees.Single(); 19822var tree = compilation1.SyntaxTrees.Single(); 28771var tree = compilation1.SyntaxTrees.Single(); 30278var tree = compilation1.SyntaxTrees.Single(); 30469var tree = compilation1.SyntaxTrees.Single(); 30935var tree = compilation1.SyntaxTrees.Single();
Symbols\SymbolEqualityTests.cs (6)
170var nonNullSubstituted = nonNullM.ContainingType.GetMembers("M").Single(); 171var nullSubstituted = nullM.ContainingType.GetMembers("M").Single(); 781var field1 = (IFieldSymbol)((INamedTypeSymbol)model.GetDeclaredSymbol(member1Syntax)).GetMembers("field").Single(); // A<T!>! A<T>.field 832var method1 = (IMethodSymbol)((INamedTypeSymbol)model.GetDeclaredSymbol(member1Syntax)).GetMembers("M").Single(); // A<T!>! A<T>.M(A<T!>! t) 893var event1 = (IEventSymbol)((INamedTypeSymbol)model.GetDeclaredSymbol(member1Syntax)).GetMembers("MyEvent").Single(); // System.EventHandler<T!>! A<T>.MyEvent 940var p1 = lambdaSymbol.Parameters.Single();
Symbols\SymbolErrorTests.cs (7)
1573var classA = comp.SourceModule.GlobalNamespace.GetTypeMembers("A").Single() as NamedTypeSymbol; 3144var ns = comp.SourceModule.GlobalNamespace.GetTypeMembers("A").Single() as NamedTypeSymbol; 16890var classA = (NamedTypeSymbol)comp.GlobalNamespace.GetTypeMembers("A").Single(); 16915var classA = (NamedTypeSymbol)comp.GlobalNamespace.GetTypeMembers("A").Single(); 16916var classC = (NamedTypeSymbol)comp.GlobalNamespace.GetTypeMembers("C").Single(); 16950var classA = (NamedTypeSymbol)comp.GlobalNamespace.GetTypeMembers("A").Single(); 19374var derived = comp.SourceModule.GlobalNamespace.GetTypeMembers("Derived").Single();
Symbols\SymbolExtensionTests.cs (5)
100var tree = compilation.SyntaxTrees.Single(); 118var tree = compilation.SyntaxTrees.Single(); 136var tree = compilation.SyntaxTrees.Single(); 155var tree = compilation.SyntaxTrees.Single(); 250var tree = compilation.SyntaxTrees.Single();
Symbols\TypedConstantTests.cs (2)
62Assert.Equal(commonArray.Values.Single(), langArray.Values.Single());
Symbols\TypeTests.cs (35)
41var x = c.GetMembers("x").Single() as FieldSymbol; 87var a = global.GetTypeMembers("A", 0).Single(); 88var b = global.GetTypeMembers("B", 0).Single(); 89var s = global.GetTypeMembers("S").Single(); 466var classTest = comp.GlobalNamespace.GetTypeMembers("Test", 0).Single(); 468var field1 = classTest.GetMembers("intAryField").Single(); 483field1 = classTest.GetMembers("ulongAryField").Single(); 493var method = classTest.GetMembers("MethodWithArray").Single() as MethodSymbol; 541var classTest = globalNS.GetTypeMembers("A").Single() as NamedTypeSymbol; 589var classTest = globalNS.GetTypeMembers("A").Single() as NamedTypeSymbol; 621var a = global.GetTypeMembers("A", 0).Single(); 639var obj = a.GetMembers("field1").Single(); 647var dyn = a.GetMembers("field2").Single(); 669var v = comp.GlobalNamespace.GetTypeMembers("MyEnum", 0).Single(); 945NamedTypeSymbol testTypeSymbol = comp.Assembly.GlobalNamespace.GetTypeMembers("Test").Single() as NamedTypeSymbol; 981NamedTypeSymbol testTypeSymbol = comp.Assembly.GlobalNamespace.GetTypeMembers("MyClass").Single() as NamedTypeSymbol; 994NamedTypeSymbol testTypeSymbol = comp.Assembly.GlobalNamespace.GetTypeMembers("X").Single() as NamedTypeSymbol; 1037var interfaces = global.GetTypeMembers("I5", 0).Single().AllInterfaces(); 1039Assert.Equal(global.GetTypeMembers("I4", 0).Single(), interfaces[0]); 1040Assert.Equal(global.GetTypeMembers("I3", 0).Single(), interfaces[1]); 1041Assert.Equal(global.GetTypeMembers("I2", 0).Single(), interfaces[2]); 1042Assert.Equal(global.GetTypeMembers("I1", 0).Single(), interfaces[3]); 1388var iGooGetGoo = comp.GetTypeByMetadataName("Bar+IGoo").GetMembers("GetGoo").Single(); 1506var mem = topType.GetMembers("field01").Single(); 1515mem = topType.GetMembers("field02").Single(); 1524mem = topType.GetMembers("Prop01").Single(); 1533mem = topType.GetMembers(WellKnownMemberNames.Indexer).Single(); 1549mem = topType.GetMembers("Method01").Single(); 1565mem = topType.GetMembers("Method02").Single(); 1612var nestedType = topType.GetTypeMembers("Nested").Single(); 1613var enumType = comp.SourceModule.GlobalNamespace.GetTypeMembers("E").Single(); 1615var mem = topType.GetMembers("efield").Single(); 1630mem = topType.GetMembers(WellKnownMemberNames.ImplicitConversionName).Single(); 1642mem = topType.GetMembers(WellKnownMemberNames.AdditionOperatorName).Single(); 1862Assert.IsType<UnboundArgumentErrorTypeSymbol>(symbol.ContainingType.TypeArguments.Single().GetSymbol());
Symbols\UnsignedRightShiftTests.cs (9)
121var tree = compilation1.SyntaxTrees.Single(); 624var tree = compilation1.SyntaxTrees.Single(); 1174var tree = compilation1.SyntaxTrees.Single(); 1582var tree = compilation1.SyntaxTrees.Single(); 1981var tree = compilation1.SyntaxTrees.Single(); 2233var tree = compilation1.SyntaxTrees.Single(); 2375var tree = compilation1.SyntaxTrees.Single(); 2509var tree = compilation1.SyntaxTrees.Single(); 2606var tree = compilation1.SyntaxTrees.Single();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (18)
LexicalAndXml\LexicalTests.cs (17)
3777var error = token.Errors().Single(); 4177Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4195Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4217Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4235Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4386Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4395Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4404Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4425Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4441Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4457Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4481Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4497Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4515Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4539Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4557Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4573Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code);
Syntax\LambdaUtilitiesTests.cs (1)
48var enclosingSyntax = enclosingMethod.DeclaringSyntaxReferences.Single().GetSyntax();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (5)
CompilingTestBase.cs (2)
26var method = (MethodSymbol)compilation.GlobalNamespace.GetTypeMembers(typeName).Single().GetMembers(methodName).Single();
Extensions.cs (3)
293return members.Single(); 309return members.Single(); 349return symbol.GetTypeMembers(name).Single();
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
CodeGen\WinRTCollectionTests.cs (1)
7421var tree = comp.SyntaxTrees.Single();
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
Recommendations\CSharpRecommendationServiceRunner_Conversions.cs (2)
190=> method.ReturnType.IsNonNullableValueType() && method.Parameters.Single().Type.IsNonNullableValueType(); 196TryMakeNullable(compilation, method.Parameters.Single().Type),
Rename\CSharpRenameRewriterLanguageService.cs (4)
817var token = renamedSymbol.Locations.Single().FindToken(cancellationToken); 832token = matchingParameterSymbol.Locations.Single().FindToken(cancellationToken); 841var token = renamedSymbol.Locations.Single().FindToken(cancellationToken); 870var location = renamedSymbol.Locations.Single();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
1050return iface.TypeArguments.Single();
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (18)
CodeGeneration\SyntaxGeneratorTests.cs (18)
981var operatorSymbol = (IMethodSymbol)comp.GetTypeByMetadataName("C").GetMembers(WellKnownMemberNames.CheckedIncrementOperatorName).Single(); 2168_emptyCompilation.GetTypeByMetadataName("System.IntPtr").GetMembers("ToPointer").Single()), 2227var method = type.GetMembers("M").Single(); 2248var method = type.GetMembers("M").Single(); 2269var method = type.GetMembers("M").Single(); 2290var method = type.GetMembers("M").Single(); 2311var method = type.GetMembers(WellKnownMemberNames.InstanceConstructorName).Single(); 2333var property = type.GetMembers("Prop").Single(); 2351var property = type.GetMembers("Prop").Single(); 2374var property = type.GetMembers("Accept").Single(); 2402var property = type.GetMembers("Accept").Single(); 2430var property = type.GetMembers("Accept").Single(); 2461var property = type.GetMembers("Accept").Single(); 2538var field = type.GetMembers("F").Single(); 2561var field = type.GetMembers("F").Single(); 2571var field = _emptyCompilation.GetSpecialType(SpecialType.System_UInt32).GetMembers(nameof(UInt32.MaxValue)).Single(); 2591var method = type.GetMembers(WellKnownMemberNames.DestructorName).Single(); 4967var attribute = symbol.GetAttributes().Single();
Microsoft.CodeAnalysis.EditorFeatures (4)
CodeActions\CodeActionEditHandlerService.cs (3)
143applied = await operations.Single().TryApplyAsync( 193if (operationsList.Single() is not ApplyChangesOperation applyOperation) 211var projectChange = projectChanges.Single();
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (1)
167var symbolSourceDocument = this.Document.Project.Solution.GetDocument(RenameSymbol.Locations.Single().SourceTree);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (8)
BraceMatching\AbstractBraceMatcherTests.cs (1)
36Assert.Equal(expectedSpans.Single(), foundSpan.Value);
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (1)
48var cursorSpan = testDocument.AnnotatedSpans["Cursor"].Single();
RefactoringHelpers\RefactoringHelpersTestBase.cs (3)
81selection = selections.Single(); 96selection = selections.Single(); 97result = results.Single();
Workspaces\EditorTestWorkspace.cs (3)
324var sortedAndNamedSpans = namedSpans.OrderBy(kvp => kvp.Value.Single().Start) 336var spanLocation = spanNameToListMap.Value.Single().Start; 368var matchingSpan = documentWithSpan.AnnotatedSpans[spanName].Single();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (274)
CodeFixes\CodeFixServiceTests.cs (3)
62var fixer2 = (MockFixer)reference.Fixers.Single(); 128Assert.Equal(codeFix.FixableDiagnosticIds.Single(), analyzerWithFix.SupportedDiagnostics.Single().Id);
SymbolFinder\DependentTypeFinderTests.cs (1)
758var methodSymbol = classSymbol.GetMembers("M").Single();
TextEditor\OpenDocumentTests.cs (2)
52Assert.Equal(documentIds.Last(), workspace.CurrentSolution.GetDocument(documentIds.First()).GetLinkedDocumentIds().Single()); 53Assert.Equal(documentIds.First(), workspace.CurrentSolution.GetDocument(documentIds.Last()).GetLinkedDocumentIds().Single());
Utilities\SymbolEquivalenceComparerTests.cs (229)
52var type = (ITypeSymbol)(await workspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 54var intField1 = (IFieldSymbol)type.GetMembers("intField1").Single(); 55var intArrayField1 = (IFieldSymbol)type.GetMembers("intArrayField1").Single(); 56var stringArrayField1 = (IFieldSymbol)type.GetMembers("stringArrayField1").Single(); 57var intArrayArrayField1 = (IFieldSymbol)type.GetMembers("intArrayArrayField1").Single(); 58var intArrayRank2Field1 = (IFieldSymbol)type.GetMembers("intArrayRank2Field1").Single(); 59var int32Field1 = (IFieldSymbol)type.GetMembers("int32Field1").Single(); 61var intField2 = (IFieldSymbol)type.GetMembers("intField2").Single(); 62var intArrayField2 = (IFieldSymbol)type.GetMembers("intArrayField2").Single(); 63var stringArrayField2 = (IFieldSymbol)type.GetMembers("stringArrayField2").Single(); 64var intArrayArrayField2 = (IFieldSymbol)type.GetMembers("intArrayArrayField2").Single(); 65var intArrayRank2Field2 = (IFieldSymbol)type.GetMembers("intArrayRank2Field2").Single(); 66var int32Field2 = (IFieldSymbol)type.GetMembers("int32Field2").Single(); 124var csharpType = (ITypeSymbol)(await csharpWorkspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 125var vbType = (await vbWorkspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 127var csharpIntField1 = (IFieldSymbol)csharpType.GetMembers("intField1").Single(); 128var csharpIntArrayField1 = (IFieldSymbol)csharpType.GetMembers("intArrayField1").Single(); 129var csharpStringArrayField1 = (IFieldSymbol)csharpType.GetMembers("stringArrayField1").Single(); 130var csharpIntArrayArrayField1 = (IFieldSymbol)csharpType.GetMembers("intArrayArrayField1").Single(); 131var csharpIntArrayRank2Field1 = (IFieldSymbol)csharpType.GetMembers("intArrayRank2Field1").Single(); 132var csharpInt32Field1 = (IFieldSymbol)csharpType.GetMembers("int32Field1").Single(); 134var vbIntField1 = (IFieldSymbol)vbType.GetMembers("intField1").Single(); 135var vbIntArrayField1 = (IFieldSymbol)vbType.GetMembers("intArrayField1").Single(); 136var vbStringArrayField1 = (IFieldSymbol)vbType.GetMembers("stringArrayField1").Single(); 137var vbIntArrayArrayField1 = (IFieldSymbol)vbType.GetMembers("intArrayArrayField1").Single(); 138var vbIntArrayRank2Field1 = (IFieldSymbol)vbType.GetMembers("intArrayRank2Field1").Single(); 139var vbInt32Field1 = (IFieldSymbol)vbType.GetMembers("int32Field1").Single(); 194var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 195var type2_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 196var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 197var type2_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 199var field1_v1 = type1_v1.GetMembers("field1").Single(); 200var field1_v2 = type1_v2.GetMembers("field1").Single(); 201var field2_v1 = type1_v1.GetMembers("field2").Single(); 202var field2_v2 = type2_v2.GetMembers("field2").Single(); 203var field3_v1 = type2_v1.GetMembers("field3").Single(); 204var field3_v2 = type2_v2.GetMembers("field3").Single(); 205var field4_v1 = type2_v1.GetMembers("field4").Single(); 206var field4_v2 = type1_v2.GetMembers("field4").Single(); 245var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 246var type2_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 247var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 248var type2_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 250var field1_v1 = type1_v1.GetMembers("field1").Single(); 251var field1_v2 = type1_v2.GetMembers("field1").Single(); 252var field2_v1 = type1_v1.GetMembers("field2").Single(); 253var field2_v2 = type2_v2.GetMembers("field2").Single(); 254var field3_v1 = type2_v1.GetMembers("field3").Single(); 255var field3_v2 = type2_v2.GetMembers("field3").Single(); 256var field4_v1 = type2_v1.GetMembers("field4").Single(); 257var field4_v2 = type1_v2.GetMembers("field4").Single(); 284var typeC = (await workspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 285var typeD = (await workspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("D").Single(); 287var intInstantiation1 = (IFieldSymbol)typeC.GetMembers("intInstantiation1").Single(); 288var stringInstantiation = (IFieldSymbol)typeC.GetMembers("stringInstantiation").Single(); 289var instanceInstantiation = (IFieldSymbol)typeC.GetMembers("instanceInstantiation").Single(); 290var intInstantiation2 = (IFieldSymbol)typeD.GetMembers("intInstantiation2").Single(); 292var goo = typeC.GetMembers("goo").Single(); 293var goo_intInstantiation1 = intInstantiation1.Type.GetMembers("goo").Single(); 294var goo_stringInstantiation = stringInstantiation.Type.GetMembers("goo").Single(); 295var goo_instanceInstantiation = instanceInstantiation.Type.GetMembers("goo").Single(); 296var goo_intInstantiation2 = intInstantiation2.Type.GetMembers("goo").Single(); 328var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 329var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 331var method_v1 = type1_v1.GetMembers("Goo").Single(); 332var method_v2 = type1_v2.GetMembers("Goo").Single(); 353var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 354var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 356var method_v1 = type1_v1.GetMembers("Goo").Single(); 357var method_v2 = type1_v2.GetMembers("Goo1").Single(); 378var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 379var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 381var method_v1 = type1_v1.GetMembers("Goo").Single(); 382var method_v2 = type1_v2.GetMembers("Goo").Single(); 403var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 404var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 406var method_v1 = type1_v1.GetMembers("Goo").Single(); 407var method_v2 = type1_v2.GetMembers("Goo").Single(); 428var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 429var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 431var method_v1 = type1_v1.GetMembers("Goo").Single(); 432var method_v2 = type1_v2.GetMembers("Goo").Single(); 455var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 456var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 458var method_v1 = type1_v1.GetMembers("Goo").Single(); 459var method_v2 = type1_v2.GetMembers("Goo").Single(); 482var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 483var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 485var method_v1 = type1_v1.GetMembers("Goo").Single(); 486var method_v2 = type1_v2.GetMembers("Goo").Single(); 509var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 510var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 512var method_v1 = type1_v1.GetMembers("Goo").Single(); 513var method_v2 = type1_v2.GetMembers("Goo").Single(); 534var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 535var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 537var method_v1 = type1_v1.GetMembers("Goo").Single(); 538var method_v2 = type1_v2.GetMembers("Goo").Single(); 559var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 560var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 562var method_v1 = type1_v1.GetMembers("Goo").Single(); 563var method_v2 = type1_v2.GetMembers("Goo").Single(); 586var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 587var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 589var method_v1 = type1_v1.GetMembers("Goo").Single(); 590var method_v2 = type1_v2.GetMembers("Goo").Single(); 620var csharpType1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 621var vbType1 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 623var csharpGooMethod = csharpType1.GetMembers("Goo").Single(); 624var csharpBarMethod = csharpType1.GetMembers("Bar").Single(); 625var vbGooMethod = vbType1.GetMembers("Goo").Single(); 626var vbQuuxMethod = vbType1.GetMembers("Quux").Single(); 665var csharpType1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 666var vbType1 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 668var csharpGooMethod = csharpType1.GetMembers("Goo").Single(); 669var csharpBarMethod = csharpType1.GetMembers("Bar").Single(); 670var vbGooMethod = vbType1.GetMembers("Goo").Single(); 671var vbBarMethod = vbType1.GetMembers("Bar").Single(); 696var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 698var field1_v1 = type1_v1.GetMembers("field1").Single(); 699var field2_v1 = type1_v1.GetMembers("field2").Single(); 722var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 723var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 725var method_v1 = type1_v1.GetMembers("Goo").Single(); 726var method_v2 = type1_v2.GetMembers("Goo").Single(); 757var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 758var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 760var method_v1 = type1_v1.GetMembers("Goo").Single(); 761var method_v2 = type1_v2.GetMembers("Goo").Single(); 790var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 791var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 793var method_v1 = type1_v1.GetMembers("Goo").Single(); 794var method_v2 = type1_v2.GetMembers("Goo").Single(); 825var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 826var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 828var method_v1 = type1_v1.GetMembers("Goo").Single(); 829var method_v2 = type1_v2.GetMembers("Goo").Single(); 862var outerType1 = outer1.GetTypeMembers("Type").Single(); 863var outerType2 = outer2.GetTypeMembers("Type").Single(); 865var innerType1 = inner1.GetTypeMembers("Type").Single(); 866var innerType2 = inner2.GetTypeMembers("Type").Single(); 933var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 934var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 935var type2_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 936var type2_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 970var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 971var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 995var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 996var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1020var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1021var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1051var outer = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Outer").Single(); 1052var other = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Other").Single(); 1053var type1_v1 = outer.GetTypeMembers("Type1").Single(); 1054var type1_v2 = other.GetTypeMembers("Type1").Single(); 1081var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1082var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1084var method_v1 = type1_v1.GetMembers("Goo").Single(); 1085var method_v2 = type1_v2.GetMembers("Goo").Single(); 1112var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1113var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1115var method_v1 = type1_v1.GetMembers("M").Single(); 1116var method_v2 = type1_v2.GetMembers("M").Single(); 1152var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1153var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1155var method_v1 = type1_v1.GetMembers("M").Single(); 1156var method_v2 = type1_v2.GetMembers("M").Single(); 1182var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1183var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1185var method_v1 = type1_v1.GetMembers("M").Single(); 1186var method_v2 = type1_v2.GetMembers("M").Single(); 1212var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1213var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1215var method_v1 = type1_v1.GetMembers("M").Single(); 1216var method_v2 = type1_v2.GetMembers("M").Single(); 1243var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1244var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1246var method_v1 = type1_v1.GetMembers("M").Single(); 1247var method_v2 = type1_v2.GetMembers("M").Single(); 1274var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1275var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1277var method_v1 = type1_v1.GetMembers("M").Single(); 1278var method_v2 = type1_v2.GetMembers("M").Single(); 1306var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1307var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1309var method_v1 = type1_v1.GetMembers("M").Single(); 1310var method_v2 = type1_v2.GetMembers("M").Single(); 1343var t1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1344var t2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1346var a1 = ((IFieldSymbol)t1.GetMembers("A").Single()).Type; 1347var b1 = ((IFieldSymbol)t1.GetMembers("B").Single()).Type; 1348var c1 = ((IFieldSymbol)t1.GetMembers("C").Single()).Type; 1349var d1 = ((IFieldSymbol)t1.GetMembers("D").Single()).Type; 1350var a2 = ((IFieldSymbol)t2.GetMembers("A").Single()).Type; 1351var b2 = ((IFieldSymbol)t2.GetMembers("B").Single()).Type; 1352var c2 = ((IFieldSymbol)t2.GetMembers("C").Single()).Type; 1353var d2 = ((IFieldSymbol)t2.GetMembers("D").Single()).Type; 1407var t1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1408var t2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1410var a1 = ((IFieldSymbol)t1.GetMembers("A").Single()).Type; 1411var b1 = ((IFieldSymbol)t1.GetMembers("B").Single()).Type; 1412var c1 = ((IFieldSymbol)t1.GetMembers("C").Single()).Type; 1413var d1 = ((IFieldSymbol)t1.GetMembers("D").Single()).Type; 1414var a2 = ((IFieldSymbol)t2.GetMembers("A").Single()).Type; 1415var b2 = ((IFieldSymbol)t2.GetMembers("B").Single()).Type; 1416var c2 = ((IFieldSymbol)t2.GetMembers("C").Single()).Type; 1417var d2 = ((IFieldSymbol)t2.GetMembers("D").Single()).Type; 1470var t1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1471var t2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1473var a1 = ((IFieldSymbol)t1.GetMembers("A").Single()).Type; 1474var b1 = ((IFieldSymbol)t1.GetMembers("B").Single()).Type; 1475var c1 = ((IFieldSymbol)t1.GetMembers("C").Single()).Type; 1476var d1 = ((IFieldSymbol)t1.GetMembers("D").Single()).Type; 1477var a2 = ((IFieldSymbol)t2.GetMembers("A").Single()).Type; 1478var b2 = ((IFieldSymbol)t2.GetMembers("B").Single()).Type; 1479var c2 = ((IFieldSymbol)t2.GetMembers("C").Single()).Type; 1480var d2 = ((IFieldSymbol)t2.GetMembers("D").Single()).Type; 1533var t1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1534var t2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1536var a1 = ((IFieldSymbol)t1.GetMembers("A").Single()).Type; 1537var b1 = ((IFieldSymbol)t1.GetMembers("B").Single()).Type; 1538var c1 = ((IFieldSymbol)t1.GetMembers("C").Single()).Type; 1539var d1 = ((IFieldSymbol)t1.GetMembers("D").Single()).Type; 1540var a2 = ((IFieldSymbol)t2.GetMembers("A").Single()).Type; 1541var b2 = ((IFieldSymbol)t2.GetMembers("B").Single()).Type; 1542var c2 = ((IFieldSymbol)t2.GetMembers("C").Single()).Type; 1543var d2 = ((IFieldSymbol)t2.GetMembers("D").Single()).Type; 1887var type1 = compilation.GlobalNamespace.GetTypeMembers(typeName).Single(); 1888var method = type1.GetMembers(methodName).Single();
ValueTracking\CSharpValueTrackingTests.cs (25)
325initialItems.Single(), 458initialItems.Single(), 514children.Single(), 575ValidateItem(initialItems.Single(), 18, "x"); // |> return [|x|] [Code.cs:18] 579initialItems.Single(), 656ValidateItem(initialItems.Single(), 20, "i"); 660initialItems.Single(), 680await ValidateChildrenEmptyAsync(workspace, children.Single()); 720items.Single(), 728items.Single(), 736items.Single(), 742await ValidateChildrenEmptyAsync(workspace, items.Single()); 782items.Single(), 790items.Single(), 798items.Single(), 804await ValidateChildrenEmptyAsync(workspace, items.Single()); 848items.Single(), 867items.Single(), 873await ValidateChildrenEmptyAsync(workspace, items.Single()); 917items.Single(), 936items.Single(), 942await ValidateChildrenEmptyAsync(workspace, items.Single()); 979items.Single(), 1029items.Single(), 1035await ValidateChildrenEmptyAsync(workspace, items.Single());
ValueTracking\VisualBasicValueTrackingTests.cs (14)
101items.Single(), 107await ValidateChildrenEmptyAsync(workspace, childItems.Single()); 232items.Single(), 240items.Single(), 248items.Single(), 254await ValidateChildrenEmptyAsync(workspace, items.Single()); 291items.Single(), 299items.Single(), 307items.Single(), 313await ValidateChildrenEmptyAsync(workspace, items.Single()); 352items.Single(), 360items.Single(), 368items.Single(), 374await ValidateChildrenEmptyAsync(workspace, items.Single());
Microsoft.CodeAnalysis.Features (9)
Completion\CompletionChange.cs (1)
83return new CompletionChange(textChanges.Single(), textChanges, newPosition, includesCommitCharacter);
EmbeddedLanguages\Json\JsonParser.cs (1)
190var child = sequence.Single();
RQName\RQNodeBuilder.cs (3)
112var interfaceType = BuildType(symbol.ExplicitInterfaceImplementations.Single().ContainingType); 187var interfaceType = BuildType(symbol.ExplicitInterfaceImplementations.Single().ContainingType); 232var interfaceType = BuildType(symbol.ExplicitInterfaceImplementations.Single().ContainingType);
Shared\Utilities\AnnotatedSymbolMapping.cs (1)
69var location = symbol.Locations.Single();
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
483var getterField = getterFields.TrivialField ?? getterFields.NonTrivialFields.Single();
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
243var parameter = method.Parameters.Single();
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
918var local = localDeclarationOperation.GetDeclaredVariables().Single();
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (4)
DocumentChanges\DocumentChangesTests.cs (2)
51var document = testLspServer.GetTrackedTexts().Single(); 56document = testLspServer.GetTrackedTexts().Single();
MapCode\MapCodeTests.cs (2)
38var newText = text.Replace(focusLocations.Single().Item2, contents.Single());
Microsoft.CodeAnalysis.Test.Utilities (4)
Diagnostics\OperationTestAnalyzer.cs (1)
853Report(operationContext, decl.Symbol.DeclaringSyntaxReferences.Single().GetSyntax(), LocalVarInitializedDeclarationDescriptor);
MarkedSource\MarkupTestFile.cs (3)
249textSpan = spans.Length == 0 ? null : (TextSpan?)spans.Single(); 255textSpan = spans.Single(); 266textSpan = spans.Single();
Microsoft.CodeAnalysis.UnitTests (5)
Collections\ImmutableArrayExtensionsTests.cs (4)
143Assert.Throws<NullReferenceException>(() => default(ImmutableArray<int>).Single()); 144Assert.Throws<InvalidOperationException>(() => ImmutableArray.Create<int>().Single()); 145Assert.Equal(1, ImmutableArray.Create<int>(1).Single()); 146Assert.Throws<InvalidOperationException>(() => ImmutableArray.Create<int>(1, 2).Single());
Symbols\DocumentationCommentIdTests.cs (1)
174var tree = comp.SyntaxTrees.Single();
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (183)
Binding\ImplicitVariableTests.vb (2)
1022Dim l1 = speculative.LookupSymbols(position, name:="x").Single() 1069Dim l1 = speculative.LookupSymbols(position, name:="x").Single()
Compilation\GetImportScopesTests.vb (171)
59Dim syntax = aliasSymbol.DeclaringSyntaxReferences.Single().GetSyntax() 72Assert.Single(scopes.Single().Imports) 73Assert.True(IsNamespaceWithName(scopes.Single().Imports.Single().NamespaceOrType, NameOf(System))) 74Assert.True(IsSimpleImportsClauseWithName(scopes.Single().Imports.Single().DeclaringSyntaxReference, NameOf(System))) 76Assert.Empty(scopes.Single().Aliases) 77Assert.Empty(scopes.Single().ExternAliases) 78Assert.Empty(scopes.Single().XmlNamespaces) 89Assert.Single(scopes.Single().Imports) 90Assert.True(IsNamespaceWithName(scopes.Single().Imports.Single().NamespaceOrType, NameOf(System))) 91Assert.True(IsSimpleImportsClauseWithName(scopes.Single().Imports.Single().DeclaringSyntaxReference, NameOf(System))) 93Assert.Empty(scopes.Single().Aliases) 94Assert.Empty(scopes.Single().ExternAliases) 95Assert.Empty(scopes.Single().XmlNamespaces) 108Assert.True(IsNamespaceWithName(scopes.Single().Imports.Single().NamespaceOrType, NameOf(System))) 109Assert.True(IsSimpleImportsClauseWithName(scopes.Single().Imports.Single().DeclaringSyntaxReference, NameOf(System))) 121Assert.Equal(2, scopes.Single().Imports.Length) 123Assert.True(scopes.Single().Imports.Any(Function(i) IsNamespaceWithName(i.NamespaceOrType, NameOf(System)))) 124Assert.True(scopes.Single().Imports.Any(Function(i) IsNamespaceWithName(i.NamespaceOrType, NameOf(Microsoft)))) 126Assert.True(scopes.Single().Imports.Any(Function(i) IsSimpleImportsClauseWithName(i.DeclaringSyntaxReference, NameOf(System)))) 127Assert.True(scopes.Single().Imports.Any(Function(i) IsSimpleImportsClauseWithName(i.DeclaringSyntaxReference, NameOf(Microsoft)))) 129Assert.Empty(scopes.Single().Aliases) 130Assert.Empty(scopes.Single().ExternAliases) 131Assert.Empty(scopes.Single().XmlNamespaces) 151Assert.Single(scopes.Single().Imports) 152Assert.True(IsNamespaceWithName(scopes.Single().Imports.Single().NamespaceOrType, NameOf(System))) 153Assert.True(IsSimpleImportsClauseWithName(scopes.Single().Imports.Single().DeclaringSyntaxReference, NameOf(System))) 155Assert.Empty(scopes.Single().Aliases) 156Assert.Empty(scopes.Single().ExternAliases) 157Assert.Empty(scopes.Single().XmlNamespaces) 174Assert.Single(scopes.Single.Imports) 175Assert.True(IsNamespaceWithName(scopes.Single().Imports.Single().NamespaceOrType, NameOf(System))) 176Assert.True(IsSimpleImportsClauseWithName(scopes.Single().Imports.Single().DeclaringSyntaxReference, NameOf(System))) 178Assert.Empty(scopes.Single().Aliases) 179Assert.Empty(scopes.Single().ExternAliases) 180Assert.Empty(scopes.Single().XmlNamespaces) 199Assert.Single(scopes.Single().Imports) 200Assert.True(IsNamespaceWithName(scopes.Single().Imports.Single().NamespaceOrType, NameOf(System))) 201Assert.True(IsSimpleImportsClauseWithName(scopes.Single().Imports.Single().DeclaringSyntaxReference, NameOf(System))) 203Assert.Empty(scopes.Single().Aliases) 204Assert.Empty(scopes.Single().ExternAliases) 205Assert.Empty(scopes.Single().XmlNamespaces) 219Assert.Single(scopes.Single().Aliases) 220Assert.True(IsAliasWithName(scopes.Single.Aliases().Single(), "S", NameOf(System), inGlobalNamespace:=True)) 221Assert.True(IsAliasImportsClauseWithName(scopes.Single.Aliases().Single(), "S")) 223Assert.Empty(scopes.Single().Imports) 224Assert.Empty(scopes.Single().ExternAliases) 225Assert.Empty(scopes.Single().XmlNamespaces) 236Assert.Single(scopes.Single().Aliases) 237Assert.True(IsAliasWithName(scopes.Single.Aliases().Single(), "S", NameOf(System), inGlobalNamespace:=True)) 238Assert.True(IsAliasImportsClauseWithName(scopes.Single.Aliases().Single(), "S")) 240Assert.Empty(scopes.Single().Imports) 241Assert.Empty(scopes.Single().ExternAliases) 242Assert.Empty(scopes.Single().XmlNamespaces) 256Assert.Single(scopes.Single().Aliases) 257Assert.True(IsAliasWithName(scopes.Single.Aliases().Single(), "S", NameOf(System), inGlobalNamespace:=True)) 258Assert.True(IsAliasImportsClauseWithName(scopes.Single.Aliases().Single(), "S")) 260Assert.Empty(scopes.Single().Imports) 261Assert.Empty(scopes.Single().ExternAliases) 262Assert.Empty(scopes.Single().XmlNamespaces) 274Assert.Equal(2, scopes.Single().Aliases.Length) 276Assert.True(scopes.Single().Aliases.Any(Function(a) IsAliasWithName(a, "S", NameOf(System), inGlobalNamespace:=True))) 277Assert.True(scopes.Single().Aliases.Any(Function(a) IsAliasImportsClauseWithName(a, "S"))) 278Assert.True(scopes.Single().Aliases.Any(Function(a) IsAliasWithName(a, "M", NameOf(Microsoft), inGlobalNamespace:=True))) 279Assert.True(scopes.Single().Aliases.Any(Function(a) IsAliasImportsClauseWithName(a, "M"))) 281Assert.Empty(scopes.Single().Imports) 282Assert.Empty(scopes.Single().ExternAliases) 283Assert.Empty(scopes.Single().XmlNamespaces) 301Assert.Single(scopes.Single().Aliases) 302Assert.True(IsAliasWithName(scopes.Single.Aliases().Single(), "S", NameOf(System), inGlobalNamespace:=True)) 303Assert.True(IsAliasImportsClauseWithName(scopes.Single.Aliases().Single(), "S")) 305Assert.Empty(scopes.Single().Imports) 306Assert.Empty(scopes.Single().ExternAliases) 307Assert.Empty(scopes.Single().XmlNamespaces) 325Assert.Single(scopes.Single().Aliases) 326Assert.True(IsAliasWithName(scopes.Single.Aliases().Single(), "S", NameOf(System), inGlobalNamespace:=True)) 327Assert.True(IsAliasImportsClauseWithName(scopes.Single.Aliases().Single(), "S")) 329Assert.Empty(scopes.Single().Imports) 330Assert.Empty(scopes.Single().ExternAliases) 331Assert.Empty(scopes.Single().XmlNamespaces) 348Assert.Single(scopes.Single().XmlNamespaces) 349Assert.Equal("http://roslyn", scopes.Single().XmlNamespaces.Single().XmlNamespace) 350Assert.True(TypeOf scopes.Single().XmlNamespaces.Single().DeclaringSyntaxReference.GetSyntax() Is XmlNamespaceImportsClauseSyntax) 351Assert.Equal("<xmlns:r1=""http://roslyn"">", scopes.Single().XmlNamespaces.Single().DeclaringSyntaxReference.GetSyntax().ToString()) 353Assert.Empty(scopes.Single().Aliases) 354Assert.Empty(scopes.Single().ExternAliases) 355Assert.Empty(scopes.Single().Imports) 366Assert.Single(scopes.Single().XmlNamespaces) 367Assert.Equal("http://roslyn", scopes.Single().XmlNamespaces.Single().XmlNamespace) 368Assert.True(TypeOf scopes.Single().XmlNamespaces.Single().DeclaringSyntaxReference.GetSyntax() Is XmlNamespaceImportsClauseSyntax) 369Assert.Equal("<xmlns:r1=""http://roslyn"">", scopes.Single().XmlNamespaces.Single().DeclaringSyntaxReference.GetSyntax().ToString()) 371Assert.Empty(scopes.Single().Aliases) 372Assert.Empty(scopes.Single().ExternAliases) 373Assert.Empty(scopes.Single().Imports) 388Assert.Single(scopes.Single().XmlNamespaces) 389Assert.Equal("http://roslyn", scopes.Single().XmlNamespaces.Single().XmlNamespace) 390Assert.True(TypeOf scopes.Single().XmlNamespaces.Single().DeclaringSyntaxReference.GetSyntax() Is XmlNamespaceImportsClauseSyntax) 391Assert.Equal("<xmlns:r1=""http://roslyn"">", scopes.Single().XmlNamespaces.Single().DeclaringSyntaxReference.GetSyntax().ToString()) 393Assert.Empty(scopes.Single().Aliases) 394Assert.Empty(scopes.Single().ExternAliases) 395Assert.Empty(scopes.Single().Imports) 407Assert.Equal(2, scopes.Single().XmlNamespaces.Length) 409Assert.True(scopes.Single().XmlNamespaces.Any(Function(x) x.XmlNamespace = "http://roslyn")) 410Assert.True(TypeOf scopes.Single().XmlNamespaces.First().DeclaringSyntaxReference.GetSyntax() Is XmlNamespaceImportsClauseSyntax) 411Assert.True(scopes.Single().XmlNamespaces.Any(Function(x) x.DeclaringSyntaxReference.GetSyntax().ToString() = "<xmlns:r1=""http://roslyn"">")) 413Assert.True(scopes.Single().XmlNamespaces.Any(Function(X) X.XmlNamespace = "http://roslyn2")) 414Assert.True(TypeOf scopes.Single().XmlNamespaces.Last().DeclaringSyntaxReference.GetSyntax() Is XmlNamespaceImportsClauseSyntax) 415Assert.True(scopes.Single().XmlNamespaces.Any(Function(x) x.DeclaringSyntaxReference.GetSyntax().ToString() = "<xmlns:r2=""http://roslyn2"">")) 417Assert.Empty(scopes.Single().Aliases) 418Assert.Empty(scopes.Single().ExternAliases) 419Assert.Empty(scopes.Single().Imports) 439Assert.Single(scopes.Single().XmlNamespaces) 440Assert.Equal("http://roslyn", scopes.Single().XmlNamespaces.Single().XmlNamespace) 441Assert.True(TypeOf scopes.Single().XmlNamespaces.Single().DeclaringSyntaxReference.GetSyntax() Is XmlNamespaceImportsClauseSyntax) 442Assert.Equal("<xmlns:r1=""http://roslyn"">", scopes.Single().XmlNamespaces.Single().DeclaringSyntaxReference.GetSyntax().ToString()) 444Assert.Empty(scopes.Single().Aliases) 445Assert.Empty(scopes.Single().ExternAliases) 446Assert.Empty(scopes.Single().Imports) 463Assert.Single(scopes.Single().XmlNamespaces) 464Assert.Equal("http://roslyn", scopes.Single().XmlNamespaces.Single().XmlNamespace) 465Assert.True(TypeOf scopes.Single().XmlNamespaces.Single().DeclaringSyntaxReference.GetSyntax() Is XmlNamespaceImportsClauseSyntax) 466Assert.Equal("<xmlns:r1=""http://roslyn"">", scopes.Single().XmlNamespaces.Single().DeclaringSyntaxReference.GetSyntax().ToString()) 468Assert.Empty(scopes.Single().Aliases) 469Assert.Empty(scopes.Single().ExternAliases) 470Assert.Empty(scopes.Single().Imports) 489Assert.Single(scopes.Single().XmlNamespaces) 490Assert.Equal("http://roslyn", scopes.Single().XmlNamespaces.Single().XmlNamespace) 491Assert.True(TypeOf scopes.Single().XmlNamespaces.Single().DeclaringSyntaxReference.GetSyntax() Is XmlNamespaceImportsClauseSyntax) 492Assert.Equal("<xmlns:r1=""http://roslyn"">", scopes.Single().XmlNamespaces.Single().DeclaringSyntaxReference.GetSyntax().ToString()) 494Assert.Empty(scopes.Single().Aliases) 495Assert.Empty(scopes.Single().ExternAliases) 496Assert.Empty(scopes.Single().Imports)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (10)
1258paramSymbol1.Locations.Single().SourceSpan.Start) 1266paramSymbol2.Locations.Single().SourceSpan.Start - "Optional ".Length) 1274paramSymbol3.Locations.Single().SourceSpan.Start) 1282paramSymbol4.Locations.Single().SourceSpan.Start) 1290paramSymbol5.Locations.Single().SourceSpan.Start) 1369Assert.Equal(syntax.SpanStart + 6, paramSymbol1.Locations.Single().SourceSpan.Start) 1374Assert.Equal(syntax.SpanStart + 6, paramSymbol2.Locations.Single().SourceSpan.Start) 1379Assert.Equal(syntax.SpanStart, paramSymbol3.Locations.Single().SourceSpan.Start) 1384Assert.Equal(syntax.SpanStart + 6, paramSymbol4.Locations.Single().SourceSpan.Start) 1885Assert.Equal(syntax.SpanStart, tpSymbol5.Locations.Single().SourceSpan.Start)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (26)
SymbolsTests\Metadata\PE\NoPiaInstantiationOfGenericClassAndStruct.vb (22)
32Dim classLocalType1 As NamedTypeSymbol = localConsumer1.SourceModule.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 47Dim classLocalType As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 63Dim classLocalType As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 79Dim classLocalType As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 101Dim classLocalType1 As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 116Dim classLocalType As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 139Dim classLocalType As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 154Dim classLocalType1 As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 170Dim classLocalType1 As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 186Dim classLocalType1 As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 202Dim classLocalType1 As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 218Dim classLocalType As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 234Dim classLocalType As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 250Dim classLocalType As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 266Dim classLocalType As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 280Dim classLocalType As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 294Dim classLocalType As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 307Dim classLocalType As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 323Dim classLocalType As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 340Dim classLocalType As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("NoPIAGenerics").[Single]() 366Dim classLocalType As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("DrivedClass").[Single]() 390Dim classLocalType As NamedTypeSymbol = localConsumer.GlobalNamespace.GetTypeMembers("Interface1Impl2").[Single]()
SymbolsTests\Retargeting\RetargetCustomModifiers.vb (2)
36Dim modifiers = c2.GlobalNamespace.GetTypeMembers("Modifiers").Single() 115Dim modifiers = c2.GlobalNamespace.GetTypeMembers("Modifiers").Single()
SymbolsTests\TypedConstantTests.vb (2)
52Assert.Equal(commonArray.Values.Single(), langArray.Values.Single())
Microsoft.CodeAnalysis.Workspaces (8)
Recommendations\AbstractRecommendationServiceRunner.cs (1)
81if (owningMethod.DeclaringSyntaxReferences.Single().GetSyntax(_cancellationToken) is not TAnonymousFunctionSyntax lambdaSyntax)
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
251conflictResolution.RenameDocumentToMatchNewSymbol(definitionDocuments.Single());
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (3)
182var location = originalSymbol.Locations.Single(); 272var aliasLocation = location.Alias.Locations.Single(); 291var aliasLocation = location.Alias.Locations.Single();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
205var typeArgument = typeArguments.Single().ToDisplayParts().Last().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
69return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (1)
796projectUpdateState = ConvertMetadataReferencesToProjectReferences_NoLock(solutionChanges, distinctRemainingProjects.Single(), outputPath, projectUpdateState);
Microsoft.CodeAnalysis.Workspaces.UnitTests (21)
FindReferencesTests.cs (5)
437var nameProperty = compilation.GetTypeByMetadataName("A.C").GetMembers("Uri").Single(); 481var baseVirtualMethodSymbol = baseType.GetMembers("SomeMethod").Single(); 485var overriddenMethodSymbol = derivedType.GetMembers("SomeMethod").Single(); 516var constraint = comp.GetTypeByMetadataName("C`1").TypeParameters.Single().ConstraintTypes.Single();
SolutionTests\DocumentInfoTests.cs (1)
75Assert.Equal("folder", ((ImmutableArray<string>)info1.Folders).Single());
SolutionTests\ProjectInfoTests.cs (5)
78Assert.Same(documentInfo, ((ImmutableArray<DocumentInfo>)info1.Documents).Single()); 97Assert.Same(documentInfo, ((ImmutableArray<DocumentInfo>)info1.AdditionalDocuments).Single()); 116Assert.Same(projectReference, ((ImmutableArray<ProjectReference>)info1.ProjectReferences).Single()); 135Assert.Same(metadataReference, ((ImmutableArray<MetadataReference>)info1.MetadataReferences).Single()); 154Assert.Same(analyzerReference, ((ImmutableArray<AnalyzerReference>)info1.AnalyzerReferences).Single());
SolutionTests\SolutionInfoTests.cs (1)
35Assert.Same(projectInfo, ((ImmutableArray<ProjectInfo>)info1.Projects).Single());
SymbolKeyTests.cs (9)
419var b = ((IMethodSymbol)compilation1.GlobalNamespace.GetTypeMembers("C").Single().GetMembers("M").Single()).Parameters[1]; 443var b = ((IMethodSymbol)compilation1.GlobalNamespace.GetTypeMembers("C").Single().GetMembers("M").Single()).Parameters[1]; 762var inner = constructed.GetTypeMembers().Single(); 784var a_b = a.GetTypeMembers().Single(); 792var a_string_b = a_string.GetTypeMembers().Single(); 826var typeParameter = GetDeclaredSymbols(compilation).OfType<INamedTypeSymbol>().Where(n => !n.IsImplicitlyDeclared).Single().TypeParameters.Single(); 840.Where(n => !n.IsImplicitlyDeclared).Single().GetMembers("M").OfType<IMethodSymbol>().Single().TypeParameters.Single();
Microsoft.VisualBasic.Tests (1)
Microsoft\VisualBasic\ApplicationServices\SingleInstanceTests.cs (1)
178string[] actualArgs = receivedArgs.Freeze().Single();