131 references to Count
AnalyzerRunner (2)
Program.cs (2)
212var numberOfNodes = tokensAndNodes.Count(x => x.IsNode); 213var numberOfTokens = tokensAndNodes.Count(x => x.IsToken);
Aspire.Dashboard (1)
Components\ResourcesGridColumns\UnreadLogErrorsBadge.razor.cs (1)
48var applicationName = applications.Count(a => a.ApplicationName == application.ApplicationName) > 1
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppsInfrastructure.cs (1)
361if (endpointsByTargetPort.Count(g => g.External) > 1)
Aspire.Hosting.Milvus.Tests (2)
AddMilvusTests.cs (2)
112var servicesKeysCount = config.Keys.Count(k => k.StartsWith("ConnectionStrings__")); 123var containerServicesKeysCount = containerConfig.Keys.Count(k => k.StartsWith("ConnectionStrings__"));
Aspire.Hosting.Qdrant.Tests (2)
AddQdrantTests.cs (2)
185var servicesKeysCount = config.Keys.Count(k => k.StartsWith("ConnectionStrings__")); 197var containerServicesKeysCount = containerConfig.Keys.Count(k => k.StartsWith("ConnectionStrings__"));
Aspire.Hosting.Tests (1)
WithReferenceTests.cs (1)
298var servicesKeysCount = config.Keys.Count(k => k.StartsWith("services__"));
CodeGenerator (1)
src\Servers\Kestrel\shared\KnownHeaders.cs (1)
779Debug.Assert(responseHeaders.Count(x => x.Index == 63) == 1);
CSharpSyntaxGenerator (4)
SourceWriter.cs (4)
1595var nAutoCreatableTokens = nd.Fields.Count(f => IsAutoCreatableToken(nd, f)); 1629int listCount = nd.Fields.Count(f => IsAnyNodeList(f.Type) && !IsAttributeOrModifiersList(f)); 1637int nodeCount = nd.Fields.Count(f => IsNode(f.Type) && f.Type != "SyntaxToken"); 1684if (withStringNames && minimalFactoryfields.Count(f => IsRequiredFactoryField(nd, f) && CanAutoConvertFromString(f)) == 0)
IIS.LongTests (2)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (2)
123Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains("Invoking where.exe to find dotnet.exe"))); 155Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains($"Found dotnet.exe in InstallLocation at '{installDir}\\dotnet.exe'")));
IIS.NewHandler.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (2)
123Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains("Invoking where.exe to find dotnet.exe"))); 155Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains($"Found dotnet.exe in InstallLocation at '{installDir}\\dotnet.exe'")));
IIS.NewShim.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (2)
123Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains("Invoking where.exe to find dotnet.exe"))); 155Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains($"Found dotnet.exe in InstallLocation at '{installDir}\\dotnet.exe'")));
IISExpress.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (2)
123Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains("Invoking where.exe to find dotnet.exe"))); 155Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains($"Found dotnet.exe in InstallLocation at '{installDir}\\dotnet.exe'")));
InMemory.FunctionalTests (6)
Http2\Http2ConnectionTests.cs (3)
39Assert.Equal(0, LogMessages.Count(m => m.EventId.Name == "Http2MaxConcurrentStreamsReached")); 43Assert.Equal(1, LogMessages.Count(m => m.EventId.Name == "Http2MaxConcurrentStreamsReached")); 48Assert.Equal(1, LogMessages.Count(m => m.EventId.Name == "Http2MaxConcurrentStreamsReached"));
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
33public int TotalErrorsLogged => Messages.Count(message => message.LogLevel == LogLevel.Error); 35public int CriticalErrorsLogged => Messages.Count(message => message.LogLevel == LogLevel.Critical); 37public int ApplicationErrorsLogged => Messages.Count(message => message.EventId.Id == ApplicationErrorEventId);
installer.tasks (1)
StaticFileRegeneration\RegenerateThirdPartyNotices.cs (1)
119.Where(g => g.Count(r => r.Content != null) != 1))
Microsoft.AspNetCore.Authentication.Test (2)
FacebookTests.cs (1)
368Assert.Equal(1, finalUserInfoEndpoint.Count(c => c == '?'));
TwitterTests.cs (1)
513Assert.Equal(1, finalVerifyCredentialsEndpoint.Count(c => c == '?'));
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (7)
Http1\Http1HttpProtocolFeatureCollectionTests.cs (3)
171Assert.Equal(0, _collection.Count(kv => kv.Key == typeof(string))); 174Assert.Equal(1, _collection.Count(kv => kv.Key == typeof(string))); 177Assert.Equal(0, _collection.Count(kv => kv.Key == typeof(string)));
src\Servers\Kestrel\shared\KnownHeaders.cs (1)
779Debug.Assert(responseHeaders.Count(x => x.Index == 63) == 1);
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
33public int TotalErrorsLogged => Messages.Count(message => message.LogLevel == LogLevel.Error); 35public int CriticalErrorsLogged => Messages.Count(message => message.LogLevel == LogLevel.Critical); 37public int ApplicationErrorsLogged => Messages.Count(message => message.EventId.Id == ApplicationErrorEventId);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (3)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
33public int TotalErrorsLogged => Messages.Count(message => message.LogLevel == LogLevel.Error); 35public int CriticalErrorsLogged => Messages.Count(message => message.LogLevel == LogLevel.Critical); 37public int ApplicationErrorsLogged => Messages.Count(message => message.EventId.Id == ApplicationErrorEventId);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (3)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
33public int TotalErrorsLogged => Messages.Count(message => message.LogLevel == LogLevel.Error); 35public int CriticalErrorsLogged => Messages.Count(message => message.LogLevel == LogLevel.Critical); 37public int ApplicationErrorsLogged => Messages.Count(message => message.EventId.Id == ApplicationErrorEventId);
Microsoft.Build (1)
Evaluation\ItemSpec.cs (1)
83return ReferencedItems.Count(v => v.ItemAsValueFragment.IsMatch(itemToMatch));
Microsoft.Build.Engine.UnitTests (9)
EvaluationProfiler_Tests.cs (5)
164Assert.Equal(2, profiledElements.Count(location => location.ElementName == "CSFile" & location.EvaluationPass == EvaluationPass.Items)); 166Assert.Equal(2, profiledElements.Count(location => location.ElementName == "CSFile" & location.EvaluationPass == EvaluationPass.LazyItems)); 173Assert.Equal(2, profiledElements.Count(location => location.ElementName == "Message")); 195Assert.Equal(2, profiledElements.Count(location => location.ElementName == "TestGlob" & location.EvaluationPass == EvaluationPass.Items)); 196Assert.Equal(2, profiledElements.Count(location => location.ElementName == "TestGlob" & location.EvaluationPass == EvaluationPass.LazyItems));
Graph\GraphLoadedFromSolution_tests.cs (4)
627node1.ProjectReferences.Count(r => GetProjectNumber(r) == 2).ShouldBe(3); 632outerBuild3.ProjectReferences.Count(r => GetProjectNumber(r) == 3).ShouldBe(2); 633outerBuild3.ProjectReferences.Count(r => GetProjectNumber(r) == 4).ShouldBe(1); 635GetInnerBuilds(graph, 3).SelectMany(n => n.ProjectReferences).Count(r => GetProjectNumber(r) == 4).ShouldBe(2);
Microsoft.Build.Tasks.UnitTests (1)
GenerateBindingRedirects_Tests.cs (1)
144.Count(e => e.Name.LocalName.Equals("assemblyBinding", StringComparison.OrdinalIgnoreCase))
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
270var condition1 = typeParameter.ConstraintTypes.Count(t => t.TypeKind == TypeKind.Class) >= 2;
Microsoft.CodeAnalysis.CSharp (7)
Binder\Binder_Attributes.cs (1)
352Debug.Assert(arguments.Count(a => a.IsParamsArrayOrCollection) == (boundAttribute.ConstructorExpanded ? 1 : 0));
FlowAnalysis\NullableWalker.cs (1)
7001Debug.Assert(arguments.Count(a => a.IsParamsArrayOrCollection) <= 1);
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
1020Debug.Assert(rewrittenArguments.Count(a => a.IsParamsArrayOrCollection) <= (expanded ? 1 : 0)); 1315Debug.Assert(rewrittenArguments.Count(a => a.IsParamsArrayOrCollection) <= (expanded ? 1 : 0));
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (1)
303Debug.Assert(memberInit.Arguments.Count(a => a.IsParamsArrayOrCollection) <= (memberInit.Expanded ? 1 : 0));
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
1406int nRefParameters = parameters.Count(p => p.RefKind is RefKind.Ref or RefKind.In or RefKind.RefReadOnlyParameter or RefKind.Out);
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1582var enumeratorCancellationCount = Parameters.Count(p => p.IsSourceParameterWithEnumeratorCancellationAttribute());
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
487=> triviaList.Sum(t => t.ToFullString().Replace("\r\n", "\r").Cast<char>().Count(c => SyntaxFacts.IsNewLine(c)));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
737var minParameterCount = parameterList.Count(p => !p.IsParams && !p.IsOptional);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
Emit\NumericIntPtrTests.cs (2)
1594Assert.Equal(expectedSigned, operators.Count(op => predicate(op, true))); 1595Assert.Equal(expectedUnsigned, operators.Count(op => predicate(op, false)));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (9)
Diagnostics\DiagnosticAnalyzerTests.cs (9)
408Assert.Equal(1, effectiveDiags.Count(d => d.IsWarningAsError)); 414Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Error)); 415Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Warning)); 421Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Error)); 422Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Info)); 428Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Error)); 429Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Hidden)); 435Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Error)); 436Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Hidden));
Microsoft.CodeAnalysis.CSharp.Features (1)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.ReferenceRewriter.cs (1)
81tupleExpression.Arguments.Count(a => ShouldAddTupleMemberName(a, out _)) == 1)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
Semantics\MethodBodyModelTests.cs (2)
618Assert.Equal(0, diags.Count(d => d.Severity == DiagnosticSeverity.Error)); 619Assert.Equal(0, diags.Count(d => d.Severity == DiagnosticSeverity.Warning));
Semantics\NativeIntegerTests.cs (2)
4835Assert.Equal(expectedSigned, operators.Count(op => predicate(op, true))); 4836Assert.Equal(expectedUnsigned, operators.Count(op => predicate(op, false)));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\TypeTests.cs (1)
1198Assert.Equal(0, comp.GetDeclarationDiagnostics().Count(e => e.Severity >= DiagnosticSeverity.Error));
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
487=> triviaList.Sum(t => t.ToFullString().Replace("\r\n", "\r").Cast<char>().Count(c => SyntaxFacts.IsNewLine(c)));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
737var minParameterCount = parameterList.Count(p => !p.IsParams && !p.IsOptional);
Microsoft.CodeAnalysis.EditorFeatures (5)
ExtractMethod\ExtractMethodCommandHandler.cs (1)
70if (spans.Count(s => s.Length > 0) != 1)
InlineRename\RenameLogMessage.cs (4)
49m[RenamedIdentifiersWithoutConflicts] = replacementKinds.Count(r => r == InlineRenameReplacementKind.NoConflict); 50m[ResolvableReferenceConflicts] = replacementKinds.Count(r => r == InlineRenameReplacementKind.ResolvedReferenceConflict); 51m[ResolvableNonReferenceConflicts] = replacementKinds.Count(r => r == InlineRenameReplacementKind.ResolvedNonReferenceConflict); 52m[UnresolvableConflicts] = replacementKinds.Count(r => r == InlineRenameReplacementKind.UnresolvedConflict);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Completion\AbstractArgumentProviderTests`1.cs (1)
113=> parameters.Count(parameter => !parameter.IsOptional && !parameter.IsParams);
SignatureHelp\AbstractSignatureHelpProviderTests.cs (1)
430Assert.True(expectedOrderedItemsOrNull.Count(i => i.IsSelected) == 1, "Only one expected item can be marked with 'IsSelected'");
Microsoft.CodeAnalysis.Features (2)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractMetadataFormattingRule.cs (1)
58count += trivia.ToFullString().Replace("\r\n", "\r").ToCharArray().Count(IsNewLine);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
270var condition1 = typeParameter.ConstraintTypes.Count(t => t.TypeKind == TypeKind.Class) >= 2;
Microsoft.CodeAnalysis.Test.Utilities (1)
Assert\AssertXml.cs (1)
102if (AssertEx.TryGenerateExpectedSourceFileAndGetDiffLink(actualString, expectedString.Count(c => c == '\n') + 1, expectedValueSourcePath, expectedValueSourceLine, out var link))
Microsoft.CodeAnalysis.Workspaces (1)
LinkedFileDiffMerging\LinkedFileDiffMergingSession.cs (1)
50filePathToNewDocumentsAndHashes.Count(static kvp => kvp.Value.Count > 1),
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
FindReferencesTests.cs (2)
636Assert.True(typeResult.Locations.Count(loc => loc.Alias == null) == 1); 637Assert.True(typeResult.Locations.Count(loc => loc.Alias != null) == 1);
Microsoft.DotNet.Arcade.Sdk (1)
src\GenerateSourcePackageSourceLinkTargetsFile.cs (1)
79if (innerMostRootSourceLinkUrl.Count(c => c == '*') != 1)
Microsoft.ML.AutoML (5)
ColumnInference\PurposeInference.cs (1)
134sumSpaces += spanStr.Count(x => x == ' ');
ColumnInference\TextFileSample.cs (2)
114var lineCount = firstChunk.Count(x => x == '\n'); 170multiplier.HasValue ? buf.Count(x => x == '\n') * multiplier : null);
Utils\UserInputValidationUtil.cs (2)
198if (trainData.Schema.Count(c => !c.IsHidden) != validationData.Schema.Count(c => !c.IsHidden))
Microsoft.ML.Data (2)
Deprecated\Instances\HeaderSchema.cs (1)
94int cnn = names.Take(size).Count(x => x != null);
Evaluators\AnomalyDetectionEvaluator.cs (1)
262drAtNumPos = sorted.Take((int)NumAnomalies).Count(result => result.Label > 0) / (Double)NumAnomalies;
Microsoft.ML.FastTree (2)
FastTree.cs (2)
2441return _sparse.Count(kvp => kvp.Value > gtValue) + (0 > gtValue ? length - _sparse.Count : 0); 2446return _dense.Count(v => v > gtValue) + (0 > gtValue ? length - _dense.Count : 0);
Microsoft.ML.Predictor.Tests (2)
TestPredictors.cs (2)
958Assert.Equal(probs.Count(p => p >= prob), probs.Count(p => p <= prob));
Microsoft.ML.Sweeper (1)
Parameters.cs (1)
598if (options.Length != optionsSpecified.Count(b => b))
Microsoft.ML.Tests (1)
Transformers\CustomMappingTests.cs (1)
185Assert.Equal(10, outputs.Count(output => output));
Microsoft.ML.TorchSharp (1)
Roberta\Models\RobertaModel.cs (1)
114var allSize = srcTokenArray.Count(token => token != PadIndex);
Microsoft.ML.Transforms (1)
Text\NgramTransform.cs (1)
344int numFull = lims.Count(l => l <= 0);
MSBuild (2)
TerminalLogger\TerminalLogger.cs (2)
554int countErrors = project.BuildMessages?.Count(m => m.Severity == MessageSeverity.Error) ?? 0; 555int countWarnings = project.BuildMessages?.Count(m => m.Severity == MessageSeverity.Warning) ?? 0;
Sockets.BindTests (5)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
33public int TotalErrorsLogged => Messages.Count(message => message.LogLevel == LogLevel.Error); 35public int CriticalErrorsLogged => Messages.Count(message => message.LogLevel == LogLevel.Critical); 37public int ApplicationErrorsLogged => Messages.Count(message => message.EventId.Id == ApplicationErrorEventId);
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (2)
559Assert.Equal(0, LogMessages.Count(log => log.LogLevel == LogLevel.Critical && 594Assert.Equal(0, LogMessages.Count(log => log.LogLevel == LogLevel.Critical &&
Sockets.FunctionalTests (10)
src\Servers\Kestrel\shared\test\TestApplicationErrorLogger.cs (3)
33public int TotalErrorsLogged => Messages.Count(message => message.LogLevel == LogLevel.Error); 35public int CriticalErrorsLogged => Messages.Count(message => message.LogLevel == LogLevel.Critical); 37public int ApplicationErrorsLogged => Messages.Count(message => message.EventId.Id == ApplicationErrorEventId);
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (7)
346Assert.Equal(1, TestSink.Writes.Count(w => w.EventId.Name == "ConnectionStop")); 922Assert.Equal(0, TestSink.Writes.Count(w => w.EventId.Name == "ResponseMinimumDataRateNotSatisfied")); 923Assert.Equal(1, TestSink.Writes.Count(w => w.EventId.Name == "ConnectionStop")); 1007Assert.Equal(0, TestSink.Writes.Count(w => w.EventId.Name == "ResponseMinimumDataRateNotSatisfied")); 1008Assert.Equal(1, TestSink.Writes.Count(w => w.EventId.Name == "ConnectionStop")); 1085Assert.Equal(0, TestSink.Writes.Count(w => w.EventId.Name == "ResponseMinimumDataRateNotSatisfied")); 1086Assert.Equal(1, TestSink.Writes.Count(w => w.EventId.Name == "ConnectionStop"));
System.Windows.Forms (1)
System\Windows\Forms\Dialogs\TaskDialog\TaskDialogPage.cs (1)
787if (_radioButtons.Count(e => e.Checked) > 1)