8543 references to Single
Aspire.Hosting.Tests (2)
Health\ResourceHealthCheckServiceTests.cs (2)
130e => e.Snapshot.State?.Text == KnownResourceStates.Running && e.Snapshot.HealthReports.Single().Status == HealthStatus.Unhealthy).DefaultTimeout(); 133Assert.Equal("Error calling HealthCheckService.", runningEvent.Snapshot.HealthReports.Single().Description);
GenerateDocumentationAndConfigFiles (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
192var typeArgument = typeArguments.Single().ToDisplayParts().Last().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
70return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);
Metrics (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
192var typeArgument = typeArguments.Single().ToDisplayParts().Last().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
70return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);
Metrics.Legacy (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
192var typeArgument = typeArguments.Single().ToDisplayParts().Last().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
70return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);
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)
37declaringSyntaxReferences.Single().GetSyntax(cancellationToken) is not ClassDeclarationSyntax
Microsoft.CodeAnalysis (1)
Operations\ControlFlowGraphBuilder.cs (1)
5741HandleVariableDeclarations((VariableDeclarationGroupOperation)initialization.Single());
Microsoft.CodeAnalysis.Analyzers (3)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer.cs (1)
1279string arg1 = ((IFieldInitializerOperation)operationAnalysisContext.Operation).InitializedFields.Single().Name;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
192var typeArgument = typeArguments.Single().ToDisplayParts().Last().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
70return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);
Microsoft.CodeAnalysis.AnalyzerUtilities (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
192var typeArgument = typeArguments.Single().ToDisplayParts().Last().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
70return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);
Microsoft.CodeAnalysis.BannedApiAnalyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
192var typeArgument = typeArguments.Single().ToDisplayParts().Last().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
70return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);
Microsoft.CodeAnalysis.CodeStyle (4)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
482var getterField = getterFields.TrivialField ?? getterFields.NonTrivialFields.Single();
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
242var parameter = method.Parameters.Single();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
192var typeArgument = typeArguments.Single().ToDisplayParts().Last().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
70return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
921var local = localDeclarationOperation.GetDeclaredVariables().Single();
Microsoft.CodeAnalysis.CSharp (48)
Binder\Binder_Conversions.cs (1)
2438var underlyingConversion = conversion.UnderlyingConversions.Single();
Binder\Binder_Expressions.cs (3)
2623Error(diagnostics, ErrorCode.ERR_ValConstraintNotSatisfied, node, nullableType, nullableType.TypeParameters.Single(), indexType); 2703Error(diagnostics, ErrorCode.ERR_ValConstraintNotSatisfied, node, nullableType, nullableType.TypeParameters.Single(), rangeType); 2730Error(diagnostics, ErrorCode.ERR_ValConstraintNotSatisfied, operand, nullableType, nullableType.TypeParameters.Single(), indexType);
Binder\Binder_Operators.cs (1)
1336namedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().Type.SpecialType is SpecialType.System_Byte;
Binder\Binder_Statements.cs (3)
154block.Statements.Single().WasCompilerGenerated == false), "Synthetic node would not get cached"); 3115? retType.GetMemberTypeArgumentsNoUseSiteDiagnostics().Single() 3163returnType = returnType.GetMemberTypeArgumentsNoUseSiteDiagnostics().Single();
Binder\ForEachLoopBinder.cs (2)
558(builder.ElementType.IsNullableType() && builder.ElementType.GetMemberTypeArgumentsNoUseSiteDiagnostics().Single().IsErrorType() && collectionExpr.Type.IsArray())); 1106builder.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)
882lambdaSymbol = symbolInfo.CandidateSymbols.Single().GetSymbol<LambdaSymbol>();
FlowAnalysis\FlowAnalysisPass.cs (1)
125Debug.Assert(elementField == implicitlyInitializedFields.Single());
FlowAnalysis\NullableWalker.cs (2)
3161type = ((NamedTypeSymbol)returnType.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single(); 9764|| 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)
404var elementType = collectionType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single(); 439SynthesizedReadOnlyListKind.SingleElement => this.VisitExpression((BoundExpression)elements.Single()), 448arrayOrList = new BoundObjectCreationExpression(syntax, synthesizedType.Constructors.Single(), fieldValue) { WasCompilerGenerated = true };
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (2)
96var byteType = ((NamedTypeSymbol)node.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().Type; 609createSpan = createSpan.Construct(rewrittenOperand.Type, spanType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().Type);
Symbols\Metadata\PE\PETypeParameterSymbol.cs (1)
279ModifierInfo<TypeSymbol> m = modifiers.Single();
Symbols\NamedTypeSymbol.cs (3)
453return (SynthesizedInstanceConstructor)InstanceConstructors.Single(); 459return (SynthesizedInteractiveInitializerMethod)GetMembers(SynthesizedInteractiveInitializerMethod.InitializerName).Single(); 466return (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 (5)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
109semanticModel.Compilation, ienumerableType.TypeArguments.Single()))
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
80var constructorParameterTypeArg = constructorParameter.Type.GetTypeArguments().Single();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (3)
1040return collectionTargetType.GetTypeArguments().Single(); 1044return collectionTargetType.GetTypeArguments().Single(); 1049return iface.TypeArguments.Single();
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
68: IsCorrectTypeForYieldReturn(typeArguments.Single(), returnExpressionType, methodReturnType, model);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
800return expressions.Single();
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryExpressionParenthesesTests.cs (1)
2634Assert.Equal(expectedSpans["expression"].Single(), diagnostic.AdditionalLocations[0].SourceSpan);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (15)
CommandLineTests.cs (15)
321options = analyzerOptions.GetOptions(cmd.AnalyzerOptions.AdditionalFiles.Single()); 1117resourceDescription = parsedArgs.ManifestResources.Single(); 1124resourceDescription = parsedArgs.ManifestResources.Single(); 1131resourceDescription = parsedArgs.ManifestResources.Single(); 1138resourceDescription = parsedArgs.ManifestResources.Single(); 1274Assert.Equal("a", parsedArgs.MetadataReferences.Single().Properties.Aliases.Single()); 1275Assert.Equal("b", parsedArgs.MetadataReferences.Single().Reference); 2886var err = parsedArgs.Errors.Single(); 9874Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles.Single().Path); 9890Assert.Equal(Path.Combine(WorkingDirectory, "..\\web.config"), args.AdditionalFiles.Single().Path); 9946Assert.Equal(Path.Combine(WorkingDirectory, ".editorconfig"), args.AnalyzerConfigPaths.Single()); 9962Assert.Equal(Path.Combine(WorkingDirectory, "..\\.editorconfig"), args.AnalyzerConfigPaths.Single()); 11974Assert.Equal("a", parsedArgs.ParseOptions.PreprocessorSymbols.Single()); 15054options = provider.GetOptions(cmd.AnalyzerOptions.AdditionalFiles.Single());
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (31)
CodeActions\ApplyChangesOperationTests.cs (1)
240var operation = operations.Single();
Completion\CompletionProviders\CrefCompletionProviderTests.cs (1)
398var provider = Assert.IsType<CrefCompletionProvider>(service.GetTestAccessor().GetImportedAndBuiltInProviders([]).Single());
ExtractMethod\ExtractMethodBase.cs (2)
169var validator = new CSharpExtractMethodService.CSharpSelectionValidator(semanticDocument, textSpanOverride ?? namedSpans["b"].Single(), localFunction: false); 182Assert.Equal(revisedSpans.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)
286var type = compilation.SourceModule.GlobalNamespace.GetTypeMembers("C").Single(); 526var typeSym02 = namespace2.GetTypeMembers("C2").Single(); 604var typeSym1 = comp1.SourceModule.GlobalNamespace.GetTypeMembers("Test").Single(); 607var 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)
437var classD = compilation2.SourceModule.GlobalNamespace.GetTypeMembers("D").Single(); 465var classD = compilation2.SourceModule.GlobalNamespace.GetTypeMembers("D").Single(); 503var classD = compilation2.SourceModule.GlobalNamespace.GetTypeMembers("D").Single(); 521var classDz = compilation2Z.SourceModule.GlobalNamespace.GetTypeMembers("D").Single(); 561var classDy = compilation2y.SourceModule.GlobalNamespace.GetTypeMembers("D").Single(); 633var classDy = compilation2y.SourceModule.GlobalNamespace.GetTypeMembers("D").Single(); 663var classDz = compilation2Z.SourceModule.GlobalNamespace.GetTypeMembers("D").Single(); 684var classDz = compilation2Z.SourceModule.GlobalNamespace.GetTypeMembers("D").Single(); 1379Assert.Equal(document.Id, documentIdsWithFilePath.Single()); 1383Assert.Equal(additionalDoc.Id, documentIdsWithFilePath.Single()); 1399Assert.Equal(document.Id, documentIdsWithFilePath.Single()); 1403Assert.Equal(analyzerConfigDoc.Id, documentIdsWithFilePath.Single());
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (488)
BreakingChanges.cs (1)
165var indexer = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>("MonthDays").Indexers.Single();
CodeGen\CodeGenAsyncIteratorTests.cs (4)
1150var attribute = method.GetAttributes().Single(); 8747var tree = comp.SyntaxTrees.Single(); 8813var tree = comp.SyntaxTrees.Single(); 10598m.GlobalNamespace.GetMember<NamedTypeSymbol>("Test1.<M2>d__0").TypeParameters.Single().GetAttributes().Select(a => a.ToString()));
CodeGen\CodeGenAsyncMethodBuilderOverrideTests.cs (2)
893var tree = compilation.SyntaxTrees.Single(); 945var tree = compilation.SyntaxTrees.Single();
CodeGen\CodeGenAsyncTests.cs (1)
6305m.GlobalNamespace.GetMember<NamedTypeSymbol>("Test1.<M2>d__0").TypeParameters.Single().GetAttributes().Select(a => a.ToString()));
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\CodeGenDynamicTests.cs (1)
804Assert.Equal(0, container.GetMembers().Single().GetAttributes().Length);
CodeGen\CodeGenExprLambdaTests.cs (2)
1491var tree = comp.SyntaxTrees.Single(); 1528var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenForEachTests.cs (1)
1756var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenFunctionPointersTests.cs (22)
2539var i1 = module.GlobalNamespace.GetTypeMembers("I1").Single(); 2543var i2 = module.GlobalNamespace.GetTypeMembers("I2").Single(); 2547var c = module.GlobalNamespace.GetTypeMembers("C").Single(); 2573var i1 = module.GlobalNamespace.GetTypeMembers("I1").Single(); 2577var i2 = module.GlobalNamespace.GetTypeMembers("I2").Single(); 2610var i1 = module.GlobalNamespace.GetTypeMembers("I1").Single(); 5414string getAttribute(string fieldName) => c.GetField(fieldName).GetAttributes().Single().ToString()!; 5474Assert.Equal(expectedAttribute, field.GetAttributes().Single().ToString()); 5560Assert.Equal(expectedAttribute, f.GetAttributes().Single().ToString()); 5608var param = m.Parameters.Single(); 5609Assert.Equal("System.Runtime.CompilerServices.DynamicAttribute({false, false, false, false, false, true, false, true})", param.GetAttributes().Single().ToString()); 5721var param = method.Parameters.Single(); 6307Assert.True(baseM1.Parameters.Single().Type.Equals(derivedM1.Parameters.Single().Type, TypeCompareKind.ConsiderEverything)); 6309Assert.True(baseM3.Parameters.Single().Type.Equals(derivedM3.Parameters.Single().Type, TypeCompareKind.ConsiderEverything)); 7060var funcPtr = (FunctionPointerTypeSymbol)m1.Parameters.Single().Type; 7062verifyArray(funcPtr.Signature.Parameters.Single().Type); 7066verifyArray(funcPtr.Signature.Parameters.Single().Type); 7068funcPtr = (FunctionPointerTypeSymbol)m3.Parameters.Single().Type; 7423Assert.True(lambdaSymbol.Parameters.Single().Type.IsErrorType()); 12368var item = arg.Values.Single();
CodeGen\CodeGenImplicitImplementationTests.cs (1)
777var typeSymbol = module.GlobalNamespace.GetTypeMembers("C1").Single();
CodeGen\CodeGenInterfaceImplementation.cs (1)
2738var interfaceType = derivedType.Interfaces().Single();
CodeGen\CodeGenInterpolatedString.cs (1)
36var tree = comp.SyntaxTrees.Single();
CodeGen\CodeGenLocalFunctionTests.cs (17)
144var tree = comp.SyntaxTrees.Single(); 5243Assert.Equal("A", attrs2.Single().AttributeClass.Name); 5246var attrs3 = localFn3.GetParameters().Single().GetAttributes(); 5247Assert.Equal("A", attrs3.Single().AttributeClass.Name); 5250var attrs4 = localFn4.TypeParameters.Single().GetAttributes(); 5251Assert.Equal("A", attrs4.Single().AttributeClass.Name); 5365var param = localFn1.Parameters.Single(); 5394Assert.Equal("CompilerGeneratedAttribute", attrs1.Single().AttributeClass.Name); 5396Assert.Equal("DynamicAttribute", localFn1.GetReturnTypeAttributes().Single().AttributeClass.Name); 5398var param = localFn1.Parameters.Single(); 5399Assert.Equal("DynamicAttribute", param.GetAttributes().Single().AttributeClass.Name); 5427Assert.Equal("CompilerGeneratedAttribute", attrs1.Single().AttributeClass.Name); 5431var param = localFn1.Parameters.Single(); 5638Assert.Equal(new[] { "Attr" }, GetAttributeNames(localFn1.TypeParameters.Single().GetAttributes())); 5639Assert.Equal(new[] { "Attr" }, GetAttributeNames(localFn1.Parameters.Single().GetAttributes())); 5649Assert.Empty(localFn1.TypeParameters.Single().GetAttributes()); 5650Assert.Empty(localFn1.Parameters.Single().GetAttributes());
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 (154)
951var partialParamType = partialNamesMethod.Parameters.Single().TypeWithAnnotations; 957var allNullParamType = allNullNamesMethod.Parameters.Single().TypeWithAnnotations; 3360var mFirst = (FieldSymbol)mTuple.GetMembers("first").Single(); 3374Assert.Equal("T1 first", mFirst.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 3378var mItem1 = (FieldSymbol)mTuple.GetMembers("Item1").Single(); 4596var mItem1 = (FieldSymbol)mTuple.GetMembers("Item1").Single(); 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(); 11212Assert.Equal("System.Int32 (System.Int32 a2, System.Int32 b2).Item1", m2Tuple.GetMembers("Item1").Single().ToTestDisplayString()); 11213Assert.Equal("System.Int32 (System.Int32 a2, System.Int32 b2).a2", m2Tuple.GetMembers("a2").Single().ToTestDisplayString()); 11218Assert.Equal("System.Int32 (System.Int32, System.Int32).Item1", m1Tuple.GetEarlyAttributeDecodingMembers("Item1").Single().ToTestDisplayString()); 11221Assert.Equal("(int, int)", m1Tuple.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 11222Assert.Equal("(int a2, int b2)", m2Tuple.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 11279Assert.NotEqual(m2Item1.Locations.Single(), m2Item1.TupleUnderlyingField.Locations.Single()); 11280Assert.Equal("MetadataFile(System.ValueTuple.dll)", m2Item1.TupleUnderlyingField.Locations.Single().ToString()); 11281Assert.Equal("SourceFile([826..828))", m2Item1.Locations.Single().ToString()); 11298Assert.Equal("int a2", m2a2.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 11503m2Tuple.GetMembers("Item9").Single().ToTestDisplayString()); 11505m2Tuple.GetMembers("i2").Single().ToTestDisplayString()); 11511m1Tuple.GetEarlyAttributeDecodingMembers("Item1").Single().ToTestDisplayString()); 11514Assert.Equal("(int, int, int, int, int, int, int, int, int)", m1Tuple.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 11516m2Tuple.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 11568Assert.Equal("SourceFile([739..741))", m2Item9.Locations.Single().ToString()); 11569Assert.Equal("MetadataFile(System.ValueTuple.dll)", m2Item9.TupleUnderlyingField.Locations.Single().ToString()); 11583Assert.Equal("int i2", m2i2.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 11770var m3Item8 = (FieldSymbol)m3Tuple.GetMembers("Item8").Single(); 11790var m3TupleRestTuple = (NamedTypeSymbol)((FieldSymbol)m3Tuple.GetMembers("Rest").Single()).Type; 11963var m4Item8 = (FieldSymbol)m4Tuple.GetMembers("Item8").Single(); 11982var m4h4 = (FieldSymbol)m4Tuple.GetMembers("h4").Single(); 11997Assert.Equal("int h4", m4h4.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 12002var m4TupleRestTuple = ((FieldSymbol)m4Tuple.GetMembers("Rest").Single()).Type; 12210var m5Item8 = (FieldSymbol)m5Tuple.GetMembers("Item8").Single(); 12226Assert.Equal("int Item8", m5Item8.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 12231var m5TupleRestTuple = ((FieldSymbol)m5Tuple.GetMembers("Rest").Single()).Type; 12273var m5TupleRestTupleRestTuple = ((FieldSymbol)m5TupleRestTuple.GetMembers("Rest").Single()).Type; 12578var m8Item8 = (FieldSymbol)m8Tuple.GetMembers("Item8").Single(); 12616Assert.NotEqual(m8Item1.Locations.Single(), m8Item1.TupleUnderlyingField.Locations.Single()); 12620var m8TupleRestTuple = ((FieldSymbol)m8Tuple.GetMembers("Rest").Single()).Type; 12690var tree = c.SyntaxTrees.Single(); 12759Assert.Equal("System.Int32 (System.Int32 a2, System.Int32 b2).Item1", m2Tuple.GetMembers("Item1").Single().ToTestDisplayString()); 12760Assert.Equal("System.Int32 (System.Int32 a2, System.Int32 b2).a2", m2Tuple.GetMembers("a2").Single().ToTestDisplayString()); 12767Assert.Equal("System.Int32 (System.Int32, System.Int32).Item1", m1Tuple.GetEarlyAttributeDecodingMembers("Item1").Single().ToTestDisplayString()); 12770Assert.Equal("(1, 11)", m1Tuple.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 12771Assert.Equal("(a2: 2, b2: 22)", m2Tuple.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 12773Assert.Equal("public struct ValueTuple<T1, T2>", m1Tuple.OriginalDefinition.DeclaringSyntaxReferences.Single().GetSyntax().ToString().Substring(0, 32)); 12808Assert.Equal("Item1", m1Item1.TupleUnderlyingField.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 12827Assert.Equal("Item1", m2Item1.TupleUnderlyingField.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 12828Assert.NotEqual(m2Item1.Locations.Single(), m2Item1.TupleUnderlyingField.Locations.Single()); 12829Assert.Equal("SourceFile([891..896))", m2Item1.TupleUnderlyingField.Locations.Single().ToString()); 12830Assert.Equal("SourceFile([196..198))", m2Item1.Locations.Single().ToString()); 12845Assert.Equal("a2", m2a2.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 12846Assert.Equal("Item1", m2a2.TupleUnderlyingField.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 12867Assert.Equal("public override string ToString()", m1ToString.DeclaringSyntaxReferences.Single().GetSyntax().ToString().Substring(0, 33)); 12947Assert.Equal("(System.Int32, System.Int32).C9", m9Tuple.GetTypeMembers().Single().ToTestDisplayString()); 12948Assert.Equal("(System.Int32, System.Int32).C9", m9Tuple.GetTypeMembers("C9").Single().ToTestDisplayString()); 12949Assert.Equal("(System.Int32, System.Int32).C9", m9Tuple.GetTypeMembers("C9", 0).Single().ToTestDisplayString()); 12950Assert.Equal("(System.Int32, System.Int32).C9", m9Tuple.GetTypeMembersUnordered().Single().ToTestDisplayString()); 13203Assert.Equal("System.ObsoleteAttribute", m10Tuple.GetAttributes().Single().ToString()); 13204Assert.Equal("I1", m10Tuple.Interfaces().Single().ToTestDisplayString()); 13209var m10Item1 = (FieldSymbol)m10Tuple.GetMembers("Item1").Single(); 13210var m102Item20 = (FieldSymbol)m102Tuple.GetMembers("Item20").Single(); 13211var m102a = (FieldSymbol)m102Tuple.GetMembers("a").Single(); 13217Assert.Equal("System.ObsoleteAttribute", m10Item1.GetAttributes().Single().ToString()); 13218Assert.Equal("System.ObsoleteAttribute", m102Item20.GetAttributes().Single().ToString()); 13219Assert.Equal("System.ObsoleteAttribute", m102a.GetAttributes().Single().ToString()); 13221var m10Item2 = (FieldSymbol)m10Tuple.GetMembers("Item2").Single(); 13222var m102Item21 = (FieldSymbol)m102Tuple.GetMembers("Item21").Single(); 13223var m102Item2 = (FieldSymbol)m102Tuple.GetMembers("Item2").Single(); 13224var m102b = (FieldSymbol)m102Tuple.GetMembers("b").Single(); 13241var m103Item9 = (FieldSymbol)m103Tuple.GetMembers("Item9").Single(); 13253Assert.Equal("void I1.M1()", m10I1M1.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 13256Assert.Equal("System.ObsoleteAttribute", m10M2.GetAttributes().Single().ToString()); 13261Assert.Equal("System.Int32 I1.P1 { get; set; }", m10I1P1.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 13263Assert.Equal("System.Int32 I1.P1.get", m10I1P1.GetMethod.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 13265Assert.Equal("void I1.P1.set", m10I1P1.SetMethod.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 13268Assert.Equal("System.ObsoleteAttribute", m10P2.GetAttributes().Single().ToString()); 13273Assert.Equal("event System.Action I1.E1", m10I1E1.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 13275Assert.Equal("void I1.E1.add", m10I1E1.AddMethod.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 13277Assert.Equal("void I1.E1.remove", m10I1E1.RemoveMethod.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 13280Assert.Equal("System.ObsoleteAttribute", m10E2.GetAttributes().Single().ToString()); 13536Assert.NotSame(m9Test.TypeParameters.Single(), m9Test.TypeParameters.Single().OriginalDefinition); 13537Assert.Same(m9Test, m9Test.TypeParameters.Single().ContainingSymbol); 13538Assert.Same(m9Test, m9Test.Parameters.Single().ContainingSymbol); 13539Assert.Equal(0, m9Test.TypeParameters.Single().Ordinal); 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; 15809Assert.Equal("System.Int32 (System.Int32, System.Int32).P1 { readonly get; set; }", m1Tuple.GetEarlyAttributeDecodingMembers("P1").Single().ToTestDisplayString()); 16037Assert.Equal("event System.Action<System.Int32> (System.Int32, System.Int64).E1", m1Tuple.GetEarlyAttributeDecodingMembers("E1").Single().ToTestDisplayString()); 16038Assert.Equal("event System.Action<System.Int64> (System.Int32, System.Int64).E2", m1Tuple.GetEarlyAttributeDecodingMembers("E2").Single().ToTestDisplayString()); 16537var tree = comp.SyntaxTrees.Single(); 16583((NamedTypeSymbol)((Symbols.PublicModel.ErrorTypeSymbol)xSymbol).UnderlyingSymbol).GetMembers("Item1").Single().ToTestDisplayString()); 16622((NamedTypeSymbol)((Symbols.PublicModel.ErrorTypeSymbol)xSymbol).UnderlyingSymbol).GetMembers("Item1").Single().ToTestDisplayString()); 16625((NamedTypeSymbol)((Symbols.PublicModel.ErrorTypeSymbol)xSymbol).UnderlyingSymbol).GetMembers("a").Single().ToTestDisplayString()); 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(); 27978var retargetingValueTupleType = (NamedTypeSymbol)comp3.GlobalNamespace.GetMember<NamespaceSymbol>("System").GetMembers("ValueTuple").Single(); 27991var type = (NamedTypeSymbol)module.GlobalNamespace.GetMember<NamespaceSymbol>("System").GetMembers("ValueTuple").Single(); 28068var type = (NamedTypeSymbol)module.GlobalNamespace.GetMember<NamespaceSymbol>("System").GetMembers("ValueTuple").Single(); 28280Assert.Equal(name, item.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 28360Assert.Equal(name, item.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 28393var retargetingValueTupleType = (NamedTypeSymbol)comp3.GlobalNamespace.GetMember<NamespaceSymbol>("System").GetMembers("ValueTuple").Single(); 28399var type = (NamedTypeSymbol)module.GlobalNamespace.GetMember<NamespaceSymbol>("System").GetMembers("ValueTuple").Single(); 28446Assert.Equal(name, item.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 28489var namedType = (NamedTypeSymbol)module.GlobalNamespace.GetMember<NamespaceSymbol>("System").GetMembers("ValueTuple").Single(); 28555var type = (NamedTypeSymbol)module.GlobalNamespace.GetMember<NamespaceSymbol>("System").GetMembers("ValueTuple").Single(); 28690var type = (NamedTypeSymbol)module.GlobalNamespace.GetMember<NamespaceSymbol>("System").GetMembers("ValueTuple").Single(); 28975Assert.Equal(expectedAttribute, field.GetAttributes().Single().ToString());
CodeGen\FixedSizeBufferTests.cs (2)
985var bufferType = test.GetTypeMembers().Single(); 1017var bufferType = test.GetTypeMembers().Single();
CodeGen\IndexerTests.cs (1)
255var indexer = @class.Indexers.Single();
CodeGen\SwitchTests.cs (1)
3043var member = pid.GetMembers(PrivateImplementationDetails.SynthesizedStringHashFunctionName).Single();
Emit\CompilationEmitTests.cs (14)
3904var actualAMembers = ((SourceModuleSymbol)m).GlobalNamespace.GetTypeMembers("A1").Single().GetMembers().ToArray(); 3912var actualBMembers = ((SourceModuleSymbol)m).GlobalNamespace.GetTypeMembers("B").Single().GetMembers().ToArray(); 3922var actualCMembers = ((SourceModuleSymbol)m).GlobalNamespace.GetTypeMembers("C1").Single().GetMembers().ToArray(); 3945var actualAMembers = m.GlobalNamespace.GetTypeMembers("A1").Single().GetMembers().ToArray(); 3950var actualBMembers = m.GlobalNamespace.GetTypeMembers("B").Single().GetMembers().ToArray(); 3955var actualCMembers = m.GlobalNamespace.GetTypeMembers("C1").Single().GetMembers().ToArray(); 4020var module = assembly.Modules.Single(); 4056var module = assembly.Modules.Single(); 4086var module = assembly.Modules.Single(); 4117var module = assembly.Modules.Single(); 4148var module = assembly.Modules.Single(); 4179var module = assembly.Modules.Single(); 5215var err = result.Diagnostics.Single(); 5226err = result.Diagnostics.Single();
Emit\EmitCustomModifiers.cs (3)
604var parameter = method.Parameters.Single(); 660var baseParameter = baseMethod.Parameters.Single(); 668var derivedParameter = derivedMethod.Parameters.Single();
Emit\EmitMetadataTests.cs (55)
324Assert.Same(i1, classA.Interfaces().Single()); 424var classA = module.GlobalNamespace.GetTypeMembers("A").Single(); 446var parameter1 = m1.Parameters.Single(); 451Assert.Same(module.GetCorLibType(SpecialType.System_Boolean), m2.Parameters.Single().Type); 452Assert.Same(module.GetCorLibType(SpecialType.System_Char), m3.Parameters.Single().Type); 498var classB = module.GlobalNamespace.GetTypeMembers("B").Single(); 502var classC = module.GlobalNamespace.GetTypeMembers("C").Single(); 506var classD = classC.GetTypeMembers("D").Single(); 507var classE = classC.GetTypeMembers("E").Single(); 508var classF = classC.GetTypeMembers("F").Single(); 509var classH = classC.GetTypeMembers("H").Single(); 518var classG = classC.GetTypeMembers("G").Single(); 519var classK = classC.GetTypeMembers("K").Single(); 548var classA = module.GlobalNamespace.GetTypeMembers("A").Single(); 664var type = module.GlobalNamespace.GetTypeMembers("C").Single(); 736CheckPrivateMembers(module.GlobalNamespace.GetTypeMembers("Types").Single(), isFromSource, true); 737CheckPrivateMembers(module.GlobalNamespace.GetTypeMembers("Fields").Single(), isFromSource, false); 738CheckPrivateMembers(module.GlobalNamespace.GetTypeMembers("Methods").Single(), isFromSource, false); 739CheckPrivateMembers(module.GlobalNamespace.GetTypeMembers("Properties").Single(), isFromSource, false); 779var derivedType = module.GlobalNamespace.GetTypeMembers("Derived").Single(); 810var type = module.GlobalNamespace.GetTypeMembers("I").Single(); 811var method = (MethodSymbol)type.GetMembers("Method").Single(); 813var property = (PropertySymbol)type.GetMembers("Property").Single(); 818type = module.GlobalNamespace.GetTypeMembers("C").Single(); 819method = (MethodSymbol)type.GetMembers("I.Method").Single(); 821property = (PropertySymbol)type.GetMembers("I.Property").Single(); 848var type = module.GlobalNamespace.GetTypeMembers("C").Single(); 1083var type = module.GlobalNamespace.GetTypeMembers("C").Single(); 1086var propertyP = (PropertySymbol)type.GetMembers("P").Single(); 1100var propertyQ = (PropertySymbol)type.GetMembers("Q").Single(); 1114type = module.GlobalNamespace.GetTypeMembers("F").Single(); 1115propertyP = (PropertySymbol)type.GetMembers("P").Single(); 1119propertyQ = (PropertySymbol)type.GetMembers("Q").Single(); 1134var overriddenProperty = module.GlobalNamespace.GetTypeMembers("E").Single().GetMembers("Q").Single(); 1137var overriddenAccessor = module.GlobalNamespace.GetTypeMembers("D").Single().GetMembers("set_Q").Single(); 1158var type = module.GlobalNamespace.GetTypeMembers("C").Single(); 1187var method = containingType.GetMembers(accessor.Name).Single(); 1234var typeA = module.GlobalNamespace.GetTypeMembers("A").Single(); 1236var getMethodA = (MethodSymbol)typeA.GetMembers("get_P").Single(); 1241var typeC = module.GlobalNamespace.GetTypeMembers("C").Single(); 1243var getMethodC = (MethodSymbol)typeC.GetMembers("get_P").Single(); 1278var classC = module.GlobalNamespace.GetTypeMembers("C").Single(); 1304var attribute = backingField.GetAttributes().Single(); 1318var method = property.ContainingType.GetMembers(accessor.Name).Single(); 1331var type = module.GlobalNamespace.GetTypeMembers("E").Single(); 1355var type = module.GlobalNamespace.GetTypeMembers("E").Single(); 2025var c = global.GetTypeMembers("C", 0).Single() as NamedTypeSymbol; 2026var m = c.GetMembers("M").Single() as MethodSymbol; 2070var myDel = global.GetTypeMembers("MyDel", 0).Single() as NamedTypeSymbol; 2074var beginInvoke = myDel.GetMembers("BeginInvoke").Single() as MethodSymbol; 2087var endInvoke = myDel.GetMembers("EndInvoke").Single() as MethodSymbol; 2154CheckInternalMembers(m.GlobalNamespace.GetTypeMembers("Fields").Single(), isFromSource); 2155CheckInternalMembers(m.GlobalNamespace.GetTypeMembers("Methods").Single(), isFromSource);
Emit\InAttributeModifierTests.cs (56)
1654var parameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("Method").Parameters.Single(); 1674var parameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("Method").Parameters.Single(); 1860var parameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetProperty("this[]").Parameters.Single(); 1880var parameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetProperty("this[]").Parameters.Single(); 1961var invokeParameter = type.DelegateInvokeMethod.Parameters.Single(); 2009var parameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("Method").Parameters.Single(); 2029var parameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("Method").Parameters.Single(); 2049var parameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetProperty("this[]").Parameters.Single(); 2069var parameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("op_LogicalNot").Parameters.Single(); 2113var parameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod(".ctor").Parameters.Single(); 2500var parameter = type.GetMethod("M").Parameters.Single(); 2526var parameter = type.GetMethod("M").Parameters.Single(); 2548var parameter = type.GetMethod("M").Parameters.Single(); 2573var parameter = type.GetMethod("M").Parameters.Single(); 2595var parameter = type.GetMethod("M").Parameters.Single(); 2622var implicitParameter = type.GetMethod("M").Parameters.Single(); 2627Assert.Equal("void Parent.M(in modreq(System.Runtime.InteropServices.InAttribute) System.Int32 p)", explicitImplementation.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 2629var explicitParameter = explicitImplementation.Parameters.Single(); 2650var parameter = type.GetMethod("M").Parameters.Single(); 2676var parameter = type.GetMethod("M").Parameters.Single(); 2698var parameter = type.GetMethod("M").Parameters.Single(); 2723var parameter = type.GetMethod("Parent.M").Parameters.Single(); 3199var parameter = type.GetProperty("this[]").Parameters.Single(); 3225var parameter = type.GetProperty("this[]").Parameters.Single(); 3247var parameter = type.GetProperty("this[]").Parameters.Single(); 3273var parameter = type.GetProperty("this[]").Parameters.Single(); 3295var parameter = type.GetProperty("this[]").Parameters.Single(); 3322var implicitParameter = type.GetProperty("this[]").Parameters.Single(); 3327Assert.Equal("void Parent.this[in modreq(System.Runtime.InteropServices.InAttribute) System.Int32 p].set", explicitImplementation.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 3350var parameter = type.GetProperty("this[]").Parameters.Single(); 3376var parameter = type.GetProperty("this[]").Parameters.Single(); 3398var parameter = type.GetProperty("this[]").Parameters.Single(); 3424var parameter = type.GetProperty("Parent.Item").Parameters.Single(); 3671var parameter = module.ContainingAssembly.GetTypeByMetadataName("D").DelegateInvokeMethod.Parameters.Single(); 3743var parameter = module.ContainingAssembly.GetTypeByMetadataName("D").DelegateInvokeMethod.Parameters.Single(); 4172var parentModifier = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").RefCustomModifiers.Single().Modifier; 4196var childModifier = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").RefCustomModifiers.Single().Modifier; 4219var parentModifier = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").RefCustomModifiers.Single().Modifier; 4243var childModifier = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").RefCustomModifiers.Single().Modifier; 4266var parentModifier = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").RefCustomModifiers.Single().Modifier; 4292var explicitModifier = type.GetMethod("Parent.M").RefCustomModifiers.Single().Modifier; 4315var parentModifier = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").RefCustomModifiers.Single().Modifier; 4341var implicitModifier = type.GetMethod("M").RefCustomModifiers.Single().Modifier; 4344var explicitModifier = type.GetMethod("Parent.M").RefCustomModifiers.Single().Modifier; 4367var parentModifier = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").RefCustomModifiers.Single().Modifier; 4394var implicitModifier = type.GetMethod("M").RefCustomModifiers.Single().Modifier; 4397var explicitModifier = type.GetMethod("Parent.M").RefCustomModifiers.Single().Modifier; 4427var attribute = m.RefCustomModifiers.Single().Modifier; 4503Assert.Empty(parentMethod.Parameters.Single().RefCustomModifiers); 4508Assert.Empty(childMethod.Parameters.Single().RefCustomModifiers); 4513AssertSingleInAttributeRequiredModifier(interfaceMethod.Parameters.Single().RefCustomModifiers); 4518AssertSingleInAttributeRequiredModifier(proxyMethod.Parameters.Single().RefCustomModifiers); 4546Assert.Empty(parentMethod.Parameters.Single().RefCustomModifiers); 4554AssertSingleInAttributeRequiredModifier(interfaceMethod.Parameters.Single().RefCustomModifiers); 4559AssertSingleInAttributeRequiredModifier(proxyMethod.Parameters.Single().RefCustomModifiers); 4565var modifier = modifiers.Single();
Emit\NoPiaEmbedTypes.cs (112)
1174var itest1 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest1").Single(); 1196var test2 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("Test2").Single(); 1199Assert.Same(itest1, test2.Interfaces().Single()); 1217var itest3 = module.GlobalNamespace.GetTypeMembers("ITest3").Single(); 1219Assert.Same(itest1, itest3.Interfaces().Single()); 1230var test5 = module.GlobalNamespace.GetTypeMembers("Test5").Single(); 1248var itest6 = module.GlobalNamespace.GetTypeMembers("ITest6").Single(); 1251var itest7 = module.GlobalNamespace.GetTypeMembers("ITest7").Single(); 1254var itest8 = module.GlobalNamespace.GetTypeMembers("ITest8").Single(); 1256Assert.Same(itest8, module.GlobalNamespace.GetTypeMembers("UsePia1").Single().Interfaces().Single()); 1258var test9 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("Test9").Single(); 1313var test10 = module.GlobalNamespace.GetTypeMembers("Test10").Single(); 1337var test11 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("Test11").Single(); 1352var ctor = (PEMethodSymbol)test11.GetMembers(".ctor").Single(); 1369var begin = (PEMethodSymbol)test11.GetMembers("BeginInvoke").Single(); 1385var end = (PEMethodSymbol)test11.GetMembers("EndInvoke").Single(); 1401var invoke = (PEMethodSymbol)test11.GetMembers("Invoke").Single(); 1416var itest13 = module.GlobalNamespace.GetTypeMembers("ITest13").Single(); 1437var itest14 = module.GlobalNamespace.GetTypeMembers("ITest14").Single(); 1447var itest16 = module.GlobalNamespace.GetTypeMembers("ITest16").Single(); 1451var itest17 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest17").Single(); 1485var m17 = (PEMethodSymbol)itest17.GetMembers("M17").Single(); 1499var itest18 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest18").Single(); 1503var itest19 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest19").Single(); 1504var m20 = (PEMethodSymbol)itest19.GetMembers("M20").Single(); 1556var m21 = (PEMethodSymbol)itest19.GetMembers("M21").Single(); 1574var itest21 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest21").Single(); 1575var p1 = (PEPropertySymbol)itest21.GetMembers("P1").Single(); 1581var get_P1 = (PEMethodSymbol)itest21.GetMembers("get_P1").Single(); 1582var set_P1 = (PEMethodSymbol)itest21.GetMembers("set_P1").Single(); 1587var itest22 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest22").Single(); 1588var p2 = (PEPropertySymbol)itest22.GetMembers("P2").Single(); 1590var get_P2 = (PEMethodSymbol)itest22.GetMembers("get_P2").Single(); 1591var set_P2 = (PEMethodSymbol)itest22.GetMembers("set_P2").Single(); 1596var itest23 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest23").Single(); 1597var p3 = (PEPropertySymbol)itest23.GetMembers("P3").Single(); 1599var get_P3 = (PEMethodSymbol)itest23.GetMembers("get_P3").Single(); 1604var itest24 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest24").Single(); 1605var p4 = (PEPropertySymbol)itest24.GetMembers("P4").Single(); 1612var set_P4 = (PEMethodSymbol)itest24.GetMembers("set_P4").Single(); 1617var itest25 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest25").Single(); 1618var e1 = (PEEventSymbol)itest25.GetMembers("E1").Single(); 1623var add_E1 = (PEMethodSymbol)itest25.GetMembers("add_E1").Single(); 1624var remove_E1 = (PEMethodSymbol)itest25.GetMembers("remove_E1").Single(); 1629var itest26 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest26").Single(); 1630var e2 = (PEEventSymbol)itest26.GetMembers("E2").Single(); 1636var add_E2 = (PEMethodSymbol)itest26.GetMembers("add_E2").Single(); 1637var remove_E2 = (PEMethodSymbol)itest26.GetMembers("remove_E2").Single(); 1733var itest28 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest28").Single(); 1736var itest29 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest29").Single(); 1739var m21 = (PEMethodSymbol)itest29.GetMembers("M21").Single(); 1906var itest28 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest28").Single(); 1993var itest28 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest28").Single(); 2203var interface1_Event = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("Interface1_Event").Single(); 2211var goo = (PEEventSymbol)interface1_Event.GetMembers("Goo").Single(); 2213var interfaceEvents = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("InterfaceEvents").Single(); 2221var goo1 = (PEMethodSymbol)interfaceEvents.GetMembers("Goo").Single(); 2710var itest29 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest29").Single(); 2715var itest30 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest30").Single(); 2782var itest29 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest29").Single(); 2787var itest30 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest30").Single(); 2846var test31 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("Test31").Single(); 2907var itest30 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest30").Single(); 2912Assert.Equal("System.Int32[] ITest30.M1()", itest30.GetMembers("M1").Single().ToTestDisplayString()); 2973var itest30 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest30").Single(); 2975var m1 = (PEMethodSymbol)itest30.GetMembers("M1").Single(); 3039var itest30 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest30").Single(); 3041var m1 = (PEMethodSymbol)itest30.GetMembers("M1").Single(); 3116var itest30 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest30").Single(); 3118var m1 = (PEMethodSymbol)itest30.GetMembers("M1").Single(); 3193var itest30 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest30").Single(); 3195var m1 = (PEMethodSymbol)itest30.GetMembers("M1").Single(); 3257var itest30 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest30").Single(); 3259var m1 = (PEMethodSymbol)itest30.GetMembers("M1").Single(); 3319var itest30 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest30").Single(); 3321var m1 = (PEMethodSymbol)itest30.GetMembers("M1").Single(); 3386var itest30 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest30").Single(); 3388var m1 = (PEMethodSymbol)itest30.GetMembers("M1").Single(); 3454var itest30 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest30").Single(); 3456var m1 = (PEMethodSymbol)itest30.GetMembers("M1").Single(); 3460var m2 = (PEMethodSymbol)itest30.GetMembers("M2").Single(); 3545var itest30 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest30").Single(); 3547var m1 = (PEMethodSymbol)itest30.GetMembers("M1").Single(); 3604var myDelegate = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("MyDelegate").Single(); 3669var itest30 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest30").Single(); 3671var m1 = (PEMethodSymbol)itest30.GetMembers("M1").Single(); 4171var itest33 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest33").Single(); 4172var m1 = (PEMethodSymbol)itest33.GetMembers("M1").Single(); 4174var itest34 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest34").Single(); 4175var m2 = (PEMethodSymbol)itest34.GetMembers("M2").Single(); 4177var itest35 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest35").Single(); 4178var m3 = (PEMethodSymbol)itest35.GetMembers("M3").Single(); 4255var itest33 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest33").Single(); 4256var m1 = (PEMethodSymbol)itest33.GetMembers("M1").Single(); 4258var itest34 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest34").Single(); 4259var m2 = (PEMethodSymbol)itest34.GetMembers("M2").Single(); 4261var itest35 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest35").Single(); 4262var m3 = (PEMethodSymbol)itest35.GetMembers("M3").Single(); 4332var itest33 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest33").Single(); 4335var itest34 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest34").Single(); 4338var itest35 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest35").Single(); 4397var itest33 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest33").Single(); 4398var m1 = (PEMethodSymbol)itest33.GetMembers("M1").Single(); 4400var usePia7 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("UsePia7").Single(); 4401var m1Impl = (PEMethodSymbol)usePia7.GetMembers("ITest33.M1").Single(); 4462var itest33 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest33").Single(); 4522var itest33 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest33").Single(); 4582var itest33 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest33").Single(); 4648var itest33 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest33").Single(); 5527var IEventsBase = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("IEventsBase").Single(); 5959Assert.Equal("System.Runtime.CompilerServices.DateTimeConstantAttribute(987654321)", p.GetAttributes().Single().ToString());
Emit\OptionalArgumentsTests.cs (1)
464var attribute = ((PEModuleSymbol)module).GetCustomAttributesForToken(field.Handle).Single();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (70)
CodeGen\CodeGenMethodGroupConversionCachingTests.cs (1)
6389m.GlobalNamespace.GetMember<NamedTypeSymbol>("Test1.<M2>O__0_0").TypeParameters.Single().GetAttributes().Select(a => a.ToString()));
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\EditAndContinue\EditAndContinueClosureTests.cs (4)
991var ctor0 = compilation0.GetMember<NamedTypeSymbol>("C").InstanceConstructors.Single(); 992var ctor1 = compilation1.GetMember<NamedTypeSymbol>("C").InstanceConstructors.Single(); 1058var ctor0 = compilation0.GetMember<NamedTypeSymbol>("C").InstanceConstructors.Single(); 1059var ctor1 = compilation1.GetMember<NamedTypeSymbol>("C").InstanceConstructors.Single();
Emit\EditAndContinue\EditAndContinueStateMachineTests.cs (2)
1552var ctor0 = compilation0.GetMember<NamedTypeSymbol>("C").InstanceConstructors.Single(); 1553var ctor1 = compilation1.GetMember<NamedTypeSymbol>("C").InstanceConstructors.Single();
Emit\EditAndContinue\EditAndContinueTestBase.cs (1)
76return method0.DeclaringSyntaxReferences.Single().SyntaxTree.GetRoot().DescendantNodes().Single(n => n.IsKind(kind));
Emit\EditAndContinue\EditAndContinueTests.cs (5)
7328var method0 = compilation0.GetMember<NamedTypeSymbol>("C").InstanceConstructors.Single(); 7329var method1 = compilation1.GetMember<NamedTypeSymbol>("C").InstanceConstructors.Single(); 7428var cctor1 = compilation1.GetMember<NamedTypeSymbol>("I").StaticConstructors.Single(); 7441var cctor2 = compilation2.GetMember<NamedTypeSymbol>("I").StaticConstructors.Single(); 11216}", methodToken: diff1.EmitResult.UpdatedMethods.Single());
Emit\EditAndContinue\LocalSlotMappingTests.cs (16)
1826", methodToken: diff1.EmitResult.UpdatedMethods.Single()); 2295}", methodToken: diff1.EmitResult.UpdatedMethods.Single()); 2565}", methodToken: diff2.EmitResult.UpdatedMethods.Single()); 2956}", methodToken: diff1.EmitResult.UpdatedMethods.Single()); 4268", methodToken: diff1.EmitResult.UpdatedMethods.Single()); 4324}", methodToken: diff1.EmitResult.UpdatedMethods.Single()); 4379", methodToken: diff1.EmitResult.UpdatedMethods.Single()); 4431", methodToken: diff1.EmitResult.UpdatedMethods.Single()); 4487}", methodToken: diff1.EmitResult.UpdatedMethods.Single()); 4547}", methodToken: diff1.EmitResult.UpdatedMethods.Single()); 4625", methodToken: diff1.EmitResult.UpdatedMethods.Single()); 4716", methodToken: diff1.EmitResult.UpdatedMethods.Single()); 4781", methodToken: diff1.EmitResult.UpdatedMethods.Single()); 4841", methodToken: diff1.EmitResult.UpdatedMethods.Single()); 4931", methodToken: diff1.EmitResult.UpdatedMethods.Single()); 5015", methodToken: diff1.EmitResult.UpdatedMethods.Single());
Emit\EditAndContinue\SymbolMatcherTests.cs (1)
1532Assert.Equal("<>f__AnonymousDelegate0", anonymousDelegates0.Single().Value.Single().Name);
Emit\NumericIntPtrTests.cs (5)
11177var tree = comp.SyntaxTrees.Single(); 11200var tree = comp.SyntaxTrees.Single(); 11228var tree = comp.SyntaxTrees.Single(); 11253var tree = comp.SyntaxTrees.Single(); 11298var tree = comp.SyntaxTrees.Single();
Emit\UnmanagedTypeModifierTests.cs (25)
639var parentTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 645var childTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").TypeParameters.Single(); 674var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 687var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").TypeParameters.Single(); 720var parentTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 726var childTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").TypeParameters.Single(); 752var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 765var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").TypeParameters.Single(); 795var parentTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 801var childTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").TypeParameters.Single(); 827var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 840var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").TypeParameters.Single(); 870var parentTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 876var childTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").TypeParameters.Single(); 902var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 915var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("M").TypeParameters.Single(); 945var parentTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 951var childTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("Parent.M").TypeParameters.Single(); 978var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Parent").GetMethod("M").TypeParameters.Single(); 991var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Child").GetMethod("Parent.M").TypeParameters.Single(); 1037var delegateTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("D`1").TypeParameters.Single(); 1043var lambdaTypeParameter = module.ContainingAssembly.GetTypeByMetadataName("Program").GetTypeMember("<>c__DisplayClass0_0").TypeParameters.Single(); 1064var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("D`1").TypeParameters.Single(); 1090var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Program").GetTypeMember("<>c__DisplayClass0_0").TypeParameters.Single(); 1446var typeParameter = c.GlobalNamespace.GetTypeMember("TestRef").GetMethod("M").TypeParameters.Single();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1851)
Attributes\AttributeTests.cs (42)
349var attribute = newLibComp.SourceAssembly.GetAttributes().Single(); // GetAttributes binds all attributes 712Assert.Equal("M0", attrs.Single().ConstructorArguments.Single().Value); 1037Assert.Equal("a", arguments1[2].Values.Single().Value); 1128attributeData = (SourceAttributeData)comp.GetMember("Program.M1").GetAttributes().Single(); 1132attributeData = (SourceAttributeData)comp.GetMember("Program.M2").GetAttributes().Single(); 1136attributeData = (SourceAttributeData)comp.GetMember("Program.M3").GetAttributes().Single(); 1140attributeData = (SourceAttributeData)comp.GetMember("Program.M4").GetAttributes().Single(); 1144attributeData = (SourceAttributeData)comp.GetMember("Program.M5").GetAttributes().Single(); 1148attributeData = (SourceAttributeData)comp.GetMember("Program.M6").GetAttributes().Single(); 1634var typeI = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("I").Single(); 1820Assert.Equal("B(3)", prop3.GetAttributes().Single().ToString()); 1828Assert.Equal("B(4)", prop4.GetAttributes().Single().ToString()); 2464Assert.Equal("A(2)", prop1.GetAttributes().Single().ToString()); 2668Assert.Equal("DD", event4.GetFieldAttributes().Single().AttributeClass.Name); 2690Assert.Equal("II", GetSingleAttributeName(event9.AddMethod.Parameters.Single())); 2695Assert.Equal("JJ", event10.AddMethod.GetReturnTypeAttributes().Single().AttributeClass.Name); 2827return symbol.GetAttributes().Single().AttributeClass.Name; 3419var syntax = attrs.Single().ApplicationSyntaxReference.GetSyntax(); 5754var attr = c.GetAttributes().Single(); 5798var attr = c.GetAttributes().Single(); 5826var classTypeParameter = @class.TypeParameters.Single(); 5828var methodTypeParameter = method.TypeParameters.Single(); 5832var attribute = methodTypeParameter.GetAttributes().Single(); 7536var tree = compilation.SyntaxTrees.Single(); 7577var tree = compilation.SyntaxTrees.Single(); 8363Assert.Equal("Attr2", attrs.Single().AttributeClass.Name); 9871var attrs = methods.Select(m => m.GetAttributes().Single()).ToArray(); 9999Assert.True(cc.TypeParameters.Single().GetAttributes().IsEmpty); 10000Assert.Equal("XAttribute", mm.TypeParameters.Single().GetAttributes().Single().ToString()); 10242Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 10246Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 10263Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 10271Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 10292Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 10296Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 10318Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 10322Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 10344Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 10348Assert.False(comp.GlobalNamespace.GetTypeMember("C").GetAttributes().Single().AttributeClass.IsGenericType); 10369var attribute = m.GetAttributes().Single();
Attributes\AttributeTests_CallerInfoAttributes.cs (9)
1944var attributeArguments = namedType.GetAttributes().Single().ConstructorArguments; 1976var attributeArguments = namedType.GetAttributes().Single().ConstructorArguments; 2008var attributeArguments = namedType.GetAttributes().Single().ConstructorArguments; 2041var attributeArguments = namedType.GetAttributes().Single().ConstructorArguments; 2299var arguments = compilation.GetTypeByMetadataName("Program").GetAttributes().Single().CommonConstructorArguments; 4406var attr = ctor.Parameters.Single().GetAttributes().Single(); 4436var attr = ctor.Parameters.Single().GetAttributes()[0]; 5949var indexer = (PropertySymbol)module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single();
Attributes\AttributeTests_Dynamic.cs (2)
538Assert.Equal("System.Boolean[]", dynamicAttribute.AttributeConstructor.Parameters.Single().TypeWithAnnotations.ToTestDisplayString()); 540TypedConstant argument = dynamicAttribute.CommonConstructorArguments.Single();
Attributes\AttributeTests_Embedded.cs (2)
359AssertEx.Equal("Microsoft.CodeAnalysis.EmbeddedAttribute@<unknown>", embeddedAttributeFile.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 462Assert.Equal("Microsoft.CodeAnalysis.EmbeddedAttribute", embeddedAttribute.GetAttributes().Single().AttributeClass.ToTestDisplayString());
Attributes\AttributeTests_IsByRefLike.cs (2)
674var attribute = type.GetAttributes().Single(); 759var attribute = type.GetAttributes().Single();
Attributes\AttributeTests_IsUnmanaged.cs (19)
40var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("M").TypeParameters.Single(); 64var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test`1").TypeParameters.Single(); 94var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("<M>g__N|0_0").TypeParameters.Single(); 116var typeParameter = module.GlobalNamespace.GetTypeMember("D").TypeParameters.Single(); 143var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("M").TypeParameters.Single(); 169var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test`1").TypeParameters.Single(); 205var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("<M>g__N|0_0").TypeParameters.Single(); 233var typeParameter = module.GlobalNamespace.GetTypeMember("D").TypeParameters.Single(); 260var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("M").TypeParameters.Single(); 286var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test`1").TypeParameters.Single(); 323var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("<M>g__N|0_0").TypeParameters.Single(); 352var typeParameter = module.GlobalNamespace.GetTypeMember("D").TypeParameters.Single(); 373var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("M").TypeParameters.Single(); 392var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test`1").TypeParameters.Single(); 420var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("<M>g__N|0_0").TypeParameters.Single(); 440var typeParameter = module.GlobalNamespace.GetTypeMember("D").TypeParameters.Single(); 649var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test2`1").TypeParameters.Single(); 732var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test1`1").TypeParameters.Single(); 746var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test2`1").TypeParameters.Single();
Attributes\AttributeTests_NativeInteger.cs (1)
1494var member = type.GetMembers("F").Single();
Attributes\AttributeTests_Nullable.cs (11)
528CompileAndVerify(comp, symbolValidator: m => CheckAttribute(m.GlobalNamespace.GetMember("A.F").GetAttributes().Single(), "A")); 538CompileAndVerify(comp, symbolValidator: m => CheckAttribute(m.GlobalNamespace.GetMember("B.G").GetAttributes().Single(), "B")); 563CompileAndVerify(comp, symbolValidator: m => CheckAttribute(m.GlobalNamespace.GetMember("A.F").GetAttributes().Single(), "A")); 573CompileAndVerify(comp, symbolValidator: m => CheckAttribute(m.GlobalNamespace.GetMember("B.G").GetAttributes().Single(), "A")); 802var field = (FieldSymbol)type.GetMembers("F").Single(); 816var field = (FieldSymbol)type.GetMembers("F").Single(); 975var field = (FieldSymbol)type.GetMembers("F").Single(); 1671var typeParameter = module.GlobalNamespace.GetMember<NamedTypeSymbol>(typeName).TypeParameters.Single(); 1742var typeParameter = module.GlobalNamespace.GetMember<NamedTypeSymbol>(typeName).TypeParameters.Single(); 1798var typeParameter = module.GlobalNamespace.GetMember<NamedTypeSymbol>(typeName).TypeParameters.Single(); 4995var method = (MethodSymbol)type.GetMembers("F").Single();
Attributes\AttributeTests_RefReadOnly.cs (49)
41var parameter = method.GetParameters().Single(); 67var parameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("M").GetParameters().Single(); 123var parameter = method.GetParameters().Single(); 231var parameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod(".ctor").Parameters.Single(); 250var parameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod(".ctor").Parameters.Single(); 275var parameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod(".ctor").Parameters.Single(); 405var parameter = indexer.GetParameters().Single(); 425var parameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetProperty("this[]").GetParameters().Single(); 477var parameter = indexer.GetParameters().Single(); 504var parameter = method.GetParameters().Single(); 521var parameter = module.ContainingAssembly.GetTypeByMetadataName("D").DelegateInvokeMethod.GetParameters().Single(); 564var parameter = method.GetParameters().Single(); 601var parameter = method.GetParameters().Single(); 625var parameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("<M>g__Inner|0_0").GetParameters().Single(); 689var parameter = method.GetParameters().Single(); 728var parameter = method.GetParameters().Single(); 756var parameter = module.GlobalNamespace.GetMember<MethodSymbol>("Test.<>c.<M1>b__0_0").GetParameters().Single(); 822var parameter = method.GetParameters().Single(); 1160var parameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("M").GetParameters().Single(); 1311var parameter = method.Parameters.Single(); 1348var parameter = method.Parameters.Single(); 1376var tree = compilation.SyntaxTrees.Single(); 1418var tree = compilation.SyntaxTrees.Single(); 1447var tree = compilation.SyntaxTrees.Single(); 1474var tree = compilation.SyntaxTrees.Single(); 1593Assert.Empty(method.Parameters.Single().GetAttributes()); 1604Assert.Empty(indexer.Parameters.Single().GetAttributes()); 1635Assert.Empty(method.Parameters.Single().GetAttributes()); 1646Assert.Empty(indexer.Parameters.Single().GetAttributes()); 1679Assert.Empty(method.Parameters.Single().GetAttributes()); 1690Assert.Empty(indexer.Parameters.Single().GetAttributes()); 1728Assert.Empty(method.Parameters.Single().GetAttributes()); 1735Assert.Empty(indexer.Parameters.Single().GetAttributes()); 1775Assert.Empty(method.Parameters.Single().GetAttributes()); 1782Assert.Empty(indexer.Parameters.Single().GetAttributes()); 1819Assert.Empty(method.Parameters.Single().GetAttributes()); 1826Assert.Empty(indexer.Parameters.Single().GetAttributes()); 1868Assert.Empty(method.Parameters.Single().GetAttributes()); 1875Assert.Empty(indexer.Parameters.Single().GetAttributes()); 1908Assert.Empty(method.Parameters.Single().GetAttributes()); 1919Assert.Empty(indexer.Parameters.Single().GetAttributes()); 1977Assert.Empty(method.Parameters.Single().GetAttributes()); 1984Assert.Empty(indexer.Parameters.Single().GetAttributes()); 2026Assert.Empty(method.Parameters.Single().GetAttributes()); 2033Assert.Empty(indexer.Parameters.Single().GetAttributes()); 2066Assert.Empty(method.Parameters.Single().GetAttributes()); 2073Assert.Empty(indexer.Parameters.Single().GetAttributes()); 2108Assert.Empty(method.Parameters.Single().GetAttributes()); 2115Assert.Empty(indexer.Parameters.Single().GetAttributes());
Attributes\AttributeTests_Synthesized.cs (19)
65Assert.Equal("System.Int32", attribute.AttributeConstructor.Parameters.Single().TypeWithAnnotations.ToTestDisplayString()); 93Assert.Equal("System.Diagnostics.DebuggableAttribute.DebuggingModes", attribute.AttributeConstructor.Parameters.Single().TypeWithAnnotations.ToTestDisplayString()); 148var s = (NamedTypeSymbol)comp.GlobalNamespace.GetMembers("S").Single(); 199Assert.Equal("CompilerGeneratedAttribute", attributes.Single().AttributeClass.Name); 229Assert.Equal("CompilerGeneratedAttribute", peModule.GetCustomAttributesForToken(((PEMethodSymbol)p.GetMethod).Handle).Single().AttributeClass.Name); 230Assert.Equal("CompilerGeneratedAttribute", peModule.GetCustomAttributesForToken(((PEMethodSymbol)p.SetMethod).Handle).Single().AttributeClass.Name); 238Assert.Equal("CompilerGeneratedAttribute", peModule.GetCustomAttributesForToken(((PEMethodSymbol)e.AddMethod).Handle).Single().AttributeClass.Name); 239Assert.Equal("CompilerGeneratedAttribute", peModule.GetCustomAttributesForToken(((PEMethodSymbol)e.RemoveMethod).Handle).Single().AttributeClass.Name); 585var parameter = baseMethodWrapper.Parameters.Single(); 628var parameter = baseMethodWrapper.Parameters.Single(); 631var typeParameter = baseMethodWrapper.TypeParameters.Single(); 651var typeParam = c2.TypeParameters.Single(); 1126VerifyDebuggableAttribute(module.GetAttributes().Single(), optimizationLevel, isSynthesized: false); 1200VerifyCompilationRelaxationsAttribute(module.GetAttributes().Single(), isSynthesized: false); 1238VerifyDebuggableAttribute(module.GetAttributes().Single(), options.OptimizationLevel, isSynthesized: false); 1613var unverifiableCode = module.GetAttributes().Single(); 1812Assert.Equal("DebuggerStepThroughAttribute", asyncMethod.GetAttributes().Single().AttributeClass.Name); 1846var iteratorAttribute = iteratorMethod.GetAttributes().Single(); 1876var iteratorAttribute = iteratorMethod.GetAttributes().Single();
Attributes\AttributeTests_Tuples.cs (13)
488var firstTuple = field6Type.TypeArguments().Single(); 536ValidateTupleNameAttribute(method2.Parameters.Single().GetAttributes(), 547ValidateTupleNameAttribute(method3.Parameters.Single().GetAttributes(), 558ValidateTupleNameAttribute(method4.Parameters.Single().GetAttributes(), 571ValidateTupleNameAttribute(method5.Parameters.Single().GetAttributes(), expectedTupleNamesAttribute: false); 608ValidateTupleNameAttribute(indexer.Parameters.Single().GetAttributes(), 629Assert.Equal("System.String[]", tupleAttr.AttributeConstructor.Parameters.Single().TypeWithAnnotations.ToTestDisplayString()); 637var arg = tupleAttr.CommonConstructorArguments.Single(); 938var typeParam = t.TypeParameters.Single(); 939var constraint = (NamedTypeSymbol)typeParam.ConstraintTypes().Single(); 940var typeArg = constraint.TypeArguments().Single(); 1039var interfaceImpl = t.Interfaces().Single(); 1040var typeArg = interfaceImpl.TypeArguments().Single();
Attributes\AttributeTests_WellKnownAttributes.cs (24)
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(); 9741var param = method.Parameters.Single(); 11438var lambda = exprs.SelectAsArray(e => model.GetSymbolInfo(e).Symbol).Single().GetSymbol<LambdaSymbol>(); 11463var lambda = exprs.SelectAsArray(e => model.GetSymbolInfo(e).Symbol).Single().GetSymbol<LambdaSymbol>(); 11494var lambda = exprs.SelectAsArray(e => model.GetSymbolInfo(e).Symbol).Single().GetSymbol<LambdaSymbol>(); 13541var attribute = module.ContainingAssembly.GetTypeByMetadataName("Program").GetMethod("Test").Parameters.Single().GetAttributes().Single(); 13546Assert.Equal("transformFlags", attribute.AttributeConstructor.Parameters.Single().Name);
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 (2)
643var suppression = diagnostic.ProgrammaticSuppressionInfo.Suppressions.Single(); 647Assert.Equal(suppression, suppressionInfo.ProgrammaticSuppressions.Single());
Diagnostics\GetDiagnosticsTests.cs (13)
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(); 642Assert.False(diagnostics.Single().IsSuppressed); 654Assert.False(analyzerDiagnostics.Single().IsSuppressed); 685ImmutableDictionary<object, AnalyzerConfigOptions>.Empty.Add(compilation.SyntaxTrees.Single(), analyzerConfigOptions), 697var diagnostic = diagnostics.Single(); 745var diagnostic = analyzerDiagnostics.Single(); 1561var compilationDiagnostic = compilationDiagnostics.Single(); 1566var analyzerDiagnostic = analyzerDiagnostics.Single(); 1587analyzerDiagnostic = analyzerDiagnostics.Single(); 1589var suppression = analyzerDiagnostic.ProgrammaticSuppressionInfo.Suppressions.Single();
FieldKeywordTests.cs (4)
1274var tree = comp.SyntaxTrees.Single(); 1332var tree = comp.SyntaxTrees.Single(); 10474var tree = comp.SyntaxTrees.Single(); 10508var tree = comp.SyntaxTrees.Single();
FirstClassSpanTests.cs (19)
2821var tree = comp.SyntaxTrees.Single(); 2854var tree = comp.SyntaxTrees.Single(); 5030var tree = comp.SyntaxTrees.Single(); 5038AssertEx.Equal("System.Int32 System.Span<System.Int32>.M(System.Int32 y)", lookupResult.Single().ToTestDisplayString()); 6753var tree = comp.SyntaxTrees.Single(); 6770var arrayType = comp.GetMember<MethodSymbol>("C.M").GetPublicSymbol().Parameters.Single().Type; 6803var tree = comp.SyntaxTrees.Single(); 6820var arrayType = comp.GetMember<MethodSymbol>("C.M").GetPublicSymbol().Parameters.Single().Type; 6853var tree = comp.SyntaxTrees.Single(); 6870var arrayType = comp.GetMember<MethodSymbol>("C.M").GetPublicSymbol().Parameters.Single().Type; 6903var tree = comp.SyntaxTrees.Single(); 6920var arrayType = comp.GetMember<MethodSymbol>("C.M").GetPublicSymbol().Parameters.Single().Type; 6952var tree = comp.SyntaxTrees.Single(); 6969var arrayType = comp.GetMember<MethodSymbol>("C.M").GetPublicSymbol().Parameters.Single().Type; 6993var tree = comp.SyntaxTrees.Single(); 7001var spanType = methodSymbol.Parameters.Single().Type; 7008var arrayType = comp.GetMember<MethodSymbol>("C.M").GetPublicSymbol().Parameters.Single().Type; 8875var invocation = comp.SyntaxTrees.Single().GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().Single(); 8884symbol = info.CandidateSymbols.Single();
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 (4)
906var attr = c!.GetAttributes().Single(); 997attrs[1].Single().AttributeConstructor.ToTestDisplayString()); 1101m.ContainingAssembly.GetTypeByMetadataName("C")!.GetAttributes().Single().AttributeConstructor.ToTestDisplayString()); 1144m.ContainingAssembly.GetTypeByMetadataName("C")!.GetAttributes().Single().AttributeConstructor.ToTestDisplayString());
PartialEventsAndConstructorsTests.cs (27)
1985var tree = comp.SyntaxTrees.Single(); 2009Assert.NotEqual(defSymbol.Locations.Single(), implSymbol.Locations.Single()); 2027Assert.NotEqual(defSymbol.Locations.Single(), implSymbol.Locations.Single()); 2048Assert.NotEqual(defSymbol.Locations.Single(), implSymbol.Locations.Single()); 2067var tree = comp.SyntaxTrees.Single(); 2085Assert.NotEqual(defSymbol.Locations.Single(), implSymbol.Locations.Single()); 2116Assert.NotEqual(defSymbol.Locations.Single(), implSymbol.Locations.Single()); 2142var tree = comp.SyntaxTrees.Single(); 2155Assert.Same(implSymbol, ((IMethodSymbol)defSymbol.ContainingSymbol).PartialImplementationPart!.Parameters.Single()); 2156Assert.Same(defSymbol, ((IMethodSymbol)implSymbol.ContainingSymbol).PartialDefinitionPart!.Parameters.Single()); 2158Assert.NotEqual(defSymbol.Locations.Single(), implSymbol.Locations.Single()); 3078AssertEx.Equal("x", indexer.Parameters.Single().Name); 3260var ctorParam = ctor.GetParameters().Single(); 3382AssertEx.Equal(["A(23)"], e.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 3385AssertEx.Equal(["A(24)"], e.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 3393AssertEx.Equal(["A(23)"], eImpl.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 3396AssertEx.Equal(["A(24)"], eImpl.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 3403AssertEx.Equal(["A(22)", "A(21)"], f.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 3406AssertEx.Equal(["A(22)", "A(21)"], f.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 3414AssertEx.Equal(["A(22)", "A(21)"], fImpl.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 3417AssertEx.Equal(["A(22)", "A(21)"], fImpl.RemoveMethod.Parameters.Single().GetAttributes().ToStrings());
RefReadonlyParameterTests.cs (49)
129var p = m.GlobalNamespace.GetMember<MethodSymbol>("C.M").Parameters.Single(); 158var p = m.GlobalNamespace.GetMember<MethodSymbol>("C.M").Parameters.Single(); 332var p = m.GlobalNamespace.GetMember<MethodSymbol>("C.M").Parameters.Single(); 441var p = comp.GlobalNamespace.GetMember<MethodSymbol>("C.M").Parameters.Single(); 529var p = comp.GlobalNamespace.GetMember<MethodSymbol>("C.M").Parameters.Single(); 549var p = m.GlobalNamespace.GetMember<MethodSymbol>("C.M").Parameters.Single(); 570var p = m.GlobalNamespace.GetMember<MethodSymbol>("C.M").Parameters.Single(); 591var p = m.GlobalNamespace.GetMember<MethodSymbol>("C..ctor").Parameters.Single(); 643var p = m.GlobalNamespace.GetMember<MethodSymbol>("C..ctor").Parameters.Single(); 666var p = ctor.Parameters.Single(); 688var p = ctor.Parameters.Single(); 709var p = ctor.Parameters.Single(); 822var p = m.GlobalNamespace.GetMember<MethodSymbol>("D.Invoke").Parameters.Single(); 845var p = m.GlobalNamespace.GetMember<MethodSymbol>("Program.<>c.<<Main>$>b__0_0").Parameters.Single(); 869var p = m.GlobalNamespace.GetMember<MethodSymbol>("Program.<<Main>$>g__local|0_0").Parameters.Single(); 894var p = m.GlobalNamespace.GetMember<MethodSymbol>("<>A{00000004}.Invoke").Parameters.Single(); 919var p = m.GlobalNamespace.GetMember<MethodSymbol>("C.M").Parameters.Single(); 921var p2 = ptr.Signature.Parameters.Single(); 973var p = ptr.Signature.Parameters.Single(); 1070var p = ptr.Signature.Parameters.Single(); 1074var m = p.RefCustomModifiers.Single(); 1122var p = ptr.Signature.Parameters.Single(); 1175var p = ptr.Signature.Parameters.Single(); 1224var p = ptr.Signature.Parameters.Single(); 1250var p = m.GlobalNamespace.GetMember<MethodSymbol>("C.M").Parameters.Single(); 1252var p2 = ptr.Signature.Parameters.Single(); 1442var f = ((CSharpCompilation)comp).GetMember<MethodSymbol>("C.M").Parameters.Single(); 1443var p = ((FunctionPointerTypeSymbol)f.Type).Signature.Parameters.Single(); 1444var mod = p.RefCustomModifiers.Single(); 1499var p = m.GlobalNamespace.GetMember<MethodSymbol>("C.M").Parameters.Single(); 1501var p2 = ptr.Signature.Parameters.Single(); 1503return p2.RefCustomModifiers.Single().Modifier; 1524VerifyRefReadonlyParameter(symbol!.Signature.Parameters.Single(), customModifiers: VerifyModifiers.RequiresLocation); 1643var p = comp.GlobalNamespace.GetMember<MethodSymbol>("C.M").Parameters.Single(); 1664var p = comp.GlobalNamespace.GetMember<MethodSymbol>("C.M").Parameters.Single(); 1683var p = comp.GlobalNamespace.GetMember<MethodSymbol>("C.M").Parameters.Single(); 5884var p = m.GlobalNamespace.GetMember<MethodSymbol>("C.M").Parameters.Single(); 5927var p = m.GlobalNamespace.GetMember<MethodSymbol>("C.M").Parameters.Single(); 5989var p = m.GlobalNamespace.GetMember<PropertySymbol>("C.this[]").Parameters.Single(); 6032var p = m.GlobalNamespace.GetMember<MethodSymbol>("B.M").Parameters.Single(); 6697Assert.Equal("I.M(in int)", m1.ExplicitInterfaceImplementations.Single().ToDisplayString()); 6704Assert.Equal("I.M(ref readonly int)", m2.ExplicitInterfaceImplementations.Single().ToDisplayString()); 7097var tree = comp.SyntaxTrees.Single(); 7103Assert.Equal(refKind, methodFromCref!.Parameters.Single().RefKind); 7104var methodFromClass = comp.GetMembers("C.M").Cast<MethodSymbol>().Single(m => m.Parameters.Single().RefKind == refKind); 7125var tree = comp.SyntaxTrees.Single(); 7131Assert.Equal(RefKind.RefReadOnlyParameter, methodFromCref!.Parameters.Single().RefKind); 7132var methodFromClass = comp.GetMembers("C.M").Cast<MethodSymbol>().Single(m => m.Parameters.Single().RefKind == RefKind.RefReadOnlyParameter); 7171var parameter = method.Parameters.Single();
RefStructInterfacesTests.cs (135)
4377var t = c.TypeParameters.Single(); 4430var t = method.TypeParameters.Single(); 4483var t = c.TypeParameters.Single(); 4491var dt = d.TypeParameters.Single(); 4517var ct = c.TypeParameters.Single(); 4546var t = c.TypeParameters.Single(); 4568var t = c.TypeParameters.Single(); 4600var t = c.TypeParameters.Single(); 4626var t = c.TypeParameters.Single(); 4658var t = c.TypeParameters.Single(); 4693var t = method.TypeParameters.Single(); 4730var t = method.TypeParameters.Single(); 4756var t = c.TypeParameters.Single(); 4785var t = method.TypeParameters.Single(); 4822var t = method.TypeParameters.Single(); 4851var t = c.TypeParameters.Single(); 4873var t = c.TypeParameters.Single(); 4902var t = c.TypeParameters.Single(); 4924var t = c.TypeParameters.Single(); 4952var t = c.TypeParameters.Single(); 4958Assert.Equal("I1", t.ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString()); 4979var t = c.TypeParameters.Single(); 4985Assert.Equal("I1", t.ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString()); 5010var t = c.TypeParameters.Single(); 5016Assert.Equal("C1", t.ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString()); 5039var t = c.TypeParameters.Single(); 5064var t = c.TypeParameters.Single(); 5070Assert.Equal("System.Enum", t.ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString()); 5093var t = c.TypeParameters.Single(); 5117var t = c.TypeParameters.Single(); 5144var t = c.TypeParameters.Single(); 5165var t = c.TypeParameters.Single(); 5186var t = c.TypeParameters.Single(); 5211var t = c.TypeParameters.Single(); 5236var t = c.TypeParameters.Single(); 5261var t = method.TypeParameters.Single(); 5290var t = method.TypeParameters.Single(); 5319var t = method.TypeParameters.Single(); 5348var t = method.TypeParameters.Single(); 5377var t = method.TypeParameters.Single(); 5421var t1 = method1.TypeParameters.Single(); 5425var t2 = method2.TypeParameters.Single(); 5460var t1 = method1.TypeParameters.Single(); 5464var t2 = method2.TypeParameters.Single(); 5515var t1 = method1.TypeParameters.Single(); 5517Assert.Equal("C", t1.ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString()); 5520var t2 = method2.TypeParameters.Single(); 5522Assert.Equal("C", t2.ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString()); 5558var t1 = method1.TypeParameters.Single(); 5562var t2 = method2.TypeParameters.Single(); 5593var t1 = method1.TypeParameters.Single(); 5597var t2 = method2.TypeParameters.Single(); 5644var t1 = method1.TypeParameters.Single(); 5646Assert.Equal("C", t1.ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString()); 5649var t2 = method2.TypeParameters.Single(); 5651Assert.Equal("C", t2.ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString()); 5764var t = c.TypeParameters.Single(); 5861Assert.Equal("I1", s1.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 6628var tree = comp.SyntaxTrees.Single(); 6765var tree = comp.SyntaxTrees.Single(); 6881var tree = comp.SyntaxTrees.Single(); 7013var tree = comp.SyntaxTrees.Single(); 7142var tree = comp.SyntaxTrees.Single(); 7472var tree = comp.SyntaxTrees.Single(); 7662var tree = comp.SyntaxTrees.Single(); 7881var tree = comp.SyntaxTrees.Single(); 8075var tree = comp.SyntaxTrees.Single(); 8268var tree = comp.SyntaxTrees.Single(); 8441var tree = comp.SyntaxTrees.Single(); 8547var tree = comp.SyntaxTrees.Single(); 8931var tree = comp.SyntaxTrees.Single(); 9135var tree = comp.SyntaxTrees.Single(); 9331var tree = comp.SyntaxTrees.Single(); 9499var tree = comp.SyntaxTrees.Single(); 9714var tree = comp.SyntaxTrees.Single(); 9935var tree = comp.SyntaxTrees.Single(); 10150var tree = comp.SyntaxTrees.Single(); 10347var tree = comp.SyntaxTrees.Single(); 10442var tree = comp.SyntaxTrees.Single(); 10542var tree = comp.SyntaxTrees.Single(); 10739var tree = comp.SyntaxTrees.Single(); 10979var tree = comp.SyntaxTrees.Single(); 11198var tree = comp.SyntaxTrees.Single(); 11422var tree = comp.SyntaxTrees.Single(); 11605var tree = comp.SyntaxTrees.Single(); 11700var tree = comp.SyntaxTrees.Single(); 12148var tree = comp1.SyntaxTrees.Single(); 12416var tree = comp1.SyntaxTrees.Single(); 12661var tree = comp1.SyntaxTrees.Single(); 12924var tree = comp1.SyntaxTrees.Single(); 13191var tree = comp1.SyntaxTrees.Single(); 13453var tree = comp1.SyntaxTrees.Single(); 14151var tree = comp.SyntaxTrees.Single(); 14492var tree = comp.SyntaxTrees.Single(); 14854var tree = comp.SyntaxTrees.Single(); 15205var tree = comp.SyntaxTrees.Single(); 15553var tree = comp.SyntaxTrees.Single(); 15732var tree = comp.SyntaxTrees.Single(); 15987var tree = comp.SyntaxTrees.Single(); 16758var tree = comp.SyntaxTrees.Single(); 16823var tree = comp.SyntaxTrees.Single(); 16888var tree = comp.SyntaxTrees.Single(); 16972var tree = comp.SyntaxTrees.Single(); 17060var tree = comp.SyntaxTrees.Single(); 17153var tree = comp.SyntaxTrees.Single(); 17250var tree = comp.SyntaxTrees.Single(); 17334var tree = comp.SyntaxTrees.Single(); 17655var tree = comp.SyntaxTrees.Single(); 17852var tree = comp.SyntaxTrees.Single(); 18075var tree = comp.SyntaxTrees.Single(); 18275var tree = comp.SyntaxTrees.Single(); 18476var tree = comp.SyntaxTrees.Single(); 18652var tree = comp.SyntaxTrees.Single(); 18760var tree = comp.SyntaxTrees.Single(); 19128var tree = comp.SyntaxTrees.Single(); 19299var tree = comp.SyntaxTrees.Single(); 19472var tree = comp.SyntaxTrees.Single(); 19624var tree = comp.SyntaxTrees.Single(); 19862var tree = comp.SyntaxTrees.Single(); 19966var tree = comp.SyntaxTrees.Single(); 21236var tree = comp2.SyntaxTrees.Single(); 21304var tree = comp.SyntaxTrees.Single(); 21706var tree = comp.SyntaxTrees.Single(); 22852Assert.False(m.ContainingType.TypeParameters.Single().AllowsRefLikeType); 22934Assert.False(m.ContainingType.TypeParameters.Single().AllowsRefLikeType); 22965Assert.True(m.ContainingType.TypeParameters.Single().AllowsRefLikeType); 22996Assert.False(m.ContainingType.TypeParameters.Single().AllowsRefLikeType); 23027Assert.False(m.ContainingType.TypeParameters.Single().AllowsRefLikeType); 23059Assert.False(m.ContainingType.TypeParameters.Single().AllowsRefLikeType); 23090Assert.False(m.ContainingType.TypeParameters.Single().AllowsRefLikeType); 23121Assert.False(m.ContainingType.TypeParameters.Single().AllowsRefLikeType); 23175Assert.False(m.ContainingType.TypeParameters.Single().AllowsRefLikeType); 23206Assert.True(m.ContainingType.TypeParameters.Single().AllowsRefLikeType); 28939var itest29 = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("ITest29").Single(); 28942var m21 = (PEMethodSymbol)itest29.GetMembers("M21").Single();
Semantics\CollectionExpressionTests.cs (7)
13361var sourceMember = sourceType.GetMembers(memberName).Single(); 13362var synthesizedMember = synthesizedType.GetMembers(memberName).Single(); 28181var argument = program.GetAttributes().Single().ConstructorArguments.Single(); 31489var tree = comp.SyntaxTrees.Single(); 31537var tree = comp.SyntaxTrees.Single(); 31595var tree = comp.SyntaxTrees.Single(); 31693var tree = comp.SyntaxTrees.Single();
Semantics\ExperimentalAttributeTests.cs (29)
65var diag = comp.GetDiagnostics().Single(); 1072var diag = comp.GetDiagnostics().Single(); 1101var diag = comp.GetDiagnostics().Single(); 1132var diag = comp.GetDiagnostics().Single(); 1163var diag = comp.GetDiagnostics().Single(); 1194var diag = comp.GetDiagnostics().Single(); 1813var diag = comp.GetDiagnostics().Single(); 1854var diag = comp.GetDiagnostics().Single(); 1893var diag = comp.GetDiagnostics().Single(); 1934var diag = comp.GetDiagnostics().Single(); 1975var diag = comp.GetDiagnostics().Single(); 2014var diag = comp.GetDiagnostics().Single(); 2055var diag = comp.GetDiagnostics().Single(); 2094var diag = comp.GetDiagnostics().Single(); 2120var diag = comp.GetDiagnostics().Single(); 2146var diag = comp.GetDiagnostics().Single(); 2172var diag = comp.GetDiagnostics().Single(); 2198var diag = comp.GetDiagnostics().Single(); 2224var diag = comp.GetDiagnostics().Single(); 2250var diag = comp.GetDiagnostics().Single(); 2276var diag = comp.GetDiagnostics().Single(); 2302var diag = comp.GetDiagnostics().Single(); 2328var diag = comp.GetDiagnostics().Single(); 2359var diag = comp.GetDiagnostics().Single(); 2390var diag = comp.GetDiagnostics().Single(); 2416var diag = comp.GetDiagnostics().Single(); 2442var diag = comp.GetDiagnostics().Single(); 2467var diag = comp.GetDiagnostics().Single(); 2492var diag = comp.GetDiagnostics().Single();
Semantics\ExtensionOperatorsTests.cs (8)
3865var tree = comp.SyntaxTrees.Single(); 3906var tree = comp.SyntaxTrees.Single(); 3946var tree = comp.SyntaxTrees.Single(); 3993var tree = comp.SyntaxTrees.Single(); 10098var tree = comp.SyntaxTrees.Single(); 10182var tree = comp.SyntaxTrees.Single(); 19254var tree = comp.SyntaxTrees.Single(); 19299var tree = comp.SyntaxTrees.Single();
Semantics\ExtensionTests.cs (151)
170var member = symbol.ContainingType.GetMembers().Single(); 255var member = symbol.ContainingType.GetMembers().Single(); 327Assert.True(symbol.TypeParameters.Single().IsValueType); 328Assert.False(symbol.TypeParameters.Single().IsReferenceType); 329Assert.Empty(symbol.TypeParameters.Single().ConstraintTypes); 477var substitutedExtension = (INamedTypeSymbol)container.Construct(comp.GetSpecialType(SpecialType.System_Int32)).GetMembers().Single(); 3777var tree = comp.SyntaxTrees.Single(); 4184var tree = comp.SyntaxTrees.Single(); 4645var tree = comp.SyntaxTrees.Single(); 4689var tree = comp.SyntaxTrees.Single(); 5747AssertEx.Equal("System.Runtime.CompilerServices.IteratorStateMachineAttribute(typeof(Extensions.<M>d__1))", implementation.GetAttributes().Single().ToString()); 6148AssertEx.Equal("System.Runtime.CompilerServices.AsyncStateMachineAttribute(typeof(Extensions.<M>d__1))", implementation.GetAttributes().Single().ToString()); 7223AssertEx.Equal("System.Runtime.CompilerServices.IteratorStateMachineAttribute(typeof(Extensions.<M>d__1<,>))", implementation.GetAttributes().Single().ToString()); 7612AssertEx.Equal("System.Runtime.CompilerServices.AsyncStateMachineAttribute(typeof(Extensions.<M>d__1<,>))", implementation.GetAttributes().Single().ToString()); 8774AssertEx.Equal("System.Runtime.CompilerServices.IteratorStateMachineAttribute(typeof(Extensions.<M>d__1))", implementation.GetAttributes().Single().ToString()); 9139AssertEx.Equal("System.Runtime.CompilerServices.AsyncStateMachineAttribute(typeof(Extensions.<M>d__1))", implementation.GetAttributes().Single().ToString()); 11751var tree = comp.SyntaxTrees.Single(); 11897var tree = comp.SyntaxTrees.Single(); 11953var tree = comp.SyntaxTrees.Single(); 12003var tree = comp.SyntaxTrees.Single(); 12042var tree = comp.SyntaxTrees.Single(); 12073var tree = comp.SyntaxTrees.Single(); 12105var tree = comp.SyntaxTrees.Single(); 12533var tree = comp.SyntaxTrees.Single(); 12560var tree = comp.SyntaxTrees.Single(); 12593var tree = comp.SyntaxTrees.Single(); 12621var tree = comp.SyntaxTrees.Single(); 12651var tree = comp.SyntaxTrees.Single(); 12681var tree = comp.SyntaxTrees.Single(); 12708var tree = comp.SyntaxTrees.Single(); 12806var tree = comp.SyntaxTrees.Single(); 12829var tree = comp.SyntaxTrees.Single(); 12857var tree = comp.SyntaxTrees.Single(); 12889var tree = comp.SyntaxTrees.Single(); 12946var tree = comp.SyntaxTrees.Single(); 12979var tree = comp.SyntaxTrees.Single(); 13023var tree = comp.SyntaxTrees.Single(); 13068var tree = comp.SyntaxTrees.Single(); 14306var tree = comp.SyntaxTrees.Single(); 14336var tree = comp.SyntaxTrees.Single(); 14388var tree = comp.SyntaxTrees.Single(); 14463var tree = comp.SyntaxTrees.Single(); 14502var tree = comp.SyntaxTrees.Single(); 14538var tree = comp.SyntaxTrees.Single(); 14595var tree = comp.SyntaxTrees.Single(); 14622var tree = comp.SyntaxTrees.Single(); 14926var tree = comp.SyntaxTrees.Single(); 14952var tree = comp.SyntaxTrees.Single(); 15015var tree = comp.SyntaxTrees.Single(); 15095var tree = comp.SyntaxTrees.Single(); 15145tree = comp.SyntaxTrees.Single(); 15208var tree = comp.SyntaxTrees.Single(); 18722var tree = comp.SyntaxTrees.Single(); 18851var tree = comp.SyntaxTrees.Single(); 18883var tree = comp.SyntaxTrees.Single(); 18908var tree = comp.SyntaxTrees.Single(); 20126var tree = comp.SyntaxTrees.Single(); 20147tree = comp.SyntaxTrees.Single(); 20188var tree = comp.SyntaxTrees.Single(); 20243var tree = comp.SyntaxTrees.Single(); 20453var tree = comp.SyntaxTrees.Single(); 20487var tree = comp.SyntaxTrees.Single(); 20518var tree = comp.SyntaxTrees.Single(); 20546var tree = comp.SyntaxTrees.Single(); 20574var tree = comp.SyntaxTrees.Single(); 20600var tree = comp.SyntaxTrees.Single(); 20627var tree = comp.SyntaxTrees.Single(); 20659var tree = comp.SyntaxTrees.Single(); 20696var tree = comp.SyntaxTrees.Single(); 20726var tree = comp.SyntaxTrees.Single(); 20753var tree = comp.SyntaxTrees.Single(); 20791var tree = comp.SyntaxTrees.Single(); 20829var tree = comp.SyntaxTrees.Single(); 20870var tree = comp.SyntaxTrees.Single(); 20907var tree = comp.SyntaxTrees.Single(); 20943var tree = comp.SyntaxTrees.Single(); 20980var tree = comp.SyntaxTrees.Single(); 21156var tree = comp.SyntaxTrees.Single(); 21203var tree = comp.SyntaxTrees.Single(); 21238var tree = comp.SyntaxTrees.Single(); 21268var tree = comp.SyntaxTrees.Single(); 21298var tree = comp.SyntaxTrees.Single(); 21347var tree = comp.SyntaxTrees.Single(); 21394var tree = comp.SyntaxTrees.Single(); 21426var tree = comp.SyntaxTrees.Single(); 21453var tree = comp.SyntaxTrees.Single(); 21587var tree = comp.SyntaxTrees.Single(); 21622var tree = comp.SyntaxTrees.Single(); 21684var tree = comp.SyntaxTrees.Single(); 21723var tree = comp.SyntaxTrees.Single(); 21773var tree = comp.SyntaxTrees.Single(); 24331VerifyFlowGraph(comp, comp.SyntaxTrees.Single().GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First(), """ 24940var tree = comp.SyntaxTrees.Single(); 24973var tree = comp.SyntaxTrees.Single(); 25003var tree = comp.SyntaxTrees.Single(); 25031var tree = comp.SyntaxTrees.Single(); 25059var tree = comp.SyntaxTrees.Single(); 25089var tree = comp.SyntaxTrees.Single(); 25140var tree = comp.SyntaxTrees.Single(); 25169var tree = comp.SyntaxTrees.Single(); 25198var tree = comp.SyntaxTrees.Single(); 25226var tree = comp.SyntaxTrees.Single(); 25282var tree = comp.SyntaxTrees.Single(); 29445AssertEx.Equal("System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(0)", implementations[0].GetAttributes().Single().ToString()); 29448AssertEx.Equal("System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(1)", implementations[1].GetAttributes().Single().ToString()); 29677AssertEx.Equal("System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(0)", implementations[0].GetAttributes().Single().ToString()); 29680AssertEx.Equal("System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(1)", implementations[1].GetAttributes().Single().ToString()); 29845Assert.Equal("System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(1)", implementations[0].GetAttributes().Single().ToString()); 29891Assert.Equal("System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(1)", implementations[0].GetAttributes().Single().ToString()); 29894Assert.Equal("System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(0)", implementations[1].GetAttributes().Single().ToString()); 30828var tree = comp.SyntaxTrees.Single(); 30862var tree = comp.SyntaxTrees.Single(); 30886var tree = comp.SyntaxTrees.Single(); 30940var tree = comp.SyntaxTrees.Single(); 31688var tree = comp.SyntaxTrees.Single(); 31719var tree = comp.SyntaxTrees.Single(); 31750var tree = comp.SyntaxTrees.Single(); 31782var tree = comp.SyntaxTrees.Single(); 31814var tree = comp.SyntaxTrees.Single(); 31846var tree = comp.SyntaxTrees.Single(); 31877var tree = comp.SyntaxTrees.Single(); 31911var tree = comp.SyntaxTrees.Single(); 31949var tree = comp.SyntaxTrees.Single(); 32840var tree = comp.SyntaxTrees.Single(); 32877var tree = comp.SyntaxTrees.Single(); 32941var tree = comp.SyntaxTrees.Single(); 32974var tree = comp.SyntaxTrees.Single(); 33013var tree = comp.SyntaxTrees.Single(); 33045var tree = comp.SyntaxTrees.Single(); 33086var tree = comp.SyntaxTrees.Single(); 33117var tree = comp.SyntaxTrees.Single(); 33148var tree = comp.SyntaxTrees.Single(); 33172var tree = comp.SyntaxTrees.Single(); 34004var tree = comp.SyntaxTrees.Single(); 38721Assert.Equal("<>E__0", comp.GetTypeByMetadataName("E").GetTypeMembers().Single().ExtensionName); 42159var tree = comp.SyntaxTrees.Single(); 42191tree = comp.SyntaxTrees.Single(); 42405var tree = comp.SyntaxTrees.Single(); 42436var tree = comp.SyntaxTrees.Single(); 43024Assert.False(comp.GlobalNamespace.GetTypeMember("E").GetTypeMembers().Single().IsExtension); 43053var extension = comp.GlobalNamespace.GetTypeMember("E").GetTypeMembers().Single(); 43093var extension = comp.GlobalNamespace.GetTypeMember("E").GetTypeMembers().Single(); 43188var extension = e.GetTypeMembers().Single(); 43267var tree = comp.SyntaxTrees.Single(); 43338var extension = e.GetTypeMembers().Single(); 43406var extension = e.GetTypeMembers().Single(); 43449var extension = e.GetTypeMembers().Single(); 43766var tree = comp.SyntaxTrees.Single(); 43853var tree = comp.SyntaxTrees.Single(); 43878var tree = comp.SyntaxTrees.Single(); 43934Assert.Same(context.Node.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree);
Semantics\ExtensionTests2.cs (122)
2723var extension = comp.GlobalNamespace.GetTypeMember("E").GetTypeMembers().Single(); 3492Assert.False(comp.GetTypeByMetadataName("E").GetTypeMembers().Single().IsExtension); 3538Assert.False(comp.GetTypeByMetadataName("E").GetTypeMembers().Single().IsExtension); 3582Assert.False(comp.GetTypeByMetadataName("E").GetTypeMembers().Single().IsExtension); 3626Assert.False(comp.GetTypeByMetadataName("E").GetTypeMembers().Single().IsExtension); 3675Assert.False(comp.GetTypeByMetadataName("E").GetTypeMembers().Single().IsExtension); 3776AssertEx.Equal("T:E.<>E__0", e.GetTypeMembers().Single().GetDocumentationCommentId()); 3778var mSkeleton = comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single().GetMember("M"); 3788var tree = comp.SyntaxTrees.Single(); 3825AssertEx.Equal("T:E.<>E__0`1", e.GetTypeMembers().Single().GetDocumentationCommentId()); 3827var tree = comp.SyntaxTrees.Single(); 3881var tree = comp.SyntaxTrees.Single(); 3917var tree = comp.SyntaxTrees.Single(); 3961var tree = comp.SyntaxTrees.Single(); 4001var tree = comp.SyntaxTrees.Single(); 4036var tree = comp.SyntaxTrees.Single(); 4072var tree = comp.SyntaxTrees.Single(); 4105var tree = comp.SyntaxTrees.Single(); 4141var tree = comp.SyntaxTrees.Single(); 4170var tree = comp.SyntaxTrees.Single(); 4203var tree = comp.SyntaxTrees.Single(); 4236var tree = comp.SyntaxTrees.Single(); 4265var tree = comp.SyntaxTrees.Single(); 4297var tree = comp.SyntaxTrees.Single(); 4326var tree = comp.SyntaxTrees.Single(); 4356var tree = comp.SyntaxTrees.Single(); 4388var tree = comp.SyntaxTrees.Single(); 4424var tree = comp.SyntaxTrees.Single(); 4457var tree = comp.SyntaxTrees.Single(); 4486var tree = comp.SyntaxTrees.Single(); 4515var tree = comp.SyntaxTrees.Single(); 4545var tree = comp.SyntaxTrees.Single(); 4581var tree = comp.SyntaxTrees.Single(); 4608var tree = comp.SyntaxTrees.Single(); 4643var tree = comp.SyntaxTrees.Single(); 4678var tree = comp.SyntaxTrees.Single(); 4721var tree = comp.SyntaxTrees.Single(); 4756var tree = comp.SyntaxTrees.Single(); 4790var tree = comp.SyntaxTrees.Single(); 4852var tree = comp.SyntaxTrees.Single(); 4922var tree = comp.SyntaxTrees.Single(); 4950var tree = comp.SyntaxTrees.Single(); 5005var tree = comp.SyntaxTrees.Single(); 5078var tree = comp.SyntaxTrees.Single(); 5115var tree = comp.SyntaxTrees.Single(); 5230var tree = comp.SyntaxTrees.Single(); 5253var mSkeleton = comp2.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single().GetMember("M"); 5359var tree = comp.SyntaxTrees.Single(); 5380var tree = comp.SyntaxTrees.Single(); 5443var tree = comp.SyntaxTrees.Single(); 5507var tree = comp.SyntaxTrees.Single(); 5584var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 5618var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 5640var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 5662var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 5686var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 5706var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 5726var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 5749var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 5772var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 5792var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 5812var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 5833var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 5856var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 5878var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 5898var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 5918var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 5938var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 5957var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 5976var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 5995var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6032var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6051var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6070var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6089var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6114var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6133var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6173var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6195var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6216var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6238var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6260var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6282var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6305var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6326var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6345var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6379var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6398var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6417var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6437var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6457var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6475var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6495var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6515var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6536var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6555var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6574var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6593var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6612var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6631var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6650var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6672var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6691var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6711var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6731var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6751var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6785var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6820var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6855var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6892var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6913var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6932var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6969var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 6990var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 7017var nestedExtension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single().GetTypeMembers().Single(); 7041var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single(); 7060var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 7082var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 7104var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 7126var extension = (SourceNamedTypeSymbol)e.GetTypeMembers().Single(); 7181var extension = (SourceNamedTypeSymbol)comp.GetMember<NamedTypeSymbol>("E").GetTypeMembers().Single();
Semantics\InlineArrayTests.cs (1)
1372Assert.Equal("Field", m.GlobalNamespace.GetTypeMember("C1").GetAppliedConditionalSymbols().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 (207)
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(); 4356ParameterSymbol parameter = lambda.Parameters.Single(); 4362parameter = lambda.Parameters.Single(); 5891var tree = comp.SyntaxTrees.Single(); 5894Assert.NotEqual(SpecialType.System_String, model.GetSymbolInfo(f1).Symbol.GetParameters().Single().Type.SpecialType); 5896Assert.NotEqual(SpecialType.System_String, model.GetSymbolInfo(f2).Symbol.GetParameters().Single().Type.SpecialType); 5973var tree = comp.SyntaxTrees.Single(); 5976Assert.NotEqual(SpecialType.System_String, model.GetSymbolInfo(f1).Symbol.GetParameters().Single().Type.SpecialType); 5978Assert.NotEqual(SpecialType.System_String, model.GetSymbolInfo(f2).Symbol.GetParameters().Single().Type.SpecialType); 9029Assert.Equal("System.Diagnostics.CodeAnalysis.UnscopedRefAttribute", p1.GetAttributes().Single().ToString()); 9070var tree = comp.SyntaxTrees.Single(); 9275Assert.Equal(ScopedKind.None, comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope); 9276Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope); 9277Assert.False(comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().IsParams); 9279Assert.Equal(ScopedKind.None, comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope); 9280Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope); 9281Assert.False(comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().IsParams); 9283Assert.Equal(ScopedKind.None, comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope); 9284Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope); 9316Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope); 9317Assert.Equal(ScopedKind.None, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope); 9318Assert.True(comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().IsParams); 9320Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope); 9321Assert.Equal(ScopedKind.None, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope); 9322Assert.True(comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().IsParams); 9324Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope); 9325Assert.Equal(ScopedKind.None, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope); 9368Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope); 9369Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope); 9370Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope); 9422Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope); 9423Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope); 9424Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope); 9426Assert.False(comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().IsParams); 9480Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope); 9481Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope); 9482Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope); 9484Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C3.C1.Test1").Parameters.Single().EffectiveScope); 9485Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C3.C1.Test2").Parameters.Single().EffectiveScope); 9486Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C3.C1.Test3").Parameters.Single().EffectiveScope); 9537Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope); 9538Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope); 9539Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope); 9541Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C3.C1.Test1").Parameters.Single().EffectiveScope); 9542Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C3.C1.Test2").Parameters.Single().EffectiveScope); 9543Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C3.C1.Test3").Parameters.Single().EffectiveScope); 9607Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope); 9608Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope); 9609Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope); 9611Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C3.C1.Test1").Parameters.Single().EffectiveScope); 9612Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C3.C1.Test2").Parameters.Single().EffectiveScope); 9613Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C3.C1.Test3").Parameters.Single().EffectiveScope); 9695Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope); 9696Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope); 9697Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope); 9699Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C3.C1.Test1").Parameters.Single().EffectiveScope); 9700Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C3.C1.Test2").Parameters.Single().EffectiveScope); 9701Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C3.C1.Test3").Parameters.Single().EffectiveScope); 9762Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test1.Invoke").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope); 9763Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test2.Invoke").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope); 9764Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test3.Invoke").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope); 9803Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test1.Invoke").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope); 9804Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test2.Invoke").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope); 9805Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test3.Invoke").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope); 9855Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test1.Invoke").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope); 9856Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test2.Invoke").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope); 9857Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test3.Invoke").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope); 9916Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test1.Invoke").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope); 9917Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test2.Invoke").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope); 9918Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test3.Invoke").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope); 9963Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C1.Test1").PartialImplementationPart.Parameters.Single().EffectiveScope); 9964Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C1.Test2").PartialImplementationPart.Parameters.Single().EffectiveScope); 9965Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C1.Test3").PartialImplementationPart.Parameters.Single().EffectiveScope); 10016Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C1.Test1").PartialImplementationPart.Parameters.Single().EffectiveScope); 10017Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C1.Test2").PartialImplementationPart.Parameters.Single().EffectiveScope); 10018Assert.NotEqual(comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C1.Test3").PartialImplementationPart.Parameters.Single().EffectiveScope); 10071Assert.Equal(ScopedKind.None, comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope); 10072Assert.Equal(ScopedKind.None, comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope); 10073Assert.Equal(ScopedKind.None, comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope); 10075Assert.Equal(comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C1.Test1").PartialImplementationPart.Parameters.Single().EffectiveScope); 10076Assert.Equal(comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C1.Test2").PartialImplementationPart.Parameters.Single().EffectiveScope); 10077Assert.Equal(comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C1.Test3").PartialImplementationPart.Parameters.Single().EffectiveScope); 10127Assert.Equal(ScopedKind.None, comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope); 10128Assert.Equal(ScopedKind.None, comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope); 10129Assert.Equal(ScopedKind.None, comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope); 10131Assert.Equal(comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C1.Test1").PartialImplementationPart.Parameters.Single().EffectiveScope); 10132Assert.Equal(comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C1.Test2").PartialImplementationPart.Parameters.Single().EffectiveScope); 10133Assert.Equal(comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C1.Test3").PartialImplementationPart.Parameters.Single().EffectiveScope); 10134Assert.Equal(comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C1.Test1").PartialImplementationPart.Parameters.Single().EffectiveScope); 10135Assert.Equal(comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C1.Test2").PartialImplementationPart.Parameters.Single().EffectiveScope); 10136Assert.Equal(comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope, comp.GetMember<MethodSymbol>("C1.Test3").PartialImplementationPart.Parameters.Single().EffectiveScope); 10172Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope); 10173Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope); 10174Assert.True(comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().IsParams); 10176Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope); 10177Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope); 10178Assert.True(comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().IsParams); 10180Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope); 10181Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope); 10182Assert.False(comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().IsParams); 10214Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope); 10215Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope); 10216Assert.True(comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().IsParams); 10218Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope); 10219Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope); 10220Assert.True(comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().IsParams); 10222Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope); 10223Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope); 10224Assert.False(comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().IsParams); 10256Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope); 10257Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope); 10258Assert.True(comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().IsParams); 10260Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope); 10261Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope); 10262Assert.True(comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().IsParams); 10264Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope); 10265Assert.Equal(ScopedKind.ScopedValue, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope); 10266Assert.False(comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().IsParams); 12532var tree = comp.SyntaxTrees.Single(); 13142var parameter = method.Parameters.Single(); 13173var parameter = method.Parameters.Single(); 13202var parameter = method.Parameters.Single(); 13233var parameter = method.Parameters.Single(); 13265var parameter = method.Parameters.Single(); 13296var parameter = method.Parameters.Single(); 15273VerifyParams(comp.GetMember<MethodSymbol>("C1.Test").Parameters.Single(), isParamCollection: true); 15274VerifyParams(comp.GetMember<MethodSymbol>("C2.Test").Parameters.Single(), isParamCollection: true); 15297VerifyParams(comp.GetMember<MethodSymbol>("C1.Test").Parameters.Single()); 15298VerifyParams(comp.GetMember<MethodSymbol>("C2.Test").Parameters.Single());
Semantics\PatternMatchingTestBase.cs (14)
82Assert.Equal(designation, symbol.DeclaringSyntaxReferences.Single().GetSyntax()); 86var other = model.LookupSymbols(designation.SpanStart, name: designation.Identifier.ValueText).Single(); 125Assert.Same(symbol, model.LookupSymbols(reference.SpanStart, name: designation.Identifier.ValueText).Single()); 143Assert.Equal(designation, symbol.DeclaringSyntaxReferences.Single().GetSyntax()); 146Assert.NotEqual(symbol, model.LookupSymbols(designation.SpanStart, name: designation.Identifier.ValueText).Single()); 169Assert.Equal(declarator, symbol.DeclaringSyntaxReferences.Single().GetSyntax()); 172Assert.NotEqual(symbol, model.LookupSymbols(declarator.SpanStart, name: declarator.Identifier.ValueText).Single()); 183Assert.Equal(designation, symbol.DeclaringSyntaxReferences.Single().GetSyntax()); 186Assert.NotEqual(symbol, model.LookupSymbols(designation.SpanStart, name: designation.Identifier.ValueText).Single()); 196Assert.Same(symbol, model.LookupSymbols(reference.SpanStart, name: reference.Identifier.ValueText).Single()); 209var other = model.LookupSymbols(reference.SpanStart, name: reference.Identifier.ValueText).Single(); 246Assert.Equal(designation, symbol.DeclaringSyntaxReferences.Single().GetSyntax()); 259Assert.Same(symbol, symbols.Single()); 313Assert.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 (35)
477var ctor = c.InstanceConstructors.Single(); 555var ctor = c.InstanceConstructors.Single(); 625Assert.False(m.GlobalNamespace.GetTypeMember("C").InstanceConstructors.Single().IsDefaultValueTypeConstructor()); 1014Assert.Same(symbol, model.LookupSymbols(x.SpanStart, name: "X").Single()); 1904Assert.Equal("System.Int32 X", model.LookupSymbols(x.SpanStart, name: "X").Single().ToTestDisplayString()); 3224Assert.Equal("A", c.PrimaryConstructor.GetAttributes().Single().ToString()); 3380Assert.Equal("A", c.GetAttributes().Single().ToString()); 3401Assert.Equal("A", c.GetAttributes().Single().ToString()); 3445Assert.Equal("A", c1.PrimaryConstructor.GetAttributes().Single().ToString()); 3451Assert.Equal("A", c2.PrimaryConstructor.GetAttributes().Single().ToString()); 3507Assert.Equal("A", c1.PrimaryConstructor.GetAttributes().Single().ToString()); 3513Assert.Equal("B", c2.PrimaryConstructor.GetAttributes().Single().ToString()); 3537Assert.Equal(@"A(""someParam"")", c.PrimaryConstructor.GetAttributes().Single().ToString()); 3803Assert.Same(literal.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3829Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3847Assert.Same(initializer.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3878Assert.Same(baseType.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3905Assert.Same(@class.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 5292Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 5310Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 5328Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 5357Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 6090var tree = comp.SyntaxTrees.Single(); 6304var property = cMember.GetMembers("I1").Single(); 7793var tree = comp.SyntaxTrees.Single(); 7820symbol = symbolInfo.CandidateSymbols.Single(); 7834Assert.Same(symbol, model.LookupSymbols(p1.SpanStart, name: "p1").Single()); 19715Assert.Equal("p1", comp.GetTypeByMetadataName("C1").Indexers.Single().MetadataName); 19745Assert.Equal("p1", comp.GetTypeByMetadataName("C1").Indexers.Single().MetadataName); 19766Assert.Equal("p1", comp.GetTypeByMetadataName("C1").Indexers.Single().MetadataName); 20645var tree = comp.SyntaxTrees.Single(); 20678var tree = comp.SyntaxTrees.Single(); 20722var tree = comp.SyntaxTrees.Single(); 20769var tree = comp.SyntaxTrees.Single(); 20819var tree = comp.SyntaxTrees.Single();
Semantics\RecordTests.cs (36)
507Assert.IsType<ParameterSyntax>(primaryCtor.Parameters[1].DeclaringSyntaxReferences.Single().GetSyntax()); 539Assert.IsType<ParameterSyntax>(primaryCtor.Parameters[0].DeclaringSyntaxReferences.Single().GetSyntax()); 540Assert.IsType<ParameterSyntax>(primaryCtor.Parameters[1].DeclaringSyntaxReferences.Single().GetSyntax()); 541Assert.IsType<ParameterSyntax>(primaryCtor.Parameters[2].DeclaringSyntaxReferences.Single().GetSyntax()); 563var ctor = comp.GetMember<NamedTypeSymbol>("C").Constructors.Single(); 565Assert.IsType<ParameterSyntax>(ctor.Parameters[1].DeclaringSyntaxReferences.Single().GetSyntax()); 566Assert.Equal(0, ctor.Parameters[1].Locations.Single().SourceSpan.Length); 593Assert.IsType<ParameterSyntax>(ctor.Parameters[1].DeclaringSyntaxReferences.Single().GetSyntax()); 594Assert.Equal(3, ctor.Parameters[1].Locations.Single().SourceSpan.Length); 628Assert.IsType<ParameterSyntax>(comp.GetMember<NamedTypeSymbol>("A").Constructors[0].Parameters[1].DeclaringSyntaxReferences.Single().GetSyntax()); 662Assert.IsType<ParameterSyntax>(comp.GetMember<NamedTypeSymbol>("A").Constructors[0].Parameters[1].DeclaringSyntaxReferences.Single().GetSyntax()); 687Assert.IsType<ParameterSyntax>(ctor.Parameters[0].DeclaringSyntaxReferences.Single().GetSyntax()); 688Assert.IsType<ParameterSyntax>(ctor.Parameters[1].DeclaringSyntaxReferences.Single().GetSyntax()); 8669var x = c.GetMembers("X").Single(); 12585Assert.Equal("System.Type! B.EqualityContract { get; }", GetProperties(comp, "B").Single().ToTestDisplayString(includeNonNullable: true)); 22076Assert.Equal("System.Int32 X", model.LookupSymbols(x.SpanStart, name: "X").Single().ToTestDisplayString()); 26347Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26373Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26391Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26422Assert.Same(baseType.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26445Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 28257var property = cMember.GetMembers("I1").Single(); 28290var tree = comp.SyntaxTrees.Single(); 28409var property = cMember.GetMembers("I1").Single(); 28447var tree = comp.SyntaxTrees.Single(); 28619var property = cMember.GetMembers("I1").Single(); 28706", c.GetMembers("I1").Single().GetDocumentationCommentXml()); 28753", d.GetMembers("I1").Single().GetDocumentationCommentXml()); 28801", e.GetMembers("I1").Single().GetDocumentationCommentXml()); 28849", e.GetMembers("I1").Single().GetDocumentationCommentXml()); 28901", c.GetMembers("I1").Single().GetDocumentationCommentXml()); 28952", d.GetMembers("I1").Single().GetDocumentationCommentXml()); 29011", e.GetMembers("I1").Single().GetDocumentationCommentXml()); 29059Assert.Equal("", e.GetMembers("I1").Single().GetDocumentationCommentXml()); 29117", e.GetMembers("I1").Single().GetDocumentationCommentXml()); 29163var property = cMember.GetMembers("I1").Single();
Symbols\UserDefinedCompoundAssignmentOperatorsTests.cs (14)
525Assert.Equal(implements, m.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 592Assert.Equal(implements, m.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 704Assert.Equal(implements, m.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 1024Assert.Equal(implements, m.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 1078Assert.Equal(implements, m.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 5900var i1M1 = compilation1.GetTypeByMetadataName("I1").GetMembers().Single(); 5987var i1M1 = compilation1.GetTypeByMetadataName("I1").GetMembers().Single(); 8620Assert.Equal(implements, m.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 8706Assert.Equal(implements, m.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 8838Assert.Equal(implements, m.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 9233Assert.Equal(implements, m.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 9297Assert.Equal(implements, m.ExplicitInterfaceImplementations.Single().ToTestDisplayString()); 17556var i1M1 = compilation1.GetTypeByMetadataName("I1").GetMembers().Single(); 17643var i1M1 = compilation1.GetTypeByMetadataName("I1").GetMembers().Single();
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (3)
EndToEndTests.cs (3)
491var tree = comp.SyntaxTrees.Single(); 698var tree = comp.SyntaxTrees.Single(); 834step => Assert.True(step.Outputs.Single().Value is ClassDeclarationSyntax { Identifier.ValueText: "C1" }));
Microsoft.CodeAnalysis.CSharp.Features (16)
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (2)
193typeSymbol = typeInferenceInfo.InferredType.GetTypeArguments().Single(); 201typeSymbol = ienumerableType.TypeArguments.Single();
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (1)
65return members.Single();
Completion\CompletionProviders\ObjectCreationCompletionProvider.cs (2)
70var type = (ITypeSymbol)result.Single().Symbol; 73return [new SymbolAndSelectionInfo(alias, result.Single().Preselect)];
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (1)
163return symbols.Length == 1 ? symbols.Single() : null;
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (1)
285var memberDeclarationSyntax = memberDeclarationSymbol.DeclaringSyntaxReferences.Single().GetSyntax();
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
779return declaredSymbol.DeclaringSyntaxReferences.Single().GetSyntax();
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
983|| ((BaseTypeDeclarationSyntax)syntaxRefs.Single().GetSyntax()).Modifiers.Any(SyntaxKind.PartialKeyword);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (2)
370return node.WithInitializer((ConstructorInitializerSyntax)_statementsOrMemberOrAccessorToInsert.Single()); 431var primaryConstructorBase = (PrimaryConstructorBaseTypeSyntax)_statementsOrMemberOrAccessorToInsert.Single();
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (1)
45if (statements.Single() is not BlockSyntax block)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
109semanticModel.Compilation, ienumerableType.TypeArguments.Single()))
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
80var constructorParameterTypeArg = constructorParameter.Type.GetTypeArguments().Single();
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
68: IsCorrectTypeForYieldReturn(typeArguments.Single(), returnExpressionType, methodReturnType, model);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
800return expressions.Single();
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (68)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (2)
515Assert.Equal(RudeEditKind.ExperimentalFeaturesEnabled, result.RudeEdits.Single().Kind); 798Assert.Equal(RudeEditKind.NotSupportedByRuntime, result.RudeEdits.Single().Kind);
EditAndContinue\LineEditTests.cs (14)
933semanticEdits: [SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), preserveLocalVariables: true)]); 1268semanticEdits: [SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), preserveLocalVariables: true)]); 1333semanticEdits: [SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), preserveLocalVariables: true)], 1420semanticEdits: [SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), preserveLocalVariables: true)]); 1578semanticEdits: [SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single(), preserveLocalVariables: true)], 1632SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), preserveLocalVariables: true) 1715SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single(), preserveLocalVariables: true) 1743SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single(), preserveLocalVariables: true) 1771SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single(), preserveLocalVariables: true) 1799SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single(), preserveLocalVariables: true) 1827SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single(), preserveLocalVariables: true) 1854SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single(), preserveLocalVariables: true) 1887SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single(), preserveLocalVariables: true) 2168semanticEdits: [SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), preserveLocalVariables: true)]);
EditAndContinue\StatementEditingTests.cs (1)
3984SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").GetMembers("F").Single(), preserveLocalVariables: true)
EditAndContinue\TopLevelEditingTests.cs (50)
7314SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), partialType: "C", preserveLocalVariables: true) 11182SemanticEdit(SemanticEditKind.Delete, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), deletedSymbolContainerProvider: c => c.GetMember("C")), 11183SemanticEdit(SemanticEditKind.Insert, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single()) 11304SemanticEdit(SemanticEditKind.Delete, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), deletedSymbolContainerProvider: c => c.GetMember("C")), 11305SemanticEdit(SemanticEditKind.Insert, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single()), 11718SemanticEdit(SemanticEditKind.Delete, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), deletedSymbolContainerProvider: c => c.GetMember("C")), 11719SemanticEdit(SemanticEditKind.Insert, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single()) 11877SemanticEdit(SemanticEditKind.Insert, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single()) 12629SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), preserveLocalVariables: true)); 12662SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), preserveLocalVariables: true) 12723SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), preserveLocalVariables: true) 12879SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), preserveLocalVariables: true) 12913SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), preserveLocalVariables: true) 12947SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), preserveLocalVariables: true) 12981SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), preserveLocalVariables: true) 14133[SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), syntaxMap[0])]); 14182[SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), syntaxMap[0])]); 14245[SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), syntaxMap[0])]); 14295[SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), syntaxMap[0])], 14416SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(c => c.Parameters.Single().Type.Name == "Int32"), partialType: "C", syntaxMap: syntaxMapB), 14417SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(c => c.Parameters.Single().Type.Name == "Boolean"), partialType: "C", syntaxMap: syntaxMapB), 14418SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(c => c.Parameters.Single().Type.Name == "UInt32"), partialType: "C", syntaxMap: syntaxMapB), 14419SemanticEdit(SemanticEditKind.Insert, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(c => c.Parameters.Single().Type.Name == "Byte"), partialType: "C"), 14605[SemanticEdit(SemanticEditKind.Insert, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single())], 14621SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single(), partialType: "C", preserveLocalVariables: true) 14635SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single(), partialType: "C", preserveLocalVariables: true) 14910SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), preserveLocalVariables: true)); 14923SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), partialType: "C", preserveLocalVariables: true) 15008SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), preserveLocalVariables: true) 15026[SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single(), preserveLocalVariables: true)], 15042[SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single(), preserveLocalVariables: true)], 15115[SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single(), preserveLocalVariables: true)], 15128[SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single(), preserveLocalVariables: true)], 15311[SemanticEdit(SemanticEditKind.Insert, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single())], 15329[SemanticEdit(SemanticEditKind.Insert, c => c.GetMember<INamedTypeSymbol>("C").StaticConstructors.Single())], 15743SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), preserveLocalVariables: true) 15758SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), preserveLocalVariables: true) 15776SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), preserveLocalVariables: true) 15791SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), preserveLocalVariables: true) 15880[SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), syntaxMap[0])]); 15917[SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), syntaxMap[0])]); 15958[SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), syntaxMap[0])]); 15999[SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), syntaxMap[0])]); 16507SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), syntaxMap[0]) 16548SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), syntaxMap[0]) 17346SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), syntaxMap[0]) 17390SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single(), syntaxMap[0]) 17545SemanticEdit(SemanticEditKind.Insert, c => c.GetMember<INamedTypeSymbol>("C").Constructors.Single()), 22079SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), preserveLocalVariables: true) 22241SemanticEdit(SemanticEditKind.Update, c => c.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(), preserveLocalVariables: true)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryExpressionParenthesesTests.cs (1)
2634Assert.Equal(expectedSpans["expression"].Single(), diagnostic.AdditionalLocations[0].SourceSpan);
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 (1570)
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\AmbiguousOverrideTests.cs (2)
783var derivedProperty = derivedClass.Indexers.Single(); 857var derivedProperty = derivedClass.Indexers.Single();
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 (26)
13537Assert.Equal(42, cm.Parameters.Single().ExplicitDefaultValue); 13539Assert.False(dm.Parameters.Single().HasExplicitDefaultValue); 13578Assert.False(cm.Parameters.Single().HasExplicitDefaultValue); 13580Assert.Equal(42, dm.Parameters.Single().ExplicitDefaultValue); 13641Assert.True(cm.Parameters.Single().IsParams); 13643Assert.True(dm.Parameters.Single().IsParams); 13686Assert.False(cm.Parameters.Single().IsParams); 13688Assert.False(dm.Parameters.Single().IsParams); 13708Assert.True(cm.Parameters.Single().IsParams); 13710Assert.False(dm.Parameters.Single().IsParams); 13758Assert.True(cm.Parameters.Single().IsParams); 13760Assert.True(dm.Parameters.Single().IsParams); 13825Assert.True(cm.Parameters.Single().IsParams); 13827Assert.False(dm.Parameters.Single().IsParams); 13891Assert.True(cm.Parameters.Single().IsParams); 13893Assert.True(dm.Parameters.Single().IsParams); 13972Assert.True(cm.Parameters.Single().IsParams); 13974Assert.False(dm.Parameters.Single().IsParams); 14013Assert.False(cm.Parameters.Single().IsParams); 14015Assert.False(dm.Parameters.Single().IsParams); 14056Assert.True(cm.Parameters.Single().IsParams); 14058Assert.True(dm.Parameters.Single().IsParams); 14085Assert.False(cm.Parameters.Single().IsParams); 14087Assert.True(dm.Parameters.Single().IsParams); 19887var tree = comp.SyntaxTrees.Single(); 19929var tree = comp.SyntaxTrees.Single();
Semantics\DynamicTests.cs (111)
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(); 11731m.GlobalNamespace.GetMember<NamedTypeSymbol>("Test1.<>o__0").TypeParameters.Single().GetAttributes().Select(a => a.ToString()));
Semantics\ExpressionBodiedMemberTests.cs (1)
1027Assert.Equal($"System.Int32 y{i}", model.LookupSymbols(nodes[i].SpanStart, name: $"y{i}").Single().ToTestDisplayString());
Semantics\FieldInitializerBindingTests.cs (1)
247var typeSymbol = (SourceNamedTypeSymbol)compilation.GlobalNamespace.GetMembers("C").Single();
Semantics\ForEachTests.cs (27)
1219Assert.Equal("System.Int32 x", boundNode.IterationVariables.Single().ToTestDisplayString()); 1257Assert.Equal("System.Char c", boundNode.IterationVariables.Single().ToTestDisplayString()); 1301Assert.Equal("System.Int64 x", boundNode.IterationVariables.Single().ToTestDisplayString()); 1345Assert.Equal("System.Int64 x", boundNode.IterationVariables.Single().ToTestDisplayString()); 1378Assert.Equal("System.Int64 x", boundNode.IterationVariables.Single().ToTestDisplayString()); 1418Assert.Equal("System.Int64 x", boundNode.IterationVariables.Single().ToTestDisplayString()); 1460Assert.Equal("System.Object x", boundNode.IterationVariables.Single().ToTestDisplayString()); 1499Assert.Equal("System.Int64 x", boundNode.IterationVariables.Single().ToTestDisplayString()); 1532Assert.Equal(SpecialType.System_Int32, boundNode.IterationVariables.Single().Type.SpecialType); 1563Assert.Equal(SpecialType.System_Char, boundNode.IterationVariables.Single().Type.SpecialType); 1592Assert.Equal(SpecialType.System_Int32, boundNode.IterationVariables.Single().Type.SpecialType); 1616Assert.Equal(SpecialType.System_Object, boundNode.IterationVariables.Single().Type.SpecialType); 1649Assert.Equal("C.var", boundNode.IterationVariables.Single().TypeWithAnnotations.ToTestDisplayString()); 1680Assert.Equal("System.Int32 x", boundNode.IterationVariables.Single().ToTestDisplayString()); 1713Assert.Equal("dynamic x", boundNode.IterationVariables.Single().ToTestDisplayString()); 1754Assert.Equal("System.Object x", boundNode.IterationVariables.Single().ToTestDisplayString()); 1838Assert.Equal("System.Object x", boundNode.IterationVariables.Single().ToTestDisplayString()); 1885Assert.Equal("System.Int64 x", boundNode.IterationVariables.Single().ToTestDisplayString()); 2126var tree = comp.SyntaxTrees.Single(); 2178var tree = comp.SyntaxTrees.Single(); 2882var tree = comp.SyntaxTrees.Single(); 3129Assert.Equal(SpecialType.System_Char, boundNode.IterationVariables.Single().Type.SpecialType); 3238Assert.Equal("C", info.GetEnumeratorInfo.Arguments.Single().Type.ToTestDisplayString()); 3247Assert.Equal("System.Int32 i", boundNode.IterationVariables.Single().ToTestDisplayString()); 3324var tree = comp.SyntaxTrees.Single(); 3358var tree = comp.SyntaxTrees.Single(); 3420var tree = compilation.SyntaxTrees.Single();
Semantics\FunctionPointerTests.cs (7)
363var underlying = conversion.UnderlyingConversions.Single(); 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 (48)
451var typeParameter = module.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 456Assert.Equal(SpecialType.System_Enum, typeParameter.ConstraintTypes().Single().SpecialType); 469var typeParameter = module.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 475Assert.Equal(SpecialType.System_Enum, typeParameter.ConstraintTypes().Single().SpecialType); 488var typeParameter = module.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 494Assert.Equal(SpecialType.System_Enum, typeParameter.ConstraintTypes().Single().SpecialType); 507var typeParameter = module.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 513Assert.Equal(SpecialType.System_Enum, typeParameter.ConstraintTypes().Single().SpecialType); 630var constraintTypeNames = method.TypeParameters.Single().ConstraintTypes().Select(type => type.ToTestDisplayString()); 977var typeParameter = module.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 980Assert.Equal(SpecialType.System_Delegate, typeParameter.ConstraintTypes().Single().SpecialType); 996var typeParameter = compilation.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 1011var typeParameter = module.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 1015Assert.Equal(SpecialType.System_Delegate, typeParameter.ConstraintTypes().Single().SpecialType); 1028var typeParameter = module.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 1032Assert.Equal(SpecialType.System_Delegate, typeParameter.ConstraintTypes().Single().SpecialType); 1143var constraintTypeNames = method.TypeParameters.Single().ConstraintTypes().Select(type => type.ToTestDisplayString()); 1462var typeParameter = module.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 1465Assert.Equal(SpecialType.System_MulticastDelegate, typeParameter.ConstraintTypes().Single().SpecialType); 1481var typeParameter = compilation.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 1496var typeParameter = module.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 1500Assert.Equal(SpecialType.System_MulticastDelegate, typeParameter.ConstraintTypes().Single().SpecialType); 1513var typeParameter = module.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 1517Assert.Equal(SpecialType.System_MulticastDelegate, typeParameter.ConstraintTypes().Single().SpecialType); 1628var constraintTypeNames = method.TypeParameters.Single().ConstraintTypes().Select(type => type.ToTestDisplayString()); 1835var typeParameter = c.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 1853var typeParameter = c.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 1903var typeParameter = module.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 2118var typeParameter = module.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 2143var typeParameter = module.GlobalNamespace.GetTypeMember("Test").GetMethod("M").TypeParameters.Single(); 2164var typeParameter = module.GlobalNamespace.GetTypeMember("D").TypeParameters.Single(); 2194var typeParameter = module.ContainingAssembly.GetTypeByMetadataName("Test").GetMethod("<M>g__N|0_0").TypeParameters.Single(); 2875var tree = compilation.SyntaxTrees.Single(); 2939var typeParameter = module.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 2946Assert.Equal("Enum", typeParameter.ConstraintTypes().Single().Name); 3083Assert.True(module.ContainingAssembly.GetTypeByMetadataName("D`1").TypeParameters.Single().HasUnmanagedTypeConstraint); 3084Assert.True(module.ContainingAssembly.GetTypeByMetadataName("Test`1").TypeParameters.Single().HasUnmanagedTypeConstraint); 3085Assert.True(module.ContainingAssembly.GetTypeByMetadataName("Test`1").GetTypeMember("<>c__DisplayClass2_0").TypeParameters.Single().HasUnmanagedTypeConstraint); 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 (3)
36var method = (SourceMemberMethodSymbol)compilation.GlobalNamespace.GetTypeMembers("C").Single().GetMembers("F").Single(); 41var locDecl = (BoundLocalDeclaration)block.Statements.Single();
Semantics\ImplicitObjectCreationTests.cs (2)
4528var tree = compilation.SyntaxTrees.Single(); 4571var tree = compilation.SyntaxTrees.Single();
Semantics\ImportsTests.cs (3)
112var tree = comp.SyntaxTrees.Single(); 134Assert.Equal(externAlias2.Alias.Target, concat1.ExternAliases.Single().Alias.Target); 137Assert.Equal(externAlias1.Alias.Target, concat2.ExternAliases.Single().Alias.Target);
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\InheritanceBindingTests.cs (1)
6704var c2Type = comp.Assembly.Modules[0].GlobalNamespace.GetTypeMembers("C2").Single();
Semantics\InitOnlyMemberTests.cs (8)
1455var property = (PropertySymbol)c.GetMembers("Property").Single(); 1479var modifier = property.SetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single(); 1492var backingField = (FieldSymbol)c.GetMembers("<Property>k__BackingField").Single(); 3903Assert.Equal("System.Runtime.CompilerServices.IsExternalInit", property0.RefCustomModifiers.Single().Modifier.ToTestDisplayString()); 3992Assert.Equal("System.Runtime.CompilerServices.IsExternalInit", property0.TypeWithAnnotations.CustomModifiers.Single().Modifier.ToTestDisplayString()); 4769var modifier = ((SourcePropertySymbol)comp.GlobalNamespace.GetMember("C.Property")).SetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single(); 4822var modifier = ((SourcePropertySymbol)comp.GlobalNamespace.GetMember("C.Property")).SetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single(); 4834var modifier = ((SourcePropertySymbol)comp.GlobalNamespace.GetMember("C.Property")).SetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single();
Semantics\InteractiveUsingTests.cs (1)
115var tree = sub4.SyntaxTrees.Single();
Semantics\InterceptorsTests.cs (1)
44var tree = comp.SyntaxTrees.Single();
Semantics\InterpolationTests.cs (67)
5023Assert.Equal("Attr..ctor(System.String s)", attr.GetAttributes().Single().AttributeConstructor.ToTestDisplayString()); 5048Assert.Equal("Attr..ctor(System.String s)", attr.GetAttributes().Single().AttributeConstructor.ToTestDisplayString()); 6835var sParam = comp.SourceModule.GlobalNamespace.GetTypeMember("C").GetMethod("M").Parameters.Single(); 6837sParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6863sParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6893var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Single(); 6895cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6928var cParam = comp.SourceModule.GlobalNamespace.GetTypeMember("C").GetMethod("M").Parameters.Single(); 6930cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6968var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Single(); 6970cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7005cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7045cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7083cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7123cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7158cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7196var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Single(); 7198cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7233cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7266cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7306cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7346cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7386cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7426cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7459var cParam = comp.SourceModule.GlobalNamespace.GetTypeMember("C").GetMethod("M").Parameters.Single(); 7461cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7501var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Single(); 7503cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7536var cParam = comp.SourceModule.GlobalNamespace.GetTypeMember("C").GetMethod(".ctor").Parameters.Single(); 7538cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7578var cParam = comp.GetTypeByMetadataName("C").GetMethod(".ctor").Parameters.Single(); 7580cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7618var cParam = substitutedC.GetMethod("M").Parameters.Single(); 7621cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7659var cParam = comp.GetTypeByMetadataName("C`1").GetMethod("M").Parameters.Single(); 7661cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7729cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7730Assert.Equal(1, cParam.InterpolatedStringHandlerArgumentIndexes.Single()); 7823cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7824Assert.Equal(1, cParam.InterpolatedStringHandlerArgumentIndexes.Single()); 7935cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7936Assert.Equal(0, cParam.InterpolatedStringHandlerArgumentIndexes.Single()); 8001cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8002Assert.Equal(0, cParam.InterpolatedStringHandlerArgumentIndexes.Single()); 8031cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8032Assert.Equal(0, cParam.InterpolatedStringHandlerArgumentIndexes.Single()); 8133cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8134Assert.Equal(0, cParam.InterpolatedStringHandlerArgumentIndexes.Single()); 8275cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8276Assert.Equal(0, cParam.InterpolatedStringHandlerArgumentIndexes.Single()); 8335cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8336Assert.Equal(0, cParam.InterpolatedStringHandlerArgumentIndexes.Single()); 8455cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8693cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8818cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8969cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 9080cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 9147cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 9203cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 9319cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 9435cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 9560cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 9819var cParam = module.GlobalNamespace.GetTypeMember("C").GetMethod("M").Parameters.Single(); 9821cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 9894var cParam = module.GlobalNamespace.GetTypeMember("C").GetMethod("M").Parameters.Single(); 9896cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 11954cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString());
Semantics\IteratorTests.cs (2)
675var tree = comp.SyntaxTrees.Single(); 796m.GlobalNamespace.GetMember<NamedTypeSymbol>("Test1.<M2>d__0").TypeParameters.Single().GetAttributes().Select(a => a.ToString()));
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 (39)
937var tree = compilation.SyntaxTrees.Single(); 1029var tree = compilation.SyntaxTrees.Single(); 1083var tree = compilation.SyntaxTrees.Single(); 1118var tree = compilation.SyntaxTrees.Single(); 1182Assert.Equal("void System.Collections.Generic.ICollection<C>.Add(C item)", symbolInfo.CandidateSymbols.Single().ToTestDisplayString()); 1210Assert.Equal("void System.Collections.Generic.ICollection<C>.Add(C item)", symbolInfo.CandidateSymbols.Single().ToTestDisplayString()); 1511var tree = compilation.SyntaxTrees.Single(); 1546var tree = compilation.SyntaxTrees.Single(); 1580var tree = compilation.SyntaxTrees.Single(); 1612var tree = compilation.SyntaxTrees.Single(); 1982Assert.Equal("void System.EventHandler.Invoke(System.Object sender, System.EventArgs e)", model.GetTypeInfo(node1).ConvertedType.GetMembers("Invoke").Single().ToTestDisplayString()); 3934var tree = comp.SyntaxTrees.Single(); 3945var expectedAttributeConstructor = comp.GetTypeByMetadataName(expectedAttributeName).InstanceConstructors.Single().GetPublicSymbol(); 3974var tree = comp.SyntaxTrees.Single(); 4094Assert.Equal("System.ObsoleteAttribute", symbol.GetAttributes().Single().ToString()); 4122var lambda = exprs.SelectAsArray(e => GetLambdaSymbol(model, e)).Single(); 4185var lambda = exprs.SelectAsArray(e => GetLambdaSymbol(model, e)).Single(); 4872var lambda = exprs.SelectAsArray(e => GetLambdaSymbol(model, e)).Single(); 4927var lambda = exprs.SelectAsArray(e => GetLambdaSymbol(model, e)).Single(); 5637var expectedType = comp.GetMember<MethodSymbol>("Program.F").TypeParameters.Single().GetPublicSymbol(); 6506var tree = comp.SyntaxTrees.Single(); 6816var tree = comp.SyntaxTrees.Single(); 6845var tree = comp.SyntaxTrees.Single(); 7638var methodSyntax = (MethodDeclarationSyntax)method.DeclaringSyntaxReferences.Single().GetSyntax(); 8072var tree = comp.SyntaxTrees.Single(); 8075var m2Syntax = (MethodDeclarationSyntax)m2.DeclaringSyntaxReferences.Single().GetSyntax(); 8081var newParam = newLambdaSymbol.Parameters.Single(); 8108var tree = comp.SyntaxTrees.Single(); 8145var tree = comp.SyntaxTrees.Single(); 8356Assert.True(((SourceParameterSymbol)lambdas[0].Parameters.Single()).IsParams); 8357Assert.True(((SourceParameterSymbol)lambdas[0].Parameters.Single()).IsParamsArray); 8358Assert.False(((SourceParameterSymbol)lambdas[0].Parameters.Single()).IsParamsCollection); 8360Assert.False(((SourceParameterSymbol)lambdas[1].Parameters.Single()).IsParams); 8361Assert.False(((SourceParameterSymbol)lambdas[1].Parameters.Single()).IsParamsArray); 8362Assert.False(((SourceParameterSymbol)lambdas[1].Parameters.Single()).IsParamsCollection); 8433Assert.True(lam1.DelegateParameters().Single().IsParams); 8434Assert.True(lam1.DelegateParameters().Single().IsParamsArray); 8435Assert.False(lam1.DelegateParameters().Single().IsParamsCollection); 8829m.GlobalNamespace.GetMember<NamedTypeSymbol>("Test1.<>c__DisplayClass0_0").TypeParameters.Single().GetAttributes().Select(a => a.ToString()));
Semantics\LocalFunctionTests.cs (39)
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(); 1722var typeParam = localSymbol.TypeParameters.Single(); 1799clsCompliantSymbolInfo.CandidateSymbols.Single()); 1807model.LookupNamespacesAndTypes(clsCompliant.SpanStart, name: "CLSCompliantAttribute").Single()); 1874clsCompliantSymbolInfo.CandidateSymbols.Single()); 1882model.LookupNamespacesAndTypes(clsCompliant.SpanStart, name: "CLSCompliantAttribute").Single()); 1927var typeParam = localSymbol.TypeParameters.Single(); 2371var tree = comp.SyntaxTrees.Single(); 4961var tree = compilation.SyntaxTrees.Single(); 5104var tree = comp.SyntaxTrees.Single(); 7344var tree = comp.SyntaxTrees.Single(); 7432var tree = comp.SyntaxTrees.Single(); 7497var tree = comp.SyntaxTrees.Single(); 7521tree = comp.SyntaxTrees.Single(); 7571var tree = comp.SyntaxTrees.Single(); 8737var tree = comp.SyntaxTrees.Single(); 8779var tree = comp.SyntaxTrees.Single(); 8927var tree = comp.SyntaxTrees.Single(); 9431var tree = comp.SyntaxTrees.Single(); 9749var tree = comp.SyntaxTrees.Single(); 10428var tree = comp.SyntaxTrees.Single(); 10745var syntaxTree = comp.SyntaxTrees.Single(); 10786var syntaxTree = 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 (28)
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\MultiDimensionalArrayTests.cs (4)
1681var a1 = (IArrayTypeSymbol)p.GetMember<MethodSymbol>("Test1").GetAttributes().Single().ConstructorArguments.Single().Value; 1686var a2 = (IArrayTypeSymbol)p.GetMember<MethodSymbol>("Test2").GetAttributes().Single().ConstructorArguments.Single().Value; 1691Assert.True(((ITypeSymbol)p.GetMember<MethodSymbol>("Test3").GetAttributes().Single().ConstructorArguments.Single().Value).IsErrorType()); 1692Assert.True(((ITypeSymbol)p.GetMember<MethodSymbol>("Test4").GetAttributes().Single().ConstructorArguments.Single().Value).IsErrorType());
Semantics\NamedAndOptionalTests.cs (6)
2050var parameters = methods.Select(m => m.Parameters.Single()).ToArray(); 2132var parameters = methods.Select(m => m.Parameters.Single()).ToArray(); 2183var parameters = methods.Select(m => m.Parameters.Single()).ToArray(); 2266var parameters = methods.Select(m => m.Parameters.Single()).ToArray(); 2348var parameters = methods.Select(m => m.Parameters.Single()).ToArray(); 2462var param = method.Parameters.Single();
Semantics\NameOfTests.cs (5)
975var tree = comp.SyntaxTrees.Single(); 1047var tree = comp.SyntaxTrees.Single(); 1129var tree = comp.SyntaxTrees.Single(); 1210var tree = comp.SyntaxTrees.Single(); 3039var tree = compilation.SyntaxTrees.Single();
Semantics\NativeIntegerTests.cs (9)
1563var @interface = interfaces.Single(); 4078var tree = comp.SyntaxTrees.Single(); 14748comp.GetMember<NamedTypeSymbol>(typeName).InterfacesNoUseSiteDiagnostics().Single(); 15320var tree = comp.SyntaxTrees.Single(); 15341var tree = comp.SyntaxTrees.Single(); 15364var tree = comp.SyntaxTrees.Single(); 15392var tree = comp.SyntaxTrees.Single(); 15415var tree = comp.SyntaxTrees.Single(); 15445var 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 (236)
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(); 6469Assert.Equal(@"{{""a""}}", attribute.CommonConstructorArguments.Single().ToCSharpString()); 6490var attribute = c.GetAttributes().Single(); 6491Assert.Equal(@"{{""a""}}", attribute.CommonConstructorArguments.Single().ToCSharpString()); 9021var constraintType = baseType.TypeParameters.Single().ConstraintTypesNoUseSiteDiagnostics.Single(); 9023var interfaceType = derivedType.Interfaces().Single(); 9024constraintType = interfaceType.TypeParameters.Single().ConstraintTypesNoUseSiteDiagnostics.Single(); 9027constraintType = method.TypeParameters.Single().ConstraintTypesNoUseSiteDiagnostics.Single(); 9046var interfaceType = type.Interfaces().Single(); 9047var typeArg = interfaceType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single(); 9051typeArg = ((NamedTypeSymbol)method.ReturnType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single(); 9053var parameter = method.Parameters.Single(); 9055typeArg = ((NamedTypeSymbol)parameter.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single(); 10532var tree = compilation.SyntaxTrees.Single(); 12429Assert.Equal(expectMatch, member.Parameters.Single().TypeWithAnnotations.Equals(member.OverriddenMethod.Parameters.Single().TypeWithAnnotations, TypeCompareKind.ConsiderEverything)); 56116var tree = comp.SyntaxTrees.Single(); 56146var tree = comp.SyntaxTrees.Single(); 56179var tree = comp.SyntaxTrees.Single(); 56216var tree = comp.SyntaxTrees.Single(); 56251var tree = comp.SyntaxTrees.Single(); 56285var tree = comp.SyntaxTrees.Single(); 56316var tree = comp.SyntaxTrees.Single(); 56344var tree = comp.SyntaxTrees.Single(); 56383var tree = comp.SyntaxTrees.Single(); 56417var tree = comp.SyntaxTrees.Single(); 56448var tree = comp.SyntaxTrees.Single(); 56477var tree = comp.SyntaxTrees.Single(); 56512var tree = comp.SyntaxTrees.Single(); 56548var tree = comp.SyntaxTrees.Single(); 56627var tree = comp.SyntaxTrees.Single(); 56659var tree = comp.SyntaxTrees.Single(); 62880var syntaxTree = comp.SyntaxTrees.Single(); 65929var tree1 = comp1.SyntaxTrees.Single(); 71821var tree = comp.SyntaxTrees.Single(); 71914var tree = comp.SyntaxTrees.Single(); 71961var tree = comp.SyntaxTrees.Single(); 72000var tree = comp.SyntaxTrees.Single(); 73801var tree = comp.SyntaxTrees.Single(); 97711Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t2.GetAttributes().Single().ToString()); 97752Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(1)", t1.GetAttributes().Single().ToString()); 97765Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t2.GetAttributes().Single().ToString()); 97859Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t1.GetAttributes().Single().ToString()); 97872Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t2.GetAttributes().Single().ToString()); 98468Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.GetAttributes().Single().ToString()); 98482Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", bf2.GetAttributes().Single().ToString()); 98659Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.GetAttributes().Single().ToString()); 98673Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", bf2.GetAttributes().Single().ToString()); 98766Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.GetAttributes().Single().ToString()); 98780Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", bf2.GetAttributes().Single().ToString()); 98832Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.GetAttributes().Single().ToString()); 98846CSharpAttributeData nullableAttribute = bf2.GetAttributes().Single(); 98904Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.GetAttributes().Single().ToString()); 98919CSharpAttributeData nullableAttribute = bf2.GetAttributes().Single(); 98973Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.GetAttributes().Single().ToString()); 98987Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", bf2.GetAttributes().Single().ToString()); 99063Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", f2.GetAttributes().Single().ToString()); 99098Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t2.GetAttributes().Single().ToString()); 99347Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.GetAttributes().Single().ToString()); 99361Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", bf2.GetAttributes().Single().ToString()); 100341Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", f1.GetAttributes().Single().ToString()); 100379Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", f1.GetAttributes().Single().ToString()); 100714Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", af1.GetAttributes().Single().ToString()); 100724Assert.Equal("void I<System.Object!>.F1<TF1>(TF1 x) where TF1 : System.Object!", af1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 100728Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(0)", at1.GetAttributes().Single().ToString()); 100729var impl = af1.ExplicitInterfaceImplementations.Single(); 100744Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", bf1.GetAttributes().Single().ToString()); 100753Assert.Equal("void I<System.Object?>.F1<TF1>(TF1 x)", bf1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 100760var impl = bf1.ExplicitInterfaceImplementations.Single(); 100809Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", af1.GetAttributes().Single().ToString()); 100819Assert.Equal("void I<A!>.F1<TF1>(TF1 x) where TF1 : A!", af1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 100823Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(0)", at1.GetAttributes().Single().ToString()); 100824Assert.Equal("void I<A>.F1<TF1>(TF1 x) where TF1 : A", af1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 100846Assert.Equal("void I<A?>.F1<TF1>(TF1 x) where TF1 : A?", bf1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 100851Assert.Equal("void I<A>.F1<TF1>(TF1 x) where TF1 : A", bf1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 100906Assert.Equal("void I<System.Object!>.F1<TF1>(TF1 x) where TF1 : class?, System.Object!", af1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 100910Assert.Equal("void I<System.Object>.F1<TF1>(TF1 x) where TF1 : class?, System.Object", af1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 100930Assert.Equal("void I<System.Object?>.F1<TF1>(TF1 x) where TF1 : class?", bf1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 100934Assert.Equal("void I<System.Object>.F1<TF1>(TF1 x) where TF1 : class?, System.Object", bf1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 101092Assert.Equal("void I<System.Object!>.F1<TF1>(TF1 x) where TF1 : System.Object!, B?", af1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 101096Assert.Equal("void I<System.Object>.F1<TF1>(TF1 x) where TF1 : System.Object, B?", af1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 101116Assert.Equal("void I<System.Object?>.F1<TF1>(TF1 x) where TF1 : B?", bf1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 101120Assert.Equal("void I<System.Object>.F1<TF1>(TF1 x) where TF1 : System.Object, B?", bf1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 101174Assert.Equal("void I<System.Object!, B?>.F1<TF1>(TF1 x) where TF1 : System.Object!, B?", af1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 101178Assert.Equal("void I<System.Object, B>.F1<TF1>(TF1 x) where TF1 : B", af1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 101198Assert.Equal("void I<System.Object?, B?>.F1<TF1>(TF1 x) where TF1 : B?", bf1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 101202Assert.Equal("void I<System.Object, B>.F1<TF1>(TF1 x) where TF1 : B", bf1.ExplicitInterfaceImplementations.Single().ToDisplayString(SymbolDisplayFormat.TestFormatWithConstraints)); 102167Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 102236Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 102270Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 102310Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 102348Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", i1.GetAttributes().Single().ToString()); 102470Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 102721Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 102788Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 102821Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 102860Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 102897Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(1)", i1.GetAttributes().Single().ToString()); 103015Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 103115Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 103158Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 103202Assert.Equal("System.Runtime.CompilerServices.NullableContextAttribute(2)", i1.GetAttributes().Single().ToString()); 104860Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(1)", t11.GetAttributes().Single().ToString()); 104873Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(1)", t1.GetAttributes().Single().ToString()); 104887Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t22.GetAttributes().Single().ToString()); 104901Assert.Equal("System.Runtime.CompilerServices.NullableAttribute(2)", t2.GetAttributes().Single().ToString()); 104971CSharpAttributeData nullableAttribute = t22.GetAttributes().Single(); 105048CSharpAttributeData nullableAttribute = t22.GetAttributes().Single(); 113633var tree = comp.SyntaxTrees.Single(); 113664var tree = comp.SyntaxTrees.Single(); 113842var tree = comp.SyntaxTrees.Single(); 114067var tree = comp.SyntaxTrees.Single(); 115837var c2 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), NullableAnnotation.NotAnnotated))); 115849var c3 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), NullableAnnotation.Annotated))); 115879var i1 = iDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(iDefinition.TypeParameters.Single(), NullableAnnotation.Annotated))); 115888var c2 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), NullableAnnotation.NotAnnotated))); 115895var i2a = i2.Construct(iDefinition.TypeParameters.Single()); 115900var i2b = i2.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(iDefinition.TypeParameters.Single(), NullableAnnotation.Annotated))); 115905var i2c = i2.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(i2.TypeParameters.Single(), NullableAnnotation.Annotated))); 115909var c3 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), NullableAnnotation.Annotated))); 115914var i3b = i3.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(i3.TypeParameters.Single(), NullableAnnotation.Annotated))); 115920var c4 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), customModifiers: modifiers))); 123965Assert.Equal(baseline[i].attribute, f.GetAttributes().Single().ToString()); 124239Assert.Equal(typeParametersBaseline[i].attribute, t.GetAttributes().Single().ToString()); 125175Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125184Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125193Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125204Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125213Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125224Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125234Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125259Assert.Equal(DiagnosticSeverity.Hidden, diagnostics.Single().Severity); 125270Assert.Equal(DiagnosticSeverity.Hidden, diagnostics.Single().Severity); 125280Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125291Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125510Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125519Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125528Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125539Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125548Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125559Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125569Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125594Assert.Equal(DiagnosticSeverity.Hidden, diagnostics.Single().Severity); 125605Assert.Equal(DiagnosticSeverity.Hidden, diagnostics.Single().Severity); 125615Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125626Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 137031Assert.Equal("System.IEquatable<T>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString(true)); 137065Assert.Equal("System.IEquatable<T?>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString(true)); 137093Assert.Equal("System.IEquatable<T>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString(true)); 137129Assert.Equal("System.IEquatable<System.String?>?", t.ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString(true)); 137304Assert.Equal("System.IEquatable<T>?", t.ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString(true)); 137329Assert.Equal("System.IEquatable<T>!", t.ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString(true)); 138283var cT = c.TypeParameters.Single(); 138292Assert.Equal(NullableAnnotation.NotAnnotated, interfaces[0].TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().NullableAnnotation); 138294Assert.Equal(NullableAnnotation.Oblivious, interfaces[1].TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().NullableAnnotation); 138298var i = c.AllInterfacesNoUseSiteDiagnostics.Single(); 138327var cT = c.TypeParameters.Single(); 138331var i = c.AllInterfacesNoUseSiteDiagnostics.Single(); 138367var cT = c.TypeParameters.Single(); 138371var i = c.AllInterfacesNoUseSiteDiagnostics.Single(); 138375cT = c.TypeParameters.Single(); 138379i = c.AllInterfacesNoUseSiteDiagnostics.Single(); 138415var cT = c.TypeParameters.Single(); 138419var i = c.AllInterfacesNoUseSiteDiagnostics.Single(); 138423cT = c.TypeParameters.Single(); 138427i = c.AllInterfacesNoUseSiteDiagnostics.Single(); 138452var cT = c.TypeParameters.Single(); 138456var i = c.AllInterfacesNoUseSiteDiagnostics.Single(); 138482var cT = c.TypeParameters.Single(); 138486var i = c.AllInterfacesNoUseSiteDiagnostics.Single(); 138512var cT = c.TypeParameters.Single(); 138516var i = c.AllInterfacesNoUseSiteDiagnostics.Single(); 138540var cT = c.TypeParameters.Single(); 138544var i = c.AllInterfacesNoUseSiteDiagnostics.Single(); 138809Assert.Equal("System.IEquatable<T>!", f.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString(true)); 138810Assert.Equal("System.IEquatable<T>", f.PartialImplementationPart.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString(true)); 138834Assert.Equal("System.IEquatable<T?>!", f.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString(true)); 138836Assert.Equal("System.IEquatable<T>", f.PartialImplementationPart.TypeParameters[0].ConstraintTypesNoUseSiteDiagnostics.Single().ToTestDisplayString(true)); 145416var tree = comp.SyntaxTrees.Single(); 145457var tree = comp.SyntaxTrees.Single(); 145497var tree = comp.SyntaxTrees.Single(); 145535var tree = comp.SyntaxTrees.Single(); 145573var tree = comp.SyntaxTrees.Single(); 145612var tree = comp.SyntaxTrees.Single(); 145645var tree = comp.SyntaxTrees.Single(); 145677var tree = comp.SyntaxTrees.Single(); 145716var tree = comp.SyntaxTrees.Single(); 145992var tree = comp.SyntaxTrees.Single(); 146023var tree = comp.SyntaxTrees.Single(); 146056var tree = comp.SyntaxTrees.Single(); 146339var tree = comp.SyntaxTrees.Single(); 146378var tree = comp.SyntaxTrees.Single(); 146418var tree = comp.SyntaxTrees.Single(); 146457var tree = comp.SyntaxTrees.Single(); 146492var tree = comp.SyntaxTrees.Single(); 156063var tree = comp.SyntaxTrees.Single(); 156812var tree = comp.SyntaxTrees.Single(); 157647var tree = comp.SyntaxTrees.Single(); 157695var tree = comp.SyntaxTrees.Single(); 158127var tree = comp.SyntaxTrees.Single(); 158163var tree = comp.SyntaxTrees.Single(); 158258var tree = comp.SyntaxTrees.Single(); 158296var tree = comp.SyntaxTrees.Single(); 158337var tree = comp.SyntaxTrees.Single(); 158377var tree = comp.SyntaxTrees.Single(); 158382var t = ((MethodSymbol)comp.GetMember("C.M")).TypeParameters.Single(); 158411var tree = comp.SyntaxTrees.Single(); 158415var t = ((MethodSymbol)comp.GetMember("C.M")).TypeParameters.Single(); 158448var tree = comp.SyntaxTrees.Single(); 158543var tree = comp.SyntaxTrees.Single(); 158591var tree = comp.SyntaxTrees.Single(); 158633var tree = comp.SyntaxTrees.Single(); 158637var t = ((MethodSymbol)comp.GetMember("C.M")).TypeParameters.Single(); 158670var tree = comp.SyntaxTrees.Single(); 158674var t = ((MethodSymbol)comp.GetMember("C.M")).TypeParameters.Single(); 158881var tree = comp.SyntaxTrees.Single(); 160756var tree = comp.SyntaxTrees.Single(); 161306var syntaxTree = comp.SyntaxTrees.Single(); 161352var 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\NullConditionalAssignmentTests.cs (5)
2451Assert.Equal("C c", analysis.ReadInside.Single().ToTestDisplayString()); 2485Assert.Equal("C c", analysis.ReadInside.Single().ToTestDisplayString()); 2491Assert.Equal("C c", analysis.ReadInside.Single().ToTestDisplayString()); 2739var tree = comp.SyntaxTrees.Single(); 2833var tree = 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(); 7486var tree = compilation.SyntaxTrees.Single(); 7702var tree = compilation.SyntaxTrees.Single(); 7855var tree = compilation.SyntaxTrees.Single(); 8015var tree = compilation.SyntaxTrees.Single(); 8552var tree = compilation.SyntaxTrees.Single(); 8587var tree = compilation.SyntaxTrees.Single(); 8631var tree = compilation.SyntaxTrees.Single(); 8681var tree = compilation.SyntaxTrees.Single(); 8755var tree = compilation.SyntaxTrees.Single(); 11977var 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\RawInterpolationTests_Handler.cs (61)
3228Assert.Equal("Attr..ctor(System.String s)", attr.GetAttributes().Single().AttributeConstructor.ToTestDisplayString()); 3253Assert.Equal("Attr..ctor(System.String s)", attr.GetAttributes().Single().AttributeConstructor.ToTestDisplayString()); 5087var sParam = comp.SourceModule.GlobalNamespace.GetTypeMember("C").GetMethod("M").Parameters.Single(); 5089sParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5117sParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5152var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Single(); 5154cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5192var cParam = comp.SourceModule.GlobalNamespace.GetTypeMember("C").GetMethod("M").Parameters.Single(); 5194cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5239var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Single(); 5241cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5281cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5328cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5371cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5418cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5458cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5503var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Single(); 5505cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5545cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5592cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5639cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5686cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5724var cParam = comp.SourceModule.GlobalNamespace.GetTypeMember("C").GetMethod("M").Parameters.Single(); 5726cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5773var cParam = comp.GetTypeByMetadataName("C").GetMethod("M").Parameters.Single(); 5775cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5813var cParam = comp.SourceModule.GlobalNamespace.GetTypeMember("C").GetMethod(".ctor").Parameters.Single(); 5815cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5862var cParam = comp.GetTypeByMetadataName("C").GetMethod(".ctor").Parameters.Single(); 5864cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5907var cParam = substitutedC.GetMethod("M").Parameters.Single(); 5910cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5955var cParam = comp.GetTypeByMetadataName("C`1").GetMethod("M").Parameters.Single(); 5957cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5987cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 5988Assert.Equal(1, cParam.InterpolatedStringHandlerArgumentIndexes.Single()); 6113cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6114Assert.Equal(0, cParam.InterpolatedStringHandlerArgumentIndexes.Single()); 6182cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6183Assert.Equal(0, cParam.InterpolatedStringHandlerArgumentIndexes.Single()); 6212cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6213Assert.Equal(0, cParam.InterpolatedStringHandlerArgumentIndexes.Single()); 6446cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6447Assert.Equal(0, cParam.InterpolatedStringHandlerArgumentIndexes.Single()); 6508cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6509Assert.Equal(0, cParam.InterpolatedStringHandlerArgumentIndexes.Single()); 6630cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6870cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 6997cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7150cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7263cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7334cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7394cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7512cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7630cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 7758cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8028var cParam = module.GlobalNamespace.GetTypeMember("C").GetMethod("M").Parameters.Single(); 8030cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8106var cParam = module.GlobalNamespace.GetTypeMember("C").GetMethod("M").Parameters.Single(); 8108cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString()); 8535cParam.GetAttributes().Single().AttributeClass.ToTestDisplayString());
Semantics\ReadOnlyStructsTests.cs (4)
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(); 1265var testMethodSyntax = (MethodDeclarationSyntax)c.DeclaringSyntaxReferences.Single().GetSyntax();
Semantics\RecordStructTests.cs (12)
2377var tree = comp.SyntaxTrees.Single(); 2401var tree = comp.SyntaxTrees.Single(); 3288var property = cMember.GetMembers("I1").Single(); 3313var tree = comp.SyntaxTrees.Single(); 3355var tree = comp.SyntaxTrees.Single(); 3403var tree = comp.SyntaxTrees.Single(); 3454var tree = comp.SyntaxTrees.Single(); 6062Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 6080Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 6098Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 6127Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 8881var 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 (11)
16615var tree = comp.SyntaxTrees.Single(); 16656var tree = comp.SyntaxTrees.Single(); 16695var tree = comp.SyntaxTrees.Single(); 16791var tree = comp.SyntaxTrees.Single(); 22692var a = m.Parameters[0].GetAttributes().Single().AttributeClass.ToTestDisplayString(); 27229Assert.Equal(assemblyIdentity, module.ReferencedAssemblies.Single()); 27296Assert.Equal(assemblyIdentityLowerVersion, module.ReferencedAssemblies.Single()); 27360Assert.Equal(assemblyIdentity, module.ReferencedAssemblies.Single()); 27411Assert.Equal(ScopedKind.None, type.DelegateInvokeMethod.Parameters.Single().EffectiveScope); 27463Assert.Equal(ScopedKind.None, type.DelegateInvokeMethod.Parameters.Single().EffectiveScope); 27515Assert.Equal(ScopedKind.None, type.DelegateInvokeMethod.Parameters.Single().EffectiveScope);
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 (8)
236var tree = compilation.SyntaxTrees.Single(); 374var goo = global.GetMembers("Goo").Single() as NamespaceSymbol; 377var script = goo.GetTypeMembers("Script").Single(); 380var a = script.GetTypeMembers("A").Single(); 383var b = goo.GetTypeMembers("B").Single(); 509var model = submission.GetSemanticModel(submission.SyntaxTrees.Single()); 553var tree = compilation.SyntaxTrees.Single(); 589var tree = compilation.SyntaxTrees.Single();
Semantics\SemanticErrorTests.cs (7)
3252var type1 = comp.SourceModule.GlobalNamespace.GetMembers("MyClass").Single() as NamedTypeSymbol; 3343var typeArgSymbol = constructedMethodSymbol.TypeArguments.Single(); 3347var paramTypeSymbol = constructedMethodSymbol.Parameters.Single().Type; 7487var tree = compilation.SyntaxTrees.Single(); 13389var tree = compilation2.SyntaxTrees.Single(); 16699compilation.GetDiagnosticsForSyntaxTree(CompilationStage.Compile, compilation.SyntaxTrees.Single(), filterSpanWithinTree: null, includeEarlierStages: true).Verify(expected); 24277var tree = compilation.SyntaxTrees.Single();
Semantics\SimpleLambdaParametersWithModifiersTests.cs (77)
33var tree = compilation.SyntaxTrees.Single(); 41Assert.Equal(RefKind.Ref, symbol.Parameters.Single().RefKind); 42Assert.Equal(SpecialType.System_Int32, symbol.Parameters.Single().Type.SpecialType); 60var tree = compilation.SyntaxTrees.Single(); 92var tree = compilation.SyntaxTrees.Single(); 122var tree = compilation.SyntaxTrees.Single(); 131symbol.Parameters.Single().GetAttributes().Single().AttributeClass, 158var tree = compilation.SyntaxTrees.Single(); 167symbol.Parameters.Single().GetAttributes().Single().AttributeClass, 193var tree = compilation.SyntaxTrees.Single(); 202symbol.Parameters.Single().GetAttributes().Any(a => a.AttributeClass!.Equals( 205symbol.Parameters.Single().GetAttributes().Any(a => a.AttributeClass!.Equals( 225var tree = compilation.SyntaxTrees.Single(); 233Assert.Equal(ScopedKind.ScopedValue, symbol.Parameters.Single().ScopedKind); 234Assert.Equal(compilation.GetTypeByMetadataName(typeof(ReadOnlySpan<>).FullName).GetPublicSymbol(), symbol.Parameters.Single().Type.OriginalDefinition); 253var tree = compilation.SyntaxTrees.Single(); 284var tree = compilation.SyntaxTrees.Single(); 318var tree = compilation.SyntaxTrees.Single(); 326Assert.Equal(ScopedKind.ScopedValue, symbol.Parameters.Single().ScopedKind); 327Assert.True(symbol.Parameters.Single().IsOptional); 328Assert.Equal(compilation.GetTypeByMetadataName(typeof(ReadOnlySpan<>).FullName).GetPublicSymbol(), symbol.Parameters.Single().Type.OriginalDefinition); 347var tree = compilation.SyntaxTrees.Single(); 355Assert.Equal(ScopedKind.ScopedValue, symbol.Parameters.Single().ScopedKind); 356Assert.Equal("scoped", symbol.Parameters.Single().Name); 357Assert.Equal(compilation.GetTypeByMetadataName(typeof(ReadOnlySpan<>).FullName).GetPublicSymbol(), symbol.Parameters.Single().Type.OriginalDefinition); 378var tree = compilation.SyntaxTrees.Single(); 412var tree = compilation.SyntaxTrees.Single(); 444var tree = compilation.SyntaxTrees.Single(); 473var tree = compilation.SyntaxTrees.Single(); 505var tree = compilation.SyntaxTrees.Single(); 538var tree = compilation.SyntaxTrees.Single(); 571var tree = compilation.SyntaxTrees.Single(); 633var tree = compilation.SyntaxTrees.Single(); 661var tree = compilation.SyntaxTrees.Single(); 693var tree = compilation.SyntaxTrees.Single(); 722var tree = compilation.SyntaxTrees.Single(); 751var tree = compilation.SyntaxTrees.Single(); 782var tree = compilation.SyntaxTrees.Single(); 816var tree = compilation.SyntaxTrees.Single(); 850var tree = compilation.SyntaxTrees.Single(); 882var tree = compilation.SyntaxTrees.Single(); 928var tree = compilation.SyntaxTrees.Single(); 956var tree = compilation.SyntaxTrees.Single(); 981var tree = compilation.SyntaxTrees.Single(); 1000Assert.Equal(RefKind.Ref, symbol.Parameters.Single().RefKind); 1001Assert.Equal(SpecialType.System_Int32, symbol.Parameters.Single().Type.SpecialType); 1005Assert.True(operation.Body.Operations.Single() is IReturnOperation { ReturnedValue: null }); 1032var tree = compilation.SyntaxTrees.Single(); 1067var tree = compilation.SyntaxTrees.Single(); 1096var tree = compilation.SyntaxTrees.Single(); 1125var tree = compilation.SyntaxTrees.Single(); 1152var tree = compilation.SyntaxTrees.Single(); 1160Assert.Equal(ScopedKind.None, symbol.Parameters.Single().ScopedKind); 1161Assert.Equal("x", symbol.Parameters.Single().Name); 1162Assert.Equal(compilation.GetTypeByMetadataName(typeof(ReadOnlySpan<>).FullName).GetPublicSymbol(), symbol.Parameters.Single().Type.OriginalDefinition); 1181var tree = compilation.SyntaxTrees.Single(); 1189Assert.Equal(ScopedKind.ScopedValue, symbol.Parameters.Single().ScopedKind); 1190Assert.Equal("x", symbol.Parameters.Single().Name); 1191Assert.Equal(compilation.GetTypeByMetadataName(typeof(ReadOnlySpan<>).FullName).GetPublicSymbol(), symbol.Parameters.Single().Type.OriginalDefinition); 1215var tree = compilation.SyntaxTrees.Single(); 1324var tree = compilation.SyntaxTrees.Single(); 1332Assert.Equal(RefKind.Ref, symbol.Parameters.Single().RefKind); 1333Assert.Equal(SpecialType.System_Int32, symbol.Parameters.Single().Type.SpecialType); 1354var tree = compilation.SyntaxTrees.Single(); 1362Assert.Equal(RefKind.RefReadOnlyParameter, symbol.Parameters.Single().RefKind); 1363Assert.Equal(SpecialType.System_Int32, symbol.Parameters.Single().Type.SpecialType); 1381var tree = compilation.SyntaxTrees.Single(); 1389Assert.Equal(RefKind.RefReadOnlyParameter, symbol.Parameters.Single().RefKind); 1390Assert.Equal(SpecialType.System_Int32, symbol.Parameters.Single().Type.SpecialType); 1414var tree = compilation.SyntaxTrees.Single(); 1422Assert.Equal(RefKind.RefReadOnlyParameter, symbol.Parameters.Single().RefKind); 1423Assert.Equal(SpecialType.System_Int32, symbol.Parameters.Single().Type.SpecialType); 1447var tree = compilation.SyntaxTrees.Single(); 1455Assert.Equal(RefKind.Ref, symbol.Parameters.Single().RefKind); 1456Assert.Equal(SpecialType.None, symbol.Parameters.Single().Type.SpecialType);
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\StructsTests.cs (1)
395var method = (RetargetingMethodSymbol)@struct.GetMembers().Single();
Semantics\SuppressAccessibilityChecksTests.cs (1)
64Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).CandidateSymbols.Single().Name);
Semantics\SynthesizedStaticConstructorTests.cs (1)
291var typeSymbol = (SourceNamedTypeSymbol)compilation.GlobalNamespace.GetMembers("C").Single();
Semantics\TargetTypedDefaultTests.cs (1)
3604Assert.Equal(ConversionKind.ImplicitNumeric, conversion.UnderlyingConversions.Single().Kind);
Semantics\TopLevelStatementsTests.cs (95)
60ParameterSymbol parameter = entryPoint.Parameters.Single(); 200Assert.Same(refSymbol, model1.LookupSymbols(localRef.SpanStart, name: refSymbol.Name).Single()); 243Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 366Assert.Same(declSymbol, model2.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 487Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 496Assert.Same(declSymbol, model1.LookupSymbols(localFuncRef.SpanStart, name: declSymbol.Name).Single()); 539Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 550Assert.Same(declSymbol, model1.LookupSymbols(localRef.SpanStart, name: declSymbol.Name).Single()); 579Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: declSymbol.Name).Single()); 588Assert.Same(declSymbol, model1.LookupSymbols(localFuncRef.SpanStart, name: declSymbol.Name).Single()); 597Assert.Same(refSymbol, model1.LookupSymbols(localRef.SpanStart, name: refSymbol.Name).Single()); 697var tree = comp.SyntaxTrees.Single(); 1520var tree = comp.SyntaxTrees.Single(); 1693Assert.Same(getHashCode, model1.LookupSymbols(localDecl.SpanStart, name: getHashCode.Name).Single()); 1698Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: "Test").Single()); 1703Assert.Same(testType, model1.LookupNamespacesAndTypes(localDecl.SpanStart, name: "Test").Single()); 1731Assert.Same(testType, model.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 1768Assert.Same(declSymbol, model.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 1773Assert.Same(testType, model.LookupNamespacesAndTypes(nameRef.SpanStart, name: "Test").Single()); 1866Assert.Same(getHashCode, model1.LookupSymbols(localDecl.SpanStart, name: getHashCode.Name).Single()); 1871Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: "Test").Single()); 1876Assert.Same(testType, model1.LookupNamespacesAndTypes(localDecl.SpanStart, name: "Test").Single()); 1899Assert.Same(testType, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 1936Assert.Same(declSymbol, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 1941Assert.Same(testType, model2.LookupNamespacesAndTypes(nameRef.SpanStart, name: "Test").Single()); 2094Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: "Test").Single()); 2099Assert.Same(testType, model1.LookupNamespacesAndTypes(localDecl.SpanStart, name: "Test").Single()); 2114Assert.Same(testType, model1.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2149Assert.Same(declSymbol, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2154Assert.Same(testType, model2.LookupNamespacesAndTypes(nameRef.SpanStart, name: "Test").Single()); 2258Assert.Same(declSymbol, model1.LookupSymbols(localDecl.SpanStart, name: "Test").Single()); 2263Assert.Same(testType, model1.LookupNamespacesAndTypes(localDecl.SpanStart, name: "Test").Single()); 2280Assert.Same(testType, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2315Assert.Same(declSymbol, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2320Assert.Same(testType, model2.LookupNamespacesAndTypes(nameRef.SpanStart, name: "Test").Single()); 2437Assert.Same(testType, model1.LookupSymbols(labelDecl.SpanStart, name: "Test").Single()); 2442Assert.Same(testType, model1.LookupNamespacesAndTypes(labelDecl.SpanStart, name: "Test").Single()); 2444Assert.Same(declSymbol, model1.LookupLabels(labelDecl.SpanStart).Single()); 2445Assert.Same(declSymbol, model1.LookupLabels(labelDecl.SpanStart, name: "Test").Single()); 2460Assert.Same(testType, model1.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2475Assert.Same(testType, model1.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2476Assert.Same(declSymbol, model1.LookupLabels(nameRef.SpanStart).Single()); 2477Assert.Same(declSymbol, model1.LookupLabels(nameRef.SpanStart, name: "Test").Single()); 2512Assert.Same(testType, model2.LookupSymbols(nameRef.SpanStart, name: "Test").Single()); 2517Assert.Same(testType, model2.LookupNamespacesAndTypes(nameRef.SpanStart, name: "Test").Single()); 3954Assert.Same(testType, model.LookupSymbols(nameRef.SpanStart, name: "args").Single()); 3968Assert.Same(parameter, model.LookupSymbols(nameRef.SpanStart, name: "args").Single()); 3973Assert.Same(testType, model.LookupNamespacesAndTypes(nameRef.SpanStart, name: "args").Single()); 4008Assert.Same(testType, model.LookupSymbols(nameRef.SpanStart, name: "args").Single()); 4013Assert.Same(testType, model.LookupNamespacesAndTypes(nameRef.SpanStart, name: "args").Single()); 4103Assert.Same(testType, model.LookupSymbols(nameRef.SpanStart, name: "args").Single()); 4138Assert.Same(testType, model.LookupSymbols(nameRef.SpanStart, name: "args").Single()); 4143Assert.Same(testType, model.LookupNamespacesAndTypes(nameRef.SpanStart, name: "args").Single()); 4214var tree = comp.SyntaxTrees.Single(); 4892var tree = comp.SyntaxTrees.Single(); 4977var tree = comp.SyntaxTrees.Single(); 6044Assert.Same(declSymbol, model1.LookupSymbols(localRef.SpanStart, name: declSymbol.Name).Single()); 6232var syntaxTree = comp.SyntaxTrees.Single(); 6239Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).CandidateSymbols.Single().Name); 6276var syntaxTree = comp.SyntaxTrees.Single(); 6283Assert.Same(x, semanticModel.LookupSymbols(localDecl.SpanStart, name: "x").Single()); 6285Assert.Same(x, semanticModel.LookupSymbols(localRef.SpanStart, name: "x").Single()); 6316var syntaxTree1 = comp.SyntaxTrees.Single(); 6328Assert.Same(xDecl, semanticModel1.LookupSymbols(localDecl.SpanStart, name: "x").Single()); 6330Assert.Same(xRef, semanticModel1.LookupSymbols(localRef.SpanStart, name: "x").Single()); 6379Assert.Same(xDecl, semanticModel1.LookupSymbols(localDecl.SpanStart, name: "x").Single()); 6385Assert.Same(xRef, semanticModel2.LookupSymbols(localRef.SpanStart, name: "x").Single()); 6456Assert.Same(globalStatement.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 6538switch (context.Symbol.DeclaringSyntaxReferences.Single().GetSyntax().ToString()) 6614switch (context.Symbol.DeclaringSyntaxReferences.Single().GetSyntax().ToString()) 6657Assert.Equal("System.Console.WriteLine(1);", context.Symbol.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 6664Assert.Equal("System.Console.WriteLine(2);", context.Symbol.DeclaringSyntaxReferences.Single().GetSyntax().ToString()); 6722Assert.Same(context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree, context.Operation.Syntax.SyntaxTree); 6743Assert.Same(context.ContainingSymbol.DeclaringSyntaxReferences.Single().GetSyntax(), context.Operation.Syntax); 6802Assert.Equal(SyntaxKind.CompilationUnit, context.OperationBlocks.Single().Syntax.Kind()); 6804switch (context.OperationBlocks.Single().Syntax.ToString()) 6860Assert.Equal(SyntaxKind.CompilationUnit, context.OperationBlocks.Single().Syntax.Kind()); 6862switch (context.OperationBlocks.Single().Syntax.ToString()) 7087var decl = (CSharpSyntaxNode)context.ContainingSymbol.DeclaringSyntaxReferences.Single().GetSyntax(); 7354Assert.Equal(SyntaxKind.CompilationUnit, context.OperationBlocks.Single().Syntax.Kind()); 7356switch (context.OperationBlocks.Single().Syntax.ToString()) 7421Assert.Same(context.ContainingSymbol.DeclaringSyntaxReferences.Single().GetSyntax(), context.Operation.Syntax); 7609Assert.Equal("System.String[missing][] args", entryPoint.Parameters.Single().ToTestDisplayString()); 8577var tree = comp.SyntaxTrees.Single(); 8584Assert.Equal("System.String[] args", symbols.Single().ToTestDisplayString()); 8587Assert.Equal("System.String[] args", symbols.Single().ToTestDisplayString()); 8589Assert.Equal("System.String[] args", symbols.Single().ToTestDisplayString()); 8592Assert.Equal("System.String[] args", symbols.Single().ToTestDisplayString()); 8594Assert.Equal("System.String[] args", symbols.Single().ToTestDisplayString()); 8650var tree = comp.SyntaxTrees.Single(); 8657Assert.Equal("System.String[] args", symbols.Single().ToTestDisplayString()); 8672var tree = comp.SyntaxTrees.Single(); 8679Assert.Equal("System.String[] args", symbols.Single().ToTestDisplayString()); 8694var tree = comp.SyntaxTrees.Single(); 8701Assert.Equal("System.String[] args", symbols.Single().ToTestDisplayString());
Semantics\TryCatchTests.cs (1)
42var tree = compilation.SyntaxTrees.Single();
Semantics\UninitializedNonNullableFieldTests.cs (4)
2752var actualAdditionalLocations = comp.GetDiagnostics().Single().AdditionalLocations; 2753Assert.Equal(property.Locations.Single(), actualAdditionalLocations.Single()); 2773var actualAdditionalLocations = comp.GetDiagnostics().Single().AdditionalLocations; 2774Assert.Equal(property.Locations.Single(), actualAdditionalLocations.Single());
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 (43)
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); 1552Assert.Equal("// generated", runResults.Results.Single().GeneratedSources.Single().SourceText.ToString()); 1562VerifyGeneratorExceptionDiagnostic<InvalidOperationException>(runResults.Diagnostics.Single(), nameof(PipelineCallbackGenerator), "abc"); 1564Assert.Equal(e, runResults.Results.Single().Exception); 2071Assert.Equal(texts[0], value.Item2.Single()); 2100Assert.Equal(texts[0], value.Item2.Single()); 2115Assert.Equal(texts[0], value.Item2.Single()); 2123Assert.Equal(texts[0], value.Item2.Single()); 2210var generatedTree = driver.GetRunResult().GeneratedTrees.Single(); 2383driver.GetRunResult().Results.Single().TrackedSteps["Select"].Select(r => r.Outputs.Single())); 2404driver.GetRunResult().Results.Single().TrackedSteps["Select"].Select(r => r.Outputs.Single())); 3762VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(PipelineCallbackGenerator), "Reported diagnostic 'TEST0001' has a source location in file '/detached', which is not part of the compilation being analyzed.", "diagnostic"); 3796VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(PipelineCallbackGenerator), "Reported diagnostic 'TEST0001' has a source location in file '/detached', which is not part of the compilation being analyzed.", "diagnostic"); 3825VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(CallbackGenerator), "Reported diagnostic 'TEST0001' has a source location in file '/detached', which is not part of the compilation being analyzed.", "diagnostic"); 3856VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(CallbackGenerator), "Reported diagnostic 'TEST0001' has a source location in file '/detached', which is not part of the compilation being analyzed.", "diagnostic"); 3888VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(PipelineCallbackGenerator), "Reported diagnostic 'TEST0001' has a source location '[0..100)' in file '/original', which is outside of the given file.", "diagnostic"); 3921VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(PipelineCallbackGenerator), "Reported diagnostic 'TEST0001' has a source location '[0..100)' in file '/original', which is outside of the given file.", "diagnostic"); 3950VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(CallbackGenerator), "Reported diagnostic 'TEST0001' has a source location '[0..100)' in file '/original', which is outside of the given file.", "diagnostic"); 3980VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(CallbackGenerator), "Reported diagnostic 'TEST0001' has a source location '[0..100)' in file '/original', which is outside of the given file.", "diagnostic"); 4012VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(PipelineCallbackGenerator), "Reported diagnostic has an ID 'TEST 0001', which is not a valid identifier.", "diagnostic"); 4041VerifyArgumentExceptionDiagnostic(diagnostics.Single(), nameof(CallbackGenerator), "Reported diagnostic has an ID 'TEST 0001', which is not a valid identifier.", "diagnostic"); 4233var tree = compilation.GetMember(className).DeclaringSyntaxReferences.Single().SyntaxTree;
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.cs (163)
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()))); 1299var tree = compilation.GetMember(className).DeclaringSyntaxReferences.Single().SyntaxTree; 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 (3600)
Compilation\CompilationAPITests.cs (8)
1903Assert.Equal("alias", comp.References.Last().Properties.Aliases.Single()); 2632Assert.Equal(loc1, type.GetMembers("m1").Single().Locations.Single()); 2633Assert.Equal(loc2, type.GetMembers("m2").Single().Locations.Single()); 2838var syntaxTree = compilation.SyntaxTrees.Single(); 2873var syntaxTree = compilation.SyntaxTrees.Single(); 2905var 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 (53)
1532var candidate = bindInfo.CandidateSymbols.Single(); 1713Assert.Equal(symbol, lookupSymbols.Single()); 1748Assert.Equal(symbol, lookupSymbols.Single()); 1816var candidate = (IMethodSymbol)bindInfo.CandidateSymbols.Single(); 2224typeParameter = classC.TypeParameters.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)
119Assert.Equal(external4, compilation.SyntaxTrees.Single());
Compilation\ReferenceManagerTests.cs (2)
1771var tree1 = comp1.SyntaxTrees.Single(); 1821var tree1 = comp1.SyntaxTrees.Single();
Compilation\SemanticModelAPITests.cs (80)
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(); 796var xSym = mainType.GetMembers("x").Single() as IFieldSymbol; 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(); 3121var tree = comp.SyntaxTrees.Single(); 3155var tree = comp.SyntaxTrees.Single(); 3185var tree = comp.SyntaxTrees.Single(); 3220var tree = comp.SyntaxTrees.Single(); 3250var tree = comp.SyntaxTrees.Single(); 3287var tree = comp.SyntaxTrees.Single(); 3328var tree = comp.SyntaxTrees.Single(); 3369var tree = comp.SyntaxTrees.Single(); 3403var tree = comp.SyntaxTrees.Single(); 3445var tree = comp.SyntaxTrees.Single(); 3486var tree = comp.SyntaxTrees.Single(); 3527var tree = comp.SyntaxTrees.Single(); 3552var tree = compilation.SyntaxTrees.Single(); 3573var tree = compilation.SyntaxTrees.Single(); 3612var tree = comp.SyntaxTrees.Single(); 3658Assert.False(((NamedTypeSymbol)newSymbol).TypeArguments().Single().IsErrorType()); 3785var firstParamType = ((ISymbol)exprInfo.CandidateSymbols.Single()).GetParameters().First().Type; 3847var tree = comp.SyntaxTrees.Single(); 3874var tree = comp.SyntaxTrees.Single(); 3879var symbol = model.LookupSymbols(syntax.SpanStart, name: "Alias").Single(); 3902var tree = comp.SyntaxTrees.Single(); 3906var symbol = model.LookupSymbols(endPosition, name: "M0").Single(); 4059var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4086var tree = compilation.SyntaxTrees.Single(); 4115var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 4135var tree = comp.SyntaxTrees.Single(); 4172var tree = comp.SyntaxTrees.Single(); 4215var tree = comp.SyntaxTrees.Single(); 4239var tree = comp.SyntaxTrees.Single(); 4267var tree = comp.SyntaxTrees.Single(); 4305var tree = comp.SyntaxTrees.Single(); 4357var tree = comp.SyntaxTrees.Single(); 4408var classA = (NamedTypeSymbol)globalNs.GetMembers("A").Single(); 4409var fieldX = (IFieldSymbol)classA.GetMembers("X").Single().ISymbol; 4410var fieldY = (IFieldSymbol)classA.GetMembers("Y").Single().ISymbol; 4411var fieldZ = (IFieldSymbol)classA.GetMembers("Z").Single().ISymbol; 4483var method = (IMethodSymbol)comp.GetTypeByMetadataName("C").GetMembers("M").Single().GetPublicSymbol(); 4484var attribute = method.GetAttributes().Single(); 4487var tree = comp.SyntaxTrees.Single(); 4504var tree = comp.SyntaxTrees.Single(); 4568var tree = comp.SyntaxTrees.Single(); 4641var tree = compilation.SyntaxTrees.Single(); 4655var tree = compilation.SyntaxTrees.Single(); 4674var tree = compilation.SyntaxTrees.Single(); 4691var tree = compilation.SyntaxTrees.Single(); 4706var tree = compilation.SyntaxTrees.Single(); 4722var tree = compilation.SyntaxTrees.Single(); 4738var tree = compilation.SyntaxTrees.Single(); 4757var tree = compilation.SyntaxTrees.Single(); 4773var tree = compilation.SyntaxTrees.Single(); 4788var tree = compilation.SyntaxTrees.Single();
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (66)
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(); 3046var ns1 = globalNS.GetMembers("NS").Single() as NamespaceSymbol; 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)
8261var tree = compilation.SyntaxTrees.Single(); 8426var tree = compilation.SyntaxTrees.Single(); 8450var tree = compilation.SyntaxTrees.Single(); 8686Assert.Equal("System.Int32 Test.M()", semanticInfo.CandidateSymbols.Single().ToTestDisplayString()); 9064Assert.Equal("System.Int32 Test.M()", semanticInfo.CandidateSymbols.Single().ToTestDisplayString()); 9276Assert.Equal(constructedFrom, a.GetTypeMembers("B").Single()); 14590Utils.CheckSymbol(semanticInfo.CandidateSymbols.Single(), "void C.M<T>(T t)"); 14648var tree = comp.SyntaxTrees.Single(); 14781SyntaxTree tree = compilation.SyntaxTrees.Single(); 14877SyntaxTree tree = compilation.SyntaxTrees.Single(); 14988SyntaxTree tree = compilation.SyntaxTrees.Single();
DeclarationTests.cs (15)
69var na1 = decl1.Children.Single(); 70var na2 = decl2.Children.Single(); 79var nb1 = na1.Children.Single(); 80var nb2 = na2.Children.Single(); 90var ct2 = (SingleTypeDeclaration)nb2.Children.Single(); 106var d1 = ct1.Children.Single(); 107var d2 = ct2.Children.Single(); 134var na = mr.Children.Single(); 138var nb = na.Children.Single(); 152var d = ct.Children.Single(); 167na = mr.Children.Single(); 171nb = na.Children.Single(); 185d = ct.Children.Single(); 311var parameterType = method.Parameters.Single(); 354var parameterType = method.Parameters.Single();
DocumentationComments\ConstructorDocumentationCommentTests.cs (3)
41_acmeNamespace = (NamespaceSymbol)_compilation.GlobalNamespace.GetMembers("Acme").Single(); 42_widgetClass = _acmeNamespace.GetTypeMembers("Widget").Single(); 48var staticConstructorSymbol = _widgetClass.GetMembers(WellKnownMemberNames.StaticConstructorName).Single();
DocumentationComments\CrefTests.cs (109)
304var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 444var expectedSymbol = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>("Program").TypeParameters.Single(); 910var ctorA = typeA.InstanceConstructors.Single(); 913var ctorB = typeB.InstanceConstructors.Single(); 1006var ctorA = typeA.InstanceConstructors.Single(); 1009var ctorB = typeB.InstanceConstructors.Single(); 1105var ctorA = typeA.InstanceConstructors.Single(); 1108var ctorB = typeB.InstanceConstructors.Single(); 1270Single(m => m.Parameters.Single().Type.SpecialType == SpecialType.System_Int32); 1314Single(m => m.ParameterRefKinds.Single() == RefKind.Out); 1432var typeArgument = actualSymbol.GetMemberTypeArgumentsNoUseSiteDiagnostics().Single(); 1433Assert.NotEqual(expectedOriginalDefinitionSymbol.TypeParameters.Single(), typeArgument); 1457var typeArgument = actualSymbol.GetMemberTypeArgumentsNoUseSiteDiagnostics().Single(); 1458Assert.NotEqual(expectedOriginalDefinitionSymbol.TypeParameters.Single(), typeArgument); 1483var typeArgument = actualSymbol.GetMemberTypeArgumentsNoUseSiteDiagnostics().Single(); 1484Assert.NotEqual(expectedOriginalDefinitionSymbol.TypeParameters.Single(), typeArgument); 1509var typeArgument = actualSymbol.GetMemberTypeArgumentsNoUseSiteDiagnostics().Single(); 1510Assert.NotEqual(expectedOriginalDefinitionSymbol.TypeParameters.Single(), typeArgument); 1561AssertEx.All(actualTypeParameters, p => p.Locations.Single() == p.DeclaringSyntaxReferences.Single().GetLocation()); 1602.Single(method => method.Parameters.Single().Type.TypeKind == TypeKind.TypeParameter); 1606var typeArgument = actualSymbol.GetMemberTypeArgumentsNoUseSiteDiagnostics().Single(); 1607Assert.NotEqual(expectedOriginalDefinitionSymbol.TypeParameters.Single(), typeArgument); 1611Assert.Equal(typeArgument, actualSymbol.GetParameters().Single().Type); 1669var actualParameterType = actualWinner.GetParameters().Single().Type; 1707var actualParameterType = actualWinner.GetParameters().Single().Type; 1708Assert.Equal(actualParameterType, actualWinner.ContainingType.TypeArguments().Single()); 1709Assert.Equal(actualParameterType, actualWinner.ContainingType.ContainingType.TypeArguments().Single()); 1735Single(method => method.Parameters.Single().Type.TypeKind == TypeKind.TypeParameter); 1739Assert.Equal(TypeKind.TypeParameter, actualSymbol.GetParameterTypes().Single().Type.TypeKind); 1761Single(method => method.Parameters.Single().Type.TypeKind == TypeKind.TypeParameter); 1765Assert.Equal(TypeKind.TypeParameter, actualSymbol.GetParameterTypes().Single().Type.TypeKind); 1782var expectedOriginalDefinitionSymbol = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>("A").InstanceConstructors.Single(); 1814var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 2239var expectedSymbol = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 2260var expectedSymbol = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 2412Single(method => method.ParameterTypesWithAnnotations.Single().SpecialType == SpecialType.System_Int32); 2452var expectedSymbol = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>(WellKnownMemberNames.LogicalNotOperatorName).InstanceConstructors.Single(); 2473var expectedSymbol = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>(WellKnownMemberNames.LogicalNotOperatorName).InstanceConstructors.Single(); 2494var expectedSymbol = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>(WellKnownMemberNames.LogicalNotOperatorName).InstanceConstructors.Single(); 2637var expectedSymbol = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>(WellKnownMemberNames.DivisionOperatorName).InstanceConstructors.Single(); 2681var expectedSymbol = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>(WellKnownMemberNames.DivisionOperatorName).InstanceConstructors.Single(); 2702var expectedSymbol = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>(WellKnownMemberNames.DivisionOperatorName).InstanceConstructors.Single(); 2805Single(method => method.ParameterTypesWithAnnotations.Single().SpecialType == SpecialType.System_Int32); 2841Single(method => method.ParameterTypesWithAnnotations.Single().SpecialType == SpecialType.System_Int32 && method.ReturnType.SpecialType == SpecialType.System_Int32); 2881var expectedSymbol = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>(WellKnownMemberNames.ImplicitConversionName).InstanceConstructors.Single(); 2902var expectedSymbol = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>(WellKnownMemberNames.ExplicitConversionName).InstanceConstructors.Single(); 2923var expectedSymbol = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>(WellKnownMemberNames.ImplicitConversionName).InstanceConstructors.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()); 3074var expectedIndexer = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single().ISymbol; 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()); 5012var constructor = compilation.GlobalNamespace.GetMember<INamedTypeSymbol>("G").InstanceConstructors.Single(); 5044var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 5084var outerCtor = compilation.GlobalNamespace.GetMember<INamedTypeSymbol>("Outer").InstanceConstructors.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(); 5846InstanceConstructors.Single(); 5968var expectedSymbol = compilation.GlobalNamespace.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(); 6020var expectedSymbolOriginalDefinition = compilation.GlobalNamespace.GetMember<INamedTypeSymbol>("C").InstanceConstructors.Single(); 6348Assert.Equal(accessor, nonCrefInfo.CandidateSymbols.Single()); 6363Assert.Equal(inheritedType, nonCrefInfo.CandidateSymbols.Single()); 6537Assert.Equal(TypeKind.Error, ((INamedTypeSymbol)actualSymbol1).TypeArguments.Single().TypeKind); 6665var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 6672var parameterSymbol = ((IMethodSymbol)model.GetSymbolInfo(cref).Symbol).Parameters.Single(); 6708var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 6715var parameterSymbol = ((IMethodSymbol)model.GetSymbolInfo(cref).Symbol).Parameters.Single(); 6858var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 7027var model = comp.GetSemanticModel(comp.SyntaxTrees.Single());
DocumentationComments\DestructorDocumentationCommentTests.cs (4)
34_acmeNamespace = (NamespaceSymbol)_compilation.GlobalNamespace.GetMembers("Acme").Single(); 35_widgetClass = _acmeNamespace.GetTypeMembers("Widget").Single(); 41Assert.Equal("M:Acme.Widget.Finalize", _widgetClass.GetMembers("Finalize").Single().GetDocumentationCommentId()); 46", _widgetClass.GetMembers("Finalize").Single().GetDocumentationCommentXml());
DocumentationComments\DocumentationCommentCompilerTests.cs (17)
1291Assert.Equal("p2", method.Parameters.Single().Name); 1348Assert.Equal("p2", method.Parameters.Single().Name); 1411Assert.Equal("p2", method.Parameters.Single().Name); 1474Assert.Equal("p2", method.Parameters.Single().Name); 1652var property = comp.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 1971var indexer = module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 1972Assert.Equal("p2", indexer.Parameters.Single().Name); 2029var indexer = module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 2030Assert.Equal("p2", indexer.Parameters.Single().Name); 2093var indexer = module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 2094Assert.Equal("p2", indexer.Parameters.Single().Name); 2157var indexer = module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 2158Assert.Equal("p2", indexer.Parameters.Single().Name); 3039Assert.Equal("p2", ctor.Parameters.Single().Name); 3106Assert.Equal("p2", ctor.Parameters.Single().Name); 3173Assert.Equal("p2", ctor.Parameters.Single().Name); 3234Assert.Equal("p2", ctor.Parameters.Single().Name);
DocumentationComments\DocumentationCommentIDTests.cs (6)
29var tree = comp.SyntaxTrees.Single(); 142var tree = comp.SyntaxTrees.Single(); 163var tree = comp.SyntaxTrees.Single(); 256var symbol = comp.GlobalNamespace.GetMember<NamedTypeSymbol>("C").GetMember<MethodSymbol>("M").Parameters.Single(); 307var tree = comp.SyntaxTrees.Single(); 325var symbol = type.TypeParameters.Single();
DocumentationComments\FieldDocumentationCommentTests.cs (17)
58_acmeNamespace = (NamespaceSymbol)_compilation.GlobalNamespace.GetMembers("Acme").Single(); 59_widgetClass = _acmeNamespace.GetTypeMembers("Widget").Single(); 60_enumSymbol = _acmeNamespace.GetTypeMembers("E").Single(); 61_valueType = _acmeNamespace.GetTypeMembers("ValueType").Single(); 67var total1 = _valueType.GetMembers("total1").Single(); 68var total2 = _valueType.GetMembers("total2").Single(); 86Assert.Equal("F:Acme.Widget.NestedClass.value", _widgetClass.GetTypeMembers("NestedClass").Single() 87.GetMembers("value").Single().GetDocumentationCommentId()); 93Assert.Equal("F:Acme.Widget.message", _widgetClass.GetMembers("message").Single().GetDocumentationCommentId()); 99Assert.Equal("F:Acme.Widget.defaultColor", _widgetClass.GetMembers("defaultColor").Single().GetDocumentationCommentId()); 105Assert.Equal("F:Acme.Widget.PI", _widgetClass.GetMembers("PI").Single().GetDocumentationCommentId()); 111Assert.Equal("F:Acme.Widget.monthlyAverage", _widgetClass.GetMembers("monthlyAverage").Single().GetDocumentationCommentId()); 117Assert.Equal("F:Acme.Widget.array1", _widgetClass.GetMembers("array1").Single().GetDocumentationCommentId()); 123Assert.Equal("F:Acme.Widget.array2", _widgetClass.GetMembers("array2").Single().GetDocumentationCommentId()); 129Assert.Equal("F:Acme.Widget.pCount", _widgetClass.GetMembers("pCount").Single().GetDocumentationCommentId()); 135Assert.Equal("F:Acme.Widget.ppValues", _widgetClass.GetMembers("ppValues").Single().GetDocumentationCommentId()); 141var field = _enumSymbol.GetMembers("A").Single();
DocumentationComments\IncludeTests.cs (6)
53var acmeNamespace = (NamespaceSymbol)compilation.GlobalNamespace.GetMembers("Acme").Single(); 54var widgetClass = acmeNamespace.GetTypeMembers("Widget").Single(); 56var symbol = widgetClass.GetMembers(symbolName).Single(); 115var acmeNamespace = (NamespaceSymbol)compilation.GlobalNamespace.GetMembers("Acme").Single(); 116var widgetClass = acmeNamespace.GetTypeMembers("Widget").Single(); 118var symbol = widgetClass.GetMembers(symbolName).Single();
DocumentationComments\MethodDocumentationCommentTests.cs (29)
71_acmeNamespace = (NamespaceSymbol)_compilation.GlobalNamespace.GetMembers("Acme").Single(); 72_widgetClass = _acmeNamespace.GetTypeMembers("Widget").Single(); 78Assert.Equal("M:Acme.ValueType.M(System.Int32)", _acmeNamespace.GetTypeMembers("ValueType").Single().GetMembers("M").Single().GetDocumentationCommentId()); 84Assert.Equal("M:Acme.Widget.NestedClass.M(System.Int32)", _widgetClass.GetTypeMembers("NestedClass").Single().GetMembers("M").Single().GetDocumentationCommentId()); 90var m0 = _widgetClass.GetMembers("M0").Single(); 102Assert.Equal("M:Acme.Widget.M1(System.Char,System.Single@,Acme.ValueType@)", _widgetClass.GetMembers("M1").Single().GetDocumentationCommentId()); 108Assert.Equal("M:Acme.Widget.M2(System.Int16[],System.Int32[0:,0:],System.Int64[][])", _widgetClass.GetMembers("M2").Single().GetDocumentationCommentId()); 114Assert.Equal("M:Acme.Widget.M3(System.Int64[][],Acme.Widget[0:,0:,0:][])", _widgetClass.GetMembers("M3").Single().GetDocumentationCommentId()); 120Assert.Equal("M:Acme.Widget.M4(System.Char*,Color**)", _widgetClass.GetMembers("M4").Single().GetDocumentationCommentId()); 126Assert.Equal("M:Acme.Widget.M5(System.Void*,System.Double*[0:,0:][])", _widgetClass.GetMembers("M5").Single().GetDocumentationCommentId()); 132Assert.Equal("M:Acme.Widget.M6(System.Int32,System.Object[])", _widgetClass.GetMembers("M6").Single().GetDocumentationCommentId()); 139_widgetClass.GetMembers("M7").Single().GetDocumentationCommentId()); 146_widgetClass.GetMembers("M8").Single().GetDocumentationCommentId()); 153_widgetClass.GetMembers("M9").Single().GetDocumentationCommentId()); 160_widgetClass.GetMembers("M10").Single().GetDocumentationCommentId()); 166Assert.Equal("M:Acme.MyList`1.Test(`0)", _acmeNamespace.GetTypeMembers("MyList", 1).Single().GetMembers("Test").Single().GetDocumentationCommentId()); 173Assert.Equal("M:Acme.MyList`1.Zip(Acme.MyList{`0})", _acmeNamespace.GetTypeMembers("MyList", 1).Single().GetMembers("Zip").Single().GetDocumentationCommentId()); 180Assert.Equal("M:Acme.MyList`1.ReallyZip(Acme.MyList{Acme.MyList{`0}})", _acmeNamespace.GetTypeMembers("MyList", 1).Single().GetMembers("ReallyZip").Single().GetDocumentationCommentId()); 186Assert.Equal("M:Acme.UseList.Process(Acme.MyList{System.Int32})", _acmeNamespace.GetTypeMembers("UseList").Single().GetMembers("Process").Single().GetDocumentationCommentId()); 192Assert.Equal("M:Acme.UseList.GetValues``1(``0)", _acmeNamespace.GetTypeMembers("UseList").Single().GetMembers("GetValues").Single().GetDocumentationCommentId()); 219Assert.Equal("M:Acme.ValueType.op_Explicit(System.Byte)~Acme.ValueType", _acmeNamespace.GetTypeMembers("ValueType").Single().GetMembers("op_Explicit").Single().GetDocumentationCommentId());
DocumentationComments\ParameterTests.cs (36)
34var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 39var typeParameter = type.TypeParameters.Single().ISymbol; 57var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 63var parameter = method.Parameters.Single().ISymbol; 81var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 87var typeParameter = method.TypeParameters.Single().ISymbol; 105var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 110var indexer = type.Indexers.Single(); 111var parameter = indexer.Parameters.Single().ISymbol; 134var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 140var parameter = property.SetMethod.Parameters.Single().ISymbol; 159var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 164var indexer = type.Indexers.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()); 278var parameter = method.Parameters.Single().ISymbol; 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()); 379var typeParameter = method.TypeParameters.Single().ISymbol; 380var parameter = method.Parameters.Single().ISymbol; 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()); 577AssertEx.SetEqual(model.LookupSymbols(pos4), compilation.GlobalNamespace.GetMember<INamedTypeSymbol>("C").TypeParameters.Single()); 605AssertEx.SetEqual(model.LookupSymbols(pos4), compilation.GlobalNamespace.GetMember<INamedTypeSymbol>("C").TypeParameters.Single()); 690var model = compilation.GetSemanticModel(compilation.SyntaxTrees.Single()); 740var tree = compilation.SyntaxTrees.Single(); 787var tree = compilation.SyntaxTrees.Single();
DocumentationComments\PartialTypeDocumentationCommentTests.cs (4)
51_gooClass = _compilation.GlobalNamespace.GetTypeMembers("Goo").Single(); 68var method = _gooClass.GetMembers("MethodWithNoImplementation").Single(); 82var method = _gooClass.GetMembers("ImplementedMethodWithNoSummaryOnImpl").Single(); 93var method = _gooClass.GetMembers("ImplementedMethod").Single();
DocumentationComments\PropertyDocumentationCommentTests.cs (6)
35_acmeNamespace = (NamespaceSymbol)_compilation.GlobalNamespace.GetMembers("Acme").Single(); 36_widgetClass = _acmeNamespace.GetTypeMembers("Widget").Single(); 43_acmeNamespace.GetTypeMembers("Widget").Single() 44.GetMembers("Width").Single().GetDocumentationCommentId()); 51_acmeNamespace.GetTypeMembers("Widget").Single() 59_acmeNamespace.GetTypeMembers("Widget").Single()
DocumentationComments\TypeDocumentationCommentTests.cs (12)
46_acmeNamespace = (NamespaceSymbol)_compilation.GlobalNamespace.GetMembers("Acme").Single(); 47_widgetClass = _acmeNamespace.GetTypeMembers("Widget").Single(); 53Assert.Equal("T:Color", _compilation.GlobalNamespace.GetTypeMembers("Color").Single().GetDocumentationCommentId()); 59Assert.Equal("T:Acme.IProcess", _acmeNamespace.GetTypeMembers("IProcess").Single().GetDocumentationCommentId()); 65Assert.Equal("T:Acme.ValueType", _acmeNamespace.GetTypeMembers("ValueType").Single().GetDocumentationCommentId()); 77var classSymbol = _widgetClass.GetTypeMembers("NestedClass").Single(); 91Assert.Equal("T:Acme.Widget.IMenuItem", _widgetClass.GetMembers("IMenuItem").Single().GetDocumentationCommentId()); 97Assert.Equal("T:Acme.Widget.Del", _widgetClass.GetTypeMembers("Del").Single().GetDocumentationCommentId()); 103Assert.Equal("T:Acme.Widget.Direction", _widgetClass.GetTypeMembers("Direction").Single().GetDocumentationCommentId()); 109Assert.Equal("T:Acme.MyList`1", _acmeNamespace.GetTypeMembers("MyList", 1).Single().GetDocumentationCommentId()); 115Assert.Equal("T:Acme.MyList`1.Helper`2", _acmeNamespace.GetTypeMembers("MyList", 1).Single() 116.GetTypeMembers("Helper", 2).Single().GetDocumentationCommentId());
SymbolDisplay\SymbolDisplayTests.cs (238)
30global.GetTypeMembers("A", 0).Single(); 49global.GetTypeMembers("A", 0).Single(); 76GetTypeMembers("R1").Single(). 77GetTypeMembers("R2").Single(); 104GetTypeMembers("C1").Single(). 105GetTypeMembers("C2").Single(); 132GetTypeMembers("C1").Single(). 133GetTypeMembers("C2").Single(); 153Func<NamespaceSymbol, Symbol> findSymbol = global => global.GetTypeMembers("A", 0).Single(); 180GetTypeMembers("C1").Single(). 181GetTypeMembers("C2").Single(); 205global.GetTypeMembers("A", 0).Single(). 206GetMembers("M").Single(); 233GetTypeMembers("C1").Single(). 234GetTypeMembers("C2").Single(). 235GetMembers("M").Single(); 256global.GetTypeMembers("A", 0).Single(). 257GetMembers("M").Single(); 293GetTypeMembers("C1").Single(). 294GetTypeMembers("C2").Single(). 295GetMembers("M").Single(); 339global.GetTypeMembers("C2").Single(). 340GetMembers("M").Single(); 404global.GetTypeMembers("C2").Single(). 405GetMembers("M").Single(); 460global.GetTypeMembers("C2").Single(). 461GetMembers("M").Single(); 698global.GetTypeMembers("C2").Single(). 699GetMembers("M").Single(); 736global.GetTypeMembers("A", 0).Single(). 737GetMembers("f").Single(); 760global.GetTypeMembers("A", 0).Single(). 761GetMembers("f").Single(); 798global.GetTypeMembers("C", 0).Single(). 799GetMembers("F").Single(); 831global.GetTypeMembers("C", 0).Single(). 832GetMembers("F").Single(); 870global.GetTypeMembers("C", 0).Single(). 871GetMembers("F").Single(); 905global.GetTypeMembers("C", 0).Single(). 906GetMembers("F").Single(); 940global.GetTypeMembers("C", 0).Single(). 941GetMembers("F").Single(); 975global.GetTypeMembers("C", 0).Single(). 976GetMembers("F").Single(); 1010global.GetTypeMembers("C", 0).Single(). 1011GetMembers("F").Single(); 1064global.GetTypeMembers("true", 0).Single(). 1065GetMembers("false").Single(); 1105global.GetTypeMembers("record", 0).Single(). 1106GetMembers("struct").Single(); 1151global.GetTypeMembers("C", 0).Single(). 1152GetMembers("record").Single(); 1180global.GetTypeMembers("decimal", 0).Single(). 1181GetMembers("M").Single(); 1212global.GetTypeMembers("true", 0).Single(). 1213GetMembers("false").Single(); 1255global.GetTypeMembers("C", 0).Single(). 1256GetMembers("I.M").Single(); 1280global.GetTypeMembers("C", 0).Single(). 1281GetMembers("I.M").Single(); 1307global.GetTypeMembers("C", 0).Single(). 1308GetMembers("I.M").Single(); 1333global.GetTypeMembers("C", 0).Single(); 1380global.GetTypeMembers("C", 0).Single(). 1381GetMembers("f").Single(); 1406global.GetTypeMembers("C", 0).Single(). 1407GetMembers("f").Single(); 1446global.GetTypeMembers("C", 0).Single(). 1447GetMembers(".ctor").Single(); 1469global.GetTypeMembers("C", 3).Single(); 1503global => global.GetTypeMembers("C").Single().GetTypeMember("D"), 1530global => global.GetTypeMembers("C").Single().GetTypeMember("D"), 1558global => global.GetTypeMembers("C").Single().GetTypeMember("D"), 1586global => global.GetTypeMembers("C").Single().GetTypeMember("D"), 1604global.GetTypeMembers("C", 3).Single(); 1634global.GetTypeMembers("C", 3).Single(); 1671global.GetMember<NamedTypeSymbol>("C").TypeParameters.Single(); 1710global.GetTypeMembers("C", 0).Single(). 1711GetMembers("M").Single(); 1742global.GetTypeMembers("C", 0).Single(). 1743GetMembers("M").Single(); 1817global.GetTypeMembers("C", 0).Single(). 1818GetMembers("M").Single(); 1840global.GetTypeMembers("C", 0).Single(). 1841GetMembers("M").Single(); 1877global.GetTypeMembers("C", 0).Single(). 1878GetMembers("f").Single(); 1900global.GetTypeMembers("C", 0).Single(). 1901GetMembers("f").Single(); 1935global.GetTypeMembers("C", 0).Single(). 1936GetMembers("P").Single(); 1958global.GetTypeMembers("C", 0).Single(). 1959GetMembers("P").Single(); 2002global => global.GetTypeMembers("C", 0).Single().GetMembers("P").Single(), 2018global => global.GetTypeMembers("C", 0).Single().GetMembers("Q").Single(), 2034global => global.GetTypeMembers("C", 0).Single().GetMembers("R").Single(), 2063global.GetTypeMembers("C", 0).Single(). 2064GetMembers("get_P").Single(); 2101global.GetTypeMembers("C", 0).Single(). 2102GetMembers("set_P").Single(); 2139global.GetTypeMembers("C", 0).Single(). 2140GetMembers("<P>k__BackingField").Single(); 2177global.GetTypeMembers("C", 0).Single(). 2178GetMembers("<P>k__BackingField").Single(); 2209global.GetTypeMembers("C", 0).Single(). 2210GetMembers("<I.P>k__BackingField").Single(); 2243global.GetTypeMembers("C", 0).Single(). 2244GetMembers("<I.P>k__BackingField").Single(); 2269global.GetTypeMembers("C", 0).Single(). 2270GetMembers("F").Single(); 2324global.GetTypeMembers("C", 0).Single(). 2325GetMembers("<P>k__BackingField").Single(); 2400var goo = a.GetMembers("_Prop").Single(); 2516GetMembers("add_E").Single(); 2553GetMembers("remove_E").Single(); 2589global.GetTypeMembers("C", 0).Single(). 2590GetMembers("M").Single(); 2615global.GetTypeMembers("C", 0).Single(). 2616GetMembers("M").Single(); 2645global.GetTypeMembers("C", 0).Single(). 2646GetMembers("M").Single(); 2673global.GetTypeMembers("C", 0).Single(). 2674GetMembers("M").Single(); 2764global.GetTypeMembers("C", 0).Single(). 2765GetMembers("M").Single(); 2825global.GetTypeMembers("C", 0).Single(). 2826GetMembers("M").Single(); 2884global => global.GetTypeMembers("I", 0).Single().GetMembers("P").Single(), 2890global => global.GetTypeMembers("I", 0).Single().GetMembers("F").Single(), 2896global => global.GetTypeMembers("C", 0).Single().GetMembers("F").Single(), 2902global => global.GetTypeMembers("C", 0).Single().GetTypeMembers("I", 0).Single().GetMembers("M").Single(), 2917global.GetTypeMembers("X", 0).Single(). 2950GetTypeMembers("C1").Single(). 2951GetTypeMembers("C2").Single(); 2982GetTypeMembers("C1").Single(); 3015GetTypeMembers("C1").Single(). 3016GetTypeMembers("C2").Single(); 3047GetTypeMembers("C1").Single(); 3318global.GetTypeMembers("class1Attribute").Single(); 3341global.GetTypeMembers("classAttribute").Single(); 3362global.GetTypeMembers("class1Attribute").Single(); 3387((FieldSymbol)global.GetTypeMembers("C1").Single().GetMembers("goo").Single()).Type; 3757global.GetTypeMembers("D", 0).Single(); 3809var field = global.GetTypeMembers("Test", 0).Single().GetMembers("field").Single() as FieldSymbol; 3863var field = global.GetTypeMembers("Test", 0).Single().GetMembers("field").Single() as FieldSymbol; 3915var field = global.GetTypeMembers("Test", 0).Single().GetMembers("field2").Single() as FieldSymbol; 4550global.GetTypeMembers("C", 0).Single(). 4551GetMembers("f").Single(); 4594global.GetTypeMembers("C", 0).Single(). 4595GetMembers("f").Single(); 4641global.GetTypeMembers("C", 0).Single(). 4642GetMembers("f").Single(); 4683global.GetTypeMembers("E", 0).Single(). 4684GetMembers("B").Single(); 4718global.GetTypeMembers("E", 0).Single(). 4719GetMembers("D").Single(); 4766global.GetTypeMembers("E", 0).Single(). 4767GetMembers("D").Single(); 4962var goo = a.GetMembers("Goo").Single(); 5154var type = outer.GetMembers("Inner").Single(); 5155var method = outer.GetMembers("M").Single(); 5156var property = outer.GetMembers("P").Single(); 5157var field = outer.GetMembers("F").Single(); 5158var @event = outer.GetMembers("E").Single(); 5159var @delegate = outer.GetMembers("D").Single(); 5160var error = outer.GetMembers("Error").Single(); 5458GetTypeMembers("C").Single(). 5459GetMembers("f").Single(); 5490GetTypeMembers("C").Single(). 5491GetMembers("f").Single(); 5521GetTypeMembers("C").Single(). 5522GetMembers("f").Single(); 5552GetTypeMembers("C").Single(). 5553GetMembers("f").Single(); 5589GetTypeMembers("C").Single(). 5590GetMembers("f").Single(); 5640GetTypeMembers("C").Single(). 5641GetMembers("P").Single(); 5735var tree = comp.SyntaxTrees.Single(); 5802var type = global.GetTypeMembers("C").Single(); 5803var method = type.GetMembers("F").Single(); 5804var property = type.GetMembers("P").Single(); 5806var @delegate = global.GetTypeMembers("D").Single(); 6006var type = global.GetTypeMembers("C").Single(); 6007var method = type.GetMembers("F").Single(); 6008var property = type.GetMembers("P").Single(); 6010var @delegate = global.GetTypeMembers("D").Single(); 6723var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 6800var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 6862var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 6895var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 6956var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 6989var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7034var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7127g => g.GetTypeMembers("E").Single().GetField("A"), 7152var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7190var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7228var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7288var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7360var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7620var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7773var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7801var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 7842global => global.GetTypeMember("X").TypeParameters.Single().ConstraintTypes().Single(), 7879global => global.GetTypeMember("X").TypeParameters.Single().ConstraintTypes().Single(), 7916global => global.GetTypeMember("X").TypeParameters.Single().ConstraintTypes().Single(), 8322Func<NamespaceSymbol, Symbol> findSymbol = global => global.GetTypeMembers("Person").Single(); 8343Func<NamespaceSymbol, Symbol> findSymbol = global => global.GetTypeMembers("Person").Single(); 8364Func<NamespaceSymbol, Symbol> findSymbol = global => global.GetTypeMembers("Person").Single(); 8387Func<NamespaceSymbol, Symbol> findSymbol = global => global.GetTypeMembers("Person").Single(); 8415((FieldSymbol)global.GetTypeMembers("A", 0).Single() 8416.GetMembers("f").Single()).Type; 8436((FieldSymbol)global.GetTypeMembers("A", 0).Single() 8437.GetMembers("f").Single()).Type; 8457((FieldSymbol)global.GetTypeMembers("A", 0).Single() 8458.GetMembers("f").Single()).Type; 8478((FieldSymbol)global.GetTypeMembers("A", 0).Single() 8479.GetMembers("f").Single()).Type; 8512var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 8563var semanticModel = comp.GetSemanticModel(comp.SyntaxTrees.Single()); 8597var tree = comp.SyntaxTrees.Single(); 8659var parameterSymbol = methodSymbol.Parameters.Single();
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (17)
65Assert.Same(baseProperty, derivedPropertyOverriddenOrHidden.OverriddenMembers.Single()); 70Assert.Same(baseGetter, derivedGetterOverriddenOrHidden.OverriddenMembers.Single()); 75Assert.Same(baseSetter, derivedSetterOverriddenOrHidden.OverriddenMembers.Single()); 120Assert.Same(baseProperty, derived1PropertyOverriddenOrHidden.OverriddenMembers.Single()); 124Assert.Same(baseGetter, derived1GetterOverriddenOrHidden.OverriddenMembers.Single()); 128Assert.Same(derived1Property, derived2PropertyOverriddenOrHidden.OverriddenMembers.Single()); 132Assert.Same(baseSetter, derived2SetterOverriddenOrHidden.OverriddenMembers.Single()); 166Assert.Same(baseProperty, derivedPropertyOverriddenOrHidden.HiddenMembers.Single()); 170Assert.Same(baseGetter, derivedGetterOverriddenOrHidden.HiddenMembers.Single()); 174Assert.Same(baseSetter, derivedSetterOverriddenOrHidden.HiddenMembers.Single()); 225Assert.Same(baseProperty, derived1PropertyOverriddenOrHidden.HiddenMembers.Single()); 229Assert.Same(baseGetter, derived1GetterOverriddenOrHidden.HiddenMembers.Single()); 233Assert.Same(derived1Property, derived2PropertyOverriddenOrHidden.OverriddenMembers.Single()); 355var bridge = @class.GetSynthesizedExplicitImplementations(CancellationToken.None).ForwardingMethods.Single(); 357Assert.Same(ilGetter, bridge.ExplicitInterfaceImplementations.Single()); 724Assert.Equal(interface3Property, interface4PropertyOverriddenOrHidden.HiddenMembers.Single()); 1053var disposeMethod = (IMethodSymbol)compilation.GetSpecialType(SpecialType.System_IDisposable).GetMembers("Dispose").Single();
Symbols\AnonymousTypesSymbolTests.cs (3)
1681var programType = (NamedTypeSymbol)(comp.GlobalNamespace.GetTypeMembers("Program").Single()); 1682var mainMethod = (MethodSymbol)(programType.GetMembers("Main").Single()); 1683var mainSyntax = mainMethod.DeclaringSyntaxReferences.Single().GetSyntax() as MethodDeclarationSyntax;
Symbols\AssemblyAndNamespaceTests.cs (19)
74var ns = comp.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 75var ns1 = (ns.GetMembers("NS1").Single() as NamespaceSymbol).GetMembers("NS2").Single() as NamespaceSymbol; 126var ns = global.GetMembers("N1").Single() as NamespaceSymbol; 130var ns1 = (ns.GetMembers("N11").Single() as NamespaceSymbol).GetMembers("N111").Single() as NamespaceSymbol; 169var ns = global.GetMembers("NS").Single() as NamespaceSymbol; 173var ns1 = ns.GetMembers("NS1").Single() as NamespaceSymbol; 178var ns2 = ns.GetMembers("NS2").Single() as NamespaceSymbol; 214var ns = global.GetMembers("N1").Single() as NamespaceSymbol; 220Assert.True(constituents.Contains(comp.SourceAssembly.GlobalNamespace.GetMembers("N1").Single() as NamespaceSymbol)); 221Assert.True(constituents.Contains(comp.GetReferencedAssemblySymbol(compRef1).GlobalNamespace.GetMembers("N1").Single() as NamespaceSymbol)); 222Assert.True(constituents.Contains(comp.GetReferencedAssemblySymbol(compRef2).GlobalNamespace.GetMembers("N1").Single() as NamespaceSymbol)); 262var ns = global.GetMembers("N1").Single() as NamespaceSymbol; 268Assert.True(constituents.Contains(comp.SourceAssembly.GlobalNamespace.GetMembers("N1").Single() as NamespaceSymbol)); 269Assert.True(constituents.Contains(comp.GetReferencedAssemblySymbol(compRef1).GlobalNamespace.GetMembers("N1").Single() as NamespaceSymbol)); 270Assert.True(constituents.Contains(comp.GetReferencedAssemblySymbol(compRef2).GlobalNamespace.GetMembers("N1").Single() as NamespaceSymbol)); 303var ns = global.GetMembers("N1").Single() as NamespaceSymbol; 335var ns1 = globalNS.GetMembers("NS").Single() as NamespaceSymbol;
Symbols\CheckedUserDefinedOperatorsTests.cs (5)
7232var tree = compilation1.SyntaxTrees.Single(); 7304var tree = compilation1.SyntaxTrees.Single(); 7375var tree = compilation1.SyntaxTrees.Single(); 7448var tree = compilation1.SyntaxTrees.Single(); 7512var tree = compilation1.SyntaxTrees.Single();
Symbols\CompilationCreationTests.cs (185)
74TypeSymbol c107 = c1.GlobalNamespace.GetTypeMembers("C107").Single(); 103Assert.Equal(SpecialType.None, c2.GlobalNamespace.GetTypeMembers("C107").Single().SpecialType); 141Single(). 161Single(). 165Assert.Same(retval1, asm2[2].GlobalNamespace.GetMembers("Class1").Single()); 192Single(). 196Assert.Same(retval2, asm3[2].GlobalNamespace.GetMembers("Class1").Single()); 212Single(); 217Assert.Same(retval3, asm3[2].GlobalNamespace.GetMembers("Class1").Single()); 222Assert.Same(retval4, asm3[2].GlobalNamespace.GetMembers("Class2").Single()); 227Assert.Same(retval5, asm3[1].GlobalNamespace.GetMembers("Class4").Single()); 251Single(). 255Assert.Same(retval6, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 275Single(); 280Assert.Same(retval7, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 285Assert.Same(retval8, asm4[2].GlobalNamespace.GetMembers("Class2").Single()); 290Assert.Same(retval9, asm4[1].GlobalNamespace.GetMembers("Class4").Single()); 300Single(); 305Assert.Same(retval10, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 310Assert.Same(retval11, asm4[2].GlobalNamespace.GetMembers("Class2").Single()); 315Assert.Same(retval12, asm4[2].GlobalNamespace.GetMembers("Class3").Single()); 320Assert.Same(retval13, asm4[1].GlobalNamespace.GetMembers("Class4").Single()); 325Assert.Same(retval14, asm4[3].GlobalNamespace.GetMembers("Class5").Single()); 366Single(); 379Assert.Same(retval17, asm7[1].GlobalNamespace.GetMembers("Class4").Single()); 389Single(); 406Assert.Same(retval21, asm7[1].GlobalNamespace.GetMembers("Class4").Single()); 411Assert.Same(retval22, asm7[2].GlobalNamespace.GetMembers("Class5").Single()); 459Single(). 472Single(). 476Assert.Same(retval1, asm2[2].GlobalNamespace.GetMembers("Class1").Single()); 494Single(). 498Assert.Same(retval2, asm3[2].GlobalNamespace.GetMembers("Class1").Single()); 514Single(); 519Assert.Same(retval3, asm3[2].GlobalNamespace.GetMembers("Class1").Single()); 524Assert.Same(retval4, asm3[2].GlobalNamespace.GetMembers("Class2").Single()); 529Assert.Same(retval5, asm3[1].GlobalNamespace.GetMembers("Class4").Single()); 543Single(). 547Assert.Same(retval6, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 567Single(); 572Assert.Same(retval7, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 577Assert.Same(retval8, asm4[2].GlobalNamespace.GetMembers("Class2").Single()); 582Assert.Same(retval9, asm4[1].GlobalNamespace.GetMembers("Class4").Single()); 592Single(); 597Assert.Same(retval10, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 602Assert.Same(retval11, asm4[2].GlobalNamespace.GetMembers("Class2").Single()); 607Assert.Same(retval12, asm4[2].GlobalNamespace.GetMembers("Class3").Single()); 612Assert.Same(retval13, asm4[1].GlobalNamespace.GetMembers("Class4").Single()); 617Assert.Same(retval14, asm4[3].GlobalNamespace.GetMembers("Class5").Single()); 632Single(); 645Assert.Same(retval17, asm7[1].GlobalNamespace.GetMembers("Class4").Single()); 655Single(); 672Assert.Same(retval21, asm7[1].GlobalNamespace.GetMembers("Class4").Single()); 677Assert.Same(retval22, asm7[2].GlobalNamespace.GetMembers("Class5").Single()); 744Single(). 748Assert.Same(retval1, asm2[2].GlobalNamespace.GetMembers("Class1").Single()); 840Single(). 844Assert.Same(retval2, asm3[2].GlobalNamespace.GetMembers("Class1").Single()); 860Single(); 865Assert.Same(retval3, asm3[2].GlobalNamespace.GetMembers("Class1").Single()); 870Assert.Same(retval4, asm3[2].GlobalNamespace.GetMembers("Class2").Single()); 875Assert.Same(retval5, asm3[1].GlobalNamespace.GetMembers("Class4").Single()); 981Single(). 985Assert.Same(retval6, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 1005Single(); 1010Assert.Same(retval7, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 1015Assert.Same(retval8, asm4[2].GlobalNamespace.GetMembers("Class2").Single()); 1020Assert.Same(retval9, asm4[1].GlobalNamespace.GetMembers("Class4").Single()); 1030Single(); 1035Assert.Same(retval10, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 1040Assert.Same(retval11, asm4[2].GlobalNamespace.GetMembers("Class2").Single()); 1045Assert.Same(retval12, asm4[2].GlobalNamespace.GetMembers("Class3").Single()); 1050Assert.Same(retval13, asm4[1].GlobalNamespace.GetMembers("Class4").Single()); 1055Assert.Same(retval14, asm4[3].GlobalNamespace.GetMembers("Class5").Single()); 1094Single(); 1108Assert.Same(retval17, asm7[1].GlobalNamespace.GetMembers("Class4").Single()); 1118Single(); 1135Assert.Same(retval21, asm7[1].GlobalNamespace.GetMembers("Class4").Single()); 1140Assert.Same(retval22, asm7[2].GlobalNamespace.GetMembers("Class5").Single()); 1192Single(). 1196Assert.Same(retval1, asm2[2].GlobalNamespace.GetMembers("Class1").Single()); 1219Single(). 1223Assert.Same(retval2, asm3[2].GlobalNamespace.GetMembers("Class1").Single()); 1239Single(); 1244Assert.Same(retval3, asm3[2].GlobalNamespace.GetMembers("Class1").Single()); 1249Assert.Same(retval4, asm3[2].GlobalNamespace.GetMembers("Class2").Single()); 1254Assert.Same(retval5, asm3[1].GlobalNamespace.GetMembers("Class4").Single()); 1272Single(). 1276Assert.Same(retval6, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 1296Single(); 1301Assert.Same(retval7, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 1306Assert.Same(retval8, asm4[2].GlobalNamespace.GetMembers("Class2").Single()); 1311Assert.Same(retval9, asm4[1].GlobalNamespace.GetMembers("Class4").Single()); 1321Single(); 1326Assert.Same(retval10, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 1331Assert.Same(retval11, asm4[2].GlobalNamespace.GetMembers("Class2").Single()); 1336Assert.Same(retval12, asm4[2].GlobalNamespace.GetMembers("Class3").Single()); 1341Assert.Same(retval13, asm4[1].GlobalNamespace.GetMembers("Class4").Single()); 1346Assert.Same(retval14, asm4[3].GlobalNamespace.GetMembers("Class5").Single()); 1367Single(); 1381Assert.Same(retval17, asm7[1].GlobalNamespace.GetMembers("Class4").Single()); 1391Single(); 1408Assert.Same(retval21, asm7[1].GlobalNamespace.GetMembers("Class4").Single()); 1413Assert.Same(retval22, asm7[2].GlobalNamespace.GetMembers("Class5").Single()); 1451Single(). 1455Single(). 1459Assert.Same(retval1, asm2[2].GlobalNamespace.GetMembers("Class1").Single()); 1510Single(). 1514Single(). 1518Assert.Same(retval2, asm3[2].GlobalNamespace.GetMembers("Class1").Single()); 1534var type1 = asm3[3].GlobalNamespace.GetTypeMembers("Class5").Single(); 1539Assert.Same(retval3, asm3[2].GlobalNamespace.GetMembers("Class1").Single()); 1544Assert.Same(retval4, asm3[2].GlobalNamespace.GetMembers("Class2").Single()); 1549Assert.Same(retval5, asm3[1].GlobalNamespace.GetMembers("Class4").Single()); 1602Single(). 1606Assert.Same(retval6, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 1626Single(); 1631Assert.Same(retval7, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 1636Assert.Same(retval8, asm4[2].GlobalNamespace.GetMembers("Class2").Single()); 1641Assert.Same(retval9, asm4[1].GlobalNamespace.GetMembers("Class4").Single()); 1651Single(); 1656Assert.Same(retval10, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 1661Assert.Same(retval11, asm4[2].GlobalNamespace.GetMembers("Class2").Single()); 1666Assert.Same(retval12, asm4[2].GlobalNamespace.GetMembers("Class3").Single()); 1671Assert.Same(retval13, asm4[1].GlobalNamespace.GetMembers("Class4").Single()); 1676Assert.Same(retval14, asm4[3].GlobalNamespace.GetMembers("Class5").Single()); 1726Single(); 1744Assert.Same(retval17, asm7[1].GlobalNamespace.GetMembers("Class4").Single()); 1754Single(); 1771Assert.Same(retval21, asm7[1].GlobalNamespace.GetMembers("Class4").Single()); 1776Assert.Same(retval22, asm7[2].GlobalNamespace.GetMembers("Class5").Single()); 1838Single(). 1842Assert.Same(retval1, asm2[2].GlobalNamespace.GetMembers("Class1").Single()); 1865Single(). 1869Assert.Same(retval2, asm3[2].GlobalNamespace.GetMembers("Class1").Single()); 1885Single(); 1890Assert.Same(retval3, asm3[2].GlobalNamespace.GetMembers("Class1").Single()); 1895Assert.Same(retval4, asm3[2].GlobalNamespace.GetMembers("Class2").Single()); 1900Assert.Same(retval5, asm3[1].GlobalNamespace.GetMembers("Class4").Single()); 1918Single(). 1922Assert.Same(retval6, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 1942Single(); 1947Assert.Same(retval7, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 1952Assert.Same(retval8, asm4[2].GlobalNamespace.GetMembers("Class2").Single()); 1957Assert.Same(retval9, asm4[1].GlobalNamespace.GetMembers("Class4").Single()); 1967Single(); 1972Assert.Same(retval10, asm4[2].GlobalNamespace.GetMembers("Class1").Single()); 1977Assert.Same(retval11, asm4[2].GlobalNamespace.GetMembers("Class2").Single()); 1982Assert.Same(retval12, asm4[2].GlobalNamespace.GetMembers("Class3").Single()); 1987Assert.Same(retval13, asm4[1].GlobalNamespace.GetMembers("Class4").Single()); 1992Assert.Same(retval14, asm4[3].GlobalNamespace.GetMembers("Class5").Single()); 2013Single(); 2029Assert.Same(retval17, asm7[1].GlobalNamespace.GetMembers("Class4").Single()); 2039Single(); 2056Assert.Same(retval21, asm7[1].GlobalNamespace.GetMembers("Class4").Single()); 2061Assert.Same(retval22, asm7[2].GlobalNamespace.GetMembers("Class5").Single()); 2243Single().GetMembers("Foo2").OfType<MethodSymbol>().Single(); 2271Single(); 2274Single(); 2277Single(); 2280Single(); 2306Single(); 2327Single(). 2403var typeC301 = type3.GetTypeMembers("C301").Single(); 2404var typeC302 = type3.GetTypeMembers("C302").Single(); 2405var typeC6 = asm5[1].GlobalNamespace.GetTypeMembers("C6").Single(); 2408asm3.GlobalNamespace.GetTypeMembers("C3").Single(). 2409GetTypeMembers("C301").Single().ToTestDisplayString()); 2412asm3.GlobalNamespace.GetTypeMembers("C6").Single().ToTestDisplayString()); 2415asm3.GlobalNamespace.GetTypeMembers("C3").Single(). 2416GetTypeMembers("C301").Single().ToDisplayString(SymbolDisplayFormat.QualifiedNameArityFormat)); 2419asm3.GlobalNamespace.GetTypeMembers("C6").Single().ToDisplayString(SymbolDisplayFormat.QualifiedNameArityFormat)); 2422asm3.GlobalNamespace.GetTypeMembers("C3").Single().GetMembers().Length); 2425asm3.GlobalNamespace.GetTypeMembers("C3").Single().GetTypeMembers().Length); 2427Assert.Same(typeC301, type3.GetTypeMembers("C301", 0).Single()); 2440Assert.Equal("I1", typeC301.Interfaces().Single().Name); 2457asm3.GlobalNamespace.GetTypeMembers("C3").Single()); 2461Assert.Equal(TypeKind.Interface, asm5[1].GlobalNamespace.GetTypeMembers("I1").Single().TypeKind); 2469Assert.Same(type4, foo3TypeParam.ConstraintTypes().Single()); 2487asm3.GlobalNamespace.GetTypeMembers("C6").Single().TypeParameters[0]); 2496Assert.Same(ns1.GetTypeMembers("C304").Single(), ns1.GetTypeMembers("C304", 0).Single()); 2508Assert.Same(asm3.Modules[0].GlobalNamespace.GetMembers("ns1").Single(), 2524var typeC5 = c5.Assembly.GlobalNamespace.GetTypeMembers("C5").Single(); 2581NamedTypeSymbol classModule1 = c1AsmRef.Modules[0].GlobalNamespace.GetTypeMembers("Module1").Single();
Symbols\ConversionTests.cs (14)
312var typeIntArrayWithCustomModifiers = interfaceI3.GetMember<MethodSymbol>("M1").Parameters.Single().Type; 452var tree = comp.SyntaxTrees.Single(); 483var tree = comp.SyntaxTrees.Single(); 518var tree = comp.SyntaxTrees.Single(); 554var tree = comp.SyntaxTrees.Single(); 590var tree = comp.SyntaxTrees.Single(); 624var tree = comp.SyntaxTrees.Single(); 659var tree = comp.SyntaxTrees.Single(); 684var tree = comp.SyntaxTrees.Single(); 715var tree = comp.SyntaxTrees.Single(); 741var tree = comp.SyntaxTrees.Single(); 764var tree = comp.SyntaxTrees.Single(); 2147Assert.Equal(SpecialType.System_Byte, method.Parameters.Single().Type.SpecialType); 2181Assert.Equal(SpecialType.System_Byte, method.Parameters.Single().Type.SpecialType);
Symbols\CorLibrary\CorTypes.cs (4)
43var p = noMsCorLibRef.GlobalNamespace.GetTypeMembers("I1").Single(). 219Select(m => (NamespaceSymbol)m).Single().GetTypeMembers("Object").Single(); 293var tree = comp.SyntaxTrees.Single(); 358var tree = comp1.SyntaxTrees.Single();
Symbols\CovariantReturnTests.cs (1)
360return constructedType.GetMembers(memberName).Single();
Symbols\CSharpCompilerFeatureRequiredTests.cs (1)
389Assert.True(comp.GetReferencedAssemblySymbol(ilRef).Modules.Single().HasUnsupportedMetadata);
Symbols\CustomModifiersTests.cs (1)
68Assert.Equal("System.Runtime.CompilerServices.IsLong", type.GetTypeArgumentCustomModifiers(0).Single().Modifier.ToTestDisplayString());
Symbols\DefaultInterfaceImplementationTests.cs (106)
193var i1 = test1.InterfacesNoUseSiteDiagnostics().Single(); 224var i1 = test2.InterfacesNoUseSiteDiagnostics().Single(); 605Assert.Equal("I1", derivedResult.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 703Assert.Equal("I1", derivedResult.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 805Assert.Equal("I1", derivedResult.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 907Assert.Equal("I1", derivedResult.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 984Assert.Equal("I1", test1Result.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 1059Assert.Equal("I1", test1Result.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 1138Assert.Equal("I1", test1Result.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 1217Assert.Equal("I1", test1Result.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 1301Assert.Equal("I1", test1Result.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 1385Assert.Equal("I1", test1Result.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 1473Assert.Equal("I1", test1Result.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 1561Assert.Equal("I1", test1Result.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 1925Assert.Equal("I1", test2Result.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 2730Assert.Equal("I1", test1.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 2747Assert.Equal("I1", test2.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 2749var p1 = test2.InterfacesNoUseSiteDiagnostics().Single().GetMember<PropertySymbol>(propertyName); 3747Assert.Equal("I1", derivedResult.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 3889Assert.Equal("I1", derivedResult.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 4041Assert.Equal("I1", derivedResult.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 4193Assert.Equal("I1", derivedResult.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 4328var i1 = derived.InterfacesNoUseSiteDiagnostics().Single(); 4798Assert.Equal("I1", test2Result.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 4888var i1 = derived.InterfacesNoUseSiteDiagnostics().Single(); 5408Assert.Equal("I1", derivedResult.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 5525Assert.Equal("I1", derivedResult.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 5670Assert.Equal("I1", derivedResult.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 5797Assert.Equal("I1", derivedResult.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 5884var i1 = derived.InterfacesNoUseSiteDiagnostics().Single(); 6232Assert.Equal("I1", test2Result.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 6451Assert.Equal("I1", test1.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 6468Assert.Equal("I1", test2.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 6470var e1 = test2.InterfacesNoUseSiteDiagnostics().Single().GetMember<EventSymbol>("E1"); 6965Assert.Equal("I1", derivedResult.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 7068Assert.Equal("I1", derivedResult.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 7175Assert.Equal("I1", derivedResult.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 7282Assert.Equal("I1", derivedResult.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 7376var i1 = derived.InterfacesNoUseSiteDiagnostics().Single(); 7708Assert.Equal("I1", test2Result.InterfacesNoUseSiteDiagnostics().Single().ToTestDisplayString()); 7772var i1 = derived.InterfacesNoUseSiteDiagnostics().Single(); 10895var i1 = test1.InterfacesNoUseSiteDiagnostics().Single(); 12652var i1 = test1.InterfacesNoUseSiteDiagnostics().Single(); 12740var i1 = test1.InterfacesNoUseSiteDiagnostics().Single(); 12828var i1 = test1.InterfacesNoUseSiteDiagnostics().Single(); 14998var i1 = test1.InterfacesNoUseSiteDiagnostics().Single(); 17473var i1 = test1.InterfacesNoUseSiteDiagnostics().Single(); 18293var im = test1.InterfacesNoUseSiteDiagnostics().Single().ContainingModule; 18359Assert.Same(p1, implementingProperty.ExplicitInterfaceImplementations.Single()); 18479var im = test1.InterfacesNoUseSiteDiagnostics().Single().ContainingModule; 19854var i1 = test1.InterfacesNoUseSiteDiagnostics().Single(); 28440var i1 = test1.InterfacesNoUseSiteDiagnostics().Single(); 30878var i1 = test1.InterfacesNoUseSiteDiagnostics().Single(); 34813var i2i1 = i2.InterfacesNoUseSiteDiagnostics().Single(); 34817var i3i1 = i3.InterfacesNoUseSiteDiagnostics().Single(); 39120var i2i1 = i2.InterfacesNoUseSiteDiagnostics().Single(); 39123var i3i1 = i3.InterfacesNoUseSiteDiagnostics().Single(); 41796var i2i1 = i2.InterfacesNoUseSiteDiagnostics().Single(); 41799var i3i1 = i3.InterfacesNoUseSiteDiagnostics().Single(); 51100var i1m1 = i2m1.ExplicitInterfaceImplementations.Single(); 51261var i1m1 = i2m1.ExplicitInterfaceImplementations.Single(); 51988var i1m1 = i2m1.ExplicitInterfaceImplementations.Single(); 52053var i1m1 = i2m1.ExplicitInterfaceImplementations.Single(); 52111var i1m1 = i2m1.ExplicitInterfaceImplementations.Single(); 52176var i1m1 = i2m1.ExplicitInterfaceImplementations.Single(); 52231var i1m1 = i2m1.ExplicitInterfaceImplementations.Single(); 52285var i1m1 = c2m1.ExplicitInterfaceImplementations.Single(); 52532var i1p1 = i2p1.ExplicitInterfaceImplementations.Single(); 52539Assert.Same(i1p1.GetMethod, i2p1.GetMethod.ExplicitInterfaceImplementations.Single()); 52550Assert.Same(i1p1.SetMethod, i2p1.SetMethod.ExplicitInterfaceImplementations.Single()); 52731var i1p1 = i2p1.ExplicitInterfaceImplementations.Single(); 53612var i1p1 = i2p1.ExplicitInterfaceImplementations.Single(); 53623Assert.Same(i1p1.GetMethod, i2p1.GetMethod.ExplicitInterfaceImplementations.Single()); 53638Assert.Same(i1p1.SetMethod, i2p1.SetMethod.ExplicitInterfaceImplementations.Single()); 53787var i1p1 = i2p1.ExplicitInterfaceImplementations.Single(); 53794Assert.Same(i1p1.GetMethod, i2p1.GetMethod.ExplicitInterfaceImplementations.Single()); 53805Assert.Same(i1p1.SetMethod, i2p1.SetMethod.ExplicitInterfaceImplementations.Single()); 53908var i1p1 = c2p1.ExplicitInterfaceImplementations.Single(); 53913Assert.Same(i1p1.GetMethod, c2p1.GetMethod.ExplicitInterfaceImplementations.Single()); 53923Assert.Same(i1p1.SetMethod, c2p1.SetMethod.ExplicitInterfaceImplementations.Single()); 54220var i1p1 = i2p1.ExplicitInterfaceImplementations.Single(); 54229Assert.Same(i1p1.GetMethod, i2p1.GetMethod.ExplicitInterfaceImplementations.Single()); 54240Assert.Same(i1p1.SetMethod, i2p1.SetMethod.ExplicitInterfaceImplementations.Single()); 57510var i1p1 = i2p1.ExplicitInterfaceImplementations.Single(); 57515Assert.Same(i1p1.AddMethod, i2p1.AddMethod.ExplicitInterfaceImplementations.Single()); 57519Assert.Same(i1p1.RemoveMethod, i2p1.RemoveMethod.ExplicitInterfaceImplementations.Single()); 57689var i1p1 = i2p1.ExplicitInterfaceImplementations.Single(); 58500var i1p1 = i2p1.ExplicitInterfaceImplementations.Single(); 58511Assert.Same(i1p1.AddMethod, i2p1.AddMethod.ExplicitInterfaceImplementations.Single()); 58526Assert.Same(i1p1.RemoveMethod, i2p1.RemoveMethod.ExplicitInterfaceImplementations.Single()); 58694var i1p1 = c2p1.ExplicitInterfaceImplementations.Single(); 58705Assert.Same(i1p1.AddMethod, c2p1Add.ExplicitInterfaceImplementations.Single()); 58720Assert.Same(i1p1.RemoveMethod, c2p1Remove.ExplicitInterfaceImplementations.Single()); 59272var i1p1 = i2p1.ExplicitInterfaceImplementations.Single(); 59279Assert.Same(i1p1.AddMethod, i2p1.AddMethod.ExplicitInterfaceImplementations.Single()); 59283Assert.Same(i1p1.RemoveMethod, i2p1.RemoveMethod.ExplicitInterfaceImplementations.Single()); 62719var baseInterface = i1.Interfaces().Single(); 62845var baseInterface = i1.Interfaces().Single(); 67220Assert.Same(i2.GetMembers().OfType<MethodSymbol>().Single(), i1.GetMembers().OfType<MethodSymbol>().Single().ExplicitInterfaceImplementations.Single()); 67406Assert.Same(m2, m1.ExplicitInterfaceImplementations.Single()); 67407Assert.Same(m2.GetMethod, m1.GetMethod.ExplicitInterfaceImplementations.Single()); 67597Assert.Same(m2, m1.ExplicitInterfaceImplementations.Single()); 67598Assert.Same(m2.AddMethod, m1.AddMethod.ExplicitInterfaceImplementations.Single()); 67599Assert.Same(m2.RemoveMethod, m1.RemoveMethod.ExplicitInterfaceImplementations.Single()); 68892var i1m1 = i2m1.ExplicitInterfaceImplementations.Single(); 68977var i1m1 = i2m1.ExplicitInterfaceImplementations.Single();
Symbols\ExtensionMethodTests.cs (10)
225var syntaxTree = compilation.SyntaxTrees.Single(); 2597Assert.Equal(SpecialType.System_Object, method.Parameters.Single().Type.SpecialType); 2599var attr = ((PEModuleSymbol)module).GetCustomAttributesForToken(method.Handle).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 (28)
43var pointerType = (FunctionPointerTypeSymbol)m.Parameters.Single().Type; 264var pointerType = (FunctionPointerTypeSymbol)m.Parameters.Single().Type; 326var m1PointerType = (FunctionPointerTypeSymbol)m1.Parameters.Single().Type; 330var m2PointerType = (FunctionPointerTypeSymbol)m2.Parameters.Single().Type; 334var m3PointerType = (FunctionPointerTypeSymbol)m3.Parameters.Single().Type; 376var t = m.TypeParameters.Single(); 380Assert.Equal(SpecialType.System_Int32, firstParam.Parameters.Single().Type.SpecialType); 383Assert.Equal(SpecialType.System_Object, secondParam.Parameters.Single().Type.SpecialType); 386Assert.Equal(c, thirdParam.Parameters.Single().Type); 399var sixthParamParam = ((FunctionPointerTypeSymbol)sixthParam.Parameters.Single().Type).Signature; 472Assert.Equal(RefKind.Ref, firstParam.Parameters.Single().RefKind); 475Assert.Equal(RefKind.In, secondParam.Parameters.Single().RefKind); 478Assert.Equal(RefKind.Out, thirdParam.Parameters.Single().RefKind); 481Assert.Equal(RefKind.None, fourthParam.Parameters.Single().RefKind); 574Assert.Equal(RefKind.None, firstParam.Parameters.Single().RefKind); 577Assert.Equal(RefKind.None, secondParam.Parameters.Single().RefKind); 580Assert.Equal(RefKind.Ref, thirdParam.Parameters.Single().RefKind); 583Assert.Equal(RefKind.In, fourthParam.Parameters.Single().RefKind); 586Assert.Equal(RefKind.Out, fifthParam.Parameters.Single().RefKind); 589Assert.Equal(RefKind.In, sixthParam.Parameters.Single().RefKind); 592Assert.Equal(RefKind.Ref, seventhParam.Parameters.Single().RefKind); 595Assert.Equal(RefKind.Out, eightParam.Parameters.Single().RefKind); 598Assert.Equal(RefKind.Ref, ninthParam.Parameters.Single().RefKind); 679var signature = ((FunctionPointerTypeSymbol)m.Parameters.Single().Type).Signature; 680Assert.True(signature.Parameters.Single().Type.IsVoidType()); 1625Assert.Equal("System.Runtime.InteropServices.InAttribute[missing]", ptr.Signature.RefCustomModifiers.Single().Modifier.ToTestDisplayString()); 1626Assert.Equal("System.Runtime.InteropServices.OutAttribute[missing]", ptr.Signature.Parameters.Single().RefCustomModifiers.Single().Modifier.ToTestDisplayString());
Symbols\GenericConstraintTests.cs (3)
6613var typeI = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("I").Single(); 7421var tree = comp.SyntaxTrees.Single(); 7446var tree = comp.SyntaxTrees.Single();
Symbols\ImplicitClassTests.cs (8)
30var n = ((NamespaceSymbol)c.Assembly.GlobalNamespace.GetMembers("N").Single()); 31var implicitClass = ((NamedTypeSymbol)n.GetMembers().Single()); 37Assert.Equal(SyntaxKind.NamespaceDeclaration, implicitClass.DeclaringSyntaxReferences.Single().GetSyntax().Kind()); 43n = ((NamespaceSymbol)c2.GlobalNamespace.GetMembers("N").Single()); 44implicitClass = ((NamedTypeSymbol)n.GetMembers().Single()); 66Assert.Equal(SyntaxKind.CompilationUnit, scriptClass.DeclaringSyntaxReferences.Single().GetSyntax().Kind()); 70var tree = c.SyntaxTrees.Single(); 113var tree = comp.SyntaxTrees.Single();
Symbols\IndexerTests.cs (44)
58CheckIndexer(type.Indexers.Single(), true, true, SpecialType.System_String, SpecialType.System_String); 61CheckIndexer(type.Indexers.Single(), false, true, SpecialType.System_Object, SpecialType.System_Int32, SpecialType.None); 64CheckIndexer(type.Indexers.Single(), true, false, SpecialType.System_Object, SpecialType.System_String); 132CheckIndexer(type.Indexers.Single(), true, true, SpecialType.System_Object, SpecialType.System_String); 135CheckIndexer(type.Indexers.Single(), true, false, SpecialType.System_Object, SpecialType.System_String); 138CheckIndexer(type.Indexers.Single(), true, true, SpecialType.System_Object, SpecialType.System_String); 148CheckIndexer(sourceType.Indexers.Single(), true, true, SpecialType.System_Object, SpecialType.System_String); 159CheckIndexer(sourceType.Indexers.Single(), true, true, SpecialType.System_Object, SpecialType.System_String); 173return new KeyValuePair<string, string>(bridge.ExplicitInterfaceImplementations.Single().ToTestDisplayString(), bridge.ImplementingMethod.ToTestDisplayString()); 284var indexerC = classC.Indexers.Single(); 318var interface1Indexer = interface1.Indexers.Single(); 321var interface2Indexer = interface2.Indexers.Single(); 324var classIndexer = @class.Indexers.Single(); 348var interface1GetterImpl = synthesizedExplicitImplementations[0].ExplicitInterfaceImplementations.Single(); 349var interface2GetterImpl = synthesizedExplicitImplementations[1].ExplicitInterfaceImplementations.Single(); 400var interface1Indexer = interface1.Indexers.Single(); 403var interface2Indexer = interface2.Indexers.Single(); 406var classIndexer = @class.Indexers.Single(); 430var interface1GetterImpl = synthesizedExplicitImplementations[0].ExplicitInterfaceImplementations.Single(); 431var interface2GetterImpl = synthesizedExplicitImplementations[1].ExplicitInterfaceImplementations.Single(); 483var classIndexer = @class.Indexers.Single(); 489var synthesizedExplicitImplementation = @class.GetSynthesizedExplicitImplementations(default(CancellationToken)).ForwardingMethods.Single(); 493Assert.Equal(interfaceIndexers[0].GetMethod, synthesizedExplicitImplementation.ExplicitInterfaceImplementations.Single()); 494Assert.Equal(interfaceIndexers[1].GetMethod, synthesizedExplicitImplementation.ExplicitInterfaceImplementations.Single()); 613var baseIndexer = baseClass.Indexers.Single(); 616var derivedIndexer = derivedClass.Indexers.Single(); 625Assert.Equal(baseIndexer, derivedIndexer.OverriddenOrHiddenMembers.HiddenMembers.Single()); 670var baseIndexer = baseClass.Indexers.Single(); 673var derivedIndexer = derivedClass.Indexers.Single(); 741var derivedIndexer = derivedClass.Indexers.Single(); 812var derivedIndexer = derivedClass.Indexers.Single(); 1157var interfaceIndexer = @interface.Indexers.Single(); 1181var classIndexer = @class.Indexers.Single(); 1293var baseIndexer = baseClass.Indexers.Single(); 1436var indexer = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>("B").Indexers.Single(); 1461var indexer = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>("I").Indexers.Single(); 1600Assert.Equal("X", classA.Indexers.Single().MetadataName); 2129var indexer = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>("Program").Indexers.Single(); 2132Assert.True(indexer.GetAttributes().Single().IsTargetAttribute(AttributeDescription.IndexerNameAttribute)); 2136var peIndexer = (PEPropertySymbol)module.GlobalNamespace.GetTypeMember("Program").Indexers.Single(); 2404NamedTypeSymbol type01 = comp.SourceModule.GlobalNamespace.GetTypeMembers("Test").Single(); 2405var indexer = type01.GetMembers(WellKnownMemberNames.Indexer).Single() as PropertySymbol; 2560Assert.True(((TypeSymbol)compilation.GlobalNamespace.GetTypeMembers("C").Single()).GetMembers().Any(x => x.IsIndexer())); 2564Assert.True(((TypeSymbol)compilation.GlobalNamespace.GetTypeMembers("C").Single()).GetMembers().Any(x => x.IsIndexer()));
Symbols\InterfaceImplementationTests.cs (151)
51var @base = (NamedTypeSymbol)global.GetMembers("Base").Single(); 53var baseMethod = @base.GetMembers("Method").Single(); 59var baseIndexer = @base.Indexers.Single(); 65var baseField = @base.GetMembers("Field").Single(); 68var baseNestedInterface = @base.GetMembers("Interface").Single(); 71var baseNestedClass = @base.GetMembers("Class").Single(); 74var baseNestedStruct = @base.GetMembers("Struct").Single(); 77var baseNestedEnum = @base.GetMembers("Enum").Single(); 80var baseNestedDelegate = @base.GetMembers("Delegate").Single(); 85var @interface = (NamedTypeSymbol)global.GetMembers("Interface").Single(); 87var interfaceMethod = @base.GetMembers("Method").Single(); 122var baseInterface = (NamedTypeSymbol)global.GetMembers("BaseInterface").Single(); 123var baseInterfaceMethod = baseInterface.GetMembers("Method").Single(); 125var @interface = (NamedTypeSymbol)global.GetMembers("Interface").Single(); 126var interfaceMethod = @interface.GetMembers("Method").Single(); 128var @class = (NamedTypeSymbol)global.GetMembers("Class").Single(); 130var classExplicitImplementationBase = (MethodSymbol)@class.GetMembers("BaseInterface.Method").Single(); 133var classExplicitImplementation = (MethodSymbol)@class.GetMembers("Interface.Method").Single(); 136var classImplicitImplementation = (MethodSymbol)@class.GetMembers("Method").Single(); 178var baseInterface = (NamedTypeSymbol)global.GetMembers("BaseInterface").Single(); 179var baseInterfaceIndexer = baseInterface.Indexers.Single(); 181var @interface = (NamedTypeSymbol)global.GetMembers("Interface").Single(); 182var interfaceIndexer = @interface.Indexers.Single(); 184var @class = (NamedTypeSymbol)global.GetMembers("Class").Single(); 245var baseInterface1 = (NamedTypeSymbol)global.GetMembers("BaseInterface1").Single(); 246var baseInterface1Method = baseInterface1.GetMembers("BaseMethod").Single(); 248var baseInterface2 = (NamedTypeSymbol)global.GetMembers("BaseInterface2").Single(); 249var baseInterface2Method = baseInterface2.GetMembers("BaseMethod").Single(); 251var @interface = (NamedTypeSymbol)global.GetMembers("Interface").Single(); 252var interfaceMethod = @interface.GetMembers("Method").Single(); 254var @class = (NamedTypeSymbol)global.GetMembers("Class").Single(); 256var classImplicitImplementation = (MethodSymbol)@class.GetMembers("Method").Single(); 259var classImplicitImplementationBase = (MethodSymbol)@class.GetMembers("BaseMethod").Single(); 317var baseInterface1 = (NamedTypeSymbol)global.GetMembers("BaseInterface1").Single(); 318var baseInterface1Indexer = baseInterface1.Indexers.Single(); 320var baseInterface2 = (NamedTypeSymbol)global.GetMembers("BaseInterface2").Single(); 321var baseInterface2Indexer = baseInterface2.Indexers.Single(); 323var @interface = (NamedTypeSymbol)global.GetMembers("Interface").Single(); 324var interfaceIndexer = @interface.Indexers.Single(); 326var @class = (NamedTypeSymbol)global.GetMembers("Class").Single(); 374var @interface = (NamedTypeSymbol)global.GetMembers("Interface").Single(); 375var interfaceMethod = @interface.GetMembers("Method").Single(); 377var class1 = (NamedTypeSymbol)global.GetMembers("Class1").Single(); 380var class2 = (NamedTypeSymbol)global.GetMembers("Class2").Single(); 431var baseInterface = (NamedTypeSymbol)global.GetMembers("BaseInterface").Single(); 432var baseInterfaceMethod = baseInterface.GetMembers("Method").Single(); 434var @interface = (NamedTypeSymbol)global.GetMembers("Interface").Single(); 435var interfaceMethod = @interface.GetMembers("Method").Single(); 437var baseClass = (NamedTypeSymbol)global.GetMembers("BaseClass").Single(); 439var baseClassExplicitImplementationBase = (MethodSymbol)baseClass.GetMembers("BaseInterface.Method").Single(); 442var baseClassExplicitImplementation = (MethodSymbol)baseClass.GetMembers("Interface.Method").Single(); 445var baseClassImplicitImplementation = (MethodSymbol)baseClass.GetMembers("Method").Single(); 451var class1 = (NamedTypeSymbol)global.GetMembers("Class1").Single(); 459var class2 = (NamedTypeSymbol)global.GetMembers("Class2").Single(); 507var baseInterface1 = (NamedTypeSymbol)global.GetMembers("BaseInterface1").Single(); 508var baseInterface1Method = baseInterface1.GetMembers("BaseMethod").Single(); 510var baseInterface2 = (NamedTypeSymbol)global.GetMembers("BaseInterface2").Single(); 511var baseInterface2Method = baseInterface2.GetMembers("BaseMethod").Single(); 513var @interface = (NamedTypeSymbol)global.GetMembers("Interface").Single(); 514var interfaceMethod = @interface.GetMembers("Method").Single(); 516var baseClass = (NamedTypeSymbol)global.GetMembers("BaseClass").Single(); 518var baseClassImplicitImplementation = (MethodSymbol)baseClass.GetMembers("Method").Single(); 521var baseClassImplicitImplementationBase = (MethodSymbol)baseClass.GetMembers("BaseMethod").Single(); 524var class1 = (NamedTypeSymbol)global.GetMembers("Class1").Single(); 535var class2 = (NamedTypeSymbol)global.GetMembers("Class2").Single(); 575var @interface = (NamedTypeSymbol)global.GetMembers("Interface").Single(); 576var interfaceMethod = @interface.GetMembers("Method").Single(); 578var baseClass = (NamedTypeSymbol)global.GetMembers("BaseClass").Single(); 581var baseClassMethod = (MethodSymbol)baseClass.GetMembers("Method").Single(); 584var class1 = (NamedTypeSymbol)global.GetMembers("Class1").Single(); 588var class2 = (NamedTypeSymbol)global.GetMembers("Class2").Single(); 625var @interface = (NamedTypeSymbol)global.GetMembers("Interface").Single(); 626var interfaceIndexer = @interface.Indexers.Single(); 628var baseClass = (NamedTypeSymbol)global.GetMembers("BaseClass").Single(); 631var baseClassIndexer = baseClass.Indexers.Single(); 633var class1 = (NamedTypeSymbol)global.GetMembers("Class1").Single(); 637var class2 = (NamedTypeSymbol)global.GetMembers("Class2").Single(); 676var @interface = (NamedTypeSymbol)global.GetMembers("Interface").Single(); 677var interfaceMethod = @interface.GetMembers("Method").Single(); 679var baseClass = (NamedTypeSymbol)global.GetMembers("BaseClass").Single(); 680var baseClassMethod = (MethodSymbol)baseClass.GetMembers("Interface.Method").Single(); 686var class1 = (NamedTypeSymbol)global.GetMembers("Class1").Single(); 687var class1Method = (MethodSymbol)class1.GetMembers("Method").Single(); 694var class2 = (NamedTypeSymbol)global.GetMembers("Class2").Single(); 695var class2Method = (MethodSymbol)class2.GetMembers("Method").Single(); 737var @interface = (NamedTypeSymbol)global.GetMembers("Interface").Single(); 738var interfaceMethodVirtual = @interface.GetMembers("Virtual").Single(); 739var interfaceMethodNonVirtual = @interface.GetMembers("NonVirtual").Single(); 741var baseClass = (NamedTypeSymbol)global.GetMembers("BaseClass").Single(); 743var baseClassMethodVirtual = (MethodSymbol)baseClass.GetMembers("Virtual").Single(); 747var baseClassMethodNonVirtual = (MethodSymbol)baseClass.GetMembers("NonVirtual").Single(); 757var class1 = (NamedTypeSymbol)global.GetMembers("Class1").Single(); 759var class1MethodVirtual = (MethodSymbol)class1.GetMembers("Virtual").Single(); 763var class1MethodNonVirtual = (MethodSymbol)class1.GetMembers("NonVirtual").Single(); 775var class2 = (NamedTypeSymbol)global.GetMembers("Class2").Single(); 777var class2MethodVirtual = (MethodSymbol)class2.GetMembers("Virtual").Single(); 781var class2MethodNonVirtual = (MethodSymbol)class2.GetMembers("NonVirtual").Single(); 827var @interface = (NamedTypeSymbol)global.GetMembers("Interface").Single(); 828var interfaceMethod = @interface.GetMembers("Method").Single(); 830var nonDeclaring1 = (NamedTypeSymbol)global.GetMembers("NonDeclaringClass1").Single(); 833var nonDeclaring1Method = nonDeclaring1.GetMembers("Method").Single(); 835var declaring1 = (NamedTypeSymbol)global.GetMembers("DeclaringClass1").Single(); 839var nonDeclaring2 = (NamedTypeSymbol)global.GetMembers("NonDeclaringClass2").Single(); 843var nonDeclaring2Method = nonDeclaring2.GetMembers("Method").Single(); 845var declaring2 = (NamedTypeSymbol)global.GetMembers("DeclaringClass2").Single(); 871var @interface = (NamedTypeSymbol)global.GetMembers("I1").Single(); 872var interfaceMethod = @interface.GetMembers("Method1").Single(); 874var baseClass = (NamedTypeSymbol)global.GetMembers("BaseDeclaresInterface").Single(); 878var derivedClass = (NamedTypeSymbol)global.GetMembers("DerivedExplicitlyImplementsInterface").Single(); 882var derivedClassMethod = derivedClass.GetMembers("I1.Method1").Single(); 911var @interface = (NamedTypeSymbol)global.GetMembers("Interface").Single(); 912var interfaceMethod = (MethodSymbol)@interface.GetMembers("Method").Single(); 913var interfaceProperty = (PropertySymbol)@interface.GetMembers("Property").Single(); 917var baseClass = (NamedTypeSymbol)global.GetMembers("Base").Single(); 920var baseClassMethod = (MethodSymbol)baseClass.GetMembers("Method").Single(); 921var baseClassProperty = (PropertySymbol)baseClass.GetMembers("Property").Single(); 930var derivedClass = (SourceNamedTypeSymbol)global.GetMembers("Derived").Single(); 980var @interface = (NamedTypeSymbol)global.GetMembers("Interface").Single(); 981var interfaceMethod = (MethodSymbol)@interface.GetMembers("Method").Single(); 982var interfaceProperty = (PropertySymbol)@interface.GetMembers("Property").Single(); 986var baseClass = (NamedTypeSymbol)global.GetMembers("Base").Single(); 989var baseClassMethod = (MethodSymbol)baseClass.GetMembers("Method").Single(); 990var baseClassProperty = (PropertySymbol)baseClass.GetMembers("Property").Single(); 999var derivedClass = (SourceNamedTypeSymbol)global.GetMembers("Derived").Single(); 1017Assert.Same(interfaceMethod, synthesizedExplicitImpls[0].ExplicitInterfaceImplementations.Single()); 1020Assert.Same(interfacePropertyGetter, synthesizedExplicitImpls[1].ExplicitInterfaceImplementations.Single()); 1024Assert.Same(interfacePropertySetter, synthesizedExplicitImpls[2].ExplicitInterfaceImplementations.Single()); 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(); 1086Assert.Same(interfaceMethod1, synthesizedExplicitMethod1Impl.ExplicitInterfaceImplementations.Single()); 1091Assert.Same(interfaceMethod2, synthesizedExplicitMethod2Impl.ExplicitInterfaceImplementations.Single()); 1149var type = comp.GlobalNamespace.GetTypeMembers("c2").Single(); 1590var typeSymbol = comp.GlobalNamespace.GetTypeMembers("C1").Single(); 1642Assert.Equal(@interface, classA.AllInterfaces().Single()); 1643Assert.Equal(@interface, classB.AllInterfaces().Single()); 1644Assert.Equal(@interface, classC.AllInterfaces().Single()); 1655var synthesizedExplicitImpl = classC.GetSynthesizedExplicitImplementations(CancellationToken.None).ForwardingMethods.Single(); 1657Assert.Equal(interfaceMethod, synthesizedExplicitImpl.ExplicitInterfaceImplementations.Single()); 1702Assert.Equal(@interface, classA.AllInterfaces().Single()); 1703Assert.Equal(@interface, classB.AllInterfaces().Single()); 1704Assert.Equal(@interface, classC.AllInterfaces().Single()); 1900var bridgeMethod = derivedType.GetSynthesizedExplicitImplementations(CancellationToken.None).ForwardingMethods.Single(); 2036var synthesized = derivedType.GetSynthesizedExplicitImplementations(CancellationToken.None).ForwardingMethods.Single(); 2038Assert.Equal(interfaceMethod, synthesized.ExplicitInterfaceImplementations.Single()); 2221Single(m => m.ExplicitInterfaceImplementations.Single().MethodKind == MethodKind.EventAdd); 2497var implementation = derivedType.FindImplementationForInterfaceMember(baseType.Interfaces().Single().GetMember("GetHashCode"));
Symbols\InterfaceOverriddenOrHiddenMembersTests.cs (10)
853Assert.Equal(aMethod, bMethod.OverriddenOrHiddenMembers.HiddenMembers.Single()); 882Assert.Equal(aMethod, bMethod.OverriddenOrHiddenMembers.HiddenMembers.Single()); 911Assert.Equal(aMethod, bMethod.OverriddenOrHiddenMembers.HiddenMembers.Single()); 940Assert.Equal(aMethod, bMethod.OverriddenOrHiddenMembers.HiddenMembers.Single()); 969Assert.Equal(aProperty, bProperty.OverriddenOrHiddenMembers.HiddenMembers.Single()); 998Assert.Equal(aProperty, bProperty.OverriddenOrHiddenMembers.HiddenMembers.Single()); 1027Assert.Equal(aProperty, bProperty.OverriddenOrHiddenMembers.HiddenMembers.Single()); 1053Assert.Equal(aMethod, bMethod.OverriddenOrHiddenMembers.HiddenMembers.Single()); 1079Assert.Equal(aMethod, bMethod.OverriddenOrHiddenMembers.HiddenMembers.Single()); 1105Assert.Equal(aProperty, bProperty.OverriddenOrHiddenMembers.HiddenMembers.Single());
Symbols\LocalFunctionTests.cs (8)
444var tree = comp.SyntaxTrees.Single(); 468var tree = comp.SyntaxTrees.Single(); 497var tree = comp.SyntaxTrees.Single(); 520var tree = comp.SyntaxTrees.Single(); 560m.GlobalNamespace.GetMember<NamedTypeSymbol>("Test1.<>c__DisplayClass0_0").TypeParameters.Single().GetAttributes().Select(a => a.ToString())); 591m.GlobalNamespace.GetMember<MethodSymbol>("Test1.<M2>g__local|0_0").TypeParameters.Single().GetAttributes().Select(a => a.ToString())); 627m.GlobalNamespace.GetMember<NamedTypeSymbol>("Test1.<>c__DisplayClass0_0").TypeParameters.Single().GetAttributes().Select(a => a.ToString())); 630m.GlobalNamespace.GetMember<MethodSymbol>("Test1.<M2>g__local|0_0").TypeParameters.Single().GetAttributes().Select(a => a.ToString()));
Symbols\LookupSymbolsInfoTests.cs (1)
93var tree = compilation.SyntaxTrees.Single();
Symbols\Metadata\MetadataMemberTests.cs (19)
157var ns1 = mscorNS.GlobalNamespace.GetMembers("System").Single() as NamespaceSymbol; 158var type1 = ns1.GetTypeMembers("StringComparer").Single() as NamedTypeSymbol; 159var ctor = type1.InstanceConstructors.Single(); 192var ns1 = mscorNS.GlobalNamespace.GetMembers("Microsoft").Single() as NamespaceSymbol; 193var ns2 = ns1.GetMembers("Runtime").Single() as NamespaceSymbol; 194var ns3 = ns2.GetMembers("Hosting").Single() as NamespaceSymbol; 244var ns1 = mscorNS.GlobalNamespace.GetMembers("Microsoft").Single() as NamespaceSymbol; 245var ns2 = (ns1.GetMembers("Runtime").Single() as NamespaceSymbol).GetMembers("Hosting").Single() as NamespaceSymbol; 302var ns1 = (mscorNS.GlobalNamespace.GetMembers("System").Single() as NamespaceSymbol).GetMembers("Collections").Single() as NamespaceSymbol; 303var ns2 = ns1.GetMembers("Generic").Single() as NamespaceSymbol; 306var member1 = type1.GetMembers("Add").Single() as MethodSymbol; 307var member2 = type1.GetMembers("TryGetValue").Single() as MethodSymbol; 347var ns1 = (mscorNS.GlobalNamespace.GetMembers("System").Single() as NamespaceSymbol).GetMembers("Collections").Single() as NamespaceSymbol; 348var ns2 = ns1.GetMembers("Generic").Single() as NamespaceSymbol; 351var member1 = type1.GetMembers("TryGetValue").Single() as MethodSymbol; 396var classC = compilation.SourceModule.GlobalNamespace.GetTypeMembers("C").Single();
Symbols\Metadata\MetadataTypeTests.cs (21)
33var ns1 = mscorNS.GlobalNamespace.GetMembers("System").Single() as NamespaceSymbol; 34var ns2 = ns1.GetMembers("Runtime").Single() as NamespaceSymbol; 35var ns = ns2.GetMembers("Serialization").Single() as NamespaceSymbol; 72var ns1 = mscorNS.GlobalNamespace.GetMembers("Microsoft").Single() as NamespaceSymbol; 73var ns2 = ns1.GetMembers("Runtime").Single() as NamespaceSymbol; 74var ns3 = ns2.GetMembers("Hosting").Single() as NamespaceSymbol; 123var ns1 = (mscorNS.GlobalNamespace.GetMembers("System").Single() as NamespaceSymbol).GetMembers("Collections").Single() as NamespaceSymbol; 124var ns2 = ns1.GetMembers("Generic").Single() as NamespaceSymbol; 171var ns1 = (mscorNS.GlobalNamespace.GetMembers("System").Single() as NamespaceSymbol).GetMembers("Collections").Single() as NamespaceSymbol; 172var ns2 = ns1.GetMembers("Generic").Single() as NamespaceSymbol; 222var ns1 = mscorNS.GlobalNamespace.GetMembers("System").Single() as NamespaceSymbol; 223var ns2 = ns1.GetMembers("Runtime").Single() as NamespaceSymbol; 224var ns3 = ns2.GetMembers("Serialization").Single() as NamespaceSymbol; 288var ns1 = systemCoreNS.GlobalNamespace.GetMembers("System").Single() as NamespaceSymbol; 289var ns2 = ns1.GetMembers("Diagnostics").Single() as NamespaceSymbol; 290var ns3 = ns2.GetMembers("Eventing").Single() as NamespaceSymbol; 292var type1 = ns3.GetTypeMembers("EventProviderBase").Single() as NamedTypeSymbol; 294var type2 = (type1.GetMembers("m_eventData").Single() as FieldSymbol).Type as ArrayTypeSymbol; 295var member2 = type1.GetMembers("WriteTransferEventHelper").Single() as MethodSymbol;
Symbols\Metadata\PE\BaseTypeResolution.cs (29)
113var varTC2 = module1.GlobalNamespace.GetTypeMembers("TC2").Single(); 114var varTC3 = module1.GlobalNamespace.GetTypeMembers("TC3").Single(); 115var varTC4 = module1.GlobalNamespace.GetTypeMembers("TC4").Single(); 121var varC1 = module1.GlobalNamespace.GetTypeMembers("C1").Single(); 125var varTC5 = module2.GlobalNamespace.GetTypeMembers("TC5").Single(); 126var varTC6 = module2.GlobalNamespace.GetTypeMembers("TC6").Single(); 127var varTC7 = module2.GlobalNamespace.GetTypeMembers("TC7").Single(); 128var varTC8 = module2.GlobalNamespace.GetTypeMembers("TC8").Single(); 129var varTC9 = varTC6.GetTypeMembers("TC9").Single(); 139var varCorTypes_Derived = varCorTypes.GetTypeMembers("Derived").Single(); 143var varCorTypes_Derived1 = varCorTypes.GetTypeMembers("Derived1").Single(); 147var varI101 = module1.GlobalNamespace.GetTypeMembers("I101").Single(); 148var varI102 = module1.GlobalNamespace.GetTypeMembers("I102").Single(); 150var varC203 = module1.GlobalNamespace.GetTypeMembers("C203").Single(); 154var varC204 = module1.GlobalNamespace.GetTypeMembers("C204").Single(); 184var derived1 = module0.GlobalNamespace.GetTypeMembers("Derived1").Single(); 187var derived2 = module0.GlobalNamespace.GetTypeMembers("Derived2").Single(); 190var derived3 = module0.GlobalNamespace.GetTypeMembers("Derived3").Single(); 197Assert.Same(base1, module1.GlobalNamespace.GetTypeMembers("Class1").Single()); 198Assert.Same(base2, module2.GlobalNamespace.GetTypeMembers("Class2").Single()); 199Assert.Same(base3, module3.GlobalNamespace.GetTypeMembers("Class3").Single()); 224var localTC1 = module0.GlobalNamespace.GetTypeMembers("TC1").Single(); 230var localTC2 = module0.GlobalNamespace.GetTypeMembers("TC2").Single(); 236var localTC3 = module0.GlobalNamespace.GetTypeMembers("TC3").Single(); 242var localTC4 = module0.GlobalNamespace.GetTypeMembers("TC4").Single(); 248var localTC5 = module0.GlobalNamespace.GetTypeMembers("TC5").Single(); 254var localTC6 = module0.GlobalNamespace.GetTypeMembers("TC6").Single(); 260var localTC7 = module0.GlobalNamespace.GetTypeMembers("TC7").Single(); 266var localTC8 = module0.GlobalNamespace.GetTypeMembers("TC8").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\LoadCustomModifiers.cs (3)
32var modifiers = modifiersModule.GlobalNamespace.GetTypeMembers("Modifiers").Single(); 161var propertyTypeCustomModifier = property.TypeWithAnnotations.CustomModifiers.Single(); 170var arrayPropertyTypeCustomModifiers = arrayPropertyType.ElementTypeWithAnnotations.CustomModifiers.Single();
Symbols\Metadata\PE\LoadingAttributes.cs (45)
207var innerC1 = c1.GetTypeMembers("InnerC1").Single(); 214var innerC2 = innerC1.GetTypeMembers("InnerC2").Single(); 384var c1 = (NamedTypeSymbol)assemblies[0].Modules[0].GlobalNamespace.GetMembers("C1").Single(); 389Assert.Equal("Integer", attr.CommonConstructorArguments.Single().Value); 395Assert.Equal("Integer", attr.CommonConstructorArguments.Single().Value); 429var c2 = (NamedTypeSymbol)assemblies[0].Modules[0].GlobalNamespace.GetMembers("C2").Single(); 476var arg = field.GetAttributes().Single(); 480arg = field.GetAttributes().Single(); 484arg = field.GetAttributes().Single(); 488arg = field.GetAttributes().Single(); 492arg = field.GetAttributes().Single(); 496var t = field.GetAttributes().First().CommonConstructorArguments.Single().Type; 498arg = field.GetAttributes().Single(); 502arg = field.GetAttributes().Single(); 503t = arg.CommonConstructorArguments.Single().Type; 508arg = field.GetAttributes().Single(); 509t = arg.CommonConstructorArguments.Single().Type; 691var attrObj = (NamedTypeSymbol)interopNS.GetTypeMembers("GuidAttribute").Single(); 696attrObj = (NamedTypeSymbol)interopNS.GetTypeMembers("InterfaceTypeAttribute").Single(); 704attrObj = (NamedTypeSymbol)interopNS.GetTypeMembers("TypeLibImportClassAttribute").Single(); 745var attrObj = (NamedTypeSymbol)interopNS.GetTypeMembers("ComVisibleAttribute").Single(); 749attrObj = (NamedTypeSymbol)interopNS.GetTypeMembers("UnmanagedFunctionPointerAttribute").Single(); 851var attrObj = (NamedTypeSymbol)interopNS.GetTypeMembers("CoClassAttribute").Single(); 856attrObj = (NamedTypeSymbol)reflectNS.GetTypeMembers("DefaultMemberAttribute").Single(); 912var attrObj1 = (NamedTypeSymbol)caNS.GetTypeMembers("AttrName").Single(); 913var attrObj2 = (NamedTypeSymbol)caNS.GetTypeMembers("AttrNameAttribute").Single(); 947var attrObj1 = (NamedTypeSymbol)caNS.GetTypeMembers("AllInheritMultipleAttribute").Single(); 948var attrObj2 = (NamedTypeSymbol)caNS.GetTypeMembers("DerivedAttribute").Single(); 1049var attrObj1 = (NamedTypeSymbol)caNS.GetTypeMembers("AllInheritMultipleAttribute").Single(); 1054var attrObj2 = (NamedTypeSymbol)caNS.GetTypeMembers("DerivedAttribute").Single(); 1181var asmFileAttr = (NamedTypeSymbol)refNS.GetTypeMembers("AssemblyFileVersionAttribute").Single(); 1185var asmInfoAttr = (NamedTypeSymbol)refNS.GetTypeMembers("AssemblyInformationalVersionAttribute").Single(); 1199var corsysNS = assemblies[2].GlobalNamespace.GetMembers("System").Single() as NamespaceSymbol; 1200var diagNS = corsysNS.GetMembers("Diagnostics").Single() as NamespaceSymbol; 1206var dbgProxyAttr = (NamedTypeSymbol)diagNS.GetTypeMembers("DebuggerTypeProxyAttribute").Single(); 1231var type01 = (NamedTypeSymbol)secondNS.GetTypeMembers("SchemeSettingElement").Single(); 1264var resCatAttr = (NamedTypeSymbol)secondNS.GetTypeMembers("ResCategoryAttribute").Single(); 1265var resDesAttr = (NamedTypeSymbol)secondNS.GetTypeMembers("ResDescriptionAttribute").Single(); 1268var defValAttr = (NamedTypeSymbol)level02NS.GetTypeMembers("DefaultValueAttribute").Single(); 1270var type01 = (NamedTypeSymbol)thirdNS.GetTypeMembers("DataAdapter").Single(); 1307var parameter = (PEParameterSymbol)class1.GetMethod("M1").GetParameters().Single(); 1310Assert.Equal("System.Runtime.CompilerServices.DecimalConstantAttribute(0, 128, 0, 0, 7)", peModule.GetCustomAttributesForToken(field.Handle).Single().ToString()); 1314Assert.Equal("System.Runtime.CompilerServices.DecimalConstantAttribute(0, 128, 0, 0, 7)", peModule.GetCustomAttributesForToken(parameter.Handle).Single().ToString()); 1514Assert.Equal(expected, c.GetTypeByMetadataName("Test").GetAttributes().Single().ToString()); 1518Assert.Equal(expected, m.GlobalNamespace.GetTypeMember("Test").GetAttributes().Single().ToString());
Symbols\Metadata\PE\LoadingEvents.cs (38)
116Assert.Equal(@event.Type, accessor.Parameters.Single().Type); 135Assert.NotEqual(mismatchedAddEvent.Type, mismatchedAddEvent.AddMethod.Parameters.Single().Type); 138Assert.NotEqual(mismatchedRemoveEvent.Type, mismatchedRemoveEvent.RemoveMethod.Parameters.Single().Type); 195var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Interface").Single(); 198var interfaceEvent = (EventSymbol)@interface.GetMembers("Event").Single(); 200var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Class").Single(); 204var classEvent = (EventSymbol)@class.GetMembers("Interface.Event").Single(); 206var explicitImpl = classEvent.ExplicitInterfaceImplementations.Single(); 222var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGeneric").Single(); 225var interfaceEvent = (EventSymbol)@interface.GetMembers("Event").Single(); 227var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Generic").Single(); 230var substitutedInterface = @class.Interfaces().Single(); 233var substitutedInterfaceEvent = (EventSymbol)substitutedInterface.GetMembers("Event").Single(); 236var classEvent = (EventSymbol)@class.GetMembers("IGeneric<S>.Event").Single(); 238var explicitImpl = classEvent.ExplicitInterfaceImplementations.Single(); 254var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGeneric").Single(); 257var interfaceEvent = (EventSymbol)@interface.GetMembers("Event").Single(); 259var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Constructed").Single(); 262var substitutedInterface = @class.Interfaces().Single(); 265var substitutedInterfaceEvent = (EventSymbol)substitutedInterface.GetMembers("Event").Single(); 268var classEvent = (EventSymbol)@class.GetMembers("IGeneric<System.Int32>.Event").Single(); 270var explicitImpl = classEvent.ExplicitInterfaceImplementations.Single(); 290var defInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Interface").Single(); 293var defInterfaceEvent = (EventSymbol)defInterface.GetMembers("Event").Single(); 295var refInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGenericInterface").Single(); 299var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IndirectImplementation").Single(); 307var classEvent = (EventSymbol)@class.GetMembers("Interface.Event").Single(); 309var explicitImpl = classEvent.ExplicitInterfaceImplementations.Single(); 330var outerInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGeneric2").Single(); 336var outerClass = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Outer").Single(); 340var innerInterface = (NamedTypeSymbol)outerClass.GetTypeMembers("IInner").Single(); 346var innerClass1 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner1").Single(); 349var innerClass2 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner2").Single(); 352var innerClass3 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner3").Single(); 355var innerClass4 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner4").Single(); 365Assert.Equal(@interface, innerClass.Interfaces().Single().ConstructedFrom); 367var innerClassEvent = (EventSymbol)innerClass.GetMembers(methodName).Single(); 368var innerClassImplementingEvent = innerClassEvent.ExplicitInterfaceImplementations.Single();
Symbols\Metadata\PE\LoadingFields.cs (11)
35var vbFields = module2.GlobalNamespace.GetTypeMembers("VBFields").Single(); 36var csFields = module1.GlobalNamespace.GetTypeMembers("CSFields").Single(); 38var f1 = (FieldSymbol)vbFields.GetMembers("F1").Single(); 39var f2 = (FieldSymbol)vbFields.GetMembers("F2").Single(); 40var f3 = (FieldSymbol)vbFields.GetMembers("F3").Single(); 41var f4 = (FieldSymbol)vbFields.GetMembers("F4").Single(); 42var f5 = (FieldSymbol)vbFields.GetMembers("F5").Single(); 43var f6 = (FieldSymbol)csFields.GetMembers("F6").Single(); 109Assert.Equal(SymbolKind.NamedType, csFields.GetMembers("FFF").Single().Kind); 110Assert.Equal(SymbolKind.Field, csFields.GetMembers("Fff").Single().Kind); 111Assert.Equal(SymbolKind.Method, csFields.GetMembers("FfF").Single().Kind);
Symbols\Metadata\PE\LoadingGenericTypeParameters.cs (18)
28GetTypeMembers("Object").Single(); 37var varC1 = module0.GlobalNamespace.GetTypeMembers("C1").Single(); 77Assert.Same(module0, varC1_T.Locations.Single().MetadataModuleInternal); 80var varC2 = varC1.GetTypeMembers("C2").Single(); 90var varC3 = varC1.GetTypeMembers("C3").Single(); 95var varC4 = varC3.GetTypeMembers("C4").Single(); 105var varTC2 = module0.GlobalNamespace.GetTypeMembers("TC2").Single(); 125var varC100 = module0.GlobalNamespace.GetTypeMembers("C100").Single(); 132var varC101 = module0.GlobalNamespace.GetTypeMembers("C101").Single(); 139var varC102 = module0.GlobalNamespace.GetTypeMembers("C102").Single(); 147var varC103 = module0.GlobalNamespace.GetTypeMembers("C103").Single(); 155var varC104 = module0.GlobalNamespace.GetTypeMembers("C104").Single(); 163var varC105 = module0.GlobalNamespace.GetTypeMembers("C105").Single(); 170var varC106 = module0.GlobalNamespace.GetTypeMembers("C106").Single(); 177var varI101 = module0.GlobalNamespace.GetTypeMembers("I101").Single(); 178var varI102 = module0.GlobalNamespace.GetTypeMembers("I102").Single(); 180var varC201 = module0.GlobalNamespace.GetTypeMembers("C201").Single(); 185var localC202 = module0.GlobalNamespace.GetTypeMembers("C202").Single();
Symbols\Metadata\PE\LoadingIndexers.cs (8)
605Assert.Equal(RefKind.Ref, indexer.Parameters.Single().RefKind); 789var property1ParamName = property1.Parameters.Single().Name; 792Assert.NotEqual(property1ParamName, property1.GetMethod.Parameters.Single().Name); 796var property2ParamName = property2.Parameters.Single().Name; 798Assert.Equal(property2ParamName, property2.GetMethod.Parameters.Single().Name); 801var property3ParamName = property3.Parameters.Single().Name; 1172var interfaceIndexer = @interface.Indexers.Single(); 1180Assert.Equal(interfaceIndexer, classIndexer.ExplicitInterfaceImplementations.Single());
Symbols\Metadata\PE\LoadingMetadataTokens.cs (4)
61var parameter = method.GetParameters().Single(); 67var typeParameter = genericMethod.GetMemberTypeParameters().Single(); 119var parameter = method.GetParameters().Single(); 125var typeParameter = genericMethod.GetMemberTypeParameters().Single();
Symbols\Metadata\PE\LoadingMethods.cs (118)
45var varTC10 = module2.GlobalNamespace.GetTypeMembers("TC10").Single(); 49var localM1 = (MethodSymbol)varTC10.GetMembers("M1").Single(); 50var localM2 = (MethodSymbol)varTC10.GetMembers("M2").Single(); 51var localM3 = (MethodSymbol)varTC10.GetMembers("M3").Single(); 52var localM4 = (MethodSymbol)varTC10.GetMembers("M4").Single(); 53var localM5 = (MethodSymbol)varTC10.GetMembers("M5").Single(); 58Assert.Same(module2, localM1.Locations.Single().MetadataModuleInternal); 93var localC107 = module1.GlobalNamespace.GetTypeMembers("C107").Single(); 94var varC108 = localC107.GetMembers("C108").Single(); 97var csharpC1 = module3.GlobalNamespace.GetTypeMembers("C1").Single(); 98var sameName1 = csharpC1.GetMembers("SameName").Single(); 99var sameName2 = csharpC1.GetMembers("sameName").Single(); 110var basicC1 = module4.GlobalNamespace.GetTypeMembers("C1").Single(); 112var basicC1_M1 = (MethodSymbol)basicC1.GetMembers("M1").Single(); 113var basicC1_M2 = (MethodSymbol)basicC1.GetMembers("M2").Single(); 114var basicC1_M3 = (MethodSymbol)basicC1.GetMembers("M3").Single(); 115var basicC1_M4 = (MethodSymbol)basicC1.GetMembers("M4").Single(); 119Assert.Same(module4, basicC1_M1.Parameters[0].Locations.Single().MetadataModuleInternal); 130var emptyStructure = module4.GlobalNamespace.GetTypeMembers("EmptyStructure").Single(); 134var basicC1_M5 = (MethodSymbol)basicC1.GetMembers("M5").Single(); 135var basicC1_M6 = (MethodSymbol)basicC1.GetMembers("M6").Single(); 136var basicC1_M7 = (MethodSymbol)basicC1.GetMembers("M7").Single(); 137var basicC1_M8 = (MethodSymbol)basicC1.GetMembers("M8").Single(); 154var basicC1_M10 = (MethodSymbol)basicC1.GetMembers("M10").Single(); 157var basicC1_M11 = (MethodSymbol)basicC1.GetMembers("M11").Single(); 160Assert.Same(basicC1, basicC1_M11.TypeParameters[1].ConstraintTypes().Single()); 162var basicC1_M12 = (MethodSymbol)basicC1.GetMembers("M12").Single(); 168var loadLibrary = (MethodSymbol)basicC1.GetMembers("LoadLibrary").Single(); 171var basicC2 = module4.GlobalNamespace.GetTypeMembers("C2").Single(); 173var basicC2_M1 = (MethodSymbol)basicC2.GetMembers("M1").Single(); 177GetTypeMembers("Console").Single(); 182var basicModifiers1 = module4.GlobalNamespace.GetTypeMembers("Modifiers1").Single(); 184var basicModifiers1_M1 = (MethodSymbol)basicModifiers1.GetMembers("M1").Single(); 185var basicModifiers1_M2 = (MethodSymbol)basicModifiers1.GetMembers("M2").Single(); 186var basicModifiers1_M3 = (MethodSymbol)basicModifiers1.GetMembers("M3").Single(); 187var basicModifiers1_M4 = (MethodSymbol)basicModifiers1.GetMembers("M4").Single(); 188var basicModifiers1_M5 = (MethodSymbol)basicModifiers1.GetMembers("M5").Single(); 189var basicModifiers1_M6 = (MethodSymbol)basicModifiers1.GetMembers("M6").Single(); 190var basicModifiers1_M7 = (MethodSymbol)basicModifiers1.GetMembers("M7").Single(); 191var basicModifiers1_M8 = (MethodSymbol)basicModifiers1.GetMembers("M8").Single(); 192var basicModifiers1_M9 = (MethodSymbol)basicModifiers1.GetMembers("M9").Single(); 248var basicModifiers2 = module4.GlobalNamespace.GetTypeMembers("Modifiers2").Single(); 250var basicModifiers2_M1 = (MethodSymbol)basicModifiers2.GetMembers("M1").Single(); 251var basicModifiers2_M2 = (MethodSymbol)basicModifiers2.GetMembers("M2").Single(); 252var basicModifiers2_M6 = (MethodSymbol)basicModifiers2.GetMembers("M6").Single(); 253var basicModifiers2_M7 = (MethodSymbol)basicModifiers2.GetMembers("M7").Single(); 279var basicModifiers3 = module4.GlobalNamespace.GetTypeMembers("Modifiers3").Single(); 281var basicModifiers3_M1 = (MethodSymbol)basicModifiers3.GetMembers("M1").Single(); 282var basicModifiers3_M6 = (MethodSymbol)basicModifiers3.GetMembers("M6").Single(); 296var csharpModifiers1 = module3.GlobalNamespace.GetTypeMembers("Modifiers1").Single(); 298var csharpModifiers1_M1 = (MethodSymbol)csharpModifiers1.GetMembers("M1").Single(); 299var csharpModifiers1_M2 = (MethodSymbol)csharpModifiers1.GetMembers("M2").Single(); 300var csharpModifiers1_M3 = (MethodSymbol)csharpModifiers1.GetMembers("M3").Single(); 301var csharpModifiers1_M4 = (MethodSymbol)csharpModifiers1.GetMembers("M4").Single(); 327var csharpModifiers2 = module3.GlobalNamespace.GetTypeMembers("Modifiers2").Single(); 329var csharpModifiers2_M1 = (MethodSymbol)csharpModifiers2.GetMembers("M1").Single(); 330var csharpModifiers2_M2 = (MethodSymbol)csharpModifiers2.GetMembers("M2").Single(); 331var csharpModifiers2_M3 = (MethodSymbol)csharpModifiers2.GetMembers("M3").Single(); 351var csharpModifiers3 = module3.GlobalNamespace.GetTypeMembers("Modifiers3").Single(); 353var csharpModifiers3_M1 = (MethodSymbol)csharpModifiers3.GetMembers("M1").Single(); 354var csharpModifiers3_M3 = (MethodSymbol)csharpModifiers3.GetMembers("M3").Single(); 355var csharpModifiers3_M4 = (MethodSymbol)csharpModifiers3.GetMembers("M4").Single(); 375var byrefReturnMethod = byrefReturn.GlobalNamespace.GetTypeMembers("ByRefReturn").Single().GetMembers("M").OfType<MethodSymbol>().Single(); 388var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Interface").Single(); 391var interfaceMethod = (MethodSymbol)@interface.GetMembers("Method").Single(); 393var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Class").Single(); 397var classMethod = (MethodSymbol)@class.GetMembers("Interface.Method").Single(); 400var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); 412var interface1 = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I1").Single(); 415var interface1Method = (MethodSymbol)interface1.GetMembers("Method1").Single(); 417var interface2 = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I2").Single(); 420var interface2Method = (MethodSymbol)interface2.GetMembers("Method2").Single(); 422var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("C").Single(); 427var classMethod = (MethodSymbol)@class.GetMembers("Method").Single(); // the method is considered to be Ordinary 448var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGeneric").Single(); 454var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Generic").Single(); 457var substitutedInterface = @class.Interfaces().Single(); 468var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); 484var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGeneric").Single(); 490var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Constructed").Single(); 493var substitutedInterface = @class.Interfaces().Single(); 504var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); 516var cyclicInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ImplementsSelf").Single(); 519var implementedInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I1").Single(); 522var interface2Method = (MethodSymbol)implementedInterface.GetMembers("Method1").Single(); 524var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("InterfaceCycleSuccess").Single(); 529var classMethod = (MethodSymbol)@class.GetMembers("Method").Single(); // the method is considered to be Ordinary 532var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); 544var cyclicInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ImplementsSelf").Single(); 547var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("InterfaceCycleFailure").Single(); 551var classMethod = (MethodSymbol)@class.GetMembers("Method").Single(); 575var defInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Interface").Single(); 578var defInterfaceMethod = (MethodSymbol)defInterface.GetMembers("Method").Single(); 580var refInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGenericInterface").Single(); 584var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IndirectImplementation").Single(); 592var classMethod = (MethodSymbol)@class.GetMembers("Interface.Method").Single(); 595var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); 611var baseClass = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ExplicitlyImplementedClass").Single(); 614var derivedClass = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ExplicitlyImplementsAClass").Single(); 618var derivedClassMethod = (MethodSymbol)derivedClass.GetMembers("Method").Single(); 639var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ExplicitlyImplementsUnrelatedInterfaceMethods").Single(); 643var classMethod = (MethodSymbol)@class.GetMembers("Method1").Single(); 647var classGenericMethod = (MethodSymbol)@class.GetMembers("Method1").Single(); 672var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("ExplicitlyImplementsUnrelatedInterfaceMethods").Single(); 676var classMethod = (MethodSymbol)@class.GetMembers("Method2").Single(); 680var classGenericMethod = (MethodSymbol)@class.GetMembers("Method2").Single(); 702var outerInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGeneric2").Single(); 706var outerInterfaceMethod = outerInterface.GetMembers().Single(); 708var outerClass = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Outer").Single(); 712var innerInterface = (NamedTypeSymbol)outerClass.GetTypeMembers("IInner").Single(); 716var innerInterfaceMethod = innerInterface.GetMembers().Single(); 718var innerClass1 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner1").Single(); 721var innerClass2 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner2").Single(); 724var innerClass3 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner3").Single(); 727var innerClass4 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner4").Single(); 737Assert.Equal(@interface, innerClass.Interfaces().Single().ConstructedFrom); 739var innerClassMethod = (MethodSymbol)innerClass.GetMembers(methodName).Single(); 740var innerClassImplementingMethod = innerClassMethod.ExplicitInterfaceImplementations.Single();
Symbols\Metadata\PE\LoadingNamespacesAndTypes.cs (8)
140var systemNS = (NamespaceSymbol)globalNS.GetMembers("System").Single(); 153var collectionsNS = (NamespaceSymbol)systemNS.GetMembers("Collections").Single(); 214var nestingClass = module0.GlobalNamespace.GetTypeMembers("NestingClass").Single(); 242var actionOf0 = system.GetTypeMembers("Action", 0).Single(); 243var actionOf4 = system.GetTypeMembers("Action", 4).Single(); 289Assert.Equal(valueCollection[0], dictionary.GetTypeMembers("ValueCollection", 0).Single()); 313var constructor = structType.InstanceConstructors.Single(); 332var constructor = structType.InstanceConstructors.Single();
Symbols\Metadata\PE\LoadingProperties.cs (44)
29var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Interface").Single(); 32var interfaceProperty = (PropertySymbol)@interface.GetMembers("Property").Single(); 34var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Class").Single(); 38var classProperty = (PropertySymbol)@class.GetMembers("Interface.Property").Single(); 40var explicitImpl = classProperty.ExplicitInterfaceImplementations.Single(); 56var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGeneric").Single(); 59var interfaceProperty = (PropertySymbol)@interface.GetMembers("Property").Single(); 61var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Generic").Single(); 64var substitutedInterface = @class.Interfaces().Single(); 67var substitutedInterfaceProperty = (PropertySymbol)substitutedInterface.GetMembers("Property").Single(); 70var classProperty = (PropertySymbol)@class.GetMembers("IGeneric<S>.Property").Single(); 72var explicitImpl = classProperty.ExplicitInterfaceImplementations.Single(); 88var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGeneric").Single(); 91var interfaceProperty = (PropertySymbol)@interface.GetMembers("Property").Single(); 93var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Constructed").Single(); 96var substitutedInterface = @class.Interfaces().Single(); 99var substitutedInterfaceProperty = (PropertySymbol)substitutedInterface.GetMembers("Property").Single(); 102var classProperty = (PropertySymbol)@class.GetMembers("IGeneric<System.Int32>.Property").Single(); 104var explicitImpl = classProperty.ExplicitInterfaceImplementations.Single(); 124var defInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Interface").Single(); 127var defInterfaceProperty = (PropertySymbol)defInterface.GetMembers("Property").Single(); 129var refInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGenericInterface").Single(); 133var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IndirectImplementation").Single(); 141var classProperty = (PropertySymbol)@class.GetMembers("Interface.Property").Single(); 143var explicitImpl = classProperty.ExplicitInterfaceImplementations.Single(); 164var outerInterface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IGeneric2").Single(); 170var outerClass = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Outer").Single(); 174var innerInterface = (NamedTypeSymbol)outerClass.GetTypeMembers("IInner").Single(); 180var innerClass1 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner1").Single(); 183var innerClass2 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner2").Single(); 186var innerClass3 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner3").Single(); 189var innerClass4 = (NamedTypeSymbol)outerClass.GetTypeMembers("Inner4").Single(); 199Assert.Equal(@interface, innerClass.Interfaces().Single().ConstructedFrom); 201var innerClassProperty = (PropertySymbol)innerClass.GetMembers(methodName).Single(); 202var innerClassImplementingProperty = innerClassProperty.ExplicitInterfaceImplementations.Single(); 227var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Interface").Single(); 230var interfaceProperty1 = (PropertySymbol)@interface.GetMembers("Property1").Single(); 231var interfaceProperty2 = (PropertySymbol)@interface.GetMembers("Property2").Single(); 232var interfaceProperty3 = (PropertySymbol)@interface.GetMembers("Property3").Single(); 233var interfaceProperty4 = (PropertySymbol)@interface.GetMembers("Property4").Single(); 234var interfaceProperty5 = (PropertySymbol)@interface.GetMembers("Property5").Single(); 251var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Class").Single(); 254var classProperty1 = (PropertySymbol)@class.GetMembers("Property1").Single(); 255var classProperty2 = (PropertySymbol)@class.GetMembers("Property2").Single();
Symbols\Metadata\PE\MissingTypeReferences.cs (14)
43var localTC10 = module0.GlobalNamespace.GetTypeMembers("TC10").Single(); 59var localTC8 = module0.GlobalNamespace.GetTypeMembers("TC8").Single(); 76var localTC7 = module0.GlobalNamespace.GetTypeMembers("TC7").Single(); 128NamedTypeSymbol localTC = module1.GlobalNamespace.GetTypeMembers("TC1").Single(); 143localTC = module1.GlobalNamespace.GetTypeMembers("TC2").Single(); 158localTC = module1.GlobalNamespace.GetTypeMembers("TC3").Single(); 171localTC = module1.GlobalNamespace.GetTypeMembers("TC4").Single(); 189localTC = module1.GlobalNamespace.GetTypeMembers("TC5").Single(); 204var localC6 = module2.GlobalNamespace.GetTypeMembers("C6").Single(); 206localTC = module1.GlobalNamespace.GetTypeMembers("TC6").Single(); 225localTC = module1.GlobalNamespace.GetTypeMembers("TC7").Single(); 247localTC = module1.GlobalNamespace.GetTypeMembers("TC8").Single(); 286var asm1classC = asm1.GlobalNamespace.GetTypeMembers("C").Single(); 309var asm2classC = asm2.GlobalNamespace.GetTypeMembers("C").Single();
Symbols\Metadata\PE\NoPia.cs (64)
60var varI1 = pia1_1.GlobalNamespace.GetTypeMembers("I1").Single(); 61var varS1 = pia1_1.GlobalNamespace.GetTypeMembers("S1").Single(); 63var varI2 = varNS1.GetTypeMembers("I2").Single(); 64var varS2 = varNS1.GetTypeMembers("S2").Single(); 69classLocalTypes1 = localTypes1_1.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 70classLocalTypes2 = localTypes2_1.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 105classLocalTypes1 = localTypes1_2.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 106classLocalTypes2 = localTypes2_2.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 138classLocalTypes1 = localTypes1_3.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 139classLocalTypes2 = localTypes2_3.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 146Assert.Same(pia1_3.GlobalNamespace.GetTypeMembers("I1").Single(), param[0].Type); 147Assert.Same(pia1_3.GlobalNamespace.GetMembers("NS1").OfType<NamespaceSymbol>().Single().GetTypeMembers("I2").Single(), param[1].Type); 192classLocalTypes1 = localTypes1_5.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 193classLocalTypes2 = localTypes2_5.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 229classLocalTypes1 = localTypes1_6.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 230classLocalTypes2 = localTypes2_6.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 260classLocalTypes1 = localTypes1_7.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 261classLocalTypes2 = localTypes2_7.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 294classLocalTypes1 = localTypes1_8.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 295classLocalTypes2 = localTypes2_8.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 307Assert.Same(pia4_8.GlobalNamespace.GetTypeMembers("I1").Single(), ambiguous.FirstCandidate); 308Assert.Same(pia1_8.GlobalNamespace.GetTypeMembers("I1").Single(), ambiguous.SecondCandidate); 401var varI1 = pia1_1.GlobalNamespace.GetTypeMembers("I1").Single(); 402var varS1 = pia1_1.GlobalNamespace.GetTypeMembers("S1").Single(); 404var varI2 = varNS1.GetTypeMembers("I2").Single(); 405var varS2 = varNS1.GetTypeMembers("S2").Single(); 410classLocalTypes1 = localTypes1_1.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 411classLocalTypes2 = localTypes2_1.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 446classLocalTypes1 = localTypes1_2.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 447classLocalTypes2 = localTypes2_2.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 478classLocalTypes1 = localTypes1_3.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 479classLocalTypes2 = localTypes2_3.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 518classLocalTypes1 = localTypes1_5.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 519classLocalTypes2 = localTypes2_5.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 563classLocalTypes1 = localTypes1_6.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 564classLocalTypes2 = localTypes2_6.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 594classLocalTypes1 = localTypes1_7.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 595classLocalTypes2 = localTypes2_7.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 606Assert.Same(pia4_7.GlobalNamespace.GetTypeMembers("I1").Single(), param[0].Type); 630classLocalTypes1 = localTypes1_8.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 631classLocalTypes2 = localTypes2_8.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 643Assert.Same(pia4_8.GlobalNamespace.GetTypeMembers("I1").Single(), ambiguous.FirstCandidate); 644Assert.Same(pia1_8.GlobalNamespace.GetTypeMembers("I1").Single(), ambiguous.SecondCandidate); 715var localTypes3 = asmLocalTypes3.GlobalNamespace.GetTypeMembers("LocalTypes3").Single(); 734localTypes3 = assemblies[0].GlobalNamespace.GetTypeMembers("LocalTypes3").Single(); 768var varI5_1 = pia5Asm1.GlobalNamespace.GetTypeMembers("I5").Single(); 779var varI5_2 = pia5Asm2.GlobalNamespace.GetTypeMembers("I5").Single(); 792var varI7_3 = library2Asm3.GlobalNamespace.GetTypeMembers("I7").Single(); 808var varI7_4 = library2Asm4.GlobalNamespace.GetTypeMembers("I7").Single(); 826var varI7_5 = library2Asm5.GlobalNamespace.GetTypeMembers("I7").Single(); 856var varI7_7 = library2Asm7.GlobalNamespace.GetTypeMembers("I7").Single(); 1016var localTypes3 = asmLocalTypes3.GlobalNamespace.GetTypeMembers("LocalTypes3").Single(); 1035localTypes3 = assemblies[2].GlobalNamespace.GetTypeMembers("LocalTypes3").Single(); 1135var varI5_1 = pia5Asm1.GlobalNamespace.GetTypeMembers("I5").Single(); 1146var varI5_2 = pia5Asm2.GlobalNamespace.GetTypeMembers("I5").Single(); 1159var varI7_3 = library2Asm3.GlobalNamespace.GetTypeMembers("I7").Single(); 1175var varI7_4 = library2Asm4.GlobalNamespace.GetTypeMembers("I7").Single(); 1193var varI7_5 = library2Asm5.GlobalNamespace.GetTypeMembers("I7").Single(); 1223var varI7_7 = library2Asm7.GlobalNamespace.GetTypeMembers("I7").Single(); 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(); 1419Assert.Same(i1F1, baseI1F1.ExplicitInterfaceImplementations.Single());
Symbols\Metadata\PE\NoPiaInstantiationOfGenericClassAndStruct.cs (28)
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(); 97var outer = ((NamedTypeSymbol)importedField.Type).TypeArguments().Single(); 100var inner = ((NamedTypeSymbol)outer).TypeArguments().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(); 486var nestedType = localConsumerRefsAsm.Where(a => a.Name == "NoPIAGenerics1-Asm1").Single().GlobalNamespace.GetTypeMembers("NestedConstructs").Single(); 502var nestedType = localConsumerRefsAsm[1].GlobalNamespace.GetTypeMembers("NestedConstructs").Single(); 518var nestedType = localConsumerRefsAsm[1].GlobalNamespace.GetTypeMembers("TypeRefs1").Single(); 566var nestedType = localConsumerRefsAsm.First(arg => arg.Name == "Dummy").GlobalNamespace.GetTypeMembers("TypeRefs1").Single();
Symbols\Metadata\PE\NoPiaLocalHideAndTypeSubstitutionTests.cs (30)
38var canonicalType1 = localConsumerRefsAsm.First(arg => arg.Name == "Pia1").GlobalNamespace.GetTypeMembers("I1").Single(); 39var canonicalType2 = localConsumerRefsAsm.First(arg => arg.Name == "Pia1").GlobalNamespace.GetMembers("NS1").OfType<NamespaceSymbol>().Single().GetTypeMembers("I2").Single(); 41NamedTypeSymbol classLocalType = localConsumerRefsAsm.First(arg => arg.Name == "LocalTypes1").GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 98NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("LocalType1").Single(); 133var canonicalType = localConsumerRefsAsm.First(arg => arg.Name == "GeneralPia").GlobalNamespace.GetTypeMembers("FooStruct").Single(); 135NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("TypeSubstitution").Single(); 138NamedTypeSymbol classRefLocalType = localConsumerRefsAsm.First(arg => arg.Name == "ExternalAsm1").GlobalNamespace.GetTypeMembers("ExternalAsm1").Single(); 193var canonicalTypeInter = canonicalType.GetTypeMembers("IBase").Single(); 195NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("TypeSubstitution").Single(); 198NamedTypeSymbol classRefLocalType = localConsumerRefsAsm.First(arg => arg.Name == "ExternalAsm1").GlobalNamespace.GetTypeMembers("ExternalAsm1").Single(); 229var canonicalType = localConsumerRefsAsm.First(arg => arg.Name == "GeneralPia").GlobalNamespace.GetTypeMembers("FooEnum").Single(); 231NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("TypeSubstitution").Single(); 234NamedTypeSymbol classRefLocalType = localConsumerRefsAsm.First(arg => arg.Name == "ExternalAsm1").GlobalNamespace.GetTypeMembers("ExternalAsm1").Single(); 264var canonicalType = localConsumerRefsAsm.First(arg => arg.Name == "GeneralPia").GlobalNamespace.GetTypeMembers("ISubFuncProp").Single(); 266NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("TypeSubstitution").Single(); 269NamedTypeSymbol classRefLocalType = localConsumerRefsAsm.First(arg => arg.Name == "ExternalAsm1").GlobalNamespace.GetTypeMembers("ExternalAsm1").Single(); 297var canonicalTypeInter = canonicalType.GetTypeMembers("EventHandler").Single(); 299NamedTypeSymbol classLocalType = localConsumer.GlobalNamespace.GetTypeMembers("TypeSubstitution").Single(); 302NamedTypeSymbol classRefLocalType = localConsumerRefsAsm.First(arg => arg.Name == "ExternalAsm1").GlobalNamespace.GetTypeMembers("ExternalAsm1").Single(); 323var canonicalType = localConsumerRefsAsm.First(arg => arg.Name == "GeneralPia").GlobalNamespace.GetTypeMembers("ISubFuncProp").Single(); 325NamedTypeSymbol classRefLocalType = localConsumerRefsAsm.First(arg => arg.Name == "ExternalAsm1").GlobalNamespace.GetTypeMembers("SubFuncProp").Single(); 345var canonicalType = localConsumerRefsAsm.First(arg => arg.Name == "GeneralPia").GlobalNamespace.GetTypeMembers("ISubFuncProp").Single(); 347NamedTypeSymbol classRefLocalType = localConsumerRefsAsm.First(arg => arg.Name == "ExternalAsm1").GlobalNamespace.GetTypeMembers("SubFuncProp").Single(); 350MethodSymbol explicitImpl = methodSymbol.ExplicitInterfaceImplementations.Single(); 369NamedTypeSymbol classRefLocalType = localConsumerRefsAsm.First(arg => arg.Name == "ExternalAsm1").GlobalNamespace.GetTypeMembers("ExternalAsm1").Single(); 377Assert.Same(localConsumerRefsAsm.First(arg => arg.Name == "GeneralPia").GlobalNamespace.ChildNamespace("InheritanceConflict").GetTypeMembers("IBase").Single(), ambiguous.FirstCandidate); 378Assert.Same(localConsumerRefsAsm.First(arg => arg.Name == "GeneralPiaCopy").GlobalNamespace.ChildNamespace("InheritanceConflict").GetTypeMembers("IBase").Single(), ambiguous.SecondCandidate); 438var importedType = localConsumerRefsAsm.First(arg => arg.Name == "Dummy2").GlobalNamespace.GetTypeMembers("IdentifyingAttributes").Single(); 477var importedTypeComp2 = localConsumerRefsAsm.First(arg => arg.Name == "Dummy1").GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 479var importedTypeAsm = localConsumerRefsAsm.First(arg => arg.Name == "Pia1").GlobalNamespace.GetTypeMembers("I1").Single();
Symbols\Metadata\PE\TypeAccessibility.cs (4)
110Assert.Same(module0, module0.GlobalNamespace.Locations.Single().MetadataModuleInternal); 111Assert.Same(module0, system.Locations.Single().MetadataModuleInternal); 112Assert.Same(module0, runtime.Locations.Single().MetadataModuleInternal); 113Assert.Same(module0, obj.Locations.Single().MetadataModuleInternal);
Symbols\Metadata\PE\TypeForwarders.cs (6)
49var derived1 = module1.GlobalNamespace.GetTypeMembers("Derived").Single(); 53var derived4 = module1.GlobalNamespace.GetTypeMembers("GenericDerived").Single(); 57var derived6 = module1.GlobalNamespace.GetTypeMembers("GenericDerived1").Single(); 77var derived2 = module2.GlobalNamespace.GetTypeMembers("Derived").Single(); 82var derived3 = module2.GlobalNamespace.GetTypeMembers("GenericDerived").Single(); 86var derived5 = module2.GlobalNamespace.GetTypeMembers("GenericDerived1").Single();
Symbols\Metadata\PE\TypeKindTests.cs (1)
89var console = system.GetTypeMembers("Console").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 (132)
191Assert.Same(ref1M, ref2M.OverriddenOrHiddenMembers.OverriddenMembers.Single()); 198Assert.Same(out1M, out2M.OverriddenOrHiddenMembers.OverriddenMembers.Single()); 205Assert.Same(out2M, out3M.OverriddenOrHiddenMembers.OverriddenMembers.Single()); 245var baseInterface1 = (NamedTypeSymbol)global.GetMembers("BaseInterface1").Single(); 246var baseInterface2 = (NamedTypeSymbol)global.GetMembers("BaseInterface2").Single(); 247var derivedInterface1 = (NamedTypeSymbol)global.GetMembers("DerivedInterface1").Single(); 248var derivedInterface2 = (NamedTypeSymbol)global.GetMembers("DerivedInterface2").Single(); 250var baseInterface1Method = (MethodSymbol)baseInterface1.GetMembers("Method").Single(); 251var baseInterface1Property = (PropertySymbol)baseInterface1.GetMembers("Property").Single(); 253var baseInterface2Method = (MethodSymbol)baseInterface2.GetMembers("Method").Single(); 254var baseInterface2Property = (PropertySymbol)baseInterface2.GetMembers("Property").Single(); 258var derivedInterface1Property = (PropertySymbol)derivedInterface1.GetMembers("Property").Single(); 262var derivedInterface2Property = (PropertySymbol)derivedInterface2.GetMembers("Property").Single(); 336var baseInterface1 = (NamedTypeSymbol)global.GetMembers("BaseInterface1").Single(); 337var baseInterface2 = (NamedTypeSymbol)global.GetMembers("BaseInterface2").Single(); 338var derivedInterface1 = (NamedTypeSymbol)global.GetMembers("DerivedInterface1").Single(); 339var derivedInterface2 = (NamedTypeSymbol)global.GetMembers("DerivedInterface2").Single(); 343var baseInterface1Property = (PropertySymbol)baseInterface1.GetMembers("Property").Single(); 347var baseInterface2Property = (PropertySymbol)baseInterface2.GetMembers("Property").Single(); 351var derivedInterface1Property = (PropertySymbol)derivedInterface1.GetMembers("Property").Single(); 355var derivedInterface2Property = (PropertySymbol)derivedInterface2.GetMembers("Property").Single(); 417var baseClass = (NamedTypeSymbol)global.GetMembers("BaseClass").Single(); 418var derivedClass = (NamedTypeSymbol)global.GetMembers("DerivedClass").Single(); 420var baseClassMethod = (MethodSymbol)baseClass.GetMembers("Method").Single(); 421var baseClassProperty = (PropertySymbol)baseClass.GetMembers("Property").Single(); 425var derivedClassProperty = (PropertySymbol)derivedClass.GetMembers("Property").Single(); 434Assert.Same(baseClassMethod, derivedClassMethodOverriddenOrHidden.HiddenMembers.Single()); 438Assert.Same(baseClassProperty, derivedClassPropertyOverriddenOrHidden.HiddenMembers.Single()); 468var baseClass = (NamedTypeSymbol)global.GetMembers("BaseClass").Single(); 469var derivedClass = (NamedTypeSymbol)global.GetMembers("DerivedClass").Single(); 473var baseClassProperty = (PropertySymbol)baseClass.GetMembers("Property").Single(); 477var derivedClassProperty = (PropertySymbol)derivedClass.GetMembers("Property").Single(); 528var baseClass = (NamedTypeSymbol)global.GetMembers("BaseClass").Single(); 529var derivedClass = (NamedTypeSymbol)global.GetMembers("DerivedClass").Single(); 531var baseClassMethod = (MethodSymbol)baseClass.GetMembers("Method").Single(); 532var baseClassProperty = (PropertySymbol)baseClass.GetMembers("Property").Single(); 533var baseClassRefMethod = (MethodSymbol)baseClass.GetMembers("Method1").Single(); 534var baseClassRefProperty = (PropertySymbol)baseClass.GetMembers("Property1").Single(); 535var baseClassRefIndexer = (PropertySymbol)baseClass.GetMembers("this[]").Single(); 539var derivedClassProperty = (PropertySymbol)derivedClass.GetMembers("Property").Single(); 540var derivedClassRefMethod = (MethodSymbol)derivedClass.GetMembers("Method1").Single(); 541var derivedClassRefProperty = (PropertySymbol)derivedClass.GetMembers("Property1").Single(); 542var derivedClassRefIndexer = (PropertySymbol)derivedClass.GetMembers("this[]").Single(); 551Assert.Same(baseClassMethod, derivedClassMethodOverriddenOrHidden.OverriddenMembers.Single()); 555Assert.Same(baseClassProperty, derivedClassPropertyOverriddenOrHidden.OverriddenMembers.Single()); 559Assert.Same(baseClassRefMethod, derivedClassRefMethodOverriddenOrHidden.OverriddenMembers.Single()); 563Assert.Same(baseClassRefProperty, derivedClassRefPropertyOverriddenOrHidden.OverriddenMembers.Single()); 567Assert.Same(baseClassRefIndexer, derivedClassRefIndexerOverriddenOrHidden.OverriddenMembers.Single()); 605var systemObject = (NamedTypeSymbol)system.GetMembers("Object").Single(); 606var baseClass = (NamedTypeSymbol)global.GetMembers("BaseClass").Single(); 607var derivedClass = (NamedTypeSymbol)global.GetMembers("DerivedClass").Single(); 609var objectToString = (MethodSymbol)systemObject.GetMembers("ToString").Single(); 610var objectGetHashCode = (MethodSymbol)systemObject.GetMembers("GetHashCode").Single(); 613var baseClassToString = (MethodSymbol)baseClass.GetMembers("ToString").Single(); 614var baseClassGetHashCode = (MethodSymbol)baseClass.GetMembers("GetHashCode").Single(); 618var derivedClassGetHashCode = (MethodSymbol)derivedClass.GetMembers("GetHashCode").Single(); 619var derivedClassEquals = (MethodSymbol)derivedClass.GetMembers("Equals").Single(); 666var baseClass = (NamedTypeSymbol)global.GetMembers("BaseClass").Single(); 667var derivedClass = (NamedTypeSymbol)global.GetMembers("DerivedClass").Single(); 672var baseClassProperty = (PropertySymbol)baseClass.GetMembers("Property").Single(); 676var derivedClassProperty = (PropertySymbol)derivedClass.GetMembers("Property").Single(); 746var definingClass = (NamedTypeSymbol)global.GetMembers("DefiningClass").Single(); 747var hidingClass = (NamedTypeSymbol)global.GetMembers("HidingClass").Single(); 748var overridingClass = (NamedTypeSymbol)global.GetMembers("OverridingClass").Single(); 750var definingClassMethod1 = (MethodSymbol)definingClass.GetMembers("Method1").Single(); 751var definingClassMethod2 = (MethodSymbol)definingClass.GetMembers("Method2").Single(); 752var definingClassProperty1 = (PropertySymbol)definingClass.GetMembers("Property1").Single(); 753var definingClassProperty2 = (PropertySymbol)definingClass.GetMembers("Property2").Single(); 755var hidingClassMethod1 = (FieldSymbol)hidingClass.GetMembers("Method1").Single(); 756var hidingClassMethod2 = (MethodSymbol)hidingClass.GetMembers("Method2").Single(); 757var hidingClassProperty1 = (FieldSymbol)hidingClass.GetMembers("Property1").Single(); 758var hidingClassProperty2 = (PropertySymbol)hidingClass.GetMembers("Property2").Single(); 760var overridingClassMethod1 = (MethodSymbol)overridingClass.GetMembers("Method1").Single(); 761var overridingClassMethod2 = (MethodSymbol)overridingClass.GetMembers("Method2").Single(); 762var overridingClassProperty1 = (PropertySymbol)overridingClass.GetMembers("Property1").Single(); 763var overridingClassProperty2 = (PropertySymbol)overridingClass.GetMembers("Property2").Single(); 767Assert.Same(hidingClassMethod1, overridingClassMethod1OverriddenOrHidden.HiddenMembers.Single()); 773Assert.Same(hidingClassMethod2, overridingClassMethod2OverriddenOrHidden.OverriddenMembers.Single()); 783Assert.Same(hidingClassProperty2, overridingClassProperty2OverriddenOrHidden.OverriddenMembers.Single()); 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(); 908var classAMethod1 = (MethodSymbol)classA.GetMembers("Method1").Single(); 909var classAMethod2 = (MethodSymbol)classA.GetMembers("Method2").Single(); 910var classBMethod1 = (MethodSymbol)classB.GetMembers("Method1").Single(); 911var classBMethod2 = (MethodSymbol)classB.GetMembers("Method2").Single(); 912var classCMethod1 = (MethodSymbol)classC.GetMembers("Method1").Single(); 913var classCMethod2 = (MethodSymbol)classC.GetMembers("Method2").Single(); 914var classDMethod1 = (MethodSymbol)classD.GetMembers("Method1").Single(); 915var classDMethod2 = (MethodSymbol)classD.GetMembers("Method2").Single(); 936var classE = (NamedTypeSymbol)global.GetTypeMembers("CustomModifierOverridingE").Single(); 938var classEMethod1 = (MethodSymbol)classE.GetMembers("Method1").Single(); 939var classEMethod2 = (MethodSymbol)classE.GetMembers("Method2").Single(); 947Assert.Same(classDMethod1, classEMethod1OverriddenOrHiddenMembers.OverriddenMembers.Single()); 955Assert.Same(classDMethod2, classEMethod2OverriddenOrHiddenMembers.OverriddenMembers.Single()); 1010Assert.Equal(baseMethod1, overriddenOrHidden.OverriddenMembers.Single()); 1080Assert.Equal(firstBaseMethod1, overriddenOrHidden1.OverriddenMembers.Single()); 1084Assert.Equal(firstBaseMethod2, overriddenOrHidden2.OverriddenMembers.Single()); 2448Assert.Equal(propA, ohmB.OverriddenMembers.Single()); 2452Assert.Equal(propB, ohmC.HiddenMembers.Single()); 2454Assert.Equal(propC, ohmD.OverriddenMembers.Single()); 2507Assert.Equal(eventA, ohmB.OverriddenMembers.Single()); 2511Assert.Equal(eventB, ohmC.HiddenMembers.Single()); 2513Assert.Equal(eventC, ohmD.OverriddenMembers.Single()); 2572Assert.Equal(methodA, ohmB.OverriddenMembers.Single()); 2576Assert.Equal(methodB, ohmC.HiddenMembers.Single()); 2578Assert.Equal(methodC, ohmD.OverriddenMembers.Single()); 2631Assert.Equal(indexerA, ohmB.OverriddenMembers.Single()); 2635Assert.Equal(indexerB, ohmC.HiddenMembers.Single()); 2637Assert.Equal(indexerC, ohmD.OverriddenMembers.Single()); 2868var finalize = (MethodSymbol)obj.GetMembers("Finalize").Single(); 3593Assert.Equal(baseMethod, overriddenOrHidden1.OverriddenMembers.Single()); 3594Assert.Equal(baseProperty, overriddenOrHidden1.HiddenMembers.Single()); 3600Assert.Equal(baseProperty, overriddenOrHidden2.OverriddenMembers.Single()); 3601Assert.Equal(baseMethod, overriddenOrHidden2.HiddenMembers.Single()); 3985Assert.Equal(aMethod, bMethod.OverriddenOrHiddenMembers.HiddenMembers.Single()); 4015Assert.Equal(aMethod, bMethod.OverriddenOrHiddenMembers.HiddenMembers.Single()); 4045Assert.Equal(aMethod, bMethod.OverriddenOrHiddenMembers.HiddenMembers.Single()); 4075Assert.Equal(aMethod, bMethod.OverriddenOrHiddenMembers.HiddenMembers.Single()); 4105Assert.Equal(aProperty, bProperty.OverriddenOrHiddenMembers.HiddenMembers.Single()); 4135Assert.Equal(aProperty, bProperty.OverriddenOrHiddenMembers.HiddenMembers.Single()); 4165Assert.Equal(aProperty, bProperty.OverriddenOrHiddenMembers.HiddenMembers.Single()); 4191Assert.Equal(aMethod, bMethod.OverriddenOrHiddenMembers.HiddenMembers.Single()); 4218Assert.Equal(aMethod, bMethod.OverriddenOrHiddenMembers.HiddenMembers.Single()); 4245Assert.Equal(aProperty, bProperty.OverriddenOrHiddenMembers.HiddenMembers.Single()); 4270Assert.Equal(aMethod, bMethod.OverriddenOrHiddenMembers.OverriddenMembers.Single()); 4297Assert.Equal(aMethod, bMethod.OverriddenOrHiddenMembers.OverriddenMembers.Single()); 4324Assert.Equal(aProperty, bProperty.OverriddenOrHiddenMembers.OverriddenMembers.Single()); 4396Assert.Equal(baseMethod, derivedMethod.OverriddenOrHiddenMembers.OverriddenMembers.Single()); 4399Assert.Equal(baseProperty, derivedProperty.OverriddenOrHiddenMembers.OverriddenMembers.Single()); 4402Assert.Equal(baseIndexer, derivedIndexer.OverriddenOrHiddenMembers.OverriddenMembers.Single());
Symbols\PartialPropertiesTests.cs (29)
3866AssertEx.Equal(["A(2)", "B(2)", "A(1)", "B(1)"], accessor.Parameters.Single().GetAttributes().ToStrings()); 3867AssertEx.Equal(["A(2)", "B(2)", "A(1)", "B(1)"], accessor.PartialImplementationPart!.Parameters.Single().GetAttributes().ToStrings()); 3896var indexer = (SourcePropertySymbol)comp.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 3927var indexer = (SourcePropertySymbol)comp.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 3929verify(indexer.Parameters.Single()); 3930verify(indexer.GetMethod!.Parameters.Single()); 3933verify(indexer.PartialImplementationPart!.Parameters.Single()); 3934verify(indexer.PartialImplementationPart!.GetMethod!.Parameters.Single()); 3994AssertEx.Equal(["Attr", "Attr"], property.SetMethod!.Parameters.Single().GetAttributes().ToStrings()); 4052var property = (SourcePropertySymbol)comp.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 4332var indexer = (SourcePropertySymbol)comp.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 4371var indexer = (PropertySymbol)module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 4414var indexer = (PropertySymbol)module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 4450var indexer = (PropertySymbol)module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 4492var indexer = (PropertySymbol)module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 4528var indexer = (PropertySymbol)module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 4570var indexer = (PropertySymbol)module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 4621var indexer = (PropertySymbol)module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 4678var indexer = (PropertySymbol)module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 5039var indexer = module.GlobalNamespace.GetMember<NamedTypeSymbol>("C").Indexers.Single(); 5040Assert.Equal("p1", indexer.Parameters.Single().Name); 5243Assert.Equal("SourceFile(Program.cs[43..47))", defSymbol.Locations.Single().ToString()); 5244Assert.Equal("SourceFile(Program.cs[81..85))", implSymbol.Locations.Single().ToString()); 5280Assert.Equal("SourceFile(Program.cs[46..50))", defSymbol.Locations.Single().ToString()); 5281Assert.Equal("SourceFile(Program.cs[84..88))", implSymbol.Locations.Single().ToString()); 5327Assert.Equal("SourceFile(Program.cs[43..47))", defSymbol.Locations.Single().ToString()); 5328Assert.Equal("SourceFile(Program.cs[88..92))", implSymbol.Locations.Single().ToString()); 5361Assert.Equal("SourceFile(Program.cs[52..53))", defSymbol.Locations.Single().ToString()); 5362Assert.Equal("SourceFile(Program.cs[97..98))", implSymbol.Locations.Single().ToString());
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\RequiredMembersTests.cs (4)
3948var attr = c.GetAttributes().Single(); 6886var attrData = ctor.GetAttributes().Single(); 6932var attrData = ctor.GetAttributes().Single(); 7978MethodSymbol constructor = c!.Constructors.Single();
Symbols\Retargeting\NoPia.cs (72)
370var varI1 = pia1_1.GlobalNamespace.GetTypeMembers("I1").Single(); 371var varS1 = pia1_1.GlobalNamespace.GetTypeMembers("S1").Single(); 373var varI2 = varNS1.GetTypeMembers("I2").Single(); 374var varS2 = varNS1.GetTypeMembers("S2").Single(); 379classLocalTypes1 = localTypes1_1.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 380classLocalTypes2 = localTypes2_1.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 415classLocalTypes1 = localTypes1_2.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 416classLocalTypes2 = localTypes2_2.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 446classLocalTypes1 = localTypes1_3.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 447classLocalTypes2 = localTypes2_3.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 454Assert.Same(pia1_3.GlobalNamespace.GetTypeMembers("I1").Single(), param[0].Type); 455Assert.Same(pia1_3.GlobalNamespace.GetMembers("NS1").OfType<NamespaceSymbol>().Single().GetTypeMembers("I2").Single(), param[1].Type); 498classLocalTypes1 = localTypes1_5.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 499classLocalTypes2 = localTypes2_5.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 533classLocalTypes1 = localTypes1_6.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 534classLocalTypes2 = localTypes2_6.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 563classLocalTypes1 = localTypes1_7.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 564classLocalTypes2 = localTypes2_7.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 596classLocalTypes1 = localTypes1_8.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 597classLocalTypes2 = localTypes2_8.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 609Assert.Same(pia4_8.GlobalNamespace.GetTypeMembers("I1").Single(), ambiguous.FirstCandidate); 610Assert.Same(pia1_8.GlobalNamespace.GetTypeMembers("I1").Single(), ambiguous.SecondCandidate); 671var varI1 = pia1_1.GlobalNamespace.GetTypeMembers("I1").Single(); 672var varS1 = pia1_1.GlobalNamespace.GetTypeMembers("S1").Single(); 674var varI2 = varNS1.GetTypeMembers("I2").Single(); 675var varS2 = varNS1.GetTypeMembers("S2").Single(); 680classLocalTypes1 = localTypes1_1.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 681classLocalTypes2 = localTypes2_1.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 716classLocalTypes1 = localTypes1_2.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 717classLocalTypes2 = localTypes2_2.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 747classLocalTypes1 = localTypes1_3.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 748classLocalTypes2 = localTypes2_3.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 755Assert.Same(pia1_3.GlobalNamespace.GetTypeMembers("I1").Single(), param[0].Type); 756Assert.Same(pia1_3.GlobalNamespace.GetMembers("NS1").OfType<NamespaceSymbol>().Single().GetTypeMembers("I2").Single(), param[1].Type); 799classLocalTypes1 = localTypes1_5.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 800classLocalTypes2 = localTypes2_5.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 834classLocalTypes1 = localTypes1_6.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 835classLocalTypes2 = localTypes2_6.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 864classLocalTypes1 = localTypes1_7.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 865classLocalTypes2 = localTypes2_7.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 897classLocalTypes1 = localTypes1_8.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 898classLocalTypes2 = localTypes2_8.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 910Assert.Same(pia4_8.GlobalNamespace.GetTypeMembers("I1").Single(), ambiguous.FirstCandidate); 911Assert.Same(pia1_8.GlobalNamespace.GetTypeMembers("I1").Single(), ambiguous.SecondCandidate); 975var varI1 = pia1_1.GlobalNamespace.GetTypeMembers("I1").Single(); 976var varS1 = pia1_1.GlobalNamespace.GetTypeMembers("S1").Single(); 978var varI2 = varNS1.GetTypeMembers("I2").Single(); 979var varS2 = varNS1.GetTypeMembers("S2").Single(); 984classLocalTypes1 = localTypes1_1.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 985classLocalTypes2 = localTypes2_1.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 1020classLocalTypes1 = localTypes1_2.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 1021classLocalTypes2 = localTypes2_2.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 1051classLocalTypes1 = localTypes1_3.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 1052classLocalTypes2 = localTypes2_3.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 1059Assert.Same(pia1_3.GlobalNamespace.GetTypeMembers("I1").Single(), param[0].Type); 1060Assert.Same(pia1_3.GlobalNamespace.GetMembers("NS1").OfType<NamespaceSymbol>().Single().GetTypeMembers("I2").Single(), param[1].Type); 1103classLocalTypes1 = localTypes1_5.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 1104classLocalTypes2 = localTypes2_5.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 1138classLocalTypes1 = localTypes1_6.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 1139classLocalTypes2 = localTypes2_6.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 1168classLocalTypes1 = localTypes1_7.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 1169classLocalTypes2 = localTypes2_7.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 1201classLocalTypes1 = localTypes1_8.GlobalNamespace.GetTypeMembers("LocalTypes1").Single(); 1202classLocalTypes2 = localTypes2_8.GlobalNamespace.GetTypeMembers("LocalTypes2").Single(); 1214Assert.Same(pia4_8.GlobalNamespace.GetTypeMembers("I1").Single(), ambiguous.FirstCandidate); 1215Assert.Same(pia1_8.GlobalNamespace.GetTypeMembers("I1").Single(), ambiguous.SecondCandidate); 1347var localTypes3 = asmLocalTypes3.GlobalNamespace.GetTypeMembers("LocalTypes3").Single(); 1368localTypes3 = assemblies[0].GlobalNamespace.GetTypeMembers("LocalTypes3").Single(); 1900var localTypes3 = asmLocalTypes3.GlobalNamespace.GetTypeMembers("LocalTypes3").Single(); 1921localTypes3 = assemblies[0].GlobalNamespace.GetTypeMembers("LocalTypes3").Single(); 1950var localTypes3 = asmLocalTypes3.GlobalNamespace.GetTypeMembers("LocalTypes3").Single(); 1971localTypes3 = assemblies[0].GlobalNamespace.GetTypeMembers("LocalTypes3").Single();
Symbols\Retargeting\RetargetCustomAttributes.cs (10)
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(); 304var attr = c.GetAttributes().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 (79)
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(); 89Assert.Equal(interfaceV1, method.ExplicitInterfaceImplementations.Single().ContainingType); 93Assert.Equal(interfaceV1, ((PropertySymbol)member).ExplicitInterfaceImplementations.Single().ContainingType); 96Assert.Equal(interfaceV1, ((EventSymbol)member).ExplicitInterfaceImplementations.Single().ContainingType); 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(); 152Assert.Equal(interfaceV2, retargetedClassC.Interfaces().Single()); 154var retargetedClassCMethod1 = (MethodSymbol)retargetedClassC.GetMembers("Interface1.Method1").Single(); 159var retargetedClassCMethod1Impl = retargetedClassCMethod1.ExplicitInterfaceImplementations.Single(); 165var retargetedClassCMethod2 = (MethodSymbol)retargetedClassC.GetMembers("Interface1.Method2").Single(); 174var retargetedClassCMethod3 = (MethodSymbol)retargetedClassC.GetMembers("Interface1.Method3").Single(); 183var retargetedClassCMethod4 = (MethodSymbol)retargetedClassC.GetMembers("Interface1.Method4").Single(); 188var retargetedClassCMethod4Impl = retargetedClassCMethod4.ExplicitInterfaceImplementations.Single(); 194var retargetedClassCProperty1 = (PropertySymbol)retargetedClassC.GetMembers("Interface1.Property1").Single(); 198var retargetedClassCProperty1Impl = retargetedClassCProperty1.ExplicitInterfaceImplementations.Single(); 205var retargetedClassCProperty2 = (PropertySymbol)retargetedClassC.GetMembers("Interface1.Property2").Single(); 213var retargetedClassCProperty3 = (PropertySymbol)retargetedClassC.GetMembers("Interface1.Property3").Single(); 221var retargetedClassCProperty4 = (PropertySymbol)retargetedClassC.GetMembers("Interface1.Property4").Single(); 225var retargetedClassCProperty4Impl = retargetedClassCProperty4.ExplicitInterfaceImplementations.Single(); 236var retargetedClassCIndexer1Impl = retargetedClassCIndexer1.ExplicitInterfaceImplementations.Single(); 263var retargetedClassCIndexer4Impl = retargetedClassCIndexer4.ExplicitInterfaceImplementations.Single(); 270var retargetedClassCEvent1 = (EventSymbol)retargetedClassC.GetMembers("Interface1.Event1").Single(); 274var retargetedClassCEvent1Impl = retargetedClassCEvent1.ExplicitInterfaceImplementations.Single(); 281var retargetedClassCEvent2 = (EventSymbol)retargetedClassC.GetMembers("Interface1.Event2").Single(); 289var retargetedClassCEvent3 = (EventSymbol)retargetedClassC.GetMembers("Interface1.Event3").Single(); 297var retargetedClassCEvent4 = (EventSymbol)retargetedClassC.GetMembers("Interface1.Event4").Single(); 301var retargetedClassCEvent4Impl = retargetedClassCEvent4.ExplicitInterfaceImplementations.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(); 401var retargetedClassC1Method1 = (MethodSymbol)retargetedClassC1.GetMembers("Interface2<S>.Method1").Single(); 402var retargetedClassC1Method1Impl = retargetedClassC1Method1.ExplicitInterfaceImplementations.Single(); 405var retargetedClassC2Method1 = (MethodSymbol)retargetedClassC2.GetMembers("Interface2<System.Int32>.Method1").Single(); 406var retargetedClassC2Method1Impl = retargetedClassC2Method1.ExplicitInterfaceImplementations.Single(); 409var retargetedClassC3Method1 = (MethodSymbol)retargetedClassC3.GetMembers("Interface2<Class1>.Method1").Single(); 410var retargetedClassC3Method1Impl = retargetedClassC3Method1.ExplicitInterfaceImplementations.Single(); 413var retargetedClassC1Property1 = (PropertySymbol)retargetedClassC1.GetMembers("Interface2<S>.Property1").Single(); 414var retargetedClassC1Property1Impl = retargetedClassC1Property1.ExplicitInterfaceImplementations.Single(); 417var retargetedClassC2Property1 = (PropertySymbol)retargetedClassC2.GetMembers("Interface2<System.Int32>.Property1").Single(); 418var retargetedClassC2Property1Impl = retargetedClassC2Property1.ExplicitInterfaceImplementations.Single(); 421var retargetedClassC3Property1 = (PropertySymbol)retargetedClassC3.GetMembers("Interface2<Class1>.Property1").Single(); 422var retargetedClassC3Property1Impl = retargetedClassC3Property1.ExplicitInterfaceImplementations.Single(); 425var retargetedClassC1Event1 = (EventSymbol)retargetedClassC1.GetMembers("Interface2<S>.Event1").Single(); 426var retargetedClassC1Event1Impl = retargetedClassC1Event1.ExplicitInterfaceImplementations.Single(); 429var retargetedClassC2Event1 = (EventSymbol)retargetedClassC2.GetMembers("Interface2<System.Int32>.Event1").Single(); 430var retargetedClassC2Event1Impl = retargetedClassC2Event1.ExplicitInterfaceImplementations.Single(); 433var retargetedClassC3Event1 = (EventSymbol)retargetedClassC3.GetMembers("Interface2<Class1>.Event1").Single(); 434var retargetedClassC3Event1Impl = retargetedClassC3Event1.ExplicitInterfaceImplementations.Single(); 470Assert.Equal(c2.Interfaces().Single().GetMethod("M"), m.ExplicitInterfaceImplementations.Single());
Symbols\Retargeting\RetargetingTests.cs (19)
523Assert.Equal(TypeKind.Error, sourceType.Interfaces().Single().TypeKind); 524Assert.Equal(SpecialType.System_Int16, sourceType.Interfaces().Single().SpecialType); 530Assert.Equal(TypeKind.Error, retargetingType.Interfaces().Single().TypeKind); 531Assert.Equal(SpecialType.System_Int16, retargetingType.Interfaces().Single().SpecialType); 581Assert.Equal(TypeKind.Error, sourceType.Interfaces().Single().TypeKind); 582Assert.Equal(SpecialType.System_Int16, sourceType.Interfaces().Single().SpecialType); 587Assert.Equal(TypeKind.Error, retargetingType.Interfaces().Single().TypeKind); 588Assert.Equal(SpecialType.System_Int16, retargetingType.Interfaces().Single().SpecialType); 611var sourceTypeParameter = sourceType.TypeParameters.Single(); 616var retargetingTypeParameter = retargetingType.TypeParameters.Single(); 648var sourceTypeParameter = sourceType.TypeParameters.Single(); 649var sourceTypeParameterConstraint = sourceTypeParameter.ConstraintTypes().Single(); 655var retargetingTypeParameter = retargetingType.TypeParameters.Single(); 656var retargetingTypeParameterConstraint = retargetingTypeParameter.ConstraintTypes().Single(); 669SourceTypeTypeParameterSymbol sourceTypeParameter = (SourceTypeTypeParameterSymbol)sourceAssembly.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 675RetargetingTypeParameterSymbol retargetingTypeParameter = (RetargetingTypeParameterSymbol)retargetingAssembly.GlobalNamespace.GetTypeMember("Test").TypeParameters.Single(); 733NamedTypeSymbol c1 = comp1.Assembly.GlobalNamespace.GetTypeMembers("C1").Single(); 737NamedTypeSymbol c1r = comp2.GlobalNamespace.GetTypeMembers("C1").Single(); 911=> ((CSharpCustomModifier)modifiers.Single()).ModifierSymbol;
Symbols\Source\AccessTests.cs (4)
30var a = global.GetMembers("A").Single() as NamespaceSymbol; 47var a = global.GetMembers("A").Single() as NamespaceSymbol; 73var a = global.GetMembers("A").Single() as NamespaceSymbol; 96var a = global.GetMembers("A").Single() as NamespaceSymbol;
Symbols\Source\BaseClassTests.cs (90)
37var x = global.GetTypeMembers("X", 0).Single(); 38var y = global.GetTypeMembers("Y", 0).Single(); 57var x = global.GetTypeMembers("X", 0).Single(); 58var y = global.GetTypeMembers("Y", 0).Single(); 80var x = global.GetTypeMembers("C4", 0).Single(); 104var a = global.GetTypeMembers("A", 1).Single(); 105var b = a.GetTypeMembers("B", 0).Single(); 106var e = a.GetTypeMembers("E", 0).Single(); 133var a = global.GetTypeMembers("A", 1).Single(); 134var b = global.GetTypeMembers("B", 0).Single(); 135var d = b.GetTypeMembers("D", 0).Single(); 159var a = global.GetTypeMembers("A", 0).Single(); 160var ic = a.GetTypeMembers("IC", 0).Single(); 182var a = global.GetTypeMembers("A", 0).Single(); 183var b = a.GetTypeMembers("B", 0).Single(); 184var ic = b.GetTypeMembers("IC", 0).Single(); 235var z = global.GetTypeMembers("Z", 0).Single(); 236var w = global.GetTypeMembers("W", 0).Single(); 264var a = global.GetTypeMembers("A", 0).Single(); 301var a = global.GetTypeMembers("A", 0).Single(); 464var c = global.GetTypeMembers("C", 0).Single(); 468Assert.True(c.Interfaces().Single().TypeArguments().Single().IsErrorType()); //can't see base of C while evaluating C.B 482var e = global.GetTypeMembers("E", 0).Single(); 500var g = global.GetTypeMembers("G", 0).Single(); 520var j = global.GetTypeMembers("J", 0).Single(); 534var m = global.GetTypeMembers("M", 0).Single(); 549var o = global.GetTypeMembers("O", 0).Single(); 567var p = global.GetTypeMembers("P", 0).Single(); 587var r = global.GetTypeMembers("R", 0).Single(); 606var u = global.GetTypeMembers("U", 0).Single(); 626var c = global.GetTypeMembers("C", 0).Single(); 651var x = global.GetTypeMembers("X", 0).Single(); 670var b = global.GetTypeMembers("B", 0).Single(); 687var z = global.GetTypeMembers("Z", 1).Single(); 996var x = global.GetTypeMembers("I4", 0).Single(); 1017var B1 = global1.GetTypeMembers("ClassB", 0).Single(); 1018var A1 = global1.GetTypeMembers("ClassA", 0).Single(); 1035var B2 = global.GetTypeMembers("ClassB", 0).Single(); 1036var C = global.GetTypeMembers("ClassC", 0).Single(); 1049var A2 = global.GetTypeMembers("ClassA", 0).Single(); 1073var B1 = global1.GetTypeMembers("ClassB", 0).Distinct().Single(); 1074var A1 = global1.GetTypeMembers("ClassA", 0).Single(); 1095var B2 = global.GetTypeMembers("ClassB", 0).Single(); 1096var C = global.GetTypeMembers("ClassC", 0).Single(); 1110var A2 = global.GetTypeMembers("ClassA", 0).Single(); 1131var B1 = global1.GetTypeMembers("ClassB", 0).Single(); 1132var A1 = global1.GetTypeMembers("ClassA", 0).Single(); 1164var A2 = global.GetTypeMembers("ClassA", 0).Single(); 1165var B2 = global.GetTypeMembers("ClassB", 0).Single(); 1166var C = global.GetTypeMembers("ClassC", 0).Single(); 1189var B1 = global1.GetTypeMembers("ClassB", 0).Distinct().Single(); 1190var A1 = global1.GetTypeMembers("ClassA", 0).Single(); 1221var B2 = global.GetTypeMembers("ClassB", 0).Single(); 1222var C = global.GetTypeMembers("ClassC", 0).Single(); 1230var A2 = global.GetTypeMembers("ClassA", 0).Single(); 1256var c = n.GetTypeMembers("C", 0).Single(); 1257var a = c.GetTypeMembers("A", 1).Single(); 1258var b = a.GetTypeMembers("B", 1).Single(); 1259var d = a.GetTypeMembers("D", 0).Single(); 1280var n1 = global.GetMembers("N1").Single() as NamespaceSymbol; 1281var n2 = global.GetMembers("N2").Single() as NamespaceSymbol; 1282var a = n1.GetTypeMembers("A", 0).Single(); 1283var b = n2.GetTypeMembers("B", 0).Single(); 1302var n1 = global.GetMembers("N1").Single() as NamespaceSymbol; 1303var n2 = global.GetMembers("N2").Single() as NamespaceSymbol; 1304var a = n1.GetTypeMembers("A", 1).Single(); 1305var b = n2.GetTypeMembers("B", 0).Single(); 1321var d = global.GetMembers("D").Single() as NamedTypeSymbol; 1337var g = global.GetTypeMembers("G", 1).Single(); 1338var c = global.GetTypeMembers("C", 0).Single(); 1381var n1 = global.GetMembers("N1").Single() as NamespaceSymbol; 1382var n2 = global.GetMembers("N2").Single() as NamespaceSymbol; 1383var a = n1.GetTypeMembers("A", 0).Single(); 1384var b = n2.GetTypeMembers("B", 0).Single(); 1385var x = global.GetTypeMembers("X", 0).Single(); 1386var a1 = x.GetTypeMembers("A1", 0).Single(); 1388var b1 = x.GetTypeMembers("B1", 0).Single(); 1390var broken = global.GetTypeMembers("Broken", 0).Single(); 1391var a2 = broken.GetTypeMembers("A2", 0).Single(); 1394var b2 = broken.GetTypeMembers("B2", 0).Single(); 1413var a = global.GetTypeMembers("A", 0).Single(); 1414var b = global.GetTypeMembers("B", 0).Single(); 1441NamespaceSymbol nif = (NamespaceSymbol)comp.SourceModule.GlobalNamespace.GetMembers("if").Single(); 1444NamedTypeSymbol cfloat = (NamedTypeSymbol)nif.GetMembers("float").Single(); 1450NamedTypeSymbol ibreak = cfloat.Interfaces().Single(); 1466NamespaceSymbol nif = (NamespaceSymbol)comp.SourceModule.GlobalNamespace.GetMembers("if").Single(); 1469NamedTypeSymbol cfloat = (NamedTypeSymbol)nif.GetMembers("float").Single(); 1570Assert.Equal(baseInterface, derivedInterface.AllInterfaces().Single()); 1571Assert.Equal(derivedInterface, @class.Interfaces().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 (100)
65var method2ExplicitImpl = @class.GetSynthesizedExplicitImplementations(CancellationToken.None).ForwardingMethods.Single(); 455CheckCustomModifier(inParameterType, ((ArrayTypeSymbol)method.Parameters.Single().Type).ElementTypeWithAnnotations.CustomModifiers); 456CheckCustomModifier(onParameterType, method.Parameters.Single().TypeWithAnnotations.CustomModifiers); 480Assert.Equal(ConstModOptType, customModifiers.Single().Modifier.ToTestDisplayString()); 543var class2Method2SynthesizedExplicitImpl = class2.GetSynthesizedExplicitImplementations(CancellationToken.None).ForwardingMethods.Single(); 544Assert.Equal("Method2", class2Method2SynthesizedExplicitImpl.ExplicitInterfaceImplementations.Single().Name); 552Assert.False(class3Method1.Parameters.Single().TypeWithAnnotations.CustomModifiers.Any()); 560Assert.Equal("Method1", class3Method1SynthesizedExplicitImpl.ExplicitInterfaceImplementations.Single().Name); 566Assert.Equal("Method2", class3Method2SynthesizedExplicitImpl.ExplicitInterfaceImplementations.Single().Name); 596var classMethod1CustomModifiers = classMethod1.Parameters.Single().TypeWithAnnotations.CustomModifiers; 651Assert.True(baseM.Parameters.Single().IsParams, "Base.M.IsParams should be true"); 652Assert.True(baseM.Parameters.Single().IsParamsArray, "Base.M.IsParams should be true"); 653Assert.False(baseM.Parameters.Single().IsParamsCollection); 654Assert.False(baseN.Parameters.Single().IsParams, "Base.N.IsParams should be false"); 655Assert.False(baseN.Parameters.Single().IsParamsArray, "Base.N.IsParams should be false"); 656Assert.False(baseN.Parameters.Single().IsParamsCollection); 657Assert.True(derivedM.Parameters.Single().IsParams, "Derived.M.IsParams should be true"); //NB: does not reflect source 658Assert.True(derivedM.Parameters.Single().IsParamsArray, "Derived.M.IsParams should be true"); //NB: does not reflect source 659Assert.False(derivedM.Parameters.Single().IsParamsCollection); 660Assert.False(derivedN.Parameters.Single().IsParams, "Derived.N.IsParams should be false"); //NB: does not reflect source 661Assert.False(derivedN.Parameters.Single().IsParamsArray, "Derived.N.IsParams should be false"); //NB: does not reflect source 662Assert.False(derivedN.Parameters.Single().IsParamsCollection); 663Assert.True(derived2M.Parameters.Single().IsParams, "Derived2.M.IsParams should be true"); 664Assert.True(derived2M.Parameters.Single().IsParamsArray, "Derived2.M.IsParams should be true"); 665Assert.False(derived2M.Parameters.Single().IsParamsCollection); 666Assert.False(derived2N.Parameters.Single().IsParams, "Derived2.N.IsParams should be false"); 667Assert.False(derived2N.Parameters.Single().IsParamsArray, "Derived2.N.IsParams should be false"); 668Assert.False(derived2N.Parameters.Single().IsParamsCollection); 822Assert.True(baseIndexer1.Parameters.Single().IsParams, "Base.Indexer1.IsParams should be true"); 823Assert.True(baseIndexer1.Parameters.Single().IsParamsArray, "Base.Indexer1.IsParams should be true"); 824Assert.False(baseIndexer1.Parameters.Single().IsParamsCollection); 825Assert.False(baseIndexer2.Parameters.Single().IsParams, "Base.Indexer2.IsParams should be false"); 826Assert.False(baseIndexer2.Parameters.Single().IsParamsArray, "Base.Indexer2.IsParams should be false"); 827Assert.False(baseIndexer2.Parameters.Single().IsParamsCollection); 828Assert.True(derivedIndexer1.Parameters.Single().IsParams, "Derived.Indexer1.IsParams should be true"); //Indexer2B: does not reflect source 829Assert.True(derivedIndexer1.Parameters.Single().IsParamsArray, "Derived.Indexer1.IsParams should be true"); //Indexer2B: does not reflect source 830Assert.False(derivedIndexer1.Parameters.Single().IsParamsCollection); 831Assert.False(derivedIndexer2.Parameters.Single().IsParams, "Derived.Indexer2.IsParams should be false"); //Indexer2B: does not reflect source 832Assert.False(derivedIndexer2.Parameters.Single().IsParamsArray, "Derived.Indexer2.IsParams should be false"); //Indexer2B: does not reflect source 833Assert.False(derivedIndexer2.Parameters.Single().IsParamsCollection); 834Assert.True(derived2Indexer1.Parameters.Single().IsParams, "Derived2.Indexer1.IsParams should be true"); 835Assert.True(derived2Indexer1.Parameters.Single().IsParamsArray, "Derived2.Indexer1.IsParams should be true"); 836Assert.False(derived2Indexer1.Parameters.Single().IsParamsCollection); 837Assert.False(derived2Indexer2.Parameters.Single().IsParams, "Derived2.Indexer2.IsParams should be false"); 838Assert.False(derived2Indexer2.Parameters.Single().IsParamsArray, "Derived2.Indexer2.IsParams should be false"); 839Assert.False(derived2Indexer2.Parameters.Single().IsParamsCollection); 921Assert.Equal(SpecialType.System_Object, interfaceMethod.ParameterTypesWithAnnotations.Single().SpecialType); 922Assert.Equal(TypeKind.Dynamic, classMethod.ParameterTypesWithAnnotations.Single().Type.TypeKind); 965Assert.Equal(TypeKind.Dynamic, interfaceMethod.ParameterTypesWithAnnotations.Single().Type.TypeKind); 966Assert.Equal(SpecialType.System_Object, classMethod.ParameterTypesWithAnnotations.Single().SpecialType); 1792Assert.Equal(int8Type, baseProperty.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single().Modifier()); 1793Assert.Equal(int8Type, derivedProperty.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single().Modifier()); 1795Assert.Equal(int16Type, baseProperty.SetMethod.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1796Assert.Equal(int16Type, derivedProperty.SetMethod.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1798Assert.Equal(int8Type, baseIndexer.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single().Modifier()); 1799Assert.Equal(int8Type, derivedIndexer.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single().Modifier()); 1801Assert.Equal(int16Type, baseIndexer.GetMethod.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1802Assert.Equal(int16Type, derivedIndexer.GetMethod.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1804Assert.Equal(int32Type, baseIndexer.SetMethod.Parameters[0].TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1805Assert.Equal(int32Type, derivedIndexer.SetMethod.Parameters[0].TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1807Assert.Equal(int64Type, baseIndexer.SetMethod.Parameters[1].TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1808Assert.Equal(int64Type, derivedIndexer.SetMethod.Parameters[1].TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1911Assert.Equal(int8Type, baseProperty.TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1912Assert.Equal(int8Type, derivedProperty.TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1914Assert.Equal(int8Type, baseIndexer.TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1915Assert.Equal(int8Type, derivedIndexer.TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1917Assert.Equal(int16Type, baseIndexer.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 1918Assert.Equal(int16Type, derivedIndexer.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 2006Assert.Equal(int8Type, interfaceProperty.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single().Modifier()); 2007Assert.Equal(int8Type, implementationProperty.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single().Modifier()); 2009Assert.Equal(int16Type, interfaceProperty.SetMethod.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 2010Assert.Equal(int16Type, implementationProperty.SetMethod.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 2012Assert.Equal(int8Type, interfaceIndexer.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single().Modifier()); 2013Assert.Equal(int8Type, implementationIndexer.GetMethod.ReturnTypeWithAnnotations.CustomModifiers.Single().Modifier()); 2015Assert.Equal(int16Type, interfaceIndexer.GetMethod.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 2016Assert.Equal(int16Type, implementationIndexer.GetMethod.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 2018Assert.Equal(int32Type, interfaceIndexer.SetMethod.Parameters[0].TypeWithAnnotations.CustomModifiers.Single().Modifier()); 2019Assert.Equal(int32Type, implementationIndexer.SetMethod.Parameters[0].TypeWithAnnotations.CustomModifiers.Single().Modifier()); 2021Assert.Equal(int64Type, interfaceIndexer.SetMethod.Parameters[1].TypeWithAnnotations.CustomModifiers.Single().Modifier()); 2022Assert.Equal(int64Type, implementationIndexer.SetMethod.Parameters[1].TypeWithAnnotations.CustomModifiers.Single().Modifier()); 2110Assert.Equal(int8Type, interfaceProperty.TypeWithAnnotations.CustomModifiers.Single().Modifier()); 2111Assert.Equal(int8Type, implementationProperty.TypeWithAnnotations.CustomModifiers.Single().Modifier()); 2113Assert.Equal(int8Type, interfaceIndexer.TypeWithAnnotations.CustomModifiers.Single().Modifier()); 2114Assert.Equal(int8Type, implementationIndexer.TypeWithAnnotations.CustomModifiers.Single().Modifier()); 2116Assert.Equal(int16Type, interfaceIndexer.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 2117Assert.Equal(int16Type, implementationIndexer.Parameters.Single().TypeWithAnnotations.CustomModifiers.Single().Modifier()); 2130var paramType = s.GetParameters().Single().Type; 2145Assert.Equal(ConstModOptType, param.TypeWithAnnotations.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 (26)
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; 160var beginInvoke = myDel.GetMembers("BeginInvoke").Single() as MethodSymbol; 174var endInvoke = myDel.GetMembers("EndInvoke").Single() as MethodSymbol; 228NamedTypeSymbol dout = (NamedTypeSymbol)comp.SourceModule.GlobalNamespace.GetMembers("out").Single(); 338NamedTypeSymbol d = (NamedTypeSymbol)comp.SourceModule.GlobalNamespace.GetMembers("D").Single(); 347MethodSymbol beginInvoke = (MethodSymbol)d.GetMembers("BeginInvoke").Single(); 356MethodSymbol endInvoke = (MethodSymbol)d.GetMembers("EndInvoke").Single(); 392NamedTypeSymbol d = (NamedTypeSymbol)comp.SourceModule.GlobalNamespace.GetMembers("D").Single(); 399MethodSymbol beginInvoke = (MethodSymbol)d.GetMembers("BeginInvoke").Single(); 406MethodSymbol endInvoke = (MethodSymbol)d.GetMembers("EndInvoke").Single(); 423NamedTypeSymbol d = (NamedTypeSymbol)comp.SourceModule.GlobalNamespace.GetMembers("D").Single(); 430MethodSymbol beginInvoke = (MethodSymbol)d.GetMembers("BeginInvoke").Single(); 437MethodSymbol endInvoke = (MethodSymbol)d.GetMembers("EndInvoke").Single(); 454NamedTypeSymbol d = (NamedTypeSymbol)comp.SourceModule.GlobalNamespace.GetMembers("D").Single(); 462MethodSymbol beginInvoke = (MethodSymbol)d.GetMembers("BeginInvoke").Single(); 470MethodSymbol endInvoke = (MethodSymbol)d.GetMembers("EndInvoke").Single(); 488NamedTypeSymbol d = (NamedTypeSymbol)comp.SourceModule.GlobalNamespace.GetMembers("D").Single(); 496MethodSymbol beginInvoke = (MethodSymbol)d.GetMembers("BeginInvoke").Single(); 504MethodSymbol endInvoke = (MethodSymbol)d.GetMembers("EndInvoke").Single(); 734var syntaxTree = comp.SyntaxTrees.Single(); 761var syntaxTree = comp.SyntaxTrees.Single(); 784Assert.Equal(RefKind.Ref, ((MethodSymbol)d.GetMembers("EndInvoke").Single()).RefKind); 801Assert.Equal(RefKind.RefReadOnly, ((MethodSymbol)d.GetMembers("EndInvoke").Single()).RefKind);
Symbols\Source\EnumTests.cs (2)
757var classEnum = comp.SourceModule.GlobalNamespace.GetMembers("EnumPartial").Single() as NamedTypeSymbol; 758var member = classEnum.GetMembers("M").Single() as FieldSymbol;
Symbols\Source\EventTests.cs (13)
59NamedTypeSymbol c1 = (NamedTypeSymbol)comp.SourceModule.GlobalNamespace.GetMembers("C1").Single(); 324NamedTypeSymbol type01 = comp.SourceModule.GlobalNamespace.GetTypeMembers("C").Single(); 325var fevent = type01.GetMembers("FieldLikeEvent").Single() as EventSymbol; 2269Assert.Equal(baseEventType, event1.AddMethod.ParameterTypesWithAnnotations.Single().Type); 2270Assert.Equal(baseEventType, event1.RemoveMethod.ParameterTypesWithAnnotations.Single().Type); 2276Assert.Equal(baseEventType, event2.AddMethod.ParameterTypesWithAnnotations.Single().Type); 2277Assert.Equal(baseEventType, event2.RemoveMethod.ParameterTypesWithAnnotations.Single().Type); 2860AssertEx.Equal(["A(3)"], e.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 2863AssertEx.Equal(["A(3)"], e.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 2870AssertEx.Equal(["A(3)"], f.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 2873AssertEx.Equal(["A(3)"], f.RemoveMethod.Parameters.Single().GetAttributes().ToStrings()); 2879AssertEx.Equal(["A(23)"], g.AddMethod.Parameters.Single().GetAttributes().ToStrings()); 2882AssertEx.Equal(["A(33)"], g.RemoveMethod.Parameters.Single().GetAttributes().ToStrings());
Symbols\Source\ExternAliasTests.cs (1)
492Assert.Same(externAliasSyntax, externAliasSymbol.DeclaringSyntaxReferences.Single().GetSyntax());
Symbols\Source\FieldTests.cs (22)
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; 235NamedTypeSymbol c1 = (NamedTypeSymbol)comp.SourceModule.GlobalNamespace.GetMembers("C1").Single(); 236FieldSymbol ein = (FieldSymbol)c1.GetMembers("in").Single(); 255NamedTypeSymbol type1 = (NamedTypeSymbol)comp.SourceModule.GlobalNamespace.GetMembers("C").Single(); 256FieldSymbol mem = (FieldSymbol)type1.GetMembers("x").Single();
Symbols\Source\FileModifierTests.cs (13)
1229Assert.Equal(comp.SyntaxTrees[0], cs[0].DeclaringSyntaxReferences.Single().SyntaxTree); 1230Assert.Equal(comp.SyntaxTrees[1], cs[1].DeclaringSyntaxReferences.Single().SyntaxTree); 1363Assert.Equal(comp.SyntaxTrees[2], c1.DeclaringSyntaxReferences.Single().SyntaxTree); 1421Assert.Equal(comp.SyntaxTrees[0], c0.DeclaringSyntaxReferences.Single().SyntaxTree); 1483Assert.Equal(comp.SyntaxTrees[0], c0.DeclaringSyntaxReferences.Single().SyntaxTree); 1487Assert.Equal(comp.SyntaxTrees[1], c1.DeclaringSyntaxReferences.Single().SyntaxTree); 1548Assert.Equal(comp.SyntaxTrees[1], c1.DeclaringSyntaxReferences.Single().SyntaxTree); 1615Assert.Equal(comp.SyntaxTrees[0], c0.DeclaringSyntaxReferences.Single().SyntaxTree); 1642Assert.Equal(comp.SyntaxTrees[1], c1.DeclaringSyntaxReferences.Single().SyntaxTree); 1801Assert.Equal(comp.SyntaxTrees[0], cs[0].DeclaringSyntaxReferences.Single().SyntaxTree); 1802Assert.Equal(comp.SyntaxTrees[1], cs[1].DeclaringSyntaxReferences.Single().SyntaxTree); 1876Assert.Equal(comp.SyntaxTrees[0], cs[0].DeclaringSyntaxReferences.Single().SyntaxTree); 1877Assert.Equal(comp.SyntaxTrees[1], cs[1].DeclaringSyntaxReferences.Single().SyntaxTree);
Symbols\Source\LocationTests.cs (6)
28var n = global.GetMembers("N").Single() as NamespaceSymbol; 30var s = n.GetMembers("S").Single() as NamespaceSymbol; 32var c = s.GetTypeMembers("C", 0).Single() as NamedTypeSymbol; 36var f = c.GetMembers("F").Single() as FieldSymbol; 38var m = c.GetMembers("M").Single() as MethodSymbol; 46var pos = sym.Locations.Single();
Symbols\Source\MethodTests.cs (114)
36var a = global.GetTypeMembers("A", 0).Single(); 37var m = a.GetMembers("M").Single() as MethodSymbol; 71var a = global.GetTypeMembers(className, 0).Single(); 116var a = global.GetTypeMembers("A", 0).Single(); 117var m = a.InstanceConstructors.Single(); 141var a = global.GetTypeMembers("A", 0).Single(); 142var m = a.GetMembers("M").Single() as MethodSymbol; 168var a = global.GetTypeMembers("A", 0).Single(); 169var m1 = a.GetMembers("M1").Single() as MethodSymbol; 170var b = global.GetTypeMembers("B", 0).Single(); 171var m2 = b.GetMembers("M2").Single() as MethodSymbol; 190var mylist = global.GetTypeMembers("MyList", 1).Single(); 192var add = mylist.GetMembers("Add").Single() as MethodSymbol; 212var a = global.GetTypeMembers("A", 0).Single(); 231var a = global.GetTypeMembers("A", 0).Single(); 232var m = (MethodSymbol)a.GetMembers("M").Single(); 236var tree = comp.SyntaxTrees.Single(); 259var a = global.GetTypeMembers("A", 0).Single(); 260var m = (MethodSymbol)a.GetMembers("M").Single(); 264var tree = comp.SyntaxTrees.Single(); 284var a = global.GetTypeMembers("A", 0).Single(); 285var m = (MethodSymbol)a.GetMembers("M").Single(); 289var tree = comp.SyntaxTrees.Single().GetRoot(); 305var a = global.GetTypeMembers("A", 0).Single(); 306var m = (MethodSymbol)a.GetMembers("M").Single(); 310var tree = comp.SyntaxTrees.Single().GetRoot(); 327var a = global.GetTypeMembers("A", 0).Single(); 328var m = a.GetMembers("M").Single() as MethodSymbol; 343var a = global.GetTypeMembers("A", 0).Single(); 344var m = a.GetMembers("M").Single() as MethodSymbol; 360var a = global.GetTypeMembers("A", 0).Single(); 361var m = a.GetMembers("M").Single() as MethodSymbol; 404var a = global.GetTypeMembers("A", 0).Single(); 405var m = a.GetMembers("M").Single() as MethodSymbol; 427var classTest = comp.GlobalNamespace.GetTypeMembers("Test", 0).Single(); 446var classTest = comp.GlobalNamespace.GetTypeMembers("Test", 0).Single(); 447var method = classTest.GetMembers("MethodWithRefOutArray").Single() as MethodSymbol; 511var ns = comp.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 512var ns1 = ns.GetMembers("NS1").Single() as NamespaceSymbol; 514var classImpl = ns1.GetTypeMembers("Impl", 0).Single() as NamedTypeSymbol; 530var mem1 = classImpl.GetMembers("M22").Single() as MethodSymbol; 537var structImpl = ns1.GetTypeMembers("S").Single() as NamedTypeSymbol; 587var ns = comp.GlobalNamespace.GetMembers("N1").Single() as NamespaceSymbol; 588var ns1 = ns.GetMembers("N2").Single() as NamespaceSymbol; 591var type1 = ns1.GetTypeMembers("Bbc", 0).Single() as NamedTypeSymbol; 780var ns = comp.GlobalNamespace.GetMembers("N1").Single() as NamespaceSymbol; 781var ns1 = ns.GetMembers("N2").Single() as NamespaceSymbol; 784var type1 = ns1.GetTypeMembers("Bbc", 0).Single() as NamedTypeSymbol; 959var ns = comp.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 961var type1 = (ns.GetTypeMembers("Test").Single() as NamedTypeSymbol).GetTypeMembers("C", 0).Single() as NamedTypeSymbol; 1069var ns = comp.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 1070var type1 = (ns.GetTypeMembers("Test").Single() as NamedTypeSymbol).GetTypeMembers("C", 0).Single() as NamedTypeSymbol; 1166var ns = comp.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 1168var type1 = ns.GetTypeMembers("PS", 0).Single() as NamedTypeSymbol; 1260var ns = comp.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 1261var type1 = ns.GetTypeMembers("PC", 0).Single() as NamedTypeSymbol; 1355var classB = (NamedTypeSymbol)comp.GlobalNamespace.GetMembers("B").Single(); 1373var classC = (NamedTypeSymbol)comp.GlobalNamespace.GetMembers("C").Single(); 1410var c = comp.GlobalNamespace.GetTypeMembers("C").Single(); 1411var f1 = c.GetMembers("F1").Single() as MethodSymbol; 1431Assert.Equal("System.Int32 AA.Method1(__arglist)", nts.GetMembers("Method1").Single().ToTestDisplayString()); 1465var ns = comp.GlobalNamespace.GetMembers("N2").Single() as NamespaceSymbol; 1466var type1 = ns.GetTypeMembers("ExpImpl", 0).Single() as NamedTypeSymbol; 1503var n2 = comp.GlobalNamespace.GetMembers("N2").Single() as NamespaceSymbol; 1504var test = n2.GetTypeMembers("Test").Single() as NamedTypeSymbol; 1505var bt = test.Interfaces().Single() as NamedTypeSymbol; 1567var test = comp.GlobalNamespace.GetTypeMembers("Test").Single() as NamedTypeSymbol; 1595var a = comp.GlobalNamespace.GetTypeMembers("A").Single() as NamedTypeSymbol; 1596var b = comp.GlobalNamespace.GetTypeMembers("B").Single() as NamedTypeSymbol; 1597var f = b.GetMembers("F").Single() as MethodSymbol; 1619NamedTypeSymbol c1 = (NamedTypeSymbol)comp.SourceModule.GlobalNamespace.GetMembers("C1").Single(); 1628MethodSymbol mreturn = (MethodSymbol)c1.GetMembers("@void.return").Single(); 1634MethodSymbol mvoidreturn = (MethodSymbol)mreturn.ExplicitInterfaceImplementations.Single(); 1637ParameterSymbol pin = mreturn.Parameters.Single(); 1643MethodSymbol mfloat = (MethodSymbol)c1.GetMembers("float").Single(); 1667var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I").Single(); 1670var interfaceMethod = (MethodSymbol)@interface.GetMembers("Method").Single(); 1672var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("C").Single(); 1676var classMethod = (MethodSymbol)@class.GetMembers("I.Method").Single(); 1679var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); 1709var systemNamespace = (NamespaceSymbol)globalNamespace.GetMembers("System").Single(); 1711var @interface = (NamedTypeSymbol)systemNamespace.GetTypeMembers("IFormattable").Single(); 1714var interfaceMethod = (MethodSymbol)@interface.GetMembers("ToString").Single(); 1716var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("F").Single(); 1720var classMethod = (MethodSymbol)@class.GetMembers("System.IFormattable.ToString").Single(); 1723var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); 1756var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I").Single(); 1759var interfaceMethod = (MethodSymbol)@interface.GetMembers("Method").Single(); 1762var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("C").Single(); 1766var classMethod = (MethodSymbol)@class.GetMembers("I.Method").Single(); 1770var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); 1805var systemNamespace = (NamespaceSymbol)globalNamespace.GetMembers("Namespace").Single(); 1807var @interface = (NamedTypeSymbol)systemNamespace.GetTypeMembers("I", 1).Single(); 1810var interfaceMethod = (MethodSymbol)@interface.GetMembers("Method").Single(); 1812var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("IC").Single(); 1815var substitutedInterface = @class.Interfaces().Single(); 1818var substitutedInterfaceMethod = (MethodSymbol)substitutedInterface.GetMembers("Method").Single(); 1820var classMethod = (MethodSymbol)@class.GetMembers("Namespace.I<System.Int32>.Method").Single(); 1823var explicitImpl = classMethod.ExplicitInterfaceImplementations.Single(); 1857var @class = (NamedTypeSymbol)comp.GlobalNamespace.GetTypeMembers("C").Single(); 1859var method1 = (SourceMemberMethodSymbol)@class.GetMembers("Method1").Single(); 1860var method2 = (SourceMemberMethodSymbol)@class.GetMembers("Method2").Single(); 1861var method3 = (SourceMemberMethodSymbol)@class.GetMembers("Method3").Single(); 1862var method4 = (SourceMemberMethodSymbol)@class.GetMembers("Method4").Single(); 2067var symbol = comp.GlobalNamespace.GetMember<NamedTypeSymbol>("C").GetMembers(WellKnownMemberNames.UnaryPlusOperatorName).Single(); 2068var span = symbol.Locations.Single().SourceSpan; 2088var symbol = comp.GlobalNamespace.GetMember<NamedTypeSymbol>("C").GetMembers(WellKnownMemberNames.ExplicitConversionName).Single(); 2089var span = symbol.Locations.Single().SourceSpan; 2139var substitutedParameter1 = constructedMethod1.Parameters.Single(); 2140var substitutedParameter2 = constructedMethod2.Parameters.Single(); 2164var extensionParameter1 = reducedMethod1.Parameters.Single(); 2165var extensionParameter2 = reducedMethod2.Parameters.Single();
Symbols\Source\ModifierTests.cs (26)
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; 156var typeParamType = structType.TypeParameters.Single();
Symbols\Source\NullablePublicAPITests.cs (29)
92Assert.Equal(PublicNullableAnnotation.NotAnnotated, expressionTypes[0].TypeArgumentNullableAnnotations.Single()); 94Assert.Equal(PublicNullableAnnotation.Annotated, expressionTypes[1].TypeArgumentNullableAnnotations.Single()); 96Assert.Equal(PublicNullableAnnotation.NotAnnotated, expressionTypes[2].TypeArgumentNullableAnnotations.Single()); 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()); 4700Assert.Equal(PublicNullableAnnotation.NotAnnotated, symbol2.Parameters.Single().Type.NullableAnnotation); 4810var tree = comp.SyntaxTrees.Single(); 4896var tree = comp.SyntaxTrees.Single(); 5097var tree = comp.SyntaxTrees.Single(); 5129var tree = comp.SyntaxTrees.Single(); 5157var tree = comp.SyntaxTrees.Single(); 5192var tree = comp.SyntaxTrees.Single(); 5227var tree = comp.SyntaxTrees.Single();
Symbols\Source\PropertyTests.cs (55)
360var a = global.GetTypeMembers("A", 0).Single(); 361var i = global.GetTypeMembers("I", 0).Single(); 393var type01 = global.GetTypeMembers("C").Single(); 394var type02 = type01.GetTypeMembers("S").Single(); 411var prop = type01.GetMembers("Prop").Single() as PropertySymbol; 430prop = type02.GetMembers("Prop").Single() as PropertySymbol; 450NamedTypeSymbol c1 = (NamedTypeSymbol)comp.SourceModule.GlobalNamespace.GetMembers("C1").Single(); 451PropertySymbol ein = (PropertySymbol)c1.GetMembers("in").Single(); 601var method = type.GetMembers(accessor.Name).Single(); 629var type = (PENamedTypeSymbol)compilation.GlobalNamespace.GetMembers("NoAccessors").Single(); 717var goodStatic = (PEPropertySymbol)type.GetMembers("GoodStatic").Single(); 718var badStatic = (PEPropertySymbol)type.GetMembers("BadStatic").Single(); 719var mismatchedStatic = (PEPropertySymbol)type.GetMembers("MismatchedStatic").Single(); 734var goodInstance = (PEPropertySymbol)type.GetMembers("GoodInstance").Single(); 735var badInstance = (PEPropertySymbol)type.GetMembers("BadInstance").Single(); 736var mismatchedInstance = (PEPropertySymbol)type.GetMembers("MismatchedInstance").Single(); 750var staticAndInstance = (PEPropertySymbol)type.GetMembers("StaticAndInstance").Single(); 756var getUsedAsSet = (PEPropertySymbol)type.GetMembers("GetUsedAsSet").Single(); 791var type = (PENamedTypeSymbol)compilation.GlobalNamespace.GetMembers("FamilyAssembly").Single(); 794(PEPropertySymbol)type.GetMembers("FamilyGetAssemblySetStatic").Single(), 799(PEPropertySymbol)type.GetMembers("FamilyGetFamilyOrAssemblySetStatic").Single(), 804(PEPropertySymbol)type.GetMembers("FamilyGetFamilyAndAssemblySetStatic").Single(), 809(PEPropertySymbol)type.GetMembers("AssemblyGetFamilyOrAssemblySetStatic").Single(), 814(PEPropertySymbol)type.GetMembers("AssemblyGetFamilyAndAssemblySetStatic").Single(), 819(PEPropertySymbol)type.GetMembers("FamilyOrAssemblyGetFamilyOrAssemblySetStatic").Single(), 824(PEPropertySymbol)type.GetMembers("FamilyOrAssemblyGetFamilyAndAssemblySetStatic").Single(), 829(PEPropertySymbol)type.GetMembers("FamilyAndAssemblyGetFamilyAndAssemblySetStatic").Single(), 834(PEPropertySymbol)type.GetMembers("FamilyAndAssemblyGetOnlyInstance").Single(), 839(PEPropertySymbol)type.GetMembers("FamilyOrAssemblySetOnlyInstance").Single(), 844(PEPropertySymbol)type.GetMembers("FamilyAndAssemblyGetFamilyOrAssemblySetInstance").Single(), 1750var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I").Single(); 1753var interfaceProperty = (PropertySymbol)@interface.GetMembers("P").Single(); 1755var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("C").Single(); 1759var classProperty = (PropertySymbol)@class.GetMembers("I.P").Single(); 1784var @interface = (NamedTypeSymbol)globalNamespace.GetTypeMembers("I").Single(); 1787var interfaceProperty = (PropertySymbol)@interface.GetMembers("P").Single(); 1789var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("C").Single(); 1793var classProperty = (PropertySymbol)@class.GetMembers("I.P").Single(); 1820var @namespace = (NamespaceSymbol)globalNamespace.GetMembers("N").Single(); 1822var @interface = (NamedTypeSymbol)@namespace.GetTypeMembers("I").Single(); 1825var interfaceProperty = (PropertySymbol)@interface.GetMembers("P").Single(); 1827var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("C").Single(); 1830var classProperty = (PropertySymbol)@class.GetMembers("N.I<System.Int32>.P").Single(); 1832var substitutedInterface = @class.Interfaces().Single(); 1835var substitutedInterfaceProperty = (PropertySymbol)substitutedInterface.GetMembers("P").Single(); 1925var a = global.GetTypeMembers("A", 0).Single(); 1934var one = errors.Single(); 1957var @class = (NamedTypeSymbol)globalNamespace.GetTypeMembers("Test").Single(); 1960var accessor = @class.GetMembers("get_Item").Single() as MethodSymbol; 1967accessor = @class.GetMembers("set_Item").Single() as MethodSymbol; 2495Assert.Equal(interfaceProperty, classProperty.ExplicitInterfaceImplementations.Single()); 2502Assert.Equal(interfacePropertyGetter, classPropertyGetter.ExplicitInterfaceImplementations.Single()); 2503Assert.Equal(interfacePropertySetter, classPropertySetter.ExplicitInterfaceImplementations.Single()); 2534Assert.Equal(interfaceProperty, classProperty.ExplicitInterfaceImplementations.Single()); 2541Assert.Equal(interfacePropertyGetter, classPropertyGetter.ExplicitInterfaceImplementations.Single());
Symbols\Source\RecordTests.cs (7)
1430var clone = (MethodSymbol)r.GetMembers(WellKnownMemberNames.CloneMethodName).Single(); 1438var clone2 = (MethodSymbol)r2.GetMembers(WellKnownMemberNames.CloneMethodName).Single(); 1473var clone = (MethodSymbol)r.GetMembers(WellKnownMemberNames.CloneMethodName).Single(); 1483var clone2 = (MethodSymbol)r2.GetMembers(WellKnownMemberNames.CloneMethodName).Single(); 1494var clone3 = (MethodSymbol)r3.GetMembers(WellKnownMemberNames.CloneMethodName).Single(); 1505var clone4 = (MethodSymbol)r4.GetMembers(WellKnownMemberNames.CloneMethodName).Single(); 1516var clone5 = (MethodSymbol)r5.GetMembers(WellKnownMemberNames.CloneMethodName).Single();
Symbols\Source\SourcePlusMetadataTests.cs (16)
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(); 82var system = global.GetMembers("System").Single() as NamespaceSymbol; 83var a = system.GetTypeMembers("A", 0).Single(); 138var ns = (NamespaceSymbol)compilation.GlobalNamespace.GetMembers("NS").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 (13)
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 77var aebfc = aebf.GetTypeMembers("C", 0).Single(); // A<E>.B<F>.C 82Assert.Equal(e, TypeArg(aebfc.GetTypeMembers("TBox", 0).Single().BaseType())); 83Assert.Equal(f, TypeArg(aebfc.GetTypeMembers("UBox", 0).Single().BaseType())); // exercises alpha-renaming. 114var c = global.GetTypeMembers("C", 0).Single() as NamedTypeSymbol; 115var field = c.GetMembers("field").Single() as FieldSymbol;
Symbols\Source\UsingAliasTests.cs (2)
695var tree = compilation.SyntaxTrees.Single(); 738var tree = compilation.SyntaxTrees.Single();
Symbols\StaticAbstractMembersInInterfacesTests.cs (391)
8433var tree = compilation1.SyntaxTrees.Single(); 8448Assert.Equal("void I1.M01()", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "M01").Single().ToTestDisplayString()); 8450Assert.Equal("void I1.M01()", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "M01").Single().ToTestDisplayString()); 8453Assert.Equal("void I1.M01()", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "M01").Single().ToTestDisplayString()); 8455Assert.Equal("void I1.M01()", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "M01").Single().ToTestDisplayString()); 9021var tree = compilation1.SyntaxTrees.Single(); 9336var tree = compilation1.SyntaxTrees.Single(); 9735var tree = compilation1.SyntaxTrees.Single(); 10732var tree = compilation1.SyntaxTrees.Single(); 10925var tree = compilation1.SyntaxTrees.Single(); 11115var tree = compilation1.SyntaxTrees.Single(); 11309var tree = compilation1.SyntaxTrees.Single(); 11563var tree = compilation1.SyntaxTrees.Single(); 11940var tree = compilation1.SyntaxTrees.Single(); 12119var tree = compilation1.SyntaxTrees.Single(); 13160var tree = compilation1.SyntaxTrees.Single(); 13174Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13175Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13179Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13180Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13246var tree = compilation1.SyntaxTrees.Single(); 13260Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13261Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13265Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13266Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13368var tree = compilation1.SyntaxTrees.Single(); 13382Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13383Assert.Equal("System.Int32 I1.P01 { get; set; }", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "P01").Single().ToTestDisplayString()); 13387Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 13388Assert.Equal("System.Int32 I1.P01 { get; set; }", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "P01").Single().ToTestDisplayString()); 14069var tree = compilation1.SyntaxTrees.Single(); 14092Assert.Equal("event System.Action I1.E01", ((CSharpSemanticModel)model).LookupSymbols(node.SpanStart, m02.TypeParameters[0], "E01").Single().ToTestDisplayString()); 14093Assert.Equal("event System.Action I1.E01", ((CSharpSemanticModel)model).LookupStaticMembers(node.SpanStart, m02.TypeParameters[0], "E01").Single().ToTestDisplayString()); 14097Assert.Equal("event System.Action I1.E01", model.LookupSymbols(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "E01").Single().ToTestDisplayString()); 14098Assert.Equal("event System.Action I1.E01", model.LookupStaticMembers(node.SpanStart, m02.TypeParameters[0].GetPublicSymbol(), "E01").Single().ToTestDisplayString()); 14694var tree = compilation1.SyntaxTrees.Single(); 15100var tree = compilation1.SyntaxTrees.Single(); 15368var tree = compilation1.SyntaxTrees.Single(); 16071Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 16130Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 16188var m01 = c3.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 16193Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 16282var m01 = c1.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 16287Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 16343var i1 = c1.Interfaces().Single(); 16374m01 = c1.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 16420var i2 = c1.Interfaces().Single(); 16421var i1 = i2.Interfaces().Single(); 16427Assert.Same(m01, i2M01.ExplicitInterfaceImplementations.Single()); 16478Assert.Same(m01, c2M01.ExplicitInterfaceImplementations.Single()); 16548var m01 = c1.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 16563Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 16598Assert.Same(m01, c2M01.ExplicitInterfaceImplementations.Single()); 16670var m01 = c3.Interfaces().Single().GetMembers("M01").OfType<MethodSymbol>().Single(); 16688Assert.Same(m01, c2M01.ExplicitInterfaceImplementations.Single()); 16695var m02 = c3.Interfaces().Single().GetMembers("M02").OfType<MethodSymbol>().Single(); 16763var m01 = c3.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 16781Assert.Same(m01, c3M01.ExplicitInterfaceImplementations.Single()); 16849var m01 = c2.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 16863Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 16931var m01 = c2.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 16945Assert.Equal(m01, c1M01.ExplicitInterfaceImplementations.Single()); 17013var m01 = c2.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 17019Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 17084var m01 = c2.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 17090Assert.Equal(m01, c1M01.ExplicitInterfaceImplementations.Single()); 17158var m01 = c2.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 17173Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 17245var m01 = c2.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 17260Assert.Equal(m01, c1M01.ExplicitInterfaceImplementations.Single()); 17345var m01 = c2.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 17357Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 17447var m01 = c2.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 17459Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 18425Assert.Null(i8.FindImplementationForInterfaceMember(i8.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 18428Assert.Null(i9.FindImplementationForInterfaceMember(i9.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 18431Assert.Null(i10.FindImplementationForInterfaceMember(i10.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 18434Assert.Same(i12.GetMembers().OfType<MethodSymbol>().Single(), i12.FindImplementationForInterfaceMember(i12.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 18437Assert.Null(i13.FindImplementationForInterfaceMember(i13.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 18572Assert.Null(i8.FindImplementationForInterfaceMember(i8.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 18575Assert.Null(i9.FindImplementationForInterfaceMember(i9.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 18578Assert.Null(i10.FindImplementationForInterfaceMember(i10.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 18581Assert.Same(i12.GetMembers().OfType<MethodSymbol>().Single(), i12.FindImplementationForInterfaceMember(i12.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 18584Assert.Null(i13.FindImplementationForInterfaceMember(i13.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 18727var iXM = iX.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 18734var iXM = iX.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 18880var iXM = iX.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 18887var iXM = iX.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 19064Assert.Null(i8.FindImplementationForInterfaceMember(i8.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 19067Assert.Null(i9.FindImplementationForInterfaceMember(i9.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 19070Assert.Null(i10.FindImplementationForInterfaceMember(i10.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 19073Assert.Same(i12.GetMembers().OfType<MethodSymbol>().Single(), i12.FindImplementationForInterfaceMember(i12.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 19076Assert.Null(i13.FindImplementationForInterfaceMember(i13.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 19258var iXM = iX.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 19265var iXM = iX.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 19843var i1 = c.Interfaces().Single(); 19864Assert.Equal(m01, cM01.ExplicitInterfaceImplementations.Single()); 19924var i1 = c.Interfaces().Single(); 19945Assert.Equal(m01, cM01.ExplicitInterfaceImplementations.Single()); 20016var i1 = c.Interfaces().Single(); 20037Assert.Equal(m01, cM01.ExplicitInterfaceImplementations.Single()); 20096var tree = compilation1.SyntaxTrees.Single(); 20132Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 20179var tree = compilation1.SyntaxTrees.Single(); 20215Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 20271var tree = compilation1.SyntaxTrees.Single(); 20307Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 20360var tree = compilation1.SyntaxTrees.Single(); 20379var m01 = c.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().Single(); 20396Assert.Equal(m01, cM01.ExplicitInterfaceImplementations.Single()); 20472var m01 = c3.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().Single(); 20477Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 20546var m01 = c3.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().Single(); 20551Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 20629var m01 = c3.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().Single(); 20634Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 20709var m01 = c3.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().Single(); 20714Assert.Equal(m01, cM01.ExplicitInterfaceImplementations.Single()); 20815var m01 = c1.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 20824Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 20950var m01 = c1.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 20959Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 21028var i1 = c1.Interfaces().Single(); 21060m01 = c1.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 21108var i1 = c1.Interfaces().Single(); 21140m01 = c1.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 21198var i2 = c1.Interfaces().Single(); 21199var i1 = i2.Interfaces().Single(); 21207Assert.Same(m01, i2M01.ExplicitInterfaceImplementations.Single()); 21263var i2 = c1.Interfaces().Single(); 21264var i1 = i2.Interfaces().Single(); 21272Assert.Same(m01, i2M01.ExplicitInterfaceImplementations.Single()); 21335var i1 = c2.Interfaces().Single(); 21354Assert.Equal(m01, c2M01.ExplicitInterfaceImplementations.Single()); 21452var m01 = c1.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 21467Assert.Equal(m01, c1M01.ExplicitInterfaceImplementations.Single()); 21490m01 = c2.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 21502Assert.Equal(m01, c2M01.ExplicitInterfaceImplementations.Single()); 21563var m01 = c1.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 21578Assert.Equal(m01, c1M01.ExplicitInterfaceImplementations.Single()); 21601m01 = c2.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 21613Assert.Equal(m01, c2M01.ExplicitInterfaceImplementations.Single()); 21698var m01 = c1.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 21713Assert.Equal(m01, c1M01.ExplicitInterfaceImplementations.Single()); 21735m01 = c2.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 21747Assert.Equal(m01, c2M01.ExplicitInterfaceImplementations.Single()); 21838var m02 = c3.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().Single(); 21898var m01 = c3.Interfaces().Single().GetMembers("op_True").OfType<MethodSymbol>().Single(); 21899var m02 = c3.Interfaces().Single().GetMembers("op_False").OfType<MethodSymbol>().Single(); 22001var m01 = c3.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().First(); 22019Assert.Equal(m01, c2M01.ExplicitInterfaceImplementations.Single()); 22026var m02 = c3.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().ElementAt(1); 22128var m01 = c3.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().Single(); 22146Assert.Equal(m01, c3M01.ExplicitInterfaceImplementations.Single()); 22243var m01 = c2.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().Single(); 22257Assert.Equal(m01, c1M01.ExplicitInterfaceImplementations.Single()); 22352var m01 = c2.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().Single(); 22359Assert.Equal(m01, c1M01.ExplicitInterfaceImplementations.Single()); 22454var m01 = c2.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().Single(); 22469Assert.Equal(m01, c1M01.ExplicitInterfaceImplementations.Single()); 23518Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 23519Assert.Same(m01Get, cM01Get.ExplicitInterfaceImplementations.Single()); 23520Assert.Same(m01Set, cM01Set.ExplicitInterfaceImplementations.Single()); 23609Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 23610Assert.Same(m01Get, cM01Get.ExplicitInterfaceImplementations.Single()); 23702Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 23703Assert.Same(m01Get, cM01Get.ExplicitInterfaceImplementations.Single()); 23704Assert.Same(m01Set, cM01Set.ExplicitInterfaceImplementations.Single()); 23763var m01 = c3.Interfaces().Single().GetMembers().OfType<PropertySymbol>().Single(); 23772Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 23773Assert.Same(m01.GetMethod, cM01.GetMethod.ExplicitInterfaceImplementations.Single()); 23774Assert.Same(m01.SetMethod, cM01.SetMethod.ExplicitInterfaceImplementations.Single()); 23919var m01 = c1.Interfaces().Single().GetMembers().OfType<PropertySymbol>().Single(); 23927Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 23928Assert.Same(m01.GetMethod, c1M01.GetMethod.ExplicitInterfaceImplementations.Single()); 23929Assert.Same(m01.SetMethod, c1M01.SetMethod.ExplicitInterfaceImplementations.Single()); 24020var i1 = c1.Interfaces().Single(); 24062i1 = c1.Interfaces().Single(); 24102var m01 = c.Interfaces().Single().GetMembers().OfType<PropertySymbol>().Single(); 24154var i1 = c1.Interfaces().Single(); 24190var m01 = c.Interfaces().Single().GetMembers().OfType<PropertySymbol>().Single(); 24221Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 24222Assert.Same(m01Get, cM01Get.ExplicitInterfaceImplementations.Single()); 24249var m01 = c.Interfaces().Single().GetMembers().OfType<PropertySymbol>().Single(); 24293Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 24294Assert.Same(m01Get, cM01Get.ExplicitInterfaceImplementations.Single()); 24295Assert.Same(m01Set, cM01Set.ExplicitInterfaceImplementations.Single()); 24324i1 = c1.Interfaces().Single(); 24331Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 24332Assert.Same(m01.GetMethod, c1M01.GetMethod.ExplicitInterfaceImplementations.Single()); 24333Assert.Same(m01.SetMethod, c1M01.SetMethod.ExplicitInterfaceImplementations.Single()); 24353var m01 = c.Interfaces().Single().GetMembers().OfType<PropertySymbol>().Single(); 24385Assert.Same(m01Get, cM01Get.ExplicitInterfaceImplementations.Single()); 24417i1 = c1.Interfaces().Single(); 24450i1 = c1.Interfaces().Single(); 24457Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 24458Assert.Same(m01.SetMethod, c1M01.SetMethod.ExplicitInterfaceImplementations.Single()); 24506var i1 = c1.Interfaces().Single(); 24542var m01 = c.Interfaces().Single().GetMembers().OfType<PropertySymbol>().Single(); 24573Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 24574Assert.Same(m01Set, cM01Set.ExplicitInterfaceImplementations.Single()); 24601var m01 = c.Interfaces().Single().GetMembers().OfType<PropertySymbol>().Single(); 24645Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 24646Assert.Same(m01Set, cM01Set.ExplicitInterfaceImplementations.Single()); 24647Assert.Same(m01Get, cM01Get.ExplicitInterfaceImplementations.Single()); 24676i1 = c1.Interfaces().Single(); 24683Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 24684Assert.Same(m01.GetMethod, c1M01.GetMethod.ExplicitInterfaceImplementations.Single()); 24685Assert.Same(m01.SetMethod, c1M01.SetMethod.ExplicitInterfaceImplementations.Single()); 24705var m01 = c.Interfaces().Single().GetMembers().OfType<PropertySymbol>().Single(); 24737Assert.Same(m01Set, cM01Set.ExplicitInterfaceImplementations.Single()); 24769i1 = c1.Interfaces().Single(); 24802i1 = c1.Interfaces().Single(); 24809Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 24810Assert.Same(m01.GetMethod, c1M01.GetMethod.ExplicitInterfaceImplementations.Single()); 24883var i2 = c1.Interfaces().Single(); 24884var i1 = i2.Interfaces().Single(); 24895Assert.Same(m01, i2M01.ExplicitInterfaceImplementations.Single()); 24896Assert.Same(m01.GetMethod, i2M01.GetMethod.ExplicitInterfaceImplementations.Single()); 24897Assert.Same(m01.SetMethod, i2M01.SetMethod.ExplicitInterfaceImplementations.Single()); 24959Assert.Same(m01.GetMethod, c2M01Get.ExplicitInterfaceImplementations.Single()); 24965Assert.Same(m01.SetMethod, c2M01Set.ExplicitInterfaceImplementations.Single()); 25122var m01 = c1.Interfaces().Single().GetMembers().OfType<PropertySymbol>().Single(); 25156Assert.Same(m01.GetMethod, c1M01Get.ExplicitInterfaceImplementations.Single()); 25161Assert.Same(m01.SetMethod, c1M01Set.ExplicitInterfaceImplementations.Single()); 25187Assert.Same(m01, c2M01.ExplicitInterfaceImplementations.Single()); 25197Assert.Same(m01.GetMethod, c2M01Get.ExplicitInterfaceImplementations.Single()); 25208Assert.Equal("System.Int32 modopt(I1) value", c2M01Set.Parameters.Single().ToTestDisplayString()); 25209Assert.Same(m01.SetMethod, c2M01Set.ExplicitInterfaceImplementations.Single()); 25216m01 = c3.Interfaces().Single().GetMembers().OfType<PropertySymbol>().Single(); 25227Assert.Same(m01, c3M01.ExplicitInterfaceImplementations.Single()); 25237Assert.Same(m01.GetMethod, c3M01Get.ExplicitInterfaceImplementations.Single()); 25248Assert.Equal("System.Int32 modopt(I2) value", c3M01Set.Parameters.Single().ToTestDisplayString()); 25249Assert.Same(m01.SetMethod, c3M01Set.ExplicitInterfaceImplementations.Single()); 25325var m01 = c3.Interfaces().Single().GetMembers("M01").OfType<PropertySymbol>().Single(); 25374var m02 = c3.Interfaces().Single().GetMembers("M02").OfType<PropertySymbol>().Single(); 25455var m01 = c3.Interfaces().Single().GetMembers().OfType<PropertySymbol>().Single(); 25491Assert.Same(m01.GetMethod, c3M01Get.ExplicitInterfaceImplementations.Single()); 25495Assert.Same(m01.SetMethod, c3M01Set.ExplicitInterfaceImplementations.Single()); 25565var m01 = c2.Interfaces().Single().GetMembers().OfType<PropertySymbol>().Single(); 25571Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 25636var m01 = c2.Interfaces().Single().GetMembers().OfType<PropertySymbol>().Single(); 25642Assert.Equal(m01, c1M01.ExplicitInterfaceImplementations.Single()); 26296Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 26297Assert.Same(m01Add, cM01Add.ExplicitInterfaceImplementations.Single()); 26298Assert.Same(m01Remove, cM01Remove.ExplicitInterfaceImplementations.Single()); 26389Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 26390Assert.Same(m01Add, cM01Add.ExplicitInterfaceImplementations.Single()); 26391Assert.Same(m01Remove, cM01Remove.ExplicitInterfaceImplementations.Single()); 26450var m01 = c3.Interfaces().Single().GetMembers().OfType<EventSymbol>().Single(); 26459Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 26460Assert.Same(m01.AddMethod, cM01.AddMethod.ExplicitInterfaceImplementations.Single()); 26461Assert.Same(m01.RemoveMethod, cM01.RemoveMethod.ExplicitInterfaceImplementations.Single()); 26611var m01 = c1.Interfaces().Single().GetMembers().OfType<EventSymbol>().Single(); 26619Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 26620Assert.Same(m01.AddMethod, c1M01.AddMethod.ExplicitInterfaceImplementations.Single()); 26621Assert.Same(m01.RemoveMethod, c1M01.RemoveMethod.ExplicitInterfaceImplementations.Single()); 26713var i1 = c1.Interfaces().Single(); 26751i1 = c1.Interfaces().Single(); 26782var m01 = c.Interfaces().Single().GetMembers().OfType<EventSymbol>().Single(); 26836var i1 = c1.Interfaces().Single(); 26865i1 = c1.Interfaces().Single(); 26872Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 26873Assert.Same(m01.AddMethod, c1M01.AddMethod.ExplicitInterfaceImplementations.Single()); 26893var m01 = c.Interfaces().Single().GetMembers().OfType<EventSymbol>().Single(); 26936Assert.Same(m01Add, cM01Add.ExplicitInterfaceImplementations.Single()); 26937Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 26938Assert.Same(m01.RemoveMethod, cM01Remove.ExplicitInterfaceImplementations.Single()); 26963i1 = c1.Interfaces().Single(); 26970Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 26971Assert.Same(m01.AddMethod, c1M01.AddMethod.ExplicitInterfaceImplementations.Single()); 26972Assert.Same(m01.RemoveMethod, c1M01.RemoveMethod.ExplicitInterfaceImplementations.Single()); 26993i1 = c1.Interfaces().Single(); 27023i1 = c1.Interfaces().Single(); 27053i1 = c1.Interfaces().Single(); 27060Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 27061Assert.Same(m01.RemoveMethod, c1M01.RemoveMethod.ExplicitInterfaceImplementations.Single()); 27110var i1 = c1.Interfaces().Single(); 27139i1 = c1.Interfaces().Single(); 27146Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 27147Assert.Same(m01.RemoveMethod, c1M01.RemoveMethod.ExplicitInterfaceImplementations.Single()); 27167var m01 = c.Interfaces().Single().GetMembers().OfType<EventSymbol>().Single(); 27210Assert.Same(m01Remove, cM01Remove.ExplicitInterfaceImplementations.Single()); 27211Assert.Same(m01, cM01.ExplicitInterfaceImplementations.Single()); 27212Assert.Same(m01.AddMethod, cM01Add.ExplicitInterfaceImplementations.Single()); 27237i1 = c1.Interfaces().Single(); 27244Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 27245Assert.Same(m01.RemoveMethod, c1M01.RemoveMethod.ExplicitInterfaceImplementations.Single()); 27246Assert.Same(m01.AddMethod, c1M01.AddMethod.ExplicitInterfaceImplementations.Single()); 27267i1 = c1.Interfaces().Single(); 27297i1 = c1.Interfaces().Single(); 27327i1 = c1.Interfaces().Single(); 27334Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 27335Assert.Same(m01.AddMethod, c1M01.AddMethod.ExplicitInterfaceImplementations.Single()); 27411var i2 = c1.Interfaces().Single(); 27412var i1 = i2.Interfaces().Single(); 27423Assert.Same(m01, i2M01.ExplicitInterfaceImplementations.Single()); 27424Assert.Same(m01.AddMethod, i2M01.AddMethod.ExplicitInterfaceImplementations.Single()); 27425Assert.Same(m01.RemoveMethod, i2M01.RemoveMethod.ExplicitInterfaceImplementations.Single()); 27487Assert.Same(m01.AddMethod, c2M01Add.ExplicitInterfaceImplementations.Single()); 27493Assert.Same(m01.RemoveMethod, c2M01Remove.ExplicitInterfaceImplementations.Single()); 27662var m01 = c1.Interfaces().Single().GetMembers().OfType<EventSymbol>().Single(); 27676Assert.Equal("System.Action<System.Int32> value", c1M01Add.Parameters.Single().ToTestDisplayString()); 27687Assert.Equal("System.Action<System.Int32> value", c1M01Remove.Parameters.Single().ToTestDisplayString()); 27701Assert.Same(m01.AddMethod, c1M01Add.ExplicitInterfaceImplementations.Single()); 27713Assert.Same(m01.RemoveMethod, c1M01Remove.ExplicitInterfaceImplementations.Single()); 27743Assert.Same(m01, c2M01.ExplicitInterfaceImplementations.Single()); 27753Assert.Equal("System.Action<System.Int32 modopt(I1)> value", c2M01Add.Parameters.Single().ToTestDisplayString()); 27754Assert.Same(m01.AddMethod, c2M01Add.ExplicitInterfaceImplementations.Single()); 27765Assert.Equal("System.Action<System.Int32 modopt(I1)> value", c2M01Remove.Parameters.Single().ToTestDisplayString()); 27766Assert.Same(m01.RemoveMethod, c2M01Remove.ExplicitInterfaceImplementations.Single()); 27773var m02 = c3.Interfaces().Single().GetMembers().OfType<EventSymbol>().Single(); 27787Assert.Equal("System.Action value", c3M02Add.Parameters.Single().ToTestDisplayString()); 27812Assert.Same(m02.AddMethod, c3M02Add.ExplicitInterfaceImplementations.Single()); 27824Assert.Same(m02.RemoveMethod, c3M02Remove.ExplicitInterfaceImplementations.Single()); 27856Assert.Same(m02, c4M02.ExplicitInterfaceImplementations.Single()); 27866Assert.Equal("System.Action value", c4M02Add.Parameters.Single().ToTestDisplayString()); 27868Assert.Same(m02.AddMethod, c4M02Add.ExplicitInterfaceImplementations.Single()); 27879Assert.Equal("System.Action value", c4M02Remove.Parameters.Single().ToTestDisplayString()); 27881Assert.Same(m02.RemoveMethod, c4M02Remove.ExplicitInterfaceImplementations.Single()); 27990var m01 = c3.Interfaces().Single().GetMembers("M01").OfType<EventSymbol>().Single(); 28039var m02 = c3.Interfaces().Single().GetMembers("M02").OfType<EventSymbol>().Single(); 28121var m01 = c3.Interfaces().Single().GetMembers().OfType<EventSymbol>().Single(); 28157Assert.Same(m01.AddMethod, c3M01Add.ExplicitInterfaceImplementations.Single()); 28161Assert.Same(m01.RemoveMethod, c3M01Remove.ExplicitInterfaceImplementations.Single()); 28231var m01 = c2.Interfaces().Single().GetMembers().OfType<EventSymbol>().Single(); 28237Assert.Same(m01, c1M01.ExplicitInterfaceImplementations.Single()); 28302var m01 = c2.Interfaces().Single().GetMembers().OfType<EventSymbol>().Single(); 28308Assert.Equal(m01, c1M01.ExplicitInterfaceImplementations.Single()); 28722Assert.Null(i2.FindImplementationForInterfaceMember(i2.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 28725Assert.Null(i3.FindImplementationForInterfaceMember(i3.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 28728Assert.Null(i4.FindImplementationForInterfaceMember(i4.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 28731Assert.Null(i5.FindImplementationForInterfaceMember(i5.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 28734Assert.Same(i6.GetMembers().OfType<MethodSymbol>().Single(), i6.FindImplementationForInterfaceMember(i6.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 28737Assert.Null(i7.FindImplementationForInterfaceMember(i7.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 28740Assert.Null(i8.FindImplementationForInterfaceMember(i8.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 28743Assert.Null(i9.FindImplementationForInterfaceMember(i9.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 28746Assert.Null(i10.FindImplementationForInterfaceMember(i10.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 28749Assert.Same(i12.GetMembers().OfType<MethodSymbol>().Single(), i12.FindImplementationForInterfaceMember(i12.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 28752Assert.Null(i13.FindImplementationForInterfaceMember(i13.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 28755Assert.Null(i14.FindImplementationForInterfaceMember(i14.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 28885var m01 = i2.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 28889m01 = i3.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 28893m01 = i4.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 28897m01 = i5.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 28901Assert.Same(i6.GetMembers().OfType<MethodSymbol>().Single(), i6.FindImplementationForInterfaceMember(i6.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 28904m01 = i7.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 28910var iXM = iX.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 28917var iXM = iX.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 28922Assert.Same(i14.GetMembers().OfType<MethodSymbol>().Single(), i14.FindImplementationForInterfaceMember(i14.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single())); 29200var i1 = c.Interfaces().Single(); 29221Assert.Equal(m01, cM01.ExplicitInterfaceImplementations.Single()); 29246Assert.Equal(m02, cM02.ExplicitInterfaceImplementations.Single()); 29309var tree = compilation1.SyntaxTrees.Single(); 29330var m01 = c.Interfaces().Single().GetMembers().OfType<MethodSymbol>().First(); 29344Assert.Equal(m01, cM01.ExplicitInterfaceImplementations.Single()); 29346var m02 = c.Interfaces().Single().GetMembers().OfType<MethodSymbol>().ElementAt(1); 29360Assert.Equal(m02, cM02.ExplicitInterfaceImplementations.Single()); 29436var m01 = c3.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().Single(); 29441Assert.Equal(m01, cM01.ExplicitInterfaceImplementations.Single()); 29554var m01 = c1.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 29563Assert.Equal(m01, c1M01.ExplicitInterfaceImplementations.Single()); 29633var i1 = c1.Interfaces().Single(); 29665m01 = c1.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 29727var i2 = c1.Interfaces().Single(); 29728var i1 = i2.Interfaces().Single(); 29736Assert.Equal(m01, i2M01.ExplicitInterfaceImplementations.Single()); 29794var i1 = c2.Interfaces().Single(); 29813Assert.Equal(m01, c2M01.ExplicitInterfaceImplementations.Single()); 29910var m01 = c1.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 29925Assert.Equal(m01, c1M01.ExplicitInterfaceImplementations.Single()); 29948m01 = c2.Interfaces().Single().GetMembers().OfType<MethodSymbol>().Single(); 29960Assert.Equal(m01, c2M01.ExplicitInterfaceImplementations.Single()); 30062var m01 = c3.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().First(); 30080Assert.Equal(m01, c2M01.ExplicitInterfaceImplementations.Single()); 30087var m02 = c3.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().ElementAt(1); 30178var m01 = c2.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().Single(); 30192Assert.Equal(m01, c1M01.ExplicitInterfaceImplementations.Single()); 30284var m01 = c2.Interfaces().Single().GetMembers(opName).OfType<MethodSymbol>().Single(); 30291Assert.Equal(m01, c1M01.ExplicitInterfaceImplementations.Single()); 30816var tree = compilation1.SyntaxTrees.Single(); 31007var tree = compilation1.SyntaxTrees.Single(); 31473var tree = compilation1.SyntaxTrees.Single(); 32162var bI = b.Interfaces().Single(); 32183Assert.Equal(biMethods[0], bM1Impl.Single()); 32197var dI = d.Interfaces().Single(); 32260var dI = d.Interfaces().Single(); 32279Assert.Equal(diMethods[0], dM1Impl.Single()); 32329var dI = d.Interfaces().Single(); 34212var modifier = m01.Parameters.First().RefCustomModifiers.Single(); 34269var modifier = m01.Parameters.Last().RefCustomModifiers.Single();
Symbols\SymbolDistinguisherTests.cs (6)
188var sourceParameter = sourceAssembly.GlobalNamespace.GetMember<NamedTypeSymbol>("C").GetMember<MethodSymbol>("M").Parameters.Single(); 189var referencedParameter = referencedAssembly.GlobalNamespace.GetMember<NamedTypeSymbol>("C").GetMember<MethodSymbol>("M").Parameters.Single(); 264var sourceParameter = sourceAssembly.GlobalNamespace.GetMember<NamedTypeSymbol>("C").GetMember<MethodSymbol>("M").Parameters.Single(); 265var referencedParameter = referencedAssembly.GlobalNamespace.GetMember<NamedTypeSymbol>("C").GetMember<MethodSymbol>("M").Parameters.Single(); 286var sourceType = sourceAssembly.GlobalNamespace.GetMember<NamedTypeSymbol>("C").TypeParameters.Single(); 287var referencedType = referencedAssembly.GlobalNamespace.GetMember<NamedTypeSymbol>("C").TypeParameters.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 (99)
1472var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 1498var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 1517var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 1535var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 1548var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 1573var classA = comp.SourceModule.GlobalNamespace.GetTypeMembers("A").Single() as NamedTypeSymbol; 1687var classCInterface = classC.Interfaces().Single(); 2335var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 2336var baseType = ns.GetTypeMembers("A").Single().BaseType(); 2341var type2 = ns.GetTypeMembers("Bar").Single() as NamedTypeSymbol; 2342var mem1 = type2.GetMembers("foundNamespaceInsteadOfType").Single() as FieldSymbol; 2346var type3 = ns.GetTypeMembers("S").Single() as NamedTypeSymbol; 2347var mem2 = type3.GetMembers("Goo").Single() as MethodSymbol; 2457var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 2556var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 2585var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 2586var baseType = (NamedTypeSymbol)ns.GetTypeMembers("A").Single().BaseType(); 2591baseType = (NamedTypeSymbol)ns.GetTypeMembers("DD").Single().BaseType(); 2596baseType = (NamedTypeSymbol)ns.GetTypeMembers("BB").Single().BaseType(); 3088var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 3144var ns = comp.SourceModule.GlobalNamespace.GetTypeMembers("A").Single() as NamedTypeSymbol; 3364var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 3365var type1 = ns.GetTypeMembers("IGoo").Single() as NamedTypeSymbol; 3369var type2 = ns.GetTypeMembers("IBar").Single() as NamedTypeSymbol; 3379var type3 = ns.GetTypeMembers("A").Single() as NamedTypeSymbol; 3385var type4 = ns.GetTypeMembers("S").Single() as NamedTypeSymbol; 3389var mem3 = type4.GetMembers("M").Single() as MethodSymbol; 3578var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 3600var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 3636var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 3658var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 3659var type1 = ns.GetTypeMembers("C").Single() as NamedTypeSymbol; 3705var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 3733var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 3734var type1 = ns.GetTypeMembers("C").Single() as NamedTypeSymbol; 3759var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 3760var type1 = ns.GetTypeMembers("MyClass").Single() as NamedTypeSymbol; 3762var f = type1.GetMembers("F").Single() as MethodSymbol; 3784var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 3785var type1 = ns.GetTypeMembers("MyClass").Single() as NamedTypeSymbol; 3787var f = type1.GetMembers("F").Single() as MethodSymbol; 3948var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 4376var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 4756var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 5414var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 5556var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 5599var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 7462var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 8083var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 8202var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 8235var nsNamespace = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 8236var clxClass = nsNamespace.GetMembers("clx").Single() as NamedTypeSymbol; 8668var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 9217var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 9247var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 9267var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 9291var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 9314var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 9340var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 9370var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 9388var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 11081var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 11509var ns = comp.SourceModule.GlobalNamespace.GetMembers("x").Single() as NamespaceSymbol; 12399var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 12575var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 12729var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 12778var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 13107var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 13137var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 13167var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 13528var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 13576var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 14613var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 14735var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 15150var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 15196var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 15197var type1 = ns.GetMembers("C").Single() as NamedTypeSymbol; 16943var classA = (NamedTypeSymbol)comp.GlobalNamespace.GetTypeMembers("A").Single(); 16944var fieldSym = (FieldSymbol)classA.GetMembers("n").Single(); 16968var classA = (NamedTypeSymbol)comp.GlobalNamespace.GetTypeMembers("A").Single(); 16969var classC = (NamedTypeSymbol)comp.GlobalNamespace.GetTypeMembers("C").Single(); 16970var classB = (NamedTypeSymbol)classC.GetTypeMembers("B").Single(); 16971var fieldSym = (FieldSymbol)classA.GetMembers("n").Single(); 17003var classA = (NamedTypeSymbol)comp.GlobalNamespace.GetTypeMembers("A").Single(); 17004var ns1 = (NamespaceSymbol)comp.GlobalNamespace.GetMembers("N1").Single(); 17005var ns2 = (NamespaceSymbol)comp.GlobalNamespace.GetMembers("N2").Single(); 17006var classBinN1 = (NamedTypeSymbol)ns1.GetTypeMembers("B").Single(); 17007var classBinN2 = (NamedTypeSymbol)ns2.GetTypeMembers("B").Single(); 17008var fieldSym = (FieldSymbol)classA.GetMembers("n").Single(); 17703var ns = comp.SourceModule.GlobalNamespace.GetMembers("SA").Single() as NamespaceSymbol; 17740var ns = comp.SourceModule.GlobalNamespace.GetMembers("SA").Single() as NamespaceSymbol; 17983var ns = comp.SourceModule.GlobalNamespace.GetMembers("SA").Single() as NamespaceSymbol; 19427var derived = comp.SourceModule.GlobalNamespace.GetTypeMembers("Derived").Single(); 19460var b = comp.SourceModule.GlobalNamespace.GetMembers("B").Single() as NamespaceSymbol; 19461var test = b.GetMembers("Test").Single() as NamedTypeSymbol; 19462var nsa = test.GetMembers("NSA").Single() as NamedTypeSymbol; 19475var b = comp.SourceModule.GlobalNamespace.GetMembers("B").Single() as NamespaceSymbol; 19506var ns = comp.SourceModule.GlobalNamespace.GetMembers("NS").Single() as NamespaceSymbol; 19507var type1 = ns.GetMembers("MyType").Single() as NamedTypeSymbol;
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 (63)
41var x = c.GetMembers("x").Single() as FieldSymbol; 64var b1 = aint1.GetTypeMembers("B", 1).Single(); // A<int>.B<U> 65var b2 = aint2.GetTypeMembers("B", 1).Single(); // A<int>.B<U> 87var a = global.GetTypeMembers("A", 0).Single(); 88var b = global.GetTypeMembers("B", 0).Single(); 89var s = global.GetTypeMembers("S").Single(); 126var ns = global.GetMembers("NS").Single() as NamespaceSymbol; 205var ns = global.GetMembers("NS").Single() as NamespaceSymbol; 273var ns = global.GetMembers("NS").Single() as NamespaceSymbol; 277var type2 = type1.GetTypeMembers("NestedClass").Single() as NamedTypeSymbol; 295type2 = type1.GetTypeMembers("NestedS", 2).Single() as NamedTypeSymbol; 348var ns = global.GetMembers("NS").Single() as NamespaceSymbol; 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; 946MethodSymbol methodSymbol = testTypeSymbol.GetMembers("Main").Single() as MethodSymbol; 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]); 1062var ns = global.GetMembers("Convert").Single() as NamespaceSymbol; 1063var type1 = ns.GetTypeMembers("Test").Single() as NamedTypeSymbol; 1080var ns1 = global.GetMembers("NS1").Single() as NamespaceSymbol; 1081var ns2 = ns1.GetMembers("NS2").Single() as NamespaceSymbol; 1102var ns = global.GetMembers("Collections").Single() as NamespaceSymbol; 1103var type1 = ns.GetTypeMembers("Test", 1).Single() as NamedTypeSymbol; 1120var ns1 = global.GetMembers("NS").Single() as NamespaceSymbol; 1121var syma = ns1.GetMembers("A").Single() as NamedTypeSymbol; 1181var d = global.GetMembers("D").Single() as NamedTypeSymbol; 1182var x = d.GetMembers("x").Single() as FieldSymbol; 1200var system = global.GetMembers("System").Single() as NamespaceSymbol; 1201var mystring = system.GetMembers("MyString").Single() as NamedTypeSymbol; 1248var typeBi = typeB.Interfaces().Single(); 1255var typeCi = typeC.Interfaces().Single(); 1261var typeDi = typeD.Interfaces().Single(); 1340Assert.Same(interface1, ExtractErrorGuess(derivedTypes[0].Interfaces().Single())); 1348Assert.Same(interface1, ExtractErrorGuess(derivedTypes[2].Interfaces().Single())); 1351Assert.Same(interface1, ExtractErrorGuess(derivedTypes[3].Interfaces().Single())); 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(); 1860Assert.Equal(originalDefinition.InstanceConstructors.Single(), symbol.OriginalDefinition); 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)
3778var error = token.Errors().Single(); 4178Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4196Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4218Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4236Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4387Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4396Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4405Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4426Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4442Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4458Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4482Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4498Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4516Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4540Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4558Assert.Equal((int)ErrorCode.ERR_Merge_conflict_marker_encountered, trivia.Errors().Single().Code); 4574Assert.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 (13)
AttributeValidation.cs (1)
20NamedTypeSymbol attributeType = attributes.Single().AttributeClass;
CompilingTestBase.cs (2)
26var method = (MethodSymbol)compilation.GlobalNamespace.GetTypeMembers(typeName).Single().GetMembers(methodName).Single();
CSharpTestBase.cs (1)
2407var method = (PEMethodSymbol)type.GetMembers(methodData.Method.MetadataName).Single();
Extensions.cs (9)
293return members.Single(); 309return members.Single(); 324return (PropertySymbol)symbol.GetMembers(name).Single(); 329return (EventSymbol)symbol.GetMembers(name).Single(); 334return (MethodSymbol)symbol.GetMembers(name).Single(); 339return (FieldSymbol)symbol.GetMembers(name).Single(); 344return symbol.GetTypeMembers(name).Single(); 349return symbol.GetTypeMembers(name).Single(); 578Assert.Equal(propertyOrEventType, accessor.Parameters.Single().Type);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (10)
CodeGen\WinRTCollectionTests.cs (1)
7421var tree = comp.SyntaxTrees.Single();
Metadata\WinMdEventTests.cs (7)
2864var substitutedNormalEvent = implementingNormalEvent.ExplicitInterfaceImplementations.Single(); 2865var substitutedWinRTEvent = implementingWinRTEvent.ExplicitInterfaceImplementations.Single(); 3349Assert.Equal(@event.Type, fieldType.TypeArguments().Single()); 3583Assert.Equal(eventType.Type, addMethod.ParameterTypesWithAnnotations.Single().Type); 3589Assert.Equal(tokenType, removeMethod.ParameterTypesWithAnnotations.Single().Type); 3614Assert.Equal(eventType, addMethod.ParameterTypesWithAnnotations.Single().Type); 3620Assert.Equal(eventType, removeMethod.ParameterTypesWithAnnotations.Single().Type);
Metadata\WinMdMetadataTests.cs (2)
134var blk = clas.GetMembers("Black").Single(); 177var puint = clas.GetMembers("ParseUInt").Single();
Microsoft.CodeAnalysis.CSharp.Workspaces (9)
Recommendations\CSharpRecommendationServiceRunner_Conversions.cs (2)
190=> method.ReturnType.IsNonNullableValueType() && method.Parameters.Single().Type.IsNonNullableValueType(); 196TryMakeNullable(compilation, method.Parameters.Single().Type),
Rename\CSharpRenameRewriterLanguageService.cs (4)
811var token = renamedSymbol.Locations.Single().FindToken(cancellationToken); 826token = matchingParameterSymbol.Locations.Single().FindToken(cancellationToken); 835var token = renamedSymbol.Locations.Single().FindToken(cancellationToken); 864var location = renamedSymbol.Locations.Single();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (3)
1040return collectionTargetType.GetTypeArguments().Single(); 1044return collectionTargetType.GetTypeArguments().Single(); 1049return iface.TypeArguments.Single();
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (18)
CodeGeneration\SyntaxGeneratorTests.cs (18)
1067var operatorSymbol = (IMethodSymbol)comp.GetTypeByMetadataName("C").GetMembers(WellKnownMemberNames.CheckedIncrementOperatorName).Single(); 2277_emptyCompilation.GetTypeByMetadataName("System.IntPtr").GetMembers("ToPointer").Single()), 2342var method = type.GetMembers("M").Single(); 2363var method = type.GetMembers("M").Single(); 2384var method = type.GetMembers("M").Single(); 2405var method = type.GetMembers("M").Single(); 2426var method = type.GetMembers(WellKnownMemberNames.InstanceConstructorName).Single(); 2448var property = type.GetMembers("Prop").Single(); 2466var property = type.GetMembers("Prop").Single(); 2489var property = type.GetMembers("Accept").Single(); 2517var property = type.GetMembers("Accept").Single(); 2545var property = type.GetMembers("Accept").Single(); 2576var property = type.GetMembers("Accept").Single(); 2653var field = type.GetMembers("F").Single(); 2676var field = type.GetMembers("F").Single(); 2686var field = _emptyCompilation.GetSpecialType(SpecialType.System_UInt32).GetMembers(nameof(UInt32.MaxValue)).Single(); 2706var method = type.GetMembers(WellKnownMemberNames.DestructorName).Single(); 5288var 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)
166var symbolSourceDocument = this.Document.Project.Solution.GetDocument(RenameSymbol.Locations.Single().SourceTree);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (14)
BraceMatching\AbstractBraceMatcherTests.cs (1)
36Assert.Equal(expectedSpans.Single(), foundSpan.Value);
Completion\AbstractArgumentProviderTests`1.cs (1)
98var symbol = symbols.Single();
Debugging\AbstractDataTipInfoGetterTests.cs (1)
45Assert.Equal(linqExpressionSpans.Single(), result.ExpressionSpan);
ExtractInterface\AbstractExtractInterfaceTests.cs (1)
112Assert.Equal(expectedMemberName, testState.TestExtractInterfaceOptionsService.AllExtractableMembers.Single().Name);
ExtractInterface\ExtractInterfaceTestState.cs (1)
105var action = actions.Single();
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (1)
48var cursorSpan = testDocument.AnnotatedSpans["Cursor"].Single();
RefactoringHelpers\RefactoringHelpersTestBase.cs (3)
81selection = selections.Single(); 96selection = selections.Single(); 97result = results.Single();
SpellCheck\AbstractSpellCheckFixerProviderTests.cs (1)
44var result = await service.GetTestAccessor().TryRenameAsync(buffer.CurrentSnapshot.GetSpan(span.Single().ToSpan()), replacement, CancellationToken.None);
TextStructureNavigation\AbstractTextStructureNavigationTests.cs (1)
41Assert.Equal(expectedSpans.Single(), extent.Span.Span.ToTextSpan());
Workspaces\EditorTestWorkspace.cs (3)
348var sortedAndNamedSpans = namedSpans.OrderBy(kvp => kvp.Value.Single().Start) 360var spanLocation = spanNameToListMap.Value.Single().Start; 392var matchingSpan = documentWithSpan.AnnotatedSpans[spanName].Single();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (304)
CodeFixes\CodeFixServiceTests.cs (8)
63var fixer2 = (MockFixer)reference.Fixers.Single(); 128Assert.Equal(codeFix.FixableDiagnosticIds.Single(), analyzerWithFix.SupportedDiagnostics.Single().Id); 855var txtDocumentCodeFixTitles = txtDocumentCodeFixes.Select(s => s.Fixes.Single().Action.Title).ToImmutableArray(); 860var codeAction = txtDocumentCodeFixes.Single(s => s.Fixes.Single().Action.Title == fixer1.Title).Fixes.Single().Action; 872var logDocumentCodeFixTitle = logDocumentCodeFix.Fixes.Single().Action.Title; 1096var fix = expectedFixCollection.Fixes.Single();
CodeGeneration\CodeGenerationTests.CSharp.cs (1)
1155var attribute = method.GetAttributes().Single();
CodeRefactorings\CodeRefactoringServiceTest.cs (10)
91Assert.Equal($"Blocking=false", refactorings.Single().CodeActions.Single().action.Title); 176var txtRefactoringTitles = txtRefactorings.Select(s => s.CodeActions.Single().action.Title).ToImmutableArray(); 181var codeAction = txtRefactorings.Single(s => s.CodeActions.Single().action.Title == refactoring1.Title).CodeActions.Single().action; 191var logRefactoringTitle = logRefactoring.CodeActions.Single().action.Title; 215var editorConfigRefactoringTitles = editorConfigRefactorings.Select(s => s.CodeActions.Single().action.Title).ToImmutableArray(); 220var codeAction = editorConfigRefactorings.Single(s => s.CodeActions.Single().action.Title == refactoring1.Title).CodeActions.Single().action; 230var globalConfigRefactoringTitle = globalConfigRefactoring.CodeActions.Single().action.Title;
Diagnostics\DiagnosticAnalyzerServiceTests.cs (7)
643var (actualAnalyzerId, diagnosticMap) = diagnosticsMapResults.Diagnostics.Single(); 646var semanticDiagnostics = diagnosticMap.Semantic.Single().Item2; 775var builder = diagnosticsMap.Diagnostics.Single().diagnosticMap; 776var diagnostic = kind == AnalysisKind.Syntax ? builder.Syntax.Single().Item2.Single() : builder.Semantic.Single().Item2.Single();
EditAndContinue\EditAndContinueLanguageServiceTests.cs (5)
286var update = updates.Updates.Single(); 296var sequencePoint = update.SequencePoints.Single(); 300var activeStatement = update.ActiveStatements.Single(); 306var exceptionRegion = update.ExceptionRegions.Single(); 394var debuggingSession = service.GetTestAccessor().GetActiveDebuggingSessions().Single();
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
309return stringText.Container.GetRelatedDocuments().Single();
SymbolFinder\SymbolFinderTests.cs (1)
764var 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)
53var type = (ITypeSymbol)(await workspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 55var intField1 = (IFieldSymbol)type.GetMembers("intField1").Single(); 56var intArrayField1 = (IFieldSymbol)type.GetMembers("intArrayField1").Single(); 57var stringArrayField1 = (IFieldSymbol)type.GetMembers("stringArrayField1").Single(); 58var intArrayArrayField1 = (IFieldSymbol)type.GetMembers("intArrayArrayField1").Single(); 59var intArrayRank2Field1 = (IFieldSymbol)type.GetMembers("intArrayRank2Field1").Single(); 60var int32Field1 = (IFieldSymbol)type.GetMembers("int32Field1").Single(); 62var intField2 = (IFieldSymbol)type.GetMembers("intField2").Single(); 63var intArrayField2 = (IFieldSymbol)type.GetMembers("intArrayField2").Single(); 64var stringArrayField2 = (IFieldSymbol)type.GetMembers("stringArrayField2").Single(); 65var intArrayArrayField2 = (IFieldSymbol)type.GetMembers("intArrayArrayField2").Single(); 66var intArrayRank2Field2 = (IFieldSymbol)type.GetMembers("intArrayRank2Field2").Single(); 67var int32Field2 = (IFieldSymbol)type.GetMembers("int32Field2").Single(); 129var csharpType = (ITypeSymbol)(await csharpWorkspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 130var vbType = (await vbWorkspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 132var csharpIntField1 = (IFieldSymbol)csharpType.GetMembers("intField1").Single(); 133var csharpIntArrayField1 = (IFieldSymbol)csharpType.GetMembers("intArrayField1").Single(); 134var csharpStringArrayField1 = (IFieldSymbol)csharpType.GetMembers("stringArrayField1").Single(); 135var csharpIntArrayArrayField1 = (IFieldSymbol)csharpType.GetMembers("intArrayArrayField1").Single(); 136var csharpIntArrayRank2Field1 = (IFieldSymbol)csharpType.GetMembers("intArrayRank2Field1").Single(); 137var csharpInt32Field1 = (IFieldSymbol)csharpType.GetMembers("int32Field1").Single(); 139var vbIntField1 = (IFieldSymbol)vbType.GetMembers("intField1").Single(); 140var vbIntArrayField1 = (IFieldSymbol)vbType.GetMembers("intArrayField1").Single(); 141var vbStringArrayField1 = (IFieldSymbol)vbType.GetMembers("stringArrayField1").Single(); 142var vbIntArrayArrayField1 = (IFieldSymbol)vbType.GetMembers("intArrayArrayField1").Single(); 143var vbIntArrayRank2Field1 = (IFieldSymbol)vbType.GetMembers("intArrayRank2Field1").Single(); 144var vbInt32Field1 = (IFieldSymbol)vbType.GetMembers("int32Field1").Single(); 203var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 204var type2_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 205var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 206var type2_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 208var field1_v1 = type1_v1.GetMembers("field1").Single(); 209var field1_v2 = type1_v2.GetMembers("field1").Single(); 210var field2_v1 = type1_v1.GetMembers("field2").Single(); 211var field2_v2 = type2_v2.GetMembers("field2").Single(); 212var field3_v1 = type2_v1.GetMembers("field3").Single(); 213var field3_v2 = type2_v2.GetMembers("field3").Single(); 214var field4_v1 = type2_v1.GetMembers("field4").Single(); 215var field4_v2 = type1_v2.GetMembers("field4").Single(); 258var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 259var type2_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 260var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 261var type2_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 263var field1_v1 = type1_v1.GetMembers("field1").Single(); 264var field1_v2 = type1_v2.GetMembers("field1").Single(); 265var field2_v1 = type1_v1.GetMembers("field2").Single(); 266var field2_v2 = type2_v2.GetMembers("field2").Single(); 267var field3_v1 = type2_v1.GetMembers("field3").Single(); 268var field3_v2 = type2_v2.GetMembers("field3").Single(); 269var field4_v1 = type2_v1.GetMembers("field4").Single(); 270var field4_v2 = type1_v2.GetMembers("field4").Single(); 298var typeC = (await workspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 299var typeD = (await workspace.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("D").Single(); 301var intInstantiation1 = (IFieldSymbol)typeC.GetMembers("intInstantiation1").Single(); 302var stringInstantiation = (IFieldSymbol)typeC.GetMembers("stringInstantiation").Single(); 303var instanceInstantiation = (IFieldSymbol)typeC.GetMembers("instanceInstantiation").Single(); 304var intInstantiation2 = (IFieldSymbol)typeD.GetMembers("intInstantiation2").Single(); 306var goo = typeC.GetMembers("goo").Single(); 307var goo_intInstantiation1 = intInstantiation1.Type.GetMembers("goo").Single(); 308var goo_stringInstantiation = stringInstantiation.Type.GetMembers("goo").Single(); 309var goo_instanceInstantiation = instanceInstantiation.Type.GetMembers("goo").Single(); 310var goo_intInstantiation2 = intInstantiation2.Type.GetMembers("goo").Single(); 346var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 347var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 349var method_v1 = type1_v1.GetMembers("Goo").Single(); 350var method_v2 = type1_v2.GetMembers("Goo").Single(); 375var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 376var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 378var method_v1 = type1_v1.GetMembers("Goo").Single(); 379var method_v2 = type1_v2.GetMembers("Goo1").Single(); 404var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 405var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 407var method_v1 = type1_v1.GetMembers("Goo").Single(); 408var method_v2 = type1_v2.GetMembers("Goo").Single(); 433var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 434var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 436var method_v1 = type1_v1.GetMembers("Goo").Single(); 437var method_v2 = type1_v2.GetMembers("Goo").Single(); 462var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 463var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 465var method_v1 = type1_v1.GetMembers("Goo").Single(); 466var method_v2 = type1_v2.GetMembers("Goo").Single(); 493var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 494var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 496var method_v1 = type1_v1.GetMembers("Goo").Single(); 497var method_v2 = type1_v2.GetMembers("Goo").Single(); 524var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 525var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 527var method_v1 = type1_v1.GetMembers("Goo").Single(); 528var method_v2 = type1_v2.GetMembers("Goo").Single(); 555var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 556var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 558var method_v1 = type1_v1.GetMembers("Goo").Single(); 559var method_v2 = type1_v2.GetMembers("Goo").Single(); 584var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 585var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 587var method_v1 = type1_v1.GetMembers("Goo").Single(); 588var method_v2 = type1_v2.GetMembers("Goo").Single(); 613var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 614var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 616var method_v1 = type1_v1.GetMembers("Goo").Single(); 617var method_v2 = type1_v2.GetMembers("Goo").Single(); 644var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 645var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 647var method_v1 = type1_v1.GetMembers("Goo").Single(); 648var method_v2 = type1_v2.GetMembers("Goo").Single(); 680var csharpType1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 681var vbType1 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 683var csharpGooMethod = csharpType1.GetMembers("Goo").Single(); 684var csharpBarMethod = csharpType1.GetMembers("Bar").Single(); 685var vbGooMethod = vbType1.GetMembers("Goo").Single(); 686var vbQuuxMethod = vbType1.GetMembers("Quux").Single(); 727var csharpType1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 728var vbType1 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 730var csharpGooMethod = csharpType1.GetMembers("Goo").Single(); 731var csharpBarMethod = csharpType1.GetMembers("Bar").Single(); 732var vbGooMethod = vbType1.GetMembers("Goo").Single(); 733var vbBarMethod = vbType1.GetMembers("Bar").Single(); 760var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 762var field1_v1 = type1_v1.GetMembers("field1").Single(); 763var field2_v1 = type1_v1.GetMembers("field2").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(); 827var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 828var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 830var method_v1 = type1_v1.GetMembers("Goo").Single(); 831var method_v2 = type1_v2.GetMembers("Goo").Single(); 862var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 863var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 865var method_v1 = type1_v1.GetMembers("Goo").Single(); 866var method_v2 = type1_v2.GetMembers("Goo").Single(); 899var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 900var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 902var method_v1 = type1_v1.GetMembers("Goo").Single(); 903var method_v2 = type1_v2.GetMembers("Goo").Single(); 937var outerType1 = outer1.GetTypeMembers("Type").Single(); 938var outerType2 = outer2.GetTypeMembers("Type").Single(); 940var innerType1 = inner1.GetTypeMembers("Type").Single(); 941var innerType2 = inner2.GetTypeMembers("Type").Single(); 1009var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1010var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1011var type2_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 1012var type2_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 1048var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1049var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type2").Single(); 1075var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1076var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1102var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1103var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1135var outer = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Outer").Single(); 1136var other = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Other").Single(); 1137var type1_v1 = outer.GetTypeMembers("Type1").Single(); 1138var type1_v2 = other.GetTypeMembers("Type1").Single(); 1167var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1168var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("Type1").Single(); 1170var method_v1 = type1_v1.GetMembers("Goo").Single(); 1171var method_v2 = type1_v2.GetMembers("Goo").Single(); 1200var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1201var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1203var method_v1 = type1_v1.GetMembers("M").Single(); 1204var method_v2 = type1_v2.GetMembers("M").Single(); 1242var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1243var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1245var method_v1 = type1_v1.GetMembers("M").Single(); 1246var 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(); 1339var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1340var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1342var method_v1 = type1_v1.GetMembers("M").Single(); 1343var method_v2 = type1_v2.GetMembers("M").Single(); 1372var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1373var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1375var method_v1 = type1_v1.GetMembers("M").Single(); 1376var method_v2 = type1_v2.GetMembers("M").Single(); 1406var type1_v1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1407var type1_v2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("C").Single(); 1409var method_v1 = type1_v1.GetMembers("M").Single(); 1410var method_v2 = type1_v2.GetMembers("M").Single(); 1445var t1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1446var t2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1448var a1 = ((IFieldSymbol)t1.GetMembers("A").Single()).Type; 1449var b1 = ((IFieldSymbol)t1.GetMembers("B").Single()).Type; 1450var c1 = ((IFieldSymbol)t1.GetMembers("C").Single()).Type; 1451var d1 = ((IFieldSymbol)t1.GetMembers("D").Single()).Type; 1452var a2 = ((IFieldSymbol)t2.GetMembers("A").Single()).Type; 1453var b2 = ((IFieldSymbol)t2.GetMembers("B").Single()).Type; 1454var c2 = ((IFieldSymbol)t2.GetMembers("C").Single()).Type; 1455var d2 = ((IFieldSymbol)t2.GetMembers("D").Single()).Type; 1511var t1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1512var t2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1514var a1 = ((IFieldSymbol)t1.GetMembers("A").Single()).Type; 1515var b1 = ((IFieldSymbol)t1.GetMembers("B").Single()).Type; 1516var c1 = ((IFieldSymbol)t1.GetMembers("C").Single()).Type; 1517var d1 = ((IFieldSymbol)t1.GetMembers("D").Single()).Type; 1518var a2 = ((IFieldSymbol)t2.GetMembers("A").Single()).Type; 1519var b2 = ((IFieldSymbol)t2.GetMembers("B").Single()).Type; 1520var c2 = ((IFieldSymbol)t2.GetMembers("C").Single()).Type; 1521var d2 = ((IFieldSymbol)t2.GetMembers("D").Single()).Type; 1576var t1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1577var t2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1579var a1 = ((IFieldSymbol)t1.GetMembers("A").Single()).Type; 1580var b1 = ((IFieldSymbol)t1.GetMembers("B").Single()).Type; 1581var c1 = ((IFieldSymbol)t1.GetMembers("C").Single()).Type; 1582var d1 = ((IFieldSymbol)t1.GetMembers("D").Single()).Type; 1583var a2 = ((IFieldSymbol)t2.GetMembers("A").Single()).Type; 1584var b2 = ((IFieldSymbol)t2.GetMembers("B").Single()).Type; 1585var c2 = ((IFieldSymbol)t2.GetMembers("C").Single()).Type; 1586var d2 = ((IFieldSymbol)t2.GetMembers("D").Single()).Type; 1641var t1 = (await workspace1.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1642var t2 = (await workspace2.CurrentSolution.Projects.Single().GetCompilationAsync()).GlobalNamespace.GetTypeMembers("T").Single(); 1644var a1 = ((IFieldSymbol)t1.GetMembers("A").Single()).Type; 1645var b1 = ((IFieldSymbol)t1.GetMembers("B").Single()).Type; 1646var c1 = ((IFieldSymbol)t1.GetMembers("C").Single()).Type; 1647var d1 = ((IFieldSymbol)t1.GetMembers("D").Single()).Type; 1648var a2 = ((IFieldSymbol)t2.GetMembers("A").Single()).Type; 1649var b2 = ((IFieldSymbol)t2.GetMembers("B").Single()).Type; 1650var c2 = ((IFieldSymbol)t2.GetMembers("C").Single()).Type; 1651var d2 = ((IFieldSymbol)t2.GetMembers("D").Single()).Type; 1997var type1 = compilation.GlobalNamespace.GetTypeMembers(typeName).Single(); 1998var method = type1.GetMembers(methodName).Single();
ValueTracking\CSharpValueTrackingTests.cs (26)
255initialItems.Single(), 398initialItems.Single(), 539initialItems.Single(), 595children.Single(), 666ValidateItem(initialItems.Single(), 18, "x"); // |> return [|x|] [Code.cs:18] 670initialItems.Single(), 749ValidateItem(initialItems.Single(), 20, "i"); 753initialItems.Single(), 773await ValidateChildrenEmptyAsync(workspace, children.Single()); 815items.Single(), 823items.Single(), 831items.Single(), 837await ValidateChildrenEmptyAsync(workspace, items.Single()); 879items.Single(), 887items.Single(), 895items.Single(), 901await ValidateChildrenEmptyAsync(workspace, items.Single()); 947items.Single(), 966items.Single(), 972await ValidateChildrenEmptyAsync(workspace, items.Single()); 1018items.Single(), 1037items.Single(), 1043await ValidateChildrenEmptyAsync(workspace, items.Single()); 1082items.Single(), 1140items.Single(), 1146await ValidateChildrenEmptyAsync(workspace, items.Single());
ValueTracking\VisualBasicValueTrackingTests.cs (14)
105items.Single(), 111await ValidateChildrenEmptyAsync(workspace, childItems.Single()); 244items.Single(), 252items.Single(), 260items.Single(), 266await ValidateChildrenEmptyAsync(workspace, items.Single()); 305items.Single(), 313items.Single(), 321items.Single(), 327await ValidateChildrenEmptyAsync(workspace, items.Single()); 368items.Single(), 376items.Single(), 384items.Single(), 390await ValidateChildrenEmptyAsync(workspace, items.Single());
Microsoft.CodeAnalysis.Extensions.Package (1)
Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
70return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);
Microsoft.CodeAnalysis.Features (18)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.cs (2)
101actions.Add(result.RequiredParameterActions.Single()); 104actions.Add(result.OptionalParameterActions.Single());
Completion\CompletionChange.cs (1)
95return new CompletionChange(textChanges.Single(), textChanges, newPosition, includesCommitCharacter);
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (1)
69type = type.GetTypeArguments().Single();
ConvertLinq\ConvertForEachToLinqQuery\AbstractConvertForEachToLinqQueryProvider.cs (1)
171TryBuildSpecificConverter(forEachInfo, semanticModel, forEachInfo.Statements.Single(), cancellationToken, out converter))
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
5226return attribute.ConstructorArguments.Single().Value switch
EmbeddedLanguages\Json\JsonParser.cs (1)
189var child = sequence.Single();
ExtractMethod\MethodExtractor.Analyzer.cs (1)
191return returnType.GetTypeArguments().Single();
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
433var (parameterSymbol, name) = methodParametersInfo.ParametersWithVariableDeclarationArgument.Single();
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (1)
66var destinationDocId = _document.Project.Solution.GetDocumentIdsWithFilePath(moveOptions.FilePath).Single();
PullMemberUp\AbstractPullMemberUpRefactoringProvider.cs (1)
63? string.Format(FeaturesResources.Pull_0_up_to, selectedMembers.Single().ToNameDisplayString())
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)
482var getterField = getterFields.TrivialField ?? getterFields.NonTrivialFields.Single();
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
242var parameter = method.Parameters.Single();
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
921var local = localDeclarationOperation.GetDeclaredVariables().Single();
Microsoft.CodeAnalysis.Features.UnitTests (72)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (60)
453Assert.Empty(asSpans.Single()); 1890var additionalText = context.AdditionalFiles.Single().GetText().ToString(); 1951Assert.Contains("System.InvalidOperationException: Source generator failed", generatorDiagnostics.Single().GetMessage()); 2186var delta = updates.Updates.Single(); 2595ValidateDelta(updates.Updates.Single()); 2604Assert.Equal(0x06000001, delta.UpdatedMethods.Single()); 2605Assert.Equal(0x02000002, delta.UpdatedTypes.Single()); 2613var newBaseline = pendingUpdate.ProjectBaselines.Single(); 2658ValidateDelta(updates.Updates.Single()); 2735var delta = updates.Updates.Single(); 2740Assert.Equal(0x06000002, delta.UpdatedMethods.Single()); 2741Assert.Equal(0x02000002, delta.UpdatedTypes.Single()); 2748var newBaseline = pendingUpdate.ProjectBaselines.Single(); 2854var delta = updates.Updates.Single(); 2939var delta = results.ModuleUpdates.Updates.Single(); 3091var delta = updates.Updates.Single(); 3206var delta = updates.Updates.Single(); 3209var lineUpdate = delta.SequencePoints.Single(); 3256var delta = updates.Updates.Single(); 3262Assert.Equal(0x02000002, delta.UpdatedTypes.Single()); 3308var delta = updates.Updates.Single(); 3314Assert.Equal(0x02000003, delta.UpdatedTypes.Single()); 3354var delta = updates.Updates.Single(); 3360Assert.Equal(0x02000003, delta.UpdatedTypes.Single()); 3395var delta = updates.Updates.Single(); 3401Assert.Equal(0x02000002, delta.UpdatedTypes.Single()); 3919], baseSpans.Single()); 3987var baseSpans = (await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [documentId], CancellationToken.None)).Single(); 4039Assert.Empty(baseSpans.Single()); 4045Assert.Empty(baseSpans.Single()); 4227AssertEx.Equal([$"(9,18)-(9,22)"], baseSpans.Single().Select(s => s.LineSpan.ToString())); 4234AssertEx.Equal([$"(10,12)-(10,16)"], baseSpans.Single().Select(s => s.LineSpan.ToString())); 4311var delta = updates.Updates.Single(); 4481Assert.Equal(0x06000003, updates.Updates.Single().UpdatedMethods.Single()); 4482Assert.Equal(0x02000002, updates.Updates.Single().UpdatedTypes.Single()); 4501Assert.Equal(0x06000003, updates.Updates.Single().UpdatedMethods.Single()); 4502Assert.Equal(0x02000002, updates.Updates.Single().UpdatedTypes.Single()); 4527var spans = (await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [documentId], CancellationToken.None)).Single(); 4537Assert.Equal(0x06000003, updates.Updates.Single().UpdatedMethods.Single()); 4538Assert.Equal(0x02000002, updates.Updates.Single().UpdatedTypes.Single()); 4616var spans = (await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [documentId], CancellationToken.None)).Single(); 4642spans = (await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [documentId], CancellationToken.None)).Single(); 4656Assert.Equal(0x06000003, updates.Updates.Single().UpdatedMethods.Single()); 4657Assert.Equal(0x02000002, updates.Updates.Single().UpdatedTypes.Single()); 4718Assert.Equal(0x06000003, updates.Updates.Single().UpdatedMethods.Single()); 4719Assert.Equal(0x02000002, updates.Updates.Single().UpdatedTypes.Single()); 4740var spans = (await debuggingSession.GetBaseActiveStatementSpansAsync(solution, [documentId], CancellationToken.None)).Single(); 4880Assert.Equal("CS0103", result2.Diagnostics.Single().Diagnostics.Single().Id); 4957var update = updates.Updates.Single();
EditAndContinue\RemoteEditAndContinueServiceTests.cs (9)
164var activeStatement = (await remoteDebuggeeModuleMetadataProvider!.GetActiveStatementsAsync(CancellationToken.None)).Single(); 227var delta = results.ModuleUpdates.Updates.Single(); 235var lineEdit = delta.SequencePoints.Single(); 238Assert.Equal(exceptionRegionUpdate1, delta.ExceptionRegions.Single()); 240var activeStatements = delta.ActiveStatements.Single(); 267Assert.Equal(activeStatementSpan1, baseActiveSpans.Single().Single()); 281Assert.Equal(activeStatementSpan1, documentActiveSpans.Single()); 295Assert.Equal(diagnostic.GetMessage(), (await proxy.GetDocumentDiagnosticsAsync(document, activeStatementSpanProvider, CancellationToken.None)).Single().Message);
FindUsages\DefinitionItemFactoryTests.cs (3)
939var p = c.GetTypeParameters().Single(); 1345var p = m.GetParameters().Single(); 1405var p = m.GetTypeParameters().Single();
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Extensions\ProtocolConversions.cs (1)
479var mappedSpan = result.Value.Single();
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (101)
Diagnostics\DiagnosticsPullCacheTests.cs (6)
51Assert.Null(results.Single().Diagnostics); 52Assert.Equal(results[0].ResultId, results.Single().ResultId); 82Assert.Null(results.Single().Diagnostics); 83Assert.Equal(results[0].ResultId, results.Single().ResultId); 110Assert.Null(results.Single().Diagnostics); 111Assert.Equal(results[0].ResultId, results.Single().ResultId);
Diagnostics\NonLocalDiagnosticTests.cs (1)
54var results2 = await RunGetDocumentPullDiagnosticsAsync(testLspServer, document.GetURI(), useVSDiagnostics: false, previousResultId: results.Single().ResultId, category: PublicDocumentNonLocalDiagnosticSourceProvider.NonLocal);
Diagnostics\PullDiagnosticTests.cs (90)
70Assert.Equal("CS1513", results.Single().Diagnostics!.Single().Code); 71Assert.NotNull(results.Single().Diagnostics!.Single().CodeDescription!.Href.ParsedUri); 93Assert.Equal("CS1513", syntaxResults.Single().Diagnostics!.Single().Code); 94Assert.Equal("CS0246", semanticResults.Single().Diagnostics!.Single().Code); 97testLspServer, document.GetURI(), useVSDiagnostics, previousResultId: syntaxResults.Single().ResultId, category: PullDiagnosticCategories.DocumentCompilerSyntax); 99testLspServer, document.GetURI(), useVSDiagnostics, previousResultId: semanticResults.Single().ResultId, category: PullDiagnosticCategories.DocumentCompilerSemantic); 101Assert.Equal(syntaxResults.Single().ResultId, syntaxResults2.Single().ResultId); 102Assert.Equal(semanticResults.Single().ResultId, semanticResults2.Single().ResultId); 110Assert.Equal(CSharpSyntaxAnalyzer.RuleId, syntaxAnalyzerResults.Single().Diagnostics!.Single().Code); 111Assert.Equal(CSharpSemanticAnalyzer.RuleId, semanticAnalyzerResults.Single().Diagnostics!.Single().Code); 114testLspServer, document.GetURI(), useVSDiagnostics, previousResultId: syntaxAnalyzerResults.Single().ResultId, category: PullDiagnosticCategories.DocumentAnalyzerSyntax); 116testLspServer, document.GetURI(), useVSDiagnostics, previousResultId: semanticAnalyzerResults.Single().ResultId, category: PullDiagnosticCategories.DocumentAnalyzerSemantic); 118Assert.Equal(syntaxAnalyzerResults.Single().ResultId, syntaxAnalyzerResults2.Single().ResultId); 119Assert.Equal(semanticAnalyzerResults.Single().ResultId, semanticAnalyzerResults2.Single().ResultId); 171Assert.Equal("IDE0060", results.Single().Diagnostics!.Single().Code); 172var vsDiagnostic = (VSDiagnostic)results.Single().Diagnostics!.Single(); 189Assert.Equal("CS1513", results.Single().Diagnostics!.Single().Code); 190var vsDiagnostic = (VSDiagnostic)results.Single().Diagnostics!.Single(); 212Assert.Equal("TODO", results.Single().Diagnostics!.Single().Code); 213Assert.Equal("todo: goo", results.Single().Diagnostics!.Single().Message); 227Assert.Equal("CS1513", results.Single().Diagnostics!.Single().Code); 246Assert.Equal("CS1513", results.Single().Diagnostics!.Single().Code); 252results = await RunGetDocumentPullDiagnosticsAsync(testLspServer, document.GetURI(), useVSDiagnostics, results.Single().ResultId).ConfigureAwait(false); 255Assert.Equal(useVSDiagnostics ? null : [], results.Single().Diagnostics); 256Assert.Null(results.Single().ResultId); 271Assert.Equal("CS1513", results.Single().Diagnostics!.Single().Code); 273var resultId = results.Single().ResultId; 277Assert.Null(results.Single().Diagnostics); 278Assert.Equal(resultId, results.Single().ResultId); 294Assert.Equal("CS1513", results.Single().Diagnostics!.Single().Code); 296var resultId = results.Single().ResultId; 306Assert.Equal(resultId, results.Single().ResultId); 325results = await RunGetDocumentPullDiagnosticsAsync(testLspServer, document.GetURI(), useVSDiagnostics, results.Single().ResultId); 370Assert.Equal("CS1513", results.Single().Diagnostics!.Single().Code); 371Assert.Equal(1, results.Single().Diagnostics!.Single().Range.Start.Line); 386Assert.Equal("CS1513", results!.Single().Diagnostics!.Single().Code); 428Assert.Equal("CS1513", results.Single().Diagnostics!.Single().Code); 432var vsDiagnostic = (LSP.VSDiagnostic)results.Single().Diagnostics!.Single(); 439Assert.Equal(2, results.Single().Diagnostics!.Length); 440AssertEx.All(results.Single().Diagnostics, d => Assert.Equal("CS1513", d.Code)); 444AssertEx.All(results.Single().Diagnostics, d => Assert.Equal("CSProj1", ((VSDiagnostic)d).Projects!.Single().ProjectName)); 473var csproj1Diagnostic = (VSDiagnostic)csproj1Results.Single().Diagnostics!.Single(); 475var csproj2Diagnostic = (VSDiagnostic)csproj2Results.Single().Diagnostics!.Single(); 534Assert.Equal("CS0246", results.Single().Diagnostics!.Single().Code); 539var originalResultId = results.Single().ResultId; 542AssertEx.Empty(results.Single().Diagnostics); 543Assert.NotEqual(originalResultId, results.Single().ResultId); 586Assert.Equal("CS0246", results.Single().Diagnostics!.Single().Code); 592var originalResultId = results.Single().ResultId; 595Assert.Null(results.Single().Diagnostics); 596Assert.Equal(originalResultId, results.Single().ResultId); 615Assert.Equal("CS1513", results.Single().Diagnostics!.Single().Code); 616Assert.NotNull(results.Single().Diagnostics!.Single().CodeDescription!.Href.ParsedUri); 635Assert.Equal("CS1513", results.Single().Diagnostics!.Single().Code); 636Assert.NotNull(results.Single().Diagnostics!.Single().CodeDescription!.Href.ParsedUri); 683var diagnostic = AssertEx.Single(results.Single().Diagnostics); 711Assert.Empty(results.Single().Diagnostics!); 716diagnostic = AssertEx.Single(results.Single().Diagnostics); 723Assert.Empty(results.Single().Diagnostics!); 750var diagnostic = AssertEx.Single(results.Single().Diagnostics); 779Assert.True(results.Single().Diagnostics![0].Tags!.Contains(DiagnosticTag.Unnecessary)); 780Assert.Equal(firstLocation, results.Single().Diagnostics![1].Range); 783Assert.False(results.Single().Diagnostics![1].Tags!.Contains(DiagnosticTag.Unnecessary)); 784Assert.Equal(firstLocation, results.Single().Diagnostics![1].Range); 789Assert.True(results.Single().Diagnostics![0].Tags!.Contains(DiagnosticTag.Unnecessary)); 790Assert.Equal(firstLocation, results.Single().Diagnostics![0].Range); 816AssertEx.All(results.Single().Diagnostics, d => Assert.False(d.Tags!.Contains(DiagnosticTag.Unnecessary))); 848Assert.False(results.Single().Diagnostics![0].Tags!.Contains(DiagnosticTag.Unnecessary)); 849Assert.Equal(lineLocation, results.Single().Diagnostics![0].Range); 852Assert.True(results.Single().Diagnostics![1].Tags!.Contains(DiagnosticTag.Unnecessary)); 853Assert.Equal(openLocation, results.Single().Diagnostics![1].Range); 856Assert.True(results.Single().Diagnostics![2].Tags!.Contains(DiagnosticTag.Unnecessary)); 857Assert.Equal(closeLocation, results.Single().Diagnostics![2].Range); 862Assert.True(results.Single().Diagnostics!.Single().Tags!.Contains(DiagnosticTag.Unnecessary)); 863Assert.Equal(lineLocation, results.Single().Diagnostics!.Single().Range); 866Assert.Equal(openLocation, results.Single().Diagnostics!.Single().RelatedInformation![0].Location.Range); 869Assert.Equal(closeLocation, results.Single().Diagnostics!.Single().RelatedInformation![1].Location.Range); 886Assert.Equal(IDEDiagnosticIds.RemoveUnnecessarySuppressionDiagnosticId, results.Single().Diagnostics!.Single().Code); 912AssertEx.Empty(results.Single().Diagnostics); 934Assert.Equal("IDE0090", results.Single().Diagnostics!.Single().Code); 935Assert.Equal(LSP.DiagnosticSeverity.Information, results.Single().Diagnostics!.Single().Severity); 965Assert.Equal("CS1513", results.Single().Diagnostics!.Single().Code); 966Assert.NotNull(results.Single().Diagnostics!.Single().CodeDescription!.Href.ParsedUri); 1252AssertEx.Empty(results.Single().Diagnostics); 1321testLspServer, openDocument.GetURI(), previousResultId: documentResults1.Single().ResultId, useVSDiagnostics: useVSDiagnostics, category: PullDiagnosticCategories.EditAndContinue); 1342testLspServer, openDocument.GetURI(), previousResultId: documentResults2.Single().ResultId, useVSDiagnostics: useVSDiagnostics, category: PullDiagnosticCategories.EditAndContinue);
DocumentChanges\DocumentChangesTests.cs (2)
43var document = testLspServer.GetTrackedTexts().Single(); 48document = testLspServer.GetTrackedTexts().Single();
MapCode\MapCodeTests.cs (2)
38var newText = text.Replace(focusLocations.Single().Item2, contents.Single());
Microsoft.CodeAnalysis.LanguageServer.UnitTests (1)
VirtualProjectXmlProviderTests.cs (1)
181var diagnostic = content.Diagnostics.Single();
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
192var typeArgument = typeArguments.Single().ToDisplayParts().Last().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
70return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);
Microsoft.CodeAnalysis.PublicApiAnalyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
192var typeArgument = typeArguments.Single().ToDisplayParts().Last().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
70return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
192var typeArgument = typeArguments.Single().ToDisplayParts().Last().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
70return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);
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 (6)
Collections\Extensions\ImmutableArrayExtensionsTests.cs (4)
142Assert.Throws<NullReferenceException>(() => default(ImmutableArray<int>).Single()); 143Assert.Throws<InvalidOperationException>(() => ImmutableArray.Create<int>().Single()); 144Assert.Equal(1, ImmutableArray.Create<int>(1).Single()); 145Assert.Throws<InvalidOperationException>(() => ImmutableArray.Create<int>(1, 2).Single());
Emit\SemanticEditTests.cs (1)
26var method = type!.Constructors.Single();
Symbols\DocumentationCommentIdTests.cs (1)
174var tree = comp.SyntaxTrees.Single();
Microsoft.CodeAnalysis.Workspaces (7)
Recommendations\AbstractRecommendationServiceRunner.cs (1)
81if (owningMethod.DeclaringSyntaxReferences.Single().GetSyntax(_cancellationToken) is not TAnonymousFunctionSyntax lambdaSyntax)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (3)
182var location = originalSymbol.Locations.Single(); 273var aliasLocation = location.Alias.Locations.Single(); 296var aliasLocation = location.Alias.Locations.Single();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
192var typeArgument = typeArguments.Single().ToDisplayParts().Last().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
70return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (1)
801projectUpdateState = ConvertMetadataReferencesToProjectReferences_NoLock(solutionChanges, distinctRemainingProjects.Single(), outputPath, projectUpdateState);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
NetCoreTests.cs (1)
114var projectFileInfo = (await projectFile.GetProjectFileInfosAsync(CancellationToken.None)).Single();
VisualStudioMSBuildWorkspaceTests.cs (1)
3113var projectFileInfo = (await projectFile.GetProjectFileInfosAsync(CancellationToken.None)).Single();
Microsoft.CodeAnalysis.Workspaces.UnitTests (43)
FindReferencesTests.cs (5)
459var nameProperty = compilation.GetTypeByMetadataName("A.C").GetMembers("Uri").Single(); 507var baseVirtualMethodSymbol = baseType.GetMembers("SomeMethod").Single(); 511var overriddenMethodSymbol = derivedType.GetMembers("SomeMethod").Single(); 544var constraint = comp.GetTypeByMetadataName("C`1").TypeParameters.Single().ConstraintTypes.Single();
Options\EditorConfigNamingStyleParserTests.cs (21)
32var namingRule = result.SerializableNamingRules.Single(); 34var namingStyle = result.NamingStyles.Single(); 36var symbolSpec = result.SymbolSpecifications.Single(); 102var namingRule = result.SerializableNamingRules.Single(); 104var namingStyle = result.NamingStyles.Single(); 106var symbolSpec = result.SymbolSpecifications.Single(); 160var namingRule = result.SerializableNamingRules.Single(); 162var namingStyle = result.NamingStyles.Single(); 164var symbolSpec = result.SymbolSpecifications.Single(); 208var namingRule = result.SerializableNamingRules.Single(); 210var namingStyle = result.NamingStyles.Single(); 212var symbolSpec = result.SymbolSpecifications.Single(); 250var namingRule = result.SerializableNamingRules.Single(); 252var namingStyle = result.NamingStyles.Single(); 255var symbolSpec = result.SymbolSpecifications.Single(); 293var namingRule = result.SerializableNamingRules.Single(); 295var namingStyle = result.NamingStyles.Single(); 298var symbolSpec = result.SymbolSpecifications.Single(); 439var namingRule = result.SerializableNamingRules.Single(); 441var namingStyle = result.NamingStyles.Single(); 443var symbolSpec = result.SymbolSpecifications.Single();
SolutionTests\DocumentInfoTests.cs (1)
75Assert.Equal("folder", ((ImmutableArray<string>)info1.Folders).Single());
SolutionTests\ProjectInfoTests.cs (5)
77Assert.Same(documentInfo, ((ImmutableArray<DocumentInfo>)info1.Documents).Single()); 96Assert.Same(documentInfo, ((ImmutableArray<DocumentInfo>)info1.AdditionalDocuments).Single()); 115Assert.Same(projectReference, ((ImmutableArray<ProjectReference>)info1.ProjectReferences).Single()); 134Assert.Same(metadataReference, ((ImmutableArray<MetadataReference>)info1.MetadataReferences).Single()); 153Assert.Same(analyzerReference, ((ImmutableArray<AnalyzerReference>)info1.AnalyzerReferences).Single());
SolutionTests\SolutionInfoTests.cs (1)
35Assert.Same(projectInfo, ((ImmutableArray<ProjectInfo>)info1.Projects).Single());
SolutionTests\SolutionWithSourceGeneratorTests.cs (1)
827Assert.Equal(document.GetLinkedDocumentIds().Single(), documentIdsToTest.Except([documentIdToTest]).Single());
SymbolKeyTests.cs (9)
405var b = ((IMethodSymbol)compilation1.GlobalNamespace.GetTypeMembers("C").Single().GetMembers("M").Single()).Parameters[1]; 429var b = ((IMethodSymbol)compilation1.GlobalNamespace.GetTypeMembers("C").Single().GetMembers("M").Single()).Parameters[1]; 749var inner = constructed.GetTypeMembers().Single(); 772var a_b = a.GetTypeMembers().Single(); 780var a_string_b = a_string.GetTypeMembers().Single(); 814var typeParameter = GetDeclaredSymbols(compilation).OfType<INamedTypeSymbol>().Where(n => !n.IsImplicitlyDeclared).Single().TypeParameters.Single(); 828.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();
Microsoft.VisualStudio.LanguageServices.CSharp (2)
ProjectSystemShim\CSharpProjectShim.ICSharpProjectSite.cs (2)
85ProjectSystemProject.RemoveMetadataReference(filename, properties: ProjectSystemProject.GetPropertiesForMetadataReference(filename).Single()); 172var existingProperties = ProjectSystemProject.GetPropertiesForMetadataReference(file).Single();
Roslyn.Diagnostics.Analyzers (4)
AbstractDoNotCopyValue.cs (1)
1283var symbol = operation.Declarators.Single().Symbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
192var typeArgument = typeArguments.Single().ToDisplayParts().Last().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
70return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);
TemporaryArrayAsRefAnalyzer.cs (1)
69var declaration = invocation.SemanticModel!.GetOperation(localReference.Local.DeclaringSyntaxReferences.Single().GetSyntax(context.CancellationToken), context.CancellationToken);
Roslyn.Diagnostics.CSharp.Analyzers (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (3)
1040return collectionTargetType.GetTypeArguments().Single(); 1044return collectionTargetType.GetTypeArguments().Single(); 1049return iface.TypeArguments.Single();
Roslyn.Test.PdbUtilities (1)
EditAndContinue\EditAndContinueTest.GenerationVerifier.cs (1)
169var updatedMethodToken = updatedMethods.Single();
Test.Utilities (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
192var typeArgument = typeArguments.Single().ToDisplayParts().Last().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
70return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);
Text.Analyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
192var typeArgument = typeArguments.Single().ToDisplayParts().Last().ToString();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
70return AreEquivalent(array.ElementType, readOnlySpanType.TypeArguments.Single(), equivalentTypesWithDifferingAssemblies);