657 implementations of Count
Aspire.Hosting (1)
Aspire.RabbitMQ.Client (1)
ConfigurationSchemaGenerator (1)
GenerateDocumentationAndConfigFiles (23)
Metrics (23)
Metrics.Legacy (23)
Microsoft.AspNetCore.Components (3)
Microsoft.AspNetCore.Components.Endpoints (1)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
Microsoft.AspNetCore.Hosting (4)
Microsoft.AspNetCore.Http (1)
Microsoft.AspNetCore.Http.Abstractions (2)
Microsoft.AspNetCore.Http.Connections (1)
Microsoft.AspNetCore.Http.Connections.Client (1)
Microsoft.AspNetCore.HttpLogging (1)
Microsoft.AspNetCore.Mvc.Abstractions (2)
Microsoft.AspNetCore.Mvc.Core (2)
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
Microsoft.AspNetCore.Routing (1)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Microsoft.AspNetCore.Shared.Tests (1)
Microsoft.AspNetCore.SignalR.Client.Core (1)
Microsoft.AspNetCore.SignalR.Core (1)
Microsoft.CodeAnalysis (32)
Microsoft.CodeAnalysis.Analyzers (23)
Microsoft.CodeAnalysis.AnalyzerUtilities (23)
Microsoft.CodeAnalysis.BannedApiAnalyzers (23)
Microsoft.CodeAnalysis.CodeStyle (23)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (1)
Microsoft.CodeAnalysis.Collections.Package (21)
Microsoft.CodeAnalysis.Debugging.Package (1)
Microsoft.CodeAnalysis.Extensions.Package (21)
Microsoft.CodeAnalysis.InteractiveHost (21)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (23)
Microsoft.CodeAnalysis.PooledObjects.Package (1)
Microsoft.CodeAnalysis.PublicApiAnalyzers (23)
Microsoft.CodeAnalysis.ResxSourceGenerator (23)
Microsoft.CodeAnalysis.Threading.Package (21)
Microsoft.CodeAnalysis.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces (24)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (22)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Microsoft.DotNet.XUnitAssert.Tests (1)
Microsoft.Extensions.AI (2)
Microsoft.Extensions.AI.Abstractions (5)
Microsoft.Extensions.AI.Abstractions.Tests (2)
Microsoft.Extensions.AI.AzureAIInference (2)
Microsoft.Extensions.AI.OpenAI (2)
Microsoft.Extensions.Diagnostics.HealthChecks (2)
Microsoft.Extensions.Http (1)
Microsoft.Extensions.Http.Diagnostics (2)
Microsoft.Extensions.Logging (1)
Microsoft.Extensions.Logging.Abstractions (8)
Microsoft.Extensions.Primitives (1)
Microsoft.Extensions.Telemetry (3)
Microsoft.Extensions.Telemetry.Abstractions (1)
Microsoft.Gen.ComplianceReports.Unit.Tests (2)
Microsoft.Gen.ContextualOptions.Unit.Tests (2)
Microsoft.Gen.Logging.Unit.Tests (2)
Microsoft.Gen.MetadataExtractor.Unit.Tests (2)
Microsoft.Gen.Metrics.Unit.Tests (2)
Microsoft.Gen.MetricsReports.Unit.Tests (2)
Microsoft.Maui (2)
Microsoft.Maui.Controls (7)
Microsoft.ML.Core (1)
Microsoft.ML.Data (1)
Microsoft.ML.DataView (1)
Microsoft.ML.StandardTrainers (1)
PresentationFramework (2)
Roslyn.Diagnostics.Analyzers (23)
Shared (2)
Shared.Tests (2)
SignalRSamples (1)
SocialWeather (1)
System.Collections (11)
System.Collections.Concurrent (4)
System.Collections.Immutable (16)
System.Diagnostics.DiagnosticSource (1)
System.Formats.Nrbf (1)
System.Linq (4)
System.Linq.AsyncEnumerable (1)
System.Linq.Expressions (1)
System.Net.Http (3)
System.Net.Primitives (1)
System.Net.WebSockets.Client (1)
System.Private.CoreLib (15)
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (1)
256public int Count
System.Private.Windows.Core (2)
System.Private.Windows.Core.TestUtilities (2)
System.Reflection.Metadata (25)
System.Security.Cryptography.Cose (1)
System.Text.Json.SourceGeneration (1)
System.Text.RegularExpressions (4)
System.Windows.Forms.Primitives (1)
Test.Utilities (23)
Text.Analyzers (23)
2493 references to Count
AnalyzerRunner (2)
aspire (11)
Aspire.Cli.Tests (4)
Aspire.Dashboard (15)
Aspire.Dashboard.Components.Tests (9)
Aspire.Hosting (8)
Aspire.Hosting.Azure (2)
Aspire.Hosting.Azure.AppContainers (2)
Aspire.Hosting.Azure.AppService (2)
Aspire.Hosting.Azure.CosmosDB (2)
Aspire.Hosting.Azure.WebPubSub (1)
Aspire.Hosting.Docker (2)
Aspire.Hosting.Kubernetes (2)
Aspire.Hosting.Tests (5)
Aspire.Hosting.Yarp (1)
Aspire.RabbitMQ.Client.Tests (2)
Aspire.RabbitMQ.Client.v7.Tests (2)
Aspire.Templates.Tests (1)
Diagnostics.EFCore.FunctionalTests (1)
dotnet-dev-certs (2)
dotnet-svcutil-lib (1)
GenerateDocumentationAndConfigFiles (37)
HttpStress (1)
illink (2)
ILLink.CodeFixProvider (1)
ILLink.RoslynAnalyzer (2)
KeyManagementSample (2)
Metrics (29)
Metrics.Legacy (29)
Microsoft.Analyzers.Extra (1)
Microsoft.Analyzers.Extra.Tests (24)
Microsoft.Analyzers.Local.Tests (11)
Microsoft.AspNetCore.App.Analyzers.Test (3)
Microsoft.AspNetCore.AsyncState (1)
Microsoft.AspNetCore.Authentication.JwtBearer (1)
Microsoft.AspNetCore.Authorization.Policy (4)
Microsoft.AspNetCore.Components (46)
Microsoft.AspNetCore.Components.Endpoints (21)
Microsoft.AspNetCore.Components.Endpoints.Tests (5)
Microsoft.AspNetCore.Components.QuickGrid.Tests (1)
Microsoft.AspNetCore.Components.Server (15)
Microsoft.AspNetCore.Components.Server.Tests (5)
Microsoft.AspNetCore.Components.Tests (6)
Microsoft.AspNetCore.Components.Web (5)
Microsoft.AspNetCore.Components.Web.Tests (1)
Microsoft.AspNetCore.Components.WebAssembly (3)
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
Microsoft.AspNetCore.DataProtection (1)
Microsoft.AspNetCore.DataProtection.Tests (6)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (40)
Logging\AcceptanceTests.cs (26)
244Assert.Equal(8, state!.Count);
249Assert.Equal(7, state!.Count);
304Assert.Equal(9, state!.Count);
309Assert.Equal(7, state!.Count);
390Assert.Equal(5, logRecords.Count);
402Assert.Equal(6, requestState!.Count);
412Assert.Equal(3, requestBodyState!.Count);
415Assert.Equal(2, responseState!.Count);
419Assert.Equal(2, responseBodyState!.Count);
422Assert.Equal(2, durationState!.Count);
460Assert.Equal(9, state!.Count);
506Assert.Equal(9, state!.Count);
548Assert.Equal(7, state!.Count);
571Assert.Equal(3, logRecords.Count);
580Assert.Equal(5, firstState!.Count);
584Assert.Equal(3, secondState!.Count);
609Assert.Equal(6, logRecords.Count);
622Assert.Equal(5, firstRecord!.Count);
624Assert.Equal(5, fourthRecord!.Count);
638Assert.Equal(2, thirdRecord!.Count);
639Assert.Equal(2, sixthRecord!.Count);
665Assert.Equal(7, state!.Count);
706Assert.Equal(10, state!.Count);
740Assert.Equal(7, state!.Count);
798Assert.Equal(7, logCollector.GetSnapshot()[0].StructuredState!.Count);
991Assert.Equal(7, logCollector.GetSnapshot()[1].StructuredState!.Count);
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
Microsoft.AspNetCore.HeaderParsing (1)
Microsoft.AspNetCore.Http (1)
Microsoft.AspNetCore.Http.Connections.Tests (8)
Microsoft.AspNetCore.Http.Extensions (4)
Microsoft.AspNetCore.Http.Extensions.Tests (1)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
Microsoft.AspNetCore.Http.Results (5)
Microsoft.AspNetCore.JsonPatch (1)
Microsoft.AspNetCore.JsonPatch.SystemTextJson (1)
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
Microsoft.AspNetCore.Mvc.Core (60)
Microsoft.AspNetCore.Mvc.Core.Test (11)
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (2)
Microsoft.AspNetCore.Mvc.Razor (4)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (5)
Microsoft.AspNetCore.Mvc.RazorPages (7)
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Microsoft.AspNetCore.Mvc.TagHelpers (6)
Microsoft.AspNetCore.Mvc.Testing (1)
Microsoft.AspNetCore.Mvc.ViewFeatures (13)
Microsoft.AspNetCore.OpenApi (4)
Microsoft.AspNetCore.Owin (1)
Microsoft.AspNetCore.Routing (124)
Microsoft.AspNetCore.Routing.Microbenchmarks (2)
Microsoft.AspNetCore.Routing.Tests (22)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
Microsoft.AspNetCore.Server.HttpSys.Microbenchmarks (2)
Microsoft.AspNetCore.Server.HttpSys.Tests (4)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
Microsoft.AspNetCore.SignalR.Client.Core (1)
Microsoft.AspNetCore.SignalR.Client.Tests (3)
Microsoft.AspNetCore.SignalR.Core (2)
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (2)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (3)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (7)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
Microsoft.AspNetCore.SignalR.Tests (7)
Microsoft.AspNetCore.StaticAssets (7)
Microsoft.AspNetCore.Testing (1)
Microsoft.AspNetCore.Tests (1)
Microsoft.Build.Framework (4)
Microsoft.CodeAnalysis (81)
PEWriter\MetadataWriter.cs (16)
1961metadata.SetCapacity(TableIndex.AssemblyRef, assemblyRefs.Count);
2206metadata.SetCapacity(TableIndex.Event, eventDefs.Count);
2374metadata.SetCapacity(TableIndex.Field, fieldDefs.Count);
2582metadata.SetCapacity(TableIndex.MemberRef, memberRefs.Count);
2609metadata.SetCapacity(TableIndex.MethodSpec, methodSpecs.Count);
2622metadata.SetCapacity(TableIndex.MethodDef, methodDefs.Count);
2645metadata.SetCapacity(TableIndex.MethodSemantics, propertyDefs.Count * 2 + eventDefs.Count * 2);
2719metadata.SetCapacity(TableIndex.ModuleRef, moduleRefs.Count);
2759metadata.SetCapacity(TableIndex.Param, parameterDefs.Count);
2773metadata.SetCapacity(TableIndex.Property, propertyDefs.Count);
2787metadata.SetCapacity(TableIndex.TypeDef, typeDefs.Count);
2844metadata.SetCapacity(TableIndex.TypeRef, typeRefs.Count);
2904metadata.SetCapacity(TableIndex.TypeSpec, typeSpecs.Count);
2926int[] bodyOffsets = new int[methods.Count];
2958int[] bodyOffsets = new int[methods.Count];
Microsoft.CodeAnalysis.Analyzers (38)
Microsoft.CodeAnalysis.AnalyzerUtilities (33)
Microsoft.CodeAnalysis.BannedApiAnalyzers (37)
Microsoft.CodeAnalysis.CodeStyle (28)
Microsoft.CodeAnalysis.CodeStyle.Fixes (12)
Microsoft.CodeAnalysis.Collections.Package (13)
Microsoft.CodeAnalysis.CSharp (13)
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (8)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (10)
Microsoft.CodeAnalysis.CSharp.Features (12)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (10)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (78)
CodeGeneration\SyntaxGeneratorTests.cs (78)
2072Assert.Equal(1, attrsAdded.Count);
2744=> Assert.Equal(0, Generator.GetNamespaceImports(Generator.RemoveNodes(declaration, Generator.GetNamespaceImports(declaration))).Count);
2984=> Assert.Equal(0, Generator.GetMembers(Generator.RemoveNodes(declaration, Generator.GetMembers(declaration))).Count);
3385Assert.Equal(0, Generator.GetParameters(Generator.MethodDeclaration("m")).Count);
3386Assert.Equal(1, Generator.GetParameters(Generator.MethodDeclaration("m", parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3387Assert.Equal(2, Generator.GetParameters(Generator.MethodDeclaration("m", parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))])).Count);
3389Assert.Equal(0, Generator.GetParameters(Generator.ConstructorDeclaration()).Count);
3390Assert.Equal(1, Generator.GetParameters(Generator.ConstructorDeclaration(parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3391Assert.Equal(2, Generator.GetParameters(Generator.ConstructorDeclaration(parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))])).Count);
3393Assert.Equal(1, Generator.GetParameters(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))], Generator.IdentifierName("t"))).Count);
3394Assert.Equal(2, Generator.GetParameters(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))], Generator.IdentifierName("t"))).Count);
3396Assert.Equal(0, Generator.GetParameters(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("expr"))).Count);
3397Assert.Equal(1, Generator.GetParameters(Generator.ValueReturningLambdaExpression("p1", Generator.IdentifierName("expr"))).Count);
3399Assert.Equal(0, Generator.GetParameters(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("expr"))).Count);
3400Assert.Equal(1, Generator.GetParameters(Generator.VoidReturningLambdaExpression("p1", Generator.IdentifierName("expr"))).Count);
3402Assert.Equal(0, Generator.GetParameters(Generator.DelegateDeclaration("d")).Count);
3403Assert.Equal(1, Generator.GetParameters(Generator.DelegateDeclaration("d", parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3405Assert.Equal(0, Generator.GetParameters(Generator.ClassDeclaration("c")).Count);
3406Assert.Equal(0, Generator.GetParameters(Generator.IdentifierName("x")).Count);
3412Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.MethodDeclaration("m"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3413Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.ConstructorDeclaration(), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3414Assert.Equal(3, Generator.GetParameters(Generator.AddParameters(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))], Generator.IdentifierName("t")), [Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2")), Generator.ParameterDeclaration("p3", Generator.IdentifierName("t3"))])).Count);
3416Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("expr")), [Generator.LambdaParameter("p")])).Count);
3417Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("expr")), [Generator.LambdaParameter("p")])).Count);
3419Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.DelegateDeclaration("d"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3421Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.ClassDeclaration("c"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3422Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.StructDeclaration("c"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3423Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.InterfaceDeclaration("c"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3424Assert.Equal(0, Generator.GetParameters(Generator.AddParameters(Generator.IdentifierName("x"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count);
3437Assert.Equal(1, Generator.GetStatements(Generator.ValueReturningLambdaExpression("p", [Generator.IdentifierName("x")])).Count);
3502Assert.Equal(2, Generator.GetAccessors(prop).Count);
3527Assert.Equal(0, Generator.GetStatements(getAccessor).Count);
3528Assert.Equal(0, Generator.GetStatements(setAccessor).Count);
3605Assert.Equal(2, Generator.GetAccessors(x).Count);
3606Assert.Equal(0, Generator.GetAccessors(y).Count);
3611Assert.Equal(0, Generator.GetAccessors(y2).Count);
3628Assert.Equal(2, Generator.GetAccessors(x).Count);
3629Assert.Equal(0, Generator.GetAccessors(y).Count);
3634Assert.Equal(0, Generator.GetAccessors(y2).Count);
3700Assert.Equal(0, Generator.GetStatements(Generator.MethodDeclaration("m")).Count);
3701Assert.Equal(2, Generator.GetStatements(Generator.MethodDeclaration("m", statements: stmts)).Count);
3703Assert.Equal(0, Generator.GetStatements(Generator.ConstructorDeclaration()).Count);
3704Assert.Equal(2, Generator.GetStatements(Generator.ConstructorDeclaration(statements: stmts)).Count);
3706Assert.Equal(0, Generator.GetStatements(Generator.VoidReturningLambdaExpression([])).Count);
3707Assert.Equal(2, Generator.GetStatements(Generator.VoidReturningLambdaExpression(stmts)).Count);
3709Assert.Equal(0, Generator.GetStatements(Generator.ValueReturningLambdaExpression([])).Count);
3710Assert.Equal(2, Generator.GetStatements(Generator.ValueReturningLambdaExpression(stmts)).Count);
3712Assert.Equal(0, Generator.GetStatements(Generator.IdentifierName("x")).Count);
3727Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.MethodDeclaration("m"), stmts)).Count);
3728Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.ConstructorDeclaration(), stmts)).Count);
3729Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.VoidReturningLambdaExpression([]), stmts)).Count);
3730Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.ValueReturningLambdaExpression([]), stmts)).Count);
3732Assert.Equal(0, Generator.GetStatements(Generator.WithStatements(Generator.IdentifierName("x"), stmts)).Count);
3750Assert.Equal(0, Generator.GetGetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))).Count);
3751Assert.Equal(2, Generator.GetGetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), getAccessorStatements: stmts)).Count);
3753Assert.Equal(0, Generator.GetGetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t"))).Count);
3754Assert.Equal(2, Generator.GetGetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t"), getAccessorStatements: stmts)).Count);
3756Assert.Equal(0, Generator.GetGetAccessorStatements(Generator.IdentifierName("x")).Count);
3759Assert.Equal(0, Generator.GetSetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"))).Count);
3760Assert.Equal(2, Generator.GetSetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), setAccessorStatements: stmts)).Count);
3762Assert.Equal(0, Generator.GetSetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t"))).Count);
3763Assert.Equal(2, Generator.GetSetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t"), setAccessorStatements: stmts)).Count);
3765Assert.Equal(0, Generator.GetSetAccessorStatements(Generator.IdentifierName("x")).Count);
3783Assert.Equal(2, Generator.GetGetAccessorStatements(Generator.WithGetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t")), stmts)).Count);
3784Assert.Equal(2, Generator.GetGetAccessorStatements(Generator.WithGetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t")), stmts)).Count);
3785Assert.Equal(0, Generator.GetGetAccessorStatements(Generator.WithGetAccessorStatements(Generator.IdentifierName("x"), stmts)).Count);
3788Assert.Equal(2, Generator.GetSetAccessorStatements(Generator.WithSetAccessorStatements(Generator.PropertyDeclaration("p", Generator.IdentifierName("t")), stmts)).Count);
3789Assert.Equal(2, Generator.GetSetAccessorStatements(Generator.WithSetAccessorStatements(Generator.IndexerDeclaration([p], Generator.IdentifierName("t")), stmts)).Count);
3790Assert.Equal(0, Generator.GetSetAccessorStatements(Generator.WithSetAccessorStatements(Generator.IdentifierName("x"), stmts)).Count);
3805Assert.Equal(2, baseListBI.Count);
3818Assert.Equal(1, baseListB.Count);
4041Assert.Equal(1, Generator.GetAttributes(xAttributed).Count);
4045Assert.Equal(3, membersC.Count);
4391Assert.Equal(3, attrs.Count);
4598Assert.Equal(0, Generator.GetAttributes(declM).Count);
4601Assert.Equal(3, attrs.Count);
4705Assert.Equal(4, attrs.Count);
4724Assert.Equal(4, rattrs.Count);
Microsoft.CodeAnalysis.Debugging.Package (6)
Microsoft.CodeAnalysis.EditorFeatures (17)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (12)
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);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
Microsoft.CodeAnalysis.Extensions.Package (17)
Microsoft.CodeAnalysis.Features (61)
Microsoft.CodeAnalysis.Features.UnitTests (8)
Microsoft.CodeAnalysis.InteractiveHost (13)
Microsoft.CodeAnalysis.LanguageServer.Protocol (8)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (37)
Microsoft.CodeAnalysis.PublicApiAnalyzers (29)
Microsoft.CodeAnalysis.Remote.ServiceHub (3)
Microsoft.CodeAnalysis.ResxSourceGenerator (30)
Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests (2)
Microsoft.CodeAnalysis.Test.Utilities (1)
Microsoft.CodeAnalysis.Threading.Package (13)
Microsoft.CodeAnalysis.UnitTests (42)
Collections\ImmutableSetTest.cs (12)
226Assert.Equal(1, set.Count);
269Assert.Equal(expectedValues.Length, set.Count);
289Assert.Equal(0, emptySet.Count); //, "Empty set should have a Count of 0");
394int initialCount = set.Count;
400Assert.Equal(initialCount - removedCount, set.Count);
401Assert.Equal(initialCount - removedCount - 1, nextSet.Count);
408Assert.Equal(initialCount - removedCount, set.Count);
490int initialCount = set.Count;
494Assert.Equal(initialCount + uniqueValues.Count, enumerateAddSet.Count);
505Assert.True(nextSet.Count > 0);
506Assert.Equal(initialCount + addedCount, set.Count);
512Assert.Equal(expectedCount, nextSet.Count);
Text\TextChangeTests.cs (10)
100Assert.Equal(1, changes.Count);
685Assert.Equal(1, changes.Count);
741Assert.Equal(1, changes.Count);
755Assert.Equal(1, changes.Count);
769Assert.Equal(1, changes.Count);
875Assert.Equal(1, changes.Count);
889Assert.Equal(2, changes.Count);
905Assert.Equal(2, changes.Count);
922Assert.Equal(1, changes.Count);
940Assert.Equal(1, changes.Count);
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.Workspaces (80)
Editing\SyntaxGenerator.cs (10)
1030attributeArguments: args.Count > 0 ? args : null);
1105=> this.InsertAttributes(declaration, this.GetAttributes(declaration).Count, attributes);
1133=> this.InsertReturnAttributes(declaration, this.GetReturnAttributes(declaration).Count, attributes);
1155=> this.InsertAttributeArguments(attributeDeclaration, this.GetAttributeArguments(attributeDeclaration).Count, attributeArguments);
1177=> this.InsertNamespaceImports(declaration, this.GetNamespaceImports(declaration).Count, imports);
1205=> this.InsertMembers(declaration, this.GetMembers(declaration).Count, members);
1278=> this.InsertParameters(declaration, this.GetParameters(declaration).Count, parameters);
1294=> this.InsertSwitchSections(switchStatement, this.GetSwitchSections(switchStatement).Count, switchSections);
1336=> this.InsertAccessors(declaration, this.GetAccessors(declaration).Count, accessors);
1521for (int i = 0, count = list.Count; i < count; i++)
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (14)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (15)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Microsoft.CodeAnalysis.Workspaces.UnitTests (35)
SolutionTests\SolutionTests.cs (14)
3021Assert.Equal(1, actualAnalyzerReferences.Count);
3047Assert.Equal(2, actualAnalyzerReferences.Count);
3053Assert.Equal(1, actualAnalyzerReferences.Count);
3059Assert.Equal(2, actualAnalyzerReferences.Count);
4998Assert.Equal(2, solution.ProjectIds.Count);
5022Assert.Equal(2, solution.ProjectIds.Count);
5050Assert.Equal(2, solution.ProjectIds.Count);
5081Assert.Equal(3, solution.ProjectIds.Count);
5112Assert.Equal(3, solution.ProjectIds.Count);
5144Assert.Equal(3, solution.ProjectIds.Count);
5196Assert.Equal(3, solution.ProjectIds.Count);
5212Assert.Equal(1, solution.ProjectIds.Count);
5241Assert.Equal(3, solution.ProjectIds.Count);
5256Assert.Equal(1, solution.ProjectIds.Count);
Microsoft.Data.Analysis (17)
Microsoft.Data.Analysis.Tests (6)
Microsoft.DotNet.Arcade.Sdk (1)
Microsoft.DotNet.NuGetRepack.Tasks (2)
Microsoft.Extensions.AI (5)
Microsoft.Extensions.AI.Abstractions (5)
Microsoft.Extensions.AI.Abstractions.Tests (2)
Microsoft.Extensions.AI.AzureAIInference (6)
Microsoft.Extensions.AI.Evaluation (3)
Microsoft.Extensions.AI.Evaluation.Console (1)
Microsoft.Extensions.AI.Evaluation.NLP (3)
Microsoft.Extensions.AI.Evaluation.Quality (6)
Microsoft.Extensions.AI.Evaluation.Reporting (1)
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (1)
Microsoft.Extensions.AI.Evaluation.Safety (1)
Microsoft.Extensions.AI.Integration.Tests (6)
Microsoft.Extensions.AI.OpenAI (12)
Microsoft.Extensions.AI.OpenAI.Tests (1)
Microsoft.Extensions.AmbientMetadata.Application (1)
Microsoft.Extensions.AsyncState (1)
Microsoft.Extensions.Caching.Hybrid (1)
Microsoft.Extensions.Compliance.Abstractions (1)
Microsoft.Extensions.Compliance.Redaction (1)
Microsoft.Extensions.Compliance.Testing (1)
Microsoft.Extensions.Compliance.Testing.Tests (2)
Microsoft.Extensions.DependencyInjection.AutoActivation (1)
Microsoft.Extensions.DependencyModel (4)
Microsoft.Extensions.Diagnostics.ExceptionSummarization (2)
Microsoft.Extensions.Diagnostics.HealthChecks (1)
Microsoft.Extensions.Diagnostics.HealthChecks.Common (1)
Microsoft.Extensions.Diagnostics.Probes (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (7)
Microsoft.Extensions.Diagnostics.Testing (3)
Microsoft.Extensions.Diagnostics.Testing.Tests (15)
Microsoft.Extensions.FileProviders.Embedded (2)
Microsoft.Extensions.Hosting.Testing (1)
Microsoft.Extensions.Http (1)
Microsoft.Extensions.Http.Diagnostics (9)
Microsoft.Extensions.Http.Diagnostics.Tests (4)
Microsoft.Extensions.Http.Resilience (1)
Microsoft.Extensions.Logging.Console (1)
Microsoft.Extensions.Logging.EventSource (2)
Microsoft.Extensions.Logging.Generators (1)
Microsoft.Extensions.ObjectPool.DependencyInjection (1)
Microsoft.Extensions.Options.Contextual (1)
Microsoft.Extensions.Options.SourceGeneration (1)
Microsoft.Extensions.Primitives (3)
Microsoft.Extensions.Resilience (1)
Microsoft.Extensions.ServiceDiscovery (5)
Microsoft.Extensions.ServiceDiscovery.Dns (6)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (6)
Microsoft.Extensions.ServiceDiscovery.Tests (5)
Microsoft.Extensions.ServiceDiscovery.Yarp (2)
Microsoft.Extensions.ServiceDiscovery.Yarp.Tests (2)
Microsoft.Extensions.Telemetry (3)
Microsoft.Extensions.Telemetry.Abstractions (1)
Microsoft.Extensions.Telemetry.Abstractions.Tests (6)
Microsoft.Extensions.Telemetry.PerformanceTests (1)
Microsoft.Extensions.TimeProvider.Testing (1)
Microsoft.Extensions.Validation (1)
Microsoft.Gen.ComplianceReports (1)
Microsoft.Gen.ComplianceReports.Unit.Tests (4)
Microsoft.Gen.ContextualOptions.Unit.Tests (4)
Microsoft.Gen.Logging (1)
Microsoft.Gen.Logging.Generated.Tests (10)
Microsoft.Gen.Logging.Unit.Tests (6)
Microsoft.Gen.MetadataExtractor (7)
Microsoft.Gen.MetadataExtractor.Unit.Tests (4)
Microsoft.Gen.Metrics (1)
Microsoft.Gen.Metrics.Generated.Tests (2)
Microsoft.Gen.Metrics.Unit.Tests (4)
Microsoft.Gen.MetricsReports (4)
Microsoft.Gen.MetricsReports.Unit.Tests (4)
Microsoft.Interop.LibraryImportGenerator (1)
Microsoft.Maui (3)
Microsoft.Maui.Controls (98)
Microsoft.Maui.Controls.Build.Tasks (1)
Microsoft.Maui.Graphics (5)
Microsoft.ML.AutoML (8)
Microsoft.ML.AutoML.Tests (2)
Microsoft.ML.Core (14)
Microsoft.ML.Data (13)
Microsoft.ML.FastTree (2)
Microsoft.ML.GenAI.Core (1)
Microsoft.ML.IntegrationTests (16)
IntrospectiveTraining.cs (14)
52Assert.Equal(3, treeCollection.Trees.Count);
53Assert.Equal(3, treeCollection.TreeWeights.Count);
59Assert.Equal(tree.SplitGains.Count, tree.NumberOfNodes);
60Assert.Equal(tree.NumericalSplitThresholds.Count, tree.NumberOfNodes);
96Assert.Equal(3, treeCollection.Trees.Count);
97Assert.Equal(3, treeCollection.TreeWeights.Count);
103Assert.Equal(tree.SplitGains.Count, tree.NumberOfNodes);
104Assert.Equal(tree.NumericalSplitThresholds.Count, tree.NumberOfNodes);
160Assert.Equal(shapeFunctionBins.Count, shapeFunctionValues.Count);
161Common.AssertFiniteNumbers(shapeFunctionBins as IList<double>, shapeFunctionBins.Count - 1);
198Assert.Equal(numTopics, ldaDetails.ItemScoresPerTopic.Count);
200Assert.Equal(numTopics, ldaDetails.WordScoresPerTopic.Count);
245Assert.Equal(numFeatures, weights.Count);
Microsoft.ML.Maml (2)
Microsoft.ML.OnnxTransformer (1)
Microsoft.ML.PerformanceTests (1)
Microsoft.ML.Samples (4)
Microsoft.ML.StandardTrainers (2)
Microsoft.ML.Tests (14)
Microsoft.ML.TimeSeries (30)
Microsoft.ML.Tokenizers (24)
Microsoft.ML.Tokenizers.Tests (113)
CodeGenTests.cs (38)
691Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
696Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
701Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
706Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
715Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
720Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
725Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
730Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
735Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
740Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
743Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]);
745Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]);
747Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]);
749Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]);
751Assert.NotEqual(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]);
753Assert.NotEqual(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]);
755Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]);
757Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]);
827Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
833Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
839Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
845Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
857Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
863Assert.Equal(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
869Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
875Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
881Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
887Assert.NotEqual(new Range(text.Length, text.Length), encoding[encoding.Count - 1].Offset);
891Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]);
894Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]);
897Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]);
900Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]);
903Assert.NotEqual(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]);
906Assert.NotEqual(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]);
909Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]);
912Assert.Equal(codeGenTokenizer.EndOfSentenceId.Value, ids[ids.Count - 1]);
998Assert.Equal(expectedTokenCount, ids.Count);
1003Assert.Equal(expectedTokenCount, ids.Count);
TiktokenTests.cs (20)
127Assert.Equal(externalEncoder.Count, encoder.Count);
157Assert.Equal(encoded.Count, idsCount);
211Assert.Equal(encoded.Count, idsCount);
219Assert.Equal(5584, encoded.Count);
221Assert.Equal(encoded.Count, idsCount);
251Assert.Equal(encoded.Count, idsCount);
281Assert.Equal(encoded.Count, idsCount);
295Assert.Equal(5609, encoded.Count);
296Assert.Equal(encoded.Count, idsCount);
318Assert.Equal(encoded.Count, idsCount);
332Assert.Equal(11378, encoded.Count);
333Assert.Equal(encoded.Count, idsCount);
351Assert.Equal(7230, encoded.Count);
352Assert.Equal(encoded.Count, idsCount);
370Assert.Equal(7230, encoded.Count);
371Assert.Equal(encoded.Count, idsCount);
389Assert.Equal(11378, encoded.Count);
390Assert.Equal(encoded.Count, idsCount);
558int entriesCount = GetEncoder((tokenizer as TiktokenTokenizer)!)!.Count;
Microsoft.ML.TorchSharp (10)
Microsoft.ML.Transforms (17)
Microsoft.VisualStudio.LanguageServices (10)
Microsoft.VisualStudio.LanguageServices.Implementation (18)
CodeModel\AbstractCodeModelService.AbstractCodeModelEventCollector.cs (18)
61var oldCount = oldChildren.Count;
62var newCount = newChildren.Count;
99var oldCount = oldChildren.Count;
100var newCount = newChildren.Count;
142Debug.Assert(oldChildren.Count == newChildren.Count);
152for (i = 0; i < oldChildren.Count; i++)
164for (; i < oldChildren.Count; i++)
195Debug.Assert(oldChildren.Count + delta == newChildren.Count);
206for (oldIndex = 0, newIndex = 0; newIndex < newChildren.Count; oldIndex++, newIndex++)
208if (oldIndex >= oldChildren.Count || !compare(oldChildren[oldIndex], newChildren[newIndex], newNodeParent, null))
218for (; newIndex < newChildren.Count; oldIndex++, newIndex++)
246Debug.Assert(oldChildren.Count - delta == newChildren.Count);
257for (oldIndex = 0, newIndex = 0; oldIndex < oldChildren.Count; oldIndex++, newIndex++)
259if (newIndex >= newChildren.Count || !compare(oldChildren[oldIndex], newChildren[newIndex], newNodeParent, null))
269for (; oldIndex < oldChildren.Count; oldIndex++, newIndex++)
MinimalSample (1)
PresentationBuildTasks (1)
PresentationCore (1)
PresentationFramework (25)
Roslyn.Diagnostics.Analyzers (38)
Roslyn.Test.PdbUtilities (1)
Roslyn.VisualStudio.Next.UnitTests (7)
Sample (2)
SemanticSearch.BuildTask (1)
Shared (6)
Shared.Tests (1)
Swaggatherer (4)
System.Collections.Concurrent (1)
System.Collections.Immutable (20)
System\Collections\Immutable\ImmutableList.cs (10)
149return list.IndexOf(item, 0, list.Count, EqualityComparer<T>.Default);
170return list.IndexOf(item, 0, list.Count, equalityComparer);
195return list.IndexOf(item, startIndex, list.Count - startIndex, EqualityComparer<T>.Default);
243if (list.Count == 0)
249return list.LastIndexOf(item, list.Count - 1, list.Count, EqualityComparer<T>.Default);
270if (list.Count == 0)
276return list.LastIndexOf(item, list.Count - 1, list.Count, equalityComparer);
301if (list.Count == 0 && startIndex == 0)
System.Formats.Nrbf (3)
System.Linq.Expressions (41)
System.Net.Http (2)
System.Private.CoreLib (6)
System.Private.Windows.Core (17)
System.Reflection.Metadata (8)
System.Windows.Forms (17)
System.Windows.Forms.Design (3)
System.Xaml (2)
Templates.Blazor.WebAssembly.Auth.Tests (1)
Templates.Blazor.WebAssembly.Tests (1)
Templates.Mvc.Tests (1)
Templates.Tests (1)
Test.Utilities (29)
Text.Analyzers (37)
xunit.assert (1)
xunit.console (1)