1797 references to Count
AnalyzerRunner (2)
DiagnosticAnalyzerRunner.cs (1)
127double documentCount = documentPerformance.Where(x => x.Key.ProjectId == projectId).Count();
Program.cs (1)
214var numberOfTrivia = root.DescendantTrivia(descendIntoTrivia: true).Count();
Aspire.Dashboard (1)
Otlp\Model\OtlpHelpers.cs (1)
412var totalItemCount = results.Count();
Aspire.Dashboard.Components.Tests (1)
Controls\StructuredLogDetailsTests.cs (1)
69var duplicate = properties.GroupBy(p => p.Key).Where(g => g.Count() >= 2).FirstOrDefault();
Aspire.EndToEnd.Tests (1)
tests\Shared\WorkloadTesting\TemplateCustomHive.cs (1)
93if (packages.Count() > 1)
Aspire.Hosting (1)
DistributedApplicationBuilder.cs (1)
408.Where(g => g.Count() > 1)
Aspire.Hosting.Elasticsearch.Tests (2)
AddElasticsearchTests.cs (2)
30Assert.Equal(2, endpoints.Count()); 92Assert.Equal(2, endpoints.Count());
Aspire.Hosting.Kafka.Tests (1)
AddKafkaTests.cs (1)
29Assert.Equal(2, endpoints.Count());
Aspire.Hosting.MongoDB.Tests (1)
AddMongoDBTests.cs (1)
186Assert.Equal(2, builder.Resources.OfType<MongoExpressContainerResource>().Count());
Aspire.Hosting.MySql (1)
MySqlBuilderExtensions.cs (1)
125if (mySqlInstances.Count() == 1)
Aspire.Hosting.Nats.Tests (1)
AddNatsTests.cs (1)
179Assert.Equal(2, builder.Resources.OfType<NatsServerResource>().Count());
Aspire.Hosting.Qdrant.Tests (1)
AddQdrantTests.cs (1)
292Assert.Equal(2, qdrantResource.Annotations.OfType<EndpointAnnotation>().Count());
Aspire.Hosting.Tests (5)
ResourceExtensionsTests.cs (2)
123Assert.Equal(2, annotations.Count()); 141Assert.Equal(3, annotations.Count());
ResourceNotificationTests.cs (1)
378Assert.Equal(3, logs.Where(l => l.Level == LogLevel.Trace).Count());
Utils\WithAnnotationTests.cs (2)
20Assert.Equal(2, dummyAnnotations.Count()); 34Assert.Equal(2, dummyAnnotations.Count());
Aspire.Playground.Tests (1)
Infrastructure\DistributedApplicationExtensions.cs (1)
242logger.LogInformation("Found {DbContextCount} DbContext types in project '{ProjectName}'", dbContextTypes.Count(), projectName);
Aspire.Workload.Tests (1)
tests\Shared\WorkloadTesting\TemplateCustomHive.cs (1)
93if (packages.Count() > 1)
CodeGenerator (2)
src\Servers\Kestrel\shared\KnownHeaders.cs (2)
403var useVarForFirstTerm = values.Count > 1 && values.Select(h => h.FirstNameIgnoreCaseSegment()).Distinct().Count() == 1; 450return start + $@"{Each(groups, (byFirstTerm, i) => $@"{(byFirstTerm.Count() == 1 ? $@"{Each(byFirstTerm, header => $@"
Contract.Service.IntegrationTests (4)
ServiceContractTests.4.0.0.cs (4)
50Assert.True((number == message.Count<char>()), String.Format("The local int variable was not correctly set, expected {0} but got {1}", message.Count<char>(), number)); 143Assert.True((number == message.Count<char>()), 144String.Format("The value of the integer sent by reference was not the expected value. expected {0} but got {1}", message.Count<char>(), number));
csc (1)
src\Compilers\Core\CommandLine\BuildProtocol.cs (1)
595var hashAttributeCount = hashAttributes.Count();
CSharpSyntaxGenerator (2)
SourceWriter.cs (2)
946else if (relevantNodes.Count() == 1) 992else if (relevantNodes.Count() == 1)
dotnet-svcutil-lib (31)
Bootstrapper\SvcutilBootstrapper.cs (1)
49return targetFramework.IsDnx && references.Where(r => !r.IsFramework).Except(TargetFrameworkHelper.ServiceModelPackages).Count() > 0;
CommandProcessorOptions.cs (10)
132return options?.Errors.Count() == 0; 145if (cmdOptions.Errors.Count() == 0 && cmdOptions.Inputs.Count == 1) 148TryFromFile(fileUri.LocalPath, out var fileOptions) && fileOptions.GetOptions().Count() > 0) 164if (disallowedSwitchesOnParamsFilesProvided.Count() > 0) 200if (this.Help != true && this.Errors.Count() == 0) 502if (paramsFiles.Count() == 1) 506else if (paramsFiles.Count() == 0) 512if (paramsFiles.Count() > 1) 660if (invalidNamespaces.Count() > 0) 736await safeLogger.WriteMessageAsync($"resolved inputs: {inputFiles.Count()}", logToUI: false).ConfigureAwait(false);
Metadata\MetadataDocumentSaver.cs (1)
144if (missingRefs.Count() == 0)
Metadata\ServiceDescriptor.cs (1)
249if (binding.Extensions.OfType<WsdlNS.HttpBinding>().Count() != 0)
Shared\MSBuildProj.cs (13)
81if (refItems == null || refItems.Count() == 0) 104if (refItems == null || refItems.Count() == 0) 128if (refItems == null || refItems.Count() == 0) 190if (targetFrameworkElements.Count() > 0) 212if (targetFrameworksElements.Count() > 0) 246if (runtimeIdentifierElements.Count() > 0) 447if (createOnMissing && groups.Count() == 0) 601if (existingElements.Count() > 0) 658if (targetFrameworkElements.Count() > 0) 666if (targetFrameworksElements.Count() > 0) 777await safeLogger.WriteMessageAsync($"Resolved project reference count: {dependencies.Count()}", logToUI: false).ConfigureAwait(false); 974if (propertyTable.Count() != propertyNames.Count())
Shared\ProjectDependency.cs (2)
75if (!string.IsNullOrWhiteSpace(filePath) && Path.GetInvalidPathChars().Intersect(filePath).Count() > 0) 80if (!string.IsNullOrWhiteSpace(packageName) && Path.GetInvalidFileNameChars().Intersect(packageName).Count() > 0)
Shared\ProjectPropertyResolver.cs (1)
27using (var safeLogger = await SafeLogger.WriteStartOperationAsync(logger, $"Resolving {propertyNames.Count()} project properties ...").ConfigureAwait(false))
Tool.cs (2)
217var displayUri = serviceDescriptor.MetadataFiles.Count() == 1 ? serviceDescriptor.MetadataFiles.First().LocalPath : SR.WsdlOrSchemaFilesMsg; 322if (options.Errors.Count() > 0)
IdeCoreBenchmarks (2)
IncrementalSourceGeneratorBenchmarks.cs (1)
151Console.WriteLine("Syntax tree count: " + compilation.SyntaxTrees.Count());
NavigateToBenchmarks.cs (1)
86var docCount = _workspace.CurrentSolution.Projects.SelectMany(p => p.Documents).Count();
IIS.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (1)
537Assert.Equal(2, headerValues.Count());
IISExpress.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (1)
537Assert.Equal(2, headerValues.Count());
illink (2)
ILLink.RoslynAnalyzer (1)
src\tools\illink\src\ILLink.Shared\TrimAnalysis\ValueExtensions.cs (1)
54 if (values.Count () != 1)
InMemory.FunctionalTests (4)
ResponseTests.cs (4)
1295Assert.Equal(2, error.Count()); 2464Assert.Equal(2, LogMessages.Where(message => message.LogLevel == LogLevel.Error).Count()); 2524Assert.Equal(2, LogMessages.Where(message => message.LogLevel == LogLevel.Error).Count()); 2664Assert.Equal(2, LogMessages.Where(message => message.LogLevel == LogLevel.Error).Count());
Interop.FunctionalTests (2)
Http3\Http3RequestTests.cs (1)
1381Logger.LogInformation($"Client trailer count: {response.TrailingHeaders.Count()}");
HttpClientHttp2InteropTests.cs (1)
1117Assert.Equal(2, TestSink.Writes.Where(context => context.Message.Contains("sending CONTINUATION frame for stream ID 1 with length 15585 and flags NONE")).Count());
IOperationGenerator (1)
IOperationClassWriter.cs (1)
926return (type.OperationKind?.Entries?.Where(e => e.EditorBrowsable != false).Count() ?? 0) > 1;
LocalizationWebsite (1)
StartupGetAllStrings.cs (1)
40await context.Response.WriteAsync(strings.Count().ToString(CultureInfo.InvariantCulture));
Microsoft.Arcade.Test.Common (2)
AssertEx.cs (2)
245var result = expected.Count() == actual.Count() && expectedSet.SetEquals(actual);
Microsoft.AspNetCore (1)
WebApplication.cs (1)
280if (compositeEndpointDataSource.DataSources.Intersect(_webApplication.DataSources).Count() == _webApplication.DataSources.Count)
Microsoft.AspNetCore.App.Analyzers (5)
Mvc\DetectAmbiguousActionRoutes.cs (1)
38foreach (var ambiguousGroup in groupedByParent.Where(g => g.Count() >= 2))
RouteHandlers\AtMostOneFromBodyAttribute.cs (2)
33if (fromBodyMetadataInterfaceMembers.Count() >= 2) 41if (fromBodyMetadataInterfaceParameters.Count() >= 2)
RouteHandlers\DetectAmbiguousRoutes.cs (1)
34foreach (var ambiguousGroup in groupedByParent.Where(g => g.Count() >= 2))
WebApplicationBuilder\PublicPartialProgramClassAnalyzer.cs (1)
43&& parentNode.DescendantNodes().Count() > 1;
Microsoft.AspNetCore.Authentication (2)
TicketSerializer.cs (2)
63writer.Write(principal.Identities.Count()); 90writer.Write(identity.Claims.Count());
Microsoft.AspNetCore.Authentication.Core.Test (4)
TokenExtensionTests.cs (4)
28Assert.Equal(3, props.GetTokens().Count()); 75Assert.Equal(3, props.GetTokens().Count()); 98Assert.Equal(3, props.GetTokens().Count()); 119Assert.Equal(3, props.GetTokens().Count());
Microsoft.AspNetCore.Authentication.Test (9)
ClaimActionTests.cs (2)
102Assert.Equal(2, identity.FindAll("name0").Count()); 103Assert.Equal(2, identity.FindAll("name1").Count());
JwtBearerTests_Handler.cs (1)
1049Assert.Equal(2, jwtBearerOptions.TokenValidationParameters.IssuerSigningKeys.Count());
OpenIdConnect\TestSettings.cs (2)
55if (forms.Count() != 1) 93if (forms.Count() != 1)
TokenExtensionTests.cs (4)
24Assert.Equal(3, props.GetTokens().Count()); 71Assert.Equal(3, props.GetTokens().Count()); 94Assert.Equal(3, props.GetTokens().Count()); 115Assert.Equal(3, props.GetTokens().Count());
Microsoft.AspNetCore.Authorization.Test (12)
AuthorizationPolicyFacts.cs (10)
37Assert.Equal(2, combined.AuthenticationSchemes.Count()); 40Assert.Equal(4, combined.Requirements.Count()); 42Assert.Equal(2, combined.Requirements.OfType<ClaimsAuthorizationRequirement>().Count()); 87Assert.Equal(2, combined.AuthenticationSchemes.Count()); 90Assert.Equal(2, combined.Requirements.Count()); 92Assert.Equal(2, combined.Requirements.OfType<ClaimsAuthorizationRequirement>().Count()); 111Assert.Equal(2, rolesAuthorizationRequirement.AllowedRoles.Count()); 131Assert.Equal(2, combined.AuthenticationSchemes.Count()); 151Assert.Equal(2, combined.AuthenticationSchemes.Count()); 172Assert.Equal(2, rolesAuthorizationRequirement.AllowedRoles.Count());
DefaultAuthorizationServiceTests.cs (1)
190Assert.Equal(2, allowed.Failure.FailureReasons.Count());
PolicyEvaluatorTests.cs (1)
45Assert.Equal(3, result.Principal.Identities.Count());
Microsoft.AspNetCore.BrowserTesting (1)
BrowserManagerConfiguration.cs (1)
244else if (arg.GetChildren().Count() > 1)
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Verifiers\DiagnosticVerifier.cs (1)
109int actualCount = actualResults.Count();
Microsoft.AspNetCore.Components.Endpoints.Tests (2)
RazorComponentsServiceCollectionExtensionsTest.cs (2)
106var actual = serviceDescriptors.Count(); 133else if (implementationTypes.Length != implementationTypes.Distinct().Count())
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Verifiers\DiagnosticVerifier.cs (1)
109int actualCount = actualResults.Count();
Microsoft.AspNetCore.Components.Tests (5)
CascadingParameterTest.cs (3)
797Assert.Equal(2, services.Count()); 812Assert.Equal(2, services.Count()); 827Assert.Equal(2, services.Count());
StackObjectPoolTest.cs (2)
74Assert.Equal(3, new[] { instance1, instance2, instance3 }.Distinct().Count()); 86Assert.Equal(4, new[] { instance1, instance2, instance3, instance2b }.Distinct().Count());
Microsoft.AspNetCore.Cors.Test (1)
CorsMiddlewareTests.cs (1)
99Assert.Equal(2, response.Headers.Count());
Microsoft.AspNetCore.Http.Extensions.Tests (2)
ProblemDetailsServiceCollectionExtensionsTest.cs (2)
64(expectedCount == serviceDescriptors.Count()), 66$" time(s) but was actually registered {serviceDescriptors.Count()} time(s).");
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
StaticRouteHandlerModel\EndpointParameter.cs (1)
470var numOfConstructors = constructors.Count();
Microsoft.AspNetCore.Http.Tests (5)
DefaultHttpContextTests.cs (5)
42Assert.Equal(3, context.Session.Keys.Count()); 161Assert.Equal(4, features.Count()); 165Assert.NotEqual(4, features.Count()); 181Assert.Equal(4, newFeatures.Count()); 185Assert.NotEqual(4, newFeatures.Count());
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
UserStoreWithGenericsTest.cs (1)
111Assert.Equal(3, userClaims.Intersect(claims, ClaimEqualityComparer.Default).Count());
Microsoft.AspNetCore.Identity.Specification.Tests (5)
IdentitySpecificationTestBase.cs (1)
190Assert.Equal(2, result.Errors.Count());
UserManagerSpecificationTests.cs (4)
395Assert.Equal(2, result.Errors.Count()); 1755Assert.Equal(numCodes, newCodes.Count()); 1783Assert.Equal(numCodes, newCodes.Count()); 1785Assert.Equal(numCodes, realCodes.Count());
Microsoft.AspNetCore.Identity.Test (1)
IdentityBuilderTest.cs (1)
247Assert.Equal(4, tokenProviders.Count());
Microsoft.AspNetCore.Mvc.Core.Test (30)
ApplicationModels\AuthorizationApplicationModelProviderTest.cs (1)
99Assert.Equal(3, authorizeFilters.First().Policy.Requirements.Count()); // Basic + Basic2 + Derived authorize
ApplicationModels\ControllerActionDescriptorProviderTests.cs (21)
259Assert.Equal(2, descriptors.Count()); 454Assert.Equal(4, actions.Count()); 479Assert.Equal(2, actions.Count()); 531Assert.Equal(4, actions.Count()); 542Assert.Equal(4, constrainedActions.Count()); 547Assert.Equal(2, putActions.Count()); 554Assert.Equal(2, routeActions.Count()); 570Assert.Equal(6, actions.Count()); 581Assert.Equal(4, constrainedActions.Count()); 586Assert.Equal(2, postActions.Count()); 593Assert.Equal(2, putActions.Count()); 599Assert.Equal(2, unconstrainedActions.Count()); 640Assert.Equal(5, actions.Count()); 812Assert.Equal(2, getActions.Count()); 840Assert.Equal(2, getActions.Count()); 899Assert.Equal(4, actionDescriptors.Count()); 968Assert.Equal(2, actions.Count()); 1048Assert.Equal(2, actions.Count()); 1188Assert.Equal(2, actions.Count()); 1214Assert.Equal(2, actions.Count()); 1241Assert.Equal(4, actions.Count());
DependencyInjection\MvcCoreServiceCollectionExtensionsTest.cs (1)
344var actual = serviceDescriptors.Count();
ModelBinding\Binders\SimpleTypeModelBinderTest.cs (2)
193Assert.Equal(3, sink.Writes.Count()); 283Assert.Equal(2, sink.Writes.Count());
ModelBinding\Binders\TryParseTypeModelBinderTest.cs (2)
142Assert.Equal(3, sink.Writes.Count()); 210Assert.Equal(2, sink.Writes.Count());
ModelBinding\Metadata\DefaultModelMetadataTest.cs (2)
567Assert.Equal(expectedNames.Count(), properties.Count); 679Assert.Equal(expectedNames.Count(), properties.Count);
ModelBinding\ParameterBinderTest.cs (1)
221Assert.Equal(4, sink.Writes.Count());
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (1)
DelegatingEnumerableTest.cs (1)
44Assert.Equal(errors.Length, delegatingEnumerable.Count());
Microsoft.AspNetCore.Mvc.FunctionalTests (2)
AsyncEnumerableTestBase.cs (1)
90Assert.Equal(10, projects.Count());
XmlDataContractSerializerInputFormatterTest.cs (1)
105Assert.Equal(expectedErrorMessages.Count(), modelBindingInfo.ModelStateErrorMessages.Count);
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
BodyValidationIntegrationTests.cs (1)
89Assert.Equal(2, products.Count());
Microsoft.AspNetCore.Mvc.Razor (1)
ApplicationParts\RazorCompiledItemFeatureProvider.cs (1)
24.FirstOrDefault(g => g.Count() > 1);
Microsoft.AspNetCore.Mvc.Test (1)
MvcServiceCollectionExtensionsTest.cs (1)
620var actual = serviceDescriptors.Count();
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
ViewComponents\DefaultViewComponentSelector.cs (1)
81var count = matches.Count();
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (3)
Rendering\HtmlHelperSelectTest.cs (3)
1556Assert.Equal(expected.Count(), actual.Count()); 1557for (var i = 0; i < actual.Count(); i++)
Microsoft.AspNetCore.OpenApi (2)
Extensions\ApiDescriptionExtensions.cs (1)
109if (bodyParameters.Count() == 1)
Services\OpenApiDocumentService.cs (1)
514var hasMultipleFormParameters = groupedFormParameters.Count() > 1;
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiDocumentProviderTests.cs (1)
44Assert.Equal(4, documentNames.Count());
Microsoft.AspNetCore.Razor.Test (1)
TagHelpers\TagHelperAttributeListTest.cs (1)
365var attributeDestination = new TagHelperAttribute[expectedAttributes.Count()];
Microsoft.AspNetCore.Routing (6)
Matching\ILEmitTrieFactory.cs (6)
131groups.Sort(static (a, b) => b.Count().CompareTo(a.Count())); 351groups.Sort(static (a, b) => b.Count().CompareTo(a.Count())); 476groups.Sort(static (a, b) => b.Count().CompareTo(a.Count()));
Microsoft.AspNetCore.Routing.Tests (4)
RouteConstraintBuilderTest.cs (1)
143Assert.Equal(2, compositeConstraint.Constraints.Count());
RouteTest.cs (1)
324Assert.Equal(2, compositeConstraint.Constraints.Count<IRouteConstraint>());
Template\TemplateParserTests.cs (2)
885if (x.InlineConstraints.Count() != y.InlineConstraints.Count())
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (15)
AuthenticationTests.cs (3)
260Assert.Equal(authTypeList.Count(), response.Headers.WwwAuthenticate.Count); 283Assert.Equal(authTypeList.Count(), response.Headers.WwwAuthenticate.Count); 327Assert.Equal(authTypeList.Count(), response.Headers.WwwAuthenticate.Count);
Listener\ResponseHeaderTests.cs (7)
40Assert.Equal(2, response.Headers.Count()); 62Assert.Equal(3, response.Headers.Count()); 85Assert.Equal(2, response.Headers.Count()); 113Assert.Equal(3, response.Headers.Count()); 143Assert.Equal(2, response.Headers.Count()); 172Assert.Equal(2, response.Headers.Count()); 195Assert.Equal(2, response.Headers.Count());
ResponseHeaderTests.cs (5)
31Assert.Equal(2, response.Headers.Count()); 235Assert.Equal(5, response.Headers.Count()); // Date, Server, Chunked 237Assert.Equal(2, response.Headers.GetValues("Custom1").Count()); 265Assert.Equal(5, response.Headers.Count()); // Date, Server, Chunked 267Assert.Equal(2, response.Headers.GetValues("Custom1").Count());
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (13)
HttpParserTests.cs (3)
836Assert.True(expectedHeaderNames.Count() == expectedHeaderValues.Count(), $"{nameof(expectedHeaderNames)} and {nameof(expectedHeaderValues)} sizes must match"); 847Assert.Equal(expectedHeaderNames.Count(), parsedHeaders.Length);
HttpRequestHeadersTests.cs (2)
841Assert.Equal(2, headers.Count()); // NB: enumerable count, not property 843Assert.Equal(3, headers.Count()); // NB: enumerable count, not property
HttpResponseHeadersTests.cs (2)
407Assert.Equal(2, headers.Count()); // NB: enumerable count, not property 409Assert.Equal(3, headers.Count()); // NB: enumerable count, not property
KestrelServerTests.cs (4)
174Assert.Equal(2, infos.Count()); // ipv4 and ipv6 182Assert.Equal(2, warnings.Count()); // ipv4 and ipv6 191Assert.Equal(2, warnings.Count()); // ipv4 and ipv6 192Assert.Equal(2, infos.Count()); // ipv4 and ipv6
src\Servers\Kestrel\shared\KnownHeaders.cs (2)
403var useVarForFirstTerm = values.Count > 1 && values.Select(h => h.FirstNameIgnoreCaseSegment()).Distinct().Count() == 1; 450return start + $@"{Each(groups, (byFirstTerm, i) => $@"{(byFirstTerm.Count() == 1 ? $@"{Each(byFirstTerm, header => $@"
Microsoft.AspNetCore.Shared.Tests (4)
CommandLineApplicationTests.cs (1)
808Assert.Equal(2, app.GetOptions().Count());
SecurityHelperTests.cs (3)
44Assert.Equal(3, user.Identities.Count()); 74Assert.Equal(4, user.Identities.Count()); 86Assert.Equal(4, user.Identities.Count());
Microsoft.AspNetCore.SignalR.Tests (2)
HubReflectionHelperTests.cs (2)
26Assert.Equal(3, hubMethods.Count()); 38Assert.Equal(4, hubMethods.Count());
Microsoft.Build (4)
BackEnd\BuildManager\CacheSerialization.cs (1)
71if (configCacheToSerialize.Count() > 1)
BackEnd\Components\SdkResolution\SdkResult.cs (1)
61if (paths.Count() > 1)
Evaluation\Expander.cs (1)
2337yield return new KeyValuePair<string, S>(Convert.ToString(itemsOfType.Count(), CultureInfo.InvariantCulture), null /* no base item */);
Logging\BinaryLogger\BuildEventArgsWriter.cs (1)
1098int length = items.Count();
Microsoft.Build.BuildCheck.UnitTests (3)
ConfigurationProvider_Tests.cs (1)
92configs!.Keys.Count().ShouldBe(3);
EditorConfig_Tests.cs (2)
695var result = expected.Count() == actual.Count() && expectedSet.SetEquals(actual);
Microsoft.Build.Engine.OM.UnitTests (6)
Construction\ProjectRootElement_Tests.cs (3)
1864var childrenCount = projectElement.AllChildren.Count(); 1881Assert.NotEqual(childrenCount, projectElement.AllChildren.Count()); 1885Assert.Equal(childrenCount, projectElement.AllChildren.Count());
Definition\ProjectItem_Tests.cs (3)
2228Assert.Equal(2, project.Xml.AllChildren.OfType<ProjectItemElement>().Count()); 2288Assert.Equal(2, project.Xml.AllChildren.OfType<ProjectItemElement>().Count()); 2657items.Count().ShouldBe(3);
Microsoft.Build.Engine.UnitTests (31)
AssemblyNameEx_Tests.cs (2)
705assemblyNameOriginal.RemappedFromEnumerator.Count().ShouldBe(1); 720assemblyNameDeserialized.RemappedFromEnumerator.Count().ShouldBe(1);
BackEnd\BuildManager_Tests.cs (6)
210.Count() 213.Count() 217.Count() 220.Count() 3530Assert.Equal(3, resultsFiles.Count()); 3967Assert.True(_logger.AllBuildEvents.OfType<ProjectEvaluationStartedEventArgs>().GroupBy(args => args.BuildEventContext.EvaluationId).All(g => g.Count() == 1));
BackEnd\Lookup_Tests.cs (4)
178Assert.Equal(2, group.Where(item => item.EvaluatedInclude == "a1").Count()); 190Assert.Equal(2, group.Where(item => item.EvaluatedInclude == "a1").Count()); 230Assert.Equal(4, group.Where(item => item.EvaluatedInclude == "a1").Count()); 243Assert.Equal(4, group.Where(item => item.EvaluatedInclude == "a1").Count());
Construction\SolutionProjectGenerator_Tests.cs (1)
2873Assert.Equal(count, itemGroup.Count());
EscapingInProjects_Tests.cs (2)
882Assert.Equal(3, items.Count()); 914Assert.Equal(4, items.Count());
Evaluation\Evaluator_Tests.cs (8)
1930Assert.Equal(allEvaluatedPropertiesWithNoBackingXmlAndNoDuplicates.Count, nonImportedProperties.Count()); 1951Assert.Equal(4, restOfAllEvaluatedProperties.Count()); 1962Assert.Equal(4, restOfAllEvaluatedProperties.Count()); 2094Assert.Equal(allEvaluatedPropertiesWithNoBackingXmlAndNoDuplicates.Count, nonImportedProperties.Count()); 2115Assert.Equal(3, restOfAllEvaluatedProperties.Count()); 2226Assert.Equal(nonImportedProperties.Count(), allProjectPropertiesNoDuplicateNames.Count); 4728.Count() 4796.Count()
Globbing\CompositeGlob_Tests.cs (1)
170Assert.Equal(2, composite.Globs.Count());
Graph\GraphLoadedFromSolution_tests.cs (1)
690graph.ProjectNodes.Count.ShouldBe(graph.ProjectNodes.Select(GetProjectPath).Distinct().Count());
Graph\IsolateProjects_Tests.cs (5)
238logger.AllBuildEvents.OfType<ProjectStartedEventArgs>().Count().ShouldBe(3); 260logger.AllBuildEvents.OfType<ProjectStartedEventArgs>().Count().ShouldBe(3); 355rootLogger.AllBuildEvents.OfType<ProjectStartedEventArgs>().Count().ShouldBe(2); 356declaredReferenceLogger.AllBuildEvents.OfType<ProjectStartedEventArgs>().Count().ShouldBe(2); 387logger.AllBuildEvents.OfType<ProjectStartedEventArgs>().Count().ShouldBe(2);
Graph\ProjectGraph_Tests.cs (1)
2233GetNodesWithProjectNumber(graph, 2).Count().ShouldBe(2);
Microsoft.Build.Framework (3)
BuildSubmissionStartedEventArgs.cs (2)
64writer.Write(EntryProjectsFullPath.Count()); 70writer.Write(TargetNames.Count());
ProjectStartedEventArgs.cs (1)
388var propertyCount = validProperties.Count();
Microsoft.Build.Tasks.CodeAnalysis (1)
src\Compilers\Core\CommandLine\BuildProtocol.cs (1)
595var hashAttributeCount = hashAttributes.Count();
Microsoft.Build.Tasks.UnitTests (4)
AssemblyNameEx_Tests.cs (2)
705assemblyNameOriginal.RemappedFromEnumerator.Count().ShouldBe(1); 720assemblyNameDeserialized.RemappedFromEnumerator.Count().ShouldBe(1);
Hash_Tests.cs (1)
98.Where(g => g.Count() > 1)
RoslynCodeTaskFactory_Tests.cs (1)
763logLines.Where(l => l.Contains(dotnetPath)).Count().ShouldBe(1, log);
Microsoft.Build.UnitTests.Shared (2)
ObjectModelHelpers.cs (2)
1311a.Count().ShouldBe(b.Count());
Microsoft.Build.Utilities.UnitTests (2)
ToolLocationHelper_Tests.cs (2)
4012myPlatforms.Count().ShouldBe(3); 4093ToolLocationHelper.GetFoldersInVSInstalls(null, null, "relativePath").Count().ShouldBe(0);
Microsoft.Cci.Extensions (5)
Experimental\APIEmitter.cs (1)
38if (types.Count() > 0)
Extensions\MemberExtensions.cs (2)
133if (attribute.Arguments == null || attribute.Arguments.Count() != 1) 159if (attribute.Arguments == null || attribute.Arguments.Count() != 2)
Writers\CSharp\CSDeclarationWriter.cs (1)
330genericArgumentsCount = genericType.GenericArguments.Count();
Writers\CSharp\CSharpWriter.cs (1)
269if (excludedFields.Count() == 1)
Microsoft.CodeAnalysis (8)
Emit\CommonPEModuleBuilder.cs (2)
812NestedTypes.Select(t => t.Name).Distinct().Count() == NestedTypes.Count());
Emit\EditAndContinue\DeltaMetadataWriter.cs (1)
1326Debug.Assert(debugTokens.Distinct().Count() == debugTokens.Count);
InternalUtilities\EnumerableExtensions.cs (2)
736var count = data.First().Count(); 737Debug.Assert(data.All(d => d.Count() == count));
Operations\ControlFlowGraphBuilder.cs (1)
8091return set.Count == properties.Count();
PEWriter\MetadataWriter.PortablePdb.cs (1)
891WriteValue(CompilationOptionNames.SourceFileCount, module.CommonCompilation.SyntaxTrees.Count().ToString());
SourceGeneration\GeneratorDriver.cs (1)
33Debug.Assert(state.Generators.GroupBy(s => s.GetGeneratorType()).Count() == state.Generators.Length); // ensure we don't have duplicate generator types
Microsoft.CodeAnalysis.CodeStyle (5)
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (1)
217properties = properties.AddRange(tagIndices.Select(kvp => new KeyValuePair<string, string?>(kvp.Key, EncodeIndices(kvp.Value, additionalLocations.Count()))));
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (2)
736var count = data.First().Count(); 737Debug.Assert(data.All(d => d.Count() == count));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (1)
183=> $"Interval tree with '{System.Linq.Enumerable.Count(this)}' entries. Use '.ToList()' to visualize contents.";
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
402if (words.Count() == 1) // Only Split if words have not been split before
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
67if (declarationDeclarators.Count == fieldDeclarators.Count())
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
925return referencedSymbols.Count() == 1 &&
Microsoft.CodeAnalysis.CSharp (1)
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
831Debug.Assert(result.Result.BadArgumentsOpt.TrueBits().Count() == 1);
Microsoft.CodeAnalysis.CSharp.CodeStyle (4)
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
113if (parent.DescendantNodes().OfType<StatementSyntax>().Count() <= 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaListExtensions.cs (1)
72return new SyntaxTriviaList(triviaList.Skip(triviaInLeadingBlankLines.Count()));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
278Debug.Assert(originalIdentifierNodes.Count() == replacedIdentifierNodes.Count());
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
404return allNamespaces.Take(2).Count() == 1;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\QueryExpressionSyntaxExtensions.cs (1)
44var clauses = SyntaxFactory.List(allClauses.Take(allClauses.Count() - 1).Cast<QueryClauseSyntax>());
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (14)
CommandLineTests.cs (14)
757Assert.Equal(1, errors.Count()); 769Assert.Equal(1, errors.Count()); 780Assert.Equal(1, errors.Count()); 791Assert.Equal(1, errors.Count()); 802Assert.Equal(1, errors.Count()); 813Assert.Equal(1, errors.Count()); 882Assert.Equal(1, errors.Count()); 1902Assert.Equal(0, parsedArgs.ParseOptions.PreprocessorSymbolNames.Count()); 1906Assert.Equal(1, parsedArgs.ParseOptions.PreprocessorSymbolNames.Count()); 1911Assert.Equal(3, parsedArgs.ParseOptions.PreprocessorSymbolNames.Count()); 1918Assert.Equal(1, parsedArgs.ParseOptions.PreprocessorSymbolNames.Count()); 4499Assert.Equal(1, Directory.EnumerateFiles(dir.Path, exeName).Count()); 7087Assert.Equal(1, Directory.EnumerateFiles(dir.Path, "*" + PathUtilities.GetExtension(expectedOutputName)).Count()); 7088Assert.Equal(1, Directory.EnumerateFiles(dir.Path, expectedOutputName).Count());
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (35)
CommentSelection\CSharpCommentSelectionTests.cs (1)
149if (spans.Count() == 1)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
209Assert.Equal(1, diagnosticsFromAnalyzer.Count());
Interactive\NavigateTo\InteractiveNavigateToTests.cs (3)
178Assert.Equal(0, items.Count()); 644Assert.Equal(expecteditems.Count(), items.Count());
NavigateTo\NavigateToTests.cs (3)
262Assert.Equal(0, items.Count()); 1033Assert.Equal(expecteditems.Count(), items.Count());
Workspaces\WorkspaceTests_EditorFeatures.cs (27)
87Assert.Equal(0, solution.Projects.Count()); 94Assert.Equal(1, solution.Projects.Count()); 109Assert.Equal(0, solution.Projects.Count()); 125Assert.Equal(0, solution.Projects.Count()); 328Assert.Equal(0, snapshot.GetProject(id1).ProjectReferences.Count()); 766Assert.Equal(2, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 787Assert.Equal(0, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1055Assert.Equal(1, project.Documents.Count()); 1056Assert.Equal(1, project.AdditionalDocuments.Count()); 1079Assert.Equal(1, project.Documents.Count()); 1080Assert.Equal(1, project.AnalyzerConfigDocuments.Count()); 1243Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1244Assert.Equal(2, workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Count()); 1253Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1254Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Count()); 1279Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1280Assert.Equal(2, workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Count()); 1289Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1290Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Count()); 1312Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1313Assert.Equal(2, workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Count()); 1319Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1320Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Count()); 1340Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1341Assert.Equal(2, workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Count()); 1347Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).Documents.Count()); 1348Assert.Equal(1, workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Count());
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (9)
BreakingChanges.cs (2)
67Assert.Equal(0, comp.GetDiagnostics().Count()); 202Assert.Equal(8, tree.GetDiagnostics().Count());
CodeGen\CodeGenAsyncLocalsTests.cs (1)
967Assert.Equal(1, spillFieldsByType.Count());
CodeGen\CodeGenAwaitForeachTests.cs (1)
4242Assert.Equal(0, ctrlFlowAnalysis.ExitPoints.Count());
CodeGen\CodeGenDeconstructTests.cs (1)
6440Assert.Equal(2, refs.Count());
CodeGen\CodeGenOverridingAndHiding.cs (1)
3169Assert.Equal(0, comp2.GetDiagnostics().Count());
CodeGen\CodeGenTupleTest.cs (3)
20360Assert.Equal(2, model.GetDeclaredSymbol(c1).AllInterfaces.Count()); 20365Assert.Equal(1, model.GetDeclaredSymbol(c2).AllInterfaces.Count()); 20369Assert.Equal(1, model.GetDeclaredSymbol(c3).AllInterfaces.Count());
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Emit\NumericIntPtrTests.cs (1)
10687Assert.Equal(4, methods.Count());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (213)
Attributes\AttributeTests.cs (4)
3125Assert.Equal(2, syntax.ArgumentList.Arguments.Count()); 3127Assert.Equal(0, syntax.ArgumentList.Arguments.Count()); 7538Assert.Equal(3, attrArgSyntaxes.Count()); 8855Assert.Equal(0, type.GetAttributes()[0].ConstructorArguments.Count());
Attributes\AttributeTests_Assembly.cs (1)
1025Assert.Equal(expectedSrcAttrCount, sourceAttributes.Count());
Attributes\AttributeTests_Security.cs (1)
55Assert.Equal(1, typeSecurityAttributes.Count());
Attributes\AttributeTests_WellKnownAttributes.cs (1)
2810Assert.Equal(0, metadataReader.FieldDefinitions.AsEnumerable().Count());
Diagnostics\DiagnosticAnalyzerTests.cs (1)
1723for (int i = 0; i < compilation.SyntaxTrees.Count(); i++)
FlowAnalysis\FlowDiagnosticTests.cs (11)
119Assert.Equal(0, errs.Count()); 134Assert.Equal(1, errs.Count()); 232Assert.Equal(0, this.FlowDiagnostics(comp).Count()); 256Assert.Equal(0, this.FlowDiagnostics(comp).Count()); 272Assert.Equal(0, this.FlowDiagnostics(comp).Count()); 290Assert.Equal(0, this.FlowDiagnostics(comp).Count()); 305Assert.Equal(2, this.FlowDiagnostics(comp).Count()); 325Assert.Equal(1, this.FlowDiagnostics(comp).Count()); 432Assert.Equal(0, this.FlowDiagnostics(comp).Count()); 455Assert.Equal(0, this.FlowDiagnostics(comp).Count()); 479Assert.Equal(0, this.FlowDiagnostics(comp).Count());
FlowAnalysis\IterationJumpYieldStatementTests.cs (88)
42Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 43Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()); 44Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 76Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 77Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()); 78Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 106Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 107Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 108Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 136Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 137Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 138Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 166Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 167Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 168Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 195Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 196Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 197Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 225Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 226Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 227Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 254Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 255Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 256Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 300Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 301Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 302Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 329Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 330Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 331Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 358Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 359Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 360Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 387Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 388Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 389Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 416Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 417Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 418Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 445Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 446Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 447Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 471Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 472Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 473Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 490Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 491Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 492Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 509Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 510Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 511Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 528Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 529Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 530Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 547Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 548Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 549Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 569Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 570Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 571Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 688Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 689Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 690Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 722Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 723Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 724Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 884Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 885Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()); 916Assert.Equal(2, flow.VariablesDeclared.Count()); 938Assert.Equal(1, analysis.ExitPoints.Count()); 955Assert.Equal(1, analysis.ExitPoints.Count()); 975Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 976Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()); 1003Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 1004Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()); 1031Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 1032Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()); 1059Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 1060Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()); 1103Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()); 1168Assert.Equal(bkcount[idx], ctrlFlow.ExitPoints.Count()); 1233Assert.Equal(2, ctrlFlow.ExitPoints.Count()); 1237Assert.Equal(2, ctrlFlow.ExitPoints.Count()); 1241Assert.Equal(1, ctrlFlow.ExitPoints.Count()); 1323Assert.Equal(2, ctrlFlow.ExitPoints.Count()); 1327Assert.Equal(1, ctrlFlow.ExitPoints.Count()); 1331Assert.Equal(2, ctrlFlow.ExitPoints.Count()); 1335Assert.Equal(1, ctrlFlow.ExitPoints.Count());
FlowAnalysis\RegionAnalysisTests.cs (72)
2874Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 2875Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 2876Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 2907Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 2908Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 2909Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 3007Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 3008Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 3009Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 3036Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 3037Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 3038Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 3069Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 3070Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 3071Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 3163Assert.Equal(1, analysis.EntryPoints.Count()); 3183Assert.Equal(2, analysis.ExitPoints.Count()); 3231Assert.Equal(1, analysis.ExitPoints.Count()); 3821Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 3822Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 3823Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 3853Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 3854Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 3855Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 3885Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 3886Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 3887Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 3917Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 3918Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 3919Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 3982Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 3983Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 3984Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 4015Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 4016Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 4017Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 4068Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 4069Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()); 4095Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 4096Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()); 4204Assert.Equal(2, controlFlowAnalysisResults.ExitPoints.Count()); 4273Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()); 4296Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 4297Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 4298Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 4889Assert.Equal(2, analysis.ExitPoints.Count()); 4912Assert.Equal(1, analysis.ExitPoints.Count()); 4961Assert.Equal(1, analysis.ExitPoints.Count()); 4983Assert.Equal(1, analysis.ExitPoints.Count()); 5079Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 5080Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()); 5494Assert.Equal(4, flowAnalysis.ReadInside.Count()); 5495Assert.Equal(5, flowAnalysis.WrittenInside.Count()); 5496Assert.Equal(5, flowAnalysis.VariablesDeclared.Count()); 5499Assert.Equal(2, flowAnalysis.ReadInside.Count()); 5500Assert.Equal(2, flowAnalysis.WrittenInside.Count()); 5501Assert.Equal(0, flowAnalysis.VariablesDeclared.Count()); 5504Assert.Equal(2, flowAnalysis.ReadInside.Count()); 5505Assert.Equal(2, flowAnalysis.WrittenInside.Count()); 5506Assert.Equal(1, flowAnalysis.VariablesDeclared.Count()); 7421Assert.Equal(0, analysis.EntryPoints.Count()); 7443Assert.Equal(0, analysis.EntryPoints.Count()); 8945Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 8946Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 8971Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 8972Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()); 8996Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 8997Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()); 9041Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 9042Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 9090Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 9091Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count());
FlowAnalysis\TryLockUsingStatementTests.cs (28)
86Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 87Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()); 142Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 143Assert.Equal(3, controlFlowAnalysisResults.ExitPoints.Count()); 144Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 200Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 201Assert.Equal(5, controlFlowAnalysisResults.ExitPoints.Count()); 258Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 259Assert.Equal(2, controlFlowAnalysisResults.ExitPoints.Count()); 260Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 296Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 297Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 298Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 341Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 342Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 343Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 402Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 403Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 404Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 447Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()); 448Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()); 449Assert.Equal(0, controlFlowAnalysisResults.ReturnStatements.Count()); 1515Assert.Equal(0, analysisControlFlow.ReturnStatements.Count()); 1701Assert.Equal(1, analysisControlFlow.ExitPoints.Count()); 1702Assert.Equal(0, analysisControlFlow.EntryPoints.Count()); 1740Assert.Equal(0, analysisControlFlow.ExitPoints.Count()); 1741Assert.Equal(0, analysisControlFlow.EntryPoints.Count()); 1742Assert.Equal(0, analysisControlFlow.ReturnStatements.Count());
Semantics\OutVarTests.cs (3)
20658Assert.Equal(1, compilation.SyntaxTrees[0].GetRoot().DescendantNodesAndSelf().OfType<DeclarationExpressionSyntax>().Count()); 32743Assert.True(symbols.Count() > 1); 32772Assert.True(symbols.Count() > 1);
Semantics\PatternMatchingTestBase.cs (2)
255Assert.True(symbols.Count() > 1); 308Assert.True(symbols.Count() > 1);
Semantics\PatternMatchingTests_Scope.cs (1)
11552Assert.Equal(2, yRefs.Count());
Microsoft.CodeAnalysis.CSharp.Features (9)
ChangeSignature\CSharpChangeSignatureService.cs (1)
798if (paramNodes.Count() != declaredParameters.Length)
Completion\CompletionProviders\CrefCompletionProvider.cs (1)
243var groupCount = group.Count();
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (1)
290statement.SpanStart, cancellationToken), memberDeclarationSymbol)).Count();
ConvertLinq\ConvertForEachToLinqQuery\DefaultConverter.cs (1)
49var identifiersCount = identifiers.Count();
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
754if (memberDeclarationNode.DescendantNodes().OfType<ReturnStatementSyntax>().Count() == 1)
Copilot\CSharpCopilotCodeFixProvider.cs (1)
109if (memberDeclaration is null || memberDeclaration is not BaseMethodDeclarationSyntax baseMethodDeclaration || baseMethodDeclaration.GetDiagnostics().Count() > 3)
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (1)
37if (statements.Count() != 1)
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
113if (parent.DescendantNodes().OfType<StatementSyntax>().Count() <= 1)
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
404return allNamespaces.Take(2).Count() == 1;
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (15)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (6)
670Assert.Equal(2, newProject.Documents.Count()); 671Assert.Equal(0, changes.GetChangedDocuments().Count()); 672Assert.Equal(1, changes.GetAddedDocuments().Count()); 716Assert.Equal(2, newProject.Documents.Count()); 717Assert.Equal(0, changes.GetChangedDocuments().Count()); 718Assert.Equal(1, changes.GetAddedDocuments().Count());
EditAndContinue\SyntaxUtilitiesTests.cs (9)
211Assert.Equal(0, SyntaxUtilities.GetSuspensionPoints(m0.ExpressionBody).Count()); 212Assert.Equal(1, SyntaxUtilities.GetSuspensionPoints(m1.ExpressionBody).Count()); 213Assert.Equal(1, SyntaxUtilities.GetSuspensionPoints(m2.Body).Count()); 214Assert.Equal(0, SyntaxUtilities.GetSuspensionPoints(m3.Body).Count()); 215Assert.Equal(1, SyntaxUtilities.GetSuspensionPoints(f1.ExpressionBody).Count()); 216Assert.Equal(1, SyntaxUtilities.GetSuspensionPoints(f2.Body).Count()); 217Assert.Equal(1, SyntaxUtilities.GetSuspensionPoints(l1.Body).Count()); 218Assert.Equal(1, SyntaxUtilities.GetSuspensionPoints(l2.Body).Count()); 219Assert.Equal(1, SyntaxUtilities.GetSuspensionPoints(l3.Body).Count());
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (5)
IOperation\IOperationTests_IVariableDeclaration.cs (5)
613Assert.Equal(2, declarator.ChildOperations.Count()); 635Assert.Equal(1, declarator.ChildOperations.Count()); 656Assert.Equal(1, declarator.ChildOperations.Count()); 851Assert.Equal(2, declaration.ChildOperations.Count()); 873Assert.Equal(2, declaration.ChildOperations.Count());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (59)
Semantics\BindingAsyncTests.cs (1)
62Assert.True(parens.Count() == 2, "Expect exactly two parenthesized lambda expressions in the syntax tree.");
Semantics\DeconstructionTests.cs (19)
4170Assert.Equal(2, designations.Count()); 4238Assert.Equal(4, designations.Count()); 4257Assert.Equal(3, declarations.Count()); 4373Assert.Equal(4, designations.Count()); 4392Assert.Equal(3, declarations.Count()); 4516Assert.Equal(3, declarations.Count()); 4666Assert.Equal(2, declarations.Count()); 4760Assert.Equal(2, declarations.Count()); 4838Assert.Equal(2, declarations.Count()); 5187Assert.Equal(4, designations.Count()); 5206Assert.Equal(3, declarations.Count()); 5331Assert.Equal(4, designations.Count()); 5350Assert.Equal(3, declarations.Count()); 5487Assert.Equal(3, declarations.Count()); 5655Assert.Equal(4, designations.Count()); 5674Assert.Equal(2, declarations.Count()); 5765Assert.Equal(4, designations.Count()); 5784Assert.Equal(2, declarations.Count()); 5887Assert.Equal(2, declarations.Count());
Semantics\ExpressionBodiedMemberTests.cs (4)
616Assert.Equal(1, tree.GetRoot().DescendantNodes().OfType<ArrowExpressionClauseSyntax>().Count()); 840Assert.Equal(2, nodes.Count()); 875Assert.Equal(2, nodes.Count()); 914Assert.Equal(2, nodes.Count());
Semantics\FieldInitializerBindingTests.cs (1)
266int numInitializers = expectedInitializers.Count();
Semantics\InheritanceBindingTests.cs (1)
8242Assert.Equal(expectedErrors.Length, actualErrors.Count());
Semantics\InitOnlyMemberTests.cs (1)
3193Assert.Equal(2, nodes.Count());
Semantics\LambdaTests.cs (3)
387Assert.Equal(0, comp2.GetDiagnostics().Count()); 476Assert.True(0 < errs.Count(), "Diagnostics not empty"); 532Assert.Equal(0, csProject.GetDiagnostics().Count());
Semantics\MethodBodyModelTests.cs (9)
56Assert.Equal(0, comp.GetDeclarationDiagnostics().Count()); 78Assert.Equal(0, comp.GetDeclarationDiagnostics().Count()); 325Assert.Equal(1, tree.GetDiagnostics().Count()); 418Assert.Equal(1, comp.GetDiagnostics().Count()); 442Assert.Equal(1, comp.GetDiagnostics().Count()); 465Assert.Equal(1, comp.GetDiagnostics().Count()); 488Assert.Equal(1, comp.GetDiagnostics().Count()); 511Assert.Equal(1, comp.GetDiagnostics().Count()); 955Assert.Equal(0, comp.GetDeclarationDiagnostics().Count());
Semantics\SemanticErrorTests.cs (1)
3255Assert.Equal(1, errs.Count());
Semantics\StackAllocInitializerTests.cs (2)
1046Assert.Equal(15, variables.Count()); 1148Assert.Equal(15, variables.Count());
Semantics\StackAllocSpanExpressionsTests.cs (2)
54Assert.Equal(5, variables.Count()); 128Assert.Equal(5, variables.Count());
Semantics\TargetTypedDefaultTests.cs (3)
1737Assert.True(defaults.Count() == 4); 1803Assert.True(defaults.Count() == 4); 1874Assert.True(defaults.Count() == 4);
SourceGeneration\GeneratorDriverTests.cs (11)
137Assert.Equal(2, outputCompilation.SyntaxTrees.Count()); 229Assert.Equal(2, outputCompilation1.SyntaxTrees.Count()); 230Assert.Equal(2, outputCompilation2.SyntaxTrees.Count()); 231Assert.Equal(2, outputCompilation3.SyntaxTrees.Count()); 355Assert.Equal(2, outputCompilation.SyntaxTrees.Count()); 473Assert.Equal(2, outputCompilation.SyntaxTrees.Count()); 512Assert.Equal(1, outputCompilation.SyntaxTrees.Count()); 533Assert.Equal(3, outputCompilation.SyntaxTrees.Count()); 898Assert.Equal(2, outputCompilation.SyntaxTrees.Count()); 1628Assert.Equal(2, outputCompilation.SyntaxTrees.Count()); 4562Assert.Equal(2, result.HostOutputs.Keys.Count());
SourceGeneration\SyntaxAwareGeneratorTests.cs (1)
457Assert.Equal(2, compilation.SyntaxTrees.Count());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (111)
Compilation\CompilationAPITests.cs (12)
835Assert.InRange(comp.GetDiagnostics().Count(), 0, int.MaxValue); 836Assert.InRange(comp.GetDeclarationDiagnostics().Count(), 0, int.MaxValue); 889Assert.InRange(comp.GetDiagnostics().Count(), 0, int.MaxValue); 894Assert.Equal(0, comp.GetDiagnostics(cancellationToken: default(CancellationToken)).Count()); 899Assert.InRange(comp.GetDiagnostics().Count(), 0, int.MaxValue); 902Assert.Equal(0, comp.GetDiagnostics().Count()); 907Assert.InRange(error.Count(), 1, int.MaxValue); 910Assert.Equal(0, comp.GetDiagnostics().Count()); 1903Assert.Equal(2, comp.References.Count()); 2611Assert.Equal(1, type.GetMembers().OfType<IPropertySymbol>().Count()); 2632Assert.Equal(2, type.GetMembers().OfType<IPropertySymbol>().Count()); 2647Assert.Equal(2, type.GetMembers().OfType<IPropertySymbol>().Count());
Compilation\CSharpCompilationOptionsTests.cs (2)
209Assert.Equal(0, new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithUsings("A", "B").WithUsings(null).Usings.Count()); 210Assert.Equal(0, new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithUsings("A", "B").WithUsings((string[])null).Usings.Count());
Compilation\GetSemanticInfoTests.cs (12)
417Assert.Equal(4, errs.Count()); 419Assert.Equal(1, errs.Count()); 421Assert.Equal(2, errs.Count()); 423Assert.Equal(1, errs.Count()); 444Assert.Equal(0, errs.Count()); 446Assert.Equal(0, errs.Count()); 493Assert.Equal(3, errs.Count()); 495Assert.Equal(0, errs.Count()); 5784Assert.Equal(3, errs.Count()); 5786Assert.Equal(0, errs.Count()); 5788Assert.Equal(1, errs.Count()); 5790Assert.Equal(2, errs.Count());
Compilation\SemanticModelAPITests.cs (10)
487Assert.Equal(1, errs.Count()); 519Assert.Equal(1, errs.Count()); 844Assert.Equal(1, typeA.Count()); 846Assert.Equal(1, invalid.Count()); 1042Assert.Equal(4, anonProps.Count()); 1073Assert.Equal(5, anonProps.Count()); 1114Assert.Equal(4, anonProps.Count()); 1158Assert.Equal(9, anonProps.Count()); 1196Assert.Equal(1, paras.Count()); 1201Assert.Equal(2, args.Count());
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (3)
1387Assert.Equal(9, symbolsInC.Where(s => s.ContainingType == null || s.ContainingType.SpecialType != SpecialType.System_Object).Count()); 1634Assert.Equal(9, symbols.Count()); // A.X, B.Y, C.Z, Object.ToString, Object.Equals, Object.Finalize, Object.GetHashCode, Object.GetType, Object.MemberwiseClone 1637Assert.Equal(9, symbols2.Count()); // A.X, B.Y, C.Z, Object.ToString, Object.Equals, Object.Finalize, Object.GetHashCode, Object.GetType, Object.MemberwiseClone
Compilation\SymbolSearchTests.cs (2)
243Assert.Equal(count, compilation.GetSymbolsWithName(name, filter).Count()); 251Assert.Equal(count, compilation.GetSymbolsWithName(predicate, filter).Count());
Compilation\UsedAssembliesTests.cs (4)
116if (tryRemove.Count() > 1) 334if (tryRemove.Count() > 1) 639Assert.True(comp2.References.Count() > 1); 2328Assert.True(comp.References.Count() > 1);
DocumentationComments\CrefTests.cs (4)
302Assert.Equal(4, crefSyntaxes.Count()); 4699Assert.Equal(5, crefSyntaxes.Count()); 4755Assert.Equal(5, crefSyntaxes.Count()); 5380Assert.Equal(0, GetCrefSyntaxes(compilation).Count());
DocumentationComments\DocumentationCommentCompilerTests.cs (2)
5883Assert.Equal(2, comp.GetMethodBodyDiagnostics().Count()); 5884Assert.Equal(2, comp.GetDiagnostics().Count());
DocumentationComments\ParameterTests.cs (16)
36Assert.Equal(2, nameSyntaxes.Count()); 59Assert.Equal(2, nameSyntaxes.Count()); 83Assert.Equal(2, nameSyntaxes.Count()); 107Assert.Equal(2, nameSyntaxes.Count()); 136Assert.Equal(2, nameSyntaxes.Count()); 161Assert.Equal(2, nameSyntaxes.Count()); 186Assert.Equal(2, nameSyntaxes.Count()); 207Assert.Equal(2, nameSyntaxes.Count()); 228Assert.Equal(2, nameSyntaxes.Count()); 249Assert.Equal(2, nameSyntaxes.Count()); 274Assert.Equal(2, nameSyntaxes.Count()); 300Assert.Equal(3, nameSyntaxes.Count()); 375Assert.Equal(2, nameSyntaxes.Count()); 628Assert.Equal(1, GetNameAttributeValues(compilation).Count()); 669Assert.Equal(0, GetNameAttributeValues(compilation).Count()); 714Assert.Equal(0, GetNameAttributeValues(compilation).Count());
DocumentationComments\TypeDocumentationCommentTests.cs (1)
140Assert.Equal(0, comp.GetDiagnostics().Count());
Symbols\AnonymousTypesSymbolTests.cs (1)
240Assert.Equal(2, type.GetFields(BindingFlags.NonPublic | BindingFlags.Instance).Count());
Symbols\IndexerTests.cs (1)
2635Assert.Equal(7, receiverSyntaxes.Count());
Symbols\Metadata\PE\LoadingMethods.cs (1)
150Assert.Equal(2, basicC1_M9.Count());
Symbols\OverriddenOrHiddenMembersTests.cs (1)
1862Assert.Equal(0, comp.GetDiagnostics().Count());
Symbols\Retargeting\RetargetCustomAttributes.cs (1)
142Assert.Equal(1, attributes.Count());
Symbols\Source\AccessTests.cs (6)
33Assert.Equal(0, errs.Count()); 49Assert.Equal(0, errs.Count()); 75Assert.Equal(0, errs.Count()); 98Assert.Equal(6, errs.Count()); 146Assert.Equal(1, comp.GetDeclarationDiagnostics().Count()); 169Assert.Equal(0, comp.GetDeclarationDiagnostics().Count());
Symbols\Source\BaseClassTests.cs (6)
163Assert.Equal(0, diagnostics.Count()); 190Assert.Equal(2, diagnostics.Count()); 1426Assert.Equal(1, comp.GetDeclarationDiagnostics().Count()); 1617Assert.Equal(0, c1.GetDiagnostics().Count()); 1618Assert.Equal(0, c2.GetDiagnostics().Count()); 1623Assert.Equal(0, c2.GetDiagnostics().Count());
Symbols\Source\DelegateTests.cs (1)
89Assert.Equal(1, diags.Count());
Symbols\Source\MethodTests.cs (13)
509Assert.Equal(0, comp.GetDeclarationDiagnostics().Count()); 585Assert.Equal(0, comp.GetDiagnostics().Count()); 769Assert.Equal(0, comp1.GetDiagnostics().Count()); 770Assert.Equal(0, comp2.GetDiagnostics().Count()); 771Assert.Equal(0, comp.GetDiagnostics().Count()); 1058Assert.Equal(0, comp1.GetDiagnostics().Count()); 1059Assert.Equal(0, comp2.GetDiagnostics().Count()); 1060Assert.Equal(0, comp.GetDiagnostics().Count()); 1163Assert.Equal(0, comp.GetDiagnostics().Count()); 1257Assert.Equal(0, comp.GetDiagnostics().Count()); 1462Assert.Equal(0, comp.GetDeclarationDiagnostics().Count()); 1500Assert.Equal(0, comp.GetDeclarationDiagnostics().Count()); 1544Assert.Equal(0, comp.GetDeclarationDiagnostics().Count());
Symbols\Source\PropertyTests.cs (2)
633Assert.Equal(2, type.GetMembers().OfType<MethodSymbol>().Count()); 638Assert.Equal(0, type.GetMembers().OfType<PropertySymbol>().Count());
Symbols\TypeTests.cs (10)
200Assert.Equal(0, comp1.GetDiagnostics().Count()); 201Assert.Equal(0, comp2.GetDiagnostics().Count()); 202Assert.Equal(0, comp.GetDiagnostics().Count()); 382Assert.Equal(0, comp.GetDiagnostics().Count()); 401Assert.Equal(0, comp.GetDiagnostics().Count()); 420Assert.Equal(0, comp.GetDiagnostics().Count()); 443Assert.Equal(0, comp.GetDiagnostics().Count()); 1140Assert.Equal(0, comp.GetDeclarationDiagnostics().Count()); 1154Assert.Equal(0, comp.GetDeclarationDiagnostics().Count()); 1236Assert.Equal(4, comp.GetDiagnostics().Count());
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (37)
Diagnostics\DiagnosticTest.cs (3)
88Assert.Equal(0, d1.AdditionalLocations.Count()); 102Assert.Equal(1, d3.AdditionalLocations.Count()); 149Assert.InRange(actualErrors.Count(), 1, int.MaxValue);
Diagnostics\LocationsTests.cs (1)
312Assert.Equal(1, diags.Count());
IncrementalParsing\IncrementalParsingTests.cs (3)
3748Assert.Equal(pd.Count(), id.Count()); 3749for (int i = 0; i < id.Count(); i++)
IncrementalParsing\NodeValidators.cs (2)
39Assert.Equal(arrayType.RankSpecifiers.Count(), numRanks); 66Assert.Equal(genericName.TypeArgumentList.Arguments.Count, typeNames.Count());
LexicalAndXml\XmlDocCommentTests.cs (1)
3307Assert.Equal(actual.Count(), expected.Count);
Parsing\ParserRegressionTests.cs (2)
227Assert.Equal("202", actualErrors.Count().ToString()); 245Assert.Equal("202", actualErrors.Count().ToString());
Parsing\ScriptParsingTests.cs (1)
9611Assert.Equal(1, tree.GetCompilationUnitRoot().ChildNodes().Count());
Syntax\StructuredTriviaTests.cs (1)
94Assert.Equal(1, resultList.Count());
Syntax\SyntaxAnnotationTests.cs (11)
356for (int i = 0; i < actualNodesOrTokens.Count(); i++) 369Assert.Equal(annotatedTrivia.Count(), actualTrivia.Count()); 371for (int i = 0; i < actualTrivia.Count(); i++) 404Assert.Equal(sourceNodeOrTokens.Count(), destNodeOrTokens.Count()); 418Assert.Equal(sourceTrivia.Count(), destTrivia.Count()); 618Assert.Equal(1, results.Count()); 632Assert.Equal(1, results.Count()); 646Assert.Equal(1, results.Count());
Syntax\SyntaxNodeTests.cs (8)
1824Assert.Equal(0, syntaxTree.GetDiagnostics().Count()); 1828Assert.Equal(0, syntaxTree.GetDiagnostics(nOrT).Count()); 2045Assert.Equal(expectedTokenKinds.Count(), actualTokens.Count()); //redundant but helps debug 2066Assert.Equal(expectedTokenKinds.Count(), actualTokens.Count()); //redundant but helps debug 3534Assert.Equal(1, node.DescendantTrivia().Count()); 3545Assert.Equal(1, node.DescendantTrivia().Count());
Syntax\TrackNodeTests.cs (4)
39Assert.Equal(1, currentAs.Count()); 59Assert.Equal(0, currentAs.Count()); 88Assert.Equal(1, latestAs.Count()); 115Assert.Equal(0, latestAs.Count());
Microsoft.CodeAnalysis.CSharp.Test.Utilities (9)
CompilationTestUtils.cs (2)
127int n = reducedMethod.Parameters.Count(); 128Assert.Equal(reducedFrom.Parameters.Count(), n + 1);
CSharpTestBase.cs (1)
1368if (resolvedReferences.Count() > used.Length)
DiagnosticTestUtilities.cs (4)
102int actualLength = actualErrors.Count(); 160Assert.True(experr.Parameters.SequenceEqual(acterr.Parameters), String.Format("Param: {0}!={1}", experr.Parameters.Count(), acterr.Parameters.Count())); 179Assert.InRange(expectedErrorDesp.Length, 0, actualErrors.Count()); 195Assert.InRange(expectedGroup.Count(), 0, actualGroupCount);
Extensions.cs (2)
500if (!(expArgs.Count() == actArgs.Length)) 505for (var i = 0; i <= expArgs.Count() - 1; i++)
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaListExtensions.cs (1)
72return new SyntaxTriviaList(triviaList.Skip(triviaInLeadingBlankLines.Count()));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
278Debug.Assert(originalIdentifierNodes.Count() == replacedIdentifierNodes.Count());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\QueryExpressionSyntaxExtensions.cs (1)
44var clauses = SyntaxFactory.List(allClauses.Take(allClauses.Count() - 1).Cast<QueryClauseSyntax>());
Microsoft.CodeAnalysis.EditorFeatures (13)
InlineRename\InlineRenameSession.cs (1)
268Debug.Assert(buffer.GetRelatedDocuments().Count() == 1);
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (1)
248Debug.Assert(trackingSpansTouched.Count() == 1);
Preview\SolutionChangeSummary.cs (11)
26TotalFilesAffected += p.GetAddedDocuments().Count() + 27p.GetChangedDocuments().Count() + 28p.GetRemovedDocuments().Count() + 29p.GetAddedAdditionalDocuments().Count() + 30p.GetChangedAdditionalDocuments().Count() + 31p.GetRemovedAdditionalDocuments().Count() + 32p.GetAddedAnalyzerConfigDocuments().Count() + 33p.GetChangedAnalyzerConfigDocuments().Count() + 34p.GetRemovedAnalyzerConfigDocuments().Count(); 47var totalProjectsAddedOrRemoved = changes.GetAddedProjects().Count() + changes.GetRemovedProjects().Count();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (12)
CommentSelection\AbstractToggleCommentTestBase.cs (2)
83if (spans.Count() == 1) 88else if (spans.Count() > 1)
Completion\AbstractCompletionProviderTests.cs (1)
307Assert.Equal(matchingFilters.Count, matchingFilters.Distinct().Count());
NavigateTo\AbstractNavigateToTests.cs (2)
169Assert.Equal(expecteditems.Count(), items.Count());
QuickInfo\ToolTipAssert.cs (4)
67Assert.Equal(expected.Elements.Count(), actual.Elements.Count()); 83Assert.Equal(expected.Runs.Count(), actual.Runs.Count());
SignatureHelp\AbstractSignatureHelpProviderTests.cs (3)
185Assert.True(expectedTestItems.Count() == actualSignatureHelpItems.Items.Count(), $"Expected {expectedTestItems.Count()} items, but got {actualSignatureHelpItems.Items.Count()}"); 187for (var i = 0; i < expectedTestItems.Count(); i++)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (28)
CodeActions\CodeChangeProviderMetadataTests.cs (1)
73if (namedGroup.Count() == 1)
Collections\Immutable\Maps\MapTests.cs (2)
46Assert.Equal(5, map.Keys.Count()); 47Assert.Equal(5, map.Values.Count());
Diagnostics\IDEDiagnosticIDUniquenessTest.cs (1)
21Assert.Equal(listOfIDEDiagnosticIds.Count, listOfIDEDiagnosticIds.Distinct().Count());
Preview\PreviewWorkspaceTests.cs (2)
105Assert.Equal(1, previewWorkspace.GetOpenDocumentIds().Count()); 109Assert.Equal(0, previewWorkspace.GetOpenDocumentIds().Count());
RenameTracking\RenameTrackingTestState.cs (2)
162Assert.Equal(0, tags.Count()); 186Assert.Equal(1, tags.Count());
SymbolFinder\DependentTypeFinderTests.cs (6)
456Assert.True(transitiveDerived.Count() > immediateDerived.Count()); 505Assert.True(transitiveDerived.Count() > immediateDerived.Count()); 557Assert.True(transitiveImpls.Count() > immediateImpls.Count());
Tagging\AsynchronousTaggerTests.cs (2)
114Assert.Equal(0, tags.Count()); 140Assert.Equal(2, tags.Count());
Tagging\TagSpanIntervalTreeTests.cs (7)
87Assert.Equal(50, GetIntersectingSpans(tree, new SnapshotSpan(buffer.CurrentSnapshot, 150, 50)).Count()); 90Assert.Equal(26, GetIntersectingSpans(tree, new SnapshotSpan(buffer.CurrentSnapshot, 175, 25)).Count()); 101Assert.Equal(1, GetIntersectingSpans(tree, new SnapshotSpan(buffer.CurrentSnapshot, 0, 1)).Count()); 102Assert.Equal(1, GetIntersectingSpans(tree, new SnapshotSpan(buffer.CurrentSnapshot, 50, 1)).Count()); 105Assert.Equal(2, GetIntersectingSpans(tree, new SnapshotSpan(buffer.CurrentSnapshot, 100, 1)).Count()); 119Assert.Equal(51, GetIntersectingSpans(tree, new SnapshotSpan(buffer.CurrentSnapshot, 0, 1)).Count()); 133Assert.Equal(51, GetIntersectingSpans(tree, new SnapshotSpan(buffer.CurrentSnapshot, 99, 1)).Count());
TextEditor\TextBufferAssociatedViewServiceTests.cs (5)
41Assert.Equal(1, service.GetAssociatedTextViews(bufferMock.Object).Count()); 44Assert.Equal(0, service.GetAssociatedTextViews(bufferMock.Object).Count()); 48Assert.Equal(2, service.GetAssociatedTextViews(bufferMock.Object).Count()); 51Assert.Equal(1, service.GetAssociatedTextViews(bufferMock.Object).Count()); 54Assert.Equal(0, service.GetAssociatedTextViews(bufferMock.Object).Count());
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Suggestions\SuggestedActionsSource_Async.cs (1)
153currentActionCount += set.Actions.Count();
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
Debugger\Engine\DkmClrType.cs (1)
284if (attributesData.Count() == 0)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
Internal\NavigateTo\FSharpNavigateToSearchService.cs (1)
59Contract.ThrowIfTrue(projects.Select(p => p.Language).Distinct().Count() != 1);
Microsoft.CodeAnalysis.Features (12)
ExternalAccess\VSTypeScript\VSTypeScriptNavigateToSearchService.cs (1)
61Contract.ThrowIfTrue(projects.Select(p => p.Language).Distinct().Count() != 1);
MoveToNamespace\AbstractMoveToNamespaceService.cs (3)
156=> node.AncestorsAndSelf().OfType<TNamespaceDeclarationSyntax>().Count() + node.DescendantNodes().OfType<TNamespaceDeclarationSyntax>().Count(); 159=> node.AncestorsAndSelf().OfType<TNamedTypeDeclarationSyntax>().Count() > 1;
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (1)
72Contract.ThrowIfTrue(projects.Select(p => p.Language).Distinct().Count() != 1);
NavigateTo\AbstractNavigateToSearchService.GeneratedDocumentSearch.cs (1)
33Contract.ThrowIfTrue(projects.Select(p => p.Language).Distinct().Count() != 1);
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (1)
80Contract.ThrowIfTrue(projects.Select(p => p.Language).Distinct().Count() != 1);
NavigateTo\NavigateToSearcher.cs (1)
493Contract.ThrowIfFalse(orderedProjects.SelectMany(s => s).Count() == filteredProjects.SelectMany(s => s).Count());
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (1)
217properties = properties.AddRange(tagIndices.Select(kvp => new KeyValuePair<string, string?>(kvp.Key, EncodeIndices(kvp.Value, additionalLocations.Count()))));
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
67if (declarationDeclarators.Count == fieldDeclarators.Count())
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
45Debug.Assert(diagnostics.Select(diagnostic => diagnostic.Properties[MatchFolderAndNamespaceConstants.TargetNamespace]).Distinct().Count() == 1);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
925return referencedSymbols.Count() == 1 &&
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
RelatedDocuments\AbstractRelatedDocumentsTests.cs (1)
45Assert.True(results.Distinct().Count() == results.Count);
Microsoft.CodeAnalysis.LanguageServer (1)
LanguageServer\Handler\Restore\RestoreHandler.cs (1)
109context.TraceInformation($"Found {projects.Length} restorable projects from {solution.Projects.Count()} projects in solution");
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Features\Diagnostics\DocumentAnalysisExecutor.cs (2)
175Debug.Assert(diags.Length == CompilationWithAnalyzers.GetEffectiveDiagnostics(diags, compilation).Count()); 176Debug.Assert(diagnostics.Length == ConvertToLocalDiagnostics(diags, textDocument, span).Count());
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (1)
721return currentActionCount + actionSets.Sum(a => a.Actions.Count()) > 3
Handler\CodeActions\CodeActionHelpers.cs (1)
436if (matchingActions.Count() == 1)
Microsoft.CodeAnalysis.LanguageServer.UnitTests (1)
ExportProviderBuilderTests.cs (1)
70Assert.Equal(expectedCount, mefCompositions.Count());
Microsoft.CodeAnalysis.Test.Utilities (13)
Assert\AssertEx.cs (4)
480var result = expected.Count() == actual.Count() && expectedSet.SetEquals(actual); 709if (expected.Count() > 10) 719if (TryGenerateExpectedSourceFileAndGetDiffLink(actualString, expected.Count(), expectedValueSourcePath, expectedValueSourceLine, out var link))
CommonTestBase.cs (1)
674Assert.Equal(0, originalSet.Intersect(clonedSet).Count());
Compilation\CompilationTestDataExtensions.cs (2)
63if (keys.Count() == 1) 68else if (keys.Count() > 1)
Compilation\OperationTreeVerifier.cs (1)
355var elementCount = logElementCount ? $"({list.Count()})" : string.Empty;
CompilationVerifier.cs (1)
402errorCount = result.Count();
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
1833if (_treeCallbackSet.Count != endContext.Compilation.SyntaxTrees.Count())
Diagnostics\DiagnosticDescription.cs (2)
327if (args1.Count() != args2.Count() || !args1.SetEquals(args2))
Diagnostics\OperationTestAnalyzer.cs (1)
843if (declarationStatement.GetDeclaredVariables().Count() > 3)
Microsoft.CodeAnalysis.UnitTests (42)
Analyzers\AnalyzerFileReferenceTests.cs (1)
100Assert.Equal(2, analyzerTypeNameMap.Keys.Count());
Collections\BitArrayTests.cs (2)
183var count = BitVector.AllSet(capacity).Words().Count(); 226var count = BitVector.AllSet(capacity).Words().Count();
Collections\ImmutableDictionaryTestBase.cs (3)
242Assert.Equal(0, empty.Count()); 243Assert.Equal(0, empty.Keys.Count()); 244Assert.Equal(0, empty.Values.Count());
Collections\ImmutableDictionaryTestBase.nonnetstandard.cs (8)
210Assert.Equal(0, map.Keys.Count()); 211Assert.Equal(0, map.ToReadOnlyDictionary().Keys.Count()); 214Assert.Equal(1, nonEmpty.Keys.Count()); 215Assert.Equal(1, nonEmpty.ToReadOnlyDictionary().Keys.Count()); 221Assert.Equal(0, map.Values.Count()); 222Assert.Equal(0, map.ToReadOnlyDictionary().Values.Count()); 225Assert.Equal(1, nonEmpty.Values.Count()); 226Assert.Equal(1, nonEmpty.ToReadOnlyDictionary().Values.Count());
Collections\ImmutableSetTest.cs (1)
290Assert.Equal(0, emptySet.Count()); //, "Enumeration of an empty set yielded elements.");
Collections\ImmutablesTestBase.nonnetstandard.cs (2)
34if (objectUnderTest.Count() < 2) 43var shorterSequence = equivalentSequence.Take(equivalentSequence.Count() - 1);
Collections\List\CollectionAsserts.cs (8)
85Assert.Equal(e.Where(kv => kv.Key != null).ToDictionary(g => g.Key!, g => g.Count()), a.Where(kv => kv.Key != null).ToDictionary(g => g.Key!, g => g.Count())); 88Assert.Equal(e[null].Count(), a[null].Count()); 104Assert.Equal(e.Where(kv => kv.Key != null).ToDictionary(g => g.Key!, g => g.Count()), a.Where(kv => kv.Key != null).ToDictionary(g => g.Key!, g => g.Count())); 107Assert.Equal(e[null].Count(), a[null].Count());
Collections\List\ICollection.Generic.Tests.cs (2)
98if (casted.Count() > 0) 111if (casted.Count() > 0)
CommonCommandLineParserTests.cs (4)
232Assert.Equal(1, RuleSet.GetEffectiveIncludesFromFile(ruleSet.FilePath).Count()); 257Assert.Equal(2, RuleSet.GetEffectiveIncludesFromFile(ruleSet.FilePath).Count()); 292Assert.Equal(3, RuleSet.GetEffectiveIncludesFromFile(ruleSet.FilePath).Count()); 451Assert.True(ruleSet.Includes.Count() == 1);
Diagnostics\SuppressMessageTargetSymbolResolverTests.cs (1)
1371if (symbols.Count() > 1)
InvokeUtil.cs (4)
45var defaultContextCount = AssemblyLoadContext.Default.Assemblies.Count(); 46var compilerContextCount = compilerContext.Assemblies.Count(); 85Assert.Equal(defaultContextCount, AssemblyLoadContext.Default.Assemblies.Count()); 86Assert.Equal(compilerContextCount, compilerContext.Assemblies.Count());
MetadataReferences\MetadataHelpersTests.cs (6)
451Assert.False(nestedNamespaces.GroupBy(pair => pair.Key).Where(g => g.Count() > 1).Any()); 456Assert.Equal(2, array[0].Value.Count()); 458Assert.Equal(1, array[1].Value.Count()); 460Assert.Equal(1, array[2].Value.Count()); 493Assert.Equal(2, nestedNS.Value.Count()); 502Assert.Equal(2, nestedNamespaces.Count());
Microsoft.CodeAnalysis.VisualBasic (15)
OptionsValidator.vb (1)
39If importsClauses.Count > 0 Then
Semantics\Operators.vb (6)
1956If opSet.Count = 0 Then 1962conversionKinds.ZeroInit(opSet.Count) 1964Dim applicable = BitVector.Create(opSet.Count) 1973ElseIf opSet.Count = 0 Then 1983ElseIf opSet.Count = 0 Then 1991conversionKinds.ZeroInit(opSet.Count)
Semantics\OverloadResolution.vb (8)
2121Debug.Assert(indexesOfApplicableCandidates.Count = applicableCandidates) 2137For i As Integer = 0 To indexesOfApplicableCandidates.Count - 2 2144For j As Integer = i + 1 To indexesOfApplicableCandidates.Count - 1 2554left.EquallyApplicableCandidatesBucket = buckets.Count + 1 3920ElseIf applicableCount = quickInfo.Count Then 3934For k As Integer = 0 To If(applicableCount > 0 OrElse Not includeEliminatedCandidates, applicableCount, quickInfo.Count) - 1 3949For l As Integer = k + 1 To quickInfo.Count - 1 4011For l As Integer = k + 1 To quickInfo.Count - 1
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (155)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (1)
2855Assert.Equal(3, nodes.Count)
FlowAnalysis\FlowTestBase.vb (3)
81Debug.Assert(program.<file>.Count = 1, "Only one file can be in the compilation.") 99Debug.Assert(spans.Count = 1 AndAlso spans(0).Count = 1, "Exactly one region must be selected")
FlowAnalysis\IterationJumpYieldStatementTests.vb (70)
41Assert.Equal(0, controlFlowAnalysis.ExitPoints.Count()) 42Assert.Equal(0, controlFlowAnalysis.EntryPoints.Count()) 63Assert.Equal(0, controlFlowAnalysis.ExitPoints.Count()) 64Assert.Equal(0, controlFlowAnalysis.EntryPoints.Count()) 91Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 92Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()) 127Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 128Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()) 158Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 159Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 188Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 189Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 219Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 220Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 251Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 252Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 283Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 284Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 334Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 335Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 365Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 366Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 396Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 397Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 429Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 430Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 460Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 461Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 483Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 484Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 506Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 507Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 529Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 530Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 550Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 551Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 574Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 575Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 613Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 614Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 655Assert.Equal(1, controlFlowAnalysisResults.EntryPoints.Count()) 656Assert.Equal(0, controlFlowAnalysisResults.ExitPoints.Count()) 786Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count) 787Assert.Equal(3, controlFlowAnalysisResults.ExitPoints.Count) 794Assert.Equal(1, dataFlowAnalysisResults.DataFlowsIn.Count) 797Assert.Equal(1, dataFlowAnalysisResults.ReadInside.Count) 799Assert.Equal(1, dataFlowAnalysisResults.ReadOutside.Count) 803Assert.Equal(1, dataFlowAnalysisResults.WrittenOutside.Count) 836Assert.Equal(2, dataFlowAnalysisResults.ReadInside.Count) 839Assert.Equal(2, dataFlowAnalysisResults.WrittenInside.Count) 874Assert.Equal(0, dataFlowAnalysisResults.WrittenInside.Count) 1347Assert.Equal(2, flow.VariablesDeclared.Count) 1405Assert.Equal(2, controlFlowAnalysis.ExitPoints.Count()) 1406Assert.Equal(1, controlFlowAnalysis.EntryPoints.Count()) 1443Assert.Equal(1, controlFlowAnalysis.ExitPoints.Count()) 1444Assert.Equal(1, controlFlowAnalysis.EntryPoints.Count()) 1492Assert.Equal(1, analysis.ExitPoints.Count()) 1511Assert.Equal(1, analysis.ExitPoints.Count()) 1531Assert.Equal(1, analysis.ExitPoints.Count()) 1532Assert.Equal(0, analysis.EntryPoints.Count()) 1554Assert.Equal(1, analysis.ExitPoints.Count()) 1555Assert.Equal(0, analysis.EntryPoints.Count()) 1577Assert.Equal(1, analysis.ExitPoints.Count()) 1578Assert.Equal(0, analysis.EntryPoints.Count()) 1600Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 1601Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()) 1630Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 1631Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count()) 1661Assert.Equal(0, controlFlowAnalysisResults.EntryPoints.Count()) 1662Assert.Equal(1, controlFlowAnalysisResults.ExitPoints.Count())
FlowAnalysis\TryLockUsingStatementTests.vb (81)
55Assert.Equal(0, controlFlowAnalysis.EntryPoints.Count()) 56Assert.Equal(2, controlFlowAnalysis.ExitPoints.Count()) 105Assert.Equal(1, analysis.EntryPoints.Count()) 106Assert.Equal(0, analysis.ExitPoints.Count()) 142Assert.Equal(1, controlFlowAnalysis.EntryPoints.Count()) 143Assert.Equal(1, controlFlowAnalysis.ExitPoints.Count()) 193Assert.Equal(2, controlFlowAnalysis.ExitPoints.Count()) 240Assert.Equal(2, controlFlowAnalysis.ExitPoints.Count()) 297Assert.Equal(2, controlFlowAnalysis.ExitPoints.Count()) 356Assert.Equal(1, controlFlowAnalysis.ExitPoints.Count()) 413Assert.Equal(0, controlFlowAnalysis.ExitPoints.Count()) 469Assert.Equal(3, controlFlowAnalysis.ExitPoints.Count()) 525Assert.Equal(2, controlFlowAnalysis.ExitPoints.Count()) 1031Assert.Equal(1, controlFlowAnalysis.ExitPoints.Count) 1739Assert.Equal(0, dataFlowAnalysisResults.AlwaysAssigned.Count) 1740Assert.Equal(0, dataFlowAnalysisResults.Captured.Count) 1742Assert.Equal(2, dataFlowAnalysisResults.DataFlowsIn.Count) 1746Assert.Equal(0, dataFlowAnalysisResults.DataFlowsOut.Count) 1748Assert.Equal(2, dataFlowAnalysisResults.ReadInside.Count) 1752Assert.Equal(0, dataFlowAnalysisResults.ReadOutside.Count) 1753Assert.Equal(0, dataFlowAnalysisResults.VariablesDeclared.Count) 1754Assert.Equal(0, dataFlowAnalysisResults.WrittenInside.Count) 1756Assert.Equal(2, dataFlowAnalysisResults.WrittenOutside.Count) 1788Assert.Equal(0, dataFlowAnalysisResults.AlwaysAssigned.Count) 1789Assert.Equal(0, dataFlowAnalysisResults.Captured.Count) 1791Assert.Equal(1, dataFlowAnalysisResults.DataFlowsIn.Count) 1794Assert.Equal(0, dataFlowAnalysisResults.DataFlowsOut.Count) 1796Assert.Equal(1, dataFlowAnalysisResults.ReadInside.Count) 1799Assert.Equal(1, dataFlowAnalysisResults.ReadOutside.Count) 1802Assert.Equal(0, dataFlowAnalysisResults.VariablesDeclared.Count) 1803Assert.Equal(0, dataFlowAnalysisResults.WrittenInside.Count) 1805Assert.Equal(2, dataFlowAnalysisResults.WrittenOutside.Count) 1839Assert.Equal(0, dataFlowAnalysisResults.AlwaysAssigned.Count) 1840Assert.Equal(0, dataFlowAnalysisResults.Captured.Count) 1842Assert.Equal(2, dataFlowAnalysisResults.DataFlowsIn.Count) 1846Assert.Equal(0, dataFlowAnalysisResults.DataFlowsOut.Count) 1848Assert.Equal(2, dataFlowAnalysisResults.ReadInside.Count) 1852Assert.Equal(0, dataFlowAnalysisResults.ReadOutside.Count) 1853Assert.Equal(0, dataFlowAnalysisResults.VariablesDeclared.Count) 1854Assert.Equal(0, dataFlowAnalysisResults.WrittenInside.Count) 1856Assert.Equal(2, dataFlowAnalysisResults.WrittenOutside.Count) 2120Assert.Equal(0, controlflowAnalysis.EntryPoints.Count) 2121Assert.Equal(1, controlflowAnalysis.ExitPoints.Count) 2164Assert.Equal(0, controlflowAnalysis.EntryPoints.Count) 2165Assert.Equal(1, controlflowAnalysis.ExitPoints.Count) 2203Assert.Equal(2, dataFlowAnalysisResults.AlwaysAssigned.Count) 2207Assert.Equal(0, dataFlowAnalysisResults.Captured.Count) 2209Assert.Equal(1, dataFlowAnalysisResults.DataFlowsIn.Count) 2212Assert.Equal(0, dataFlowAnalysisResults.DataFlowsOut.Count) 2214Assert.Equal(3, dataFlowAnalysisResults.ReadInside.Count) 2219Assert.Equal(0, dataFlowAnalysisResults.ReadOutside.Count) 2221Assert.Equal(2, dataFlowAnalysisResults.VariablesDeclared.Count) 2225Assert.Equal(2, dataFlowAnalysisResults.WrittenInside.Count) 2229Assert.Equal(1, dataFlowAnalysisResults.WrittenOutside.Count) 2270Assert.Equal(0, dataFlowAnalysisResults.AlwaysAssigned.Count) 2271Assert.Equal(0, dataFlowAnalysisResults.Captured.Count) 2273Assert.Equal(1, dataFlowAnalysisResults.DataFlowsIn.Count) 2276Assert.Equal(0, dataFlowAnalysisResults.DataFlowsOut.Count) 2278Assert.Equal(1, dataFlowAnalysisResults.ReadInside.Count) 2281Assert.Equal(0, dataFlowAnalysisResults.ReadOutside.Count) 2283Assert.Equal(0, dataFlowAnalysisResults.VariablesDeclared.Count) 2285Assert.Equal(0, dataFlowAnalysisResults.WrittenInside.Count) 2287Assert.Equal(1, dataFlowAnalysisResults.WrittenOutside.Count) 2328Assert.Equal(0, dataFlowAnalysisResults.AlwaysAssigned.Count) 2329Assert.Equal(0, dataFlowAnalysisResults.Captured.Count) 2331Assert.Equal(1, dataFlowAnalysisResults.DataFlowsIn.Count) 2334Assert.Equal(0, dataFlowAnalysisResults.DataFlowsOut.Count) 2336Assert.Equal(1, dataFlowAnalysisResults.ReadInside.Count) 2339Assert.Equal(2, dataFlowAnalysisResults.ReadOutside.Count) 2343Assert.Equal(0, dataFlowAnalysisResults.VariablesDeclared.Count) 2345Assert.Equal(0, dataFlowAnalysisResults.WrittenInside.Count) 2347Assert.Equal(2, dataFlowAnalysisResults.WrittenOutside.Count) 2386Assert.Equal(0, dataFlowAnalysisResults.AlwaysAssigned.Count) 2387Assert.Equal(0, dataFlowAnalysisResults.Captured.Count) 2389Assert.Equal(1, dataFlowAnalysisResults.DataFlowsIn.Count) 2392Assert.Equal(0, dataFlowAnalysisResults.DataFlowsOut.Count) 2394Assert.Equal(3, dataFlowAnalysisResults.ReadInside.Count) 2399Assert.Equal(0, dataFlowAnalysisResults.ReadOutside.Count) 2401Assert.Equal(2, dataFlowAnalysisResults.VariablesDeclared.Count) 2405Assert.Equal(2, dataFlowAnalysisResults.WrittenInside.Count) 2409Assert.Equal(1, dataFlowAnalysisResults.WrittenOutside.Count)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (13)
Syntax\SyntaxAnnotationTests.vb (13)
329Assert.Equal(annotatedNodesOrTokens.Count(), actualNodesOrTokens.Count()) 331For index = 0 To actualNodesOrTokens.Count() - 1 343Assert.Equal(annotatedTrivia.Count(), actualTrivia.Count()) 345For index = 0 To actualTrivia.Count - 1 375Assert.Equal(sourceNodeOrTokens.Count(), destNodeOrTokens.Count()) 388Assert.Equal(sourceTrivia.Count(), destTrivia.Count()) 560Assert.Equal(1, results.Count()) 573Assert.Equal(1, results.Count()) 586Assert.Equal(1, results.Count())
Microsoft.CodeAnalysis.Workspaces (19)
Editing\SyntaxGenerator.cs (3)
1972if (elements.Count() <= 1) 2000if (elementNames.Count() != elementTypes.Count())
FindSymbols\FindLiterals\FindLiteralsSearchEngine.cs (1)
87var count = _solution.Projects.SelectMany(p => p.DocumentIds).Count();
FindSymbols\ReferencedSymbol.cs (1)
51var count = this.Locations.Count();
Log\StatisticResult.cs (1)
37var mode = values.GroupBy(i => i).OrderByDescending(g => g.Count()).First().Key;
Rename\ConflictEngine\ConflictResolver.cs (1)
349var renameDeclarationLocations = new RenameDeclarationLocationReference[symbols.Count()];
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
248if (definitionDocuments.Count() == 1)
Rename\SymbolicRenameLocations.cs (1)
42Debug.Assert(locations.Distinct().Count() == locations.Length, "Locations should be unique");
Shared\Extensions\INamespaceSymbolExtensions.cs (1)
143namespaceSymbol = members.Count() == 1
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (2)
736var count = data.First().Count(); 737Debug.Assert(data.All(d => d.Count() == count));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (1)
183=> $"Interval tree with '{System.Linq.Enumerable.Count(this)}' entries. Use '.ToList()' to visualize contents.";
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
402if (words.Count() == 1) // Only Split if words have not been split before
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
654if (documentFileNamesAdded.Count() > 0)
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (3)
509if (projectsForOutputPath.Count() == 1) 650for (var i = 0; i < referenceInfo.ConvertedProjectReferences.Count(); i++) 700if (projectUpdateState.ProjectsByOutputPath.TryGetValue(path, out var ids) && ids.Distinct().Count() == 1)
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (1)
283var groups = emitResult.Diagnostics.GroupBy(d => d.Id).Select(g => $"{g.Key}:{g.Count()}");
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (2)
736var count = data.First().Count(); 737Debug.Assert(data.All(d => d.Count() == count));
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
VisualStudioMSBuildWorkspaceTests.cs (3)
2304Assert.Equal(2, workspace.CurrentSolution.Projects.Count()); 2334Assert.Equal(2, workspace.CurrentSolution.Projects.Count()); 2522Assert.InRange(project.ProjectReferences.Count(), 0, 1);
Microsoft.CodeAnalysis.Workspaces.UnitTests (43)
CodeStyle\NamingStylePreferencesUpgradeTests.cs (1)
198.Where(group => group.Count() > 1)
CommandLineProject\CommandLineProjectWorkspaceTests.cs (2)
36Assert.Equal(1, project.Documents.Count()); 64Assert.Equal(2, project.Documents.Count());
FindAllDeclarationsTests.cs (3)
145Assert.True(csharpResult.Count() > 0); 148Assert.True(vbResult.Count() > 0); 708Assert.Equal(1, foundDeclarations.Count());
FindAllDeclarationsTests.TestSolutionsAndProject.cs (2)
32var actualResultCount = declarations.Count(); 49var actualResultCount = declarations.Count();
FindReferencesTests.cs (16)
108Assert.Equal(3, result[0].Locations.Count()); // 3 locations found 135Assert.Equal(1, typeSymbol.Locations.Count()); 189Assert.Equal(expected: 2, actual: references.ElementAt(0).Locations.Count()); 194Assert.Equal(expected: 2, actual: references.ElementAt(0).Locations.Count()); 226Assert.Equal(expected: 0, actual: references.ElementAt(0).Locations.Count()); 293Assert.Equal(2, references.ElementAt(0).Locations.Count()); 298Assert.Equal(2, references.ElementAt(0).Locations.Count()); 447Assert.Equal(5, references.Count()); 489Assert.Equal(2, refsFromVirtual.Count()); 493Assert.Equal(2, refsFromOverride.Count()); 551Assert.Equal(1, typeResult.Locations.Count()); 552Assert.Equal(1, constructorResult.Locations.Count()); 584Assert.Equal(1, typeResult.Locations.Count()); 585Assert.Equal(1, constructorResult.Locations.Count()); 626Assert.Equal(2, typeResult.Locations.Count()); 627Assert.Equal(1, constructorResult.Locations.Count());
SolutionTests\SolutionTests.cs (11)
2559Assert.Equal(2, solution.GetProjectsByName("name").Count()); 3084Assert.Equal(2, sol.Projects.Count()); 3092Assert.Equal(1, sol2.Projects.Count()); 3110Assert.Equal(2, sol.Projects.Count()); 3117Assert.Equal(1, sol2.Projects.Count()); 3124Assert.Equal(2, sol3.Projects.Count()); 3485Assert.Equal(1, compilation.SyntaxTrees.Count()); 4297Assert.Equal(2, frozenDocument.Project.Documents.Count()); 4325Assert.Equal(2, frozenDocument.Project.Documents.Count()); 4614Assert.Equal(documentIds.Count(), syntaxTrees.Count());
SymbolKeyTests.cs (1)
333Assert.Equal(5, symbols.Count());
WorkspaceTests\AdhocWorkspaceTests.cs (7)
142Assert.Equal(1, project2.ProjectReferences.Count()); 167Assert.Equal(0, ws.CurrentSolution.Projects.Count()); 172Assert.Equal(1, ws.CurrentSolution.Projects.Count()); 178Assert.Equal(1, proj.Documents.Count()); 198Assert.Equal(1, ws.CurrentSolution.Projects.Count()); 201Assert.Equal(0, newSolution.Projects.Count()); 206Assert.Equal(0, ws.CurrentSolution.Projects.Count());
Microsoft.Data.Analysis.Tests (218)
ArrayComparer.cs (4)
143return f1.Metadata.Keys.Count() == f2.Metadata.Keys.Count() && 174return s1.Metadata.Keys.Count() == s2.Metadata.Keys.Count() &&
DataFrameColumn.BinaryOperationTests.cs (209)
33Assert.Equal(columnResult.Length, verify.Count()); 46Assert.Equal(columnResult.Length, verify.Count()); 59Assert.Equal(columnResult.Length, verify.Count()); 72Assert.Equal(columnResult.Length, verify.Count()); 85Assert.Equal(columnResult.Length, verify.Count()); 98Assert.Equal(columnResult.Length, verify.Count()); 111Assert.Equal(columnResult.Length, verify.Count()); 124Assert.Equal(columnResult.Length, verify.Count()); 137Assert.Equal(columnResult.Length, verify.Count()); 150Assert.Equal(columnResult.Length, verify.Count()); 163Assert.Equal(columnResult.Length, verify.Count()); 175Assert.Equal(columnResult.Length, verify.Count()); 187Assert.Equal(columnResult.Length, verify.Count()); 199Assert.Equal(columnResult.Length, verify.Count()); 211Assert.Equal(columnResult.Length, verify.Count()); 223Assert.Equal(columnResult.Length, verify.Count()); 235Assert.Equal(columnResult.Length, verify.Count()); 247Assert.Equal(columnResult.Length, verify.Count()); 259Assert.Equal(columnResult.Length, verify.Count()); 271Assert.Equal(columnResult.Length, verify.Count()); 283Assert.Equal(columnResult.Length, verify.Count()); 295Assert.Equal(columnResult.Length, verify.Count()); 307Assert.Equal(columnResult.Length, verify.Count()); 319Assert.Equal(columnResult.Length, verify.Count()); 331Assert.Equal(columnResult.Length, verify.Count()); 343Assert.Equal(columnResult.Length, verify.Count()); 355Assert.Equal(columnResult.Length, verify.Count()); 367Assert.Equal(columnResult.Length, verify.Count()); 379Assert.Equal(columnResult.Length, verify.Count()); 391Assert.Equal(columnResult.Length, verify.Count()); 403Assert.Equal(columnResult.Length, verify.Count()); 415Assert.Equal(columnResult.Length, verify.Count()); 427Assert.Equal(columnResult.Length, verify.Count()); 440Assert.Equal(columnResult.Length, verify.Count()); 453Assert.Equal(columnResult.Length, verify.Count()); 466Assert.Equal(columnResult.Length, verify.Count()); 479Assert.Equal(columnResult.Length, verify.Count()); 492Assert.Equal(columnResult.Length, verify.Count()); 505Assert.Equal(columnResult.Length, verify.Count()); 518Assert.Equal(columnResult.Length, verify.Count()); 531Assert.Equal(columnResult.Length, verify.Count()); 544Assert.Equal(columnResult.Length, verify.Count()); 557Assert.Equal(columnResult.Length, verify.Count()); 570Assert.Equal(columnResult.Length, verify.Count()); 582Assert.Equal(columnResult.Length, verify.Count()); 594Assert.Equal(columnResult.Length, verify.Count()); 606Assert.Equal(columnResult.Length, verify.Count()); 618Assert.Equal(columnResult.Length, verify.Count()); 630Assert.Equal(columnResult.Length, verify.Count()); 642Assert.Equal(columnResult.Length, verify.Count()); 654Assert.Equal(columnResult.Length, verify.Count()); 666Assert.Equal(columnResult.Length, verify.Count()); 678Assert.Equal(columnResult.Length, verify.Count()); 690Assert.Equal(columnResult.Length, verify.Count()); 702Assert.Equal(columnResult.Length, verify.Count()); 714Assert.Equal(columnResult.Length, verify.Count()); 726Assert.Equal(columnResult.Length, verify.Count()); 738Assert.Equal(columnResult.Length, verify.Count()); 750Assert.Equal(columnResult.Length, verify.Count()); 762Assert.Equal(columnResult.Length, verify.Count()); 774Assert.Equal(columnResult.Length, verify.Count()); 786Assert.Equal(columnResult.Length, verify.Count()); 798Assert.Equal(columnResult.Length, verify.Count()); 810Assert.Equal(columnResult.Length, verify.Count()); 822Assert.Equal(columnResult.Length, verify.Count()); 834Assert.Equal(columnResult.Length, verify.Count()); 847Assert.Equal(columnResult.Length, verify.Count()); 860Assert.Equal(columnResult.Length, verify.Count()); 873Assert.Equal(columnResult.Length, verify.Count()); 886Assert.Equal(columnResult.Length, verify.Count()); 899Assert.Equal(columnResult.Length, verify.Count()); 912Assert.Equal(columnResult.Length, verify.Count()); 925Assert.Equal(columnResult.Length, verify.Count()); 938Assert.Equal(columnResult.Length, verify.Count()); 951Assert.Equal(columnResult.Length, verify.Count()); 964Assert.Equal(columnResult.Length, verify.Count()); 977Assert.Equal(columnResult.Length, verify.Count()); 989Assert.Equal(columnResult.Length, verify.Count()); 1001Assert.Equal(columnResult.Length, verify.Count()); 1013Assert.Equal(columnResult.Length, verify.Count()); 1025Assert.Equal(columnResult.Length, verify.Count()); 1037Assert.Equal(columnResult.Length, verify.Count()); 1049Assert.Equal(columnResult.Length, verify.Count()); 1061Assert.Equal(columnResult.Length, verify.Count()); 1073Assert.Equal(columnResult.Length, verify.Count()); 1085Assert.Equal(columnResult.Length, verify.Count()); 1097Assert.Equal(columnResult.Length, verify.Count()); 1109Assert.Equal(columnResult.Length, verify.Count()); 1121Assert.Equal(columnResult.Length, verify.Count()); 1133Assert.Equal(columnResult.Length, verify.Count()); 1145Assert.Equal(columnResult.Length, verify.Count()); 1157Assert.Equal(columnResult.Length, verify.Count()); 1169Assert.Equal(columnResult.Length, verify.Count()); 1181Assert.Equal(columnResult.Length, verify.Count()); 1193Assert.Equal(columnResult.Length, verify.Count()); 1205Assert.Equal(columnResult.Length, verify.Count()); 1217Assert.Equal(columnResult.Length, verify.Count()); 1229Assert.Equal(columnResult.Length, verify.Count()); 1241Assert.Equal(columnResult.Length, verify.Count()); 1254Assert.Equal(columnResult.Length, verify.Count()); 1267Assert.Equal(columnResult.Length, verify.Count()); 1280Assert.Equal(columnResult.Length, verify.Count()); 1293Assert.Equal(columnResult.Length, verify.Count()); 1306Assert.Equal(columnResult.Length, verify.Count()); 1319Assert.Equal(columnResult.Length, verify.Count()); 1332Assert.Equal(columnResult.Length, verify.Count()); 1345Assert.Equal(columnResult.Length, verify.Count()); 1358Assert.Equal(columnResult.Length, verify.Count()); 1371Assert.Equal(columnResult.Length, verify.Count()); 1384Assert.Equal(columnResult.Length, verify.Count()); 1396Assert.Equal(columnResult.Length, verify.Count()); 1408Assert.Equal(columnResult.Length, verify.Count()); 1420Assert.Equal(columnResult.Length, verify.Count()); 1432Assert.Equal(columnResult.Length, verify.Count()); 1444Assert.Equal(columnResult.Length, verify.Count()); 1456Assert.Equal(columnResult.Length, verify.Count()); 1468Assert.Equal(columnResult.Length, verify.Count()); 1480Assert.Equal(columnResult.Length, verify.Count()); 1492Assert.Equal(columnResult.Length, verify.Count()); 1504Assert.Equal(columnResult.Length, verify.Count()); 1516Assert.Equal(columnResult.Length, verify.Count()); 1528Assert.Equal(columnResult.Length, verify.Count()); 1540Assert.Equal(columnResult.Length, verify.Count()); 1552Assert.Equal(columnResult.Length, verify.Count()); 1564Assert.Equal(columnResult.Length, verify.Count()); 1576Assert.Equal(columnResult.Length, verify.Count()); 1588Assert.Equal(columnResult.Length, verify.Count()); 1600Assert.Equal(columnResult.Length, verify.Count()); 1612Assert.Equal(columnResult.Length, verify.Count()); 1624Assert.Equal(columnResult.Length, verify.Count()); 1636Assert.Equal(columnResult.Length, verify.Count()); 1648Assert.Equal(columnResult.Length, verify.Count()); 1661Assert.Equal(columnResult.Length, verify.Count()); 1674Assert.Equal(columnResult.Length, verify.Count()); 1687Assert.Equal(columnResult.Length, verify.Count()); 1700Assert.Equal(columnResult.Length, verify.Count()); 1713Assert.Equal(columnResult.Length, verify.Count()); 1726Assert.Equal(columnResult.Length, verify.Count()); 1739Assert.Equal(columnResult.Length, verify.Count()); 1752Assert.Equal(columnResult.Length, verify.Count()); 1765Assert.Equal(columnResult.Length, verify.Count()); 1778Assert.Equal(columnResult.Length, verify.Count()); 1791Assert.Equal(columnResult.Length, verify.Count()); 1803Assert.Equal(columnResult.Length, verify.Count()); 1815Assert.Equal(columnResult.Length, verify.Count()); 1827Assert.Equal(columnResult.Length, verify.Count()); 1839Assert.Equal(columnResult.Length, verify.Count()); 1851Assert.Equal(columnResult.Length, verify.Count()); 1863Assert.Equal(columnResult.Length, verify.Count()); 1875Assert.Equal(columnResult.Length, verify.Count()); 1887Assert.Equal(columnResult.Length, verify.Count()); 1899Assert.Equal(columnResult.Length, verify.Count()); 1911Assert.Equal(columnResult.Length, verify.Count()); 1923Assert.Equal(columnResult.Length, verify.Count()); 1935Assert.Equal(columnResult.Length, verify.Count()); 1947Assert.Equal(columnResult.Length, verify.Count()); 1959Assert.Equal(columnResult.Length, verify.Count()); 1971Assert.Equal(columnResult.Length, verify.Count()); 1983Assert.Equal(columnResult.Length, verify.Count()); 1995Assert.Equal(columnResult.Length, verify.Count()); 2007Assert.Equal(columnResult.Length, verify.Count()); 2019Assert.Equal(columnResult.Length, verify.Count()); 2031Assert.Equal(columnResult.Length, verify.Count()); 2043Assert.Equal(columnResult.Length, verify.Count()); 2055Assert.Equal(columnResult.Length, verify.Count()); 2068Assert.Equal(columnResult.Length, verify.Count()); 2083Assert.Equal(columnResult.Length, verify.Count()); 2098Assert.Equal(columnResult.Length, verify.Count()); 2113Assert.Equal(columnResult.Length, verify.Count()); 2128Assert.Equal(columnResult.Length, verify.Count()); 2143Assert.Equal(columnResult.Length, verify.Count()); 2158Assert.Equal(columnResult.Length, verify.Count()); 2173Assert.Equal(columnResult.Length, verify.Count()); 2188Assert.Equal(columnResult.Length, verify.Count()); 2203Assert.Equal(columnResult.Length, verify.Count()); 2218Assert.Equal(columnResult.Length, verify.Count()); 2232Assert.Equal(columnResult.Length, verify.Count()); 2244Assert.Equal(columnResult.Length, verify.Count()); 2256Assert.Equal(columnResult.Length, verify.Count()); 2268Assert.Equal(columnResult.Length, verify.Count()); 2280Assert.Equal(columnResult.Length, verify.Count()); 2292Assert.Equal(columnResult.Length, verify.Count()); 2304Assert.Equal(columnResult.Length, verify.Count()); 2316Assert.Equal(columnResult.Length, verify.Count()); 2328Assert.Equal(columnResult.Length, verify.Count()); 2340Assert.Equal(columnResult.Length, verify.Count()); 2352Assert.Equal(columnResult.Length, verify.Count()); 2365Assert.Equal(columnResult.Length, verify.Count()); 2380Assert.Equal(columnResult.Length, verify.Count()); 2395Assert.Equal(columnResult.Length, verify.Count()); 2410Assert.Equal(columnResult.Length, verify.Count()); 2425Assert.Equal(columnResult.Length, verify.Count()); 2440Assert.Equal(columnResult.Length, verify.Count()); 2455Assert.Equal(columnResult.Length, verify.Count()); 2470Assert.Equal(columnResult.Length, verify.Count()); 2485Assert.Equal(columnResult.Length, verify.Count()); 2500Assert.Equal(columnResult.Length, verify.Count()); 2515Assert.Equal(columnResult.Length, verify.Count()); 2529Assert.Equal(columnResult.Length, verify.Count()); 2541Assert.Equal(columnResult.Length, verify.Count()); 2553Assert.Equal(columnResult.Length, verify.Count()); 2565Assert.Equal(columnResult.Length, verify.Count()); 2577Assert.Equal(columnResult.Length, verify.Count()); 2589Assert.Equal(columnResult.Length, verify.Count()); 2601Assert.Equal(columnResult.Length, verify.Count()); 2613Assert.Equal(columnResult.Length, verify.Count()); 2625Assert.Equal(columnResult.Length, verify.Count()); 2637Assert.Equal(columnResult.Length, verify.Count()); 2649Assert.Equal(columnResult.Length, verify.Count());
DataFrameGroupByTests.cs (5)
32Assert.Equal(2, grouping.Count()); 37Assert.Equal(length / 2, oddGroup.Count()); 41Assert.Equal(length / 2 + length % 2, evenGroup.Count()); 79Assert.Equal(10, groupings[i].Count()); 94Assert.Equal(length % 10, groupings[length / 10].Count());
Microsoft.DotNet.Arcade.Sdk (1)
src\DownloadFile.cs (1)
66if (string.IsNullOrWhiteSpace(Uri) && (Uris == null || Uris.Count() == 0)) {
Microsoft.DotNet.Build.Tasks.Feed.Tests (7)
PublishToSymbolServerTest.cs (3)
170Assert.Equal(2, buildEngine.BuildMessageEvents.Where(x => x.Message.Contains("Adding directory")).Count()); 173Assert.Equal(symbolPackages.Keys.Count, buildEngine.BuildMessageEvents.Where(x => x.Message.Contains($"Extracting symbol package")).Count()); 174Assert.Equal(symbolPackages.Keys.Count, buildEngine.BuildMessageEvents.Where(x => x.Message.Contains($"Adding package")).Count());
SetupTargetFeedConfigV3Tests.cs (4)
414if (expectedItems.Count() != actualItems.Count()) 416Output.WriteLine($"The expected items list has {expectedItems.Count()} item(s) but the list of actual items has {actualItems.Count()}.");
Microsoft.DotNet.Build.Tasks.Installers (3)
src\CreateWixCommandPackageDropBase.cs (2)
246if (iels != null && iels.Count() > 0) 252if (fields == null || fields.Count() == 0)
src\GenerateJsonObjectString.cs (1)
59if (group.Count() == 1)
Microsoft.DotNet.Build.Tasks.Packaging (2)
Extensions.cs (1)
164if (value == null || value.Count() == 0)
ValidatePackage.cs (1)
269if (referenceAssemblies.Count() > 1)
Microsoft.DotNet.Deployment.Tasks.Links (6)
Microsoft.DotNet.GenFacades (3)
GenPartialFacadeSourceGenerator.cs (3)
40if (distinctSeeds.Count() != seedNames.Distinct(StringComparer.InvariantCultureIgnoreCase).Count()) 43.Where(g => g.Count() > 1)
Microsoft.DotNet.Helix.Sdk (3)
CancelHelixJob.cs (2)
28Log.LogMessage($"Attempting to cancel {Jobs.Count()} Helix jobs"); 78Log.LogMessage(MessageImportance.High, $"Successfully cancelled {Jobs.Count()} Helix jobs");
WaitForHelixJobCompletion.cs (1)
57if (jd.Errors.Count() > 0)
Microsoft.DotNet.Helix.Sdk.Tests (2)
InstallDotNetToolTests.cs (2)
309It.Is<IEnumerable<string>>(args => args.Count() == _expectedArgs.Count() && args.All(y => _expectedArgs.Contains(y)))),
Microsoft.DotNet.NuGetRepack.Tests (2)
TestHelpers\AssertEx.cs (2)
261var result = expected.Count() == actual.Count() && expectedSet.SetEquals(actual);
Microsoft.DotNet.SignCheck (3)
SignCheck.cs (3)
140if (Options.FileStatus.Count() > 0) 342((result.NestedResults.Count() > 0) && (Options.Recursive)) || 396if (InputFiles != null && InputFiles.Count() > 0)
Microsoft.DotNet.SignCheckLibrary (7)
Verification\Exclusions.cs (1)
124return (doNotSignExclusions.Count() > 0) && (IsExcluded(path, parent, virtualPath, containerPath, doNotSignExclusions));
Verification\Jar\JarError.cs (1)
25return _errors.Count() > 0;
Verification\Jar\JarFile.cs (1)
145if (signatureFilesFailedVerifyDigestManifest.Count() > 0)
Verification\Jar\JarSignatureFile.cs (1)
106if (ManifestHashDigestAttributes.Count() > 0)
Verification\VsixVerifier.cs (2)
136if (signatureManager.Signatures.Count() != 1) 141if (signatureManager.Signatures[0].SignedParts.Count != vsixPackage.GetParts().Count() - 1)
Verification\XmlVerifier.cs (1)
58if (signedXml.Signature.KeyInfo.OfType<KeyInfoX509Data>().Count() == 0)
Microsoft.DotNet.SignTool (3)
src\BatchSignUtil.cs (1)
224repackCount = repackList.Count();
src\Configuration.cs (1)
725string extractPathRoot = _useHashInExtractionPath ? fileUniqueKey.StringHash : _filesByContentKey.Count().ToString();
src\SignToolTask.cs (1)
189if (!AllowEmptySignList && ItemsToSign.Count() == 0)
Microsoft.DotNet.SignTool.Tests (3)
FakeBuildEngine.cs (2)
46if (itemGroupNode.Count() == 0) 51else if (itemGroupNode.Count() > 1)
SignToolTests.cs (1)
349actualXmlElementsPerSigningRound.Count().Should().Be(expectedXmlElementsPerSigningRound.Length);
Microsoft.DotNet.SourceBuild.Tasks (1)
src\WriteBuildOutputProps.cs (1)
69.Where(dir => Directory.GetDirectories(dir).Count() > 0)
Microsoft.DotNet.VersionTools (17)
Automation\DependencyUpdateResults.cs (1)
32if (UsedInfos.Count() > 1)
Automation\PullRequestCreator.cs (1)
195.Select(g => $"{g.Count()}{g.Key}")
BuildManifest\BuildManifestClient.cs (1)
278if (remainingSemaphores.Length == joinGroup.ParallelSemaphorePaths.Count())
BuildManifest\Model\BlobArtifactModel.cs (2)
57if (Attributes.Count() != other.Attributes.Count())
BuildManifest\Model\PackageArtifactModel.cs (2)
75if (Attributes.Count() != other.Attributes.Count())
BuildManifest\Model\SigningInformationParsingExtensions.cs (8)
55var conflicts = extensionToCertMapping.Where(kv => kv.Value.Count() > 1); 57if (conflicts.Count() > 0) 113var conflicts = keyToCertMapping.Where(kv => kv.Value.Count() > 1); 115if (conflicts.Count() > 0) 171var conflicts = extensionToCertMapping.Where(kv => kv.Value.Count() > 1); 173if (conflicts.Count() > 0) 218var conflicts = pktMapping.Where(kv => kv.Value.Count() > 1); 220if (conflicts.Count() > 0)
BuildManifest\Model\XElementParsingExtensions.cs (1)
35.OrderBy(pair => keySortOrder.TakeWhile(o => pair.Key != o).Count())
Dependencies\Submodule\LatestCommitSubmoduleUpdater.cs (1)
53int allSubmoduleInfoCount = dependencyInfos.OfType<SubmoduleDependencyInfo>().Count();
Microsoft.DotNet.XUnitExtensions (5)
DiscovererHelpers.cs (1)
67Debug.Assert(ctorArgs.Count() >= 2);
Discoverers\ConditionalClassDiscoverer.cs (1)
39Debug.Assert(conditionArguments.Count() == 2);
Discoverers\ConditionalTestDiscoverer.cs (2)
29List<string> falseConditions = new List<string>(conditionMemberNames.Count()); 174if (conditionMemberNames == null || conditionMemberNames.Count() == 0) return true;
Discoverers\OuterLoopTestsDiscoverer.cs (1)
25if (ctorArgs.Count() < 2)
Microsoft.Extensions.Diagnostics.Probes.Tests (3)
KubernetesProbesExtensionsTests.cs (3)
39Assert.Equal(3, hostedServices.Count()); 83Assert.Equal(3, hostedServices.Count()); 111Assert.Equal(3, hostedServices.Count());
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (1)
ResourceMonitoringBuilderTests.cs (1)
50Assert.Equal(2, publishersArray.Count());
Microsoft.Extensions.Features (1)
FeatureCollection.cs (1)
144private int GetCount() => this.Count();
Microsoft.Extensions.FileProviders.Embedded (1)
Manifest\ManifestParser.cs (1)
141element.Nodes().Count() == 1 &&
Microsoft.Extensions.FileSystemGlobbing (1)
InMemoryDirectoryInfo.cs (1)
48var fileList = new List<string>(files.Count());
Microsoft.Extensions.Http.Resilience.Tests (2)
Hedging\HedgingTests.cs (1)
178Assert.Equal(2, Requests.Distinct().Count());
Resilience\HttpStandardResilienceOptionsCustomValidatorTests.cs (1)
33Assert.Equal(2, validationResult.Failures.Count());
Microsoft.Extensions.Identity.Core (1)
PasswordValidator.cs (1)
71if (options.RequiredUniqueChars >= 1 && password.Distinct().Count() < options.RequiredUniqueChars)
Microsoft.Interop.ComInterfaceGenerator (1)
ComInterfaceGenerator.cs (1)
608LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(interfaceMethods.InheritedMethods.Count() + 3))))))));
Microsoft.Maui.Controls (2)
View\View.cs (1)
275 if (gesture is PinchGestureRecognizer && _gestureRecognizers.GetGesturesFor<PinchGestureRecognizer>().Count() > 1)
VisualStateManager.cs (1)
488 if (existCustomTriggers.Count() > 1)
Microsoft.Maui.Resizetizer (1)
GenerateTizenManifest.cs (1)
176 if (splashElements.Count() == 0)
Microsoft.ML.AutoML (45)
API\AutoCatalog.cs (11)
646Contracts.Check(outputColumnNames.Count() == inputColumnNames.Count() && outputColumnNames.Count() > 0, "outputColumnNames and inputColumnNames must have the same length and greater than 0"); 667Contracts.Check(outputColumnNames.Count() == inputColumnNames.Count() && outputColumnNames.Count() > 0, "outputColumnNames and inputColumnNames must have the same length and greater than 0"); 686Contracts.Check(outputColumnNames.Count() == inputColumnNames.Count() && outputColumnNames.Count() > 0, "outputColumnNames and inputColumnNames must have the same length and greater than 0"); 758Contracts.Assert(overallColumns.Count() == overallColumns.Distinct().Count(), "detect overlapping among catalogColumns, numericColumns, textColumns and excludedColumns");
AutoMLExperiment\ITrialResultManager.cs (1)
190_channel?.Trace($"load trial history from {filePath} successfully with {res.Count()} pieces of data");
ColumnInference\ColumnGroupingInference.cs (1)
74string name = (hasHeader && g.Count() == 1)
ColumnInference\ColumnTypeInference.cs (2)
385if (args.LabelColumnIndex >= cols.Count()) 387throw new ArgumentOutOfRangeException(nameof(args.LabelColumnIndex), $"Label column index ({args.LabelColumnIndex}) is >= than # of inferred columns ({cols.Count()}).");
ColumnInference\PurposeInference.cs (1)
155else if (cardinalityRatio >= 0.85 && (avgLength > 30 || avgSpaces >= 1 || columns.Count() == 1))
ColumnInference\TextFileContents.cs (2)
110var mostCommon = columnCounts.GroupBy(x => x).OrderByDescending(x => x.Count()).First(); 111if (mostCommon.Count() < UniformColumnCountThreshold * columnCounts.Count)
Experiment\Experiment.cs (2)
74_experimentSettings.MaxExperimentTimeInSeconds, _history.Count()); 189if (_history.Count() == 3 && _history.All(r => !r.RunSucceeded))
Experiment\Runners\CrossValRunner.cs (1)
73if (newScores.Count() == 0)
Experiment\Runners\CrossValSummaryRunner.cs (3)
175double[] arr = new double[results.ElementAt(0).Count()]; 187if (newResults.Count() == 0) 213for (var i = 0; i < values.Count(); i++)
PipelineSuggesters\PipelineSuggester.cs (7)
44if (history.Count() < availableTrainers.Count()) 98history = history.Take(availableTrainers.Count()).Where(x => x.RunSucceeded); 116.OrderBy(x => x.Count()) 127var trainer = availableTrainers.ElementAt(history.Count()); 133var results = new IValueGenerator[hps.Count()]; 135for (int i = 0; i < hps.Count(); i++)
SweepableEstimator\MultiModelPipeline.cs (1)
197var count = estimators.Count();
SweepableEstimator\SweepableEstimatorPipeline.cs (1)
80for (int i = 0; i != _estimators.Count(); ++i)
SweepableEstimator\SweepablePipeline.cs (1)
257var count = estimators.Count();
Sweepers\SmacSweeper.cs (3)
88int numRuns = previousRuns == null ? 0 : previousRuns.Count(); 109Single[] targets = new Single[previousRuns.Count()]; 110Single[][] features = new Single[previousRuns.Count()][];
TransformInference\TransformInference.cs (2)
308if (newColumns.Count() > 0) 463if (concatColNames.Count() == 1 &&
Tuner\SmacTuner.cs (2)
122Single[] losses = new Single[history.Count()]; 123Single[][] features = new Single[history.Count()][];
Utils\BestResultUtil.cs (2)
127for (var i = 0; i < scores.Count(); i++) 142for (var i = 0; i < scores.Count(); i++)
Utils\UserInputValidationUtil.cs (2)
271if (allowedTypes.Count() == 1) 304return groups.FirstOrDefault(g => g.Count() > 1)?.Key;
Microsoft.ML.AutoML.Samples (5)
AutoFit\BinaryClassificationExperiment.cs (1)
32Console.WriteLine($"Total models produced: {experimentResult.RunDetails.Count()}");
AutoFit\MulticlassClassificationExperiment.cs (1)
33Console.WriteLine($"Total models produced: {experimentResult.RunDetails.Count()}");
AutoFit\RankingExperiment.cs (1)
41Console.WriteLine($"Total models produced: {experimentResult.RunDetails.Count()}");
AutoFit\RecommendationExperiment.cs (1)
45Console.WriteLine($"Total models produced: {experimentResult.RunDetails.Count()}");
AutoFit\RegressionExperiment.cs (1)
33Console.WriteLine($"Total models produced: {experimentResult.RunDetails.Count()}");
Microsoft.ML.AutoML.Tests (29)
AutoFitTests.cs (4)
457Assert.True(experimentResults[i].RunDetails.Count() > 0); 501Assert.True(experimentResults[i].RunDetails.Count() > 0); 541Assert.True(experimentResult.RunDetails.Count() > 1); 660if (experiment.RunDetails.Select(r => r.Exception == null).Count() > 1 && experiment.RunDetails.Last().Exception != null)
ColumnInferenceTests.cs (6)
40Assert.True(columnInferenceWithGrouping.TextLoaderOptions.Columns.Count() < columnInferenceWithoutGrouping.TextLoaderOptions.Columns.Count()); 90Assert.Equal(2, result.TextLoaderOptions.Columns.Count()); 117Assert.Equal(6, result.TextLoaderOptions.Columns.Count()); 137Assert.Equal(2, result.TextLoaderOptions.Columns.Count()); 167Assert.Equal(3, result.ColumnInformation.NumericColumnNames.Count());
ColumnInformationUtilTests.cs (1)
65Assert.Equal(8, columnNames.Count());
GridSearchTunerTests.cs (1)
55parameters.Distinct().Count().Should().Be(steps);
MLContextManagerTests.cs (1)
63messages.Count().Should().Be(4);
SplitUtilTests.cs (5)
53Assert.True(splits.trainDatasets.Count() < requestedNumSplits); 54Assert.Equal(splits.trainDatasets.Count(), splits.validationDatasets.Count()); 72Assert.Equal(requestedNumSplits, splits.trainDatasets.Count()); 73Assert.Equal(requestedNumSplits, splits.validationDatasets.Count());
TrainerExtensionsTests.cs (5)
359Assert.Equal(publicNames.Distinct().Count(), internalNames.Distinct().Count()); 367Assert.Equal(publicNames.Distinct().Count(), internalNames.Distinct().Count()); 375Assert.Equal(publicNames.Distinct().Count(), internalNames.Distinct().Count()); 383Assert.Equal(publicNames.Distinct().Count(), internalNames.Distinct().Count()); 391Assert.Equal(publicNames.Distinct().Count(), internalNames.Distinct().Count());
TrialResultManagerTest.cs (4)
57csvTrialResultManager.GetAllTrialResults().Count().Should().Be(0); 64csvTrialResultManager.GetAllTrialResults().Count().Should().Be(10); 71csvTrialResultManager.GetAllTrialResults().Count().Should().Be(10); 78csvTrialResultManager.GetAllTrialResults().Count().Should().Be(10);
Util.cs (2)
28var editor = VBufferEditor.Create(ref dst, colNames.Count()); 29for (int i = 0; i < colNames.Count(); i++)
Microsoft.ML.CodeGenerator (23)
CodeGenerator\CSharp\TransformGenerators.cs (22)
23string inputColumn = InputColumns.Count() > 0 ? InputColumns[0] : "\"Features\""; 24string outputColumn = OutputColumns.Count() > 0 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} are null"); 81string inputColumn = InputColumns.Count() > 0 ? InputColumns[0] : "\"Features\""; 82string outputColumn = OutputColumns.Count() > 0 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} are null"); 111string inputColumn = InputColumns.Count() > 0 ? InputColumns[0] : "\"Features\""; 112string outputColumn = OutputColumns.Count() > 0 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} are null"); 134string inputColumn = InputColumns.Count() > 0 ? InputColumns[0] : "\"Features\""; 135string outputColumn = OutputColumns.Count() > 0 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} are null"); 157string inputColumn = InputColumns.Count() > 0 ? InputColumns[0] : "\"Features\""; 158string outputColumn = OutputColumns.Count() > 0 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} are null"); 182string inputColumn = InputColumns.Count() > 0 ? InputColumns[0] : "\"Features\""; 183string outputColumn = OutputColumns.Count() > 0 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} are null"); 286string inputColumn = InputColumns.Count() > 0 ? InputColumns[0] : "\"Features\""; 287string outputColumn = OutputColumns.Count() > 0 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} are null"); 344string inputColumn = InputColumns.Count() > 0 ? InputColumns[0] : "\"Features\""; 345string outputColumn = OutputColumns.Count() > 0 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} are null"); 366string inputColumn = InputColumns.Count() == 1 ? InputColumns[0] : throw new Exception($"input columns for the suggested transform: {MethodName} is not exactly one."); 367string outputColumn = OutputColumns.Count() == 1 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} it not exactly one."); 384string inputColumn = InputColumns.Count() == 1 ? InputColumns[0] : throw new Exception($"input columns for the suggested transform: {MethodName} is not exactly one."); 385string outputColumn = OutputColumns.Count() == 1 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} it not exactly one."); 421string inputColumn = InputColumns.Count() == 1 ? InputColumns[0] : throw new Exception($"input columns for the suggested transform: {MethodName} is not exactly one."); 422string outputColumn = OutputColumns.Count() == 1 ? OutputColumns[0] : throw new Exception($"output columns for the suggested transform: {MethodName} it not exactly one.");
Utils.cs (1)
74for (int i = 0; i < featureColumns.Count(); i++)
Microsoft.ML.CodeGenerator.Tests (1)
UtilTest.cs (1)
198for (int i = 0; i != expectedStrArray.Count(); ++i)
Microsoft.ML.Core (4)
CommandLine\CmdParser.cs (1)
1206Contracts.Assert(Args.Where(a => a.Index == argument.Index).Count() == 1);
Data\IEstimator.cs (1)
24public int Count => _columns.Count();
SearchSpace\ChoiceAttribute.cs (2)
23Contract.Assert(candidatesType.Count() == 1, "multiple candidates type detected"); 34Contract.Assert(candidatesType.Count() == 1, "multiple candidates type detected");
Microsoft.ML.Data (19)
Data\DataViewTypeManager.cs (6)
61if (typeAttributes.Count() > 1) 66else if (typeAttributes.Count() == 1) 96if (typeAttributes.Count() > 1) 101else if (typeAttributes.Count() == 1) 150if (typeAttributes.Count() > 1) 154else if (typeAttributes.Count() == 1)
Data\SchemaDefinition.cs (2)
392if (customTypeAttributes.Count() > 1) 395else if (customTypeAttributes.Count() == 1)
Prediction\Calibrator.cs (2)
678if (dependingColumns.Count() > 0) 691var predictorRow = _predictor.GetRow(input, activeColumns.Count() > 0 ? OutputSchema : Enumerable.Empty<DataViewSchema.Column>());
Scorers\FeatureContributionCalculation.cs (1)
358if (dependingColumns.Count() == 0)
Scorers\SchemaBindablePredictorWrapper.cs (2)
222if (!InputRoleMappedSchema.Feature.HasValue || dependingColumns.Count() == 0) 542if (dependingColumns.Count() == 0 || !InputRoleMappedSchema.Feature.HasValue)
Transforms\ColumnSelecting.cs (1)
465return missing.Count() == 0;
Transforms\SlotsDroppingTransformer.cs (2)
904if (slots.Count() > 0) 907var slotsVar = ctx.AddInitializer(slots, new long[] { 1, slots.Count() }, "PreservedSlots");
Transforms\ValueMapping.cs (3)
320uint[] indices = new uint[values.Count()]; 323for (int i = 0; i < values.Count(); ++i) 336dataViewBuilder.AddColumn(valueColumnName, GetKeyValueGetter(metaKeys), (ulong)metaKeys.Count(), indices);
Microsoft.ML.Ensemble (1)
PipelineEnsemble.cs (1)
97if (dependingColumns.Count() == 0)
Microsoft.ML.Fairlearn (7)
Metrics\FairlearnMetricCatalog.cs (6)
81Contracts.Assert(truths.Count() == predicted.Count()); 82Contracts.Assert(truths.Count() == scores.Count()); 83Contracts.Assert(GroupIds.Count() == truths.Count());
Reductions\UtilityParity.cs (1)
150long dataSetLength = Tags.Rows.Count();
Microsoft.ML.FastTree (2)
FastTree.cs (1)
684else if (FastTreeTrainerOptions.BaggingSize > 0 && Ensemble.Trees.Count() > 0)
TreeEnsembleFeaturizer.cs (1)
367if (dependingColumns.Count() == 0)
Microsoft.ML.GenAI.Core (9)
Extension\ModuleExtension.cs (1)
31if (stateDict.Count() == 0)
Pipeline\CausalLMPipeline.cs (1)
268stopTokenIds = stopTokenIds.Where(ids => ids.Count() > 0).ToList();
Trainer\CausalLMDataset.cs (7)
32if (inputs.Count() != outputs.Count()) 53if (inputs.Count() != outputs.Count()) 62outputIds = outputIds.Skip(inputIds.Count()).ToArray(); 73if (inputIds.Count() != labelIds.Count())
Microsoft.ML.GenAI.Core.Tests (1)
CasualLMDatasetTest.cs (1)
70dataset.Count().Should().Be(10);
Microsoft.ML.GenAI.Mistral (3)
Mistral_7B_0_3ChatTemplateBuilder.cs (3)
30if (messages.Where(m => m.GetRole() == Role.System).Count() > 1) 115if (toolCalls.Count() == 0) 138if (toolCallResults.Count() == 0)
Microsoft.ML.GenAI.Phi.Tests (2)
SemanticKernelTests.cs (2)
47responses.Count().Should().Be(1); 50response.Items.Count().Should().Be(1);
Microsoft.ML.IntegrationTests (4)
Common.cs (4)
106Assert.Equal(schema1.Count(), schema2.Count()); 129Assert.Equal(data1.Count(), data2.Count());
Microsoft.ML.OnnxConverter (13)
OnnxContextImpl.cs (7)
347_host.Check(dims.Aggregate((x, y) => x * y) == values.Count(), "Number of elements doesn't match tensor size"); 358_host.Check(dims.Aggregate((x, y) => x * y) == values.Count(), "Number of elements doesn't match tensor size"); 369_host.Check(dims.Aggregate((x, y) => x * y) == values.Count(), "Number of elements doesn't match tensor size"); 380_host.Check(dims.Aggregate((x, y) => x * y) == values.Count(), "Number of elements doesn't match tensor size"); 391_host.Check(dims.Aggregate((x, y) => x * y) == values.Count(), "Number of elements doesn't match tensor size"); 402_host.Check(dims.Aggregate((x, y) => x * y) == values.Count(), "Number of elements doesn't match tensor size"); 413_host.Check(dims.Aggregate((x, y) => x * y) == values.Count(), "Number of elements doesn't match tensor size");
OnnxUtils.cs (6)
409tensor.Dims.Add(values.Count()); 433tensor.Dims.Add(values.Count()); 457tensor.Dims.Add(values.Count()); 481tensor.Dims.Add(values.Count()); 505tensor.Dims.Add(values.Count()); 529tensor.Dims.Add(values.Count());
Microsoft.ML.OnnxTransformer (8)
OnnxTransform.cs (5)
289Inputs = (options.InputColumns.Count() == 0) ? Model.ModelInfo.InputNames.ToArray() : options.InputColumns; 290Outputs = (options.OutputColumns.Count() == 0) ? Model.ModelInfo.OutputNames.ToArray() : options.OutputColumns; 525if (inputShape.Where(x => x == 0).Count() > 1) 594int count = slotsAttr.Strings.Count(); 1065if (Transformer.Model.ModelInfo.InputsInfo[i].Shape.Where(x => x == 0).Count() > 1)
OnnxTypeParser.cs (1)
237else if (shape.Count() != 0 && shape.Aggregate((x, y) => x * y) > 0)
OnnxUtils.cs (2)
366if (left.Count() != right.Count())
Microsoft.ML.OnnxTransformerTest (9)
OnnxTransformTests.cs (9)
710Assert.Equal(3, dictionary.Count()); 725Assert.Equal(3, dictionary.Count()); 763Assert.Equal(3, dictionary.Count()); 778Assert.Equal(3, dictionary.Count()); 866for (int i = 0; i < dataPoints.Count(); ++i) 868Assert.Equal(dataPoints[i].Input.Count(), transformedDataPoints[i].Output.Count()); 933Assert.Equal(dataPoints.Count(), transformedDataPoints.Count); 1097Assert.Equal(dataPoints.Count(), transformedDataPoints.Count);
Microsoft.ML.Parquet (8)
PartitionedFileLoader.cs (3)
703segments = segments.Skip(segments.Count() - dirCount - 1); 705if (segments.Count() < dirCount - 1) 776return PartitionedPathUtils.SplitDirectories(path).Count() - 1;
PartitionedPathParser.cs (5)
179if (col.Source < 0 || col.Source >= values.Count()) 193return dirs.Take(dirs.Count() - 1); // Ignore last directory which is the file name. 340dirs = dirs.Take(dirs.Count() - 1); // Ignore last directory which is the file name. 342names = new List<string>(dirs.Count()); 343values = new List<string>(dirs.Count());
Microsoft.ML.Recommender (1)
MatrixFactorizationPredictor.cs (1)
367if (dependingColumns.Count() == 0)
Microsoft.ML.SearchSpace (6)
Option\ChoiceOption.cs (1)
30Contract.Assert(distinctChoices.Count() == choices.Length, "choices must not contain repeated values");
SearchSpace.cs (4)
206Contract.Assert(attributes.Count() <= 1, $"{field.Name} can only define one of the choice|range|option attribute"); 207if (attributes.Count() == 0) 253Contract.Assert(attributes.Count() <= 1, $"{property.Name} can only define one of the choice|range|option attribute"); 254if (attributes.Count() == 0)
Tuner\GridSearchTuner.cs (1)
33if (arrays.Count() == 1)
Microsoft.ML.StandardTrainers (1)
FactorizationMachine\FieldAwareFactorizationMachineUtils.cs (1)
145if (columns.Count() == 0)
Microsoft.ML.Sweeper (3)
Algorithms\SmacSweeper.cs (3)
93int numRuns = previousRuns == null ? 0 : previousRuns.Count(); 114Single[] targets = new Single[previousRuns.Count()]; 115Single[][] features = new Single[previousRuns.Count()][];
Microsoft.ML.TensorFlow.Tests (1)
TensorflowTests.cs (1)
1123Assert.Equal(2, cross.Count());
Microsoft.ML.Tests (21)
DatabaseLoaderTests.cs (1)
262datetimes.Count().Should().Be(2);
ImagesTests.cs (1)
1196for (int i = 0; i < dataObjects.Count(); i++)
RangeFilterTests.cs (2)
28var cnt = data1.GetColumn<float>(data1.Schema["Floats"]).Count(); 33cnt = data2.GetColumn<float>(data.Schema["Floats"]).Count();
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (1)
361for (int i = 0; i < featureImportance.Count(); i++)
Scenarios\Api\TestApi.cs (5)
385Assert.True(Enumerable.Intersect(uniqueTrain, uniqueTest).Count() == 0); 398Assert.True(Enumerable.Intersect(uniqueSeedTrain, uniqueSeedTest).Count() == 0); 503Assert.True(Enumerable.Intersect(idsTest1, idsTest2).Count() == 0); 504Assert.True(idsTest1.Count() > 0, $"CV Split 0 for Column {colname} was empty"); 505Assert.True(idsTest2.Count() > 0, $"CV Split 1 for Column {colname} was empty");
TextLoaderTests.cs (3)
1341Assert.Equal(numRows, ids.Count()); 1342Assert.Equal(numRows, descriptions.Count()); 1343Assert.Equal(numRows, animals.Count());
TrainerEstimators\MatrixFactorizationTests.cs (1)
844for (int i = 0; i < predictions.Count(); ++i)
TrainerEstimators\TreeEstimators.cs (5)
829if (tree.GetCategoricalSplitFeaturesAt(nodeId).Count() > 0) 833if (tree.GetCategoricalCategoricalSplitFeatureRangeAt(nodeId).Count() > 0) 858if (tree.GetLeafSamplesAt(nodeId).Count() > 0) 862if (tree.GetLeafSampleWeightsAt(nodeId).Count() > 0) 881for (int i = 0; i < trees.Count(); i++)
Transformers\NormalizerTests.cs (2)
1081int numberCount = numbers.Count(); 1082int halfIndex = numbers.Count() / 2;
Microsoft.ML.TimeSeries (2)
RootCauseAnalyzer.cs (1)
282double meanGain = sumGain / aggDim.Count();
SequentialTransformerBase.cs (1)
604if (dependingColumns.Count() == 0)
Microsoft.ML.Tokenizers (4)
Model\BertTokenizer.cs (4)
429mask.AddRange(Enumerable.Repeat(0, tokenIds.Count())); 433mask.AddRange(Enumerable.Repeat(0, additionalTokenIds.Count())); 612int capacity = tokenIds.Count() + 2 + (additionalTokenIds is null ? 0 : additionalTokenIds.Count() + 1);
Microsoft.ML.TorchSharp (7)
AutoFormerV2\ObjectDetectionMetrics.cs (2)
120int gt = groundTruthBoxes.Where(k => k.Value != 0).Count(); 138int gt = groundTruthBoxes.Where(k => k.Value != 0).Count();
NasBert\NerTrainer.cs (2)
146long[,] targetArray = new long[targets.Count(), maxLength]; 148for (int i = 0; i < targets.Count(); i++)
Roberta\QATrainer.cs (1)
342if (inputTensors.Count() == 0)
TorchSharpBaseTrainer.cs (2)
251if (inputTensors.Count() == 0) 325if (inputTensors.Count() == 0)
Microsoft.ML.TorchSharp.Tests (4)
ObjectDetectionTests.cs (1)
102Assert.Equal(2, prev.RowView.Count());
TextClassificationTests.cs (3)
161Assert.Equal(8, a.Count()); 257Assert.Equal(8, transformedData.RowView.Count()); 340Assert.Equal(8, predictedLabel.Count());
Microsoft.ML.Transforms (4)
HashJoiningTransform.cs (3)
265Host.CheckDecode(slotMap[j].Distinct().Count() == slotMap[j].Length); 323Host.Assert(ex.SlotMap[i].Distinct().Count() == ex.SlotMap[i].Length); 363if (slots.Distinct().Count() < slots.Length)
UngroupTransform.cs (1)
114Host.CheckUserArg(options.Columns.Distinct().Count() == options.Columns.Length, nameof(options.Columns),
Microsoft.ML.Vision (2)
ImageClassificationTrainer.cs (2)
884Contracts.Assert(examples == featurizedImages.Count()); 964runnerOutputTensorNames.Count() > 0 ? runnerOutputTensorNames.ToArray() : null,
Microsoft.VisualStudio.LanguageServices (7)
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (1)
106if (projectsWithHierarchy.Count() <= 1)
InlineRename\InlineRenameUndoManager.cs (1)
160var count = GetUndoUnits(undoManager).SkipWhile(u => u != markerPrimitive).Count() + (undoConflictResolution ? 0 : -1);
Preview\PreviewEngine.cs (1)
162var orderedChangedDocuments = changedDocuments.GroupBy(d => d.ProjectId).OrderByDescending(g => g.Count()).Flatten();
TableDataSource\Suppression\VisualStudioDiagnosticListSuppressionStateService.cs (1)
107if (SelectedItems == _tableControl.SelectedEntries.Count())
Venus\ContainedLanguage.IVsContainedLanguageCodeSupport.cs (3)
120pcMembers = membersAndIds.Count(); 181pcMembers = membersAndIds.Count(); 242var current = Marshal.AllocCoTaskMem(source.Count() * IntPtr.Size);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (2)
CodeModel\FileCodeClassTests.cs (2)
65Assert.Equal(1, bases.Cast<CodeElement>().Count()); 84Assert.Equal(2, interfaces.Cast<CodeElement>().Count());
Replay (1)
src\Compilers\Core\CommandLine\BuildProtocol.cs (1)
595var hashAttributeCount = hashAttributes.Count();
Roslyn.VisualStudio.Next.UnitTests (2)
Services\ServiceHubServicesTests.cs (2)
1758var result = expected.Count() == actual.Count() && expectedSet.SetEquals(actual);
RunTests (3)
AssemblyScheduler.cs (3)
74ConsoleUtil.WriteLine($"Found {orderedTypeInfos.Values.SelectMany(t => t).SelectMany(t => t.Tests).Count()} tests to run in {orderedTypeInfos.Keys.Count()} assemblies"); 178ConsoleUtil.WriteLine($"{unmatchedLocalTests.Count} tests were missing historical data. {unmatchedRemoteTests.Count()} tests were missing in local assemblies. Estimate of total execution time for tests is {totalExpectedRunTime}.");
Sample (1)
Program.cs (1)
111schemas.MapPost("/ienumerable-of-ints", (IEnumerable<int> values) => values.Count());
System.ComponentModel.Composition (2)
Microsoft\Internal\GenerationServices.cs (1)
237ilGenerator.LoadInt(enumerable.Cast<object>().Count());
System\ComponentModel\Composition\Hosting\TypeCatalog.cs (1)
367int count = PartsInternal.Count();
System.Composition.TypedParts (1)
System\Composition\TypedParts\Discovery\DiscoveredPart.cs (1)
140int constructorsCount = genericPartTypeInfo.DeclaredConstructors.Count();
System.Linq (10)
System\Linq\AppendPrepend.SpeedOpt.cs (2)
130return !onlyIfCheap || _source is ICollection<TSource> ? _source.Count() + 1 : -1; 279return !onlyIfCheap || _source is ICollection<TSource> ? _source.Count() + _appendCount + _prependCount : -1;
System\Linq\Concat.SpeedOpt.cs (3)
23firstCount = _first.Count(); 33secondCount = _second.Count(); 174int sourceCount = collection?.Count ?? source.Count();
System\Linq\DefaultIfEmpty.SpeedOpt.cs (1)
35count = _source.Count();
System\Linq\OrderedEnumerable.SpeedOpt.cs (1)
61return !onlyIfCheap || _source is ICollection<TElement> || _source is ICollection ? _source.Count() : -1;
System\Linq\Reverse.SpeedOpt.cs (1)
27!onlyIfCheap ? _source.Count() :
System\Linq\SelectMany.SpeedOpt.cs (1)
25count += _selector(element).Count();
System\Linq\SkipTake.SpeedOpt.cs (1)
258return Math.Max(_source.Count() - _minIndexInclusive, 0);
System.Private.Windows.Core.TestUtilities (2)
XUnit\EnumerableTupleTheoryData.cs (2)
17public int Count => _data.Count(); 35public int Count => _data.Count();
System.ServiceModel.Primitives.Tests (2)
Channels\UnderstoodHeadersTest.cs (2)
45int numUnderstoodHeaders = requestMessage.Headers.UnderstoodHeaders.Count<MessageHeaderInfo>(); 73numUnderstoodHeaders = requestMessage.Headers.UnderstoodHeaders.Count<MessageHeaderInfo>();
System.Windows.Forms (4)
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.cs (4)
1403sizeToAllocate += sizeof(TASKDIALOG_BUTTON) * customButtonElements.Count(); 1418sizeToAllocate += sizeof(TASKDIALOG_BUTTON) * radioButtonElements.Count(); 1474int customButtonCount = customButtonElements.Count(); 1499int radioButtonCount = radioButtonElements.Count();
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\ShortcutKeysEditor.ShortcutKeysUI.cs (1)
56Debug.Assert(s_validKeys.Distinct().Count() == s_validKeys.Length);
vbc (1)
src\Compilers\Core\CommandLine\BuildProtocol.cs (1)
595var hashAttributeCount = hashAttributes.Count();
VBCSCompiler (1)
src\Compilers\Core\CommandLine\BuildProtocol.cs (1)
595var hashAttributeCount = hashAttributes.Count();