6217 references to Key
AnalyzerRunner (18)
DiagnosticAnalyzerRunner.cs (16)
126var sumOfDocumentAverages = documentPerformance.Where(x => x.Key.ProjectId == projectId).Sum(x => x.Value.EditsPerSecond);
127double documentCount = documentPerformance.Where(x => x.Key.ProjectId == projectId).Count();
134var slowestFiles = documentPerformance.OrderBy(pair => pair.Value.EditsPerSecond).GroupBy(pair => pair.Key.ProjectId);
141var document = solution.GetDocument(pair.Key);
235pair => pair.Key,
295.ToLookup(analyzers => analyzers.Key, analyzers => analyzers.Value)
356if (projectDiagnosticBuilder.TryGetValue(task.Key, out var previousResult))
360result.AnalyzerTelemetryInfo[pair.Key].ExecutionTime += pair.Value.ExecutionTime;
364projectDiagnosticBuilder[task.Key] = result;
419if (!telemetryInfoDictionary.TryGetValue(pair.Key, out var telemetry))
421telemetryInfoDictionary.Add(pair.Key, pair.Value);
430foreach (var pair in telemetryInfoDictionary.OrderBy(x => x.Key.GetType().Name, StringComparer.OrdinalIgnoreCase))
432WriteTelemetry(pair.Key.GetType().Name, pair.Value);
436var longestAnalyzerName = telemetryInfoDictionary.Select(x => x.Key.GetType().Name.Length).Max();
437foreach (var pair in telemetryInfoDictionary.OrderBy(x => x.Key.GetType().Name, StringComparer.OrdinalIgnoreCase))
439WriteExecutionTimes(pair.Key.GetType().Name, longestAnalyzerName, pair.Value);
Aspire.Azure.Messaging.EventHubs.Tests (2)
Aspire.Azure.Security.KeyVault.Tests (2)
Aspire.Confluent.Kafka (2)
Aspire.Confluent.Kafka.Tests (60)
Aspire8MetricsTests.cs (60)
79Assert.Contains(collectorProducerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
80Assert.Contains(collectorProducerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
83Assert.Contains(collectorConsumerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
84Assert.Contains(collectorConsumerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
87Assert.Contains(collectorProducerQueueSize.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
88Assert.Contains(collectorProducerQueueSize.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
91Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
92Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
93Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
96Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
97Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
98Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
101Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
102Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
103Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
106Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
107Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
108Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
111Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
112Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
113Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
116Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
117Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
118Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
121Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
122Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
123Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
126Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
127Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
128Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
194Assert.Contains(collectorProducerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
195Assert.Contains(collectorProducerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
198Assert.Contains(collectorConsumerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
199Assert.Contains(collectorConsumerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
202Assert.Contains(collectorProducerQueueSize.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
203Assert.Contains(collectorProducerQueueSize.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
206Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
207Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
208Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
211Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
212Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
213Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
216Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
217Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
218Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
221Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
222Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
223Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
226Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
227Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
228Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
231Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
232Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
233Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
236Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
237Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
238Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
241Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
242Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
243Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
Aspire.Dashboard (20)
Aspire.Dashboard.Components.Tests (9)
Aspire.Dashboard.Tests (89)
TelemetryRepositoryTests\LogTests.cs (10)
84Assert.Equal("Log", p.Key);
676Assert.Equal("Key0", p.Key);
681Assert.Equal("Key1", p.Key);
686Assert.Equal("Key2", p.Key);
691Assert.Equal("Key3", p.Key);
696Assert.Equal("Key4", p.Key);
896Assert.Equal("Log", p.Key);
919Assert.Equal("Log", p.Key);
992Assert.Equal("key-1", p.Key);
1003Assert.Equal("key-2", p.Key);
TelemetryRepositoryTests\MetricsTests.cs (22)
163Assert.Equal("Meter_Key0", p.Key);
168Assert.Equal("Meter_Key1", p.Key);
173Assert.Equal("Meter_Key2", p.Key);
178Assert.Equal("Meter_Key3", p.Key);
183Assert.Equal("Meter_Key4", p.Key);
192Assert.Equal("Meter_Key0", p.Key);
197Assert.Equal("Meter_Key1", p.Key);
202Assert.Equal("Meter_Key2", p.Key);
207Assert.Equal("Meter_Key3", p.Key);
212Assert.Equal("Meter_Key4", p.Key);
279Assert.Equal("Meter_Key0", p.Key);
288Assert.Equal("Meter_Key0", p.Key);
293Assert.Equal("Metric_Key0", p.Key);
298Assert.Equal("Metric_Key1", p.Key);
303Assert.Equal("Metric_Key2", p.Key);
308Assert.Equal("Metric_Key3", p.Key);
380Assert.Collection(instrumentData.KnownAttributeValues.OrderBy(kvp => kvp.Key),
383Assert.Equal("key1", e.Key);
388Assert.Equal("key2", e.Key);
397Assert.Equal("key1", exemplar.Attributes[0].Key);
423exemplar.FilteredAttributes.Add(new KeyValue { Key = attribute.Key, Value = new AnyValue { StringValue = attribute.Value } });
620Assert.Equal("key-1", knownValues.Key);
TelemetryRepositoryTests\OtlpHelpersTests.cs (22)
181Assert.Equal("key1", a.Key);
211Assert.Equal("key1", a.Key);
216Assert.Equal("key2", a.Key);
221Assert.Equal("key3", a.Key);
255Assert.Equal("key1", a.Key);
260Assert.Equal("key2", a.Key);
265Assert.Equal("key3", a.Key);
294Assert.Equal("parentkey1", a.Key);
299Assert.Equal("key1", a.Key);
330Assert.Equal("parentkey1", a.Key);
335Assert.Equal("key1", a.Key);
340Assert.Equal("key2", a.Key);
373Assert.Equal("parentkey1", a.Key);
378Assert.Equal("parentkey2", a.Key);
383Assert.Equal("parentkey3", a.Key);
406Assert.Equal("key1", a.Key);
411Assert.Equal("key2", a.Key);
442Assert.Equal("key1", a.Key);
447Assert.Equal("key2", a.Key);
490Assert.Equal("key1", a.Key);
495Assert.Equal("key2", a.Key);
500Assert.Equal("key3", a.Key);
TelemetryRepositoryTests\TraceTests.cs (18)
580Assert.Equal("key1", a.Key);
658Assert.Equal("key2", a.Key);
669Assert.Equal("key1", a.Key);
683Assert.Equal("key2", a.Key);
694Assert.Equal("key1", a.Key);
827Assert.Equal("Key0", p.Key);
832Assert.Equal("Key1", p.Key);
837Assert.Equal("Key2", p.Key);
842Assert.Equal("Key3", p.Key);
847Assert.Equal("Key4", p.Key);
1489Assert.Equal("prop1", p.Key);
1498Assert.Equal("prop1", p.Key);
1503Assert.Equal("prop2", p.Key);
1525Assert.Equal("prop1", p.Key);
1535Assert.Equal("prop1", p.Key);
1540Assert.Equal("prop2", p.Key);
1550Assert.Equal("prop1", p.Key);
1555Assert.Equal("prop2", p.Key);
Aspire.Elastic.Clients.Elasticsearch.Tests (2)
Aspire.EndToEnd.Tests (4)
Aspire.Hosting (7)
Aspire.Hosting.Analyzers (2)
Aspire.Hosting.Azure (3)
Aspire.Hosting.Azure.AppContainers (3)
Aspire.Hosting.Azure.ServiceBus (1)
Aspire.Hosting.Azure.Sql (4)
Aspire.Hosting.Elasticsearch.Tests (6)
Aspire.Hosting.Kafka.Tests (2)
Aspire.Hosting.Milvus.Tests (2)
Aspire.Hosting.MongoDB.Tests (5)
Aspire.Hosting.MySql.Tests (2)
Aspire.Hosting.Oracle.Tests (3)
Aspire.Hosting.PostgreSQL.Tests (12)
AddPostgresTests.cs (12)
77Assert.Equal("POSTGRES_HOST_AUTH_METHOD", env.Key);
82Assert.Equal("POSTGRES_INITDB_ARGS", env.Key);
87Assert.Equal("POSTGRES_USER", env.Key);
92Assert.Equal("POSTGRES_PASSWORD", env.Key);
131Assert.Equal("POSTGRES_HOST_AUTH_METHOD", env.Key);
136Assert.Equal("POSTGRES_INITDB_ARGS", env.Key);
141Assert.Equal("POSTGRES_USER", env.Key);
146Assert.Equal("POSTGRES_PASSWORD", env.Key);
222Assert.Equal("POSTGRES_HOST_AUTH_METHOD", env.Key);
227Assert.Equal("POSTGRES_INITDB_ARGS", env.Key);
232Assert.Equal("POSTGRES_USER", env.Key);
237Assert.Equal("POSTGRES_PASSWORD", env.Key);
Aspire.Hosting.Qdrant.Tests (6)
Aspire.Hosting.SqlServer.Tests (2)
Aspire.Hosting.Testing (5)
Aspire.Hosting.Testing.Tests (3)
Aspire.Hosting.Tests (56)
Dashboard\DashboardResourceTests.cs (19)
112Assert.Equal("ASPNETCORE_ENVIRONMENT", e.Key);
117Assert.Equal("ASPNETCORE_URLS", e.Key);
122Assert.Equal("DOTNET_RESOURCE_SERVICE_ENDPOINT_URL", e.Key);
127Assert.Equal("DOTNET_DASHBOARD_OTLP_ENDPOINT_URL", e.Key);
132Assert.Equal("DASHBOARD__FRONTEND__AUTHMODE", e.Key);
137Assert.Equal("DASHBOARD__RESOURCESERVICECLIENT__AUTHMODE", e.Key);
142Assert.Equal("DASHBOARD__OTLP__AUTHMODE", e.Key);
147Assert.Equal("LOGGING__CONSOLE__FORMATTERNAME", e.Key);
213Assert.Equal("BrowserToken", config.Single(e => e.Key == DashboardConfigNames.DashboardFrontendAuthModeName.EnvVarName).Value);
214Assert.Equal("TestBrowserToken!", config.Single(e => e.Key == DashboardConfigNames.DashboardFrontendBrowserTokenName.EnvVarName).Value);
216Assert.Equal("ApiKey", config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpAuthModeName.EnvVarName).Value);
217Assert.Equal("TestOtlpApiKey!", config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpPrimaryApiKeyName.EnvVarName).Value);
248Assert.Equal("Unsecured", config.Single(e => e.Key == DashboardConfigNames.DashboardFrontendAuthModeName.EnvVarName).Value);
249Assert.Equal("Unsecured", config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpAuthModeName.EnvVarName).Value);
280Assert.Equal("http://localhost:5000", config.Single(e => e.Key == DashboardConfigNames.ResourceServiceUrlName.EnvVarName).Value);
322Assert.Equal(expectedAllowedOrigins, config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpCorsAllowedOriginsKeyName.EnvVarName).Value);
323Assert.Equal("*", config.Single(e => e.Key == DashboardConfigNames.DashboardOtlpCorsAllowedHeadersKeyName.EnvVarName).Value);
359Assert.DoesNotContain(config, e => e.Key == DashboardConfigNames.DashboardOtlpCorsAllowedOriginsKeyName.EnvVarName);
360Assert.DoesNotContain(config, e => e.Key == DashboardConfigNames.DashboardOtlpCorsAllowedHeadersKeyName.EnvVarName);
ProjectResourceTests.cs (17)
83Assert.Equal("OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES", env.Key);
88Assert.Equal("OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES", env.Key);
93Assert.Equal("OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY", env.Key);
98Assert.Equal("OTEL_DOTNET_EXPERIMENTAL_ASPNETCORE_DISABLE_URL_QUERY_REDACTION", env.Key);
103Assert.Equal("OTEL_DOTNET_EXPERIMENTAL_HTTPCLIENT_DISABLE_URL_QUERY_REDACTION", env.Key);
108Assert.Equal("OTEL_EXPORTER_OTLP_ENDPOINT", env.Key);
113Assert.Equal("OTEL_EXPORTER_OTLP_PROTOCOL", env.Key);
118Assert.Equal("OTEL_RESOURCE_ATTRIBUTES", env.Key);
123Assert.Equal("OTEL_SERVICE_NAME", env.Key);
128Assert.Equal("OTEL_EXPORTER_OTLP_HEADERS", env.Key);
135Assert.Equal("OTEL_BLRP_SCHEDULE_DELAY", env.Key);
140Assert.Equal("OTEL_BSP_SCHEDULE_DELAY", env.Key);
145Assert.Equal("OTEL_METRIC_EXPORT_INTERVAL", env.Key);
150Assert.Equal("OTEL_TRACES_SAMPLER", env.Key);
155Assert.Equal("OTEL_METRICS_EXEMPLAR_FILTER", env.Key);
160Assert.Equal("DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION", env.Key);
165Assert.Equal("LOGGING__CONSOLE__FORMATTERNAME", env.Key);
Aspire.Microsoft.Data.SqlClient (2)
Aspire.Microsoft.EntityFrameworkCore.SqlServer (2)
Aspire.Milvus.Client.Tests (1)
Aspire.MongoDB.Driver.Tests (2)
Aspire.MongoDB.Driver.v3.Tests (2)
Aspire.NATS.Net.Tests (2)
Aspire.Oracle.EntityFrameworkCore.Tests (2)
Aspire.Playground.Tests (3)
Aspire.Qdrant.Client.Tests (1)
Aspire.RabbitMQ.Client.Tests (7)
Aspire.RabbitMQ.Client.v7.Tests (7)
Aspire.StackExchange.Redis (2)
Aspire.StackExchange.Redis.DistributedCaching.Tests (3)
Aspire.StackExchange.Redis.OutputCaching.Tests (3)
Aspire.StackExchange.Redis.Tests (1)
Aspire.Workload.Tests (4)
AuthSamples.FunctionalTests (4)
AzureAppServicesHostingStartupSample (1)
AzureAppServicesSample (1)
BasicWebSite (4)
Binding.Http.IntegrationTests (4)
BuildBoss (3)
BuildValidator (1)
Client.ClientBase.IntegrationTests (1)
ConfigurationSchemaGenerator (2)
CookiePolicySample (1)
DefaultBuilder.SampleApp (1)
dotnet-openapi (2)
dotnet-svcutil-lib (68)
dotnet-svcutil-lib.Tests (1)
dotnet-user-jwts (3)
dotnet-user-secrets (5)
FilesWebSite (1)
GenerateRulesMissingDocumentation (1)
GenericHostWebSite (4)
GetDocument.Insider (2)
HeaderPropagationSample (3)
HealthChecksSample (2)
http2cat (3)
HttpLogging.Sample (2)
HttpOverridesSample (1)
IIS.FunctionalTests (2)
IIS.LongTests (1)
IIS.NewHandler.FunctionalTests (1)
IIS.NewShim.FunctionalTests (1)
IISExpress.FunctionalTests (2)
IISSample (1)
illink (13)
ILLink.RoslynAnalyzer (9)
ILLink.Tasks (3)
InMemory.FunctionalTests (36)
InProcessWebSite (2)
installer.tasks (4)
Interop.FunctionalTests (8)
InteropTests (1)
InteropWebsite (1)
Microsoft.Analyzers.Extra (3)
Microsoft.Analyzers.Local (4)
Microsoft.Arcade.Common (1)
Microsoft.Arcade.Test.Common (1)
Microsoft.AspNetCore.Analyzers (1)
Microsoft.AspNetCore.App.Analyzers (5)
Microsoft.AspNetCore.App.Analyzers.Test (4)
Microsoft.AspNetCore.App.CodeFixes (5)
Microsoft.AspNetCore.Authentication (2)
Microsoft.AspNetCore.Authentication.Cookies (1)
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
Microsoft.AspNetCore.Authentication.OAuth (1)
Microsoft.AspNetCore.Authentication.OpenIdConnect (6)
OpenIdConnectHandler.cs (6)
112message = new OpenIdConnectMessage(Request.Query.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray())));
127message = new OpenIdConnectMessage(form.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray())));
316var message = new OpenIdConnectMessage(Request.Query.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray())));
455message.Parameters.Add(additionalParameter.Key, additionalParameter.Value);
639authorizationResponse = new OpenIdConnectMessage(Request.Query.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray())));
666authorizationResponse = new OpenIdConnectMessage(form.Select(pair => new KeyValuePair<string, string[]>(pair.Key, pair.Value.ToArray())));
Microsoft.AspNetCore.Authentication.Test (10)
Microsoft.AspNetCore.Authentication.Twitter (5)
Microsoft.AspNetCore.Authentication.WsFederation (2)
Microsoft.AspNetCore.Authorization (1)
Microsoft.AspNetCore.BrowserTesting (3)
Microsoft.AspNetCore.Components (27)
src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (8)
258Add(kvp.Key, kvp.Value);
328keys[i] = array[i].Key;
360Add(item.Key, item.Value);
411return TryGetValue(item.Key, out var value) && EqualityComparer<object>.Default.Equals(value, item.Value);
493var index = FindIndex(item.Key);
715if (string.Equals(array[i].Key, key, StringComparison.OrdinalIgnoreCase))
735if (string.Equals(array[i].Key, key, StringComparison.OrdinalIgnoreCase))
758if (string.Equals(array[i].Key, key, StringComparison.OrdinalIgnoreCase))
Microsoft.AspNetCore.Components.Analyzers (1)
Microsoft.AspNetCore.Components.Endpoints (7)
Microsoft.AspNetCore.Components.Endpoints.Tests (9)
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
Microsoft.AspNetCore.Components.Server (1)
Microsoft.AspNetCore.Components.Server.Tests (1)
Microsoft.AspNetCore.Components.Tests (13)
Microsoft.AspNetCore.Components.Web (1)
Microsoft.AspNetCore.Components.WebAssembly.Tests (4)
Microsoft.AspNetCore.Components.WebView (3)
Microsoft.AspNetCore.Components.WebView.Test (4)
Microsoft.AspNetCore.Components.WebView.WindowsForms (1)
Microsoft.AspNetCore.Components.WebView.Wpf (1)
Microsoft.AspNetCore.Connections.Abstractions (3)
Microsoft.AspNetCore.CookiePolicy (2)
Microsoft.AspNetCore.Cors (1)
Microsoft.AspNetCore.Cors.Test (26)
CorsMiddlewareTests.cs (26)
201response.Headers.OrderBy(h => h.Key),
204Assert.Equal(CorsConstants.AccessControlAllowHeaders, kvp.Key);
209Assert.Equal(CorsConstants.AccessControlAllowMethods, kvp.Key);
214Assert.Equal(CorsConstants.AccessControlAllowOrigin, kvp.Key);
267response.Headers.OrderBy(h => h.Key),
270Assert.Equal(CorsConstants.AccessControlAllowCredentials, kvp.Key);
275Assert.Equal(CorsConstants.AccessControlAllowHeaders, kvp.Key);
280Assert.Equal(CorsConstants.AccessControlAllowMethods, kvp.Key);
285Assert.Equal(CorsConstants.AccessControlAllowOrigin, kvp.Key);
488response.Headers.OrderBy(h => h.Key),
491Assert.Equal(CorsConstants.AccessControlAllowHeaders, kvp.Key);
496Assert.Equal(CorsConstants.AccessControlAllowMethods, kvp.Key);
501Assert.Equal(CorsConstants.AccessControlAllowOrigin, kvp.Key);
545response.Headers.OrderBy(o => o.Key),
548Assert.Equal(CorsConstants.AccessControlAllowOrigin, kvp.Key);
553Assert.Equal(CorsConstants.AccessControlExposeHeaders, kvp.Key);
558Assert.Equal("Test", kvp.Key);
623response.Headers.OrderBy(o => o.Key),
626Assert.Equal(CorsConstants.AccessControlAllowOrigin, kvp.Key);
631Assert.Equal(CorsConstants.AccessControlExposeHeaders, kvp.Key);
668response.Headers.OrderBy(o => o.Key),
671Assert.Equal(CorsConstants.AccessControlAllowHeaders, kvp.Key);
676Assert.Equal(CorsConstants.AccessControlAllowOrigin, kvp.Key);
990Assert.Contains(httpContext.Items, item => string.Equals(item.Key as string, "__CorsMiddlewareWithEndpointInvoked"));
1014Assert.Contains(httpContext.Items, item => string.Equals(item.Key as string, "__CorsMiddlewareWithEndpointInvoked"));
1038Assert.DoesNotContain(httpContext.Items, item => string.Equals(item.Key as string, "__CorsMiddlewareWithEndpointInvoked"));
Microsoft.AspNetCore.DataProtection (3)
Microsoft.AspNetCore.DataProtection.Tests (2)
Microsoft.AspNetCore.Diagnostics (16)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (2)
Microsoft.AspNetCore.Diagnostics.Middleware (4)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (118)
Logging\AcceptanceTests.cs (83)
186Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.RequestBody);
187Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix));
188Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix));
189Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value));
190Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == TelemetryConstants.Unknown);
191Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus);
192Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Post.ToString());
193Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration &&
199Assert.Single(state, x => x.Key == HttpLoggingTagNames.ResponseBody && x.Value == "Server: hello!Server: world!");
204Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.ResponseBody);
246Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.ResponseBody);
247Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix));
248Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix));
249Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value));
250Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == TelemetryConstants.Unknown);
251Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus);
252Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Post.ToString());
253Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration &&
259Assert.Single(state, x => x.Key == HttpLoggingTagNames.RequestBody && x.Value == Content);
264Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.RequestBody);
317Assert.DoesNotContain(requestState, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix));
318Assert.DoesNotContain(requestState, x => x.Key == HttpLoggingTagNames.StatusCode);
319Assert.DoesNotContain(requestState, x => x.Key == HttpLoggingTagNames.Duration);
320Assert.Single(requestState, x => x.Key == HttpLoggingTagNames.RequestHeaderPrefix + NormalizedRequestHeader);
321Assert.Single(requestState, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value));
322Assert.Single(requestState, x => x.Key == HttpLoggingTagNames.Path && x.Value == TelemetryConstants.Unknown);
323Assert.Single(requestState, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Post.ToString());
324Assert.Single(requestState, x => x.Key == "Protocol" && x.Value == "HTTP/1.1");
327Assert.Single(requestBodyState, x => x.Key == "Body" && x.Value == Content);
330Assert.Single(responseState, x => x.Key == HttpLoggingTagNames.ResponseHeaderPrefix + NormalizedResponseHeader);
331Assert.Single(responseState, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus);
334Assert.Single(responseBodyState, x => x.Key == "Body" && x.Value == "Server: hello!Server: world!");
337Assert.Single(durationState, x => x.Key == HttpLoggingTagNames.Duration && x.Value != null);
375Assert.Single(state, x => x.Key == HttpLoggingTagNames.RequestHeaderPrefix + NormalizedRequestHeader);
376Assert.Single(state, x => x.Key == HttpLoggingTagNames.ResponseHeaderPrefix + NormalizedResponseHeader);
377Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value));
378Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == TelemetryConstants.Unknown);
379Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus);
380Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration &&
384Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString());
385Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.RequestBody);
386Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.ResponseBody);
388x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix) && !x.Key.EndsWith(NormalizedRequestHeader));
391x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix) && !x.Key.EndsWith(NormalizedResponseHeader));
421Assert.Single(state, x => x.Key == TestHttpLogEnricher.Key1 && x.Value == TestHttpLogEnricher.Value1);
422Assert.Single(state, x => x.Key == TestHttpLogEnricher.Key2 && x.Value == TestHttpLogEnricher.Value2.ToString(CultureInfo.InvariantCulture));
423Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Delete.ToString());
424Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.RequestBody);
425Assert.DoesNotContain(state, x => x.Key == HttpLoggingTagNames.ResponseBody);
426Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix));
427Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix));
463Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == RequestPath);
495Assert.DoesNotContain(firstState, x => x.Key == TestHttpLogEnricher.Key1 && x.Value == TestHttpLogEnricher.Value1);
496Assert.DoesNotContain(firstState, x => x.Key == TestHttpLogEnricher.Key2 && x.Value == TestHttpLogEnricher.Value2.ToString(CultureInfo.InvariantCulture));
499Assert.Single(secondState, x => x.Key == TestHttpLogEnricher.Key1 && x.Value == TestHttpLogEnricher.Value1);
500Assert.Single(secondState, x => x.Key == TestHttpLogEnricher.Key2 && x.Value == TestHttpLogEnricher.Value2.ToString(CultureInfo.InvariantCulture));
540Assert.DoesNotContain(firstRecord, x => x.Key == HttpLoggingTagNames.StatusCode);
541Assert.DoesNotContain(firstRecord, x => x.Key == HttpLoggingTagNames.Duration);
542Assert.DoesNotContain(secondRecord!, x => x.Key == HttpLoggingTagNames.Duration);
543Assert.DoesNotContain(fourthRecord, x => x.Key == HttpLoggingTagNames.StatusCode);
544Assert.DoesNotContain(fourthRecord, x => x.Key == HttpLoggingTagNames.Duration);
545Assert.DoesNotContain(fithRecord!, x => x.Key == HttpLoggingTagNames.Duration);
549Assert.Single(secondRecord!, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus);
550Assert.Single(fithRecord!, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus);
554Assert.Single(thirdRecord, x => x.Key == HttpLoggingTagNames.Duration && x.Value != null);
555Assert.Single(sixthRecord, x => x.Key == HttpLoggingTagNames.Duration && x.Value != null);
580Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix));
581Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix));
582Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString());
583Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value));
584Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == TelemetryConstants.Unknown);
585Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == expectedStatus);
586Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration &&
621Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix));
622Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix));
623Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Put.ToString());
624Assert.Single(state, x => x.Key == HttpLoggingTagNames.RequestBody && x.Value == Content);
625Assert.Single(state, x => x.Key == HttpLoggingTagNames.ResponseBody && x.Value == "test body");
655Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.RequestHeaderPrefix));
656Assert.DoesNotContain(state, x => x.Key.StartsWith(HttpLoggingTagNames.ResponseHeaderPrefix));
657Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Put.ToString());
Logging\AcceptanceTests.Mvc.cs (33)
80Assert.DoesNotContain(state, x => x.Key == QueryParamName);
81Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value));
82Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == redactedPath);
83Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus);
84Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString());
85Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration &&
116Assert.Single(state, x => x.Key == UserIdParamName && x.Value == redactedUserId);
117Assert.Single(state, x => x.Key == NoDataClassParamName && x.Value == TelemetryConstants.Redacted);
118Assert.DoesNotContain(state, x => x.Key == QueryParamName);
119Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value));
120Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == ActionRouteTemplate);
121Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus);
122Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString());
123Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration &&
165Assert.Single(state, x => x.Key == UserIdParamName && x.Value == redactedUserId);
166Assert.Single(state, x => x.Key == NoDataClassParamName && x.Value == NoDataClassParamValue);
169Assert.DoesNotContain(state, x => x.Key == QueryParamName);
170Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value));
172Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == expectedPath);
173Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus);
174Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString());
175Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration &&
205Assert.DoesNotContain(state, x => x.Key == QueryParamName);
206Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value));
207Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == $"/api/users/testUserId/someTestData");
208Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus);
209Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString());
210Assert.Single(state, x => x.Key == HttpLoggingTagNames.Duration &&
248Assert.DoesNotContain(state, x => x.Key == QueryParamName);
249Assert.Single(state, x => x.Key == HttpLoggingTagNames.Host && !string.IsNullOrEmpty(x.Value));
250Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == expectedPath);
251Assert.Single(state, x => x.Key == HttpLoggingTagNames.StatusCode && x.Value == responseStatus);
252Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Get.ToString());
Microsoft.AspNetCore.Diagnostics.Tests (1)
Microsoft.AspNetCore.Grpc.JsonTranscoding (9)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (1)
Microsoft.AspNetCore.Grpc.Swagger (2)
Microsoft.AspNetCore.HeaderParsing (1)
Microsoft.AspNetCore.Hosting (10)
Microsoft.AspNetCore.Hosting.Abstractions (1)
Microsoft.AspNetCore.Hosting.Tests (19)
HostingApplicationDiagnosticsTests.cs (19)
508if (pair.Key == "Microsoft.AspNetCore.Hosting.HttpRequestIn.Start")
514if (pair.Key == "Microsoft.AspNetCore.Hosting.HttpRequestIn.Stop")
547eventsFired |= pair.Key.StartsWith("Microsoft.AspNetCore.Hosting.HttpRequestIn", StringComparison.Ordinal);
581eventsFired |= pair.Key.StartsWith("Microsoft.AspNetCore.Hosting.HttpRequestIn", StringComparison.Ordinal);
616if (pair.Key == "Microsoft.AspNetCore.Hosting.HttpRequestIn.Start")
640if (pair.Key == "Microsoft.AspNetCore.Hosting.HttpRequestIn.Stop")
665if (pair.Key == "Microsoft.AspNetCore.Hosting.HttpRequestIn.Stop")
689if (pair.Key == "Microsoft.AspNetCore.Hosting.UnhandledException")
751Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1");
752Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value2");
780Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1");
781Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value2");
810Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1");
811Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value2");
841Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value3");
842Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value4");
908Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1/1");
943Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1");
944Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value2");
Microsoft.AspNetCore.Http (21)
Microsoft.AspNetCore.Http.Abstractions (16)
Routing\RouteValueDictionary.cs (11)
75if (items[start].Key != null)
79else if (items[end].Key != null)
219Add(kvp.Key, kvp.Value);
258Add(kvp.Key, kvp.Value);
328keys[i] = array[i].Key;
360Add(item.Key, item.Value);
411return TryGetValue(item.Key, out var value) && EqualityComparer<object>.Default.Equals(value, item.Value);
493var index = FindIndex(item.Key);
715if (string.Equals(array[i].Key, key, StringComparison.OrdinalIgnoreCase))
735if (string.Equals(array[i].Key, key, StringComparison.OrdinalIgnoreCase))
758if (string.Equals(array[i].Key, key, StringComparison.OrdinalIgnoreCase))
Microsoft.AspNetCore.Http.Abstractions.Tests (78)
HttpValidationProblemDetailsJsonConverterTest.cs (12)
75Assert.Equal("traceId", kvp.Key);
79problemDetails.Errors.OrderBy(kvp => kvp.Key),
82Assert.Equal("key0", kvp.Key);
87Assert.Equal("key1", kvp.Key);
116Assert.Equal("traceId", kvp.Key);
120problemDetails.Errors.OrderBy(kvp => kvp.Key),
123Assert.Equal("key0", kvp.Key);
128Assert.Equal("key1", kvp.Key);
155Assert.Equal("traceId", kvp.Key);
159problemDetails.Errors.OrderBy(kvp => kvp.Key),
162Assert.Equal("key0", kvp.Key);
167Assert.Equal("key1", kvp.Key);
RouteValueDictionaryTests.cs (62)
87yield return new object[] { routeValues.ToDictionary(kvp => kvp.Key, kvp => kvp.Value) };
106yield return new object[] { routeValues.ToDictionary(kvp => kvp.Key, kvp => kvp.Value) };
124dict.OrderBy(kvp => kvp.Key),
127Assert.Equal("Address", kvp.Key);
132kvp => { Assert.Equal("Age", kvp.Key); Assert.Equal(30, kvp.Value); },
133kvp => { Assert.Equal("Name", kvp.Key); Assert.Equal("James", kvp.Value); });
146dict.OrderBy(kvp => kvp.Key),
147kvp => { Assert.Equal("First Name", kvp.Key); Assert.Equal("James", kvp.Value); },
148kvp => { Assert.Equal("Last Name", kvp.Key); Assert.Equal("Henrik", kvp.Value); },
149kvp => { Assert.Equal("Middle Name", kvp.Key); Assert.Equal("Bob", kvp.Value); });
198dict.OrderBy(kvp => kvp.Key),
199kvp => { Assert.Equal("awesome", kvp.Key); Assert.Equal(123, kvp.Value); },
200kvp => { Assert.Equal("cool", kvp.Key); Assert.Equal("beans", kvp.Value); });
215dict.OrderBy(kvp => kvp.Key),
218Assert.Equal("CoolnessFactor", kvp.Key);
223Assert.Equal("IsAwesome", kvp.Key);
241dict.OrderBy(kvp => kvp.Key),
244Assert.Equal("IsPublic", kvp.Key);
293dict.OrderBy(kvp => kvp.Key),
296Assert.Equal("DerivedProperty", kvp.Key);
302Assert.Equal("TotallySweetProperty", kvp.Key);
321dict.OrderBy(kvp => kvp.Key),
322kvp => { Assert.Equal("DerivedProperty", kvp.Key); Assert.Equal(5, kvp.Value); });
374dict.OrderBy(kvp => kvp.Key),
375kvp => { Assert.Equal("City", kvp.Key); Assert.Equal("Singapore", kvp.Value); },
376kvp => { Assert.Equal("State", kvp.Key); Assert.Null(kvp.Value); });
392dict.OrderBy(kvp => kvp.Key),
393kvp => { Assert.Equal("City", kvp.Key); Assert.Equal("Singapore", kvp.Value); },
394kvp => { Assert.Equal("State", kvp.Key); Assert.Null(kvp.Value); });
580Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
595dict.OrderBy(kvp => kvp.Key),
596kvp => { Assert.Equal("age", kvp.Key); Assert.Equal(30, kvp.Value); },
597kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
611Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
625Assert.Collection(dict, kvp => { Assert.Equal("kEy", kvp.Key); Assert.Equal("value", kvp.Value); });
643dict.OrderBy(kvp => kvp.Key),
644kvp => { Assert.Equal("age", kvp.Key); Assert.Equal(30, kvp.Value); },
645kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
662Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
679Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
827Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
855dict.OrderBy(kvp => kvp.Key),
856kvp => { Assert.Equal("age", kvp.Key); Assert.Equal(30, kvp.Value); },
857kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
883dict.OrderBy(kvp => kvp.Key),
884kvp => { Assert.Equal("age", kvp.Key); Assert.Equal(30, kvp.Value); },
885kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
905dict.OrderBy(kvp => kvp.Key),
906kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
926dict.OrderBy(kvp => kvp.Key),
927kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
945dict.OrderBy(kvp => kvp.Key),
946kvp => { Assert.Equal("age", kvp.Key); Assert.Equal(30, kvp.Value); },
947kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
1373Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
1394Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
1450Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
1498Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
1594Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
1647Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
2079Assert.Equal("key", storage[0].Key);
2081Assert.Equal("key3", storage[1].Key);
Microsoft.AspNetCore.Http.Connections (1)
Microsoft.AspNetCore.Http.Connections.Client (8)
Microsoft.AspNetCore.Http.Extensions (2)
Microsoft.AspNetCore.Http.Extensions.Tests (10)
Microsoft.AspNetCore.Http.Features (1)
Microsoft.AspNetCore.Http.Microbenchmarks (36)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (2)
Microsoft.AspNetCore.Http.Results.Tests (1)
Microsoft.AspNetCore.HttpLogging (2)
Microsoft.AspNetCore.HttpsPolicy.Tests (1)
Microsoft.AspNetCore.Identity.FunctionalTests (6)
Microsoft.AspNetCore.Identity.InMemory.Test (1)
Microsoft.AspNetCore.InternalTesting (5)
Microsoft.AspNetCore.InternalTesting.Tests (1)
Microsoft.AspNetCore.JsonPatch.Tests (1)
Microsoft.AspNetCore.Mvc.Abstractions (3)
Microsoft.AspNetCore.Mvc.Abstractions.Test (20)
ModelBinding\ModelStateDictionaryTest.cs (20)
297Assert.Equal("some key", kvp.Key);
314Assert.Equal("some key", kvp.Key);
335Assert.Equal("some key", kvp.Key);
1011Assert.Equal("key", entry.Key);
1039Assert.Equal("key", entry.Key);
1065Assert.Equal("key", entry.Key);
1126Assert.Equal("key", entry.Key);
1155Assert.Equal("key", entry.Key);
1182Assert.Equal("key", entry.Key);
1217Assert.Equal("key", entry.Key);
1235Assert.Equal("key", entry.Key);
1255Assert.Equal("key", entry.Key);
1275Assert.Equal("key", entry.Key);
1414Assert.Equal("Property1", entry.Key);
1422Assert.Equal("Property4", entry.Key);
1430Assert.Equal("Property1.Property2", entry.Key);
1438Assert.Equal("Property2[Property3]", entry.Key);
1460Assert.Equal("prop", entry.Key);
1465Assert.Equal("property", entry.Key);
1470Assert.Equal("property_name", entry.Key);
Microsoft.AspNetCore.Mvc.Analyzers (2)
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
Microsoft.AspNetCore.Mvc.Core (31)
Microsoft.AspNetCore.Mvc.Core.Test (252)
ApplicationModels\ControllerActionDescriptorProviderTests.cs (12)
244var controller = Assert.Single(action.RouteValues, kvp => kvp.Key.Equals("controller"));
247var actionConstraint = Assert.Single(action.RouteValues, kvp => kvp.Key.Equals("action"));
345var controller = Assert.Single(action.RouteValues, kvp => kvp.Key.Equals("controller"));
348var actionConstraint = Assert.Single(action.RouteValues, kvp => kvp.Key.Equals("action"));
375c.Key == "controller" &&
380c.Key == "action" &&
385c.Key == "key" &&
392c.Key == "controller" &&
397c.Key == "action" &&
905var controllerDefault = Assert.Single(indexAction.RouteValues, rd => rd.Key.Equals("controller", StringComparison.OrdinalIgnoreCase));
908var actionDefault = Assert.Single(indexAction.RouteValues, rd => rd.Key.Equals("action", StringComparison.OrdinalIgnoreCase));
911var areaDefault = Assert.Single(indexAction.RouteValues, rd => rd.Key.Equals("area", StringComparison.OrdinalIgnoreCase));
Builder\MvcAreaRouteBuilderExtensionsTest.cs (34)
29route.Constraints.OrderBy(kvp => kvp.Key),
32Assert.Equal("area", kvp.Key);
37route.Defaults.OrderBy(kvp => kvp.Key),
40Assert.Equal("area", kvp.Key);
64route.Constraints.OrderBy(kvp => kvp.Key),
67Assert.Equal("area", kvp.Key);
72route.Defaults.OrderBy(kvp => kvp.Key),
75Assert.Equal("action", kvp.Key);
80Assert.Equal("area", kvp.Key);
105route.Constraints.OrderBy(kvp => kvp.Key),
108Assert.Equal("area", kvp.Key);
113Assert.Equal("id", kvp.Key);
118route.Defaults.OrderBy(kvp => kvp.Key),
121Assert.Equal("action", kvp.Key);
126Assert.Equal("area", kvp.Key);
152route.Constraints.OrderBy(kvp => kvp.Key),
155Assert.Equal("area", kvp.Key);
160Assert.Equal("id", kvp.Key);
164route.DataTokens.OrderBy(kvp => kvp.Key),
167Assert.Equal("some_token", kvp.Key);
171route.Defaults.OrderBy(kvp => kvp.Key),
174Assert.Equal("action", kvp.Key);
179Assert.Equal("area", kvp.Key);
205route.Constraints.OrderBy(kvp => kvp.Key),
208Assert.Equal("area", kvp.Key);
212route.DataTokens.OrderBy(kvp => kvp.Key),
215Assert.Equal("some_token", kvp.Key);
219route.Defaults.OrderBy(kvp => kvp.Key),
222Assert.Equal("area", kvp.Key);
243route.Constraints.OrderBy(kvp => kvp.Key),
246Assert.Equal("area", kvp.Key);
253routeKey: kvp.Key,
261route.Defaults.OrderBy(kvp => kvp.Key),
264Assert.Equal("area", kvp.Key);
Formatters\JsonInputFormatterTestBase.cs (18)
148formatterContext.ModelState.OrderBy(k => k.Key),
151Assert.Equal(expectedKey, kvp.Key);
175formatterContext.ModelState.OrderBy(k => k.Key),
178Assert.Equal(expectedKey, kvp.Key);
203formatterContext.ModelState.OrderBy(k => k.Key),
206Assert.Equal(expectedKey, kvp.Key);
326Assert.Collection(formatterContext.ModelState.OrderBy(k => k.Key),
329Assert.Equal(expectedKey, kvp.Key);
352Assert.Collection(formatterContext.ModelState.OrderBy(k => k.Key),
355Assert.Equal(expectedKey, kvp.Key);
379Assert.Collection(formatterContext.ModelState.OrderBy(k => k.Key),
382Assert.Equal(expectedValue, kvp.Key);
405formatterContext.ModelState.OrderBy(k => k.Key),
408Assert.Equal(expectedKey, kvp.Key);
486Assert.Collection(formatterContext.ModelState.OrderBy(k => k.Key),
489Assert.Equal(expectedKey, kvp.Key);
511formatterContext.ModelState.OrderBy(k => k.Key),
514Assert.Equal(ReadAsync_NestedParseError_Expected, kvp.Key);
Infrastructure\ValidationProblemDetailsJsonConverterTest.cs (12)
41Assert.Equal("traceId", kvp.Key);
45problemDetails.Errors.OrderBy(kvp => kvp.Key),
48Assert.Equal("key0", kvp.Key);
53Assert.Equal("key1", kvp.Key);
81Assert.Equal("traceId", kvp.Key);
85problemDetails.Errors.OrderBy(kvp => kvp.Key),
88Assert.Equal("key0", kvp.Key);
93Assert.Equal("key1", kvp.Key);
119Assert.Equal("traceId", kvp.Key);
123problemDetails.Errors.OrderBy(kvp => kvp.Key),
126Assert.Equal("key0", kvp.Key);
131Assert.Equal("key1", kvp.Key);
ModelBinding\Binders\BodyModelBinderTests.cs (10)
71Assert.Equal(string.Empty, entry.Key);
96Assert.Equal("custom", entry.Key);
154Assert.Equal("custom", entry.Key);
276Assert.Equal(string.Empty, entry.Key);
319Assert.Equal(string.Empty, entry.Key);
350Assert.Equal(string.Empty, entry.Key);
390Assert.Equal(string.Empty, entry.Key);
421Assert.Equal(string.Empty, entry.Key);
501Assert.Equal(string.Empty, entry.Key);
557Assert.Equal(string.Empty, entry.Key);
ModelBinding\Binders\DictionaryModelBinderTest.cs (6)
288var stringDictionary = dictionary.ToDictionary(kvp => kvp.Key.ToString(CultureInfo.InvariantCulture), kvp => kvp.Value.ToString(CultureInfo.InvariantCulture));
373}.OrderBy(kvp => kvp.Key),
491Assert.Equal("modelName", keyValuePair.Key);
642kvp => string.Format(CultureInfo.InvariantCulture, keyFormat, kvp.Key),
658kvp => string.Format(CultureInfo.InvariantCulture, keyFormat, kvp.Key),
679valueProvider.Add(kvp.Key, string.Empty);
ModelBinding\ParameterBinderTest.cs (13)
79Assert.Equal("myParam", actionContext.ModelState.Single().Key);
117Assert.Equal("myParam", actionContext.ModelState.Single().Key);
218Assert.Equal(expectedKey, modelState.Key);
255Assert.Equal("myParam", actionContext.ModelState.Single().Key);
296Assert.Equal("myParam", actionContext.ModelState.Single().Key);
352Assert.Equal($"{parameter.Name}.{nameof(DerivedPerson.DerivedProperty)}", kvp.Key);
407Assert.Equal(parameter.Name, kvp.Key);
462Assert.Equal($"{property.Name}.{nameof(DerivedPerson.DerivedProperty)}", kvp.Key);
516Assert.Equal($"{property.Name}", kvp.Key);
574Assert.Equal("id", kvp.Key);
635Assert.Empty(kvp.Key);
642Assert.Equal("id", kvp.Key);
700Assert.Equal("id", keyValuePair.Key);
ModelBinding\PrefixContainerTest.cs (12)
210Assert.Collection(result.OrderBy(k => k.Key, StringComparer.OrdinalIgnoreCase),
213Assert.Equal("0", item.Key);
218Assert.Equal("foo", item.Key);
223Assert.Equal("item1", item.Key);
253Assert.Collection(result.OrderBy(k => k.Key, StringComparer.OrdinalIgnoreCase),
256Assert.Equal("0", item.Key);
261Assert.Equal("1", item.Key);
266Assert.Equal("age", item.Key);
271Assert.Equal("name", item.Key);
287Assert.Collection(result.OrderBy(k => k.Key, StringComparer.OrdinalIgnoreCase),
290Assert.Equal("0", item.Key);
295Assert.Equal("1", item.Key);
ModelBinding\Validation\DefaultObjectValidatorTests.cs (13)
417Assert.Equal("FirstName", state.Key);
423Assert.Equal("Address.City", state.Key);
451Assert.Equal("invalidProperties.FirstName", state.Key);
457Assert.Equal("invalidProperties.Address.City", state.Key);
538Assert.Equal("parameter", entry.Key);
544Assert.Equal("parameter.ValidatableModelProperty", entry.Key);
553Assert.Equal("parameter.ValidatableModelProperty.Property1", entry.Key);
560Assert.Equal("parameter.ValidatableModelProperty.Property2", entry.Key);
567Assert.Equal("parameter.ValidatableModelProperty.Property3", entry.Key);
963Assert.Equal("Items[0]", state.Key);
969Assert.Equal("Items[2]", state.Key);
1247Assert.Empty(kvp.Key);
1254Assert.Equal("one", kvp.Key);
Routing\DynamicControllerEndpointMatcherPolicyTest.cs (13)
191candidates[0].Values.OrderBy(kvp => kvp.Key),
194Assert.Equal("action", kvp.Key);
199Assert.Equal("controller", kvp.Key);
269candidates[0].Values.OrderBy(kvp => kvp.Key),
272Assert.Equal("action", kvp.Key);
277Assert.Equal("controller", kvp.Key);
282Assert.Equal("slug", kvp.Key);
287Assert.Equal("state", kvp.Key);
369candidates[0].Values.OrderBy(kvp => kvp.Key),
372Assert.Equal("action", kvp.Key);
377Assert.Equal("controller", kvp.Key);
382Assert.Equal("slug", kvp.Key);
387Assert.Equal("state", kvp.Key);
Routing\UrlHelperExtensionsTest.cs (30)
44Assert.Equal("page", value.Key);
92Assert.Equal("id", value.Key);
97Assert.Equal("page", value.Key);
124Assert.Equal("id", value.Key);
129Assert.Equal("page", value.Key);
156Assert.Equal("id", value.Key);
161Assert.Equal("page", value.Key);
188Assert.Equal("id", value.Key);
193Assert.Equal("page", value.Key);
198Assert.Equal("handler", value.Key);
238Assert.Equal("id", value.Key);
243Assert.Equal("page", value.Key);
287Assert.Equal("id", value.Key);
292Assert.Equal("page", value.Key);
330Assert.Equal("id", value.Key);
335Assert.Equal("page", value.Key);
340Assert.Equal("handler", value.Key);
378Assert.Equal("handler", value.Key);
383Assert.Equal("page", value.Key);
421Assert.Equal("handler", value.Key);
426Assert.Equal("page", value.Key);
456Assert.Equal("page", value.Key);
483Assert.Equal("page", value.Key);
527Assert.Equal("page", value.Key);
587Assert.Collection(Assert.IsType<RouteValueDictionary>(actual.Values).OrderBy(v => v.Key),
590Assert.Equal("area", value.Key);
595Assert.Equal("page", value.Key);
746Assert.Equal("page", value.Key);
794Assert.Equal("page", value.Key);
842Assert.Equal("page", value.Key);
Microsoft.AspNetCore.Mvc.Core.TestCommon (2)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (117)
CompareAttributeAdapterTest.cs (18)
41kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
42kvp => { Assert.Equal("data-val-equalto", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
45Assert.Equal("data-val-equalto-other", kvp.Key);
84kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
85kvp => { Assert.Equal("data-val-equalto", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
88Assert.Equal("data-val-equalto-other", kvp.Key);
119kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
120kvp => { Assert.Equal("data-val-equalto", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
123Assert.Equal("data-val-equalto-other", kvp.Key);
156kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
157kvp => { Assert.Equal("data-val-equalto", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
160Assert.Equal("data-val-equalto-other", kvp.Key);
196kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
197kvp => { Assert.Equal("data-val-equalto", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
200Assert.Equal("data-val-equalto-other", kvp.Key);
233kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); },
234kvp => { Assert.Equal("data-val-equalto", kvp.Key); Assert.Equal("original", kvp.Value); },
235kvp => { Assert.Equal("data-val-equalto-other", kvp.Key); Assert.Equal("original", kvp.Value); });
DataAnnotationsMetadataProviderTest.cs (16)
288Assert.Equal("Name from DisplayNameAttribute", e.Key.Name);
1033Assert.Equal("Loc_Two_Name", groupTwo.Key.Name);
1038Assert.Equal("Loc_Two_Name", groupTwo.Key.Name);
1053Assert.Equal("Loc_Two_Name en-US", groupTwo.Key.Name);
1058Assert.Equal("Loc_Two_Name fr-FR", groupTwo.Key.Name);
1073Assert.Equal("type three name en-US", groupThree.Key.Name);
1078Assert.Equal("type three name fr-FR", groupThree.Key.Name);
1093Assert.Equal("type three name en-US", groupThree.Key.Name);
1098Assert.Equal("type three name fr-FR", groupThree.Key.Name);
1600var property = type.GetProperty(nameof(KeyValuePair<string, object>.Key));
1617var property = type.GetProperty(nameof(KeyValuePair<string, object>.Key))!;
1747return x.Key.Name.Equals(y.Key.Name, StringComparison.Ordinal)
1748&& x.Key.Group.Equals(y.Key.Group, StringComparison.Ordinal);
1756return obj.Key.GetHashCode();
FileExtensionsAttributeAdapterTest.cs (12)
41kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
42kvp => { Assert.Equal("data-val-fileextensions", kvp.Key); Assert.Equal(expectedErrorMessage, kvp.Value); },
43kvp => { Assert.Equal("data-val-fileextensions-extensions", kvp.Key); Assert.Equal(expectedExtensions, kvp.Value); });
92kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
93kvp => { Assert.Equal("data-val-fileextensions", kvp.Key); Assert.Equal(expectedErrorMessage, kvp.Value); },
94kvp => { Assert.Equal("data-val-fileextensions-extensions", kvp.Key); Assert.Equal(expectedExtensions, kvp.Value); });
127kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
128kvp => { Assert.Equal("data-val-fileextensions", kvp.Key); Assert.Equal(expectedErrorMessage, kvp.Value); },
129kvp => { Assert.Equal("data-val-fileextensions-extensions", kvp.Key); Assert.Equal(expectedExtensions, kvp.Value); });
156kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); },
157kvp => { Assert.Equal("data-val-fileextensions", kvp.Key); Assert.Equal("original", kvp.Value); },
158kvp => { Assert.Equal("data-val-fileextensions-extensions", kvp.Key); Assert.Equal("original", kvp.Value); });
MaxLengthAttributeAdapterTest.cs (15)
44kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
45kvp => { Assert.Equal("data-val-maxlength", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
46kvp => { Assert.Equal("data-val-maxlength-max", kvp.Key); Assert.Equal("10", kvp.Value); });
71kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
72kvp => { Assert.Equal("data-val-maxlength", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
73kvp => { Assert.Equal("data-val-maxlength-max", kvp.Key); Assert.Equal("10", kvp.Value); });
100kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
101kvp => { Assert.Equal("data-val-maxlength", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
102kvp => { Assert.Equal("data-val-maxlength-max", kvp.Key); Assert.Equal("5", kvp.Value); });
133kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
134kvp => { Assert.Equal("data-val-maxlength", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
135kvp => { Assert.Equal("data-val-maxlength-max", kvp.Key); Assert.Equal("10", kvp.Value); });
164kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); },
165kvp => { Assert.Equal("data-val-maxlength", kvp.Key); Assert.Equal("original", kvp.Value); },
166kvp => { Assert.Equal("data-val-maxlength-max", kvp.Key); Assert.Equal("original", kvp.Value); });
MinLengthAttributeAdapterTest.cs (12)
44kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
45kvp => { Assert.Equal("data-val-minlength", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
46kvp => { Assert.Equal("data-val-minlength-min", kvp.Key); Assert.Equal("6", kvp.Value); });
71kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
72kvp => { Assert.Equal("data-val-minlength", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
73kvp => { Assert.Equal("data-val-minlength-min", kvp.Key); Assert.Equal("6", kvp.Value); });
99kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
100kvp => { Assert.Equal("data-val-minlength", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
101kvp => { Assert.Equal("data-val-minlength-min", kvp.Key); Assert.Equal("2", kvp.Value); });
129kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); },
130kvp => { Assert.Equal("data-val-minlength", kvp.Key); Assert.Equal("original", kvp.Value); },
131kvp => { Assert.Equal("data-val-minlength-min", kvp.Key); Assert.Equal("original", kvp.Value); });
NumericClientModelValidatorTest.cs (10)
34kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
35kvp => { Assert.Equal("data-val-number", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); });
66kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
67kvp => { Assert.Equal("data-val-number", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); });
98kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
99kvp => { Assert.Equal("data-val-number", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); });
124kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
125kvp => { Assert.Equal("data-val-number", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); });
150kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); },
151kvp => { Assert.Equal("data-val-number", kvp.Key); Assert.Equal("original", kvp.Value); });
RangeAttributeAdapterTest.cs (12)
38kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
39kvp => { Assert.Equal("data-val-range", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
40kvp => { Assert.Equal("data-val-range-max", kvp.Key); Assert.Equal("100", kvp.Value); },
41kvp => { Assert.Equal("data-val-range-min", kvp.Key); Assert.Equal("0", kvp.Value); });
74kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
75kvp => { Assert.Equal("data-val-range", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
76kvp => { Assert.Equal("data-val-range-max", kvp.Key); Assert.Equal("100", kvp.Value); },
77kvp => { Assert.Equal("data-val-range-min", kvp.Key); Assert.Equal("0", kvp.Value); });
107kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); },
108kvp => { Assert.Equal("data-val-range", kvp.Key); Assert.Equal("original", kvp.Value); },
109kvp => { Assert.Equal("data-val-range-max", kvp.Key); Assert.Equal("original", kvp.Value); },
110kvp => { Assert.Equal("data-val-range-min", kvp.Key); Assert.Equal("original", kvp.Value); });
RequiredAttributeAdapterTest.cs (6)
45kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
46kvp => { Assert.Equal("data-val-required", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); });
70kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
71kvp => { Assert.Equal("data-val-required", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); });
98kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); },
99kvp => { Assert.Equal("data-val-required", kvp.Key); Assert.Equal("original", kvp.Value); });
StringLengthAttributeAdapterTest.cs (16)
45kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
46kvp => { Assert.Equal("data-val-length", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
47kvp => { Assert.Equal("data-val-length-max", kvp.Key); Assert.Equal("8", kvp.Value); });
72kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
73kvp => { Assert.Equal("data-val-length", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
74kvp => { Assert.Equal("data-val-length-max", kvp.Key); Assert.Equal("8", kvp.Value); });
99kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
100kvp => { Assert.Equal("data-val-length", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); },
101kvp => { Assert.Equal("data-val-length-max", kvp.Key); Assert.Equal("10", kvp.Value); },
102kvp => { Assert.Equal("data-val-length-min", kvp.Key); Assert.Equal("3", kvp.Value); });
127kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
128kvp => { Assert.Equal("data-val-length", kvp.Key); Assert.Equal(expectedMessage, kvp.Value); });
158kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); },
159kvp => { Assert.Equal("data-val-length", kvp.Key); Assert.Equal("original", kvp.Value); },
160kvp => { Assert.Equal("data-val-length-max", kvp.Key); Assert.Equal("original", kvp.Value); },
161kvp => { Assert.Equal("data-val-length-min", kvp.Key); Assert.Equal("original", kvp.Value); });
Microsoft.AspNetCore.Mvc.Formatters.Xml (3)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (17)
Microsoft.AspNetCore.Mvc.FunctionalTests (32)
Microsoft.AspNetCore.Mvc.IntegrationTests (580)
ArrayModelBinderIntegrationTest.cs (12)
44var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0]").Value;
48entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[1]").Value;
88var entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[0]").Value;
92entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[1]").Value;
128var entry = Assert.Single(modelState, kvp => kvp.Key == "[0]").Value;
132entry = Assert.Single(modelState, kvp => kvp.Key == "[1]").Value;
204var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0].Name").Value;
208entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[1].Name").Value;
249var entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[0].Name").Value;
253entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[1].Name").Value;
290var entry = Assert.Single(modelState, kvp => kvp.Key == "[0].Name").Value;
294entry = Assert.Single(modelState, kvp => kvp.Key == "[1].Name").Value;
CollectionModelBinderIntegrationTest.cs (27)
50var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0]").Value;
54entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[1]").Value;
320var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0].Id").Value;
324entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[1].Id").Value;
328entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0].Name").Value;
334entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[1].Name").Value;
379var entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[0].Id").Value;
383entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[1].Id").Value;
387entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[0].Name").Value;
391entry = Assert.Single(modelState, kvp => kvp.Key == "prefix[1].Name").Value;
430var entry = Assert.Single(modelState, kvp => kvp.Key == "[0].Id").Value;
434entry = Assert.Single(modelState, kvp => kvp.Key == "[1].Id").Value;
438entry = Assert.Single(modelState, kvp => kvp.Key == "[0].Name").Value;
442entry = Assert.Single(modelState, kvp => kvp.Key == "[1].Name").Value;
480var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[low]").Value;
485entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[high]").Value;
525var entry = Assert.Single(modelState, kvp => kvp.Key == "[low].Id").Value;
529entry = Assert.Single(modelState, kvp => kvp.Key == "[high].Id").Value;
533entry = Assert.Single(modelState, kvp => kvp.Key == "[low].Name").Value;
537entry = Assert.Single(modelState, kvp => kvp.Key == "[high].Name").Value;
620var entry = Assert.Single(modelState, kvp => kvp.Key == "Addresses[Key1].Street").Value;
624entry = Assert.Single(modelState, kvp => kvp.Key == "Addresses[Key2].Street").Value;
677Assert.Equal("Addresses[Key1].Street", kvp.Key);
1165Assert.Equal("[0]", kvp.Key);
1170Assert.Equal("[1]", kvp.Key);
1214Assert.Equal("[0]", kvp.Key);
1219Assert.Equal("[1]", kvp.Key);
ComplexRecordIntegrationTest.cs (135)
76var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
126var entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value;
177var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
231var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
377var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
381entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Token").Value;
429var entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value;
433entry = Assert.Single(modelState, e => e.Key == "Customer.Token").Value;
481var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
534var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
538entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Documents").Value;
587var entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value;
591entry = Assert.Single(modelState, e => e.Key == "Customer.Documents").Value;
641Assert.Equal("parameter.Customer.Name", kvp.Key);
698Assert.Single(modelState, e => e.Key == "parameter.Customer.Documents");
699var entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId").Value;
753Assert.Equal("Customer.Documents", entry.Key);
801var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
805entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[0]").Value;
809entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[1]").Value;
856var entry = Assert.Single(modelState, e => e.Key == "Name").Value;
860entry = Assert.Single(modelState, e => e.Key == "ProductIds[0]").Value;
864entry = Assert.Single(modelState, e => e.Key == "ProductIds[1]").Value;
911var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1004var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1008entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[0]").Value;
1012entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[1]").Value;
1059var entry = Assert.Single(modelState, e => e.Key == "Name").Value;
1063entry = Assert.Single(modelState, e => e.Key == "ProductIds[0]").Value;
1067entry = Assert.Single(modelState, e => e.Key == "ProductIds[1]").Value;
1114var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1207var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1211entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[0].Key").Value;
1215entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[0].Value").Value;
1262var entry = Assert.Single(modelState, e => e.Key == "Name").Value;
1266entry = Assert.Single(modelState, e => e.Key == "ProductIds[0].Key").Value;
1270entry = Assert.Single(modelState, e => e.Key == "ProductIds[0].Value").Value;
1317var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1422Assert.Equal("camera_specs", e.Key);
1436Assert.Equal("tyre_specs", e.Key);
1453var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
1457entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Key").Value;
1461entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[0].Name").Value;
1465entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[1].Name").Value;
1469entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Key").Value;
1473entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[0].Name").Value;
1477entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[1].Name").Value;
1529Assert.Equal("camera_specs", e.Key);
1543Assert.Equal("tyre_specs", e.Key);
1560var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
1564entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Key").Value;
1568entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[0].Name").Value;
1572entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[1].Name").Value;
1576entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Key").Value;
1580entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[0].Name").Value;
1584entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[1].Name").Value;
1636Assert.Equal("camera_specs", e.Key);
1650Assert.Equal("tyre_specs", e.Key);
1667var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
1671entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Key").Value;
1675entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[0].Name").Value;
1679entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[1].Name").Value;
1683entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Key").Value;
1687entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[0].Name").Value;
1691entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[1].Name").Value;
1741var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1745entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId.Key").Value;
1749entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId.Value").Value;
1796var entry = Assert.Single(modelState, e => e.Key == "Name").Value;
1800entry = Assert.Single(modelState, e => e.Key == "ProductId.Key").Value;
1804entry = Assert.Single(modelState, e => e.Key == "ProductId.Value").Value;
1859Assert.Equal("spec1", e.Key);
1864Assert.Equal("spec2", e.Key);
1872var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
1876entry = Assert.Single(modelState, e => e.Key == "p.Specs.Key").Value;
1880entry = Assert.Single(modelState, e => e.Key == "p.Specs.Value[0].Key").Value;
1884entry = Assert.Single(modelState, e => e.Key == "p.Specs.Value[0].Value").Value;
1888entry = Assert.Single(modelState, e => e.Key == "p.Specs.Value[1].Key").Value;
1892entry = Assert.Single(modelState, e => e.Key == "p.Specs.Value[1].Value").Value;
1991var entry = Assert.Single(modelState, e => e.Key == "Customer").Value;
2047var entry = Assert.Single(modelState, e => e.Key == "Customer").Value;
2101var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Id").Value;
2105entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
2155var entry = Assert.Single(modelState, e => e.Key == "Customer.Id").Value;
2159entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value;
2213var entry = Assert.Single(modelState, e => e.Key == "customParameter.Customer.Id").Value;
2217entry = Assert.Single(modelState, e => e.Key == "customParameter.Customer.Name").Value;
2267var entry = Assert.Single(modelState, e => e.Key == "ProductName").Value;
2319var entry = Assert.Single(modelState, e => e.Key == "customParameter.ProductName").Value;
2367var entry = Assert.Single(modelState, e => e.Key == "ProductName").Value;
2415var entry = Assert.Single(modelState, e => e.Key == "OrderIds").Value;
2467var entry = Assert.Single(modelState, e => e.Key == "customParameter.OrderIds").Value;
2514var entry = Assert.Single(modelState, e => e.Key == "OrderIds[0]").Value;
2565var entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId").Value;
2616Assert.Equal("parameter.ProductId", entry.Key);
2675Assert.Equal("HomeAddress.Street", kvp.Key);
2723Assert.Equal("HomeAddress.Street", kvp.Key);
2783Assert.Equal("Address.Street", kvp.Key);
2836Assert.Equal("Street", kvp.Key);
2936Assert.Equal("location1", model.Info.Key);
2946var entry = Assert.Single(modelState, e => e.Key == "Id").Value;
2950entry = Assert.Single(modelState, e => e.Key == "Info.Key").Value;
2954entry = Assert.Single(modelState, e => e.Key == "Info.Value.Zipcode").Value;
2958entry = Assert.Single(modelState, e => e.Key == "Info.Value.GpsCoordinates").Value;
3013Assert.Equal("[0].Photo", state.Key);
3086Assert.Equal("parameter.InnerModels[0].Rate", kvp.Key);
3094Assert.Equal("parameter.InnerModels[1].Rate", kvp.Key);
3149Assert.Equal("Photo", state.Key);
3211Assert.Equal("Photo", kvp.Key);
3218Assert.Equal("Mother.Photo", kvp.Key);
3519Assert.Equal("Name", entry.Key);
3562Assert.Equal("Age", entry.Key);
3605var entry = Assert.Single(modelState, m => m.Key == "Age");
3609entry = Assert.Single(modelState, m => m.Key == "Name");
3656Assert.Equal("Name", entry.Key);
3702Assert.Equal("Name", entry.Key);
3754Assert.Single(modelState, e => e.Key == "Name");
3755Assert.Single(modelState, e => e.Key == "Id");
3797Assert.Equal("Name", entry.Key);
3842Assert.Single(modelState, e => e.Key == "Id");
3843Assert.Single(modelState, e => e.Key == "Tags[0]");
3844Assert.Single(modelState, e => e.Key == "Tags[1]");
3884var entry = Assert.Single(modelState, e => e.Key == "Id");
3929Assert.Single(modelState, e => e.Key == "Id");
3930Assert.Single(modelState, e => e.Key == "Tags[0]");
3931Assert.Single(modelState, e => e.Key == "Tags[1]");
3975Assert.Single(modelState, e => e.Key == "Id");
3976Assert.Single(modelState, e => e.Key == "Tags[0]");
3977Assert.Single(modelState, e => e.Key == "Tags[1]");
4061Assert.Equal("Tags[0]", entry.Key);
4104Assert.Equal("parameter.Tags[0]", entry.Key);
4150Assert.Single(modelState, m => m.Key == "Age");
4151Assert.Single(modelState, m => m.Key == "Name");
4195var entry = Assert.Single(modelState, m => m.Key == "Age");
4198entry = Assert.Single(modelState, m => m.Key == "Name");
ComplexTypeIntegrationTestBase.cs (112)
113var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
163var entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value;
214var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
370var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
374entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Token").Value;
422var entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value;
426entry = Assert.Single(modelState, e => e.Key == "Customer.Token").Value;
474var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
537var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
541entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Documents").Value;
590var entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value;
594entry = Assert.Single(modelState, e => e.Key == "Customer.Documents").Value;
644Assert.Equal("parameter.Customer.Name", kvp.Key);
701Assert.Single(modelState, e => e.Key == "parameter.Customer.Documents");
702var entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId").Value;
756Assert.Equal("Customer.Documents", entry.Key);
809var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
813entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[0]").Value;
817entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[1]").Value;
864var entry = Assert.Single(modelState, e => e.Key == "Name").Value;
868entry = Assert.Single(modelState, e => e.Key == "ProductIds[0]").Value;
872entry = Assert.Single(modelState, e => e.Key == "ProductIds[1]").Value;
919var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1017var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1021entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[0]").Value;
1025entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[1]").Value;
1072var entry = Assert.Single(modelState, e => e.Key == "Name").Value;
1076entry = Assert.Single(modelState, e => e.Key == "ProductIds[0]").Value;
1080entry = Assert.Single(modelState, e => e.Key == "ProductIds[1]").Value;
1127var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1225var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1229entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[0].Key").Value;
1233entry = Assert.Single(modelState, e => e.Key == "parameter.ProductIds[0].Value").Value;
1280var entry = Assert.Single(modelState, e => e.Key == "Name").Value;
1284entry = Assert.Single(modelState, e => e.Key == "ProductIds[0].Key").Value;
1288entry = Assert.Single(modelState, e => e.Key == "ProductIds[0].Value").Value;
1335var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1458Assert.Equal("camera_specs", e.Key);
1472Assert.Equal("tyre_specs", e.Key);
1489var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
1493entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Key").Value;
1497entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[0].Name").Value;
1501entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[1].Name").Value;
1505entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Key").Value;
1509entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[0].Name").Value;
1513entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[1].Name").Value;
1565Assert.Equal("camera_specs", e.Key);
1579Assert.Equal("tyre_specs", e.Key);
1596var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
1600entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Key").Value;
1604entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[0].Name").Value;
1608entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[1].Name").Value;
1612entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Key").Value;
1616entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[0].Name").Value;
1620entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[1].Name").Value;
1672Assert.Equal("camera_specs", e.Key);
1686Assert.Equal("tyre_specs", e.Key);
1703var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
1707entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Key").Value;
1711entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[0].Name").Value;
1715entry = Assert.Single(modelState, e => e.Key == "p.Specs[0].Value[1].Name").Value;
1719entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Key").Value;
1723entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[0].Name").Value;
1727entry = Assert.Single(modelState, e => e.Key == "p.Specs[1].Value[1].Name").Value;
1782var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1786entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId.Key").Value;
1790entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId.Value").Value;
1837var entry = Assert.Single(modelState, e => e.Key == "Name").Value;
1841entry = Assert.Single(modelState, e => e.Key == "ProductId.Key").Value;
1845entry = Assert.Single(modelState, e => e.Key == "ProductId.Value").Value;
1891var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
1895entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId.Key").Value;
1940var entry = Assert.Single(modelState, e => e.Key == "ProductId.Key").Value;
1999Assert.Equal("spec1", e.Key);
2004Assert.Equal("spec2", e.Key);
2012var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
2016entry = Assert.Single(modelState, e => e.Key == "p.Specs.Key").Value;
2020entry = Assert.Single(modelState, e => e.Key == "p.Specs.Value[0].Key").Value;
2024entry = Assert.Single(modelState, e => e.Key == "p.Specs.Value[0].Value").Value;
2028entry = Assert.Single(modelState, e => e.Key == "p.Specs.Value[1].Key").Value;
2032entry = Assert.Single(modelState, e => e.Key == "p.Specs.Value[1].Value").Value;
2145var entry = Assert.Single(modelState, e => e.Key == "Customer").Value;
2200var entry = Assert.Single(modelState, e => e.Key == "Customer").Value;
2263var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Id").Value;
2267entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
2317var entry = Assert.Single(modelState, e => e.Key == "Customer.Id").Value;
2321entry = Assert.Single(modelState, e => e.Key == "Customer.Name").Value;
2375var entry = Assert.Single(modelState, e => e.Key == "customParameter.Customer.Id").Value;
2379entry = Assert.Single(modelState, e => e.Key == "customParameter.Customer.Name").Value;
2433var entry = Assert.Single(modelState, e => e.Key == "ProductName").Value;
2485var entry = Assert.Single(modelState, e => e.Key == "customParameter.ProductName").Value;
2533var entry = Assert.Single(modelState, e => e.Key == "ProductName").Value;
2585var entry = Assert.Single(modelState, e => e.Key == "OrderIds").Value;
2637var entry = Assert.Single(modelState, e => e.Key == "customParameter.OrderIds").Value;
2684var entry = Assert.Single(modelState, e => e.Key == "OrderIds[0]").Value;
2738var entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId").Value;
2789Assert.Equal("parameter.ProductId", entry.Key);
2854Assert.Equal("HomeAddress.Street", kvp.Key);
2902Assert.Equal("HomeAddress.Street", kvp.Key);
2974Assert.Equal("Address.Street", kvp.Key);
3027Assert.Equal("Street", kvp.Key);
3140Assert.Equal("location1", model.Info.Key);
3150var entry = Assert.Single(modelState, e => e.Key == "Id").Value;
3154entry = Assert.Single(modelState, e => e.Key == "Info.Key").Value;
3158entry = Assert.Single(modelState, e => e.Key == "Info.Value.Zipcode").Value;
3162entry = Assert.Single(modelState, e => e.Key == "Info.Value.GpsCoordinates").Value;
3221Assert.Equal("[0].Photo", state.Key);
3301Assert.Equal("parameter.InnerModels[0].Rate", kvp.Key);
3309Assert.Equal("parameter.InnerModels[1].Rate", kvp.Key);
3371Assert.Equal("Photo", state.Key);
3433Assert.Equal("Photo", kvp.Key);
3440Assert.Equal("Mother.Photo", kvp.Key);
DictionaryModelBinderIntegrationTest.cs (25)
48var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0].Key").Value;
52entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0].Value").Value;
88Assert.Equal("parameter[key0]", kvp.Key);
127var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[low].Key").Value;
132entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[low].Value").Value;
1257model.OrderBy(kvp => kvp.Key),
1260Assert.Equal("key0", kvp.Key);
1265modelState.OrderBy(kvp => kvp.Key),
1268Assert.Equal("parameter[key0]", kvp.Key);
1311model.OrderBy(kvp => kvp.Key),
1314Assert.Equal("key0", kvp.Key);
1321Assert.Equal("key1", kvp.Key);
1328modelState.OrderBy(kvp => kvp.Key),
1331Assert.Equal("parameter[key0].Age", kvp.Key);
1337Assert.Equal("parameter[key0].Name", kvp.Key);
1342Assert.Equal("parameter[key1].Age", kvp.Key);
1347Assert.Equal("parameter[key1].Name", kvp.Key);
1464model.OrderBy(kvp => kvp.Key),
1467Assert.Equal("key0", kvp.Key);
1474Assert.Equal("key1", kvp.Key);
1481modelState.OrderBy(kvp => kvp.Key),
1484Assert.Equal("parameter[key0].Age", kvp.Key);
1490Assert.Equal("parameter[key0].Name", kvp.Key);
1495Assert.Equal("parameter[key1].Age", kvp.Key);
1500Assert.Equal("parameter[key1].Name", kvp.Key);
FormFileModelBindingIntegrationTest.cs (32)
114modelState.OrderBy(kvp => kvp.Key),
118Assert.Equal("Address.File", kvp.Key);
165modelState.OrderBy(kvp => kvp.Key),
169Assert.Equal("Parameter1.Address.File", kvp.Key);
228modelState.OrderBy(kvp => kvp.Key),
232Assert.Equal("Person.Address.File", kvp.Key);
240Assert.Equal("Person.Address.Zip", kvp.Key);
318modelState.OrderBy(kvp => kvp.Key),
322Assert.Equal("fleet.Garage.Name", kvp.Key);
330Assert.Equal("fleet.Garage.Vehicles[0].Spec", kvp.Key);
384modelState.OrderBy(kvp => kvp.Key),
388Assert.Equal("fleet.Garage.Name", kvp.Key);
396Assert.Equal("fleet.Garage.Vehicles[0].BackupVehicle.Spec", kvp.Key);
446modelState.OrderBy(kvp => kvp.Key),
450Assert.Equal("GroupName", kvp.Key);
458Assert.Equal("Person.Address.File", kvp.Key);
508Assert.Equal("files", kvp.Key);
597Assert.Equal("files", kvp.Key);
648Assert.Equal("CustomParameter", entry.Key);
737var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
741Assert.Single(modelState, e => e.Key == "p.Specs");
812var entry = Assert.Single(modelState, e => e.Key == "house.Garage.Cars[0].Name").Value;
816Assert.Single(modelState, e => e.Key == "house.Garage.Cars[0].Specs");
817Assert.Single(modelState, e => e.Key == "house.Garage.Cars[1].Specs");
877Assert.Single(modelState, e => e.Key == "house.Garage.Cars[0].Specs");
878Assert.Single(modelState, e => e.Key == "house.Garage.Cars[1].Specs");
979Assert.Equal("house.Garage.Cars[0].Specs", kvp.Key);
1024var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value;
1028Assert.Single(modelState, e => e.Key == "p.Specs");
1231container.Dictionary.OrderBy(kvp => kvp.Key),
1234Assert.Equal("key0", kvp.Key);
1239Assert.Equal("key1", kvp.Key);
GenericModelBinderIntegrationTest.cs (20)
285Assert.Equal("key0", kvp.Key);
292var entry = Assert.Single(modelState, e => e.Key == "parameter[0][0].Key").Value;
296entry = Assert.Single(modelState, e => e.Key == "parameter[0][0].Value").Value;
330Assert.Equal("key0", kvp.Key);
337var entry = Assert.Single(modelState, e => e.Key == "[0][0].Key").Value;
341entry = Assert.Single(modelState, e => e.Key == "[0][0].Value").Value;
409Assert.Equal("key0", kvp.Key);
416var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value;
420entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value").Value;
453Assert.Equal("key0", kvp.Key);
460var entry = Assert.Single(modelState, e => e.Key == "[0].Key").Value;
464entry = Assert.Single(modelState, e => e.Key == "[0].Value").Value;
533Assert.Equal("key0", kvp.Key);
540var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value;
544entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value[0]").Value;
548entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value[1]").Value;
581Assert.Equal("key0", kvp.Key);
588var entry = Assert.Single(modelState, e => e.Key == "[0].Key").Value;
592entry = Assert.Single(modelState, e => e.Key == "[0].Value[0]").Value;
596entry = Assert.Single(modelState, e => e.Key == "[0].Value[1]").Value;
HeaderModelBinderIntegrationTest.cs (14)
102Assert.Equal("prefix.Address.Header", entry.Key);
144Assert.Equal("Address.Header", entry.Key);
189Assert.Equal("Header", kvp.Key);
236Assert.Equal("Header", kvp.Key);
298Assert.Equal("CustomParameter", entry.Key);
360modelState.OrderBy(kvp => kvp.Key),
363Assert.Equal("prefix.Manufacturer.ArrayOfString", kvp.Key);
372Assert.Equal("prefix.Manufacturer.EnumerableOfDouble", kvp.Key);
381Assert.Equal("prefix.Manufacturer.IntProperty", kvp.Key);
390Assert.Equal("prefix.Manufacturer.ListOfEnum", kvp.Key);
399Assert.Equal("prefix.Manufacturer.ListOfOrderWithTypeConverter", kvp.Key);
408Assert.Equal("prefix.Manufacturer.NoCommaString", kvp.Key);
417Assert.Equal("prefix.Manufacturer.NullableIntProperty", kvp.Key);
426Assert.Equal("prefix.Manufacturer.OneCommaSeparatedString", kvp.Key);
KeyValuePairModelBinderIntegrationTest.cs (30)
44var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value;
48entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Value").Value;
79var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value;
84entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Value").Value;
129var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value;
134entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Value").Value;
166var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value;
171entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Value").Value;
216var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value;
221entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Value").Value;
262var entry = Assert.Single(modelState, kvp => kvp.Key == "prefix.Key").Value;
266entry = Assert.Single(modelState, kvp => kvp.Key == "prefix.Value").Value;
302var entry = Assert.Single(modelState, kvp => kvp.Key == "Key").Value;
306entry = Assert.Single(modelState, kvp => kvp.Key == "Value").Value;
340var entry = Assert.Single(modelState, kvp => kvp.Key == "Key").Value;
374Assert.Equal("key0", model.Key);
381var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value;
385entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Value.Id").Value;
419Assert.Equal("key0", model.Key);
426var entry = Assert.Single(modelState, kvp => kvp.Key == "prefix.Key").Value;
430entry = Assert.Single(modelState, kvp => kvp.Key == "prefix.Value.Id").Value;
460Assert.Equal("key0", model.Key);
467var entry = Assert.Single(modelState, kvp => kvp.Key == "Key").Value;
471entry = Assert.Single(modelState, kvp => kvp.Key == "Value.Id").Value;
505var entry = Assert.Single(modelState, kvp => kvp.Key == "Key").Value;
508entry = Assert.Single(modelState, kvp => kvp.Key == "Value").Value;
536Assert.Equal("key1", model.Key);
543var entry = Assert.Single(modelState, kvp => kvp.Key == "p.Key").Value;
547entry = Assert.Single(modelState, kvp => kvp.Key == "p.Value[0]").Value;
551entry = Assert.Single(modelState, kvp => kvp.Key == "p.Value[1]").Value;
TryUpdateModelIntegrationTest.cs (25)
52Assert.Equal("Street", entry.Key);
86Assert.Equal("Street", entry.Key);
196Assert.Equal("Address.Street", entry.Key);
237Assert.Equal("Address[0].Street", entry.Key);
278Assert.Equal("Address[0].Street", entry.Key);
339Assert.Equal("Address[0].Street", entry.Key);
373Assert.Equal("Address[0].Street", entry.Key);
402Assert.Equal("prefix.Address[0].Street", entry.Key);
443Assert.Equal("Address[0].Street", entry.Key);
491Assert.Equal("Address[0].Street", entry.Key);
659Assert.Equal("prefix.Street", entry.Key);
693Assert.Equal("prefix.Street", entry.Key);
796Assert.Equal("prefix.Address.Street", entry.Key);
832Assert.Equal("prefix.Address[0].Street", entry.Key);
873Assert.Equal("prefix.Address[0].Street", entry.Key);
924Assert.Equal("prefix.Address[0].Street", entry.Key);
960Assert.Equal("prefix.Address[0].Street", entry.Key);
1008Assert.Equal("prefix.Address[0].Street", entry.Key);
1077Assert.Equal("files", kvp.Key);
1129Assert.Equal("Street", entry.Key);
1200var entry = Assert.Single(modelState, k => k.Key == "Address.ZipCode");
1207entry = Assert.Single(modelState, k => k.Key == "Address.Street");
1252modelState.OrderBy(kvp => kvp.Key),
1255Assert.Equal("Address.Street", kvp.Key);
1264Assert.Equal("Address.ZipCode", kvp.Key);
ValidationIntegrationTests.cs (65)
116e => string.Equals(e.Key, "AccountId", StringComparison.OrdinalIgnoreCase)).Value;
194var entry = Assert.Single(modelState, e => e.Key == "parameter.CustomerName").Value;
231var entry = Assert.Single(modelState, e => e.Key == "CustomerName").Value;
283var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
320var entry = Assert.Single(modelState, e => e.Key == "Customer").Value;
374var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
414var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
466var entry = Assert.Single(modelState, e => e.Key == "Items[0].ItemId").Value;
504var entry = Assert.Single(modelState, e => e.Key == "Items").Value;
552var entry = Assert.Single(modelState, e => e.Key == "parameter[0].ProductId").Value;
592var entry = Assert.Single(modelState, e => e.Key == "parameter[0].ProductId").Value;
669var entry = Assert.Single(modelState, e => e.Key == "parameter").Value;
710var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
747var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
798var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
835var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
933var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
970var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
974entry = Assert.Single(modelState, e => e.Key == "parameter.Customer").Value;
1040var entry = Assert.Single(modelState, e => e.Key == "parameter.Products[0].Name").Value;
1077var entry = Assert.Single(modelState, e => e.Key == "parameter.Products[0].Name").Value;
1081entry = Assert.Single(modelState, e => e.Key == "parameter.Products").Value;
1128var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Name").Value;
1165var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Name").Value;
1244Assert.Equal("Id", state.Key);
1284Assert.Equal("Zip", state.Key);
1377Assert.Equal(nameof(ValidateSomeProperties.NeverValidBecauseType), state.Key);
1390state.Key);
1423Assert.Equal(nameof(ValidateSomeProperties.NeverValidBecauseAttribute), kvp.Key);
1461Assert.Equal(nameof(ValidateSomeProperties.ValidateNever), kvp.Key);
1523Assert.Equal(propertyName, kvp.Key);
1600Assert.Equal(nameof(ValidateSomePropertiesSometimes.ControlLength), kvp.Key);
1639state => Assert.Equal(nameof(ValidateSomePropertiesSometimes.Control), state.Key),
1642Assert.Equal(nameof(ValidateSomePropertiesSometimes.ControlLength), state.Key);
1690Assert.Equal(nameof(ValidateSomePropertiesSometimesWithoutValidation.ControlLength), kvp.Key);
1755var entry = Assert.Single(modelState, e => e.Key == "HomeAddress.Country.Name").Value;
1760entry = Assert.Single(modelState, e => e.Key == "ShippingAddresses[0].Zip").Value;
1765entry = Assert.Single(modelState, e => e.Key == "HomeAddress.Zip").Value;
1815var entry = Assert.Single(modelState, kvp => kvp.Key == "CustomParameter.message");
1857var entry = Assert.Single(modelState, kvp => kvp.Key == "message");
1903var entry = Assert.Single(modelState, kvp => kvp.Key == "other.key");
1950var entry = Assert.Single(modelState, kvp => kvp.Key == "Message");
1953entry = Assert.Single(modelState, kvp => kvp.Key == "other.key");
2055var entry = Assert.Single(modelState, e => e.Key == "[0]").Value;
2060entry = Assert.Single(modelState, e => e.Key == "[1]").Value;
2107var entry = Assert.Single(modelState, e => e.Key == "").Value;
2110entry = Assert.Single(modelState, e => e.Key == "[0]").Value;
2115entry = Assert.Single(modelState, e => e.Key == "[1]").Value;
2178var entry = Assert.Single(modelState, e => e.Key == "p[0].Id").Value;
2183entry = Assert.Single(modelState, e => e.Key == "p[1]").Value;
2186entry = Assert.Single(modelState, e => e.Key == "p[1].Id").Value;
2233model.OrderBy(k => k.Key),
2236Assert.Equal("key0", kvp.Key);
2243var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value;
2248entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value").Value;
2280model.OrderBy(k => k.Key),
2283Assert.Equal("key0", kvp.Key);
2290var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value;
2295entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value.NeverValidProperty").Value;
2300entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value").Value;
2343var entry = Assert.Single(modelState, e => e.Key == "Model.Id").Value;
2397var entry = Assert.Single(modelState, e => e.Key == "Model.Id").Value;
2402entry = Assert.Single(modelState, e => e.Key == "Model").Value;
2447var entry = Assert.Single(modelState, e => e.Key == "Property1").Value;
2499var entry = Assert.Single(modelState, e => e.Key == "Property1").Value;
ValidationWithRecordIntegrationTests.cs (65)
108e => string.Equals(e.Key, "AccountId", StringComparison.OrdinalIgnoreCase)).Value;
182var entry = Assert.Single(modelState, e => e.Key == "parameter.CustomerName").Value;
219var entry = Assert.Single(modelState, e => e.Key == "CustomerName").Value;
264var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
301var entry = Assert.Single(modelState, e => e.Key == "Customer").Value;
346var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
386var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
431var entry = Assert.Single(modelState, e => e.Key == "Items[0].ItemId").Value;
469var entry = Assert.Single(modelState, e => e.Key == "Items").Value;
511var entry = Assert.Single(modelState, e => e.Key == "parameter[0].ProductId").Value;
551var entry = Assert.Single(modelState, e => e.Key == "parameter[0].ProductId").Value;
593var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
630var entry = Assert.Single(modelState, e => e.Key == "parameter.Name").Value;
674var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
711var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
802var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
839var entry = Assert.Single(modelState, e => e.Key == "parameter.Customer.Name").Value;
843entry = Assert.Single(modelState, e => e.Key == "parameter.Customer").Value;
902var entry = Assert.Single(modelState, e => e.Key == "parameter.Products[0].Name").Value;
939var entry = Assert.Single(modelState, e => e.Key == "parameter.Products[0].Name").Value;
943entry = Assert.Single(modelState, e => e.Key == "parameter.Products").Value;
986var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Name").Value;
1023var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Name").Value;
1096Assert.Equal("Id", state.Key);
1136Assert.Equal("Zip", state.Key);
1221Assert.Equal(nameof(ValidateSomeProperties.NeverValidBecauseType), state.Key);
1234state.Key);
1267Assert.Equal(nameof(ValidateSomeProperties.NeverValidBecauseAttribute), kvp.Key);
1305Assert.Equal(nameof(ValidateSomeProperties.ValidateNever), kvp.Key);
1408Assert.Equal(nameof(ValidateSomePropertiesSometimes.ControlLength), kvp.Key);
1447state => Assert.Equal(nameof(ValidateSomePropertiesSometimes.Control), state.Key),
1450Assert.Equal(nameof(ValidateSomePropertiesSometimes.ControlLength), state.Key);
1496Assert.Equal(nameof(ValidateSomePropertiesSometimesWithoutValidation.ControlLength), kvp.Key);
1558var entry = Assert.Single(modelState, e => e.Key == "HomeAddress.Country.Name").Value;
1563entry = Assert.Single(modelState, e => e.Key == "ShippingAddresses[0].Zip").Value;
1568entry = Assert.Single(modelState, e => e.Key == "HomeAddress.Zip").Value;
1618var entry = Assert.Single(modelState, kvp => kvp.Key == "CustomParameter.message");
1660var entry = Assert.Single(modelState, kvp => kvp.Key == "message");
1706var entry = Assert.Single(modelState, kvp => kvp.Key == "other.key");
1753var entry = Assert.Single(modelState, kvp => kvp.Key == "Message");
1756entry = Assert.Single(modelState, kvp => kvp.Key == "other.key");
1846var entry = Assert.Single(modelState, e => e.Key == "[0]").Value;
1851entry = Assert.Single(modelState, e => e.Key == "[1]").Value;
1898var entry = Assert.Single(modelState, e => e.Key == "").Value;
1901entry = Assert.Single(modelState, e => e.Key == "[0]").Value;
1906entry = Assert.Single(modelState, e => e.Key == "[1]").Value;
1969var entry = Assert.Single(modelState, e => e.Key == "p[0].Id").Value;
1974entry = Assert.Single(modelState, e => e.Key == "p[1]").Value;
1977entry = Assert.Single(modelState, e => e.Key == "p[1].Id").Value;
2024model.OrderBy(k => k.Key),
2027Assert.Equal("key0", kvp.Key);
2034var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value;
2039entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value").Value;
2071model.OrderBy(k => k.Key),
2074Assert.Equal("key0", kvp.Key);
2081var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value;
2086entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value.NeverValidProperty").Value;
2091entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value").Value;
2134var entry = Assert.Single(modelState, e => e.Key == "Model.Id").Value;
2185var entry = Assert.Single(modelState, e => e.Key == "Model.Id").Value;
2190entry = Assert.Single(modelState, e => e.Key == "Model").Value;
2235var entry = Assert.Single(modelState, e => e.Key == "Property1").Value;
2285var entry = Assert.Single(modelState, e => e.Key == "Property1").Value;
2447var entry = Assert.Single(modelState, e => e.Key == "Property1").Value;
2452entry = Assert.Single(modelState, e => e.Key == "Property2").Value;
Microsoft.AspNetCore.Mvc.NewtonsoftJson (10)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (22)
src\Mvc\Mvc.Core\test\Formatters\JsonInputFormatterTestBase.cs (18)
148formatterContext.ModelState.OrderBy(k => k.Key),
151Assert.Equal(expectedKey, kvp.Key);
175formatterContext.ModelState.OrderBy(k => k.Key),
178Assert.Equal(expectedKey, kvp.Key);
203formatterContext.ModelState.OrderBy(k => k.Key),
206Assert.Equal(expectedKey, kvp.Key);
326Assert.Collection(formatterContext.ModelState.OrderBy(k => k.Key),
329Assert.Equal(expectedKey, kvp.Key);
352Assert.Collection(formatterContext.ModelState.OrderBy(k => k.Key),
355Assert.Equal(expectedKey, kvp.Key);
379Assert.Collection(formatterContext.ModelState.OrderBy(k => k.Key),
382Assert.Equal(expectedValue, kvp.Key);
405formatterContext.ModelState.OrderBy(k => k.Key),
408Assert.Equal(expectedKey, kvp.Key);
486Assert.Collection(formatterContext.ModelState.OrderBy(k => k.Key),
489Assert.Equal(expectedKey, kvp.Key);
511formatterContext.ModelState.OrderBy(k => k.Key),
514Assert.Equal(ReadAsync_NestedParseError_Expected, kvp.Key);
Microsoft.AspNetCore.Mvc.Razor (2)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (4)
Microsoft.AspNetCore.Mvc.Razor.Test (3)
Microsoft.AspNetCore.Mvc.RazorPages (4)
Microsoft.AspNetCore.Mvc.RazorPages.Test (72)
ApplicationModels\CompiledPageRouteModelProviderTest.cs (22)
46result.RouteValues.OrderBy(k => k.Key),
49Assert.Equal("page", kvp.Key);
61result.RouteValues.OrderBy(k => k.Key),
64Assert.Equal("page", kvp.Key);
108result.RouteValues.OrderBy(k => k.Key),
111Assert.Equal("area", kvp.Key);
116Assert.Equal("page", kvp.Key);
128result.RouteValues.OrderBy(k => k.Key),
131Assert.Equal("area", kvp.Key);
136Assert.Equal("page", kvp.Key);
148result.RouteValues.OrderBy(k => k.Key),
151Assert.Equal("area", kvp.Key);
156Assert.Equal("page", kvp.Key);
196result.RouteValues.OrderBy(k => k.Key),
199Assert.Equal("area", kvp.Key);
204Assert.Equal("page", kvp.Key);
216result.RouteValues.OrderBy(k => k.Key),
219Assert.Equal("page", kvp.Key);
418result.RouteValues.OrderBy(k => k.Key),
421Assert.Equal("page", kvp.Key);
433result.RouteValues.OrderBy(k => k.Key),
436Assert.Equal("page", kvp.Key);
Infrastructure\DynamicPageEndpointMatcherPolicyTest.cs (10)
207candidates[0].Values.OrderBy(kvp => kvp.Key),
210Assert.Equal("page", kvp.Key);
248candidates[0].Values.OrderBy(kvp => kvp.Key),
251Assert.Equal("page", kvp.Key);
256Assert.Equal("slug", kvp.Key);
261Assert.Equal("state", kvp.Key);
375candidates[0].Values.OrderBy(kvp => kvp.Key),
378Assert.Equal("page", kvp.Key);
383Assert.Equal("slug", kvp.Key);
388Assert.Equal("state", kvp.Key);
Microsoft.AspNetCore.Mvc.TagHelpers (7)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (20)
Microsoft.AspNetCore.Mvc.Test (4)
Microsoft.AspNetCore.Mvc.Testing (8)
Microsoft.AspNetCore.Mvc.ViewFeatures (36)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (99)
DefaultHtmlGeneratorTest.cs (10)
132var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "name");
186var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "name");
210var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "maxlength");
234var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "maxlength");
258var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "maxlength");
280var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "maxlength");
302Assert.DoesNotContain(tagBuilder.Attributes, a => a.Key == "maxlength");
326var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "maxlength");
433Assert.DoesNotContain(tagBuilder.Attributes, a => a.Key == "maxlength");
486var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "data-valmsg-for");
ModelStateDictionaryExtensionsTest.cs (17)
21Assert.Equal("Text", modelState.Key);
38Assert.Equal("Child.Text", modelState.Key);
55Assert.Equal("Child.Value", modelState.Key);
73Assert.Equal("variable", modelState.Key);
91Assert.Equal("Text", modelState.Key);
111Assert.Equal("Text", modelState.Key);
129Assert.Equal("Child.Text", modelState.Key);
149Assert.Equal("Child.Text", modelState.Key);
167Assert.Equal("Child.Value", modelState.Key);
187Assert.Equal("Child.Value", modelState.Key);
206Assert.Equal("variable", modelState.Key);
227Assert.Equal("variable", modelState.Key);
305Assert.Equal("Key", modelState.Key);
325Assert.Equal("Key", modelState.Key);
344Assert.Equal("Child", modelState.Key);
367Assert.Equal("Key", modelState.Key);
389Assert.Equal("Key", modelState.Key);
RemoteAttributeBaseTest.cs (40)
159kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
162Assert.Equal("data-val-remote", kvp.Key);
167Assert.Equal("data-val-remote-additionalfields", kvp.Key);
170kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("POST", kvp.Value); },
171kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal(url, kvp.Value); });
194kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
198Assert.Equal("data-val-remote", kvp.Key);
203Assert.Equal("data-val-remote-additionalfields", kvp.Key);
206kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("POST", kvp.Value); },
207kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal(url, kvp.Value); });
234kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
238Assert.Equal("data-val-remote", kvp.Key);
243Assert.Equal("data-val-remote-additionalfields", kvp.Key);
246kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("POST", kvp.Value); },
247kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal(url, kvp.Value); });
282kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
285Assert.Equal("data-val-remote", kvp.Key);
290Assert.Equal("data-val-remote-additionalfields", kvp.Key);
293kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("POST", kvp.Value); },
294kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal(url, kvp.Value); });
325kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
329Assert.Equal("data-val-remote", kvp.Key);
334Assert.Equal("data-val-remote-additionalfields", kvp.Key);
337kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("POST", kvp.Value); },
338kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal(url, kvp.Value); });
366kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
369Assert.Equal("data-val-remote", kvp.Key);
374Assert.Equal("data-val-remote-additionalfields", kvp.Key);
377kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("POST", kvp.Value); },
378kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal(url, kvp.Value); });
419kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
422Assert.Equal("data-val-remote", kvp.Key);
427Assert.Equal("data-val-remote-additionalfields", kvp.Key);
430kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("POST", kvp.Value); },
431kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal(url, kvp.Value); });
453kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("true", kvp.Value); },
454kvp => { Assert.Equal("data-val-remote", kvp.Key); Assert.Equal("Error", kvp.Value); },
457Assert.Equal("data-val-remote-additionalfields", kvp.Key);
460kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("POST", kvp.Value); },
461kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal(url, kvp.Value); });
RemoteAttributeTest.cs (10)
57Assert.Equal("controller", keyValuePair.Key);
68Assert.Equal("action", keyValuePair.Key);
97keyValuePair => string.Equals(keyValuePair.Key, "action", StringComparison.Ordinal))
115keyValuePair => string.Equals(keyValuePair.Key, "controller", StringComparison.Ordinal))
135keyValuePair => string.Equals(keyValuePair.Key, "area", StringComparison.Ordinal))
347kvp => { Assert.Equal("data-val", kvp.Key); Assert.Equal("original", kvp.Value); },
348kvp => { Assert.Equal("data-val-remote", kvp.Key); Assert.Equal("original", kvp.Value); },
349kvp => { Assert.Equal("data-val-remote-additionalfields", kvp.Key); Assert.Equal("original", kvp.Value); },
350kvp => { Assert.Equal("data-val-remote-type", kvp.Key); Assert.Equal("original", kvp.Value); },
351kvp => { Assert.Equal("data-val-remote-url", kvp.Key); Assert.Equal("original", kvp.Value); });
Microsoft.AspNetCore.OpenApi (3)
Microsoft.AspNetCore.OpenApi.Tests (245)
Services\CreateSchemaReferenceIdTests.cs (25)
45item => Assert.Equal("triangle", item.Key),
46item => Assert.Equal("square", item.Key)
79Assert.Equal("application/json", content.Key);
87Assert.Equal("id", property.Key);
92Assert.Equal("title", property.Key);
97Assert.Equal("completed", property.Key);
102Assert.Equal("createdAt", property.Key);
128Assert.Equal("application/json", content.Key);
137Assert.Equal("id", property.Key);
142Assert.Equal("title", property.Key);
147Assert.Equal("completed", property.Key);
152Assert.Equal("createdAt", property.Key);
187Assert.Equal("application/json", content.Key);
195Assert.Equal("application/json", responseContent.Key);
230Assert.Equal("application/json", content.Key);
238Assert.Equal("application/json", responseContent.Key);
252Assert.Equal("dueDate", property.Key);
258Assert.Equal("id", property.Key);
263Assert.Equal("title", property.Key);
268Assert.Equal("completed", property.Key);
273Assert.Equal("createdAt", property.Key);
283Assert.Equal("id", property.Key);
288Assert.Equal("title", property.Key);
293Assert.Equal("completed", property.Key);
298Assert.Equal("createdAt", property.Key);
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Paths.cs (26)
23Assert.Collection(document.Paths.OrderBy(p => p.Key),
26Assert.Equal("/api/todos", path.Key);
27Assert.Collection(path.Value.Operations.OrderBy(o => o.Key),
30Assert.Equal(OperationType.Get, operation.Key);
35Assert.Equal("/api/users", path.Key);
36Assert.Collection(path.Value.Operations.OrderBy(o => o.Key),
39Assert.Equal(OperationType.Get, operation.Key);
61Assert.Collection(document.Paths.OrderBy(p => p.Key),
64Assert.Equal("/api/todos", path.Key);
83Assert.Collection(document.Paths.OrderBy(p => p.Key),
86Assert.Equal("/api/todos", path.Key);
87Assert.Collection(path.Value.Operations.OrderBy(o => o.Key),
90Assert.Equal(OperationType.Get, operation.Key);
94Assert.Equal(OperationType.Post, operation.Key);
115Assert.Collection(document.Paths.OrderBy(p => p.Key),
118Assert.Equal("/api/todos/{id}", path.Key);
119Assert.Collection(path.Value.Operations.OrderBy(o => o.Key),
122Assert.Equal(OperationType.Get, operation.Key);
126Assert.Equal(OperationType.Put, operation.Key);
130Assert.Equal(OperationType.Post, operation.Key);
134Assert.Equal(OperationType.Patch, operation.Key);
154Assert.Collection(document.Paths.OrderBy(p => p.Key),
157Assert.Equal("/api/todos/{id}", path.Key);
158Assert.Collection(path.Value.Operations.OrderBy(o => o.Key),
161Assert.Equal(OperationType.Get, operation.Key);
165Assert.Equal(OperationType.Post, operation.Key);
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.RequestBody.cs (38)
40Assert.Equal("multipart/form-data", content.Key);
117Assert.Equal("multipart/form-data", content.Key);
185Assert.Equal("multipart/form-data", content.Key);
225Assert.Equal("application/magic-foo-content-type", content.Key);
252Assert.Equal("application/magic-foo-content-type", content.Key);
280Assert.Equal("application/json", content.Key);
333Assert.Equal("application/json", content.Key);
354Assert.Equal("application/magic-foo-content-type", content.Key);
375Assert.Equal("application/magic-foo-content-type", content.Key);
431Assert.Equal("id", property.Key);
436Assert.Equal("title", property.Key);
441Assert.Equal("completed", property.Key);
446Assert.Equal("createdAt", property.Key);
530Assert.Equal("Id", property.Key);
535Assert.Equal("Title", property.Key);
540Assert.Equal("Completed", property.Key);
545Assert.Equal("CreatedAt", property.Key);
588Assert.Equal("id", property.Key);
593Assert.Equal("title", property.Key);
598Assert.Equal("completed", property.Key);
603Assert.Equal("createdAt", property.Key);
613Assert.Equal("code", property.Key);
618Assert.Equal("message", property.Key);
653Assert.Equal("Id", property.Key);
658Assert.Equal("Title", property.Key);
663Assert.Equal("Completed", property.Key);
668Assert.Equal("CreatedAt", property.Key);
678Assert.Equal("Code", property.Key);
683Assert.Equal("Message", property.Key);
719Assert.Equal("Name", property.Key);
795Assert.Equal("Name", property.Key);
800Assert.Equal("Description", property.Key);
805Assert.Equal("Resume", property.Key);
838Assert.Equal("name", property.Key);
843Assert.Equal("description", property.Key);
848Assert.Equal("resume", property.Key);
878Assert.Equal("model", property.Key);
1123Assert.Equal("application/octet-stream", content.Key);
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Responses.cs (37)
28Assert.Collection(operation.Responses.OrderBy(r => r.Key),
31Assert.Equal("201", response.Key);
36Assert.Equal("400", response.Key);
57Assert.Equal("400", response.Key);
81Assert.Equal("200", response.Key);
84Assert.Equal("text/plain", content.Key);
106Assert.Equal("200", response.Key);
109Assert.Equal("application/json", content.Key);
129Assert.Equal("200", response.Key);
131Assert.Collection(response.Value.Content.OrderBy(c => c.Key),
134Assert.Equal("application/json", content.Key);
138Assert.Equal("application/xml", content.Key);
159Assert.Equal("200", response.Key);
161Assert.Collection(response.Value.Content.OrderBy(c => c.Key),
164Assert.Equal("application/xml", content.Key);
183Assert.Equal("200", response.Key);
202Assert.Equal("200", response.Key);
204Assert.Collection(response.Value.Content.OrderBy(c => c.Key),
207Assert.Equal("application/json", content.Key);
211Assert.Equal("application/xml", content.Key);
230Assert.Equal(Microsoft.AspNetCore.OpenApi.OpenApiConstants.DefaultOpenApiResponseKey, response.Key);
233Assert.Equal("application/json", mediaTypeEntry.Key);
238Assert.Equal("code", property.Key);
242Assert.Equal("message", property.Key);
271Assert.Equal("code", property.Key);
276Assert.Equal("message", property.Key);
284Assert.Equal("application/json", okContent.Key);
289Assert.Equal("id", property.Key);
293Assert.Equal("title", property.Key);
297Assert.Equal("completed", property.Key);
301Assert.Equal("createdAt", property.Key);
328Assert.Collection(operation.Responses.OrderBy(r => r.Key),
331Assert.Equal("201", response.Key);
336Assert.Equal("400", response.Key);
359Assert.Collection(operation.Responses.OrderBy(r => r.Key),
362Assert.Equal("201", response.Key);
367Assert.Equal("400", response.Key);
Services\OpenApiGeneratorTests.cs (42)
124Assert.Equal("application/custom0", request.Content.First().Key);
125Assert.Equal("application/custom1", request.Content.Last().Key);
140Assert.Equal("application/custom0", request.Content.First().Key);
141Assert.Equal("application/custom1", request.Content.Last().Key);
155Assert.Equal("200", response.Key);
158Assert.Equal("application/json", formats.Key);
177Assert.Equal("200", response.Key);
179Assert.Equal("text/plain", formats.Key);
188Assert.Equal("200", response.Key);
216Assert.Equal("application/json", content.Key);
222Assert.Equal("application/json", badRequestContent.Key);
239Assert.Equal("application/json", createdResponseContent.Key);
434Assert.Equal("application/json", content.Key);
467Assert.Equal("application/json", fromBodyContent.Key);
554Assert.Equal("application/json+problem", content.Key);
571Assert.Equal("application/json", content.Key);
604responses.OrderBy(response => response.Key),
608Assert.Equal("200", responseType.Key);
609Assert.Equal("application/json", content.Key);
614Assert.Equal("400", responseType.Key);
615Assert.Equal("application/problem+json", content.Key);
620Assert.Equal("404", responseType.Key);
621Assert.Equal("application/problem+json", content.Key);
626Assert.Equal("409", responseType.Key);
627Assert.Equal("application/problem+json", content.Key);
646responses.OrderBy(response => response.Key),
650Assert.Equal("200", responseType.Key);
651Assert.Equal("application/json", content.Key);
656Assert.Equal("201", responseType.Key);
657Assert.Equal("application/json", content.Key);
681Assert.Equal("application/json", parameter.Key);
685Assert.Equal("application/xml", parameter.Key);
720Assert.Equal("application/json", content.Key);
736Assert.Equal("application/json", content.Key);
752Assert.Equal("application/xml", content.Key);
768Assert.Equal("multipart/form-data", content.Key);
784Assert.Equal("multipart/form-data", content.Key);
800Assert.Equal("multipart/form-data", content.Key);
855Assert.Equal("multipart/form-data", content.Key);
879Assert.Equal("multipart/form-data", content.Key);
914Assert.Equal("200", response.Key);
915Assert.Equal("application/json", content.Key);
Services\OpenApiSchemaService\OpenApiSchemaService.PolymorphicSchemas.cs (12)
31item => Assert.Equal("triangle", item.Key),
32item => Assert.Equal("square", item.Key)
68item => Assert.Equal("0", item.Key),
69item => Assert.Equal("1", item.Key),
70item => Assert.Equal("2", item.Key)
113item => Assert.Equal("student", item.Key),
114item => Assert.Equal("teacher", item.Key)
190item => Assert.Equal("cat", item.Key),
191item => Assert.Equal("dog", item.Key),
192item => Assert.Equal("pet", item.Key)
279item => Assert.Equal("manager", item.Key),
280item => Assert.Equal("employee", item.Key)
Services\OpenApiSchemaService\OpenApiSchemaService.RequestBodySchemas.cs (34)
34Assert.Equal("application/json", content.Key);
41Assert.Equal("id", property.Key);
46Assert.Equal("title", property.Key);
51Assert.Equal("completed", property.Key);
56Assert.Equal("createdAt", property.Key);
97Assert.Equal("id", property.Key);
105Assert.Equal("name", property.Key);
112Assert.Equal("isPrivate", property.Key);
220Assert.Equal("proposalElement", property.Key);
224Assert.Equal("stream", property.Key);
272Assert.Equal("id", property.Key);
277Assert.Equal("title", property.Key);
282Assert.Equal("completed", property.Key);
287Assert.Equal("createdAt", property.Key);
317Assert.Equal("length", property.Key);
323Assert.Equal("wheels", property.Key);
329Assert.Equal("make", property.Key);
356Assert.Equal("id", property.Key);
363Assert.Equal("title", property.Key);
369Assert.Equal("completed", property.Key);
375Assert.Equal("createdAt", property.Key);
420Assert.Equal("nullableInt", property.Key);
426Assert.Equal("nullableString", property.Key);
432Assert.Equal("nullableBool", property.Key);
438Assert.Equal("nullableDateTime", property.Key);
445Assert.Equal("nullableUri", property.Key);
473Assert.Equal("name", property.Key);
478Assert.Equal("nested", property.Key);
518Assert.Equal("name", property.Key);
523Assert.Equal("nested", property.Key);
617Assert.Equal("number", property.Key);
643Assert.Equal("number", property.Key);
681Assert.Equal("selfReferenceList", property.Key);
687Assert.Equal("selfReferenceDictionary", property.Key);
Transformers\OperationTransformerTests.cs (30)
30Assert.Collection(document.Paths.OrderBy(p => p.Key),
33Assert.Equal("/todo", path.Key);
39Assert.Equal("/user", path.Key);
94Assert.Collection(document.Paths.OrderBy(p => p.Key),
97Assert.Equal("/todo", path.Key);
103Assert.Equal("/user", path.Key);
162Assert.Collection(document.Paths.OrderBy(p => p.Key),
165Assert.Equal("/todo", path.Key);
171Assert.Equal("/user", path.Key);
195Assert.Collection(document.Paths.OrderBy(p => p.Key),
198Assert.Equal("/todo", path.Key);
204Assert.Equal("/user", path.Key);
224Assert.Collection(document.Paths.OrderBy(p => p.Key),
227Assert.Equal("/todo", path.Key);
233Assert.Equal("/user", path.Key);
253Assert.Collection(document.Paths.OrderBy(p => p.Key),
256Assert.Equal("/todo", path.Key);
262Assert.Equal("/user", path.Key);
286Assert.Collection(document.Paths.OrderBy(p => p.Key),
289Assert.Equal("/todo", path.Key);
296Assert.Equal("/user", path.Key);
303Assert.Collection(document.Paths.OrderBy(p => p.Key),
306Assert.Equal("/todo", path.Key);
312Assert.Equal("/user", path.Key);
353Assert.Collection(document.Paths.OrderBy(p => p.Key),
356Assert.Equal("/todo", path.Key);
362Assert.Equal("/user", path.Key);
384Assert.Collection(document.Paths.OrderBy(p => p.Key),
387Assert.Equal("/todo", path.Key);
393Assert.Equal("/user", path.Key);
Microsoft.AspNetCore.OutputCaching (5)
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (4)
Microsoft.AspNetCore.OutputCaching.Tests (2)
Microsoft.AspNetCore.Owin (7)
Microsoft.AspNetCore.Owin.Tests (2)
Microsoft.AspNetCore.RateLimiting (1)
Microsoft.AspNetCore.Razor.Runtime (1)
Microsoft.AspNetCore.Razor.Runtime.Test (8)
Runtime\TagHelpers\TagHelperScopeManagerTest.cs (8)
23Assert.Equal("test-entry", (string)executionContextItem.Key, StringComparer.Ordinal);
40Assert.Equal("test-entry", (string)executionContextItem.Key, StringComparer.Ordinal);
59Assert.Equal("test-entry", (string)executionContextItem.Key, StringComparer.Ordinal);
62Assert.Equal("from-child", parentEntry.Key, StringComparer.Ordinal);
80Assert.Equal("test-entry", (string)executionContextItem.Key, StringComparer.Ordinal);
83Assert.Equal("test-entry", (string)parentExecutionContextItem.Key, StringComparer.Ordinal);
100Assert.Equal("new-entry", (string)executionContextItem.Key, StringComparer.Ordinal);
120Assert.Equal("test-entry", (string)parentExecutionContextItem.Key, StringComparer.Ordinal);
Microsoft.AspNetCore.Razor.Test (2)
Microsoft.AspNetCore.ResponseCaching (7)
Microsoft.AspNetCore.ResponseCaching.Tests (2)
Microsoft.AspNetCore.Rewrite.Tests (2)
Microsoft.AspNetCore.Routing (86)
Patterns\DefaultRoutePatternTransformer.cs (12)
56if (original.GetParameter(kvp.Key) != null)
65else if (original.Defaults.TryGetValue(kvp.Key, out var defaultValue) &&
83if (original.GetParameter(kvp.Key) == null &&
84original.Defaults.TryGetValue(kvp.Key, out var defaultValue) &&
98else if ((parameter = original.GetParameter(kvp.Key)) != null)
102if (!MatchesConstraints(original, parameter, kvp.Key, requiredValues))
115else if (original.Defaults.TryGetValue(kvp.Key, out var defaultValue) &&
121if (!MatchesConstraints(original, parameter: null, kvp.Key, requiredValues))
159var parameter = original.GetParameter(kvp.Key);
168original.Defaults.TryGetValue(kvp.Key, out var defaultValue) &&
178updatedDefaults.Remove(kvp.Key);
185requiredValues.TryAdd(kvp.Key, kvp.Value);
Template\TemplateBinder.cs (13)
176var key = slots[i].Key;
257var key = slots[i].Key;
358var key = filters[i].Key;
391if (!_defaults!.ContainsKey(kvp.Key))
396if (!acceptedValues.ContainsKey(kvp.Key))
398acceptedValues.Add(kvp.Key, kvp.Value);
596if (_defaults != null && _defaults.ContainsKey(kvp.Key))
607wroteFirst |= AddQueryKeyValueToContext(context, kvp.Key, value, wroteFirst);
612wroteFirst |= AddQueryKeyValueToContext(context, kvp.Key, kvp.Value, wroteFirst);
711var parameter = _pattern.GetParameter(kvp.Key);
712if (parameter == null && !acceptedValues.ContainsKey(kvp.Key))
714combinedValues.Add(kvp.Key, kvp.Value);
731slots[i + pattern.Parameters.Count] = new KeyValuePair<string, object?>(filters[i].Key, null);
Microsoft.AspNetCore.Routing.Abstractions (5)
Microsoft.AspNetCore.Routing.Tests (114)
Matching\DfaMatcherTest.cs (13)
158httpContext.Request.RouteValues.OrderBy(kvp => kvp.Key),
161Assert.Equal("action", kvp.Key);
166Assert.Equal("controller", kvp.Key);
223httpContext.Request.RouteValues.OrderBy(kvp => kvp.Key),
226Assert.Equal("action", kvp.Key);
231Assert.Equal("controller", kvp.Key);
236Assert.Equal("id", kvp.Key);
341httpContext.Request.RouteValues.OrderBy(kvp => kvp.Key),
344Assert.Equal("action", kvp.Key);
349Assert.Equal("controller", kvp.Key);
601httpContext.Request.RouteValues.OrderBy(kvp => kvp.Key),
604Assert.Equal("action", kvp.Key);
609Assert.Equal("controller", kvp.Key);
Patterns\DefaultRoutePatternTransformerTest.cs (12)
38actual.RequiredValues.OrderBy(kvp => kvp.Key),
79actual.Defaults.OrderBy(kvp => kvp.Key),
84actual.RequiredValues.OrderBy(kvp => kvp.Key),
143actual.RequiredValues.OrderBy(kvp => kvp.Key),
165actual.RequiredValues.OrderBy(kvp => kvp.Key),
192actual.RequiredValues.OrderBy(kvp => kvp.Key),
227actual.RequiredValues.OrderBy(kvp => kvp.Key),
268actual.RequiredValues.OrderBy(kvp => kvp.Key),
309actual.RequiredValues.OrderBy(kvp => kvp.Key),
331actual.RequiredValues.OrderBy(kvp => kvp.Key),
353actual.RequiredValues.OrderBy(kvp => kvp.Key),
375actual.RequiredValues.OrderBy(kvp => kvp.Key),
Patterns\RoutePatternFactoryTest.cs (37)
35actual.Defaults.OrderBy(kvp => kvp.Key),
36kvp => { Assert.Equal("a", kvp.Key); Assert.Equal("15", kvp.Value); },
37kvp => { Assert.Equal("b", kvp.Key); Assert.Equal(17, kvp.Value); },
38kvp => { Assert.Equal("c", kvp.Key); Assert.Equal("19", kvp.Value); });
60actual.Defaults.OrderBy(kvp => kvp.Key),
61kvp => { Assert.Equal("d", kvp.Key); Assert.Equal("15", kvp.Value); },
62kvp => { Assert.Equal("e", kvp.Key); Assert.Equal(17, kvp.Value); });
110kvp => { Assert.Equal("a", kvp.Key); Assert.Equal("13", kvp.Value); });
163actual.ParameterPolicies.OrderBy(kvp => kvp.Key),
166Assert.Equal("a", kvp.Key);
174Assert.Equal("b", kvp.Key);
200actual.ParameterPolicies.OrderBy(kvp => kvp.Key),
203Assert.Equal("d", kvp.Key);
210Assert.Equal("e", kvp.Key);
236actual.ParameterPolicies.OrderBy(kvp => kvp.Key),
239Assert.Equal("d", kvp.Key);
267actual.ParameterPolicies.OrderBy(kvp => kvp.Key),
270Assert.Equal("a", kvp.Key);
277Assert.Equal("b", kvp.Key);
284Assert.Equal("c", kvp.Key);
334actual.ParameterPolicies.OrderBy(kvp => kvp.Key),
337Assert.Equal("d", kvp.Key);
344Assert.Equal("e", kvp.Key);
370actual.ParameterPolicies.OrderBy(kvp => kvp.Key),
373Assert.Equal("d", kvp.Key);
552action.RequiredValues.OrderBy(kvp => kvp.Key),
553kvp => { Assert.Equal("action", kvp.Key); Assert.Equal("Index", kvp.Value); },
554kvp => { Assert.Equal("area", kvp.Key); Assert.Equal("Admin", kvp.Value); },
555kvp => { Assert.Equal("controller", kvp.Key); Assert.Equal("Store", kvp.Value); });
572action.RequiredValues.OrderBy(kvp => kvp.Key),
573kvp => { Assert.Equal("action", kvp.Key); Assert.Equal("Index", kvp.Value); },
574kvp => { Assert.Equal("area", kvp.Key); Assert.Null(kvp.Value); },
575kvp => { Assert.Equal("controller", kvp.Key); Assert.Equal("Store", kvp.Value); });
592action.RequiredValues.OrderBy(kvp => kvp.Key),
593kvp => { Assert.Equal("action", kvp.Key); Assert.Equal("Index", kvp.Value); },
594kvp => { Assert.Equal("area", kvp.Key); Assert.Equal("", kvp.Value); },
595kvp => { Assert.Equal("controller", kvp.Key); Assert.Equal("Store", kvp.Value); });
Tree\TreeRouteBuilderTest.cs (11)
90Assert.Equal("a", firstSegment.Key);
97Assert.Equal("c", thirdSegment.Key);
122Assert.Equal("a", firstSegment.Key);
129Assert.Equal("c", thirdSegment.Key);
137Assert.Equal("e", fifthSegment.Key);
166Assert.Equal("a", firstSegment.Key);
173Assert.Equal("c", thirdSegment.Key);
198Assert.Equal("a", firstSegment.Key);
205Assert.Equal("c", thirdSegment.Key);
230Assert.Equal("a", firstSegment.Key);
237Assert.Equal("c", thirdSegment.Key);
Microsoft.AspNetCore.Server.HttpSys (14)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (5)
Microsoft.AspNetCore.Server.IIS (17)
Microsoft.AspNetCore.Server.IntegrationTesting (4)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (3)
Microsoft.AspNetCore.Server.Kestrel.Core (33)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (34)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (13)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (3)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (8)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (3)
Microsoft.AspNetCore.Session (1)
Microsoft.AspNetCore.Shared.Tests (45)
AdaptiveCapacityDictionaryTests.cs (23)
198Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
216dict.OrderBy(kvp => kvp.Key),
217kvp => { Assert.Equal("age", kvp.Key); Assert.Equal(30, kvp.Value); },
218kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
235Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
252Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
358Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
389dict.OrderBy(kvp => kvp.Key),
390kvp => { Assert.Equal("age", kvp.Key); Assert.Equal(30, kvp.Value); },
391kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
411dict.OrderBy(kvp => kvp.Key),
412kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
432dict.OrderBy(kvp => kvp.Key),
433kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
451dict.OrderBy(kvp => kvp.Key),
452kvp => { Assert.Equal("age", kvp.Key); Assert.Equal(30, kvp.Value); },
453kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
723Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
744Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
788Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
871Assert.Collection(dict, kvp => { Assert.Equal("key", kvp.Key); Assert.Equal("value", kvp.Value); });
1275Assert.Equal("key", storage[0].Key);
1277Assert.Equal("key3", storage[1].Key);
Microsoft.AspNetCore.SignalR.Client.Core (2)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (2)
Microsoft.AspNetCore.SignalR.Client.Tests (6)
Microsoft.AspNetCore.SignalR.Common.Tests (1)
Microsoft.AspNetCore.SignalR.Core (2)
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (2)
Microsoft.AspNetCore.SignalR.Tests (5)
Microsoft.AspNetCore.SignalR.Tests.Utils (2)
Microsoft.AspNetCore.SpaServices.Extensions (9)
Microsoft.AspNetCore.TestHost (10)
Microsoft.AspNetCore.TestHost.Tests (2)
Microsoft.AspNetCore.Tests (1)
Microsoft.AspNetCore.WebUtilities (3)
Microsoft.AspNetCore.WebUtilities.Tests (2)
Microsoft.Build (274)
BackEnd\Components\Scheduler\SchedulingPlan.cs (6)
114configurationsInOrder.Sort((KeyValuePair<int, double> l, KeyValuePair<int, double> r) => Comparer<int>.Default.Compare(l.Key, r.Key));
117file.WriteLine(String.Format(CultureInfo.InvariantCulture, "{0} {1} {2}", configuration.Key, configuration.Value, _configCache[configuration.Key].ProjectFullPath));
241Console.WriteLine("{0}: {1} ({2} referrers) {3}", configuration.Key, config.TotalPlanTime, config.ReferrerCount, config.ConfigFullPath);
263Console.WriteLine("{0}: {1} {2}", configuration.Key, configuration.Value.ReferencesCount, configuration.Value.ConfigFullPath);
Evaluation\Expander.cs (31)
1949var itemSpec = itemTuple.Key;
2056if (!string.IsNullOrEmpty(itemTuple.Key) && (options & ExpanderOptions.BreakOnNotEmpty) != 0)
2067var joinedItems = string.Join(expressionCapture.Separator, itemsFromCapture.Select(i => i.Key));
2211if (!string.IsNullOrEmpty(item.Key) && currentLength + item.Key.Length > CharacterLimitPerExpansion)
2216builder.Append(item.Key, 0, truncateIndex);
2222builder.Append(item.Key);
2354if (String.IsNullOrEmpty(item.Key))
2369result = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(directoryToUse, item.Key, definingProjectEscaped, functionName);
2375ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "InvalidItemFunctionExpression", functionName, item.Key, e.Message);
2400if (String.IsNullOrEmpty(item.Key))
2406string unescapedPath = EscapingUtilities.UnescapeAll(item.Key);
2428ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "InvalidItemFunctionExpression", functionName, item.Key, e.Message);
2449if (String.IsNullOrEmpty(item.Key))
2455string unescapedPath = EscapingUtilities.UnescapeAll(item.Key);
2475if (String.IsNullOrEmpty(item.Key))
2483string unescapedPath = EscapingUtilities.UnescapeAll(item.Key);
2512ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "InvalidItemFunctionExpression", functionName, item.Key, e.Message);
2551if (String.IsNullOrEmpty(item.Key))
2557if (!directoryNameTable.TryGetValue(item.Key, out directoryName))
2560string unescapedPath = EscapingUtilities.UnescapeAll(item.Key);
2585ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "InvalidItemFunctionExpression", functionName, item.Key, e.Message);
2689if (item.Key != null && seenItems.Add(item.Key))
2720if (item.Key != null)
2722matchEvaluator = new MetadataMatchEvaluator(item.Key, item.Value, elementLocation);
2762item.Key,
2763item.Key,
2772object result = function.Execute(item.Key, expander._properties, ExpanderOptions.ExpandAll, elementLocation);
2797if (includeNullEntries || item.Key != null)
2799yield return new KeyValuePair<string, S>(item.Key, null);
Instance\ProjectInstance.cs (7)
392_globalProperties.Set(ProjectPropertyInstance.Create(property.Key, property.Value));
566_globalProperties[property.Key] = ProjectPropertyInstance.Create(property.Key, property.Value, false /* may not be reserved */, _isImmutable);
815foreach (var actualItem in that.GetItems(itemFilter.Key))
3148if (String.Equals(globalProperty.Key, Constants.SubToolsetVersionPropertyName, StringComparison.OrdinalIgnoreCase) && explicitSubToolsetVersion != null)
3153_globalProperties.Set(ProjectPropertyInstance.Create(globalProperty.Key, explicitSubToolsetVersion, false /* may not be reserved */, _isImmutable));
3157_globalProperties.Set(ProjectPropertyInstance.Create(globalProperty.Key, globalProperty.Value, false /* may not be reserved */, _isImmutable));
Microsoft.Build.BuildCheck.UnitTests (1)
Microsoft.Build.CommandLine.UnitTests (4)
Microsoft.Build.Engine.OM.UnitTests (15)
Microsoft.Build.Engine.UnitTests (70)
Microsoft.Build.Framework (41)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (3)
Microsoft.Build.Tasks.Core (58)
AssemblyDependency\GenerateBindingRedirects.cs (11)
97new XAttribute("name", redirect.Key.Name),
98new XAttribute("publicKeyToken", ResolveAssemblyReference.ByteArrayToString(redirect.Key.GetPublicKeyToken())),
99new XAttribute("culture", String.IsNullOrEmpty(redirect.Key.CultureName) ? "neutral" : redirect.Key.CultureName)),
281if (IsMatch(entry.Key, nameValue, cultureValue, publicKeyTokenValue))
289var newName = entry.Key.Name;
290var newCulture = entry.Key.CultureName;
291var newPublicKeyToken = entry.Key.GetPublicKeyToken();
292var newProcessorArchitecture = entry.Key.ProcessorArchitecture;
313redirects.Remove(entry.Key);
315Log.LogWarningWithCodeFromResources("GenerateBindingRedirects.OverlappingBindingRedirect", entry.Key.ToString(), bindingRedirect.ToString());
Microsoft.Build.Tasks.UnitTests (12)
Copy_Tests.cs (5)
2025filesActuallyCopied.Select(f => Path.GetFileName(f.Key.Name)).ShouldBe(new[] { "a.cs", "b.cs" }, ignoreOrder: true);
2095Assert.Equal(Path.Combine(tempPath, "a.cs"), xaCopies[0].Key.Name);
2096Assert.Equal(Path.Combine(tempPath, "b.cs"), xaCopies[1].Key.Name);
2097Assert.Equal(Path.Combine(tempPath, "a.cs"), xaCopies[2].Key.Name);
2102Assert.Equal(Path.Combine(tempPath, "a.cs"), xbCopies[0].Key.Name);
Microsoft.Build.UnitTests.Shared (10)
Microsoft.Build.Utilities.Core (30)
TaskItem.cs (9)
341copiedMetadata.SetItems(_metadata.Where(entry => !destinationAsTaskItem.Metadata.TryGetValue(entry.Key, out string val) || String.IsNullOrEmpty(val)));
353value = destinationAsITaskItem2.GetMetadataValueEscaped(entry.Key);
357destinationAsITaskItem2.SetMetadata(entry.Key, entry.Value);
362value = destinationItem.GetMetadata(entry.Key);
366destinationItem.SetMetadata(entry.Key, EscapingUtilities.Escape(entry.Value));
406dictionary.Add(entry.Key, EscapingUtilities.UnescapeAll(entry.Value));
508_metadata.SetItems(metadata.Select(kvp => new KeyValuePair<string, string>(kvp.Key, kvp.Value ?? string.Empty)));
523var unescaped = new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value));
539var unescaped = new KeyValuePair<string, string>(kvp.Key, EscapingUtilities.UnescapeAll(kvp.Value));
ToolLocationHelper.cs (8)
405extensionSDKs[extension.Key] = extension.Value;
452extensionSDKsAndVersions[extension.Key] = Tuple.Create<string, string>(extension.Value, moniker.TargetPlatformVersion.ToString());
622ExtensionSDK extensionSDK = new ExtensionSDK(sdk.Key, sdk.Value);
627filteredExtensionSdks.Add(sdk.Key, sdk.Value);
2608if (rootPathWithIdentifier.Name.Equals(uapDirectoryName, StringComparison.OrdinalIgnoreCase) && directoryUnderRoot.Key.Major == uapVersion)
2610platformSDKKey = new TargetPlatformSDK(uapRegistryName, directoryUnderRoot.Key, null);
2614platformSDKKey = new TargetPlatformSDK(rootPathWithIdentifier.Name, directoryUnderRoot.Key, null);
2713TargetPlatformSDK platformSDKKey = new TargetPlatformSDK(platformIdentifier, registryVersions.Key, null);
Microsoft.Build.Utilities.UnitTests (1)
Microsoft.Cci.Extensions (1)
Microsoft.CodeAnalysis (145)
Symbols\Attributes\CommonAttributeData.cs (6)
183if (string.Equals(namedArguments[i].Key, name, StringComparison.Ordinal))
438if (namedArg.Key == "MethodCodeType")
494switch (namedArg.Key)
510messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, attribute.AttributeClass, namedArg.Key);
523messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, attribute.AttributeClass, namedArg.Key);
533messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, attribute.AttributeClass, namedArg.Key);
Symbols\Attributes\MarshalAsAttributeDecoder.cs (13)
128switch (namedArg.Key)
134messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key);
150messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key);
184switch (namedArg.Key)
190messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key);
219switch (namedArg.Key)
230messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key);
240messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key);
255messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key);
308switch (namedArg.Key)
314messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key);
376switch (namedArg.Key)
382messageProvider.ReportInvalidNamedArgument(arguments.Diagnostics, arguments.AttributeSyntaxOpt, position, arguments.Attribute.AttributeClass, namedArg.Key);
Microsoft.CodeAnalysis.CodeStyle (36)
Microsoft.CodeAnalysis.Collections.Package (21)
Microsoft.CodeAnalysis.CSharp (41)
Microsoft.CodeAnalysis.CSharp.CodeStyle (8)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (7)
Microsoft.CodeAnalysis.CSharp.Features (1)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (6)
SourceGeneration\GeneratorDriverTests.cs (6)
3243Assert.DoesNotContain(result.Results[0].HostOutputs, o => o.Key == "Host");
3254Assert.Contains(result.Results[0].HostOutputs, o => o.Key == "Host");
4729(r) => { var result = Assert.Single(r.HostOutputs); Assert.Equal("gen1", result.Key); Assert.Equal("value1", result.Value); },
4730(r) => { var result = Assert.Single(r.HostOutputs); Assert.Equal("gen2", result.Key); Assert.Equal("value2", result.Value); }
4747(r) => { var result = Assert.Single(r.HostOutputs); Assert.Equal("gen", result.Key); Assert.Equal("value1", result.Value); },
4748(r) => { var result = Assert.Single(r.HostOutputs); Assert.Equal("gen", result.Key); Assert.Equal("value2", result.Value); }
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (10)
Microsoft.CodeAnalysis.EditorFeatures (3)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (11)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (9)
Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests (3)
Microsoft.CodeAnalysis.Features (24)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncWorkItemQueue.cs (1)
255return pair.Key;
Microsoft.CodeAnalysis.Features.Test.Utilities (10)
Microsoft.CodeAnalysis.Features.UnitTests (1)
Microsoft.CodeAnalysis.InteractiveHost (23)
Microsoft.CodeAnalysis.LanguageServer (3)
BrokeredServices\Services\BrokeredServiceBridgeManifest\BrokeredServiceBridgeManifestService.cs (1)
45.Select(s => s.Key)
Microsoft.CodeAnalysis.LanguageServer.Protocol (7)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (3)
Microsoft.CodeAnalysis.PooledObjects.Package (1)
Microsoft.CodeAnalysis.Remote.ServiceHub (6)
Microsoft.CodeAnalysis.Remote.ServiceHub.UnitTests (2)
Microsoft.CodeAnalysis.Test.Utilities (12)
Microsoft.CodeAnalysis.Threading.Package (22)
Microsoft.CodeAnalysis.UnitTests (11)
Microsoft.CodeAnalysis.VisualBasic (26)
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
Microsoft.CodeAnalysis.Workspaces (79)
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (30)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (4)
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Microsoft.CommonLanguageServerProtocol.Framework.Package (2)
Microsoft.CSharp (1)
Microsoft.Data.Analysis (10)
Microsoft.Data.Analysis.Interactive (1)
Microsoft.DotNet.Arcade.Sdk (6)
Microsoft.DotNet.ArcadeLogging (1)
Microsoft.DotNet.AsmDiff (3)
Microsoft.DotNet.Build.Tasks.Feed (4)
Microsoft.DotNet.Build.Tasks.Installers (1)
Microsoft.DotNet.Build.Tasks.Packaging (42)
Microsoft.DotNet.Build.Tasks.Workloads (3)
Microsoft.DotNet.Helix.Client (1)
Microsoft.DotNet.Helix.JobSender (1)
Microsoft.DotNet.Helix.Sdk (2)
Microsoft.DotNet.Open.Api.Tools.Tests (2)
Microsoft.DotNet.RemoteExecutor (1)
Microsoft.DotNet.SharedFramework.Sdk (3)
Microsoft.DotNet.SignTool (13)
Microsoft.DotNet.SignTool.Tests (2)
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (7)
Microsoft.DotNet.VersionTools (15)
Microsoft.DotNet.XliffTasks (1)
Microsoft.Extensions.AI (5)
Microsoft.Extensions.AI.Abstractions (14)
Microsoft.Extensions.AI.Abstractions.Tests (16)
Contents\FunctionCallContentTests..cs (9)
166""", TestJsonSerializerContext.Default.Options)!.ToDictionary(k => k.Key, k => (object?)k.Value);
187""", TestJsonSerializerContext.Default.Options)!.ToDictionary(k => k.Key, k => (object?)k.Value);
206""", TestJsonSerializerContext.Default.Options)!.ToDictionary(k => k.Key, k => (object?)k.Value);
242""", TestJsonSerializerContext.Default.Options)!.ToDictionary(k => k.Key, k => (object?)k.Value);
288Assert.Equal("Key1", kvp.Key);
293Assert.Equal("Key2", kvp.Key);
298Assert.Equal("Key3", kvp.Key);
303Assert.Equal("Key4", kvp.Key);
308Assert.Equal("Key5", kvp.Key);
Microsoft.Extensions.AI.AzureAIInference (4)
Microsoft.Extensions.AI.AzureAIInference.Tests (5)
Microsoft.Extensions.AI.Integration.Tests (1)
Microsoft.Extensions.AI.Ollama.Tests (5)
Microsoft.Extensions.AI.OpenAI (4)
Microsoft.Extensions.AI.OpenAI.Tests (6)
Microsoft.Extensions.AI.Tests (5)
Microsoft.Extensions.ApiDescription.Client.Tests (2)
Microsoft.Extensions.ApiDescription.Tool.Tests (1)
Microsoft.Extensions.Caching.Hybrid.Tests (2)
Microsoft.Extensions.Caching.Memory (2)
Microsoft.Extensions.Compliance.Redaction (1)
Microsoft.Extensions.Configuration (6)
Microsoft.Extensions.Configuration.CommandLine (6)
Microsoft.Extensions.DependencyInjection (3)
Microsoft.Extensions.Diagnostics (5)
Microsoft.Extensions.Diagnostics.HealthChecks (1)
Microsoft.Extensions.Diagnostics.HealthChecks.Common (3)
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (32)
DefaultHealthCheckServiceTest.cs (29)
84results.Entries.OrderBy(kvp => kvp.Key),
87Assert.Equal("DegradedCheck", actual.Key);
96Assert.Equal("HealthyCheck", actual.Key);
102Assert.Equal(DataKey, item.Key);
109Assert.Equal("UnhealthyCheck", actual.Key);
138results.Entries.OrderBy(kvp => kvp.Key),
141Assert.Equal("ExceptionCheck", actual.Key);
150Assert.Equal("OperationExceptionCheck", actual.Key);
189Assert.Equal("HealthyCheck", actual.Key);
195Assert.Equal(DataKey, item.Key);
223Assert.Equal("A", actual.Key);
230Assert.Equal("B", actual.Key);
237Assert.Equal("C", actual.Key);
295Assert.Equal("Throws", actual.Key);
302Assert.Equal("Faults", actual.Key);
309Assert.Equal("Succeeds", actual.Key);
330Assert.Equal("HealthCheckName", item.Key);
352Assert.Equal("TestScope", actual.Key);
376Assert.Equal("Test", actual.Key);
400Assert.Equal("Test", actual.Key);
426Assert.Equal("Test", actual.Key);
431Assert.Equal("Test2", actual.Key);
480Assert.Equal("Test", actual.Key);
523Assert.Equal("test1", entry.Key);
528Assert.Equal("test2", entry.Key);
554Assert.Equal("timeout", actual.Key);
611Assert.Equal("degraded", actual.Key);
616Assert.Equal("healthy", actual.Key);
621Assert.Equal("unhealthy", actual.Key);
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (6)
Microsoft.Extensions.Diagnostics.Testing (6)
Microsoft.Extensions.Diagnostics.Testing.Tests (2)
Microsoft.Extensions.Features (4)
Microsoft.Extensions.FileProviders.Physical (2)
Microsoft.Extensions.FileSystemGlobbing (1)
Microsoft.Extensions.Hosting.Testing.Tests (12)
HostingFakesExtensionsTests.cs (10)
146Assert.Equal("testKey", item.Key);
172Assert.Equal("testKey1", item.Key);
177Assert.Equal("testKey2", item.Key);
201Assert.Equal("testKey", item.Key);
206Assert.Equal("anotherTestKey", item.Key);
232Assert.Equal("testKey", item.Key);
258Assert.Equal("testKey1", item.Key);
263Assert.Equal("testKey2", item.Key);
287Assert.Equal("testKey", item.Key);
292Assert.Equal("anotherTestKey", item.Key);
Microsoft.Extensions.Http (4)
Microsoft.Extensions.Http.Diagnostics (8)
Microsoft.Extensions.Http.Diagnostics.Tests (66)
Logging\HttpClientLoggerTest.cs (20)
254logRecordState.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key));
346logRecordRequest.NotContains(testEnricher.KvpRequest.Key);
358logRecordFull.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key));
359logRecordFull.Contains(testEnricher.KvpResponse.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpResponse.Key));
452logRecordState.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key));
453logRecordState.NotContains(testEnricher.KvpResponse.Key);
455Assert.DoesNotContain(logRecordState, kvp => kvp.Key.StartsWith(HttpClientLoggingTagNames.ResponseHeaderPrefix));
567logRecordState.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key));
568logRecordState.Contains(testEnricher.KvpResponse.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpResponse.Key));
570Assert.DoesNotContain(logRecordState, kvp => kvp.Key.StartsWith(HttpClientLoggingTagNames.ResponseHeaderPrefix));
659logRecordState.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key));
932logRecord.Contains(testEnricher.KvpRequest.Key, expectedLogRecord.GetEnrichmentProperty(testEnricher.KvpRequest.Key));
Logging\HttpRequestReaderTest.cs (30)
61RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData }, { header3.Key, FakeTaxonomy.PrivateData } },
62ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData }, { header3.Key, FakeTaxonomy.PrivateData } },
87httpRequestMessage.Headers.Add(header1.Key, header1.Value);
88httpRequestMessage.Headers.Add(header3.Key, header3.Value);
96httpResponseMessage.Headers.Add(header2.Key, header2.Value);
97httpResponseMessage.Headers.Add(header3.Key, header3.Value);
187RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } },
188ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } },
213httpRequestMessage.Headers.Add(header1.Key, header1.Value);
225httpResponseMessage.Headers.Add(header2.Key, header2.Value);
261RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } },
262ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } },
288httpRequestMessage.Headers.Add(header1.Key, header1.Value);
300httpResponseMessage.Headers.Add(header2.Key, header2.Value);
335RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } },
360httpRequestMessage.Headers.Add(header1.Key, header1.Value);
392RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } },
393ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } },
418httpRequestMessage.Headers.Add(header1.Key, header1.Value);
430httpResponseMessage.Headers.Add(header2.Key, header2.Value);
463RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } },
464ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } },
489httpRequestMessage.Headers.Add(header1.Key, header1.Value);
497httpResponseMessage.Headers.Add(header2.Key, header2.Value);
530RequestHeadersDataClasses = new Dictionary<string, DataClassification> { { header1.Key, FakeTaxonomy.PrivateData } },
531ResponseHeadersDataClasses = new Dictionary<string, DataClassification> { { header2.Key, FakeTaxonomy.PrivateData } },
556httpRequestMessage.Headers.Add(header1.Key, header1.Value);
565httpResponseMessage.Headers.Add(header2.Key, header2.Value);
Microsoft.Extensions.Http.Resilience (2)
Microsoft.Extensions.Http.Resilience.Tests (4)
Microsoft.Extensions.Identity.Core (1)
Microsoft.Extensions.Logging (6)
Microsoft.Extensions.Logging.Configuration (1)
Microsoft.Extensions.Logging.Console (1)
Microsoft.Extensions.Logging.EventLog (1)
Microsoft.Extensions.Logging.EventSource (2)
Microsoft.Extensions.Logging.Generators (9)
Microsoft.Extensions.Options.SourceGeneration (16)
Emitter.cs (13)
620var attributesData = _optionsSourceGenContext.AttributesToGenerate.OrderBy(static kvp => kvp.Key, StringComparer.Ordinal).ToArray();
627if (attributeData.Key == _symbolHolder.MaxLengthAttributeSymbol.Name)
630EmitMaxLengthAttribute(_optionsSourceGenContext.ClassModifier, Emitter.StaticAttributeClassNamePrefix, attributeData.Key, linesToInsert, _optionsSourceGenContext.Suffix);
632else if (attributeData.Key == _symbolHolder.MinLengthAttributeSymbol.Name)
635EmitMinLengthAttribute(_optionsSourceGenContext.ClassModifier, Emitter.StaticAttributeClassNamePrefix, attributeData.Key, linesToInsert, _optionsSourceGenContext.Suffix);
637else if (_symbolHolder.LengthAttributeSymbol is not null && attributeData.Key == _symbolHolder.LengthAttributeSymbol.Name)
640EmitLengthAttribute(_optionsSourceGenContext.ClassModifier, Emitter.StaticAttributeClassNamePrefix, attributeData.Key, linesToInsert, _optionsSourceGenContext.Suffix);
642else if (attributeData.Key == _symbolHolder.CompareAttributeSymbol.Name && attributeData.Value is not null)
645EmitCompareAttribute(_optionsSourceGenContext.ClassModifier, Emitter.StaticAttributeClassNamePrefix, attributeData.Key, linesToInsert: linesToInsert, _optionsSourceGenContext.Suffix);
647else if (attributeData.Key == _symbolHolder.RangeAttributeSymbol.Name)
649EmitRangeAttribute(_optionsSourceGenContext.ClassModifier, Emitter.StaticAttributeClassNamePrefix, attributeData.Key, _optionsSourceGenContext.Suffix, attributeData.Value is not null);
783.OrderBy(p => p.Key)
790attrInstantiationStatementLines.Add($"{GetPaddingString(1)}{prop.Key} = {prop.Value}{(notLast ? "," : string.Empty)}");
Microsoft.Extensions.Resilience.Tests (1)
Microsoft.Extensions.SecretManager.Tools.Tests (11)
Microsoft.Extensions.Telemetry (7)
Microsoft.Extensions.Telemetry.Abstractions (3)
Microsoft.Extensions.Telemetry.Abstractions.Tests (15)
Logging\LoggerMessageStateTests.cs (15)
26Assert.Equal(PropName, lms.TagArray[0].Key);
38Assert.Equal(PropName, lms.TagArray[0].Key);
45Assert.Equal(PropName, lms.TagArray[0].Key);
59Assert.Equal(PropName, lms.TagArray[0].Key);
61Assert.Equal(PropName + "X", lms.TagArray[1].Key);
79Assert.Equal("K1", lms.TagArray[0].Key);
97Assert.Equal(PropertyNamPrefix + "." + PropName, lms.TagArray[0].Key);
102Assert.Equal(PropertyNamPrefix + "." + PropName, lms.TagArray[0].Key);
115Assert.Equal(PropName, lms.TagArray[0].Key);
120Assert.Equal(PropName, lms.TagArray[0].Key);
142Assert.Equal(PropName, list[0].Key);
152Assert.Equal(PropName, list[0].Key);
158Assert.Equal(PropName, list[0].Key);
168Assert.Equal(current.Key, list[count].Key);
Microsoft.Extensions.Telemetry.Tests (7)
Microsoft.Gen.ComplianceReports (1)
Microsoft.Gen.ContextualOptions (2)
Microsoft.Gen.ContextualOptions.Unit.Tests (3)
Microsoft.Gen.Logging (5)
Microsoft.Gen.Logging.Generated.Tests (14)
Microsoft.Gen.MetadataExtractor (7)
Microsoft.Gen.Metrics (6)
Microsoft.Gen.Metrics.Generated.Tests (30)
MetricTests.cs (22)
71Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value)));
154Assert.Equal(new (string, object?)[] { ("s1", "val_1"), ("s2", "val_2") }, measurement.Tags.Select(x => (x.Key, x.Value)));
174var tags = measurements[0].Tags.Select(x => (x.Key, x.Value));
177tags = measurements[1].Tags.Select(x => (x.Key, x.Value));
198var tags = measurements[0].Tags.Select(x => (x.Key, x.Value));
201tags = measurements[1].Tags.Select(x => (x.Key, x.Value));
253Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value)));
259Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value)));
266Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val4") }, measurement.Tags.Select(x => (x.Key, x.Value)));
278Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value)));
284Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value)));
291Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val4") }, measurement.Tags.Select(x => (x.Key, x.Value)));
329Assert.Equal(new (string, object?)[] { ("Dim1", "val1"), ("Dim_2", "val2"), ("Dim_3", "val3") }, measurement.Tags.Select(x => (x.Key, x.Value)));
342Assert.Equal(new (string, object?)[] { ("Dim1", "val1"), ("Dim_2", "val2"), ("Dim_3", "val3") }, measurement.Tags.Select(x => (x.Key, x.Value)));
372measurement.Tags.Select(x => (x.Key, x.Value)));
421measurement.Tags.Select(x => (x.Key, x.Value)));
444measurement.Tags.Select(x => (x.Key, x.Value)));
467measurement.Tags.Select(x => (x.Key, x.Value)));
515measurement.Tags.Select(x => (x.Key, x.Value)));
564measurement.Tags.Select(x => (x.Key, x.Value)));
587measurement.Tags.Select(x => (x.Key, x.Value)));
609measurement.Tags.Select(x => (x.Key, x.Value)));
MetricTests.Ext.cs (8)
55Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.Tags.Select(x => (x.Key, x.Value)));
135Assert.Equal(new (string, object?)[] { ("s1", "val_1"), ("s2", "val_2") }, measurement.Tags.Select(x => (x.Key, x.Value)));
184measurement.Tags.Select(x => (x.Key, x.Value)));
206measurement.Tags.Select(x => (x.Key, x.Value)));
228measurement.Tags.Select(x => (x.Key, x.Value)));
277measurement.Tags.Select(x => (x.Key, x.Value)));
299measurement.Tags.Select(x => (x.Key, x.Value)));
321measurement.Tags.Select(x => (x.Key, x.Value)));
Microsoft.Gen.MetricsReports (2)
Microsoft.Interop.ComInterfaceGenerator (3)
Microsoft.Interop.LibraryImportGenerator (4)
Microsoft.Interop.SourceGeneration (8)
Microsoft.Maui (2)
Microsoft.Maui.Controls (70)
Microsoft.Maui.Controls.Build.Tasks (11)
Microsoft.Maui.Controls.SourceGen (2)
Microsoft.Maui.Controls.Xaml (10)
Microsoft.Maui.Essentials (2)
Microsoft.Maui.Graphics (3)
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (1)
Microsoft.Maui.Resizetizer (5)
Microsoft.ML.AutoML (21)
Microsoft.ML.AutoML.Tests (3)
Microsoft.ML.CodeGenerator (7)
Microsoft.ML.Core (20)
Microsoft.ML.Core.Tests (17)
Microsoft.ML.CpuMath.UnitTests (1)
Microsoft.ML.Data (114)
EntryPoints\InputBuilder.cs (5)
505if (!inputBuilder.TrySetValueJson(pair.Key, pair.Value))
506throw ectx.Except($"Unexpected value for component '{type}', field '{pair.Key}': '{pair.Value}'");
566if (!inputBuilder.TrySetValueJson(pair.Key, pair.Value))
567throw ectx.Except($"Unexpected value for component '{name}', field '{pair.Key}': '{pair.Value}'");
595dict[pair.Key] = (T)GetFieldAssignableValue(ectx, typeof(T), ParseJsonValue(ectx, typeof(T), attributes, pair.Value, catalog));
Microsoft.ML.Ensemble (8)
Microsoft.ML.EntryPoints (5)
Microsoft.ML.Fairlearn (1)
Microsoft.ML.FastTree (40)
FastTree.cs (30)
1684rowHasMissing.Set(kv.Key, true);
1968int irow = kvEnums[i].Current.Key;
1969int jrow = kvEnums[j].Current.Key;
1995ch.Assert(kvp.Key >= last);
1997while (kvp.Key - last > Byte.MaxValue)
2003ch.Assert(kvp.Key - last <= Byte.MaxValue);
2006delta.Add((byte)(kvp.Key - last));
2008ch.Assert(kvp.Key > last || values.Count == 1 || values[values.Count - 1] > values[values.Count - 2]);
2009last = kvp.Key;
2440Contracts.Assert(_sparse.Count == 0 || _sparse[_sparse.Count - 1].Key < length);
2464Contracts.Assert(_sparse.Count == 0 || _sparse[_sparse.Count - 1].Key < lim);
2471Contracts.Assert(prev < kvp.Key);
2472while (++prev < kvp.Key)
2475yield return kvp.Key;
2487yield return kvp.Key;
2537editor.Indices[i] = _sparse[i].Key;
2576Contracts.Assert(kvp.Key < length);
2579yield return new KeyValuePair<int, int>(kvp.Key, binned);
2588Contracts.Assert(kvp.Key < length);
2589while (++last < kvp.Key)
2593yield return new KeyValuePair<int, int>(kvp.Key, binned);
2661Contracts.Assert(sp.Count == 0 || sp[last].Key > lastRow);
2666if (s.Key < rowIndex)
2668if (s.Key > rowIndex)
2675Contracts.Assert(s.Key == rowIndex);
3142writer.WriteLine("\t{0}\t{1}", pair.Key, (double)pair.Value);
3157var name = names.GetItemOrDefault(pair.Key).ToString();
3159name = $"f{pair.Key}";
3171results.Add(new KeyValuePair<string, object>(pair.Key, pair.Value));
3251bldr.AddFeature(pair.Key, (float)(Math.Sqrt(pair.Value) * normFactor));
Microsoft.ML.GenAI.Core (6)
Microsoft.ML.GenAI.Phi.Tests (1)
Microsoft.ML.InternalCodeAnalyzer (1)
Microsoft.ML.KMeansClustering (1)
Microsoft.ML.LightGbm (2)
Microsoft.ML.OnnxConverter (1)
Microsoft.ML.OnnxTransformer (5)
Microsoft.ML.OnnxTransformerTest (2)
Microsoft.ML.Predictor.Tests (6)
Microsoft.ML.ResultProcessor (19)
ResultProcessor.cs (19)
100SettingHeaderNames.Add(setting.Key.StartsWith("/") ? setting.Key : "/" + setting.Key);
118ResultHeaderNames.Add(resultEntity.Key);
173.GroupBy(kvp => kvp.Key, kvp => kvp.Value)
296settings.Add(entity.Key + ":" + entity.Value);
537GroupBy(kvp => kvp.Key, kvp => kvp.Value).ToDictionary(g => "/" + g.Key, g => string.Join(",", g));
910if (thisFoldResults.Key < 0 || thisFoldResults.Value == null)
914if (foldResults.ContainsKey(thisFoldResults.Key))
916Console.Error.WriteLine("Fold {0} results have already been added, not adding.", thisFoldResults.Key);
918foldResults[thisFoldResults.Key] = thisFoldResults.Value;
932int foldIdx = kvp.Key;
936if (!metricToFoldValuesDict.TryGetValue(kvp1.Key, out metricDict))
939metricToFoldValuesDict[kvp1.Key] = metricDict;
947perFoldMetrics[metricValues.Key] = new ResultMetric(float.NaN)
950orderby kvp.Key ascending
1078srcFiles.Add(new KeyValuePair<string, string>(taggedPattern.Key, src));
1093resultValue.CustomizedTag = fileWithTag.Key;
1157outStream.Write("\t" + kvp.Key + ":"
Microsoft.ML.Samples (5)
Microsoft.ML.SearchSpace (17)
Microsoft.ML.StandardTrainers (6)
Microsoft.ML.Sweeper (29)
Microsoft.ML.Sweeper.Tests (1)
Microsoft.ML.Tests (7)
Microsoft.ML.TimeSeries (18)
Microsoft.ML.TimeSeries.Tests (5)
Microsoft.ML.Tokenizers (31)
Microsoft.ML.Tokenizers.Tests (12)
Microsoft.ML.TorchSharp (4)
Microsoft.ML.Transforms (29)
Microsoft.NET.StringTools (5)
Microsoft.NET.StringTools.net35 (4)
Microsoft.VisualStudio.LanguageServices (11)
Microsoft.VisualStudio.LanguageServices.CSharp (2)
Microsoft.VisualStudio.LanguageServices.DevKit (1)
MSBuild (40)
OutOfProcTaskHostNode.cs (15)
1023string oldValue = variable.Value.Key;
1030environment.TryGetValue(variable.Key, out environmentValue);
1048LogMessageFromResource(MessageImportance.Low, "ModifyingTaskHostEnvironmentVariable", variable.Key, newValue, environmentValue ?? String.Empty);
1051updatedEnvironment[variable.Key] = newValue;
1055updatedEnvironment.Remove(variable.Key);
1091string newValue = variable.Value.Key;
1097environment.TryGetValue(variable.Key, out environmentValue);
1105updatedEnvironment[variable.Key] = newValue;
1109updatedEnvironment.Remove(variable.Key);
1146if (!environment.TryGetValue(variable.Key, out newValue))
1148s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(null, oldValue);
1154s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(newValue, oldValue);
1163if (!_savedEnvironment.TryGetValue(variable.Key, out oldValue))
1165s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(newValue, null);
1171s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(newValue, oldValue);
MSBuildTaskHost (49)
OutOfProcTaskHostNode.cs (15)
1023string oldValue = variable.Value.Key;
1030environment.TryGetValue(variable.Key, out environmentValue);
1048LogMessageFromResource(MessageImportance.Low, "ModifyingTaskHostEnvironmentVariable", variable.Key, newValue, environmentValue ?? String.Empty);
1051updatedEnvironment[variable.Key] = newValue;
1055updatedEnvironment.Remove(variable.Key);
1091string newValue = variable.Value.Key;
1097environment.TryGetValue(variable.Key, out environmentValue);
1105updatedEnvironment[variable.Key] = newValue;
1109updatedEnvironment.Remove(variable.Key);
1146if (!environment.TryGetValue(variable.Key, out newValue))
1148s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(null, oldValue);
1154s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(newValue, oldValue);
1163if (!_savedEnvironment.TryGetValue(variable.Key, out oldValue))
1165s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(newValue, null);
1171s_mismatchedEnvironmentValues[variable.Key] = new KeyValuePair<string, string>(newValue, oldValue);
Mvc.RoutingWebSite (6)
NativeIISSample (1)
PrepareTests (2)
PresentationBuildTasks (1)
PresentationCore (19)
PresentationFramework (48)
ProjectCachePlugin (1)
ReachFramework (2)
Roslyn.Compilers.Extension (4)
Roslyn.Test.PdbUtilities (1)
Roslyn.VisualStudio.Next.UnitTests (5)
RunTests (4)
ScenarioTests.Common.Tests (1)
Shared (4)
Shared.Tests (1)
SocialSample (1)
Stress.TelemetryService (1)
System.Collections (36)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\DebugViewDictionaryItem.cs (1)
22Key = keyValue.Key;
System\Collections\Generic\OrderedDictionary.cs (22)
303SetAt(index, tpair.Key, tpair.Value);
353set => SetAt(index, value.Key, value.Value);
521Add(pair.Key, pair.Value);
528Add(pair.Key, pair.Value);
1169ThrowIfNull(item.Key, nameof(item));
1171int index = IndexOf(item.Key);
1185void IList<KeyValuePair<TKey, TValue>>.Insert(int index, KeyValuePair<TKey, TValue> item) => Insert(index, item.Key, item.Value);
1188void ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue> item) => Add(item.Key, item.Value);
1193ThrowIfNull(item.Key, nameof(item));
1196TryGetValue(item.Key, out TValue? value) &&
1219TryGetValue(item.Key, out TValue? value) &&
1221Remove(item.Key);
1330Add(pair.Key, pair.Value);
1337TryGetValue(pair.Key, out TValue? v) &&
1359Insert(index, pair.Key, pair.Value);
1410new DictionaryEntry(Current.Key, Current.Value) :
1414readonly DictionaryEntry IDictionaryEnumerator.Entry => new(Current.Key, Current.Value);
1417readonly object IDictionaryEnumerator.Key => Current.Key;
1568get => _dictionary.GetAt(index).Key;
1575get => _dictionary.GetAt(index).Key;
1580TKey IReadOnlyList<TKey>.this[int index] => _dictionary.GetAt(index).Key;
1640public TKey Current => _enumerator.Current.Key;
System.Collections.Concurrent (10)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\DebugViewDictionaryItem.cs (1)
22Key = keyValue.Key;
System\Collections\Concurrent\ConcurrentDictionary.cs (9)
338if (pair.Key is null)
343if (!TryAddInternal(_tables, pair.Key, null, pair.Value, updateIfExists: false, acquireLock: false, out _))
419/// The <see cref="KeyValuePair{TKey, TValue}.Key"/> property of <paramref name="item"/> is a null reference.
423if (item.Key is null)
428return TryRemoveInternal(item.Key, out _, matchValue: true, item.Value);
1627void ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue> keyValuePair) => ((IDictionary<TKey, TValue>)this).Add(keyValuePair.Key, keyValuePair.Value);
1639TryGetValue(keyValuePair.Key, out TValue? value) &&
2326public DictionaryEntry Entry => new DictionaryEntry(_enumerator.Current.Key, _enumerator.Current.Value);
2328public object Key => _enumerator.Current.Key;
System.Collections.Immutable (54)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\DebugViewDictionaryItem.cs (1)
22Key = keyValue.Key;
System\Collections\Immutable\ImmutableDictionary_2.cs (8)
174yield return item.Key;
757array.SetValue(new DictionaryEntry(item.Key, item.Value), arrayIndex++);
883int hashCode = origin.KeyComparer.GetHashCode(keyValuePair.Key);
888return bucket.TryGetValue(keyValuePair.Key, origin.Comparers, out value!)
958Requires.NotNullAllowStructs(pair.Key, nameof(pair.Key));
959int hashCode = origin.KeyComparer.GetHashCode(pair.Key);
962ImmutableDictionary<TKey, TValue>.HashBucket newBucket = bucket.Add(pair.Key, pair.Value, origin.KeyOnlyComparer, origin.ValueComparer, collisionBehavior, out result);
System\Collections\Immutable\ImmutableSortedDictionary_2.cs (6)
795? result.SetItem(item.Key, item.Value, _keyComparer, _valueComparer, out replacedExistingValue, out mutated)
796: result.Add(item.Key, item.Value, _keyComparer, _valueComparer, out mutated);
856dictionary[item.Key] = item.Value;
861if (dictionary.TryGetValue(item.Key, out value!))
865throw new ArgumentException(SR.Format(SR.DuplicateKey, item.Key));
870dictionary.Add(item.Key, item.Value);
System\Collections\Immutable\ImmutableSortedDictionary_2.Node.cs (6)
136get { return Linq.Enumerable.Select(this, p => p.Key); }
222array.SetValue(new DictionaryEntry(item.Key, item.Value), arrayIndex++);
415Requires.NotNullAllowStructs(pair.Key, nameof(pair.Key));
419ImmutableSortedDictionary<TKey, TValue>.Node matchingNode = this.Search(pair.Key, keyComparer);
605return new Node(item.Key, item.Value, left, right, true);
System.Collections.NonGeneric (1)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\DebugViewDictionaryItem.cs (1)
22Key = keyValue.Key;
System.ComponentModel.Annotations (5)
System.ComponentModel.Composition (9)
System.ComponentModel.TypeConverter (3)
System.Composition.Hosting (1)
System.Composition.Runtime (3)
System.Composition.TypedParts (7)
System.Configuration.ConfigurationManager (1)
System.Console (4)
System.Data.Common (7)
System.Data.Odbc (4)
System.Diagnostics.DiagnosticSource (52)
System.Diagnostics.Process (6)
System.Formats.Nrbf (1)
System.Formats.Tar (7)
System.IO.Packaging (5)
System.Linq.AsyncEnumerable (1)
System.Linq.Expressions (17)
System.Linq.Parallel (3)
System.Net.Http (12)
System.Net.NameResolution (7)
System\Net\Dns.cs (5)
367KeyValuePair<IPAddress, AddressFamily> t => t.Key,
581KeyValuePair<string, AddressFamily> t => GetHostAddressesCore(t.Key, t.Value, activity),
583KeyValuePair<IPAddress, AddressFamily> t => GetHostAddressesCore(t.Key, t.Value, activity),
592KeyValuePair<string, AddressFamily> t => GetHostEntryCore(t.Key, t.Value, activity),
594KeyValuePair<IPAddress, AddressFamily> t => GetHostEntryCore(t.Key, t.Value, activity),
System.Net.NetworkInformation (2)
System.Net.Requests (2)
System.Net.Security (4)
System.Net.WebSockets.Client (3)
System.Private.CoreLib (67)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\DebugViewDictionaryItem.cs (1)
22Key = keyValue.Key;
src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (37)
155return ReferenceEquals(key, _item0.Key) ?
163return ReferenceEquals(key, _item0.Key) ?
171if (ReferenceEquals(key, _item0.Key))
206ReferenceEquals(key, _item0.Key) ? new TwoElementAsyncLocalValueMap(newItem, _item1) :
207ReferenceEquals(key, _item1.Key) ? new TwoElementAsyncLocalValueMap(_item0, newItem) :
215ReferenceEquals(key, _item0.Key) ? new OneElementAsyncLocalValueMap(_item1) :
216ReferenceEquals(key, _item1.Key) ? new OneElementAsyncLocalValueMap(_item0) :
223if (ReferenceEquals(key, _item0.Key))
228else if (ReferenceEquals(key, _item1.Key))
266ReferenceEquals(key, _item0.Key) ? new ThreeElementAsyncLocalValueMap(newItem, _item1, _item2) :
267ReferenceEquals(key, _item1.Key) ? new ThreeElementAsyncLocalValueMap(_item0, newItem, _item2) :
268ReferenceEquals(key, _item2.Key) ? new ThreeElementAsyncLocalValueMap(_item0, _item1, newItem) :
276ReferenceEquals(key, _item0.Key) ? new TwoElementAsyncLocalValueMap(_item1, _item2) :
277ReferenceEquals(key, _item1.Key) ? new TwoElementAsyncLocalValueMap(_item0, _item2) :
278ReferenceEquals(key, _item2.Key) ? new TwoElementAsyncLocalValueMap(_item0, _item1) :
285if (ReferenceEquals(key, _item0.Key))
290else if (ReferenceEquals(key, _item1.Key))
295else if (ReferenceEquals(key, _item2.Key))
335ReferenceEquals(key, _item0.Key) ? new FourElementAsyncLocalValueMap(newItem, _item1, _item2, _item3) :
336ReferenceEquals(key, _item1.Key) ? new FourElementAsyncLocalValueMap(_item0, newItem, _item2, _item3) :
337ReferenceEquals(key, _item2.Key) ? new FourElementAsyncLocalValueMap(_item0, _item1, newItem, _item3) :
338ReferenceEquals(key, _item3.Key) ? new FourElementAsyncLocalValueMap(_item0, _item1, _item2, newItem) :
346ReferenceEquals(key, _item0.Key) ? new ThreeElementAsyncLocalValueMap(_item1, _item2, _item3) :
347ReferenceEquals(key, _item1.Key) ? new ThreeElementAsyncLocalValueMap(_item0, _item2, _item3) :
348ReferenceEquals(key, _item2.Key) ? new ThreeElementAsyncLocalValueMap(_item0, _item1, _item3) :
349ReferenceEquals(key, _item3.Key) ? new ThreeElementAsyncLocalValueMap(_item0, _item1, _item2) :
356if (ReferenceEquals(key, _item0.Key))
361else if (ReferenceEquals(key, _item1.Key))
366else if (ReferenceEquals(key, _item2.Key))
371else if (ReferenceEquals(key, _item3.Key))
401if (ReferenceEquals(key, _keyValues[i].Key))
458many[pair.Key] = pair.Value;
468if (ReferenceEquals(key, pair.Key))
496map[pair.Key] = pair.Value;
517if (!ReferenceEquals(key, pair.Key))
530if (!ReferenceEquals(key, pair.Key))
532map[pair.Key] = pair.Value;
System.Private.CoreLib.Generators (1)
System.Private.DataContractSerialization (6)
System.Private.Windows.Core (1)
System.Private.Xml (24)
System.Reflection.Emit (6)
System.Reflection.Metadata (13)
System.Resources.Extensions (4)
System.Resources.Writer (3)
System.Runtime.Serialization.Schema (4)
System.Security.Claims (1)
System.Security.Cryptography.Cose (4)
System.ServiceModel.NetFramingBase (1)
System.ServiceModel.Primitives.Tests (1)
System.Text.Json (22)
System.Text.Json.SourceGeneration (3)
System.Text.RegularExpressions (15)
System.Text.RegularExpressions.Generator (7)
System.Threading.Channels (1)
System.Threading.RateLimiting (1)
System.Threading.Tasks.Dataflow (58)
Blocks\BatchBlock.cs (18)
793if (sourceAndMessage.Key.ReserveMessage(sourceAndMessage.Value, _owningBatch))
796var reservedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, reservedMessage);
811if (sourceAndMessage.Key.ReserveMessage(sourceAndMessage.Value, _owningBatch))
814var reservedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, reservedMessage);
911var reservedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, reservedMessage);
927var reservedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, reservedMessage);
999T? consumedValue = sourceAndMessage.Key.ConsumeMessage(sourceAndMessage.Value.Key, _owningBatch, out consumed);
1009var consumedMessage = new KeyValuePair<DataflowMessageHeader, T>(sourceAndMessage.Value.Key, consumedValue!);
1010var consumedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, consumedMessage);
1051T? consumedValue = sourceAndMessage.Key.ConsumeMessage(sourceAndMessage.Value.Key, _owningBatch, out consumed);
1054var consumedMessage = new KeyValuePair<DataflowMessageHeader, T>(sourceAndMessage.Value.Key, consumedValue!);
1055var consumedSourceAndMessage = new KeyValuePair<ISourceBlock<T>, KeyValuePair<DataflowMessageHeader, T>>(sourceAndMessage.Key, consumedMessage);
1071if (sourceAndMessage.Key != null) _messages.Enqueue(sourceAndMessage.Value.Value);
1096ISourceBlock<T> source = sourceAndMessage.Key;
1098if (source != null && message.Key.IsValid)
1100try { source.ReleaseReservation(message.Key, _owningBatch); }
Blocks\JoinBlock.cs (12)
536Debug.Assert(_nonGreedy!.ConsumedMessage.Key, "A message must have been consumed by this point.");
566return _nonGreedy!.ConsumedMessage.Key;
632if (next.Key.ReserveMessage(next.Value, this))
654Debug.Assert(_nonGreedy!.ReservedMessage.Key != null, "This target must have a reserved message");
657T? consumedValue = _nonGreedy.ReservedMessage.Key.ConsumeMessage(_nonGreedy.ReservedMessage.Value, this, out consumed);
680Debug.Assert(!_nonGreedy.ConsumedMessage.Key, "There must be no other consumed message");
718T? consumedValue = next.Key.ConsumeMessage(next.Value, this, out consumed);
743_nonGreedy!.ConsumedMessage.Key ? 1 : 0;
768if (_nonGreedy != null && _nonGreedy.ReservedMessage.Key != null)
771try { _nonGreedy.ReservedMessage.Key.ReleaseReservation(_nonGreedy.ReservedMessage.Value, this); }
791Debug.Assert(_nonGreedy == null || _nonGreedy.ReservedMessage.Key == null,
953private int InputCountForDebugger { get { return _messages != null ? _messages.Count : _nonGreedy!.ConsumedMessage.Key ? 1 : 0; } }
System.Threading.Tasks.Parallel (1)
System.Windows.Forms (12)
System.Windows.Forms.Design (8)
System.Windows.Forms.Tests (3)
System.Xaml (37)
Templates.Blazor.Tests (1)
Templates.Blazor.WebAssembly.Auth.Tests (1)
Templates.Blazor.WebAssembly.Tests (1)
Templates.Mvc.Tests (1)
Templates.Tests (1)
UnitTests.Common (1)
VBCSCompiler.UnitTests (5)
VersioningWebSite (4)
WindowsBase.Tests (2)
WindowsFormsIntegration (2)
XmlFileLogger (6)
XmlFormattersWebSite (2)
xunit.assert (2)
xunit.console (6)
Xunit.NetCore.Extensions (1)