2539 references to First
Aspire.Components.Common.Tests (2)
ConformanceTests.cs (1)
345Assert.Equal(error, detail.Errors!.First().Value);
RequiresToolsDiscoverer.cs (1)
14string[] executablesOnPath = (string[])traitAttribute.GetConstructorArguments().First();
Aspire.Dashboard (1)
Components\Controls\Chart\MetricTable.razor.cs (1)
116_unitColumnHeader = traces.First().Name;
Aspire.Dashboard.Tests (3)
Integration\MockOpenIdAuthority.cs (1)
122var authorityUrl = serverAddress.Addresses.First().Replace("127.0.0.1", "localhost");
TelemetryRepositoryTests\LogTests.cs (1)
765var applicationKey = repository.GetApplications().First().ApplicationKey;
TelemetryRepositoryTests\TraceTests.cs (1)
945var first = GetStringId(traces.PagedResult.Items.First().TraceId);
Aspire.Hosting (1)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (1)
114launchProfileName = launchSettings.Profiles.Keys.First();
Aspire.Hosting.AWS (1)
CDK\Utils\ResourceExtensions.cs (1)
25stackArtifact = annotations.First().StackArtifact;
Aspire.Hosting.Azure (1)
AzureProvisioningResource.cs (1)
62var compiledBicep = compilation.First();
Aspire.Hosting.Azure.Functions (1)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (1)
114launchProfileName = launchSettings.Profiles.Keys.First();
Aspire.Hosting.Azure.Tests (2)
AzureCosmosDBEmulatorFunctionalTests.cs (2)
115Assert.True(results.First() == 1); 237Assert.True(results.First() == testObject.data);
Aspire.Hosting.Redis.Tests (2)
RedisFunctionalTests.cs (2)
334await redisClient.GetServers().First().SaveAsync(SaveType.BackgroundSave); 420await redisClient.GetServers().First().SaveAsync(SaveType.BackgroundSave);
Aspire.Hosting.Tests (4)
DistributedApplicationTests.cs (2)
125Assert.IsType<DistributedApplicationException>(ex.InnerExceptions.First()); 126Assert.Equal(exceptionMessage, ex.InnerExceptions.First().Message);
Utils\WithAnnotationTests.cs (2)
21Assert.NotEqual(dummyAnnotations.First(), dummyAnnotations.Last()); 35Assert.NotEqual(dummyAnnotations.First(), dummyAnnotations.Last());
Aspire.Hosting.Valkey.Tests (1)
ValkeyFunctionalTests.cs (1)
117await redisClient.GetServers().First().SaveAsync(SaveType.BackgroundSave);
Aspire.Playground.Tests (1)
tests\Aspire.Components.Common.Tests\RequiresToolsDiscoverer.cs (1)
14string[] executablesOnPath = (string[])traitAttribute.GetConstructorArguments().First();
BasicWebSite (1)
Controllers\ContentNegotiation\FallbackOnTypeBasedMatchController.cs (1)
19_jsonOutputFormatter = mvcOptions.Value.OutputFormatters.OfType<NewtonsoftJsonOutputFormatter>().First();
blazor-devserver (1)
Server\Program.cs (1)
27var applicationPath = args.SkipWhile(a => a != "--applicationpath").Skip(1).First();
CodeGenerator (1)
src\Servers\Kestrel\shared\KnownHeaders.cs (1)
447.OrderBy(g => g.First(), KnownHeaderComparer.Instance)
Contract.Data.IntegrationTests (1)
DataContractTests.4.1.1.cs (1)
41var manager = results.First();
CSharpSyntaxGenerator (3)
Grammar\GrammarGenerator.cs (1)
42if (type.Children.First() is Field firstField && firstField.Kinds.Count > 0)
SourceWriter.cs (1)
1124if (field == node.Fields.First())
TestWriter.cs (1)
192type = subTypes.First();
CustomAuthorizationFailureResponse (1)
Authorization\SampleAuthorizationMiddlewareResultHandler.cs (1)
36await httpContext.Response.WriteAsync(policyAuthorizationResult.AuthorizationFailure.FailureReasons.First().Message);
dotnet-dev-certs (2)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
215certificate = certificates.First(); 257certificate = certificates.First();
dotnet-openapi (2)
Commands\BaseCommand.cs (1)
3981 or 2 => parts.First(), // It's localhost or somewhere in an Intranet if 1; no www if 2.
HttpClientWrapper.cs (1)
61return new ContentDispositionHeaderValue(disposition.First());
dotnet-svcutil-lib (5)
CommandProcessorOptions.cs (1)
503paramsFilePath = paramsFiles.First();
Shared\MSBuildProj.cs (1)
625XElement propertyGroup = propertyGroupItems.First();
Shared\TargetFrameworkHelper.cs (2)
118public static Version MinSupportedNetStandardVersion { get; } = NetStandardToNetCoreVersionMap.Keys.First(); 119public static Version MinSupportedNetCoreAppVersion { get; } = NetStandardToNetCoreVersionMap.Values.First();
Tool.cs (1)
217var displayUri = serviceDescriptor.MetadataFiles.Count() == 1 ? serviceDescriptor.MetadataFiles.First().LocalPath : SR.WsdlOrSchemaFilesMsg;
dotnet-svcutil-lib.Tests (1)
TestInit.cs (1)
113var srcProgramPath = Directory.GetFiles(project.DirectoryPath, "*.cs", SearchOption.TopDirectoryOnly).First();
http2cat (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
63ip = Dns.GetHostEntry(address.Host).AddressList.First();
IdeBenchmarks (3)
FormatterBenchmarks.cs (2)
47var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id); 60var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
RegexClassifierBenchmarks.cs (1)
73var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
IdeCoreBenchmarks (2)
RenameBenchmarks.cs (1)
47var project = _solution.Projects.First();
SwitchStatementBenchmarks.cs (1)
74var project = solution.Projects.First();
IIS.FunctionalTests (8)
Http2TrailersResetTests.cs (2)
119Assert.Equal((2 * body.Length).ToString(CultureInfo.InvariantCulture), contentLength.First()); 137Assert.Equal(body.Length.ToString(CultureInfo.InvariantCulture), contentLength.First());
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (1)
245var sourceDirectory = new DirectoryInfo(Path.GetDirectoryName(moduleNodes.First().Attribute("image").Value));
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (3)
531Assert.Equal("test123=foo", headerValues.First()); 534Assert.Equal("text/plain", headerValues.First()); 538Assert.Equal("1", headerValues.First());
src\Servers\IIS\IIS\test\IIS.Shared.FunctionalTests\StdOutRedirectionTests.cs (1)
157var fileInDirectory = Directory.GetFiles(LogFolderPath).First();
src\Shared\Http2cat\Http2CatHostedService.cs (1)
63ip = Dns.GetHostEntry(address.Host).AddressList.First();
IIS.LongTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
63ip = Dns.GetHostEntry(address.Host).AddressList.First();
IIS.NewHandler.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
63ip = Dns.GetHostEntry(address.Host).AddressList.First();
IIS.NewShim.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
63ip = Dns.GetHostEntry(address.Host).AddressList.First();
IISExpress.FunctionalTests (5)
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (1)
245var sourceDirectory = new DirectoryInfo(Path.GetDirectoryName(moduleNodes.First().Attribute("image").Value));
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (3)
531Assert.Equal("test123=foo", headerValues.First()); 534Assert.Equal("text/plain", headerValues.First()); 538Assert.Equal("1", headerValues.First());
src\Shared\Http2cat\Http2CatHostedService.cs (1)
63ip = Dns.GetHostEntry(address.Host).AddressList.First();
installer.tasks (1)
StaticFileRegeneration\TpnDocument.cs (1)
54lines.Take(sections.First().Header.StartLine)),
Interop.FunctionalTests (2)
src\Servers\Kestrel\shared\test\TransportTestHelpers\IHostPortExtensions.cs (1)
19return host.GetPorts().First();
src\Servers\Kestrel\shared\test\TransportTestHelpers\IWebHostPortExtensions.cs (1)
15return host.GetPorts().First();
Microsoft.AspNetCore.Analyzers.Test (25)
MinimalStartupTest.cs (15)
179var optionsAnalysis = Analyses.OfType<OptionsAnalysis>().First(); 182var middlewareAnalysis = Analyses.OfType<MiddlewareAnalysis>().First(); 214var optionsAnalysis = Analyses.OfType<OptionsAnalysis>().First(); 217var middlewareAnalysis = Analyses.OfType<MiddlewareAnalysis>().First(); 268var optionsAnalysis = Analyses.OfType<OptionsAnalysis>().First(); 291var servicesAnalysis = Analyses.OfType<ServicesAnalysis>().First(); 340var middlewareAnalysis = Analyses.OfType<MiddlewareAnalysis>().First(); 365var middlewareAnalysis = Analyses.OfType<MiddlewareAnalysis>().First(); 416var middlewareAnalysis = Analyses.OfType<MiddlewareAnalysis>().First(); 443var middlewareAnalysis = Analyses.OfType<MiddlewareAnalysis>().First(); 502var middlewareAnalysis = Analyses.OfType<MiddlewareAnalysis>().First(); 543var optionsAnalysis = Analyses.OfType<OptionsAnalysis>().First(); 546var middlewareAnalysis = Analyses.OfType<MiddlewareAnalysis>().First(); 599var optionsAnalysis = Analyses.OfType<OptionsAnalysis>().First(); 602var middlewareAnalysis = Analyses.OfType<MiddlewareAnalysis>().First();
StartupAnalyzerTest.cs (10)
291var optionsAnalysis = Analyses.OfType<OptionsAnalysis>().First(); 294var middlewareAnalysis = Analyses.OfType<MiddlewareAnalysis>().First(); 339var optionsAnalysis = Analyses.OfType<OptionsAnalysis>().First(); 342var middlewareAnalysis = Analyses.OfType<MiddlewareAnalysis>().First(); 408var optionsAnalysis = Analyses.OfType<OptionsAnalysis>().First(); 442var servicesAnalysis = Analyses.OfType<ServicesAnalysis>().First(); 498var middlewareAnalysis = Analyses.OfType<MiddlewareAnalysis>().First(); 527var middlewareAnalysis = Analyses.OfType<MiddlewareAnalysis>().First(); 586var middlewareAnalysis = Analyses.OfType<MiddlewareAnalysis>().First(); 617var middlewareAnalysis = Analyses.OfType<MiddlewareAnalysis>().First();
Microsoft.AspNetCore.App.Analyzers.Test (5)
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (1)
108var firstMatch = orderedMatches.First();
TestDiagnosticAnalyzer.cs (4)
32var doc = project.Solution.GetDocument(project.Documents.First().Id); 41var source = sources.First(); 49var doc = project.Solution.GetDocument(project.Documents.First().Id); 71var document = project.Solution.GetDocument(project.Documents.First().Id);
Microsoft.AspNetCore.Authentication.Core (1)
AuthenticationSchemeProvider.cs (1)
216_autoDefaultScheme = Task.FromResult<AuthenticationScheme?>(_schemesCopy.First());
Microsoft.AspNetCore.Authentication.Core.Test (6)
AuthenticationPropertiesTests.cs (6)
173Assert.Equal(string.Empty, props.Items.First().Value); 187Assert.Equal("http://example.com", props.Items.First().Value); 201Assert.Equal("Wed, 21 Mar 2018 00:00:00 GMT", props.Items.First().Value); 215Assert.Equal("Mon, 19 Mar 2018 12:34:56 GMT", props.Items.First().Value); 229Assert.Equal("True", props.Items.First().Value); 233Assert.Equal("False", props.Items.First().Value);
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
52.Single(c => c.GetParameters().First().ParameterType == typeof(ConsoleSpecialKey));
Microsoft.AspNetCore.Authentication.Test (74)
CertificateTests.cs (20)
482Assert.Equal(Certificates.SelfSignedValidWithNoEku.Issuer, actual.First().Value); 486Assert.Equal(Certificates.SelfSignedValidWithNoEku.Thumbprint, actual.First().Value); 495Assert.Equal(Certificates.SelfSignedValidWithNoEku.SubjectName.Name, actual.First().Value); 505Assert.Equal(Certificates.SelfSignedValidWithNoEku.SerialNumber, actual.First().Value); 515Assert.Equal(Certificates.SelfSignedValidWithNoEku.GetNameInfo(X509NameType.DnsName, false), actual.First().Value); 525Assert.Equal(Certificates.SelfSignedValidWithNoEku.GetNameInfo(X509NameType.EmailName, false), actual.First().Value); 535Assert.Equal(Certificates.SelfSignedValidWithNoEku.GetNameInfo(X509NameType.SimpleName, false), actual.First().Value); 545Assert.Equal(Certificates.SelfSignedValidWithNoEku.GetNameInfo(X509NameType.UpnName, false), actual.First().Value); 555Assert.Equal(Certificates.SelfSignedValidWithNoEku.GetNameInfo(X509NameType.UrlName, false), actual.First().Value); 611Assert.Equal(Expected, name.First().Value); 614Assert.Equal("1", count.First().Value); 630Assert.Equal(Expected, name.First().Value); 634Assert.Equal(expected, count.First().Value); 681Assert.Equal(Expected, actual.First().Value); 738Assert.Equal(Expected, name.First().Value); 741Assert.Equal("1", count.First().Value); 757Assert.Equal(Expected, name.First().Value); 761Assert.Equal(expected, count.First().Value); 779Assert.Equal(Expected, name.First().Value); 784Assert.Equal(laterExpected, count.First().Value);
CookieTests.cs (5)
774var id = ctx.Principal.Identities.First(); 830var id = ctx.Principal.Identities.First(); 1066Assert.True(c.Principal.Identities.First().HasClaim("marker", "true")); 1776var firstId = p.Identities.First(); 1921transaction.CookieNameValue = transaction.SetCookie.Split(new[] { ';' }, 2).First();
FacebookTests.cs (2)
367Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 449Assert.Equal("/challenge", transaction.Response.Headers.GetValues("Location").First());
GoogleTests.cs (16)
402Assert.Equal("/error?FailureMessage=AccessDenied", transaction.Response.Headers.GetValues("Location").First()); 438Assert.Equal("https://example.com/custom-denied-page?rurl=http%3A%2F%2Fwww.google.com%2F", transaction.Response.Headers.GetValues("Location").First()); 481Assert.StartsWith("/error?FailureMessage=", transaction.Response.Headers.GetValues("Location").First()); 520Assert.Equal("/error?FailureMessage=itfailed" + UrlEncoder.Default.Encode(";Description=whyitfailed;Uri=https://example.com/fail"), transaction.Response.Headers.GetValues("Location").First()); 559Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 630transaction.Response.Headers.GetValues("Location").First()); 682transaction.Response.Headers.GetValues("Location").First()); 722Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 762Assert.Equal("/", transaction.Response.Headers.GetValues("Location").First()); 810Assert.Equal("/foo", transaction.Response.Headers.GetValues("Location").First()); 854transaction.Response.Headers.GetValues("Location").First()); 883Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 927Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 971Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 1008Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 1082Assert.Equal("/challenge", transaction.Response.Headers.GetValues("Location").First());
JwtBearerTests.cs (11)
130var jwtHandler = options.SecurityTokenValidators.First() as JwtSecurityTokenHandler; 135var tokenHandler = options.TokenHandlers.First() as JsonWebTokenHandler; 151var jwtHandler = options.SecurityTokenValidators.First() as JwtSecurityTokenHandler; 293Assert.Equal("Bearer error=\"invalid_token\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 320Assert.Equal($"Bearer error=\"invalid_token\", error_description=\"{message}\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 344Assert.Equal($"Bearer error=\"invalid_token\", error_description=\"{message}\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 364Assert.Equal("Bearer error=\"invalid_token\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 385response.Response.Headers.WwwAuthenticate.First().ToString()); 451Assert.Equal(builder.ToString(), response.Response.Headers.WwwAuthenticate.First().ToString()); 466Assert.Equal("Bearer", response.Response.Headers.WwwAuthenticate.First().ToString()); 478Assert.Equal("Bearer", response.Response.Headers.WwwAuthenticate.First().ToString());
JwtBearerTests_Handler.cs (11)
120var jwtHandler = options.SecurityTokenValidators.First() as JwtSecurityTokenHandler; 125var tokenHandler = options.TokenHandlers.First() as JsonWebTokenHandler; 141var jwtHandler = options.SecurityTokenValidators.First() as JwtSecurityTokenHandler; 276Assert.Equal("Bearer error=\"invalid_token\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 300Assert.Equal($"Bearer error=\"invalid_token\", error_description=\"{message}\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 321Assert.Equal($"Bearer error=\"invalid_token\", error_description=\"{message}\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 338Assert.Equal("Bearer error=\"invalid_token\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 356response.Response.Headers.WwwAuthenticate.First().ToString()); 421Assert.Equal(builder.ToString(), response.Response.Headers.WwwAuthenticate.First().ToString()); 435Assert.Equal("Bearer", response.Response.Headers.WwwAuthenticate.First().ToString()); 447Assert.Equal("Bearer", response.Response.Headers.WwwAuthenticate.First().ToString());
MicrosoftAccountTests.cs (2)
244Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 349Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First());
OpenIdConnect\OpenIdConnectAuthenticateTests.cs (1)
100Assert.StartsWith("/error?FailureMessage=", transaction.Response.Headers.GetValues("Location").First());
OpenIdConnect\OpenIdConnectChallengeTests.cs (1)
438Assert.Contains("samesite=none", transaction.SetCookie.First());
OpenIdConnect\UniqueJsonKeyClaimActionTests.cs (2)
41Assert.Equal("claimType", claims.First().Type); 42Assert.Equal("value", claims.First().Value);
TicketSerializerTests.cs (1)
50Assert.Equal("bootstrap", readTicket.Principal.Identities.First().BootstrapContext);
TwitterTests.cs (2)
432Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 511Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First());
Microsoft.AspNetCore.Authorization.Test (5)
AuthorizationBuilderTests.cs (1)
103Assert.IsType<AssertionRequirement>(policy.Requirements.First());
AuthorizationPolicyFacts.cs (2)
110var rolesAuthorizationRequirement = combined.Requirements.OfType<RolesAuthorizationRequirement>().First(); 171var rolesAuthorizationRequirement = combined.Requirements.OfType<RolesAuthorizationRequirement>().First();
DefaultAuthorizationServiceTests.cs (2)
191var first = allowed.Failure.FailureReasons.First(); 218Assert.IsType<ClaimsAuthorizationRequirement>(allowed.Failure.FailedRequirements.First());
Microsoft.AspNetCore.Components.Analyzers (1)
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
38var declaration = root.FindToken(diagnosticSpan.Start).Parent.AncestorsAndSelf().OfType<PropertyDeclarationSyntax>().First();
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
Helpers\DiagnosticVerifier.Helper.cs (1)
135return CreateProject(new[] { source }, language).Documents.First();
Verifiers\DiagnosticVerifier.cs (1)
135VerifyDiagnosticLocation(analyzer, actual, actual.Location, expected.Locations.First());
Microsoft.AspNetCore.Components.Endpoints.Tests (9)
Builder\RazorComponentsEndpointConventionBuilderExtensionsTest.cs (9)
29Assert.All(endpointBuilder.DataSources.First().Endpoints, e => 53Assert.All(endpointBuilder.DataSources.Skip(1).First().Endpoints, e => 72Assert.All(endpointBuilder.DataSources.Skip(1).First().Endpoints, e => 93Assert.All(endpointBuilder.DataSources.Skip(1).First().Endpoints, e => 115Assert.All(endpointBuilder.DataSources.Skip(1).First().Endpoints, e => 137Assert.All(endpointBuilder.DataSources.Skip(2).First().Endpoints, e => 160Assert.All(endpointBuilder.DataSources.Skip(2).First().Endpoints, e => 186Assert.All(groupEndpoints.Skip(1).First().Endpoints, e => 212Assert.All(groupEndpoints.Skip(1).First().Endpoints, e =>
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
38var declaration = root.FindToken(diagnosticSpan.Start).Parent.AncestorsAndSelf().OfType<PropertyDeclarationSyntax>().First();
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
Helpers\DiagnosticVerifier.Helper.cs (1)
135return CreateProject(new[] { source }, language).Documents.First();
Verifiers\DiagnosticVerifier.cs (1)
135VerifyDiagnosticLocation(analyzer, actual, actual.Location, expected.Locations.First());
Microsoft.AspNetCore.Components.Tests (7)
RenderTreeDiffBuilderTest.cs (1)
1597var componentInstance = newTree.GetFrames().AsEnumerable().First().Component as FakeComponent;
Routing\RouterTest.cs (6)
197var renderedFrame = _renderer.Batches.First().ReferenceFrames.First(); 243var renderedFrame = _renderer.Batches.First().ReferenceFrames.First(); 263var renderedFrame = _renderer.Batches.First().ReferenceFrames.First();
Microsoft.AspNetCore.DataProtection.Tests (4)
Repositories\EphemeralXmlRepositoryTests.cs (2)
100repository.DeleteElements(deletableElements => deletableElements.First().DeletionOrder = 1); 104deletableElements.First().DeletionOrder = 1;
Repositories\FileSystemXmlRepositoryTests.cs (1)
269deletableElements.First().DeletionOrder = 1;
Repositories\RegistryXmlRepositoryTests.cs (1)
211deletableElements.First().DeletionOrder = 1;
Microsoft.AspNetCore.DeveloperCertificates.XPlat (2)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
215certificate = certificates.First(); 257certificate = certificates.First();
Microsoft.AspNetCore.Diagnostics.Tests (14)
ExceptionHandlerTest.cs (13)
190Assert.Equal("no-cache", values.First()); 193Assert.Equal("-1", values.First()); 246Assert.Equal("no-cache", values.First()); 249Assert.Equal("-1", values.First()); 299Assert.Equal("max-age=3600", values.First()); 302Assert.Equal("max-age=3600", values.First()); 305Assert.Equal(expiresTime, values.First()); 308Assert.Equal("abcdef", values.First()); 373Assert.Equal("no-cache", values.First()); 441Assert.Equal("max-age=3600", values.First()); 444Assert.Equal("max-age=3600", values.First()); 447Assert.Equal(expiresTime, values.First()); 450Assert.Equal("abcdef", values.First());
StatusCodeMiddlewareTest.cs (1)
63Assert.Equal(expectedUri, response.Headers.First(s => s.Key == "Location").Value.First());
Microsoft.AspNetCore.Grpc.Swagger (2)
Internal\XmlComments\GrpcXmlCommentsDocumentFilter.cs (2)
33.Select(group => new KeyValuePair<string, ActionDescriptor>(group.Key, group.First())); 37var grpcMethodMetadata = nameAndType.Value.EndpointMetadata.OfType<GrpcMethodMetadata>().First();
Microsoft.AspNetCore.Hosting.Tests (4)
WebHostBuilderTests.cs (1)
1378var service = host.Services.GetServices<IHostedService>().OfType<NonThrowingHostedService>().First();
WebHostTests.cs (3)
63Assert.Equal("http://localhost:5002", serverAddressFeature.Addresses.First()); 82Assert.Equal("http://localhost:5003", serverAddressFeature.Addresses.First()); 102Assert.Equal("http://localhost:5009", serverAddressFeature.Addresses.First());
Microsoft.AspNetCore.Http.Connections.Tests (3)
MapConnectionHandlerTests.cs (3)
56Assert.Equal(req, policies[1].Requirements.First()); 66Assert.Equal(req, policies[1].Requirements.First()); 397var address = feature.Addresses.First().Replace("http", "ws") + "/socket";
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
70.ReplaceSyntaxTree(compilation.SyntaxTrees.First(), syntaxTree);
ResponseExtensionTests.cs (1)
47Assert.Equal(location, context.Response.Headers.Location.First());
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
70.ReplaceSyntaxTree(compilation.SyntaxTrees.First(), syntaxTree);
Microsoft.AspNetCore.Http.Results.Tests (4)
ResultsTests.cs (2)
459var result = Results.SignIn(principal, properties, authenticationSchemes?.First()) as SignInHttpResult; 464Assert.Equal(authenticationSchemes?.First(), result.AuthenticationScheme);
TypedResultsTests.cs (2)
469var result = TypedResults.SignIn(principal, properties, authenticationSchemes?.First()); 474Assert.Equal(authenticationSchemes?.First(), result.AuthenticationScheme);
Microsoft.AspNetCore.HttpsPolicy.Tests (6)
HttpsRedirectionMiddlewareTests.cs (6)
273var message = logMessages.First(); 277message = logMessages.Skip(1).First(); 361var message = logMessages.First(); 365message = logMessages.Skip(1).First(); 407var message = logMessages.First(); 451var message = logMessages.First();
Microsoft.AspNetCore.Identity (1)
SignInManager.cs (1)
238userPrincipal.Identities.First().AddClaim(claim);
Microsoft.AspNetCore.Identity.FunctionalTests (2)
LoginTests.cs (2)
121var recoveryCode = showRecoveryCodes.Context.RecoveryCodes.First(); 146var recoveryCode = showRecoveryCodes.Context.RecoveryCodes.First();
Microsoft.AspNetCore.Identity.InMemory.Test (1)
FunctionalTest.cs (1)
450transaction.CookieNameValue = transaction.SetCookie.Split(new[] { ';' }, 2).First();
Microsoft.AspNetCore.Identity.Specification.Tests (1)
IdentityResultAssert.cs (1)
41Assert.Equal(error, result.Errors.First().Description);
Microsoft.AspNetCore.Identity.Test (4)
SignInManagerTest.cs (3)
382&& i.Identities.First().AuthenticationType == IdentityConstants.TwoFactorRememberMeScheme), 696&& i.Identities.First().AuthenticationType == IdentityConstants.TwoFactorRememberMeScheme), 760&& i.Identities.First().AuthenticationType == IdentityConstants.TwoFactorRememberMeScheme),
UserClaimsPrincipalFactoryTest.cs (1)
87var identity = principal.Identities.First();
Microsoft.AspNetCore.JsonPatch.Tests (3)
JsonPatchDocumentJsonPropertyAttributeTest.cs (3)
23var pathToCheck = patchDocument.Operations.First().path; 54var fromPath = patchDocument.Operations.First().from; 56var toPath = patchDocument.Operations.First().path;
Microsoft.AspNetCore.Mvc.Abstractions.Test (1)
Filters\FilterContextTest.cs (1)
27var result = context.IsEffectivePolicy((ITestFilterPolicy)filters.First());
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\Binders\FormFileModelBinder.cs (1)
89value = postedFiles.First();
Microsoft.AspNetCore.Mvc.Core.Test (3)
ApplicationModels\AuthorizationApplicationModelProviderTest.cs (2)
98Assert.NotNull(authorizeFilters.First().Policy); 99Assert.Equal(3, authorizeFilters.First().Policy.Requirements.Count()); // Basic + Basic2 + Derived authorize
ModelBinding\Metadata\DefaultModelMetadataProviderTest.cs (1)
158var metadata = provider.GetMetadataForProperties(typeof(ModelType)).First();
Microsoft.AspNetCore.Mvc.FunctionalTests (2)
AntiforgeryTestHelper.cs (1)
25var cookie = setCookieArray[0].Split(';').First().Split('=');
RazorPagesTest.cs (1)
1514return setCookie[0].Split(';').First();
Microsoft.AspNetCore.Mvc.IntegrationTests (9)
ValidationIntegrationTests.cs (5)
2022.First(); 2074.First(); 2144.First(); 2468.First(); 2513.First();
ValidationWithRecordIntegrationTests.cs (4)
1813.First(); 1865.First(); 1935.First(); 2254.First();
Microsoft.AspNetCore.Mvc.Localization.Test (2)
HtmlLocalizerTest.cs (1)
229Assert.Equal("World", allLocalizedStrings.First().Value);
ViewLocalizerTest.cs (1)
136Assert.Equal("World", allLocalizedStrings.First().Value);
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
BsonTempDataSerializer.cs (1)
91var jTokenType = jObjectValue.Properties().First().Value.Type;
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (5)
JsonPatchExtensionsTest.cs (4)
87Assert.Equal(nameof(Customer), modelState.First().Key); 88Assert.Single(modelState.First().Value.Errors); 89Assert.Equal(error, modelState.First().Value.Errors.First().ErrorMessage);
NewtonsoftJsonInputFormatterTest.cs (1)
172var message = formatterContext.ModelState.Values.First().Errors[0].ErrorMessage;
Microsoft.AspNetCore.Mvc.Razor.Test (3)
RazorPageCreateTagHelperTest.cs (1)
86var enumerableType = serviceType.GetGenericArguments().First();
TagHelpers\TagHelperComponentTagHelperTest.cs (2)
247Assert.Equal($"Tag helper component '{typeof(TestTagHelperComponent)}' initialized.", sink.Writes.First().State.ToString(), StringComparer.Ordinal); 280Assert.Equal($"Tag helper component '{typeof(TestTagHelperComponent)}' processed.", sink.Writes.First().State.ToString(), StringComparer.Ordinal);
Microsoft.AspNetCore.Mvc.RazorPages.Test (8)
Builder\PageActionEndpointConventionBuilderResourceCollectionExtensionsTest.cs (8)
31Assert.All(endpointBuilder.DataSources.First().Endpoints, e => 52Assert.All(endpointBuilder.DataSources.Skip(1).First().Endpoints, e => 73Assert.All(endpointBuilder.DataSources.Skip(1).First().Endpoints, e => 95Assert.All(endpointBuilder.DataSources.Skip(1).First().Endpoints, e => 118Assert.All(endpointBuilder.DataSources.Skip(2).First().Endpoints, e => 141Assert.All(endpointBuilder.DataSources.Skip(2).First().Endpoints, e => 167Assert.All(groupEndpoints.Skip(1).First().Endpoints, e => 193Assert.All(groupEndpoints.Skip(1).First().Endpoints, e =>
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (14)
Builder\ControllerActionEndpointConventionBuilderResourceCollectionExtensionsTest.cs (8)
31Assert.All(endpointBuilder.DataSources.First().Endpoints, e => 61Assert.All(endpointBuilder.DataSources.Skip(1).First().Endpoints, e => 91var endpoints = endpointBuilder.DataSources.Skip(1).First().Endpoints; 123Assert.All(endpointBuilder.DataSources.Skip(1).First().Endpoints, e => 155Assert.All(endpointBuilder.DataSources.Skip(2).First().Endpoints, e => 187Assert.All(endpointBuilder.DataSources.Skip(2).First().Endpoints, e => 222Assert.All(groupEndpoints.Skip(1).First().Endpoints, e => 257Assert.All(groupEndpoints.Skip(1).First().Endpoints, e =>
HtmlAttributePropertyHelperTest.cs (4)
16var property = anonymous.GetType().GetTypeInfo().DeclaredProperties.First(); 31var property = anonymous.GetType().GetTypeInfo().DeclaredProperties.First(); 46var property = anonymous.GetType().GetTypeInfo().DeclaredProperties.First(); 61var property = anonymous.GetType().GetTypeInfo().DeclaredProperties.First();
ViewComponents\DefaultViewComponentHelperTest.cs (1)
158return provider.GetViewComponents().First();
ViewComponents\ViewViewComponentResultTest.cs (1)
534MethodInfo = typeof(object).GetTypeInfo().DeclaredMethods.First()
Microsoft.AspNetCore.OpenApi.Tests (18)
Services\CreateSchemaReferenceIdTests.cs (2)
54Assert.Equal("triangle", ((OpenApiString)triangleSchema.Properties[schema.Discriminator.PropertyName].Enum.First()).Value); 56Assert.Equal("square", ((OpenApiString)squareSchema.Properties[schema.Discriminator.PropertyName].Enum.First()).Value);
Services\OpenApiGeneratorTests.cs (2)
121Assert.Equal("application/custom0", request.Content.First().Key); 137Assert.Equal("application/custom0", request.Content.First().Key);
Services\OpenApiSchemaService\OpenApiSchemaService.PolymorphicSchemas.cs (14)
41Assert.Equal("triangle", ((OpenApiString)triangleSchema.Properties[schema.Discriminator.PropertyName].Enum.First()).Value); 43Assert.Equal("square", ((OpenApiString)squareSchema.Properties[schema.Discriminator.PropertyName].Enum.First()).Value); 80Assert.Equal(0, ((OpenApiInteger)citySchema.Properties[schema.Discriminator.PropertyName].Enum.First()).Value); 84Assert.Equal(1, ((OpenApiInteger)timeSeriesSchema.Properties[schema.Discriminator.PropertyName].Enum.First()).Value); 88Assert.Equal(2, ((OpenApiInteger)newsSchema.Properties[schema.Discriminator.PropertyName].Enum.First()).Value); 123Assert.Equal("student", ((OpenApiString)citySchema.Properties[schema.Discriminator.PropertyName].Enum.First()).Value); 127Assert.Equal("teacher", ((OpenApiString)timeSeriesSchema.Properties[schema.Discriminator.PropertyName].Enum.First()).Value); 159Assert.Equal("paint", ((OpenApiString)paintSchema.Properties["$type"].Enum.First()).Value); 163Assert.Equal("fabric", ((OpenApiString)fabricSchema.Properties["$type"].Enum.First()).Value); 211Assert.Equal("dog", ((OpenApiString)dogSchema.Properties[schema.Discriminator.PropertyName].Enum.First()).Value); 215Assert.Equal("cat", ((OpenApiString)catSchema.Properties[schema.Discriminator.PropertyName].Enum.First()).Value); 219Assert.Equal("pet", ((OpenApiString)petSchema.Properties[schema.Discriminator.PropertyName].Enum.First()).Value); 292Assert.Equal("manager", ((OpenApiString)managerSchema.Properties[schema.Discriminator.PropertyName].Enum.First()).Value); 294Assert.Equal("employee", ((OpenApiString)employeeSchema.Properties[schema.Discriminator.PropertyName].Enum.First()).Value);
Microsoft.AspNetCore.Owin.Tests (2)
OwinEnvironmentTests.cs (2)
43Assert.Equal("CustomRequestValue", requestHeaders["CustomRequestHeader"].First()); 53Assert.Equal("CustomResponseValue", responseHeaders["CustomResponseHeader"].First());
Microsoft.AspNetCore.RateLimiting.Tests (1)
RateLimitingMiddlewareTests.cs (1)
160var message = logMessages.First();
Microsoft.AspNetCore.RequestDecompression.Tests (2)
RequestDecompressionMiddlewareTests.cs (2)
250AssertLog(logMessages.First(), LogLevel.Debug, $"The request will be decompressed with '{contentEncoding}'."); 251AssertLog(logMessages.Skip(1).First(), LogLevel.Trace, "The Content-Encoding header is empty or not specified. Skipping request decompression.");
Microsoft.AspNetCore.ResponseCompression (1)
ResponseCompressionProvider.cs (1)
148.First().Provider;
Microsoft.AspNetCore.ResponseCompression.Tests (22)
ResponseCompressionMiddlewareTest.cs (22)
110AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression."); 111AssertLog(logMessages.Skip(1).First(), LogLevel.Trace, "Response compression is available for this Content-Type."); 112AssertLog(logMessages.Skip(2).First(), LogLevel.Debug, "No matching response compression provider found."); 194AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression."); 196AssertLog(logMessages.Skip(1).First(), LogLevel.Debug, $"Response compression is not enabled for the Content-Type '{expected}'."); 282AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression."); 283AssertLog(logMessages.Skip(1).First(), LogLevel.Debug, $"Response compression is not enabled for the Content-Type '{contentType}'."); 359AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression."); 360AssertLog(logMessages.Skip(1).First(), LogLevel.Trace, "Response compression is available for this Content-Type."); 361AssertLog(logMessages.Skip(2).First(), LogLevel.Debug, "No matching response compression provider found."); 384AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression."); 385AssertLog(logMessages.Skip(1).First(), LogLevel.Trace, "Response compression is available for this Content-Type."); 386AssertLog(logMessages.Skip(2).First(), LogLevel.Debug, "No matching response compression provider found."); 396AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression."); 397AssertLog(logMessages.Skip(1).First(), LogLevel.Debug, "Response compression is not enabled for the Content-Type 'text/custom'."); 410AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression."); 411AssertLog(logMessages.Skip(1).First(), LogLevel.Debug, "Response compression disabled due to the Content-Range header."); 428AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression."); 429AssertLog(logMessages.Skip(1).First(), LogLevel.Debug, "Response compression disabled due to the Content-Encoding header."); 1339AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression."); 1340AssertLog(logMessages.Skip(1).First(), LogLevel.Trace, "Response compression is available for this Content-Type."); 1341AssertLog(logMessages.Skip(2).First(), LogLevel.Debug, $"The response will be compressed with '{provider}'.");
Microsoft.AspNetCore.Routing.Microbenchmarks (2)
src\Http\Routing\test\UnitTests\Matching\RouteMatcherBuilder.cs (1)
44var endpoint = group.First();
src\Http\Routing\test\UnitTests\Matching\TreeRouterMatcherBuilder.cs (1)
55var endpoint = group.First();
Microsoft.AspNetCore.Routing.Tests (8)
Matching\RouteMatcherBuilder.cs (1)
44var endpoint = group.First();
Matching\TreeRouterMatcherBuilder.cs (1)
55var endpoint = group.First();
RouteConstraintBuilderTest.cs (5)
27Assert.Equal("controller", result.First().Key); 111Assert.Equal("id", result.First().Key); 124Assert.Equal("id", result.First().Key); 139Assert.Equal("name", result.First().Key); 141var optionalConstraint = (OptionalRouteConstraint)result.First().Value;
RouteTest.cs (1)
786Assert.DoesNotContain(routeDataTokens.First().Key, pathData.DataTokens.Keys);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (19)
AuthenticationTests.cs (1)
367Assert.Equal(authType.ToString(), response.Headers.WwwAuthenticate.First().Scheme);
RequestHeaderTests.cs (1)
191Assert.Contains(requestHeaders[customHeader].First(), requestHeaders.Keys);
ResponseBodyTests.cs (2)
227Assert.Equal("30", contentLength.First()); 307Assert.Equal("10", contentLength.First());
ResponseHeaderTests.cs (6)
238Assert.Equal("value1a", response.Headers.GetValues("Custom1").First()); 239Assert.Equal("value1b", response.Headers.GetValues("Custom1").Skip(1).First()); 241Assert.Equal("value2a, value2b", response.Headers.GetValues("Custom2").First()); 268Assert.Equal("value1a", response.Headers.GetValues("Custom1").First()); 269Assert.Equal("value1b", response.Headers.GetValues("Custom1").Skip(1).First()); 271Assert.Equal("value2a, value2b", response.Headers.GetValues("Custom2").First());
ResponseSendFileTests.cs (4)
30AbsoluteFilePath = Directory.GetFiles(Directory.GetCurrentDirectory()).First(); 229Assert.Equal(FileLength.ToString(CultureInfo.InvariantCulture), contentLength.First()); 250Assert.Equal("10", contentLength.First()); 271Assert.Equal("0", contentLength.First());
ResponseTrailersTests.cs (3)
165Assert.Equal((2 * body.Length).ToString(CultureInfo.InvariantCulture), contentLength.First()); 190Assert.Equal(body.Length.ToString(CultureInfo.InvariantCulture), contentLength.First()); 216Assert.Equal(body.Length.ToString(CultureInfo.InvariantCulture), contentLength.First());
src\Shared\Http2cat\Http2CatHostedService.cs (1)
63ip = Dns.GetHostEntry(address.Host).AddressList.First();
Utilities.cs (1)
107prefix = options.Value.UrlPrefixes.First(); // Has new port
Microsoft.AspNetCore.Server.Kestrel.Core (2)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
215certificate = certificates.First(); 257certificate = certificates.First();
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
src\Servers\Kestrel\shared\KnownHeaders.cs (1)
447.OrderBy(g => g.First(), KnownHeaderComparer.Instance)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (1)
src\Servers\Kestrel\shared\test\TransportTestHelpers\IHostPortExtensions.cs (1)
19return host.GetPorts().First();
Microsoft.AspNetCore.Session.Tests (10)
SessionTests.cs (10)
96Assert.True(!string.IsNullOrWhiteSpace(values.First())); 153Assert.Contains("; secure", values.First()); 157Assert.DoesNotContain("; secure", values.First()); 203var cookie = SetCookieHeaderValue.ParseList(response.Headers.GetValues("Set-Cookie").ToList()).First(); 263var cookie = SetCookieHeaderValue.ParseList(response.Headers.GetValues("Set-Cookie").ToList()).First(); 321var cookie = SetCookieHeaderValue.ParseList(response.Headers.GetValues("Set-Cookie").ToList()).First(); 425var cookie = SetCookieHeaderValue.ParseList(response.Headers.GetValues("Set-Cookie").ToList()).First(); 494var cookie = SetCookieHeaderValue.ParseList(response.Headers.GetValues("Set-Cookie").ToList()).First(); 682var message = sink.Writes.First(); 731var message = sink.Writes.First();
Microsoft.AspNetCore.Shared.Tests (15)
PropertyHelperTest.cs (4)
19var property = PropertyHelper.GetProperties(anonymous.GetType()).First().Property; 34var property = PropertyHelper.GetProperties(anonymous.GetType()).First().Property; 49var property = PropertyHelper.GetProperties(anonymous.GetType()).First().Property; 97var property = PropertyHelper.GetProperties(anonymous.GetType()).First().Property;
SecurityHelperTests.cs (11)
45Assert.Equal("Test3", user.Identities.Skip(0).First().Name); 46Assert.Equal("Test2", user.Identities.Skip(1).First().Name); 47Assert.Equal("Test1", user.Identities.Skip(2).First().Name); 75Assert.Equal(newEmptyIdentity, user.Identities.Skip(0).First()); 76Assert.Equal(identityTwo, user.Identities.Skip(1).First()); 77Assert.Equal(identityNoAuthTypeWithClaim, user.Identities.Skip(2).First()); 78Assert.Equal(identityEmptyWithAuthType, user.Identities.Skip(3).First()); 87Assert.Equal("Test3", user.Identities.Skip(0).First().Name); 88Assert.Equal(identityTwo, user.Identities.Skip(1).First()); 89Assert.Equal(identityNoAuthTypeWithClaim, user.Identities.Skip(2).First()); 90Assert.Equal(identityEmptyWithAuthType, user.Identities.Skip(3).First());
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (5)
HubConnectionTests.cs (5)
1454var hubProtocol = HubProtocols.First().Value; 1455var transportType = TransportTypes().First().Cast<HttpTransportType>().First(); 2147path: HubPaths.First(), 2268.WithUrl(server.Url + HubPaths.First(), HttpTransportType.WebSockets)
Microsoft.AspNetCore.SignalR.Tests (5)
HubConnectionHandlerTests.cs (3)
502Assert.Equal(exceptionLog.First().Exception.Message, $"The maximum message size of {maximumMessageSize}B was exceeded. The message size can be configured in AddHubOptions."); 532Assert.Equal(exceptionLog.First().Exception.Message, $"The maximum message size of {maximumMessageSize}B was exceeded. The message size can be configured in AddHubOptions."); 583Assert.Equal(exceptionLog.First().Exception.Message, $"The maximum message size of {maximumMessageSize}B was exceeded. The message size can be configured in AddHubOptions.");
MapSignalRTests.cs (2)
128Assert.Equal(req, policies[1].Requirements.First()); 138Assert.Equal(req, policies[1].Requirements.First());
Microsoft.AspNetCore.StaticFiles.FunctionalTests (1)
Helpers.cs (1)
15return server.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses.First();
Microsoft.AspNetCore.TestHost.Tests (8)
ClientHandlerTests.cs (8)
364Assert.Equal("TestValue:1", response.Headers.GetValues("TestHeader").First()); 367Assert.Equal("TestValue:2", response.Headers.GetValues("TestHeader").First()); 380Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First()); 416Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First()); 435Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First()); 453Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First()); 475Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First()); 534Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First());
Microsoft.AspNetCore.Testing.Tests (1)
FakesExtensionsTests.cs (1)
62BaseAddress = host.GetListenUris().First()
Microsoft.AspNetCore.WebSockets.Tests (1)
IHostPortExtensions.cs (1)
15return host.GetPorts().First();
Microsoft.Build (10)
BackEnd\BuildManager\BuildManager.cs (1)
2795e = ae.InnerExceptions.First();
BackEnd\Components\Caching\ConfigCache.cs (1)
215return _configurations.OrderBy(kvp => kvp.Key).First().Key;
BackEnd\Components\Scheduler\Scheduler.cs (4)
851ReadSchedulingPlan(_schedulingData.GetRequestsByHierarchy(null).First().BuildRequest.SubmissionId); 1088int nodeIdToAssign = requestRequiredNodeId == InvalidNodeId ? idleNodes.First() : requestRequiredNodeId; 1130int nodeIdToAssign = requestRequiredNodeId == InvalidNodeId ? idleNodes.First() : requestRequiredNodeId; 2399currentWork[nodeForEvent] = runningRequests[nodeForEvent].First();
Definition\Project.cs (3)
3067if (group.Count == 0 || MSBuildNameIgnoreCaseComparer.Default.Equals(itemType, group.Items.First().ItemType)) 3084!IsSuitableExistingItemXml(groupToAppendTo.Items.First(), unevaluatedInclude, metadata)) 3091itemElement = groupToAppendTo.Items.First();
Graph\GraphBuilder.cs (1)
403return partiallyMarchedConfig ?? projectConfigs.First().Value;
Microsoft.Build.Engine.OM.UnitTests (156)
Construction\ProjectItemElement_Tests.cs (2)
100ProjectMetadataElement metadatum1 = item.Metadata.First(); 101ProjectMetadataElement metadatum2 = item.Metadata.Skip(1).First();
Construction\ProjectMetadataElement_Tests.cs (14)
307var item = items.First(); 334var itemDefinition = itemDefinitions.First(); 436var metadata = items[0].Metadata.First(); 461var metadata = itemDefinitions[0].Metadata.First(); 495var metadata = items[0].Metadata.First(); 520var metadata = itemDefinitions[0].Metadata.First(); 572var metadata = items[0].Metadata.First(); 615var metadata = itemDefinitions[0].Metadata.First(); 689var metadata = items[0].Metadata.First(); 732var metadata = itemDefinitions[0].Metadata.First(); 818var metadata = items[0].Metadata.First(); 881var metadata = itemDefinitions[0].Metadata.First(); 950var metadata = items[0].Metadata.First(); 993var metadata = itemDefinitions[0].Metadata.First();
Construction\ProjectRootElement_Tests.cs (4)
528string toolsPath = projectCollection.Toolsets.Where(toolset => (string.Equals(toolset.ToolsVersion, ObjectModelHelpers.MSBuildDefaultToolsVersion, StringComparison.OrdinalIgnoreCase))).First().ToolsPath; 1294var projectFile = projectFiles.CreatedFiles.First(); 1332var projectFile = testFiles.CreatedFiles.First(); 1597var projectPath = testFiles.CreatedFiles.First();
Construction\WhiteSpacePreservation_Tests.cs (2)
330(pe, p) => { pe.ItemGroups.First().AddItem("i2", "b"); }); 404var itemGroup = pe.ItemGroups.First();
Definition\DefinitionEditing_Tests.cs (1)
1764project.Xml.ItemGroups.First().Parent.RemoveAllChildren();
Definition\EditingElementsReferencedByOrReferences_Tests.cs (15)
35ProjectItem item = project.GetItems("I").Where(i => i.UnevaluatedInclude == "X").First(); 52Assert.Equal("Y", items.First().EvaluatedInclude); // "Wrong evaluated include after changing type" 69ProjectItem item = project.GetItems("I").Where(i => i.EvaluatedInclude == "Y").First(); 98ProjectItem item = project.GetItems("I").Where(i => i.EvaluatedInclude == "Y").First(); 137ProjectItem item1 = project.GetItems("I").Where(i => i.EvaluatedInclude == "X").First(); 140ProjectItem item2 = project.GetItems("I").Where(i => i.EvaluatedInclude == "Y").First(); 188ProjectItem item1 = project.GetItems("I").Where(i => i.EvaluatedInclude == "X").First(); 210item1 = project.GetItems("I").Where(i => i.EvaluatedInclude == "X").First(); 212ProjectItem item2 = project.GetItems("I").Where(i => i.EvaluatedInclude == "Y").First(); 240ProjectItem item1 = project.GetItems("I").Where(i => i.EvaluatedInclude == "X").First(); 244ProjectItem item2 = project.GetItems("I").Where(i => i.EvaluatedInclude == "Y").First(); 264item1 = project.GetItems("I").Where(i => i.EvaluatedInclude == "X").First(); 266item2 = project.GetItems("I").Where(i => i.EvaluatedInclude == "Y").First(); 286ProjectItem item = project.GetItems("I").First(); 302item = project.GetItems("I").First();
Definition\Project_Tests.cs (23)
612object.ReferenceEquals(imports.First().ImportingElement, xml.Imports.ElementAt(0)).ShouldBeTrue(); 616object.ReferenceEquals(imports.First().ImportedProject, ProjectRootElement.Open(importPath)).ShouldBeTrue(); 653project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe( 685project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), @"obj\i386\foo.dll")); 686projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), @"obj\i386\foo.dll")); 690project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), @"obj/i386/foo.dll")); 691projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), @"obj/i386/foo.dll")); 721project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386").Substring(RootPrefixLength) + Path.DirectorySeparatorChar); 722projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386").Substring(RootPrefixLength) + Path.DirectorySeparatorChar); 757project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386").Substring(RootPrefixLength) + Path.DirectorySeparatorChar); 758projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386").Substring(RootPrefixLength) + Path.DirectorySeparatorChar); 796project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory /* remove c:\ */, "obj", "i386")); 797projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory /* remove c:\ */, "obj", "i386")); 1447var importFile = projectFiles.CreatedFiles.First(); 1463project.Imports.First().ImportedProject.ShouldBeSameAs(import); 1504project.GetItems("I").First().EvaluatedInclude.ShouldBe(i); 1505project.GetItems("I").First().GetMetadataValue("M").ShouldBe(m); 1512var importFile = projectFiles.CreatedFiles.First(); 1548project.Imports.First().ImportedProject.ShouldBeSameAs(import); 1549newProject.Imports.First().ImportedProject.ShouldBeSameAs(import); 1590project.GetItems("I").First().EvaluatedInclude.ShouldBe(i); 1591project.GetItems("I").First().GetMetadataValue("M").ShouldBe(m); 1600var projectFile = projectFiles.CreatedFiles.First();
Definition\ProjectItem_Tests.cs (85)
1199project.GetItems("i").First().SetMetadataValue("m", "m2"); 1201ProjectItem item1 = project.GetItems("i").First(); 1202ProjectItem item2 = project.GetItems("j").First(); 1242ProjectItem item1 = project.GetItems("i").First(); 1245ProjectItem item2 = project.GetItems("j").First(); 1293ProjectItem item1 = project.GetItems("i").First(); 1295ProjectItem item2 = project.GetItems("j").First(); 1363Assert.Equal("l0", project.GetItems("i").First().GetMetadataValue("l")); 1364Assert.Equal("m1", project.GetItems("i").First().GetMetadataValue("m")); 1365Assert.Equal("n1", project.GetItems("i").First().GetMetadataValue("n")); 1366Assert.Equal("", project.GetItems("i").First().GetMetadataValue("o")); 1367Assert.Equal("", project.GetItems("i").First().GetMetadataValue("p")); 1369Assert.Equal("l0", project.GetItems("j").First().GetMetadataValue("l")); 1370Assert.Equal("m1", project.GetItems("j").First().GetMetadataValue("m")); 1371Assert.Equal("n1", project.GetItems("j").First().GetMetadataValue("n")); 1372Assert.Equal("o2", project.GetItems("j").First().GetMetadataValue("o")); 1373Assert.Equal("p2", project.GetItems("j").First().GetMetadataValue("p")); 1375Assert.Equal("l0", project.GetItems("k").First().GetMetadataValue("l")); 1376Assert.Equal("m1", project.GetItems("k").First().GetMetadataValue("m")); 1377Assert.Equal("n1", project.GetItems("k").First().GetMetadataValue("n")); 1378Assert.Equal("o2", project.GetItems("k").First().GetMetadataValue("o")); 1379Assert.Equal("p4", project.GetItems("k").First().GetMetadataValue("p")); 1381Assert.Equal("l0", project.GetItems("l").First().GetMetadataValue("l")); 1382Assert.Equal("m1", project.GetItems("l").First().GetMetadataValue("m")); 1383Assert.Equal("n1", project.GetItems("l").First().GetMetadataValue("n")); 1384Assert.Equal("o2", project.GetItems("l").First().GetMetadataValue("o")); 1385Assert.Equal("p4", project.GetItems("l").First().GetMetadataValue("p")); 1393Assert.Equal("l0", project.GetItems("m").First().GetMetadataValue("l")); 1394Assert.Equal("m1", project.GetItems("m").First().GetMetadataValue("m")); 1395Assert.Equal("n1", project.GetItems("m").First().GetMetadataValue("n")); 1396Assert.Equal("o4", project.GetItems("m").First().GetMetadataValue("o")); 1397Assert.Equal("p4", project.GetItems("m").First().GetMetadataValue("p")); 1406Assert.True(Object.ReferenceEquals(project.GetItems("i").First().GetMetadata("l").Xml, project.GetItems("m").First().GetMetadata("l").Xml)); 1407Assert.True(Object.ReferenceEquals(project.GetItems("i").First().GetMetadata("m").Xml, project.GetItems("m").First().GetMetadata("m").Xml)); 1408Assert.True(Object.ReferenceEquals(project.GetItems("i").First().GetMetadata("n").Xml, project.GetItems("m").First().GetMetadata("n").Xml)); 1409Assert.True(Object.ReferenceEquals(project.GetItems("j").First().GetMetadata("o").Xml, project.GetItems("k").First().GetMetadata("o").Xml)); 1410Assert.True(Object.ReferenceEquals(project.GetItems("k").First().GetMetadata("p").Xml, project.GetItems("m").First().GetMetadata("p").Xml)); 1411Assert.True(!Object.ReferenceEquals(project.GetItems("j").First().GetMetadata("p").Xml, project.GetItems("m").First().GetMetadata("p").Xml)); 1461Assert.Equal("l0", project.GetItems("i").First().GetMetadataValue("l")); 1462Assert.Equal("m1", project.GetItems("i").First().GetMetadataValue("m")); 1463Assert.Equal("n1", project.GetItems("i").First().GetMetadataValue("n")); 1464Assert.Equal("", project.GetItems("i").First().GetMetadataValue("o")); 1465Assert.Equal("", project.GetItems("i").First().GetMetadataValue("p")); 1467Assert.Equal("l0", project.GetItems("j").First().GetMetadataValue("l")); 1468Assert.Equal("m1", project.GetItems("j").First().GetMetadataValue("m")); 1469Assert.Equal("n1", project.GetItems("j").First().GetMetadataValue("n")); 1470Assert.Equal("o2", project.GetItems("j").First().GetMetadataValue("o")); 1471Assert.Equal("p2", project.GetItems("j").First().GetMetadataValue("p")); 1473Assert.Equal("l0", project.GetItems("k").First().GetMetadataValue("l")); 1474Assert.Equal("m1", project.GetItems("k").First().GetMetadataValue("m")); 1475Assert.Equal("n1", project.GetItems("k").First().GetMetadataValue("n")); 1476Assert.Equal("o2", project.GetItems("k").First().GetMetadataValue("o")); 1477Assert.Equal("p4", project.GetItems("k").First().GetMetadataValue("p")); 1479Assert.Equal("l0", project.GetItems("l").First().GetMetadataValue("l")); 1480Assert.Equal("m1", project.GetItems("l").First().GetMetadataValue("m")); 1481Assert.Equal("n1", project.GetItems("l").First().GetMetadataValue("n")); 1482Assert.Equal("o2", project.GetItems("l").First().GetMetadataValue("o")); 1483Assert.Equal("p4", project.GetItems("l").First().GetMetadataValue("p")); 1491Assert.Equal("l0", project.GetItems("m").First().GetMetadataValue("l")); 1492Assert.Equal("m1", project.GetItems("m").First().GetMetadataValue("m")); 1493Assert.Equal("n1", project.GetItems("m").First().GetMetadataValue("n")); 1494Assert.Equal("o4", project.GetItems("m").First().GetMetadataValue("o")); 1495Assert.Equal("p4", project.GetItems("m").First().GetMetadataValue("p")); 1504Assert.True(Object.ReferenceEquals(project.GetItems("i").First().GetMetadata("l").Xml, project.GetItems("m").First().GetMetadata("l").Xml)); 1505Assert.True(Object.ReferenceEquals(project.GetItems("i").First().GetMetadata("m").Xml, project.GetItems("m").First().GetMetadata("m").Xml)); 1506Assert.True(Object.ReferenceEquals(project.GetItems("i").First().GetMetadata("n").Xml, project.GetItems("m").First().GetMetadata("n").Xml)); 1507Assert.True(Object.ReferenceEquals(project.GetItems("j").First().GetMetadata("o").Xml, project.GetItems("k").First().GetMetadata("o").Xml)); 1508Assert.True(Object.ReferenceEquals(project.GetItems("k").First().GetMetadata("p").Xml, project.GetItems("m").First().GetMetadata("p").Xml)); 1509Assert.True(!Object.ReferenceEquals(project.GetItems("j").First().GetMetadata("p").Xml, project.GetItems("m").First().GetMetadata("p").Xml)); 2224items.First().SetMetadataValue("M2", "V2", true); 2245var metadataElements = items.First().Xml.Metadata; 2284items.First().SetMetadataValue("M1", "V2", true); 2301var metadataElements = items.First().Xml.Metadata;
Definition\ProtectImports_Tests.cs (6)
528ProjectItem item = items.First(); 545ProjectMetadata metadata = metadatum.First(); 562ProjectMetadata metadata = metadatum.First(); 579ProjectMetadata metadata = metadatum.First(); 635ProjectItem item = items.First(); 652ProjectMetadata metadata = metadatum.First();
ObjectModelRemoting\Helpers\ViewValidation.evaluation.cs (3)
31var result = added.First(); 78return which == ObjectType.View ? viewItems.First() : realItems.First();
ObjectModelRemoting\LinkedProjectCollection_Tests.cs (1)
99Assert.Same(proj0local, prj0Coll.First());
Microsoft.Build.Engine.UnitTests (331)
AssemblyNameEx_Tests.cs (1)
721assemblyNameDeserialized.RemappedFromEnumerator.First().ShouldBe(assemblyRemappedFrom);
BackEnd\BuildManager_Tests.cs (8)
532result.ProjectStateAfterBuild.GetItems("ItemWithMetadata").First().DirectMetadataCount.ShouldBe(1); 533result.ProjectStateAfterBuild.GetItems("ItemWithMetadata").First().GetMetadataValue("Metadatum1") 535result.ProjectStateAfterBuild.GetItems("ItemWithMetadata").First().GetMetadataValue("Metadatum2") 543result.ProjectStateAfterBuild.GetItemsByItemTypeAndEvaluatedInclude("AnItem", "Item1").First() 3525string directory = Directory.EnumerateDirectories(cacheDirectory).Except(exceptCacheDirectories).First(); 3725Assert.Equal("InitialValue", results.ResultsByTarget["BuildOther"].Items.First().ItemSpec); 3747Assert.Equal(newPropertyValue, results.ResultsByTarget["Foo"].Items.First().ItemSpec); 4353graph.GraphRoots.First().ProjectInstance.FullPath,
BackEnd\BuildRequestConfiguration_Tests.cs (2)
381Assert.Equal("bazfile", instance.ItemsToBuildWith["Baz"].First().EvaluatedInclude); 407Assert.Equal("bazfile", instance.ItemsToBuildWith["Baz"].First().EvaluatedInclude);
BackEnd\GenerateTemporaryTargetAssembly_Tests.cs (1)
35logger.Errors.First().Message.ShouldBe("Task successfully failed.");
BackEnd\IntrinsicTask_Tests.cs (78)
252Assert.Equal("a1", i1Group.First().EvaluatedInclude); 253Assert.Equal("b1", i2Group.First().EvaluatedInclude); 447Assert.Equal("m1", group.First().GetMetadataValue("m1")); 471Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 472Assert.Equal("m2", group.First().GetMetadataValue("m2")); 473Assert.Equal(String.Empty, group.First().GetMetadataValue("m3")); 498Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 499Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 500Assert.Equal(String.Empty, group.First().GetMetadataValue("m3")); 524Assert.Equal("m1", group.First().GetMetadataValue("m1")); 525Assert.Equal("m2", group.First().GetMetadataValue("m2")); 526Assert.Equal(String.Empty, group.First().GetMetadataValue("m3")); 553Assert.Equal("m1", group.First().GetMetadataValue("m1")); 554Assert.Equal("m2", group.First().GetMetadataValue("m2")); 555Assert.Equal(String.Empty, group.First().GetMetadataValue("m3")); 577Assert.Equal("m1", group.First().GetMetadataValue("m1")); 601Assert.Equal("m1", group.First().GetMetadataValue("m1")); 602Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 603Assert.Equal("m3", group.First().GetMetadataValue("m3")); 627Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 628Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 629Assert.Equal("m3", group.First().GetMetadataValue("m3")); 656Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 657Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 658Assert.Equal("m3", group.First().GetMetadataValue("m3")); 726Assert.Equal("a1", i1Group.First().EvaluatedInclude); 727Assert.Equal("m1", i1Group.First().GetMetadataValue("m")); 752Assert.Equal("v0", i1Group.First().EvaluatedInclude); 824Assert.Equal("a.cpp", i1Group.First().EvaluatedInclude); 825Assert.Equal("a.obj", i2Group.First().EvaluatedInclude); 847Assert.Equal("a.cpp", i2Group.First().EvaluatedInclude); 848Assert.Equal("a.obj", i2Group.First().GetMetadataValue("m")); 869Assert.Equal("a1", i1Group.First().EvaluatedInclude); 870Assert.Equal("b2", i2Group.First().EvaluatedInclude); 895Assert.Equal("a1", i1Group.First().EvaluatedInclude); 896Assert.Equal("b1", i2Group.First().EvaluatedInclude); 1004Assert.Equal("v0", i1Group.First().EvaluatedInclude); 1005Assert.Equal("a2", i2Group.First().EvaluatedInclude); 1032Assert.Equal("a1", i1Group.First().EvaluatedInclude); 1034Assert.Equal("m1", i2Group.First().EvaluatedInclude); 1037Assert.Equal("m1", i1Group.First().GetMetadataValue("m")); 1066Assert.Equal("a1", i2Group.First().EvaluatedInclude); 1069Assert.Equal("n1", i2Group.First().GetMetadataValue("n")); 1123Assert.Equal("b1", i1Group.First().EvaluatedInclude); 1126Assert.Equal("m1", i1Group.First().GetMetadataValue("m")); 1130Assert.Equal("m1", i2Group.First().EvaluatedInclude); 1472<i Include='" + oldFiles.First() + "'><output>" + newFiles.First() + @"</output></i> 1491logger.AssertLogContains(new string[] { "start:[]", "end:[" + newFiles.ElementAt(1) + "]", "final:[" + oldFiles.First() + ";" + newFiles.ElementAt(1) + "]" }); 1514<i Include='" + oldFiles.First() + "'><output>" + newFiles.First() + @"</output></i> 1552string oldInput = oldFiles.First(); 1555string newOutput = newFiles.First(); 2150Assert.Equal("a1", i0Group.First().EvaluatedInclude); 2231Assert.Equal("x", i1Group.First().EvaluatedInclude); 2274Assert.Equal("A_PCH", linkGroup.First().EvaluatedInclude); 2416Assert.Equal("m1", p.ItemsToBuildWith["i0"].First().GetMetadataValue("m")); 2454Assert.Equal("a1", p.ItemsToBuildWith["i0"].First().EvaluatedInclude); 2545Assert.Equal("other", lookup.GetItems("i1").First().EvaluatedInclude); 2856ProjectItemInstance item = lookup.GetItems("i1").First(); 2914ProjectItemInstance item = lookup.GetItems("i1").First(); 2965ProjectItemInstance item1 = lookup.GetItems("i1").First(); 2995ProjectItemInstance item1 = lookup.GetItems("i1").First(); 3044ProjectItemInstance item1 = lookup.GetItems("i1").First(); 3075ProjectItemInstance item1 = lookup.GetItems("i1").First(); 3205ProjectItemInstance item = p.ItemsToBuildWith["i0"].First(); 3209item = p.ItemsToBuildWith["i0"].First(); 3253Assert.Equal("m0", p.ItemsToBuildWith["i0"].First().GetMetadataValue("m")); 3254Assert.Equal("n0", p.ItemsToBuildWith["i0"].First().GetMetadataValue("n")); 3255Assert.Equal("m1", p.ItemsToBuildWith["i1"].First().GetMetadataValue("m")); 3256Assert.Equal("n1", p.ItemsToBuildWith["i1"].First().GetMetadataValue("n")); 3261Assert.Equal("m0", p.ItemsToBuildWith["i0"].First().GetMetadataValue("m")); 3262Assert.Equal("n0", p.ItemsToBuildWith["i0"].First().GetMetadataValue("n")); 3546Assert.Equal("gen.obj", instance.GetItems("CppCompile").First().GetMetadataValue("ObjectFile")); 3562<i Include='" + files.First() + "'><output>" + files.ElementAt(1) + @"</output></i> 3582logger.AssertLogContains(new string[] { "final:[" + files.First() + "]" }); 3955ProjectTargetInstanceChild targetChild = projectInstance.Targets["t"].Children.First(); 3990var targetChild = projectInstance.Targets["t"].Children.First();
BackEnd\Lookup_Tests.cs (94)
38Assert.Equal("a2", lookup.GetItems("i1").First().EvaluatedInclude); 39Assert.Equal("a(2", lookup.GetItems("i2").First().EvaluatedInclude); 58Assert.Equal("a1", lookup.GetItems("i1").First().EvaluatedInclude); 59Assert.Equal("a;1", lookup.GetItems("i2").First().EvaluatedInclude); 88Assert.Equal("a1", lookup.GetItems("i1").First().EvaluatedInclude); 92Assert.Equal("a1", table1["i1"].First().EvaluatedInclude); 99Assert.Equal("a1", lookup.GetItems("i1").First().EvaluatedInclude); 103Assert.Equal("a1", table1["i1"].First().EvaluatedInclude); 111Assert.Equal("a1", lookup.GetItems("i1").First().EvaluatedInclude); 116Assert.Equal("a1", table1["i1"].First().EvaluatedInclude); 123Assert.Equal("a1", lookup.GetItems("i1").First().EvaluatedInclude); 128Assert.Equal("a1", table1["i1"].First().EvaluatedInclude); 135Assert.Equal("a1", lookup.GetItems("i1").First().EvaluatedInclude); 140Assert.Equal("a1", table1["i1"].First().EvaluatedInclude); 272Assert.Equal("a2", lookup.GetItems("i1").First().EvaluatedInclude); 287Assert.Equal("a1", table1["i1"].First().EvaluatedInclude); 423Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 424Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 438Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 439Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 442Assert.Equal("m3", group.First().GetMetadataValue("m3")); 450Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 451Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 454Assert.Equal("m3", group.First().GetMetadataValue("m3")); 488Assert.Equal("m1", group.First().GetMetadataValue("m1")); 489Assert.Equal("m2", group.First().GetMetadataValue("m2")); 490Assert.Equal("m3", group.First().GetMetadataValue("m3")); 503Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 504Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 505Assert.Equal(String.Empty, group.First().GetMetadataValue("m3")); 513Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 514Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 515Assert.Equal(String.Empty, group.First().GetMetadataValue("m3")); 548Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 549Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 552Assert.Equal("m3", group.First().GetMetadataValue("m3")); 566Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 567Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 568Assert.Equal(String.Empty, group.First().GetMetadataValue("m3")); 571Assert.Equal("m4", group.First().GetMetadataValue("m4")); 579Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 580Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 581Assert.Equal(String.Empty, group.First().GetMetadataValue("m3")); 584Assert.Equal("m4", group.First().GetMetadataValue("m4")); 619Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 620Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 623Assert.Equal("m3", group.First().GetMetadataValue("m3")); 637Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 638Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 641Assert.Equal("m3", group.First().GetMetadataValue("m3")); 649Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 650Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 653Assert.Equal("m3", group.First().GetMetadataValue("m3")); 686Assert.Equal("m1", group.First().GetMetadataValue("m1")); 689Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 697Assert.Equal("m1", group.First().GetMetadataValue("m1")); 700Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 708Assert.Equal("m1", group.First().GetMetadataValue("m1")); 711Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 740Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 741Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 749Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 750Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 758Assert.Equal(String.Empty, group.First().GetMetadataValue("m1")); 759Assert.Equal(String.Empty, group.First().GetMetadataValue("m2")); 788Assert.Equal("m2", group.First().GetMetadataValue("m")); 798Assert.Equal("m2", group.First().GetMetadataValue("m")); 809Assert.Equal("m2", group.First().GetMetadataValue("m")); 851Assert.Equal("m3", group.First().GetMetadataValue("m")); 852Assert.Equal("n2", group.First().GetMetadataValue("n")); 853Assert.Equal("o3", group.First().GetMetadataValue("o")); 888Assert.Equal("m2", group.First().GetMetadataValue("m")); 913Assert.Equal("m1", group.First().GetMetadataValue("m")); 914Assert.Equal("n1", group.First().GetMetadataValue("n")); 915Assert.Equal("o1", group.First().GetMetadataValue("o")); 928Assert.Equal("m2", foundGroup.First().GetMetadataValue("m")); 929Assert.Equal("n2", foundGroup.First().GetMetadataValue("n")); 930Assert.Equal("o1", foundGroup.First().GetMetadataValue("o")); 940Assert.Equal("m2", foundGroup.First().GetMetadataValue("m")); 941Assert.Equal("n3", foundGroup.First().GetMetadataValue("n")); 942Assert.Equal("o1", foundGroup.First().GetMetadataValue("o")); 954Assert.Equal("m2", foundGroup.First().GetMetadataValue("m")); 955Assert.Equal("n3", foundGroup.First().GetMetadataValue("n")); 956Assert.Equal("o1", foundGroup.First().GetMetadataValue("o")); 989Assert.Equal("m2", group.First().GetMetadataValue("m")); 999Assert.Equal("m2", group.First().GetMetadataValue("m")); 1046ProjectItemInstance item1b = group2.First(); 1058Assert.Equal("m3", group4.First().GetMetadataValue("m")); 1066Assert.Equal("m3", group5.First().GetMetadataValue("m")); 1097ProjectItemInstance item1b = group2.First(); 1109Assert.Equal("m3", group4.First().GetMetadataValue("m")); 1117Assert.Equal("m3", group5.First().GetMetadataValue("m")); 1150ProjectItemInstance item1b = group2.First(); 1187ProjectItemInstance item1b = group2.First();
BackEnd\OnError_Tests.cs (1)
591logger.Errors.First().Code.ShouldBe("MSB4181");
BackEnd\SdkResolverLoader_Tests.cs (4)
113resolversFound.First().ShouldBe(assemblyToLoad); 236resolversFound.First().ShouldBe(assemblyToLoad); 262resolversManifestsFound.First().Path.ShouldBe(assemblyToLoad); 263resolversManifestsFound.First().ResolvableSdkRegex.ToString().ShouldBe("1<.*");
BackEnd\SdkResolverService_Tests.cs (4)
104_logger.Warnings.First().Code.ShouldStartWith("MSB4241"); 323_logger.Warnings.First().Code.ShouldBe("MSB4240"); 325resolver.ResolvedCalls.First().Key.ShouldBe("foo"); 537_logger.Warnings.First().Code.ShouldStartWith("MSB4241");
BackEnd\TaskExecutionHost_Tests.cs (3)
1268ProjectTaskInstance taskInstance = project.Targets["foo"].Tasks.First(); 1303Assert.Equal(value, _bucket.Lookup.GetItems("output").First().EvaluatedInclude); 1315Assert.Equal(0, TaskItemComparer.Instance.Compare(value, new TaskItem(_bucket.Lookup.GetItems("output").First())));
Collections\OMcollections_tests.cs (1)
150Assert.Equal(item1, items["i"].First());
Construction\ProjectImportElement_Tests.cs (2)
30ProjectImportElement importElement = rootElement.Imports.First(); 67ProjectImportElement importElement = rootElement.Imports.First();
Construction\SolutionProjectGenerator_Tests.cs (12)
1534ProjectTargetInstance buildTarget = instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Build", StringComparison.OrdinalIgnoreCase)).First().Value; 1535ProjectTargetInstance cleanTarget = instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Clean", StringComparison.OrdinalIgnoreCase)).First().Value; 1536ProjectTargetInstance rebuildTarget = instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Rebuild", StringComparison.OrdinalIgnoreCase)).First().Value; 1537ProjectTargetInstance publishTarget = instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Publish", StringComparison.OrdinalIgnoreCase)).First().Value; 1542.First().GetParameter("Targets")); 1546.First().GetParameter("Targets")); 1550.First().GetParameter("Targets")); 1554.First().GetParameter("Targets")); 1559.First().GetParameter("Projects")); 1563.First().GetParameter("Projects")); 1567.First().GetParameter("Projects")); 1571.First().GetParameter("Projects"));
Definition\ItemDefinitionGroup_Tests.cs (11)
1462Assert.Equal("m1", p.GetItems("j").First().GetMetadataValue("m")); 1520Assert.Equal("im1", p.GetItems("i").First().GetMetadataValue("m")); 1521Assert.Equal("in1", p.GetItems("i").First().GetMetadataValue("n")); 1522Assert.Equal("io2", p.GetItems("i").First().GetMetadataValue("o")); 1523Assert.Equal("ip1", p.GetItems("i").First().GetMetadataValue("p")); 1524Assert.Equal("", p.GetItems("i").First().GetMetadataValue("q")); 1526Assert.Equal("jm3", p.GetItems("j").First().GetMetadataValue("m")); 1527Assert.Equal("jn3", p.GetItems("j").First().GetMetadataValue("n")); 1528Assert.Equal("", p.GetItems("j").First().GetMetadataValue("o")); 1529Assert.Equal("", p.GetItems("j").First().GetMetadataValue("p")); 1530Assert.Equal("jq3", p.GetItems("j").First().GetMetadataValue("q"));
Definition\ProjectItem_Tests.cs (2)
41Assert.True(Object.ReferenceEquals(item1.DirectMetadata.First().Xml, item2.DirectMetadata.First().Xml));
EscapingInProjects_Tests.cs (12)
368Assert.Equal("*.weirdo", newItems.First().UnevaluatedInclude); 369Assert.Equal("foo%3Bbar.weirdo", newItems.First().EvaluatedInclude); 370Assert.Equal("foo%253Bbar.weirdo", Project.GetEvaluatedItemIncludeEscaped(newItems.First())); 478Assert.Equal("MyWildCard", newItems.First().ItemType); // "Newly added item should have correct ItemType" 479Assert.Equal("*.weirdo", newItems.First().UnevaluatedInclude); // "Newly added item should have correct UnevaluatedInclude" 480Assert.Equal("foo%253bbar.weirdo", Project.GetEvaluatedItemIncludeEscaped(newItems.First())); // "Newly added item should have correct EvaluatedIncludeEscaped" 481Assert.Equal("foo%3bbar.weirdo", newItems.First().EvaluatedInclude); // "Newly added item should have correct EvaluatedInclude" 520Assert.Equal("MyWildCard", newItems.First().ItemType); // "Newly added item should have correct ItemType" 521Assert.Equal("*.AAA%253bBBB", newItems.First().UnevaluatedInclude); // "Newly added item should have correct UnevaluatedInclude" 522Assert.Equal("foo.AAA%253bBBB", Project.GetEvaluatedItemIncludeEscaped(newItems.First())); // "Newly added item should have correct EvaluatedIncludeEscaped" 523Assert.Equal("foo.AAA%3bBBB", newItems.First().EvaluatedInclude); // "Newly added item should have correct EvaluatedInclude" 654Assert.Equal(projectAbsolutePath, items.First().GetMetadataValue("FullPath"));
Evaluation\Evaluator_Tests.cs (5)
1453ProjectPropertyElement xml1 = project.Xml.Properties.First(); 1687project.Xml.Items.First().Metadata.First(); 1726project.Xml.Items.First().Metadata.First();
Globbing\CompositeGlob_Tests.cs (2)
168Assert.Same(glob1, composite.Globs.First()); 169Assert.Same(glob2, composite.Globs.Skip(1).First());
Graph\GraphLoadedFromSolution_tests.cs (3)
184graph.First(), 602edges.First().Value.ItemType.ShouldBe(ItemTypeNames.ProjectReference); 705var expectedCurrentConfiguration = currentSolutionConfiguration ?? solutionConfigurations.First();
Graph\GraphTestingUtilities.cs (1)
133return GetNodesWithProjectNumber(graph, projectNum).First();
Graph\IsolateProjects_Tests.cs (9)
210logger.Errors.First() 213logger.Errors.First().BuildEventContext.ShouldNotBe(BuildEventContext.Invalid); 215logger.Errors.First().BuildEventContext.NodeId.ShouldNotBe(BuildEventContext.InvalidNodeId); 216logger.Errors.First().BuildEventContext.ProjectInstanceId.ShouldNotBe(BuildEventContext.InvalidProjectInstanceId); 217logger.Errors.First().BuildEventContext.ProjectContextId.ShouldNotBe(BuildEventContext.InvalidProjectContextId); 218logger.Errors.First().BuildEventContext.TargetId.ShouldNotBe(BuildEventContext.InvalidTargetId); 219logger.Errors.First().BuildEventContext.TaskId.ShouldNotBe(BuildEventContext.InvalidTaskId); 423logger.Errors.First().Message.ShouldStartWith("MSB4254:"); 440logger.Errors.First().Message.ShouldStartWith("MSB4254:");
Graph\ProjectGraph_Tests.cs (47)
67projectGraph.ProjectNodes.First().ProjectInstance.FullPath.ShouldBe(entryProject.Path); 118projectGraph.ProjectNodes.First().ProjectInstance.FullPath.ShouldBe(entryProject.Path); 409GetFirstNodeWithProjectNumber(graph, 2).ProjectReferences.First().ShouldNotBe(GetFirstNodeWithProjectNumber(graph, 3).ProjectReferences.First()); 410GetFirstNodeWithProjectNumber(graph, 2).ProjectReferences.First().ProjectInstance.FullPath.ShouldEndWith("4.proj"); 411GetFirstNodeWithProjectNumber(graph, 2).ProjectReferences.First().ProjectInstance.GlobalProperties.ShouldBeSameIgnoringOrder(EmptyGlobalProperties); 412GetFirstNodeWithProjectNumber(graph, 3).ProjectReferences.First().ProjectInstance.FullPath.ShouldEndWith("4.proj"); 413GetFirstNodeWithProjectNumber(graph, 3).ProjectReferences.First().ProjectInstance.GlobalProperties.Count.ShouldBeGreaterThan(1); 466var node4A = GetFirstNodeWithProjectNumber(graph, 2).ProjectReferences.First(); 467var node4B = GetFirstNodeWithProjectNumber(graph, 3).ProjectReferences.First(); 472node4A.ProjectReferences.First().ShouldBe(node4B.ProjectReferences.First()); 503GetFirstNodeWithProjectNumber(graph, 2).ProjectReferences.First().ShouldBe(GetFirstNodeWithProjectNumber(graph, 3).ProjectReferences.First()); 538GetFirstNodeWithProjectNumber(graph, 2).ProjectReferences.First().ShouldBe(GetFirstNodeWithProjectNumber(graph, 3).ProjectReferences.First()); 539GetFirstNodeWithProjectNumber(graph, 2).ProjectReferences.First().ProjectInstance.FullPath.ShouldEndWith("5.proj"); 540GetFirstNodeWithProjectNumber(graph, 2).ProjectReferences.First().ProjectInstance.GlobalProperties["FoO"].ShouldBe("bar"); 543GetFirstNodeWithProjectNumber(graph, 4).ProjectReferences.First().ShouldNotBe(GetFirstNodeWithProjectNumber(graph, 2).ProjectReferences.First()); 544GetFirstNodeWithProjectNumber(graph, 4).ProjectReferences.First().ProjectInstance.FullPath.ShouldEndWith("5.proj"); 545GetFirstNodeWithProjectNumber(graph, 4).ProjectReferences.First().ProjectInstance.GlobalProperties["FoO"].ShouldBe("BAR"); 585node1.ProjectReferences.First().ShouldBe(node3); 587node2.ProjectReferences.First().ShouldBe(node3); 606var entryPointNode1 = projectGraph.EntryPointNodes.First(); 618entryPointNode1.ProjectReferences.First().ShouldNotBe(entryPointNode2.ProjectReferences.First()); 619entryPointNode1.ProjectReferences.First().ProjectInstance.FullPath.ShouldBe(entryPointNode2.ProjectReferences.First().ProjectInstance.FullPath); 620entryPointNode1.ProjectReferences.First().ProjectInstance.GlobalProperties["Platform"].ShouldBe("x86"); 621entryPointNode2.ProjectReferences.First().ProjectInstance.GlobalProperties["Platform"].ShouldBe("x64"); 645var entryPointNode1 = projectGraph.EntryPointNodes.First(); 657entryPointNode1.ProjectReferences.First().ShouldBe(entryPointNode2.ProjectReferences.First()); 658entryPointNode1.ProjectReferences.First().ProjectInstance.GlobalProperties.ContainsKey("Platform").ShouldBeFalse(); 1618string project1ErrorMessage = project1MockLogger.Errors.First().Message; 1890var outerBuild = graph.GraphRoots.First(); 2003AssertOuterBuild(graph.GraphRoots.First(), graph); 2031AssertInnerBuildEvaluation(graph.GraphRoots.First(), false, new Dictionary<string, string>()); 2050AssertInnerBuildEvaluation(graph.GraphRoots.First(), true, new Dictionary<string, string>()); 2071AssertOuterBuild(graph.GraphRoots.First(), graph); 2098AssertOuterBuild(graph.GraphRoots.First(), graph); 2148two.ProjectReferences.First().ShouldBe(referencedInnerBuild); 2172var rootNode = graph.GraphRoots.First(); 2176var innerBuildNode = rootNode.ProjectReferences.First(); 2181AssertNonMultitargetingNode(innerBuildNode.ProjectReferences.First(), additionalGlobalProperties); 2351projectGraph.ProjectNodes.First().ProjectInstance.GlobalProperties[PropertyNames.IsGraphBuild].ShouldBe("xyz");
Graph\ResultCacheBasedBuilds_Tests.cs (14)
116_logger.Errors.First().Message.ShouldContain("MSB4255:"); 141result.ResultsByTarget["Build"].Items.First() 173resultFromCachedBuild.ResultsByTarget["Build"].Items.First().ItemSpec.ShouldBe("1"); 362var rootNodeBuildResult = buildResults.First(); 368configEntries.First().ConfigurationId.ShouldBe(rootNodeBuildResult.ConfigurationId); 398results["1"].Logger.Errors.First().Message.ShouldContain("MSB4252"); 400results["1"].Logger.Errors.First().BuildEventContext.NodeId.ShouldNotBe(BuildEventContext.InvalidNodeId); 401results["1"].Logger.Errors.First().BuildEventContext.ProjectInstanceId.ShouldNotBe(BuildEventContext.InvalidProjectInstanceId); 402results["1"].Logger.Errors.First().BuildEventContext.ProjectContextId.ShouldNotBe(BuildEventContext.InvalidProjectContextId); 403results["1"].Logger.Errors.First().BuildEventContext.TargetId.ShouldNotBe(BuildEventContext.InvalidTargetId); 404results["1"].Logger.Errors.First().BuildEventContext.TaskId.ShouldNotBe(BuildEventContext.InvalidTaskId); 570_logger.Errors.First().Message.ShouldContain("MSB4255:"); 571_logger.Errors.First().Message.ShouldContain("FileDoesNotExist1"); 572_logger.Errors.First().Message.ShouldContain("FileDoesNotExist2");
PrintLineDebugger_Tests.cs (3)
50writer.Logs.First().ShouldEndWith("Hello World"); 75writer1.Logs.First().ShouldEndWith("Hello World"); 94writer.Logs.First().ShouldEndWith("Hello World");
ProjectCache\ProjectCacheTests.cs (10)
61SearchOption.AllDirectories).First(); 538logger.FullLog.ShouldNotContain($"EntryPoint: {graph.GraphRoots.First().ProjectInstance.FullPath}"); 539logger.FullLog.ShouldContain($"EntryPoint: {graph.GraphRoots.First().ProjectReferences.First().ProjectInstance.FullPath}"); 684var rootNode = graph.GraphRoots.First(); 849var itemResult = targetResult.Items.First(); 903mockCache.Requests.First().ProjectFullPath.ShouldEndWith("1.proj"); 1197logger.BuildFinishedEvents.First().Succeeded.ShouldBeFalse(); 1304logger.BuildFinishedEvents.First().Succeeded.ShouldBeFalse(); 1498buildSession.BuildProjectFile(graph.GraphRoots.First().ProjectInstance.FullPath).ShouldHaveSucceeded();
TypeLoader_Tests.cs (1)
107string portableTaskPath = Path.Combine(Directory.GetDirectories(PortableTaskFolderPath).First(), "netstandard2.0", "OldMSBuild");
Microsoft.Build.Tasks.Core (2)
BootstrapperUtil\BootstrapperBuilder.cs (1)
768Product p = buildQueue.Values.First();
WriteCodeFragment.cs (1)
518.First();
Microsoft.Build.Tasks.UnitTests (10)
AssemblyNameEx_Tests.cs (1)
721assemblyNameDeserialized.RemappedFromEnumerator.First().ShouldBe(assemblyRemappedFrom);
MSBuild_Tests.cs (2)
1481.First() 1517.First()
PortableTasks_Tests.cs (2)
56new DirectoryInfo(PortableTaskFolderPath).EnumerateDirectories().First().EnumerateDirectories().First();
PrintLineDebugger_Tests.cs (3)
50writer.Logs.First().ShouldEndWith("Hello World"); 75writer1.Logs.First().ShouldEndWith("Hello World"); 94writer.Logs.First().ShouldEndWith("Hello World");
SGen_Tests.cs (1)
45logger.Errors.First().Code.ShouldBe("MSB3474");
XmlPoke_Tests.cs (1)
114var testNodes = nodes?.First().ChildNodes.Cast<XmlElement>().ToList();
Microsoft.Build.UnitTests.Shared (1)
EngineTestEnvironment.cs (1)
211mockLogger = expectedLoggers.OfType<MockLogger>().First();
Microsoft.Build.Utilities.UnitTests (5)
PlatformManifest_Tests.cs (2)
210PlatformManifest.DependentPlatform platform = manifest.Manifest.DependentPlatforms.First(); 215ApiContract contract = manifest.Manifest.ApiContracts.First();
PrintLineDebugger_Tests.cs (3)
50writer.Logs.First().ShouldEndWith("Hello World"); 75writer1.Logs.First().ShouldEndWith("Hello World"); 94writer.Logs.First().ShouldEndWith("Hello World");
Microsoft.Cci.Extensions (5)
Extensions\CSharp\CSharpCciExtensions.cs (3)
435if (methodDefinition.ParameterCount == 1 && !TypeHelper.TypesAreEquivalent(methodDefinition.Parameters.First().Type, methodDefinition.ContainingTypeDefinition.PlatformType.SystemBoolean)) 548IMethodDefinition propertyRep = property.Accessors.First().ResolvedMethod; 868InterfaceImplementation iImpl = foundInterfaces.First();
Writers\CSharp\CSDeclarationWriter.Events.cs (1)
14IMethodDefinition accessor = evnt.Accessors.First().ResolvedMethod;
Writers\CSharp\CSharpWriter.cs (1)
271var onlyField = excludedFields.First();
Microsoft.CodeAnalysis (2)
CommandLine\CommonCompiler.cs (1)
626foreach (var assembly in currentAssembly.Modules.First().ReferencedAssemblySymbols.OrderBy(a => a.Name))
InternalUtilities\EnumerableExtensions.cs (1)
708var count = data.First().Count();
Microsoft.CodeAnalysis.CodeStyle (4)
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
708var count = data.First().Count();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ICompilationExtensions.cs (1)
46var referencedAssemblySymbols = compilation.Assembly.Modules.First().ReferencedAssemblySymbols;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
362return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
301var fullSpan = nodes.First().Span;
Microsoft.CodeAnalysis.CodeStyle.Fixes (7)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (2)
103var nodeAfterNewParamNode = paramNodes.FirstOrDefault() ?? newDocComment.ChildNodes().First(); 116GetNewNode(parameterName, nodeAfterNewParamNode == newDocComment.ChildNodes().First())
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (2)
110var commonType = commonTypes.First(); 119return similarTypes.First();
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (1)
101.First();
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
262var left = QualifiedNameToMemberAccess(qualifiedNameSyntaxKind, memberAccessExpressionSyntaxKind, expression.ChildNodes().First(), generator);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextExtensions.cs (1)
13=> FixAllHelper.GetDefaultFixAllTitle(context.Scope, title: context.DiagnosticIds.First(), context.Document!, context.Project);
Microsoft.CodeAnalysis.CSharp (10)
Binder\Binder_Statements.cs (1)
3875containerNode = containingType.DeclaringSyntaxReferences.Select(r => r.GetSyntax()).OfType<TypeDeclarationSyntax>().First();
Binder\Semantics\OverloadResolution\MemberAnalysisResult.cs (1)
173public int FirstBadArgument => BadArgumentsOpt.TrueBits().First();
BoundTree\UnboundLambda.cs (1)
1247return candidates.First().Value;
Compilation\CSharpCompilation.cs (2)
2131diagnostics.Add(new CSDiagnostic(info, viableEntryPoints.First().GetFirstLocation())); 4978_cache[mergedNamespace.ConstituentNamespaces.OfType<SourceNamespaceSymbol>().First().MergedDeclaration] = symbol;
FlowAnalysis\NullableWalker_Patterns.cs (1)
901var leaf = nodes.Where(n => n is BoundLeafDecisionDagNode leaf && leaf.Label == node.DefaultLabel).First();
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
859return SpecializedCollections.SingletonCollection(names.First());
Symbols\Source\SourceLocalSymbol.cs (1)
175Contains(nodeToBind.Ancestors().OfType<StatementSyntax>().First().Kind()) ||
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorConstructor.cs (1)
30var field = ContainingType.GetFieldsToEmit().First();
Utilities\ValueSetFactory.EnumeratedValueSet.cs (1)
54return _tc.ToConstantValue(_membersIncludedOrExcluded.OrderBy(k => k).First());
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (1)
63return root.Members.OfType<GlobalStatementSyntax>().First().GetFirstToken().GetLocation();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
302var expression = (ExpressionSyntax)currentReplacedNode.ChildNodes().First();
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
121.First();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\QueryExpressionSyntaxExtensions.cs (1)
36var fromClause = (FromClauseSyntax)allClauses.First();
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryExpressionParenthesesTests.cs (1)
2884var expectedSpans = workspace.Documents.First().AnnotatedSpans;
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (16)
CommandLineTests.cs (16)
757Assert.Equal((int)ErrorCode.ERR_CantOpenWin32Manifest, errors.First().Code); 758Assert.Equal(2, errors.First().Arguments.Count()); 769Assert.Equal((int)ErrorCode.ERR_CantOpenIcon, errors.First().Code); 770Assert.Equal(2, errors.First().Arguments.Count()); 780Assert.Equal((int)ErrorCode.ERR_CantOpenWin32Res, errors.First().Code); 781Assert.Equal(2, errors.First().Arguments.Count()); 791Assert.Equal((int)ErrorCode.ERR_CantOpenWin32Res, errors.First().Code); 792Assert.Equal(2, errors.First().Arguments.Count()); 802Assert.Equal((int)ErrorCode.ERR_CantOpenIcon, errors.First().Code); 803Assert.Equal(2, errors.First().Arguments.Count()); 813Assert.Equal((int)ErrorCode.ERR_CantOpenWin32Manifest, errors.First().Code); 814Assert.Equal(2, errors.First().Arguments.Count()); 882Assert.Equal((int)ErrorCode.ERR_ErrorBuildingWin32Resources, errors.First().Code); 883Assert.Equal(1, errors.First().Arguments.Count()); 10377var syntaxTreeInput = ctx.CompilationProvider.Select((c, _) => c.SyntaxTrees.First()); 14651var classOptions = gc.AnalyzerConfigOptions.GetOptions(gc.Compilation.SyntaxTrees.First());
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (66)
AddMissingImports\CSharpAddMissingImportsRefactoringProviderTests.cs (1)
31var hostDocument = workspace.Documents.First();
Classification\SemanticClassifierTests.cs (2)
37var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().Id); 3919var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().Id);
Classification\SyntacticClassifierTests.cs (6)
24var document = workspace.CurrentSolution.Projects.First().Documents.First(); 6050var document = workspace.CurrentSolution.Projects.First().Documents.First(); 6080var document = workspace.CurrentSolution.Projects.First().Documents.First();
Classification\SyntacticTaggerTests.cs (2)
39var document = workspace.Documents.First(); 91var document = workspace.Documents.First();
Classification\TotalClassifierTests.cs (3)
35var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().Id); 3055var document = workspace.Documents.First(); 3157var document = workspace.Documents.First();
CodeActions\PreviewExceptionTests.cs (1)
98workspace, document, textBuffer, provider, codeActions.First(), fixAllFlavors: null);
CommentSelection\CSharpCommentSelectionTests.cs (2)
131var doc = workspace.Documents.First(); 157textView.Selection.Select(new VirtualSnapshotPoint(snapshot, spans.First().Start),
Completion\ArgumentProviders\ArgumentProviderOrderTests.cs (1)
103var firstArgumentProvider = orderedCSharpArgumentProviders.First();
Completion\CompletionProviders\CompletionProviderOrderTests.cs (1)
135var firstCompletionProvider = orderedCSharpCompletionProviders.First();
Debugging\DataTipInfoGetterTests.cs (2)
55workspace.CurrentSolution.Projects.First().Documents.First(),
ExtractMethod\ExtractMethodBase.cs (2)
37var testDocument = workspace.Documents.First(); 190var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
Formatting\Indentation\CSharpFormatterTestsBase.cs (2)
73var document = buffer.CurrentSnapshot.GetRelatedDocumentsWithChanges().First(); 119var buffer = workspace.Documents.First().GetTextBuffer();
Formatting\Indentation\SmartIndenterEnterOnTokenTests.cs (2)
1401var hostdoc = workspace.Documents.First(); 1440var hostdoc = workspace.Documents.First();
Formatting\Indentation\SmartIndenterTests.cs (1)
3545var wpfTextView = workspace.Documents.First().GetTextView();
Formatting\Indentation\SmartTokenFormatterFormatTokenTests.cs (1)
613var buffer = workspace.Documents.First().GetTextBuffer();
Interactive\BraceMatching\InteractiveBraceHighlightingTests.cs (4)
54var buffer = workspace.Documents.First().GetTextBuffer(); 82var buffer = workspace.Documents.First().GetTextBuffer(); 111var buffer = workspace.Documents.First().GetTextBuffer(); 167var buffer = workspace.Documents.First().GetTextBuffer();
LineSeparators\LineSeparatorTests.cs (1)
598var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().Id);
Organizing\AbstractOrganizerTests.cs (1)
29var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (1)
224var project = workspace.CurrentSolution.Projects.First();
PdbSourceDocument\ImplementationAssemblyLookupServiceTests.cs (10)
170var implProject = workspace.CurrentSolution.Projects.First(); 237var implProject = workspace.CurrentSolution.Projects.First(); 298var implProject = workspace.CurrentSolution.Projects.First(); 353var implProject = workspace.CurrentSolution.Projects.First(); 404var implProject = workspace.CurrentSolution.Projects.First(); 469var implProject = workspace.CurrentSolution.Projects.First(); 527var implProject = workspace.CurrentSolution.Projects.First(); 534implProject = workspace.CurrentSolution.Projects.First().AddMetadataReference(MetadataReference.CreateFromFile(dllFilePath)); 542implProject = workspace.CurrentSolution.Projects.First(); 548implProject = workspace.CurrentSolution.Projects.First().AddMetadataReference(MetadataReference.CreateFromFile(realImplementationDllFilePath));
PdbSourceDocument\PdbSourceDocumentTests.cs (3)
484var implProject = workspace.CurrentSolution.Projects.First(); 531var implProject = workspace.CurrentSolution.Projects.First(); 936var project = workspace.CurrentSolution.Projects.First();
QuickInfo\DiagnosticAnalyzerQuickInfoSourceTests.cs (2)
217var document = workspace.CurrentSolution.Projects.First().Documents.First();
QuickInfo\SyntacticQuickInfoSourceTests.cs (3)
573var textElement = textElements.First(); 604var document = workspace.CurrentSolution.Projects.First().Documents.First();
StringIndentation\StringIndentationTests.cs (1)
30var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().Id);
SymbolKey\SymbolKeyCompilationsTests.cs (4)
603sym1 = comp1.Assembly.Modules.First(); 604sym2 = comp2.Assembly.Modules.First(); 636var module1 = compilation1.Assembly.Modules.First(); 637var module2 = compilation2.Assembly.Modules.First();
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (1)
257var model = comp40.GetSemanticModel(comp40.SyntaxTrees.First());
TextStructureNavigation\TextStructureNavigatorTests.cs (1)
508var buffer = workspace.Documents.First().GetTextBuffer();
Utilities\CSharpServiceTestExtensions.cs (2)
40return node.ChildNodes().OfType<T>().First(); 50=> (syntaxTree.GetRoot() as CompilationUnitSyntax).Members.OfType<TypeDeclarationSyntax>().First();
Workspaces\WorkspaceTests_EditorFeatures.cs (3)
250var tree = await currentSnapshot.Projects.First().Documents.First().GetSyntaxTreeAsync(); 705var doc = solution.Projects.Single().Documents.First();
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (94)
CodeGen\CodeGenCapturing.cs (1)
432var fields = methods.First().CaptureContext.VariablesByScope[0];
CodeGen\CodeGenDeconstructTests.cs (30)
96var lhs = tree.GetRoot().DescendantNodes().OfType<TupleExpressionSyntax>().First(); 253var tree = comp.Compilation.SyntaxTrees.First(); 1109var tree = comp.Compilation.SyntaxTrees.First(); 2285var tree = comp.Compilation.SyntaxTrees.First(); 2688var lhs = tree.GetRoot().DescendantNodes().OfType<TupleExpressionSyntax>().First(); 3130var lhs = tree.GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().First(); 3178var lhs = tree.GetRoot().DescendantNodes().OfType<TupleExpressionSyntax>().First(); 3242var x123 = tree.GetRoot().DescendantNodes().OfType<TupleExpressionSyntax>().First(); 3280var lhs = tree.GetRoot().DescendantNodes().OfType<TupleExpressionSyntax>().First(); 3330var lhs = tree.GetRoot().DescendantNodes().OfType<TupleExpressionSyntax>().First(); 3443var lhs = tree.GetRoot().DescendantNodes().OfType<TupleExpressionSyntax>().First(); 3479var lhs = tree.GetRoot().DescendantNodes().OfType<TupleExpressionSyntax>().First(); 5504var firstY = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(d => d.Identifier.ValueText == "y").First(); 5535var firstX = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().Where(d => d.Identifier.ValueText == "x").First(); 5908var discard1 = GetDiscardDesignations(tree).First(); 5999var discard = GetDiscardIdentifiers(tree).First(); 6254var discard = GetDiscardIdentifiers(tree).First(); 6305var discard1 = GetDiscardIdentifiers(tree).First(); 6337var discard1 = GetDiscardDesignations(tree).First(); 6367var discard = GetDiscardIdentifiers(tree).First(); 6394DiscardDesignationSyntax discard1 = GetDiscardDesignations(tree).First(); 6403IdentifierNameSyntax discard2 = GetDiscardIdentifiers(tree).First(); 6562var discard1 = GetDiscardIdentifiers(tree).First(); 6860var discard1 = GetDiscardDesignations(tree).First(); 6975var discard1 = GetDiscardDesignations(tree).First(); 6993var discard3 = GetDiscardIdentifiers(tree).First(); 7067var discard = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().First(); 7431Assert.Equal("int", model.GetTypeInfo(x1Ref.First()).Type.ToDisplayString()); 7436Assert.Equal("string[]", model.GetTypeInfo(x2Ref.First()).Type.ToDisplayString()); 9010var node = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().First();
CodeGen\CodeGenTupleEqualityTests.cs (8)
358var tree = comp.Compilation.SyntaxTrees.First(); 362var tupleX = tree.GetCompilationUnitRoot().DescendantNodes().OfType<TupleExpressionSyntax>().First(); 679var tree = comp.Compilation.SyntaxTrees.First(); 710var tree = comp.Compilation.SyntaxTrees.First(); 2574var firstEquals = tree.GetCompilationUnitRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().First(); 4083var comparison = tree.GetCompilationUnitRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().First(); 5122var equals = tree.GetCompilationUnitRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().First(); 5158var equals = tree.GetCompilationUnitRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().First();
CodeGen\CodeGenTupleTest.cs (54)
1615var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 3220var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 3253var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 4156var node = nodes.OfType<MemberAccessExpressionSyntax>().Where(n => n.ToString() == "x.Rest").First(); 7497var declaration = tree.GetRoot().DescendantNodes().OfType<LocalDeclarationStatementSyntax>().First(); 7530var declaration = tree.GetRoot().DescendantNodes().OfType<LocalDeclarationStatementSyntax>().First(); 8299var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 8356var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 8414var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 8461var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 8558var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 8605var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 8640var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 8669var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 8698var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 8727var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 8783var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 8812var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 8856var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 8901var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 8966var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 9143var node = nodes.OfType<TupleExpressionSyntax>().First(); 9224var node = nodes.OfType<TupleExpressionSyntax>().First(); 9307var node = nodes.OfType<TupleExpressionSyntax>().First(); 12693var node = tree.GetRoot().DescendantNodes().OfType<TupleExpressionSyntax>().First(); 14275var f1 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "F1").First(); 14289var p1 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "P1").First(); 16568var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 16605var x = nodes.OfType<VariableDeclaratorSyntax>().First(); 17410var secondElement = nodes.OfType<TupleExpressionSyntax>().First().Arguments[1]; 19063var expr1 = exprs.First(); 19102var expr1 = exprs.First(); 19141var expr1 = exprs.First(); 19180var expr1 = exprs.First(); 19231var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(1).First()); 19234var x2 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(5).First()); 19396var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(1).First()); 19399var x2 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(2).First()); 19426var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().Skip(1).First()); 19480var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().First()); 19538var x1 = model.GetDeclaredSymbol(nodes.OfType<VariableDeclaratorSyntax>().First()); 19661var invocation1 = model.GetSymbolInfo(nodes.OfType<InvocationExpressionSyntax>().First()); 19664var invocation2 = model.GetSymbolInfo(nodes.OfType<InvocationExpressionSyntax>().Skip(4).First()); 19667var invocation3 = model.GetSymbolInfo(nodes.OfType<InvocationExpressionSyntax>().Skip(5).First()); 19705var invocation1 = model.GetSymbolInfo(nodes.OfType<InvocationExpressionSyntax>().First()); 19708var invocation2 = model.GetSymbolInfo(nodes.OfType<InvocationExpressionSyntax>().Skip(1).First()); 19711var invocation3 = model.GetSymbolInfo(nodes.OfType<InvocationExpressionSyntax>().Skip(2).First()); 19736var invocation1 = model.GetSymbolInfo(nodes.OfType<InvocationExpressionSyntax>().First()); 20359var c1 = nodes.OfType<ClassDeclarationSyntax>().First(); 20364var c2 = nodes.OfType<ClassDeclarationSyntax>().Skip(1).First(); 20368var c3 = nodes.OfType<ClassDeclarationSyntax>().Skip(2).First(); 21352var x1 = nodes.OfType<VariableDeclaratorSyntax>().First(); 21355var x2 = nodes.OfType<VariableDeclaratorSyntax>().Skip(1).First(); 22857var x = nodes.OfType<VariableDeclaratorSyntax>().First();
CodeGen\ObjectAndCollectionInitializerTests.cs (1)
3587var tree = comp.SyntaxTrees.First();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (16)
CodeGen\IndexAndRangeTests.cs (6)
91var node = tree.GetRoot().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().Skip(2).First(); 332var node = tree.GetRoot().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().First(); 419var node = tree.GetRoot().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().First(); 506var node = tree.GetRoot().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().First(); 1573var node = tree.GetRoot().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().First(); 1808var node = tree.GetRoot().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().First();
Emit\NumericIntPtrTests.cs (10)
11173var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref; 11196var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref; 11224var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref; 11249var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref; 11294var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (105)
Attributes\AttributeTests.cs (4)
934var attrSyntax = root.DescendantNodes().OfType<AttributeSyntax>().First(); 938var newAttrSyntax = newRoot.DescendantNodes().OfType<AttributeSyntax>().First(); 11637var firstArgument = tree.GetRoot().DescendantNodes().OfType<AttributeArgumentSyntax>().First(); 11641var secondArgument = tree.GetRoot().DescendantNodes().OfType<AttributeArgumentSyntax>().Skip(1).First();
Attributes\AttributeTests_Nullable.cs (1)
148var interfaceImpl1 = reader.GetInterfaceImplementation(interfaceHandles.First());
Attributes\AttributeTests_Security.cs (1)
58var securityAttribute = typeSecurityAttributes.First();
Diagnostics\DiagnosticAnalyzerTests.cs (2)
3749var localDecl1 = tree.GetRoot().DescendantNodes().OfType<LocalDeclarationStatementSyntax>().First(); 4310var localDeclaration = tree.GetRoot().DescendantNodes().OfType<LocalDeclarationStatementSyntax>().First();
Diagnostics\GetDiagnosticsTests.cs (3)
782var localDecl = syntaxTree.GetRoot().DescendantNodes().OfType<LocalDeclarationStatementSyntax>().First(); 1061var localDecl = syntaxTree.GetRoot().DescendantNodes().OfType<LocalDeclarationStatementSyntax>().First(); 1549var localDecl = tree1.GetRoot().DescendantNodes().OfType<LocalDeclarationStatementSyntax>().First();
FirstClassSpanTests.cs (1)
4908var aVariable = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First();
FlowAnalysis\RegionAnalysisTests.cs (8)
2536var propertyDataFlowAnalysis = dataFlowAnalysisResults.First(); 3102var statement = compilation.SyntaxTrees[0].GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<StatementSyntax>().First(); 4527var stmt2 = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<StatementSyntax>().Where(n => n.ToString().StartsWith(keyword)).First(); 5487var methodBlock = tree.GetCompilationUnitRoot().DescendantNodes().OfType<BlockSyntax>().First(); 5488var foreachStatement = methodBlock.DescendantNodes().OfType<ForEachStatementSyntax>().First(); 5489var foreachBlock = foreachStatement.DescendantNodes().OfType<BlockSyntax>().First(); 5490var lambdaExpression = methodBlock.DescendantNodes().OfType<ParenthesizedLambdaExpressionSyntax>().First(); 5491var lambdaBlock = lambdaExpression.DescendantNodes().OfType<BlockSyntax>().First();
OverloadResolutionPriorityTests.cs (3)
978var secondCtor = tree.GetRoot().DescendantNodes().OfType<ConstructorDeclarationSyntax>().Skip(ctorToForce).First(); 2220var invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 2318var invocation = tree.GetRoot().DescendantNodes().OfType<ObjectCreationExpressionSyntax>().First();
RefStructInterfacesTests.cs (5)
7984var foreachSyntax = tree.GetRoot().DescendantNodes().OfType<ForEachStatementSyntax>().First(); 11066var foreachSyntax = tree.GetRoot().DescendantNodes().OfType<ForEachStatementSyntax>().First(); 14965var foreachSyntax = tree.GetRoot().DescendantNodes().OfType<ForEachStatementSyntax>().First(); 18182var foreachSyntax = tree.GetRoot().DescendantNodes().OfType<ForEachStatementSyntax>().First(); 21305var declarator = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First();
Semantics\CollectionExpressionTests.cs (3)
4809var invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 33548var collectionExpression = tree.GetRoot().DescendantNodes().OfType<CollectionExpressionSyntax>().First(); 33589var collectionExpression = tree.GetRoot().DescendantNodes().OfType<CollectionExpressionSyntax>().First();
Semantics\InlineArrayTests.cs (3)
2508var f = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "F").First(); 6033var f = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "F").First(); 16495var m3 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "M3").First().Parent;
Semantics\OutVarTests.cs (20)
5313var node = tree.GetRoot().DescendantNodes().OfType<EqualsValueClauseSyntax>().First(); 11077var node = tree.GetRoot().DescendantNodes().OfType<EqualsValueClauseSyntax>().First(); 20954Assert.True(decl.Ancestors().OfType<VariableDeclaratorSyntax>().First().ArgumentList.Contains(decl)); 32948var discard3 = GetDiscardIdentifiers(tree).First(); 33047var discard3 = GetDiscardIdentifiers(tree).First(); 33646var z1 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "z1").First(); 35616var statementBefore = identifierBefore.Ancestors().OfType<StatementSyntax>().First(); 35953var blockBodySyntax = tree.GetRoot().DescendantNodes().OfType<BlockSyntax>().First(); 35978var expressionBodySyntax = tree.GetRoot().DescendantNodes().OfType<ArrowExpressionClauseSyntax>().First(); 36001var declarationSyntax = tree.GetRoot().DescendantNodes().OfType<ConstructorDeclarationSyntax>().First(); 36074var expressionBodySyntax = tree.GetRoot().DescendantNodes().OfType<ArrowExpressionClauseSyntax>().First(); 36098var blockBodySyntax = tree.GetRoot().DescendantNodes().OfType<BlockSyntax>().First(); 36182var node3 = tree.GetRoot().DescendantNodes().OfType<ArrowExpressionClauseSyntax>().First(); 36315var method = tree2.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First(); 36361var method = tree2.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First(); 36364var invocation = tree2.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().Skip(1).First(); 36401var method = tree2.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First(); 36443var method = tree2.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First(); 36478var method = tree2.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First(); 36516var method = tree2.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First();
Semantics\ParamsCollectionTests.cs (2)
4340var parameter = (IParameterSymbol)model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().First()); 4346parameter = (IParameterSymbol)model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Skip(1).First());
Semantics\PatternMatchingTestBase.cs (2)
350Assert.True(decl.Ancestors().OfType<VariableDeclaratorSyntax>().First().ArgumentList.Contains(decl)); 449var tree = comp.SyntaxTrees.First();
Semantics\PatternMatchingTests.cs (6)
3577var node = tree.GetRoot().DescendantNodes().OfType<IsPatternExpressionSyntax>().First(); 4291var discard1 = GetDiscardDesignations(tree).First(); 4298var discard2 = GetDiscardDesignations(tree).Skip(1).First(); 4305var discard3 = GetDiscardDesignations(tree).Skip(2).First(); 4312var discard4 = GetDiscardDesignations(tree).Skip(3).First(); 6573var caseDefault = tree.GetRoot().DescendantNodes().OfType<CasePatternSwitchLabelSyntax>().First();
Semantics\PatternMatchingTests4.cs (1)
4828var x = tree.GetRoot().DescendantNodes().OfType<SingleVariableDesignationSyntax>().First();
Semantics\PrimaryConstructorTests.cs (19)
1184var equalsValue = tree.GetRoot().DescendantNodes().OfType<EqualsValueClauseSyntax>().First(); 1311var y = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "y").First(); 1324var test = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").First(); 1365var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 1411var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 1814var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 1854var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 1897var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 2425var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 2474tree.GetRoot().DescendantNodes().OfType<PrimaryConstructorBaseTypeSyntax>().First(); 2484tree.GetRoot().DescendantNodes().OfType<PrimaryConstructorBaseTypeSyntax>().Skip(1).First(); 2641var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 2679var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 2716var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 2752var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 20632var typeDeclaration1 = root.ChildNodes().OfType<TypeDeclarationSyntax>().First(); 20676var typeDeclaration1 = root.ChildNodes().OfType<TypeDeclarationSyntax>().First(); 20723var typeDeclaration1 = root.ChildNodes().OfType<TypeDeclarationSyntax>().First(); 20773var typeDeclaration1 = root.ChildNodes().OfType<TypeDeclarationSyntax>().First();
Semantics\RecordTests.cs (21)
1816var main = root.DescendantNodes().OfType<MethodDeclarationSyntax>().First(); 8091var withExpr1 = root.DescendantNodes().OfType<WithExpressionSyntax>().First(); 8130var main = root.DescendantNodes().OfType<MethodDeclarationSyntax>().First(); 8865var withExpr1 = root.DescendantNodes().OfType<WithExpressionSyntax>().First(); 21257var equalsValue = tree.GetRoot().DescendantNodes().OfType<EqualsValueClauseSyntax>().First(); 21385var y = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "y").First(); 21398var test = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Test").First(); 21439var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 21485var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 21888var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 21925var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 21965var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 22000var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 22917var recordDeclaration = tree.GetRoot().DescendantNodes().OfType<RecordDeclarationSyntax>().First(); 24643var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 24678var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 24712var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 24747var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 28186var doc = tree.GetRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().First(); 28344var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref;
Microsoft.CodeAnalysis.CSharp.Features (14)
AddImport\CSharpAddImportFeatureService.cs (1)
246var query = node.AncestorsAndSelf().OfType<QueryExpressionSyntax>().First();
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
293return (VariableDeclaratorSyntax)annotatedNodesOrTokens.First().AsNode();
EncapsulateField\CSharpEncapsulateFieldService.cs (3)
65var declaration = root.GetAnnotatedNodes<SyntaxNode>(tempAnnotation).First().Parent as VariableDeclarationSyntax; 90declarator = root.GetAnnotatedNodes<VariableDeclaratorSyntax>(tempAnnotation).First(); 114declarator = root.GetAnnotatedNodes<VariableDeclaratorSyntax>(tempAnnotation).First();
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
649var methodDefinition = root.GetAnnotatedNodes<SyntaxNode>(MethodDefinitionAnnotation).First();
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (1)
147VariableDeclaration(keyValuePair.Value.First().Declaration.Type, [.. variables]));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
320var innermostStatements = new HashSet<StatementSyntax>(matches.Select(expr => GetApplicableStatementAncestors(expr).First()));
Organizing\Organizers\ModifiersOrganizer.cs (1)
22var leadingTrivia = initialList.First().LeadingTrivia;
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (1)
63return root.Members.OfType<GlobalStatementSyntax>().First().GetFirstToken().GetLocation();
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
121.First();
Structure\CSharpStructureHelpers.cs (2)
450var spanStart = syntaxList.First().GetFirstToken().FullSpan.End; 455var hintSpanStart = syntaxList.First().SpanStart;
Structure\Providers\NamespaceDeclarationStructureProvider.cs (1)
45CSharpStructureHelpers.CollectCommentBlockSpans(externsAndUsings.First(), spans, options);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (3)
Diagnostics\Suppression\SuppressionTests.cs (1)
1169Assert.False(string.IsNullOrWhiteSpace(lines.First()));
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (1)
766: $"ENC0080: {string.Format(FeaturesResources.Modifying_source_file_0_requires_restarting_the_application_due_to_internal_error_1, filePath, "System.NullReferenceException: NullRef!\n")}".Split('\n').First();
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryExpressionParenthesesTests.cs (1)
2884var expectedSpans = workspace.Documents.First().AnnotatedSpans;
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (18)
IOperation\IOperationTests.cs (2)
260var m = tree.GetRoot().DescendantNodes().OfType<BlockSyntax>().First(); 352var m = tree.GetRoot().DescendantNodes().OfType<BlockSyntax>().First();
IOperation\IOperationTests_IConstructorBodyOperation.cs (5)
651var node1 = tree.GetRoot().DescendantNodes().OfType<ConstructorDeclarationSyntax>().First(); 721var node1 = tree.GetRoot().DescendantNodes().OfType<ConstructorDeclarationSyntax>().First(); 796var node1 = tree.GetRoot().DescendantNodes().OfType<ConstructorDeclarationSyntax>().First(); 865var node1 = tree.GetRoot().DescendantNodes().OfType<ConstructorDeclarationSyntax>().First(); 955var node1 = tree.GetRoot().DescendantNodes().OfType<ConstructorDeclarationSyntax>().First();
IOperation\IOperationTests_IConversionExpression.cs (1)
5292var assignment = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().First();
IOperation\IOperationTests_ILocalFunctionStatement.cs (2)
1793var graphM = ControlFlowGraph.Create((IMethodBodyOperation)semanticModel.GetOperation(tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First())); 1848var graphM = ControlFlowGraph.Create((IMethodBodyOperation)semanticModel.GetOperation(tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First()));
IOperation\IOperationTests_IMethodBodyOperation.cs (4)
444var node1 = tree.GetRoot().DescendantNodes().OfType<BaseMethodDeclarationSyntax>().First(); 506var node1 = tree.GetRoot().DescendantNodes().OfType<BaseMethodDeclarationSyntax>().First(); 1035var node1 = tree.GetRoot().DescendantNodes().OfType<AccessorDeclarationSyntax>().First(); 1080var node1 = tree.GetRoot().DescendantNodes().OfType<AccessorDeclarationSyntax>().First();
IOperation\IOperationTests_IVariableDeclaration.cs (4)
1215var rankSpecifierOld = syntaxTree.GetCompilationUnitRoot().DescendantNodes().OfType<ArrayRankSpecifierSyntax>().First(); 2301var rankSpecifierOld = syntaxTree.GetCompilationUnitRoot().DescendantNodes().OfType<ArrayRankSpecifierSyntax>().First(); 2362var rankSpecifierOld = syntaxTree.GetCompilationUnitRoot().DescendantNodes().OfType<ArrayRankSpecifierSyntax>().First(); 2830var rankSpecifierOld = syntaxTree.GetCompilationUnitRoot().DescendantNodes().OfType<ArrayRankSpecifierSyntax>().First();
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (2)
ScriptTests.cs (2)
67Assert.Equal(state.Script.Code, compilation.SyntaxTrees.First().GetText().ToString()); 75Assert.Equal(state.Script.SourceText, compilation.SyntaxTrees.First().GetText());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (235)
Semantics\AccessCheckTests.cs (2)
741var tree = c.SyntaxTrees.First(); 895var tree = c1.SyntaxTrees.First();
Semantics\AwaitExpressionTests.cs (1)
84var awaitExpression = tree.GetRoot().DescendantNodes().OfType<AwaitExpressionSyntax>().First();
Semantics\BindingTests.cs (2)
3912var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.ToString() == "G").First(); 4038var ifStmt = tree.GetRoot().DescendantNodes().OfType<IfStatementSyntax>().First();
Semantics\ConstantTests.cs (1)
2923var expr = tree.GetCompilationUnitRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().First();
Semantics\DeconstructionTests.cs (4)
1837var tree = comp.Compilation.SyntaxTrees.First(); 1840var y = nodes.OfType<VariableDeclaratorSyntax>().Skip(1).First(); 3767var literal1 = nodes.OfType<TupleExpressionSyntax>().First(); 3770var literal2 = nodes.OfType<TupleExpressionSyntax>().Skip(1).First();
Semantics\DynamicTests.cs (26)
4985var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 5109var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 5232var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 5346var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 5387var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 5431var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 5475var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 5519var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 5696var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 5737var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 5782var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 5827var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 5872var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 10009var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First(); 10137var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First(); 10265var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First(); 10419var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First(); 10553var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First(); 10701var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First(); 10971var node = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "a").First(); 11326var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 11379var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 11419var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 11455var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 11499var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 11540var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First();
Semantics\FunctionPointerTests.cs (8)
201var initializer1 = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First().Initializer!.Value; 203var parameter = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First().ArgumentList.Arguments.Single(); 1662var m1Invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 1695var m1Invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 1728var m1Invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 1822var m1Invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 1855var m1Invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 1888var m1Invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First();
Semantics\ImplicitObjectCreationTests.cs (2)
2516var def = nodes.OfType<ImplicitObjectCreationExpressionSyntax>().First(); 2567var def = nodes.OfType<ImplicitObjectCreationExpressionSyntax>().First();
Semantics\InterceptorsTests.cs (3)
7268var node = source.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 7350var node = source.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 7394var node = source.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First();
Semantics\IteratorTests.cs (1)
578var node = tree.GetRoot().DescendantNodes().OfType<YieldStatementSyntax>().First();
Semantics\LambdaTests.cs (15)
850expr = exprs.First(); 2121var eReference = lambda.Body.DescendantNodes().OfType<IdentifierNameSyntax>().First(); 2167var eReference = lambda.Body.DescendantNodes().OfType<IdentifierNameSyntax>().First(); 2213var eReference = lambda.Body.DescendantNodes().OfType<IdentifierNameSyntax>().First(); 2259var eReference = lambda.Body.DescendantNodes().OfType<IdentifierNameSyntax>().First(); 2305var eReference = lambda.Body.DescendantNodes().OfType<IdentifierNameSyntax>().First(); 2335var eReference = lambda.Body.DescendantNodes().OfType<IdentifierNameSyntax>().First(); 2362var eReference = lambda.Body.DescendantNodes().OfType<IdentifierNameSyntax>().First(); 2417var reference = lambda.Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().First(); 2463var reference = lambda.Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().First(); 2509var reference = lambda.Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().First(); 2542var reference = lambda.Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().First(); 2575var reference = lambda.Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().First(); 2612var reference = lambda.Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().First(); 5028var expr = tree.GetRoot().DescendantNodes().OfType<LambdaExpressionSyntax>().First();
Semantics\LocalFunctionTests.cs (4)
1762var tree = comp.SyntaxTrees.First(); 1837var tree = comp.SyntaxTrees.First(); 2373LocalFunctionStatementSyntax declaration = tree.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().First(); 8739var method = tree2.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First();
Semantics\LookupTests.cs (3)
1643var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "returne<double>").First(); 1670var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "System.Object").First(); 2014var call = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First();
Semantics\MethodBodyModelTests.cs (1)
326Assert.Equal(650, tree.GetDiagnostics().First().Code);
Semantics\NameOfTests.cs (9)
692var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "SomeClass.Goo").OfType<ExpressionSyntax>().First(); 718var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "SomeClass.Goo").OfType<ExpressionSyntax>().First(); 753var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "a.Extension").OfType<ExpressionSyntax>().First(); 800var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "a.Extension").OfType<ExpressionSyntax>().First(); 837var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "a.Extension").OfType<ExpressionSyntax>().First(); 873var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "a.Nested").OfType<ExpressionSyntax>().First(); 919var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "A.Extension").OfType<ExpressionSyntax>().First(); 952var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "a.Extension").OfType<ExpressionSyntax>().First(); 1429var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "X1.Extension").OfType<ExpressionSyntax>().First();
Semantics\NativeIntegerTests.cs (12)
15317var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref; 15338var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref; 15361var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref; 15389var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref; 15412var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref; 15442var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref;
Semantics\NonTrailingNamedArgumentsTests.cs (4)
43var tree = verifier.Compilation.SyntaxTrees.First(); 391var tree = verifier.Compilation.SyntaxTrees.First(); 742var tree = verifier.Compilation.SyntaxTrees.First(); 774var tree = verifier.Compilation.SyntaxTrees.First();
Semantics\NullableContextTests.cs (1)
424var syntax = syntaxTree.GetRoot().DescendantNodes().OfType<EqualsValueClauseSyntax>().First().Value;
Semantics\NullableReferenceTypesTests.cs (59)
1754var suppression = tree.GetRoot().DescendantNodes().OfType<PostfixUnaryExpressionSyntax>().First(); 1788var suppression = tree.GetRoot().DescendantNodes().OfType<PostfixUnaryExpressionSyntax>().First(); 1963var suppression = tree.GetRoot().DescendantNodes().OfType<PostfixUnaryExpressionSyntax>().First(); 2479var suppression = tree.GetRoot().DescendantNodes().OfType<PostfixUnaryExpressionSyntax>().First(); 3336var reference = lambda.Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().First(); 4526var firstCref = tree.GetRoot().DescendantNodes(descendIntoTrivia: true).OfType<NameMemberCrefSyntax>().First(); 56076var nullNode = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().First(); 56106var nullNode = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().First(); 56139var defaultNode = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().First(); 56176var defaultNode = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().First(); 56304var nullNode = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().First(); 56437var newNode = tree.GetRoot().DescendantNodes().OfType<ImplicitObjectCreationExpressionSyntax>().First(); 56472var newNode = tree.GetRoot().DescendantNodes().OfType<ImplicitObjectCreationExpressionSyntax>().First(); 56508var nullNode = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().First(); 56588var invocationNode = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 59017var declarator = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First(); 59022var declaration = tree.GetRoot().DescendantNodes().OfType<VariableDeclarationSyntax>().First(); 59051var declarator = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First(); 59079var declarator = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First(); 59111var declarator = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First(); 59140var declarator = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First(); 59173var declarator = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First(); 59205var declarator = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First(); 59238var declarator = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Skip(1).First(); 59272var declarator = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().Skip(1).First(); 59298var declarator = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First(); 59327var declarator = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First(); 71876var discard1 = arguments.First().Expression; 71881var discard2 = arguments.Skip(1).First().Expression; 71886var discard3 = arguments.Skip(2).First().Expression; 71891var discard4 = arguments.Skip(3).First().Expression; 71924var discard1 = (DeclarationExpressionSyntax)arguments.First().Expression; 71934var discard2 = arguments.Skip(1).First().Expression; 81259var declarator = tree.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First(); 145382var invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 145423var invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 145463var invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 145501var invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 145539var invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 145572var invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 145605var invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 145643var invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 145682var invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 145952var invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 145983var invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 146016var invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 156747var invocationNode = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 158061var item = tree.GetRoot().DescendantNodes().OfType<MemberAccessExpressionSyntax>().First(); 158097var item = tree.GetRoot().DescendantNodes().OfType<ElementAccessExpressionSyntax>().First(); 158192var item = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 158230var item = tree.GetRoot().DescendantNodes().OfType<MemberAccessExpressionSyntax>().First(); 158271var item = tree.GetRoot().DescendantNodes().OfType<MemberAccessExpressionSyntax>().First(); 158311var item = tree.GetRoot().DescendantNodes().OfType<MemberAccessExpressionSyntax>().First(); 158345var item = tree.GetRoot().DescendantNodes().OfType<MemberAccessExpressionSyntax>().First(); 158382var item = tree.GetRoot().DescendantNodes().OfType<ElementAccessExpressionSyntax>().First(); 158477var item = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 158525var item = tree.GetRoot().DescendantNodes().OfType<MemberAccessExpressionSyntax>().First(); 158567var item = tree.GetRoot().DescendantNodes().OfType<MemberAccessExpressionSyntax>().First(); 158604var item = tree.GetRoot().DescendantNodes().OfType<MemberAccessExpressionSyntax>().First();
Semantics\ObjectAndCollectionInitializerTests.cs (5)
4058var node1 = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First(); 4097var node = nodes.First(); 4136var node1 = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First(); 4169var node = nodes.First(); 4281var propertyAccess = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().First().Left;
Semantics\OperatorTests.cs (1)
8812var methodDecl = tree.GetCompilationUnitRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First();
Semantics\RecordStructTests.cs (12)
2594var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 2629var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 2663var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 2698var x = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "X").First(); 3285var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref; 3333var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref; 3384var cref = docComments.First().DescendantNodes().OfType<XmlCrefAttributeSyntax>().First().Cref; 10772tree.GetRoot().DescendantNodes().OfType<PrimaryConstructorBaseTypeSyntax>().First(); 10782tree.GetRoot().DescendantNodes().OfType<PrimaryConstructorBaseTypeSyntax>().Skip(1).First();
Semantics\RefFieldTests.cs (1)
28831var fieldInitializerSyntax = tree.GetRoot().DescendantNodes().OfType<EqualsValueClauseSyntax>().First();
Semantics\ScriptSemanticsTests.cs (2)
244var syntax = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ExpressionSyntax>().First(); 561var syntax = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ExpressionSyntax>().First();
Semantics\SemanticErrorTests.cs (3)
7488var node = tree.GetRoot().DescendantNodes().OfType<ElementAccessExpressionSyntax>().First(); 13327var node = tree.GetRoot().DescendantNodes().OfType<ElementAccessExpressionSyntax>().First(); 24224var node = tree.GetRoot().DescendantNodes().OfType<ConditionalAccessExpressionSyntax>().First();
Semantics\StructConstructorTests.cs (3)
1050var syntax = tree.GetRoot().DescendantNodes().OfType<ConstructorDeclarationSyntax>().First(); 1145var syntax = tree.GetRoot().DescendantNodes().OfType<ConstructorDeclarationSyntax>().First(); 1242var syntax = tree.GetRoot().DescendantNodes().OfType<ConstructorDeclarationSyntax>().First();
Semantics\TargetTypedDefaultTests.cs (2)
3344var def = nodes.OfType<LiteralExpressionSyntax>().First(); 3383var def = nodes.OfType<LiteralExpressionSyntax>().First();
Semantics\TopLevelStatementsTests.cs (15)
194var localRef = unit1.DescendantNodes().OfType<IdentifierNameSyntax>().First(); 497Assert.DoesNotContain(declSymbol, model1.AnalyzeDataFlow(localDecl.Ancestors().OfType<StatementSyntax>().First()).DataFlowsOut); 589Assert.Contains(declSymbol, model1.AnalyzeDataFlow(localDecl.Ancestors().OfType<StatementSyntax>().First()).DataFlowsOut); 985var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First()); 987Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").First()).Symbol); 1040var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First()); 1685var localDecl = tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First(); 2925model1.GetDiagnostics(nameRef.Ancestors().OfType<StatementSyntax>().First().Span).Verify( 2947model2.GetDiagnostics(nameRef.Ancestors().OfType<StatementSyntax>().First().Span).Verify( 4516var symbol2 = model2.GetDeclaredSymbol(tree2.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().First()); 4574var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().First()); 4576Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").First()).Symbol); 4578var symbol2 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Skip(1).First()); 4623var symbol1 = model1.GetDeclaredSymbol(tree1.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().First()); 6030var localDecl = tree1.GetRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First();
Semantics\UnsafeTests.cs (2)
5197var methodDecl = tree.GetCompilationUnitRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First(); 7274var declaredSymbol = model.GetDeclaredSymbol(syntax.Ancestors().OfType<VariableDeclaratorSyntax>().First());
SourceGeneration\GeneratorDriverTests.cs (9)
1271c.ReportDiagnostic(d.WithLocation(Location.Create(c.Compilation.SyntaxTrees.First(), l))); 2373compilation = compilation.ReplaceSyntaxTree(compilation.SyntaxTrees.First(), CSharpSyntaxTree.ParseText(source, parseOptions)); 2432var c2 = compilation.ReplaceSyntaxTree(compilation.SyntaxTrees.First(), CSharpSyntaxTree.ParseText("class E{}", parseOptions)); 4306var generator1 = new PipelineCallbackGenerator((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen1Source.cs", c.SyntaxTrees.First().GetRoot().ToFullString() + " //generator1"); }); }).AsSourceGenerator(); 4307var generator2 = new PipelineCallbackGenerator2((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen2Source.cs", c.SyntaxTrees.First().GetRoot().ToFullString() + " //generator2"); }); }).AsSourceGenerator(); 4351var generator1 = new PipelineCallbackGenerator((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen1Source.cs", "//" + c.SyntaxTrees.First().GetRoot().ToFullString() + " generator1"); }); }).AsSourceGenerator(); 4352var generator2 = new PipelineCallbackGenerator2((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen2Source.cs", "//" + c.SyntaxTrees.First().GetRoot().ToFullString() + " generator2"); }); }).AsSourceGenerator(); 4375var generator1 = new PipelineCallbackGenerator((ctx) => { ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen1Source.cs", c.SyntaxTrees.First().GetRoot().ToFullString() + " //generator1"); }); }).AsSourceGenerator(); 4376var generator2 = new PipelineCallbackGenerator2((ctx) => { initWasCalled = true; ctx.RegisterSourceOutput(ctx.CompilationProvider, (spc, c) => { spc.AddSource("gen2Source.cs", c.SyntaxTrees.First().GetRoot().ToFullString() + " //generator2"); }); }).AsSourceGenerator();
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.cs (10)
249step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.First())); 304step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.First()), 1525driver = driver.RunGenerators(compilation.AddSyntaxTrees(compilation.SyntaxTrees.First().WithChangedText(SourceText.From("")))); 1567driver = driver.RunGenerators(compilation.AddSyntaxTrees(compilation.SyntaxTrees.First().WithChangedText(SourceText.From(""" 1615driver = driver.RunGenerators(compilation.AddSyntaxTrees(compilation.SyntaxTrees.First().WithChangedText(SourceText.From(""" 1668driver = driver.RunGenerators(compilation.AddSyntaxTrees(compilation.SyntaxTrees.First().WithChangedText(SourceText.From(""" 1728compilation.SyntaxTrees.First(), 1729compilation.SyntaxTrees.First().WithChangedText(SourceText.From(""" 1780compilation.SyntaxTrees.First(), 1781compilation.SyntaxTrees.First().WithChangedText(SourceText.From("""
SourceGeneration\GeneratorDriverTests_Attributes_SimpleName.cs (8)
1265compilation.SyntaxTrees.First(), 1266compilation.SyntaxTrees.First().WithChangedText(SourceText.From(""" 1318compilation.SyntaxTrees.First())); 1376compilation.SyntaxTrees.First())); 1423compilation.SyntaxTrees.First().WithChangedText(SourceText.From(""" 1468compilation.SyntaxTrees.First().WithChangedText(SourceText.From(""" 1520compilation.SyntaxTrees.First().WithChangedText(SourceText.From(""" 1571compilation.SyntaxTrees.First().WithChangedText(SourceText.From("""
SourceGeneration\SyntaxAwareGeneratorTests.cs (4)
1248var firstTree = compilation.SyntaxTrees.First(); 1426var firstTree = compilation.SyntaxTrees.First(); 1537compilation = compilation.ReplaceSyntaxTree(compilation.SyntaxTrees.First(), CSharpSyntaxTree.ParseText(source2, parseOptions)); 1650compilation = compilation.ReplaceSyntaxTree(compilation.SyntaxTrees.First(), CSharpSyntaxTree.ParseText(source2, parseOptions));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (159)
Compilation\GetSemanticInfoTests.cs (9)
597var expr1 = exprs.First(); 630var expr1 = exprs.First(); 2566var expr = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().First(); 4108var localDecl1 = localDecls.First(); 4163var localDecl1 = localDecls.First(); 4687int position = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First().SpanStart; 4732int position = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First().SpanStart; 5478var invocationSyntax = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 5484var parameterSyntax = invocationSyntax.DescendantNodes().OfType<ParameterSyntax>().First();
Compilation\SemanticModelAPITests.cs (19)
111.Where(e => e.Name.ToString() == "GenericExtension").First(); 256var vardecl = tree.GetCompilationUnitRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First(); 276var vardecl = tree.GetCompilationUnitRoot().DescendantNodes().OfType<VariableDeclaratorSyntax>().First(); 295var vardecl = tree.GetCompilationUnitRoot().DescendantNodes().OfType<QueryClauseSyntax>().First(); 315var vardecl = tree.GetCompilationUnitRoot().DescendantNodes().OfType<QueryClauseSyntax>().First(); 334var statement = tree.GetCompilationUnitRoot().DescendantNodes().OfType<GotoStatementSyntax>().First(); 353var paramdecl = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().First(); 375var paramdecl1 = tree1.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().First(); 377var paramdecl2 = tree2.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().First(); 871var pType01 = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ClassDeclarationSyntax>().First(); 880var pMethod01 = tree.GetCompilationUnitRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First(); 898var pParam01 = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().First(); 966var para1 = tree1.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().First(); 967var para2 = tree2.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().First(); 1007var para1 = tree1.GetCompilationUnitRoot().DescendantNodes().OfType<TypeParameterSyntax>().First(); 1008var para2 = tree2.GetCompilationUnitRoot().DescendantNodes().OfType<TypeParameterSyntax>().First(); 1197var parasym = model.GetDeclaredSymbol(paras.First()); 1202var argsym1 = model.GetSymbolInfo(args.First().Expression).Symbol; 3873var methodDecl = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First();
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (28)
2782var tree = compilation.SyntaxTrees.First(); 2787var n1 = globalNS.GetMembers("NS").First() as INamespaceSymbol; 2903var tree = compilation.SyntaxTrees.First(); 2908var n1 = globalNS.GetMembers().First() as INamespaceSymbol; 2909var n2 = n1.GetMembers().First() as INamespaceSymbol; 2910var n3 = n2.GetMembers().First() as INamespaceSymbol; 2933var tree = compilation.SyntaxTrees.First(); 2937var compSym = compilation.GlobalNamespace.GetMembers("System").First() as INamespaceSymbol; 2965var tree = compilation.SyntaxTrees.First(); 2971var sym1 = globalNS.GetMembers("CGoo").First() as INamedTypeSymbol; 3014var tree = compilation.SyntaxTrees.First(); 3071var tree = compilation.SyntaxTrees.First(); 3107var tree = comp.SyntaxTrees.First(); 3137var tree = compilation.SyntaxTrees.First(); 3233var tree = compilation.SyntaxTrees.First(); 3384var node = root.ChildNodes().First(); 3736var tree = compilation.SyntaxTrees.First(); 3847var queryExpr = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ParenthesizedExpressionSyntax>().First(); 3901var param = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().Where(p => p.Identifier.ValueText == "name").First(); 4604var node = (DefaultExpressionSyntax)tree.GetCompilationUnitRoot().DescendantNodes().Where(i => i is DefaultExpressionSyntax).First(); 4767var structDecl = tree.GetCompilationUnitRoot().DescendantNodes().OfType<StructDeclarationSyntax>().First(); 5127var node = root.ChildNodes().First(); 5306.First() 5401.First() 5449.First() 5492.First() 5587.First() 5635.First()
Compilation\SemanticModelGetSemanticInfoTests.cs (10)
1113var tree = compilation.SyntaxTrees.First(); 1147tree = compilation.SyntaxTrees.First(); 1177tree = compilation.SyntaxTrees.First(); 1207tree = compilation.SyntaxTrees.First(); 1233tree = compilation.SyntaxTrees.First(); 1260tree = compilation.SyntaxTrees.First(); 1288tree = compilation.SyntaxTrees.First(); 1315tree = compilation.SyntaxTrees.First(); 1356tree = compilation.SyntaxTrees.First(); 1394tree = compilation.SyntaxTrees.First();
DocumentationComments\CrefTests.cs (5)
1938var crefSyntax = GetCrefSyntaxes(compilation).First(); 1973var crefSyntax = GetCrefSyntaxes(compilation).First(); 5753var parameterTypeContainingType = parameterType.DescendantNodes().OfType<SimpleNameSyntax>().First(); 5797var typeSyntax = cref.DescendantNodes().OfType<SimpleNameSyntax>().First(); 6325var tree = compilation.SyntaxTrees.First();
SymbolDisplay\SymbolDisplayTests.cs (4)
5423var model = comp.GetSemanticModel(comp.SyntaxTrees.First()); 5890var methodDecl = tree.GetCompilationUnitRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First(); 5900methodDecl = tree.GetCompilationUnitRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First(); 6576var queryExpression = root.DescendantNodes().OfType<QueryExpressionSyntax>().First();
Symbols\ExtensionMethodTests.cs (4)
3866var instance = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Instance").First(); 3913var instance = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Instance").First(); 3958var instance = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Instance").First(); 4008var instance = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(n => n.Identifier.ValueText == "Instance").First();
Symbols\Metadata\MetadataTypeTests.cs (2)
372var id = newTree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(s => s.ToString() == "StaticModClass").First(); 387id = newTree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(s => s.ToString() == "StaticModClass").First();
Symbols\Metadata\PE\TypeForwarders.cs (2)
1637ValidateExportedTypeRow(peReader.ExportedTypes.First(), peReader, "CF1"); 1648ValidateExportedTypeRow(peReader1.ExportedTypes.First(), peReader1, "CF1");
Symbols\RequiredMembersTests.cs (1)
6951var tuple = tree.GetRoot().DescendantNodes().OfType<TupleExpressionSyntax>().First();
Symbols\Retargeting\RetargetCustomAttributes.cs (1)
144var attribute = attributes.First();
Symbols\Source\BaseClassTests.cs (3)
269var tree = comp.SyntaxTrees.First(); 306var tree = comp.SyntaxTrees.First(); 2031var baseY = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "y").OfType<ExpressionSyntax>().First();
Symbols\Source\DelegateTests.cs (1)
202var namespaceNS = comp.GlobalNamespace.GetMembers("NS").First() as NamespaceOrTypeSymbol;
Symbols\Source\EnumTests.cs (1)
996var first = expectedEnumValues.First();
Symbols\Source\EventTests.cs (4)
435var lambdaSyntax = tree.GetRoot().DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().First(); 441var parameterSyntax = lambdaSyntax.DescendantNodes().OfType<ParameterSyntax>().First(); 481var lambdaSyntax = tree.GetRoot().DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().First(); 487var parameterSyntax = lambdaSyntax.DescendantNodes().OfType<ParameterSyntax>().First();
Symbols\Source\ExternAliasTests.cs (2)
414var firstTarget = targets.First(); 440var firstTarget = targets.First();
Symbols\Source\FileModifierTests.cs (2)
3510var invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 3559var invocation = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First();
Symbols\Source\MethodTests.cs (1)
236var node = tree.GetRoot().DescendantNodes().OfType<PredefinedTypeSyntax>().Where(n => n.Keyword.Kind() == SyntaxKind.VoidKeyword).First();
Symbols\Source\NullablePublicAPITests.cs (15)
1207var syntaxTree = comp.SyntaxTrees.First(); 3148var collectionInitializer = root.DescendantNodes().OfType<InitializerExpressionSyntax>().First(); 3193var collectionInitializer = root.DescendantNodes().OfType<InitializerExpressionSyntax>().First(); 3537var lambda = root.DescendantNodes().OfType<LambdaExpressionSyntax>().First(); 3562.First() 3598var lambda = root.DescendantNodes().OfType<LambdaExpressionSyntax>().First(); 3623.First() 3854var lambda = root.DescendantNodes().OfType<LambdaExpressionSyntax>().First(); 3856var o2Declaration = lambda.DescendantNodes().OfType<VariableDeclaratorSyntax>().First(); 3913var fieldLambda = root.DescendantNodes().OfType<LambdaExpressionSyntax>().First(); 3978var lambda = root.DescendantNodes().OfType<LambdaExpressionSyntax>().First(); 4047var lambda = root.DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().First(); 4114var lambda = root.DescendantNodes().OfType<LambdaExpressionSyntax>().First(); 4177var lambda = root.DescendantNodes().OfType<LambdaExpressionSyntax>().First(); 4179var localFunction = lambda.DescendantNodes().OfType<LocalFunctionStatementSyntax>().First();
Symbols\Source\TypeMapTests.cs (1)
155var v1 = c1OfByteChar_c2OfIntInt_c3OfIntByte.GetMembers().OfType<FieldSymbol>().First();
Symbols\Source\UpdatedContainingSymbolAndNullableAnntotationTests.cs (1)
38var local1 = model.GetDeclaredSymbol(varDeclarators.First()).GetSymbol<SourceLocalSymbol>();
Symbols\StaticAbstractMembersInInterfacesTests.cs (24)
8453var node = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First(); 9041var node = postfixOp != "" ? (ExpressionSyntax)tree.GetRoot().DescendantNodes().OfType<PostfixUnaryExpressionSyntax>().First() : tree.GetRoot().DescendantNodes().OfType<PrefixUnaryExpressionSyntax>().First(); 9356var node = tree.GetRoot().DescendantNodes().OfType<ConditionalExpressionSyntax>().First(); 9755var node = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().First(); 11329var node1 = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + op + " y").First(); 11583var node1 = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(n => n.ToString() == "x " + op + op + " y").First(); 12139var node = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().First(); 13180var node = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().First().Right; 13266var node = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().First().Left; 13388var node = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().First().Left; 14089var node = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().First().Left; 14098node = tree.GetRoot().DescendantNodes().OfType<InvocationExpressionSyntax>().First().ArgumentList.Arguments[0].Expression; 14714var node = tree.GetRoot().DescendantNodes().OfType<MemberAccessExpressionSyntax>().First(); 15120var node = tree.GetRoot().DescendantNodes().OfType<MemberAccessExpressionSyntax>().First(); 15388var node = tree.GetRoot().DescendantNodes().OfType<MemberAccessExpressionSyntax>().First(); 19560var node = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First(); 19643var node = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First(); 19735var node = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First(); 19824var node = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First(); 28773var node = tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Where(l => l.ToString() == "default").First(); 30280var node = tree.GetRoot().DescendantNodes().OfType<ReturnStatementSyntax>().First(); 30471var node = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().First(); 30937var node = tree.GetRoot().DescendantNodes().OfType<ReturnStatementSyntax>().First();
Symbols\SymbolEqualityTests.cs (1)
935var lambdaSyntax = root.DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().First();
Symbols\TypeTests.cs (5)
850var namespaceNS = comp.GlobalNamespace.GetMembers("NS").First() as NamespaceOrTypeSymbol; 1421var gen1Class = ((NamedTypeSymbol)globalNS.GetMembers("Gen1").First()); 1424var nonGenClass = ((NamedTypeSymbol)globalNS.GetMembers("NonGen").First()); 1427var system = ((NamespaceSymbol)globalNS.GetMembers("System").First()); 1477var namespaceNS = comp.GlobalNamespace.GetMembers("NS").First() as NamespaceOrTypeSymbol;
Symbols\UnsignedRightShiftTests.cs (13)
123var unsignedShift = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftExpression).First(); 124var shift = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.RightShiftExpression).First(); 626var unsignedShift = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftAssignmentExpression).First(); 627var shift = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.RightShiftAssignmentExpression).First(); 1176var unsignedShift = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftExpression).First(); 1177var shift = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.RightShiftExpression).First(); 1584var unsignedShift = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftAssignmentExpression).First(); 1585var shift = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.RightShiftAssignmentExpression).First(); 1983var unsignedShift = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftExpression).First(); 2235var unsignedShift = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftExpression).First(); 2377var unsignedShift = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftAssignmentExpression).First(); 2511var unsignedShift = tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftExpression).First(); 2608var unsignedShift = tree.GetRoot().DescendantNodes().OfType<AssignmentExpressionSyntax>().Where(e => e.Kind() == SyntaxKind.UnsignedRightShiftAssignmentExpression).First();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (80)
Diagnostics\DiagnosticTest.cs (3)
103Assert.Equal(new TextSpan(14, 8), d3.AdditionalLocations.First().SourceSpan); 1983var errorCodeName = nodes.OfType<Syntax.PragmaWarningDirectiveTriviaSyntax>().First() 1984.ErrorCodes.OfType<Syntax.IdentifierNameSyntax>().First().Identifier;
Diagnostics\LocationsTests.cs (5)
313var diag = diags.First(); 331diag = diags.First(); 351diag = diags.First(); 376var diag = diags.First(); 460expressionDiags.First().Location.GetLineSpan();
LexicalAndXml\LexicalTests.cs (52)
1036var token = Lex(text).First(); 1528var token = Lex(text).First(); 1544var token = Lex(text).First(); 1562var token = Lex(text).First(); 3383var token = Lex(text).First(); 3485var token = Lex("@0x0").First(); 3521token = Lex("@0b1c2d3e4f").First(); 3833var token = Lex("<<<<<<<").First(); 3837token = Lex(" <<<<<<<").First(); 3843token = Lex("<<<<<< ").First(); 3847token = Lex("<<<<<<< ").First(); 3862var token = Lex("{\r\n<<<<<<<").Skip(1).First(); 3865token = Lex("{\r\n <<<<<<<").Skip(1).First(); 3870token = Lex("{\r\n<<<<<< ").Skip(1).First(); 3873token = Lex("{\r\n<<<<<<< ").Skip(1).First(); 3893var token = Lex(">>>>>>>").First(); 3896token = Lex(" >>>>>>>").First(); 3901token = Lex(">>>>>> ").First(); 3904token = Lex(">>>>>>> ").First(); 3916var token = Lex("{\r\n>>>>>>>").Skip(1).First(); 3919token = Lex("{\r\n >>>>>>>").Skip(1).First(); 3924token = Lex("{\r\n>>>>>> ").Skip(1).First(); 3927token = Lex("{\r\n>>>>>>> ").Skip(1).First(); 3937var token = Lex(" =======").First(); 3943token = Lex("====== ").First(); 3947token = Lex("=======").First(); 3953token = Lex("======= trailing chars").First(); 3965token = Lex("======= Trailing\r\ndisabled text").First(); 3988token = Lex("======= Trailing\r\ndisabled text\r\n>>>> still disabled").First(); 4010token = Lex("======= Trailing\r\ndisabled text\r\n>>>>>>> Actually the end").First(); 4043token = Lex("======= Trailing\r\n>>>>>>> Actually the end").First(); 4076var token = Lex("{\r\n =======").Skip(1).First(); 4082token = Lex("{\r\n====== ").Skip(1).First(); 4086token = Lex("{\r\n=======").Skip(1).First(); 4092token = Lex("{\r\n======= trailing chars").Skip(1).First(); 4099token = Lex("{\r\n======= Trailing\r\ndisabled text").Skip(1).First(); 4117token = Lex("{\r\n======= Trailing\r\ndisabled text\r\n>>>> still disabled").Skip(1).First(); 4134token = Lex("{\r\n======= Trailing\r\ndisabled text\r\n>>>>>>> Actually the end").Skip(1).First(); 4168""").First(); 4208""").First(); 4242var token = Lex(" |||||||").First(); 4248token = Lex("|||||| ").First(); 4252token = Lex("|||||||").First(); 4258token = Lex("||||||| trailing chars").First(); 4272""").First(); 4294""").First(); 4317""").First(); 4346""").First(); 4377""").First(); 4416""").First(); 4472""").First(); 4530""").First();
LexicalAndXml\PreprocessorTests.cs (3)
3558Assert.Contains("100", diagnostics.First().ToString(), StringComparison.Ordinal); // one-based line number 3560var lineSpan = diagnostics.First().Location.GetMappedLineSpan(); 3881VerifyDirectivePragma(node.GetDirectives().First(), new PragmaInfo
Syntax\SyntaxAnnotationTests.cs (5)
72var toToken = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot().DescendantTokens().First(); 80var fromToken = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot().DescendantTokens().First(); 89var fromToken = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot().DescendantTokens().First(); 90var toToken = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot().DescendantTokens().First(); 225var trivia = GetAllTrivia(tree.GetCompilationUnitRoot()).First();
Syntax\SyntaxFactoryTests.cs (2)
423var literal = tokens.First(); 437var literal = tokens.First();
Syntax\SyntaxListTests.cs (3)
332var node = tree.GetRoot().DescendantNodes().OfType<InitializerExpressionSyntax>().First(); 356var node = tree.GetRoot().DescendantNodes().OfType<InitializerExpressionSyntax>().First(); 402return tree.GetRoot().DescendantNodes().OfType<InitializerExpressionSyntax>().First();
Syntax\SyntaxNodeTests.cs (4)
641var node = t1.GetCompilationUnitRoot().DescendantTokens(new TextSpan(6, 3)).First(); 709var classDecl = (TypeDeclarationSyntax)root.ChildNodes().First(); 3495var nodeOrToken = children.First(); 3507var trivia = root.DescendantTrivia().First();
Syntax\SyntaxRewriterTests.cs (3)
426var privateToken = root.DescendantTokens().First(); 444var publicToken = root.DescendantTokens().First(); 516var newRoot = root.RemoveNode(root.DescendantNodes().First(), SyntaxRemoveOptions.KeepDirectives);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
CompilationTestUtils.cs (1)
464var annotationsByMethod = allAnnotations.GroupBy(annotation => annotation.Expression.Ancestors().OfType<BaseMethodDeclarationSyntax>().First()).ToArray();
Extensions.cs (1)
393select a).ToList().First();
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
Classification\SyntaxClassification\SyntaxTokenClassifier.cs (1)
50result.Add(new ClassifiedSpan(identifier.Span, GetClassificationForType(types.First())));
Rename\CSharpRenameRewriterLanguageService.cs (2)
292newNode = speculativeTree.GetAnnotatedNodes<SyntaxNode>(annotation).First(); 307newNode = speculativeTree.GetAnnotatedNodes<SyntaxNode>(annotation).First();
Simplification\Simplifiers\ExpressionSimplifier.cs (1)
104semanticModel, SpecialTypeAnnotation.GetSpecialType(memberAccess.GetAnnotations(SpecialTypeAnnotation.Kind).First()));
Simplification\Simplifiers\NameSimplifier.cs (1)
104var keywordToken = TryGetPredefinedKeywordToken(semanticModel, SpecialTypeAnnotation.GetSpecialType(name.GetAnnotations(SpecialTypeAnnotation.Kind).First()));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
302var expression = (ExpressionSyntax)currentReplacedNode.ChildNodes().First();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\QueryExpressionSyntaxExtensions.cs (1)
36var fromClause = (FromClauseSyntax)allClauses.First();
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (106)
CodeGeneration\SymbolEditorTests.cs (59)
50var compilation = await solution.Projects.First().GetCompilationAsync(); 79var symbol = (await GetSymbolsAsync(solution, "C")).First(); 85var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 111var symbol = (await GetSymbolsAsync(solution, "C")).First(); 122var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 148var symbol = (await GetSymbolsAsync(solution, "C")).First(); 159var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 192var comp = await solution.Projects.First().GetCompilationAsync(); 193var symbolA = comp.GlobalNamespace.GetMembers("A").First(); 194var symbolB = comp.GlobalNamespace.GetMembers("B").First(); 204var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 238var comp = await solution.Projects.First().GetCompilationAsync(); 239var symbolA = comp.GlobalNamespace.GetMembers("A").First(); 240var symbolB = comp.GlobalNamespace.GetMembers("B").First(); 280var symbol = (await GetSymbolsAsync(solution, "C")).First(); 285var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 316var comp = await solution.Projects.First().GetCompilationAsync(); 317var symbol = comp.GlobalNamespace.GetMembers("C").First(); 355var symbol = (await GetSymbolsAsync(solution, "C")).First(); 362var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 392var symbol = (await GetSymbolsAsync(solution, "C")).First(); 399var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 433var symbol = (await GetSymbolsAsync(solution, "C")).First(); 445var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 479var symbol = (await GetSymbolsAsync(solution, "C")).First(); 492var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 529var symbol = (INamedTypeSymbol)(await GetSymbolsAsync(solution, "C")).First(); 536var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 556var symbol = (await GetSymbolsAsync(solution, "C")).First(); 566var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 593var symbol = (await GetSymbolsAsync(solution, "C")).First(); 603var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 620var symbol = (await GetSymbolsAsync(solution, "C")).First(); 626var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 650var symbol = (await GetSymbolsAsync(solution, "C")).First(); 657var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 679var symbol = (await GetSymbolsAsync(solution, "C")).First(); 685var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 711var symbol = (INamedTypeSymbol)(await GetSymbolsAsync(solution, "C")).First(); 721var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 728actual = await GetActualAsync(editor.GetChangedDocuments().First()); 762var symbol = (INamedTypeSymbol)(await GetSymbolsAsync(solution, "C")).First(); 769var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 803var symbol = (INamedTypeSymbol)(await GetSymbolsAsync(solution, "C")).First(); 810var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 836var symbol = (INamedTypeSymbol)(await GetSymbolsAsync(solution, "C")).First(); 843var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 869var symbol = (INamedTypeSymbol)(await GetSymbolsAsync(solution, "C")).First(); 876var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 902var symbol = (INamedTypeSymbol)(await GetSymbolsAsync(solution, "C")).First(); 909var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 943var symbol = (INamedTypeSymbol)(await GetSymbolsAsync(solution, "C")).First(); 950var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 976var symbol = (INamedTypeSymbol)(await GetSymbolsAsync(solution, "C")).First(); 983var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 1001var symbol = (INamedTypeSymbol)(await GetSymbolsAsync(solution, "C")).First(); 1008var actual = await GetActualAsync(editor.GetChangedDocuments().First()); 1033var typeC = (INamedTypeSymbol)(await GetSymbolsAsync(solution, "C")).First(); 1043var typeI = (INamedTypeSymbol)(await GetSymbolsAsync(solution, "I")).First();
CodeGeneration\SyntaxGeneratorTests.cs (45)
233var typeC = compilation.GlobalNamespace.GetMembers("C").First() as INamedTypeSymbol; 1992var attrWithComment = Generator.GetAttributes(added).First(); 2662var summary = cls.DescendantNodes(descendIntoTrivia: true).OfType<XmlElementSyntax>().First(); 2686var summary = cls.DescendantNodes(descendIntoTrivia: true).OfType<XmlElementSyntax>().First(); 2711var text = cls.DescendantNodes(descendIntoTrivia: true).OfType<XmlTextSyntax>().First(); 2734var text = cls.DescendantNodes(descendIntoTrivia: true).OfType<XmlTextSyntax>().First(); 3782var symbolC = (INamedTypeSymbol)comp.GlobalNamespace.GetMembers("C").First(); 3787var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 3788var declX = Generator.GetDeclaration(symbolX.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 3789var declY = Generator.GetDeclaration(symbolY.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 3790var declZ = Generator.GetDeclaration(symbolZ.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 3963var symbolC = (INamedTypeSymbol)comp.GlobalNamespace.GetMembers("C").First(); 3964var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 3981var symbolC = (INamedTypeSymbol)comp.GlobalNamespace.GetMembers("C").First(); 3982var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 4002var symbolC = (INamedTypeSymbol)comp.GlobalNamespace.GetMembers("C").First(); 4003var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 4020var symbolC = (INamedTypeSymbol)comp.GlobalNamespace.GetMembers("C").First(); 4021var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 4038var symbolC = (INamedTypeSymbol)comp.GlobalNamespace.GetMembers("C").First(); 4039var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 4056var symbolC = (INamedTypeSymbol)comp.GlobalNamespace.GetMembers("C").First(); 4057var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 4074var symbolC = (INamedTypeSymbol)comp.GlobalNamespace.GetMembers("C").First(); 4075var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 4092var symbolC = (INamedTypeSymbol)comp.GlobalNamespace.GetMembers("C").First(); 4093var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 4110var symbolC = (INamedTypeSymbol)comp.GlobalNamespace.GetMembers("C").First(); 4111var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 4129var symbolC = comp.GlobalNamespace.GetMembers("C").First(); 4276var symbolC = comp.GlobalNamespace.GetMembers("C").First(); 4306var symbolC = comp.GlobalNamespace.GetMembers("C").First(); 4308var declM = Generator.GetMembers(declC).First(); 4398var symbolC = comp.GlobalNamespace.GetMembers("C").First(); 4400var declM = Generator.GetMembers(declC).First(); 4581var decl = root.DescendantNodes().OfType<ClassDeclarationSyntax>().First(); 4595var symbolR = (INamedTypeSymbol)comp.GlobalNamespace.GetMembers("R").First(); 4610var symbolR = (INamedTypeSymbol)comp.GlobalNamespace.GetMembers("R").First(); 4633var symbolR = (INamedTypeSymbol)comp.GlobalNamespace.GetMembers("R").First(); 4648var symbolR = (INamedTypeSymbol)comp.GlobalNamespace.GetMembers("R").First(); 4671var symbol = comp.GlobalNamespace.GetMembers("C").First(); 4691var symbol = comp.GlobalNamespace.GetMembers("C").First().GetMembers("M").First(); 4709var symbol = comp.GlobalNamespace.GetMembers("C").First().GetMembers("X").First(); 4726var symbol = comp.GlobalNamespace.GetMembers("C").First().GetMembers("MyEvent").First(); 4751var symbol = comp.GlobalNamespace.GetMembers("C2").First().GetMembers("MyEvent").First();
Formatting\FormattingTreeEditTests.cs (2)
43var param = root.DescendantNodes().OfType<ParameterSyntax>().First(); 56var method = root.DescendantNodes().OfType<MethodDeclarationSyntax>().First();
Microsoft.CodeAnalysis.EditorFeatures (16)
Classification\CopyPasteAndPrintingClassificationBufferTaggerProvider.Tagger.cs (2)
105var snapshot = spans.First().Snapshot; 113var spanToTag = new SnapshotSpan(snapshot, Span.FromBounds(spans.First().Start, spans.Last().End));
CommentSelection\AbstractToggleBlockCommentBase.cs (2)
96var firstLineAroundSelection = selectedSpans.First().Start.GetContainingLine().Start; 100document, selectedSpans.First().Snapshot, linesContainingSelection, commentInfo, cancellationToken);
InlineRename\CommandHandlers\AbstractRenameCommandHandler.cs (1)
102var selection = args.TextView.Selection.VirtualSelectedSpans.First();
InlineRename\InlineRenameSession.cs (3)
179textBufferAssociatedViewService.GetAssociatedTextViews(triggerSpan.Snapshot.TextBuffer).First(); 247selections.First().IsEmpty || 248!startingSpan.Contains(selections.First()))
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (3)
187var document = _baseDocuments.First(); 246var boundingIntersectionSpan = Span.FromBounds(intersectionSpans.First().Start, intersectionSpans.Last().End); 330var newDocument = mergeResult.MergedSolution.GetDocument(documents.First().Id);
InlineRename\Taggers\AbstractRenameTagger.cs (1)
106var snapshot = spans.First().Snapshot;
IntelliSense\ViewTextSpan.cs (1)
78return spans.First();
Shared\Extensions\IProjectionBufferFactoryServiceExtensions.cs (1)
59var buffer = spans.First().Snapshot.TextBuffer;
Shared\Extensions\ITextViewExtensions.cs (1)
360var visibleStart = visibleSpansInBuffer.First().Start;
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs (1)
752var buffer = requestedSpans.First().Snapshot.TextBuffer;
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (25)
AbstractCommandHandlerTestState.cs (1)
69var languageName = Workspace.Projects.First().Language;
AutomaticCompletion\AbstractAutomaticBraceCompletionTests.cs (1)
149var document = workspace.Documents.First();
BraceHighlighting\AbstractBraceHighlightingTests.cs (1)
43var testDocument = workspace.Documents.First();
BraceMatching\AbstractBraceMatcherTests.cs (1)
27var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
CommentSelection\AbstractToggleCommentTestBase.cs (2)
37var doc = workspace.Documents.First(); 91textView.Selection.Select(new VirtualSnapshotPoint(snapshot, spans.First().Start),
Completion\AbstractCompletionProviderTests.cs (2)
896var position = testWorkspace.Documents.First().CursorPosition.Value; 898var textContainer = testWorkspace.Documents.First().GetTextBuffer().AsTextContainer();
DocumentTracking\FirstDocumentIsActiveAndVisibleDocumentTrackingService.cs (2)
26=> _workspace.CurrentSolution.Projects.First().DocumentIds.First();
Formatting\AbstractNewDocumentFormattingServiceTests.cs (2)
30var document = workspace.CurrentSolution.Projects.First().Documents.First();
Formatting\CoreFormatterTestsBase.cs (5)
79var document = workspace.Documents.First(); 142var buffer = workspace.Documents.First().GetTextBuffer(); 180var hostdoc = workspace.Documents.First(); 197factory.TextSpan = spans?.First() ?? documentSyntax.Root.FullSpan; 249var buffer = workspace.Documents.First().GetTextBuffer();
LanguageServer\AbstractLanguageServerProtocolTests.cs (1)
406var generatedDocumentId = DocumentId.CreateNewId(workspace.CurrentSolution.ProjectIds.First());
NavigateTo\AbstractNavigateToTests.cs (2)
247=> ImmutableArray.Create(_workspace.CurrentSolution.Projects.First().DocumentIds.First());
SignatureHelp\AbstractSignatureHelpProviderTests.cs (2)
367textSpan = textSpans.First(); 484textSpan = textSpans.First();
Squiggles\SquiggleUtilities.cs (1)
38var firstDocument = workspace.Documents.First();
TaskList\AbstractTaskListTests.cs (1)
34var hostDocument = workspace.Documents.First();
TextStructureNavigation\AbstractTextStructureNavigationTests.cs (1)
27var document = workspace.Documents.First();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (40)
CodeGeneration\AbstractCodeGenerationTests.cs (2)
94var expression = simplifiedRootNode.DescendantNodes().OfType<EqualsValueClauseSyntax>().First().Value; 115var expression = simplifiedRootNode.DescendantNodes().OfType<EqualsValueSyntax>().First().Value;
CommentSelection\CommentUncommentSelectionCommandHandlerTests.cs (1)
807textView.Selection.Select(new VirtualSnapshotPoint(snapshot, spans.First().Start),
Diagnostics\DiagnosticAnalyzerServiceTests.cs (2)
925context.RegisterCompilationAction(c => c.ReportDiagnostic(Diagnostic.Create(s_compilationRule, c.Compilation.SyntaxTrees.First().GetRoot().GetLocation()))); 941context.RegisterCompilationAction(c => c.ReportDiagnostic(Diagnostic.Create(s_compilationRule, c.Compilation.SyntaxTrees.First().GetRoot().GetLocation())));
FindSymbols\SymbolTreeInfoTests.cs (4)
24var reference1 = (PortableExecutableReference)project.MetadataReferences.First(); 45var reference1 = (PortableExecutableReference)project.MetadataReferences.First(); 68var reference1 = (PortableExecutableReference)project.MetadataReferences.First(); 90var reference1 = (PortableExecutableReference)project.MetadataReferences.First();
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
82get { return this.CurrentSolution.Projects.First(); }
Preview\PreviewWorkspaceTests.cs (12)
72var addedSolution = previewWorkspace.CurrentSolution.Projects.First() 76Assert.Equal(1, previewWorkspace.CurrentSolution.Projects.First().MetadataReferences.Count); 77Assert.Equal(1, previewWorkspace.CurrentSolution.Projects.First().DocumentIds.Count); 80var changedSolution = previewWorkspace.CurrentSolution.Projects.First().Documents.First().WithText(SourceText.From(text)).Project.Solution; 82Assert.Equal(previewWorkspace.CurrentSolution.Projects.First().Documents.First().GetTextAsync().Result.ToString(), text); 84var removedSolution = previewWorkspace.CurrentSolution.Projects.First() 85.RemoveMetadataReference(previewWorkspace.CurrentSolution.Projects.First().MetadataReferences[0]) 86.RemoveDocument(previewWorkspace.CurrentSolution.Projects.First().DocumentIds[0]).Solution; 89Assert.Equal(0, previewWorkspace.CurrentSolution.Projects.First().MetadataReferences.Count); 90Assert.Equal(0, previewWorkspace.CurrentSolution.Projects.First().DocumentIds.Count);
RenameTracking\RenameTrackingTestState.cs (1)
82HostDocument = Workspace.Documents.First();
Snippets\RoslynLSPSnippetConvertTests.cs (3)
402var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().Id); 413var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().Id); 495var document = workspace.CurrentSolution.GetRequiredDocument(workspace.Documents.First().Id);
Structure\BlockStructureServiceTests.cs (1)
115var hostDocument = workspace.Documents.First();
Structure\StructureTaggerTests.cs (1)
398var hostdoc = workspace.Documents.First();
Tagging\AsynchronousTaggerTests.cs (5)
78var document = workspace.Documents.First(); 107var document = workspace.Documents.First(); 133var document = workspace.Documents.First(); 154var testDocument = workspace.Documents.First(); 210var testDocument = workspace.Documents.First();
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());
TextEditor\TryGetDocumentTests.cs (3)
25var hostDocument = workspace.Documents.First(); 53var hostDocument = workspace.Documents.First(); 77var newDocument = newText.GetRelatedDocumentsWithChanges().First();
Utilities\PatternMatcherTests.cs (1)
398Assert.False(match.First().IsCaseSensitive);
Utilities\SymbolEquivalenceComparerTests.cs (1)
1893invocation ??= method_root.Parent.DescendantNodes().OfType<TInvocation>().First();
Microsoft.CodeAnalysis.EditorFeatures.Wpf (2)
InlineRename\UI\Dashboard\RenameDashboard.xaml.cs (1)
164=> FocusElement(_tabNavigableChildren.First(), i => i == _tabNavigableChildren.Count - 1 ? 0 : i + 1);
InlineRename\UI\InlineRenameAdornmentManager.cs (1)
134var selectionSpan = _textView.Selection.SelectedSpans.First();
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
Debugger\Engine\DkmClrModuleInstance.cs (1)
40get { return this.Assembly.Modules.First().ModuleVersionId; }
Microsoft.CodeAnalysis.ExternalAccess.Razor (1)
IMefHostServicesExtensions.cs (1)
14return exportProvider.GetExports<TService>().First().Value;
Microsoft.CodeAnalysis.Features (13)
AddImport\References\Reference.cs (1)
98var newContextNode = newRoot.GetAnnotatedTokens(annotation).First().Parent;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (1)
148attributeRemoveFixes.First().Title,
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (1)
113var firstNode = syntaxNodes.First();
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (1)
833? container.DescendantNodes().First()
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
145var firstFolder = folder.First();
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
346foreach (var symbol in symbols.GroupBy(s => new { s.Symbol.Name, s.Symbol.Kind }).Select(g => g.First()))
QuickInfo\CommonSemanticQuickInfoProvider.cs (1)
115?? candidateResults.First();
Snippets\SnippetFunctionService.cs (1)
72var simplifiedTypeName = await GetSimplifiedEnumNameAsync(document, fullyQualifiedEnumName, enumFields.First().Name, caseGenerationLocation, simplifierOptions, cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (2)
103var nodeAfterNewParamNode = paramNodes.FirstOrDefault() ?? newDocComment.ChildNodes().First(); 116GetNewNode(parameterName, nodeAfterNewParamNode == newDocComment.ChildNodes().First())
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (2)
110var commonType = commonTypes.First(); 119return similarTypes.First();
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
262var left = QualifiedNameToMemberAccess(qualifiedNameSyntaxKind, memberAccessExpressionSyntaxKind, expression.ChildNodes().First(), generator);
Microsoft.CodeAnalysis.LanguageServer (1)
HostWorkspace\ProjectTelemetry\ProjectLoadTelemetryReporter.cs (1)
52var firstInfo = projectFileInfos.First();
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateSet.cs (1)
50var (documentId, state) = _activeFileStates.First();
Handler\CodeActions\CodeActionHelpers.cs (1)
438matchingAction = matchingActions.First();
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\AbstractLanguageServer.cs (1)
134var hasParameters = methodGroup.First().RequestTypeRef != null;
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (14)
FoldingRanges\FoldingRangesTests.cs (2)
88var document = testLspServer.GetCurrentSolution().Projects.First().Documents.First();
Rename\RenameTests.cs (3)
45AssertJsonEquals(expectedEdits, ((TextDocumentEdit[])results.DocumentChanges).First().Edits); 101AssertJsonEquals(expectedEdits, ((TextDocumentEdit[])results.DocumentChanges).First().Edits); 147AssertJsonEquals(expectedEdits, ((TextDocumentEdit[])results.DocumentChanges).First().Edits);
SemanticTokens\AbstractSemanticTokensTests.cs (2)
64var document = testLspServer.GetCurrentSolution().Projects.First().Documents.First();
Symbols\DocumentSymbolsTests.cs (3)
48CreateDocumentSymbol(LSP.SymbolKind.Method, "M", "M()", testLspServer.GetLocations("method").Single(), testLspServer.GetLocations("methodSelection").Single(), expected.First()); 152var document = testLspServer.GetCurrentSolution().Projects.First().Documents.First();
Workspaces\LspWorkspaceManagerTests.cs (4)
446var newProjectWorkspaceTwo = testWorkspaceTwo.CurrentSolution.Projects.First().WithAssemblyName("NewCSProj1"); 483var documentUri = testWorkspace.CurrentSolution.Projects.First().Documents.First().GetURI(); 502var newProject = testWorkspace.CurrentSolution.Projects.First().WithAssemblyName(newAssemblyName);
Microsoft.CodeAnalysis.Test.Utilities (12)
CommonTestBase.cs (1)
97var module = compilation.Assembly.Modules.First();
Compilation\CompilationExtensions.cs (1)
201SyntaxTree tree = compilation.SyntaxTrees.First();
Compilation\CompilationTestDataExtensions.cs (1)
65methodData = map[keys.First()];
CompilationVerifier.cs (1)
700return ((IAssemblySymbol)symbol).Modules.First();
Diagnostics\CommonDiagnosticAnalyzers.cs (5)
105var tree = compilation.SyntaxTrees.First(); 183var tree = compilation.SyntaxTrees.First(); 260var tree = compilation.SyntaxTrees.First(); 313var tree = compilation.SyntaxTrees.First(); 1294_ = getControlFlowGraph(operationBlock.Descendants().First());
Diagnostics\DiagnosticDescription.cs (1)
489var isCSharpOrRazor = actual.Any() && actual.First() is CSDiagnostic or { Descriptor.Category: "Razor" };
Metadata\AggregatedMetadataReader.cs (1)
31_aggregator = new MetadataAggregator(readers.First(), readers.Skip(1).ToArray());
Metadata\MetadataSignatureUnitTestHelper.cs (1)
119var actualSignature = signatures.First().Replace("\"", "\\\"");
Microsoft.CodeAnalysis.UnitTests (20)
Analyzers\AnalyzerConfigTests.cs (4)
1593Assert.Same(options[0].TreeOptions.Keys.First(), options[1].TreeOptions.Keys.First()); 1594Assert.Same(options[1].TreeOptions.Keys.First(), options[2].TreeOptions.Keys.First());
Analyzers\AnalyzerFileReferenceTests.cs (3)
175Assert.Equal(AnalyzerLoadFailureEventArgs.FailureErrorCode.UnableToLoadAnalyzer, errors.First().ErrorCode); 252Assert.Equal(AnalyzerLoadFailureEventArgs.FailureErrorCode.UnableToCreateAnalyzer, errors.First().ErrorCode); 461Assert.Equal(AnalyzerLoadFailureEventArgs.FailureErrorCode.ReferencesFramework, errors.First().ErrorCode);
Collections\ImmutableArrayExtensionsTests.cs (1)
47Assert.Equal("hello", e.First());
Collections\ImmutableListTestBase.cs (1)
452for (int value = basis.First() - 1; value <= basis.Last() + 1; value++)
Collections\ImmutableSetTest.cs (1)
480Assert.Equal(set.First(), enumerator.Current);
Collections\List\ICollection.Generic.Tests.cs (1)
372T value = collection.First();
CommonSyntaxTests.cs (4)
222var trackedB = trackedExpr.GetCurrentNodes(exprB).First(); 234var annotation = trackedExpr.GetAnnotatedNodes(SyntaxNodeExtensions.IdAnnotationKind).First() 235.GetAnnotations(SyntaxNodeExtensions.IdAnnotationKind).First(); 245var trackedB = trackedExpr.GetCurrentNodes(exprB).First();
Diagnostics\SuppressMessageTargetSymbolResolverTests.cs (1)
1356foreach (var span in spans.Values.First())
GivesAccessTo.cs (2)
45var CS = csc.GlobalNamespace.GetMembers("CS").First() as INamedTypeSymbol; 48var CS2 = csc2.GlobalNamespace.GetMembers("CS2").First() as INamedTypeSymbol;
IsSymbolAccessibleWithinTests.cs (2)
29var Ac = csc.GlobalNamespace.GetMembers("A").First() as INamedTypeSymbol; 32var Av = vbc.GlobalNamespace.GetMembers("A").First() as INamedTypeSymbol;
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (5)
Syntax\SyntaxAnnotationTests.vb (5)
64Dim toToken = VisualBasicSyntaxTree.ParseText(_helloWorldCode).GetRoot().DescendantTokens().First() 71Dim fromToken = VisualBasicSyntaxTree.ParseText(_helloWorldCode).GetRoot().DescendantTokens().First() 79Dim fromToken = VisualBasicSyntaxTree.ParseText(_helloWorldCode).GetRoot().DescendantTokens().First() 80Dim toToken = VisualBasicSyntaxTree.ParseText(_helloWorldCode).GetRoot().DescendantTokens().First() 209Dim trivia = GetAllTrivia(tree.GetRoot()).First()
Microsoft.CodeAnalysis.Workspaces (21)
CodeFixes\FixAllOccurrences\FixAllState.cs (3)
69var triggerDocument = diagnosticsToFix.First().Key; 70var diagnosticSpan = diagnosticsToFix.First().Value.FirstOrDefault()?.Location.SourceSpan; 91var triggerProject = diagnosticsToFix.First().Key;
Editing\SyntaxGenerator.cs (1)
1531var first = replacements.First();
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (1)
95var document = scope.First();
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (2)
108var lambdaNode = parameter.ContainingSymbol.DeclaringSyntaxReferences.Select(r => r.GetSyntax(cancellationToken)).First(); 148var lambdaNode = symbol.ContainingSymbol.DeclaringSyntaxReferences.Select(r => r.GetSyntax(cancellationToken)).First();
LinkedFileDiffMerging\AbstractLinkedFileMergeConflictCommentAdditionService.cs (3)
41changes.First() 43var currentPartitionEndLine = originalSourceText.Lines.GetLineFromPosition(changes.First().Span.End); 73var startPosition = changePartition.First().Span.Start;
Log\StatisticResult.cs (1)
37var mode = values.GroupBy(i => i).OrderByDescending(g => g.Count()).First().Key;
Rename\ConflictEngine\ConflictResolver.cs (1)
206var renameRewriterService = implicitReferenceLocationsPerLanguage.First().Document.Project.Services.GetRequiredService<IRenameRewriterLanguageService>();
Rename\RenameUtilities.cs (1)
94.Concat(documentsOfRenameSymbolDeclaration.First().Id)
Shared\Extensions\INamespaceSymbolExtensions.cs (1)
144? members.First() as INamespaceSymbol
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
708var count = data.First().Count();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ICompilationExtensions.cs (1)
46var referencedAssemblySymbols = compilation.Assembly.Modules.First().ReferencedAssemblySymbols;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
362return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
301var fullSpan = nodes.First().Span;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextExtensions.cs (1)
13=> FixAllHelper.GetDefaultFixAllTitle(context.Scope, title: context.DiagnosticIds.First(), context.Document!, context.Project);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
233var importContainer = addImportsService.GetImportContainer(root, context, importToSyntax.First().Value, options);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
813: inProgressState.PendingTranslationActions.First().OldProjectState;
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
Build\ProjectBuildManager.cs (1)
93return (loadedProjects.First(), log);
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
708var count = data.First().Count();
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (36)
MSBuildWorkspaceTestBase.cs (2)
61var project = sol.Projects.First(); 70var project = sol.Projects.First();
SolutionGeneration.cs (1)
265var propertyGroup = document.Root.Descendants(XName.Get("PropertyGroup", NS)).First();
VisualStudioMSBuildWorkspaceTests.cs (33)
59var project = solution.Projects.First(); 60var document = project.Documents.First(); 338var d1 = p1.Documents.First(); 340var decl = root.DescendantNodes().OfType<CS.Syntax.ClassDeclarationSyntax>().First(); 372var project2 = solution.GetProjectsByName("Project2").First(); 391var project = solution.Projects.First(); 393var document = project.Documents.First(); 436var document = project.Documents.First(); 457var document = project.Documents.First(); 475var document = project.Documents.First(); 588var project = solution.Projects.First(); 788var project = solution.Projects.First(); 806var project = solution.Projects.First(); 824var project = solution.Projects.First(); 842var project = solution.Projects.First(); 894var document = project.Documents.First(); 913var document = project.Documents.First(); 955var doc = solution.Projects.First().Documents.First(d => d.FilePath == sourceFile); 989var doc = solution.Projects.First().Documents.First(d => d.FilePath == sourceFile); 1655var project = sol.Projects.First(); 2238var doc = workspace.CurrentSolution.Projects.First().Documents.First(); 2268var doc = workspace.CurrentSolution.Projects.First().Documents.First(); 2390var doc = proj.Documents.First(); 2428var proj = sol.Projects.First(); 2535var project = solution.Projects.First(); 2551var project = solution.Projects.First(); 2664var project = solution.Projects.First(); 2845var project = sol.GetObjectReference(static s => s.Projects.First()); 2846var document = project.GetObjectReference(static p => p.Documents.First()); 2935var project = solution.Projects.First(); 2964var pref = project.ProjectReferences.First();
Microsoft.CodeAnalysis.Workspaces.UnitTests (57)
CommandLineProject\CommandLineProjectTests.cs (7)
27var docInfo = info.Documents.First(); 58var docInfo = info.Documents.First(); 69var docInfo = info.Documents.First(); 81var docInfo = info.Documents.First(); 92var docInfo = info.Documents.First(); 104var docInfo = info.Documents.First(); 115var docInfo = info.Documents.First();
FindAllDeclarationsTests.cs (1)
667var project = solution.Projects.First();
FindAllDeclarationsTests.TestSolutionsAndProject.cs (1)
143project = solution.Projects.First();
FindReferencesTests.cs (7)
103var project = solution.Projects.First(); 128var project = solution.Projects.First(); 323var project = solution.Projects.First(); 513var project = solution.Projects.First(); 540var project = solution.Projects.First(); 573var project = solution.Projects.First(); 615var project = solution.Projects.First();
SolutionTests\SolutionTests.cs (7)
431var documentId1 = solution.Projects.First().DocumentIds.Single(); 519var documentId1 = solution.Projects.First().DocumentIds.Single(); 598var documentId1 = solution.Projects.First().DocumentIds.Single(); 684var documentId1 = solution.Projects.First().DocumentIds.Single(); 761var documentId1 = solution.Projects.First().DocumentIds.Single(); 849var documentId1 = solution.Projects.First().DocumentIds.Single(); 4272var frozenDocument = project.Documents.First().WithFrozenPartialSemantics(CancellationToken.None);
SolutionTests\SolutionWithSourceGeneratorTests.cs (1)
201project = project.AdditionalDocuments.First().WithAdditionalDocumentText(SourceText.From("Changed text!")).Project;
SymbolKeyTests.cs (12)
618var tree = compilation.SyntaxTrees.First(); 654var tree = compilation.SyntaxTrees.First(); 676var tree = compilation.SyntaxTrees.First(); 701var tree = compilation.SyntaxTrees.First(); 719var tree = compilation.SyntaxTrees.First(); 722var method = GetDeclaredSymbols(compilation).OfType<IMethodSymbol>().First(); 737var tree = compilation.SyntaxTrees.First(); 740var type = GetDeclaredSymbols(compilation).OfType<INamedTypeSymbol>().First(); 757var tree = compilation.SyntaxTrees.First(); 780var tree = compilation.SyntaxTrees.First(); 823var tree = compilation.SyntaxTrees.First(); 837var tree = compilation.SyntaxTrees.First();
SyntaxNodeTests.cs (6)
95var classDecl = root.DescendantNodes().OfType<ClassDeclarationSyntax>().First(); 96var methodDecl = classDecl.DescendantNodes().OfType<MethodDeclarationSyntax>().First(); 105var currentClassDecl = trackedRoot.GetCurrentNodes(classDecl).First(); 109var latestMethod = classDeclWithField.GetCurrentNodes(methodDecl).First(); 123var finalClassDecl = root2.GetCurrentNodes(classDecl).First(); 127var finalMethodDecl = root2.GetCurrentNodes(methodDecl).First();
SyntaxReferenceTests.cs (12)
55var tree = await solution.Projects.First().Documents.First().GetRequiredSyntaxTreeAsync(CancellationToken.None); 77var tree = await solution.Projects.First().Documents.First().GetRequiredSyntaxTreeAsync(CancellationToken.None); 101var tree = await solution.Projects.First().Documents.First().GetRequiredSyntaxTreeAsync(CancellationToken.None); 124var tree = await solution.Projects.First().Documents.First().GetRequiredSyntaxTreeAsync(CancellationToken.None); 148var tree = await solution.Projects.First().Documents.First().GetRequiredSyntaxTreeAsync(CancellationToken.None); 175var tree = await solution.Projects.First().Documents.First().GetRequiredSyntaxTreeAsync(CancellationToken.None);
WorkspaceTests\AdhocWorkspaceTests.cs (3)
143Assert.Equal(id1, project2.ProjectReferences.First().ProjectId); 173var proj = ws.CurrentSolution.Projects.First(); 180var doc = proj.Documents.First();
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
AbstractLanguageServer.cs (1)
134var hasParameters = methodGroup.First().RequestTypeRef != null;
Microsoft.Data.Analysis.Tests (2)
DataFrame.IOTests.cs (1)
1071var separator = cultureInfo.NumberFormat.NumberDecimalSeparator.First();
DataFrameGroupByTests.cs (1)
52Assert.Equal("even", grouping.First().Key);
Microsoft.DotNet.Arcade.Sdk (1)
src\GroupItemsBy.cs (1)
59var result = items.First();
Microsoft.DotNet.AsmDiff (2)
AssemblySet.cs (2)
78var firstLocation = assemblies.Select(a => a.Location).First(); 113var firstPath = allPaths.First();
Microsoft.DotNet.Build.Tasks.Installers (1)
src\GenerateJsonObjectString.cs (1)
61ITaskItem item = group.First();
Microsoft.DotNet.Build.Tasks.Workloads (2)
Msi\MsiUtils.wix.cs (1)
147Record providerKey = depProviderView.First();
WorkloadPackGroupPackage.wix.cs (1)
37var manifestPackage = ManifestsPerPlatform.First().Value.OrderBy(m => m.Version).Last();
Microsoft.DotNet.Git.IssueManager (2)
Clients\AzureDevOpsClient.cs (1)
46return $"Azure DevOps user: {commitResponse.Value.First().Author.Name}";
Clients\GitHubClient.cs (1)
32commit = commitInfo.Parents.First().Sha;
Microsoft.DotNet.Helix.Sdk (2)
CreateFailedTestsForFailedWorkItems.cs (1)
80return (int)testResults.First()["id"];
ProvisioningProfileProvider.cs (1)
136string appBundleName = entry.FullName.Split(new[] { '/' }, 2).First();
Microsoft.DotNet.Helix.Sdk.Tests (9)
CreateXHarnessAndroidWorkItemsTests.cs (4)
77var workItem = _task.WorkItems.First(); 119workItem = _task.WorkItems.First(); 154var workItem2 = _task.WorkItems.First(); 179var workItem = _task.WorkItems.First();
CreateXHarnessAppleWorkItemsTests.cs (5)
80var workItem = _task.WorkItems.First(); 129workItem = _task.WorkItems.First(); 158var workItem = _task.WorkItems.First(); 188var workItem1 = _task.WorkItems.First(); 231var workItem = _task.WorkItems.First();
Microsoft.DotNet.NuGetRepack.Tasks (1)
src\NuGetVersionUpdater.cs (1)
197var label = packageVersion.ReleaseLabels.First().Split('-')[0];
Microsoft.DotNet.Open.Api.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
52.Single(c => c.GetParameters().First().ParameterType == typeof(ConsoleSpecialKey));
Microsoft.DotNet.SharedFramework.Sdk (3)
src\CreateFrameworkListFile.cs (1)
99.Select(g => g.First())
src\GeneratePlatformManifestEntriesFromTemplate.cs (1)
32var files = Files.ToLookup(file => Path.GetFileName(file.ItemSpec)).ToDictionary(l => l.Key, l=> l.First());
src\GenerateSharedFrameworkDepsFile.cs (1)
104.Select(expansion => new RuntimeFallbacks(expansion.First(), expansion.Skip(1))); // ExpandRuntime return runtime itself as first item.
Microsoft.DotNet.SignCheckLibrary (1)
Verification\XmlVerifier.cs (1)
63ArrayList certificates = signedXml.Signature.KeyInfo.OfType<KeyInfoX509Data>().First().Certificates;
Microsoft.DotNet.SignTool.Tests (2)
SignToolTests.cs (2)
1998{ "31bf3856ad364e35", new List<SignInfo>{ new SignInfo(dualCertificates.First().ItemSpec, null) } } 2005$"File 'SignedLibrary.dll' TargetFramework='.NETCoreApp,Version=v2.0' Certificate='{dualCertificates.First()}'",
Microsoft.DotNet.SourceBuild.Tasks (2)
src\UsageReport\WriteUsageReports.cs (2)
249.First() 254x.Nodes().OfType<XText>().First().Value))
Microsoft.DotNet.VersionTools (4)
Automation\GitHubApi\GitHubClient.cs (1)
252pullRequestNumber = queryResponse.Items.First().Number;
Automation\VstsApi\VstsAdapterClient.cs (1)
326JObject o = responseRefs["value"].Values<JObject>().First();
BuildInfo.cs (1)
151latestReleaseVersion = File.ReadLines(latestReleasePath).First().Trim();
Dependencies\Submodule\SubmoduleDependencyInfo.cs (1)
43commit = remoteRefLines.Single().Split('\t').First();
Microsoft.DotNet.XUnitAssert.Tests (2)
Sdk\ArgumentFormatterTests.cs (2)
535 var parameterType = genericTypeParameters.First(); 544 var parameterTKey = genericTypeParameters.First();
Microsoft.DotNet.XUnitExtensions (3)
Discoverers\PlatformSpecificDiscoverer.cs (1)
26TestPlatforms platforms = (TestPlatforms)traitAttribute.GetConstructorArguments().First();
Discoverers\SkipOnTargetFrameworkDiscoverer.cs (1)
26TargetFrameworkMonikers frameworks = (TargetFrameworkMonikers)traitAttribute.GetConstructorArguments().First();
XunitParallelTheoryTestCaseRunner.cs (1)
64IAttributeInfo discovererAttribute = dataAttribute.GetCustomAttributes(typeof(DataDiscovererAttribute)).First();
Microsoft.Extensions.AI.Abstractions.Tests (1)
AssertExtensions.cs (1)
43.First();
Microsoft.Extensions.AI.AzureAIInference.Tests (1)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (1)
43.First();
Microsoft.Extensions.AI.Ollama.Tests (1)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (1)
43.First();
Microsoft.Extensions.AI.OpenAI.Tests (1)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (1)
43.First();
Microsoft.Extensions.AI.Tests (1)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (1)
43.First();
Microsoft.Extensions.ApiDescription.Tool.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
52.Single(c => c.GetParameters().First().ParameterType == typeof(ConsoleSpecialKey));
Microsoft.Extensions.Caching.Abstractions (1)
Hybrid\HybridCache.cs (1)
80ICollection<string> { Count: 1 } => RemoveAsync(keys.First(), cancellationToken),
Microsoft.Extensions.DependencyModel (1)
DependencyContextWriter.cs (1)
414WriteLibrary(libraryGroup.Key, libraryGroup.First(), jsonWriter);
Microsoft.Extensions.Diagnostics.Probes.Tests (5)
KubernetesProbesExtensionsTests.cs (3)
42var config = configurations.First(); 85var config = configurations.First(); 113var config = configurations.First();
TcpEndpointProbesExtensionsTests.cs (2)
148var configuration = configurations.First(); 169var config = configurations.First();
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (3)
CircularBufferTests.cs (1)
43Assert.Equal(expectedBufferElements.First(), firstElement);
ResourceMonitoringBuilderTests.cs (2)
31Assert.IsAssignableFrom<EmptyPublisher>(publishersArray.First()); 51Assert.IsAssignableFrom<EmptyPublisher>(publishersArray.First());
Microsoft.Extensions.Diagnostics.Testing (1)
Logging\FakeLoggerProvider.cs (1)
99internal string FirstLoggerName => _loggers.First().Key;
Microsoft.Extensions.Http.Diagnostics (1)
Latency\Internal\HttpClientLatencyLogEnricher.cs (1)
63_ = stringBuilder.Append(values!.First());
Microsoft.Extensions.ML (2)
ModelLoaders\UriModelLoader.cs (2)
112return resp.Headers.GetValues(ETagHeader).First() == eTag; 151_eTag = resp.Headers.GetValues(ETagHeader).First();
Microsoft.Extensions.Options.Contextual.Tests (2)
AcceptanceTests.cs (2)
96Assert.Equal("Fahrenheit", (await forecastService.GetForecast(new WeatherForecastContext { Country = "US" }, CancellationToken.None)).First().TemperatureScale); 97Assert.Equal("Celsius", (await forecastService.GetForecast(new WeatherForecastContext { Country = "CA" }, CancellationToken.None)).First().TemperatureScale);
Microsoft.Extensions.SecretManager.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
52.Single(c => c.GetParameters().First().ParameterType == typeof(ConsoleSpecialKey));
Microsoft.Gen.ComplianceReports.Unit.Tests (2)
GeneratorTests.cs (2)
120var inputFile = Directory.GetFiles("TestClasses").First(); 147var inputFile = Directory.GetFiles("TestClasses").First();
Microsoft.Gen.MetricsReports.Unit.Tests (3)
GeneratorTests.cs (3)
85var inputFile = Directory.GetFiles("TestClasses").First(); 101var inputFile = Directory.GetFiles("TestClasses").First(); 128var inputFile = Directory.GetFiles("TestClasses").First();
Microsoft.ML.AutoML (17)
AutoMLExperiment\Runner\SweepablePipelineRunner.cs (1)
66Model = models.First(),
ColumnInference\ColumnGroupingInference.cs (1)
75? g.First().Item1.SuggestedName
ColumnInference\TextFileContents.cs (2)
110var mostCommon = columnCounts.GroupBy(x => x).OrderByDescending(x => x.Count()).First(); 119result = new ColumnSplitResult(true, options.Separators.First(), options.AllowQuoting, options.ReadMultilines, options.AllowSparse, mostCommon.Key);
PipelineSuggesters\PipelineSuggester.cs (2)
100history = history.GroupBy(r => r.Pipeline.Trainer.TrainerName).Select(g => g.First()); 117.Select(x => x.First().Pipeline.Trainer);
SweepableEstimator\SweepablePipeline.cs (1)
76_currentSchema = currentSchema ?? schema.ToTerms().First().ToString();
TransformInference\TransformInference.cs (6)
458intermediateCols.First().Type.IsVector())) 464(intermediateCols.First().Type.IsVector() || 465intermediateCols.First().Purpose == ColumnPurpose.CategoricalFeature || 466intermediateCols.First().Purpose == ColumnPurpose.TextFeature || 467intermediateCols.First().Purpose == ColumnPurpose.ImagePath)) 469return ColumnCopyingExtension.CreateSuggestedTransform(context, concatColNames.First(), DefaultColumnNames.Features);
Tuner\AutoZeroTuner.cs (2)
95var pipelineSchema = pipelineSchemas.First().Key; 98var trainerEstimatorName = pipeline.Estimators.Where(kv => kv.Value.EstimatorType.IsTrainer()).First().Key;
Tuner\PipelineProposer.cs (1)
97schema = _eci.OrderBy(kv => kv.Value).First().Key;
Utils\UserInputValidationUtil.cs (1)
274$"but only type {allowedTypes.First()} is allowed.");
Microsoft.ML.AutoML.SourceGenerator (4)
EstimatorTypeGenerator.cs (1)
25if (context.AdditionalFiles.Where(f => f.Path.Contains("code_gen_flag.json")).First() is AdditionalText text)
SearchSpaceGenerator.cs (1)
22if (context.AdditionalFiles.Where(f => f.Path.Contains("code_gen_flag.json")).First() is AdditionalText text)
SweepableEstimatorFactoryGenerator.cs (1)
22if (context.AdditionalFiles.Where(f => f.Path.Contains("code_gen_flag.json")).First() is AdditionalText text)
SweepableEstimatorGenerator.cs (1)
21if (context.AdditionalFiles.Where(f => f.Path.Contains("code_gen_flag.json")).First() is AdditionalText text)
Microsoft.ML.AutoML.Tests (15)
AutoFitTests.cs (5)
288result.BestRun.Results.First().ValidationMetrics.MicroAccuracy.Should().BeGreaterThan(0.7); 289var scoredData = result.BestRun.Results.First().Model.Transform(trainData); 375var scoredData = result.BestRun.Results.First().Model.Transform(trainData); 616.Execute(dataCV.First().TrainSet, 627var resCV = model.Transform(dataCV.First().TrainSet);
ColumnInferenceTests.cs (6)
100Assert.Equal("Bool", result.ColumnInformation.NumericColumnNames.First()); 145Assert.Equal("Username", result.ColumnInformation.TextColumnNames.First()); 183Assert.Equal(DefaultColumnNames.Features, result.ColumnInformation.NumericColumnNames.First()); 196Assert.Equal(DefaultColumnNames.Features, result.ColumnInformation.NumericColumnNames.First()); 230Assert.Equal("description", result.ColumnInformation.TextColumnNames.First()); 231Assert.Equal("animal", result.ColumnInformation.CategoricalColumnNames.First());
DatasetUtil.cs (1)
226.First() + ".bin";
UserInputValidationTests.cs (3)
60var originalColumnName = _data.Schema.First().Name; 401var originalColumnName = _data.Schema.First().Name; 416var originalColumnName = _data.Schema.First().Name;
Microsoft.ML.CodeGenerator (3)
CodeGenerator\CSharp\AzureCodeGenerator\AzureAttachModelCodeGenerator.cs (1)
56var labelType = _columnInferenceResult.TextLoaderOptions.Columns.Where(t => t.Name == _settings.LabelName).First().DataKind;
CodeGenerator\CSharp\CodeGenerator.cs (1)
60var labelType = _columnInferenceResult.TextLoaderOptions.Columns.Where(t => t.Name == _settings.LabelName).First().DataKind;
Utils.cs (1)
146return sanitizedInput.First().ToString().ToUpper() + sanitizedInput.Substring(1);
Microsoft.ML.CodeGenerator.Tests (1)
CodeGenTests.cs (1)
40Assert.Equal("using Microsoft.ML.Trainers.LightGbm;\r\n", actual.Item2.First());
Microsoft.ML.Core (3)
Data\Repository.cs (1)
435.First()
SearchSpace\ChoiceAttribute.cs (1)
35Contract.Assert(candidatesType.First() == defaultValue.GetType(), "candidates type doesn't match with defaultValue type");
Utilities\ResourceManagerUtils.cs (1)
277if (!hasHeader || !long.TryParse(headers.First(), out var size))
Microsoft.ML.Data (37)
Commands\DataCommand.cs (1)
158var data = mValue.First().Value;
Data\DataViewTypeManager.cs (3)
68typeAttr = typeAttributes.First() as DataViewTypeAttribute; 103typeAttr = typeAttributes.First() as DataViewTypeAttribute; 156var attr = typeAttributes.First();
Data\DataViewUtils.cs (2)
1132$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'."); 1323$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'.");
Data\SchemaDefinition.cs (1)
397var customTypeAttribute = (DataViewTypeAttribute)customTypeAttributes.First();
DataLoadSave\Binary\BinaryLoader.cs (1)
2043$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'.");
DataLoadSave\Database\DatabaseLoaderCursor.cs (1)
167$"expected type: '{originFn.GetType().GetGenericArguments().First()}'.");
DataLoadSave\Text\TextLoaderCursor.cs (1)
326$"expected type: '{originFn.GetType().GetGenericArguments().First()}'.");
DataLoadSave\Transpose\TransposeLoader.cs (3)
697$"expected type: '{_getter.GetType().GetGenericArguments().First().GetGenericArguments().First()}'."); 891$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'.");
DataView\AppendRowsDataView.cs (1)
197$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'.");
DataView\BatchDataViewMapperBase.cs (1)
126$"expected type: '{getter.GetType().GetGenericArguments().First()}'.");
DataView\CacheDataView.cs (1)
1213$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'.");
DataView\DataViewConstructionUtils.cs (1)
438$"expected type: '{getter.GetType().GetGenericArguments().First()}'.");
DataView\RowToRowMapperTransform.cs (2)
341$"expected type: '{originFn.GetType().GetGenericArguments().First()}'."); 408$"expected type: '{getter.GetType().GetGenericArguments().First()}'.");
DataView\Transposer.cs (4)
321$"expected type: '{_getter.GetType().GetGenericArguments().First().GetGenericArguments().First()}'."); 1175$"expected type: '{originFn.GetType().GetGenericArguments().First()}'."); 1508$"expected type: '{_getter.GetType().GetGenericArguments().First()}'.");
EntryPoints\EntryPointNode.cs (1)
853var firstBinding = bindings.First();
Evaluators\MulticlassClassificationEvaluator.cs (2)
226dst = new VBuffer<ReadOnlyMemory<char>>(allTopK.First().Length, Enumerable.Range(1, allTopK.First().Length).Select(i => new ReadOnlyMemory<char>(i.ToString().ToCharArray())).ToArray());
Model\Pfa\BoundPfaContext.cs (1)
93_nameToVarName[_nameToVarName.Keys.First()] = "input";
Scorers\RowToRowScorerBase.cs (1)
304$"expected type: '{getter.GetType().GetGenericArguments().First()}'.");
Transforms\GenerateNumberTransform.cs (1)
447$"expected type: '{originFn.GetType().GetGenericArguments().First()}'.");
Transforms\LabelConvertTransform.cs (2)
228$"expected type: '{_getter.GetType().GetGenericArguments().First().GetGenericArguments().First()}'.");
Transforms\NAFilter.cs (1)
433$"expected type: '{originFn.GetType().GetGenericArguments().First()}'.");
Transforms\PerGroupTransformBase.cs (1)
309$"expected type: '{getter.GetType().GetGenericArguments().First()}'.");
Transforms\RangeFilter.cs (1)
328$"expected type: '{originFn.GetType().GetGenericArguments().First()}'.");
Transforms\RowShufflingTransformer.cs (1)
721$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'.");
Transforms\TransformBase.cs (2)
237$"expected type: '{originFn.GetType().GetGenericArguments().First()}'."); 911$"expected type: '{originFn.GetType().GetGenericArguments().First()}'.");
Microsoft.ML.Ensemble (2)
Trainer\Binary\EnsembleTrainer.cs (1)
95var p = models.First();
Trainer\Regression\RegressionEnsembleTrainer.cs (1)
89var p = models.First();
Microsoft.ML.EntryPoints (2)
PermutationFeatureImportance.cs (2)
190var metric = metrics.First(); 295var metric = metrics.First();
Microsoft.ML.FastTree (17)
BoostingFastTree.cs (2)
127var validationResult = ValidTest.ComputeTests().First(); 131var trainingResult = TrainTest.ComputeTests().First();
FastTreeRanking.cs (2)
370trainTestResult = _specialTrainSetTest.ComputeTests().First().FinalValue; 375validTestResult = PruningTest.ComputeTests().First().FinalValue;
Training\Test.cs (5)
285public double BestAverageValue => _toleratedQueue.Count == 0 ? 0.0 : _toleratedQueue.First().Sum / _windowSize; 305double currentValue = ComputeTests().First().FinalValue * (r.LowerIsBetter ? -1.0 : 1.0); 309double outValue = _window.First(); 327while (_toleratedQueue.First().Sum < _currentWindowSum * toleranceFactor) 332BestIteration = _toleratedQueue.First().Iteration;
TreeEnsemble\InternalRegressionTree.cs (1)
216CategoricalSplitFeatureRanges[i][0] = CategoricalSplitFeatures[i].First();
TreeEnsemble\InternalTreeEnsemble.cs (1)
330var maxValue = sortedByGain.First().Value;
Utils\LinqExtensions.cs (6)
69T max = e.First(); 86T max = e.First(); 106T max = e.First(); 129T max = e.First(); 149T max = e.First(); 169T max = e.First();
Microsoft.ML.GenAI.Phi.Tests (2)
SemanticKernelTests.cs (2)
48var response = responses.First(); 51var textContent = response.Items.First() as TextContent;
Microsoft.ML.OnnxTransformerTest (5)
DnnImageFeaturizerTest.cs (1)
241ModelInput sample = ML.Data.CreateEnumerable<ModelInput>(data, false).First();
OnnxTransformTests.cs (4)
709var dictionary = buffer.First(); 724var dictionary = transformedDataPoints[i].output.First(); 762var dictionary = buffer.First(); 777var dictionary = transformedDataPoints[i].output.First();
Microsoft.ML.Parquet (2)
ParquetLoader.cs (1)
606$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'.");
PartitionedFileLoader.cs (1)
428$"expected type: '{originGetter.GetType().GetGenericArguments().First()}'.");
Microsoft.ML.PerformanceTests (2)
FeaturizeTextBench.cs (1)
74IEstimator<ITransformer> pipeline = featurizers.First();
ImageClassificationBench.cs (1)
195.First() + ".bin";
Microsoft.ML.Samples (12)
Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (2)
141Image = testImages.First().Image 294.First() + ".bin";
Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (2)
167Image = testImages.First().Image 326.First() + ".bin";
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (2)
162ImagePath = testImages.First().ImagePath 282.First() + ".bin";
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (2)
150Image = testImages.First().Image 303.First() + ".bin";
Dynamic\Transforms\ApplyONNXModelWithInMemoryImages.cs (1)
65var firstClassProb = dataPoint.Scores.First();
Dynamic\Transforms\CalculateFeatureContribution.cs (1)
66var prediction = predictionEngine.Predict(samples.First());
Dynamic\Transforms\CalculateFeatureContributionCalibrated.cs (1)
68var prediction = predictionEngine.Predict(samples.First());
Dynamic\Transforms\CustomMappingWithInMemoryCustomType.cs (1)
38tribeTransformed, false).First();
Microsoft.ML.Samples.GPU (8)
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (2)
141Image = testImages.First().Image 294.First() + ".bin";
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (2)
167Image = testImages.First().Image 326.First() + ".bin";
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (2)
162ImagePath = testImages.First().ImagePath 282.First() + ".bin";
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (2)
150Image = testImages.First().Image 303.First() + ".bin";
Microsoft.ML.SearchSpace (6)
SearchSpace.cs (4)
213CheckOptionType(attributes.First(), field.Name, field.FieldType); 215OptionBase option = attributes.First() switch 260CheckOptionType(attributes.First(), property.Name, property.PropertyType); 262OptionBase option = attributes.First() switch
Tuner\GridSearchTuner.cs (2)
35foreach (var i in arrays.First()) 42foreach (var i in arrays.First())
Microsoft.ML.TensorFlow.Tests (1)
TensorflowTests.cs (1)
2007.First() + ".bin";
Microsoft.ML.Tests (23)
ImagesTests.cs (2)
94var newCols = ((ImageLoadingTransformer)transformerChain.First()).Columns; 95var oldCols = ((ImageLoadingTransformer)model.First()).Columns;
PermutationFeatureImportanceTests.cs (2)
961var min = metricsDelta.OrderBy(m => metricSelector(m)).First(); 969var max = metricsDelta.OrderByDescending(m => metricSelector(m)).First();
Scenarios\Api\TestApi.cs (10)
324cvSplit.First().TrainSet, 325cvSplit.First().TestSet, 326cvSplitWithSeed.First().TrainSet, 327cvSplitWithSeed.First().TestSet, 328cvSplitWithSeedAndSamplingKey.First().TrainSet, 329cvSplitWithSeedAndSamplingKey.First().TestSet 381var uniqueTrain = stratTrainWorkclass.GroupBy(x => x.ToString()).Select(x => x.First()).ToList(); 383var uniqueTest = stratTestWorkClass.GroupBy(x => x.ToString()).Select(x => x.First()).ToList(); 393var uniqueSeedTrain = stratTrainWithSeedWorkclass.GroupBy(x => x.ToString()).Select(x => x.First()).ToList(); 395var uniqueSeedTest = stratTestWithSeedWorkClass.GroupBy(x => x.ToString()).Select(x => x.First()).ToList();
TextLoaderTests.cs (2)
1187var oneIrisData = mlContext.Data.CreateEnumerable<IrisPublicProperties>(dataIris, false).First(); 1192oneIrisData = mlContext.Data.CreateEnumerable<IrisPublicProperties>(dataIris, false).First();
TrainerEstimators\MatrixFactorizationTests.cs (2)
685var firstElement = results.First(); 703firstElement = topColumns.First();
TrainerEstimators\SdcaTests.cs (2)
91var first = rawPrediction.First(); 250var first = rawPrediction.First();
Transformers\HashTests.cs (1)
400return buffer.DenseValues().First();
Transformers\ValueMappingTests.cs (1)
745uint s = t.First();
Transformers\WordTokenizeTests.cs (1)
69var nativeResult = ML.Data.CreateEnumerable<NativeResult>(result, false).First();
Microsoft.ML.TimeSeries (2)
SequentialTransformerBase.cs (2)
995$"expected type: '{originFn.GetType().GetGenericArguments().First()}'."); 1067$"expected type: '{getter.GetType().GetGenericArguments().First()}'.");
Microsoft.ML.Transforms (5)
OptionalColumnTransform.cs (1)
493$"expected type: '{originFn.GetType().GetGenericArguments().First()}'.");
ProduceIdTransform.cs (1)
223$"expected type: '{idGetter.GetType().GetGenericArguments().First()}'.");
StatefulCustomMappingTransformer.cs (1)
326$"expected type: '{originFn.GetType().GetGenericArguments().First()}'.");
SvmLight\SvmLightLoader.cs (1)
487$"expected type: '{_getter.GetType().GetGenericArguments().First()}'.");
Text\WordEmbeddingsExtractor.cs (1)
706var firstLine = File.ReadLines(_modelFileNameWithPath).First();
Microsoft.Net.Http.Headers.Tests (54)
CacheControlHeaderValueTest.cs (3)
50Assert.Equal("PLACEHOLDER", cacheControl.NoCacheHeaders.First()); 57Assert.Equal("PLACEHOLDER", cacheControl.PrivateHeaders.First()); 64Assert.Equal(new NameValueHeaderValue("name", "value"), cacheControl.Extensions.First());
ContentDispositionHeaderValueTest.cs (36)
79Assert.Equal("name", contentDisposition.Parameters.First().Name); 96Assert.Equal("NAME", contentDisposition.Parameters.First().Name); 101Assert.Equal("NAME", contentDisposition.Parameters.First().Name); 116Assert.Equal("FILENAME", contentDisposition.Parameters.First().Name); 121Assert.Equal("FILENAME", contentDisposition.Parameters.First().Name); 135Assert.Equal("filename", contentDisposition.Parameters.First().Name); 136Assert.Equal("\"=?utf-8?B?RmlsZcODTmFtZS5iYXQ=?=\"", contentDisposition.Parameters.First().Value); 138contentDisposition.Parameters.Remove(contentDisposition.Parameters.First()); 150Assert.Equal("filename", contentDisposition.Parameters.First().Name); 151Assert.Equal("\"=?utf-8?B?RmlsZQpOYW1lLmJhdA==?=\"", contentDisposition.Parameters.First().Value); 153contentDisposition.Parameters.Remove(contentDisposition.Parameters.First()); 166Assert.Equal("FILENAME", contentDisposition.Parameters.First().Name); 167Assert.Equal("\"=?utf-99?Q?R=mlsZcODTmFtZS5iYXQ=?=\"", contentDisposition.Parameters.First().Value); 173Assert.Equal("FILENAME", contentDisposition.Parameters.First().Name); 188Assert.Equal("FILENAME*", contentDisposition.Parameters.First().Name); 194Assert.Equal("FILENAME*", contentDisposition.Parameters.First().Name); 195Assert.Equal("UTF-8\'\'new_name", contentDisposition.Parameters.First().Value); 209Assert.Equal("filename*", contentDisposition.Parameters.First().Name); 210Assert.Equal("UTF-8\'\'File%C3%83Name.bat", contentDisposition.Parameters.First().Value); 212contentDisposition.Parameters.Remove(contentDisposition.Parameters.First()); 221Assert.Equal($"UTF-8\'\'a%C2%80b", contentDisposition.Parameters.First().Value); //%C2 added because the value in UTF-8 is encoded on 2 bytes. 229Assert.Equal($"UTF-8\'\'{new string('a', 400)}", contentDisposition.Parameters.First().Value); 253Assert.Equal($"UTF-8\'\'a%{hexC}b", contentDisposition.Parameters.First().Value); 257Assert.Equal($"UTF-8\'\'a{(char)b}b", contentDisposition.Parameters.First().Value); 259contentDisposition.Parameters.Remove(contentDisposition.Parameters.First()); 272Assert.Equal("FILENAME*", contentDisposition.Parameters.First().Name); 273Assert.Equal("utf-99'lang'File%CZName.bat", contentDisposition.Parameters.First().Value); 279Assert.Equal("FILENAME*", contentDisposition.Parameters.First().Name); 313Assert.Equal("Creation-DATE", contentDisposition.Parameters.First().Name); 321Assert.Equal("Creation-DATE", contentDisposition.Parameters.First().Name); 322Assert.Equal("\"Tue, 15 Nov 1994 08:12:32 GMT\"", contentDisposition.Parameters.First().Value); 339Assert.Equal("read-DATE", contentDisposition.Parameters.First().Name); 357Assert.Equal("SIZE", contentDisposition.Parameters.First().Name); 363Assert.Equal("SIZE", contentDisposition.Parameters.First().Name); 378Assert.Equal("SIZE", contentDisposition.Parameters.First().Name); 385Assert.Equal("SIZE", contentDisposition.Parameters.First().Name);
MediaTypeHeaderValueTest.cs (14)
162var pair0 = mediaType0.Parameters.First(); 163var pair1 = mediaType1.Parameters.First(); 188var pair0 = mediaType0.Parameters.First(); 189var pair1 = mediaType1.Parameters.First(); 211var pair2 = mediaType2.Parameters.First(); 212var pair1 = mediaType1.Parameters.First(); 237Assert.Equal("charset", mediaType.Parameters.First().Name); 254Assert.Equal("CHARSET", mediaType.Parameters.First().Name); 259Assert.Equal("CHARSET", mediaType.Parameters.First().Name); 272Assert.Equal("q", mediaType.Parameters.First().Name); 273Assert.Equal("0.563", mediaType.Parameters.First().Value); 289Assert.Equal("q", mediaType.Parameters.First().Name); 295Assert.Equal("q", mediaType.Parameters.First().Name); 309Assert.Equal("Q", mediaType.Parameters.First().Name);
RangeItemHeaderValueTest.cs (1)
136var range = ranges.First();
Microsoft.VisualStudio.LanguageServices (7)
Interop\CleanableWeakComHandleTable.cs (1)
123var key = _deadKeySet.First();
Preview\TopLevelChange.cs (2)
51var firstChild = Children.Changes.OfType<FileChange>().First(); 57var firstChild = Children.Changes.OfType<FileChange>().First();
ProjectSystem\VisualStudioWorkspaceImpl.OpenFileTracker.cs (2)
198return projectIds.First(); 254return projectIds.First();
ValueTracking\TreeViewItemBase.cs (1)
53return ChildItems.First();
Venus\ContainedLanguageCodeSupport.cs (1)
66var typeNode = type.DeclaringSyntaxReferences.Where(r => r.SyntaxTree == tree).Select(r => r.GetSyntax(cancellationToken)).First();
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (8)
DesignerAttribute\DesignerAttributeServiceTests.cs (1)
119var hostDocument = workspace.Documents.First();
F1Help\F1HelpTests.cs (5)
28var caret = workspace.Documents.First().CursorPosition; 31var actualText = await service.GetHelpTermAsync(workspace.CurrentSolution.Projects.First().Documents.First(), workspace.Documents.First().SelectedSpans.First(), CancellationToken.None);
PersistentStorage\AbstractPersistentStorageTests.cs (2)
118var project = solution.Projects.First(); 119var document = project.Documents.First();
Mvc.Api.Analyzers.Test (3)
ActualApiResponseMetadataFactoryTest.cs (3)
78var returnStatement = methodSyntax.DescendantNodes().OfType<ReturnStatementSyntax>().First(); 395var returnStatement = methodSyntax.DescendantNodes().OfType<ReturnStatementSyntax>().First(); 414var returnStatement = methodSyntax.DescendantNodes().OfType<ReturnStatementSyntax>().First();
Roslyn.VisualStudio.DiagnosticsWindow (1)
VenusMargin\ProjectionSpanTagger.cs (1)
71.Select(s => new TagSpan<TextMarkerTag>(new SnapshotSpan(spans.First().Snapshot, s), ProjectionSpanTag.Instance));
Roslyn.VisualStudio.Next.UnitTests (22)
Services\AssetProviderTests.cs (1)
127var project = workspace.CurrentSolution.Projects.First();
Services\PerformanceTrackerServiceTests.cs (1)
260return assembly.GetManifestResourceNames().Where(n => n.EndsWith(convert, StringComparison.OrdinalIgnoreCase)).First();
Services\ServiceHubServicesTests.cs (3)
85var oldDocument = solution.Projects.First().Documents.First(); 1677], [solution.ProjectIds.First()]);
Services\SolutionServiceTests.cs (10)
296await VerifySolutionUpdate(code, s => s.WithDocumentFolders(s.Projects.First().Documents.First().Id, ["test"])); 306var existingProjectId = s.ProjectIds.First(); 313var existingDocumentId = project.DocumentIds.First(); 331var projectId = workspace.CurrentSolution.ProjectIds.First(); 362var projectId = workspace.CurrentSolution.ProjectIds.First(); 395var projectId = workspace.CurrentSolution.ProjectIds.First(); 521var documentIdentity = (await solution.Projects.Single().GetSourceGeneratedDocumentsAsync()).First().Identity; 1040var document1 = project1.Documents.First(); 1165var document1 = project1.Documents.First();
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (7)
50var analyzerResult = await AnalyzeAsync(workspace, workspace.CurrentSolution.ProjectIds.First(), analyzerType, isHostAnalyzer); 58analyzerResult = await AnalyzeAsync(workspace, workspace.CurrentSolution.ProjectIds.First(), analyzerType, isHostAnalyzer); 81var analyzerResult = await AnalyzeAsync(workspace, workspace.CurrentSolution.ProjectIds.First(), analyzerType, isHostAnalyzer); 97analyzerResult = await AnalyzeAsync(workspace, workspace.CurrentSolution.ProjectIds.First(), analyzerType, isHostAnalyzer); 119var task = Task.Run(() => AnalyzeAsync(workspace, workspace.CurrentSolution.ProjectIds.First(), analyzerType, isHostAnalyzer: false, source.Token)); 158var project = workspace.CurrentSolution.Projects.First(); 196var project = workspace.CurrentSolution.Projects.First().AddAnalyzerReference(analyzerReference);
ServerComparison.FunctionalTests (1)
ResponseCompressionTests.cs (1)
208Assert.Equal("gzip", response.Content.Headers.ContentEncoding.First());
SocialSample (1)
Startup.cs (1)
303var currentAuthType = user.Identities.First().AuthenticationType;
Sockets.BindTests (7)
src\Servers\Kestrel\shared\test\TransportTestHelpers\IHostPortExtensions.cs (1)
19return host.GetPorts().First();
src\Servers\Kestrel\shared\test\TransportTestHelpers\IWebHostPortExtensions.cs (1)
15return host.GetPorts().First();
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (1)
84_listenOptions = options.GetListenOptions().First();
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (4)
251return context.Response.WriteAsync(serverAddresses.Addresses.First()); 635Assert.Equal(serverAddresses.First(), useUrlsAddressWithPort); 680Assert.Equal(serverAddresses.First(), endPointAddress); 720Assert.Equal(serverAddresses.First(), endPointAddress);
Sockets.FunctionalTests (4)
src\Servers\Kestrel\shared\test\TransportTestHelpers\IHostPortExtensions.cs (1)
19return host.GetPorts().First();
src\Servers\Kestrel\shared\test\TransportTestHelpers\IWebHostPortExtensions.cs (1)
15return host.GetPorts().First();
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (1)
84_listenOptions = options.GetListenOptions().First();
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (1)
462var measurement = connectionDuration.GetMeasurementSnapshot().First();
System.Collections.Immutable (2)
System\Linq\ImmutableArrayExtensions.cs (2)
343return Enumerable.Empty<T>().First(); 358: Enumerable.First(immutableArray.array!);
System.ComponentModel.Composition (1)
System\ComponentModel\Composition\Hosting\ImportEngine.cs (1)
703PartManager firstPart = _recursionStateStack.First();
System.Linq.Expressions (1)
System\Linq\Expressions\Compiler\LabelInfo.cs (1)
164LabelScopeInfo def = _definitions.First();
System.Linq.Parallel (1)
System\Linq\ParallelEnumerable.cs (1)
5411.First();
System.Windows.Forms.Analyzers.CodeFixes.CSharp (2)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (2)
46.First(); 118.First();
System.Windows.Forms.Primitives.TestUtilities (1)
Win32\WindowClass.cs (1)
79Marshal.GetHINSTANCE(Assembly.GetCallingAssembly().Modules.First());
System.Windows.Forms.PrivateSourceGenerators.Tests (1)
EnumValidationTests.cs (1)
311string output = outputCompilation.SyntaxTrees.Skip(2).First().ToString();
System.Windows.Forms.Tests (1)
System\Windows\Forms\LayoutEventArgsTests.cs (1)
74using (Panel panel = (Panel)tableLayoutPanel.Controls.Find("Panel", false).First())
Templates.Blazor.Tests (2)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
215certificate = certificates.First(); 257certificate = certificates.First();
Templates.Blazor.WebAssembly.Auth.Tests (2)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
215certificate = certificates.First(); 257certificate = certificates.First();
Templates.Blazor.WebAssembly.Tests (2)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
215certificate = certificates.First(); 257certificate = certificates.First();
Templates.Mvc.Tests (2)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
215certificate = certificates.First(); 257certificate = certificates.First();
Templates.Tests (2)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
215certificate = certificates.First(); 257certificate = certificates.First();
Wasm.Performance.Driver (1)
Program.cs (1)
332.First();
XmlFormattersWebSite (2)
Controllers\XmlDataContractApiController.cs (1)
27var xmlFormatter = mvcOptions.Value.OutputFormatters.OfType<XmlDataContractSerializerOutputFormatter>().First();
Controllers\XmlSerializedApiController.cs (1)
27var xmlFormatter = mvcOptions.Value.OutputFormatters.OfType<XmlSerializerOutputFormatter>().First();