586 references to Contains
Aspire.Components.Common.Tests (2)
Aspire.Confluent.Kafka.Tests (60)
MetricsTests.cs (60)
80Assert.Contains(collectorProducerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
81Assert.Contains(collectorProducerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
84Assert.Contains(collectorConsumerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
85Assert.Contains(collectorConsumerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
88Assert.Contains(collectorProducerQueueSize.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
89Assert.Contains(collectorProducerQueueSize.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
92Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
93Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
94Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
97Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
98Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
99Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
102Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
103Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
104Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
107Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
108Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
109Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
112Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
113Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
114Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
117Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
118Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
119Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
122Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
123Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
124Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
127Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
128Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
129Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
197Assert.Contains(collectorProducerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
198Assert.Contains(collectorProducerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
201Assert.Contains(collectorConsumerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
202Assert.Contains(collectorConsumerQueueMessageCount.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
205Assert.Contains(collectorProducerQueueSize.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
206Assert.Contains(collectorProducerQueueSize.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
209Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
210Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
211Assert.Contains(collectorNetworkTx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
214Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
215Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
216Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
219Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
220Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
221Assert.Contains(collectorNetworkRx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
224Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
225Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
226Assert.Contains(collectorNetworkReceived.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
229Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
230Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
231Assert.Contains(collectorMessageTx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
234Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
235Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
236Assert.Contains(collectorMessageTransmitted.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
239Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
240Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
241Assert.Contains(collectorMessageRx.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
244Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
245Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
246Assert.Contains(collectorMessageReceived.LastMeasurement!.Tags, t => t.Key == "type" && t.Value!.ToString() == "producer");
Aspire.Dashboard.Tests (2)
Aspire.Elastic.Clients.Elasticsearch.Tests (2)
Aspire.Hosting.Azure.Tests (1)
Aspire.Hosting.Containers.Tests (1)
Aspire.Hosting.Kafka.Tests (2)
Aspire.Hosting.Milvus.Tests (2)
Aspire.Hosting.Qdrant.Tests (4)
Aspire.Hosting.Testing.Tests (4)
Aspire.Hosting.Tests (23)
Dcp\ApplicationExecutorTests.cs (14)
580Assert.Contains(watchLogsResults1, l => l.Content.Contains("First"));
581Assert.Contains(watchLogsResults1, l => l.Content.Contains("Second"));
582Assert.Contains(watchLogsResults1, l => l.Content.Contains("Third"));
583Assert.Contains(watchLogsResults1, l => l.Content.Contains("Forth"));
584Assert.Contains(watchLogsResults1, l => l.Content.Contains("Fifth"));
585Assert.Contains(watchLogsResults1, l => l.Content.Contains("Sixth"));
586Assert.Contains(watchLogsResults1, l => l.Content.Contains("Seventh"));
592Assert.Contains(watchLogsResults2, l => l.Content.Contains("First"));
593Assert.Contains(watchLogsResults2, l => l.Content.Contains("Second"));
594Assert.Contains(watchLogsResults2, l => l.Content.Contains("Third"));
595Assert.Contains(watchLogsResults2, l => l.Content.Contains("Forth"));
596Assert.Contains(watchLogsResults2, l => l.Content.Contains("Fifth"));
597Assert.Contains(watchLogsResults2, l => l.Content.Contains("Sixth"));
598Assert.Contains(watchLogsResults2, l => l.Content.Contains("Seventh"));
Aspire.Milvus.Client.Tests (1)
Aspire.MongoDB.Driver.Tests (2)
Aspire.NATS.Net.Tests (2)
Aspire.Oracle.EntityFrameworkCore.Tests (2)
Aspire.Qdrant.Client.Tests (1)
Aspire.StackExchange.Redis.DistributedCaching.Tests (3)
Aspire.StackExchange.Redis.OutputCaching.Tests (3)
Aspire.StackExchange.Redis.Tests (1)
Diagnostics.EFCore.FunctionalTests (2)
IIS.FunctionalTests (2)
IIS.LongTests (3)
IIS.NewHandler.FunctionalTests (3)
IIS.NewShim.FunctionalTests (3)
IISExpress.FunctionalTests (6)
InMemory.FunctionalTests (29)
Http2\Http2StreamTests.cs (7)
1350Assert.Contains(LogMessages, m => m.Exception?.Message.Contains("Response Content-Length mismatch: too many bytes written (12 of 11).") ?? false);
1926Assert.Contains(LogMessages, m => m.Message.Contains("the application completed without reading the entire request body."));
2013Assert.Contains(LogMessages, m => m.Message.Contains("the application completed without reading the entire request body."));
2076Assert.Contains(LogMessages, m => m.Message.Contains("the application completed without reading the entire request body."));
3111Assert.Contains(LogMessages, m => (m.Exception?.Message.Contains("App Faulted") ?? false) && m.LogLevel == LogLevel.Error);
4723Assert.Contains(TestSink.Writes, w => w.EventId.Id == 13 && w.LogLevel == LogLevel.Error
5878Assert.Contains(LogMessages, m => m.Message.Equals("One or more of the following response headers have been removed because they are invalid for HTTP/2 and HTTP/3 responses: 'Connection', 'Transfer-Encoding', 'Keep-Alive', 'Upgrade' and 'Proxy-Connection'."));
Interop.FunctionalTests (1)
Microsoft.AspNetCore.App.Analyzers.Test (4)
Microsoft.AspNetCore.Authentication.Negotiate.Test (1)
Microsoft.AspNetCore.Authentication.Test (2)
Microsoft.AspNetCore.Authorization.Test (12)
AuthorizationPolicyFacts.cs (11)
41Assert.Contains(combined.Requirements, r => r is DenyAnonymousAuthorizationRequirement);
109Assert.Contains(combined.Requirements, r => r is RolesAuthorizationRequirement);
112Assert.Contains(rolesAuthorizationRequirement.AllowedRoles, r => r.Equals("r1"));
113Assert.Contains(rolesAuthorizationRequirement.AllowedRoles, r => r.Equals("r2"));
132Assert.Contains(combined.AuthenticationSchemes, a => a.Equals("a1"));
133Assert.Contains(combined.AuthenticationSchemes, a => a.Equals("a2"));
152Assert.Contains(combined.AuthenticationSchemes, a => a.Equals("a1"));
153Assert.Contains(combined.AuthenticationSchemes, a => a.Equals("a2"));
170Assert.Contains(combined.Requirements, r => r is RolesAuthorizationRequirement);
173Assert.Contains(rolesAuthorizationRequirement.AllowedRoles, r => r.Equals("r1"));
174Assert.Contains(rolesAuthorizationRequirement.AllowedRoles, r => r.Equals("r2"));
Microsoft.AspNetCore.Components.Endpoints.Tests (7)
Microsoft.AspNetCore.Components.Tests (1)
Microsoft.AspNetCore.Cors.Test (2)
Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests (4)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (2)
Microsoft.AspNetCore.Hosting.Tests (15)
HostingApplicationDiagnosticsTests.cs (11)
746Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1");
747Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value2");
775Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1");
776Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value2");
805Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1");
806Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value2");
836Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value3");
837Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value4");
903Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1/1");
938Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key1" && pair.Value == "value1");
939Assert.Contains(Activity.Current.Baggage, pair => pair.Key == "Key2" && pair.Value == "value2");
Microsoft.AspNetCore.Http.Extensions.Tests (52)
RequestDelegateFactoryTests.cs (26)
2599Assert.Contains(result.EndpointMetadata, m => m is ParameterNameMetadata { Name: "param1" });
2600Assert.Contains(result.EndpointMetadata, m => m is ParameterNameMetadata { Name: "param2" });
2613Assert.Contains(result.EndpointMetadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Parameter });
2626Assert.Contains(result.EndpointMetadata, m => m is CustomEndpointMetadata { Source: MetadataSource.ReturnType });
2639Assert.Contains(result.EndpointMetadata, m => m is CustomEndpointMetadata { Source: MetadataSource.ReturnType });
2652Assert.Contains(result.EndpointMetadata, m => m is CustomEndpointMetadata { Source: MetadataSource.ReturnType });
2665Assert.Contains(result.EndpointMetadata, m => m is CustomEndpointMetadata { Source: MetadataSource.ReturnType });
2685Assert.Contains(result.EndpointMetadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
2687Assert.Contains(result.EndpointMetadata, m => m is MetadataCountMetadata { Count: 1 });
2707Assert.Contains(result.EndpointMetadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
2708Assert.Contains(result.EndpointMetadata, m => m is ProducesResponseTypeMetadata { Type: { } type } && type == typeof(CountsDefaultEndpointMetadataResult));
2710Assert.Contains(result.EndpointMetadata, m => m is MetadataCountMetadata { Count: 2 });
2730Assert.Contains(result.EndpointMetadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
2731Assert.Contains(result.EndpointMetadata, m => m is ProducesResponseTypeMetadata { Type: { } type } && type == typeof(CountsDefaultEndpointMetadataResult));
2733Assert.Contains(result.EndpointMetadata, m => m is MetadataCountMetadata { Count: 2 });
2753Assert.Contains(result.EndpointMetadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
2754Assert.Contains(result.EndpointMetadata, m => m is IProducesResponseTypeMetadata { Type: { } type } && type == typeof(CountsDefaultEndpointMetadataResult));
2756Assert.Contains(result.EndpointMetadata, m => m is MetadataCountMetadata { Count: 2 });
2776Assert.Contains(result.EndpointMetadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
2777Assert.Contains(result.EndpointMetadata, m => m is ParameterNameMetadata { Name: "param1" });
2797Assert.Contains(result.EndpointMetadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
2798Assert.Contains(result.EndpointMetadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Parameter });
2852Assert.Contains(result.EndpointMetadata, m => m is RoutePatternMetadata { RoutePattern: "/test/pattern" });
2887Assert.Contains(result.EndpointMetadata, m => m is IParameterBindingMetadata { Name: "param1" });
3025Assert.Contains(result.EndpointMetadata, m => m is MetadataService);
3040Assert.Contains(result.EndpointMetadata, m => m is MetadataService);
RequestDelegateGenerator\RequestDelegateCreationTests.Metadata.cs (25)
211Assert.Contains(endpoint.Metadata, m => m is ParameterNameMetadata { Name: "param1" });
212Assert.Contains(endpoint.Metadata, m => m is ParameterNameMetadata { Name: "param2" });
227Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Parameter });
242Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.ReturnType });
257Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.ReturnType });
272Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.ReturnType });
368Assert.Contains(endpoint.Metadata, m => m is MetadataService);
388Assert.Contains(endpoint.Metadata, m => m is MetadataService);
402Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
404Assert.Contains(endpoint.Metadata, m => m is MetadataCountMetadata { Count: > 1 });
419Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
421Assert.Contains(endpoint.Metadata, m => m is MetadataCountMetadata { Count: > 1 });
436Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
438Assert.Contains(endpoint.Metadata, m => m is MetadataCountMetadata { Count: > 1 });
453Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
454Assert.Contains(endpoint.Metadata, m => m is ParameterNameMetadata { Name: "param1" });
469Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
470Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Parameter });
485Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Caller });
486Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Parameter });
501Assert.Contains(endpoint.Metadata, m => m is RoutePatternMetadata { RoutePattern: "/test/pattern" });
560Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Parameter });
561Assert.Contains(endpoint.Metadata, m => m is ParameterNameMetadata { Name: "param1" });
562Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Property });
563Assert.Contains(endpoint.Metadata, m => m is ParameterNameMetadata { Name: nameof(AddsCustomParameterMetadata.Data) });
Microsoft.AspNetCore.Http.Results.Tests (20)
ResultsOfTTests.Generated.cs (20)
215Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult1) });
216Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult2) });
494Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult1) });
495Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult2) });
496Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult3) });
850Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult1) });
851Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult2) });
852Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult3) });
853Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult4) });
1291Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult1) });
1292Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult2) });
1293Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult3) });
1294Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult4) });
1295Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult5) });
1825Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult1) });
1826Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult2) });
1827Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult3) });
1828Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult4) });
1829Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult5) });
1830Assert.Contains(builder.Metadata, m => m is ResultTypeProvidedMetadata { SourceTypeName: nameof(ProvidesMetadataResult6) });
Microsoft.AspNetCore.HttpLogging.Tests (140)
HttpLoggingMiddlewareTests.cs (140)
135Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0"));
136Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET"));
137Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http"));
138Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: /foo"));
139Assert.Contains(TestSink.Writes, w => w.Message.Contains("PathBase: /foo"));
140Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive"));
167Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0"));
168Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET"));
169Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http"));
170Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: /foo"));
171Assert.Contains(TestSink.Writes, w => w.Message.Contains("PathBase: /foo"));
172Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive"));
173Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: test"));
199Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0"));
200Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET"));
201Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http"));
202Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: /foo"));
203Assert.Contains(TestSink.Writes, w => w.Message.Contains("PathBase: /foo"));
237Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive"));
263Assert.Contains(TestSink.Writes, w => w.Message.Contains("foo: [Redacted]"));
283Assert.Contains(TestSink.Writes, w => w.Message.Contains("foo: bar"));
285Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: [Redacted]"));
303Assert.Contains(TestSink.Writes, w => w.Message.Contains("RequestBody: [Not consumed by app]"));
334Assert.Contains(TestSink.Writes, w => w.Message.Contains(expected));
362Assert.Contains(TestSink.Writes, w => w.Message.Contains(expected));
390Assert.Contains(TestSink.Writes, w => w.Message.Contains(expected));
427Assert.Contains(TestSink.Writes, w => w.Message.Equals("RequestBody: " + expected));
463Assert.Contains(TestSink.Writes, w => w.Message.Equals("RequestBody: " + expected));
488Assert.Contains(TestSink.Writes, w => w.Message.Equals("RequestBody: " + expected));
514Assert.Contains(TestSink.Writes, w => w.Message.Equals("RequestBody: " + expected));
552Assert.Contains(TestSink.Writes, w => w.Message.Contains(expected));
593Assert.Contains(TestSink.Writes, w => w.Message.Contains("Unrecognized Content-Type for request body."));
631Assert.Contains(TestSink.Writes, w => w.Message.Contains(expected));
669Assert.Contains(TestSink.Writes, w => w.Message.Contains("RequestBody:"));
670Assert.Contains(TestSink.Writes, w => w.Message.Contains(expected));
744Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0"));
745Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET"));
746Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http"));
747Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: /foo"));
748Assert.Contains(TestSink.Writes, w => w.Message.Contains("PathBase: /foo"));
749Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive"));
750Assert.Contains(TestSink.Writes, w => w.Message.Contains("RequestBody: test"));
751Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 418"));
752Assert.Contains(TestSink.Writes, w => w.Message.Contains("Content-Type: text/plain"));
753Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: Hello World"));
771Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0"));
772Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET"));
773Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http"));
774Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: /foo"));
775Assert.Contains(TestSink.Writes, w => w.Message.Contains("PathBase: /foo"));
776Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive"));
777Assert.Contains(TestSink.Writes, w => w.Message.Contains("RequestBody: test"));
778Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 418"));
779Assert.Contains(TestSink.Writes, w => w.Message.Contains("Content-Type: text/plain"));
780Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: Hello World"));
781Assert.Contains(TestSink.Writes, w => w.Message.Contains("foo: bar"));
800Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0"));
801Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET"));
802Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http"));
805Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive"));
806Assert.Contains(TestSink.Writes, w => w.Message.Contains("RequestBody: test"));
807Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 418"));
808Assert.Contains(TestSink.Writes, w => w.Message.Contains("Content-Type: text/plain"));
809Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: Hello World"));
810Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: ReplacedPath"));
828Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 200"));
829Assert.Contains(TestSink.Writes, w => w.Message.Contains("Transfer-Encoding: test"));
852Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 200"));
853Assert.Contains(TestSink.Writes, w => w.Message.Contains("Transfer-Encoding: test"));
854Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: test"));
876Assert.Contains(TestSink.Writes, w => w.Message.StartsWith("Duration: ", StringComparison.Ordinal));
899Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 200"));
900Assert.Contains(TestSink.Writes, w => w.Message.Contains("Transfer-Encoding: test"));
924Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 200"));
925Assert.Contains(TestSink.Writes, w => w.Message.Contains("Transfer-Encoding: test"));
926Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: test"));
948Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 200"));
973Assert.Contains(TestSink.Writes, w => w.Message.Contains("Transfer-Encoding: test"));
994Assert.Contains(TestSink.Writes, w => w.Message.Contains("Test: [Redacted]"));
1017Assert.Contains(TestSink.Writes, w => w.Message.Contains("Test: Kestrel"));
1018Assert.Contains(TestSink.Writes, w => w.Message.Contains("Server: [Redacted]"));
1039Assert.Contains(TestSink.Writes, w => w.Message.Contains(expected));
1081Assert.Contains(TestSink.Writes, w => w.Message.Contains(expected));
1111Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 200"));
1112Assert.Contains(TestSink.Writes, w => w.Message.Contains("Transfer-Encoding: test"));
1119Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: test"));
1149Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 200"));
1150Assert.Contains(TestSink.Writes, w => w.Message.Contains("Transfer-Encoding: test"));
1176Assert.Contains(TestSink.Writes, w => w.Message.Contains("Unrecognized Content-Type for response body."));
1191Assert.Contains(TestSink.Writes, w => w.Message.Contains("No Content-Type header for request body."));
1230Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 101"));
1334Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: Upgrade"));
1411Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 200"));
1412Assert.Contains(TestSink.Writes, w => w.Message.Contains("Transfer-Encoding: test"));
1413Assert.Contains(TestSink.Writes, w => w.Message.Contains("Content-Type: text/plain"));
1624Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0"));
1625Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET"));
1626Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http"));
1627Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: /foo"));
1628Assert.Contains(TestSink.Writes, w => w.Message.Contains("PathBase: /foo"));
1629Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive"));
1630Assert.Contains(TestSink.Writes, w => w.Message.Contains("RequestBody: test"));
1660Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 418"));
1661Assert.Contains(TestSink.Writes, w => w.Message.Contains("Content-Type: text/plain"));
1662Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: Hello World"));
1680Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0"));
1681Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET"));
1682Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http"));
1683Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: /foo"));
1684Assert.Contains(TestSink.Writes, w => w.Message.Contains("PathBase: /foo"));
1685Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive"));
1686Assert.Contains(TestSink.Writes, w => w.Message.Contains("RequestBody: test"));
1687Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 418"));
1688Assert.Contains(TestSink.Writes, w => w.Message.Contains("Content-Type: text/plain"));
1689Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: Hello World"));
1690Assert.Contains(TestSink.Writes, w => w.Message.Contains("foo: bar"));
1709Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0"));
1710Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET"));
1711Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http"));
1712Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: /foo"));
1713Assert.Contains(TestSink.Writes, w => w.Message.Contains("PathBase: /foo"));
1714Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive"));
1715Assert.Contains(TestSink.Writes, w => w.Message.Contains("RequestBody: test"));
1718Assert.Contains(TestSink.Writes, w => w.Message.Contains("Content-Type: text/plain"));
1719Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: Hello World"));
1720Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 412"));
1735Assert.Contains(filteredLogs, w => w.Message.Contains("StatusCode: 200"));
1749Assert.Contains(filteredLogs, w => w.Message.Contains("Request"));
1750Assert.Contains(filteredLogs, w => w.Message.Contains("StatusCode: 200"));
1781Assert.Contains(filteredLogs, w => w.Message.Equals("RequestBody: fro[Truncated by RequestBodyLogLimit]"));
1782Assert.Contains(filteredLogs, w => w.Message.Equals("ResponseBody: testin"));
1807Assert.Contains(filteredLogs, w => w.Message.Contains("Request"));
1809Assert.Contains(filteredLogs, w => w.Message.Contains("StatusCode: 200"));
1825Assert.Contains(filteredLogs, w => w.Message.Contains("StatusCode: 200"));
1839Assert.Contains(filteredLogs, w => w.Message.Contains("Request"));
1840Assert.Contains(filteredLogs, w => w.Message.Contains("StatusCode: 200"));
1871Assert.Contains(filteredLogs, w => w.Message.Equals("RequestBody: fro[Truncated by RequestBodyLogLimit]"));
1872Assert.Contains(filteredLogs, w => w.Message.Equals("ResponseBody: testin"));
1897Assert.Contains(filteredLogs, w => w.Message.Contains("Request"));
1899Assert.Contains(filteredLogs, w => w.Message.Contains("StatusCode: 200"));
Microsoft.AspNetCore.HttpsPolicy.Tests (1)
Microsoft.AspNetCore.Identity.Specification.Tests (1)
Microsoft.AspNetCore.Identity.Test (3)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (2)
Microsoft.AspNetCore.Mvc.Core.Test (20)
ApplicationModels\EndpointMetadataProviderTest.cs (11)
38Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.ReturnType });
49endpoint => Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.ReturnType }),
50endpoint => Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.ReturnType }));
60Assert.Contains(endpoint.Metadata, m => m is ParameterNameMetadata { Name: "param1" });
71endpoint => Assert.Contains(endpoint.Metadata, m => m is ParameterNameMetadata { Name: "param1" }),
72endpoint => Assert.Contains(endpoint.Metadata, m => m is ParameterNameMetadata { Name: "param1" }));
82Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Parameter });
93endpoint => Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Parameter }),
94endpoint => Assert.Contains(endpoint.Metadata, m => m is CustomEndpointMetadata { Source: MetadataSource.Parameter }));
211endpoint => Assert.Contains(endpoint.Metadata, m => m is RoutePatternMetadata { RoutePattern: "selector1" }),
212endpoint => Assert.Contains(endpoint.Metadata, m => m is RoutePatternMetadata { RoutePattern: "selector2" }));
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (6)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (4)
Microsoft.AspNetCore.Mvc.FunctionalTests (5)
Microsoft.AspNetCore.Mvc.RazorPages.Test (2)
Microsoft.AspNetCore.Mvc.Test (6)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (8)
Microsoft.AspNetCore.Shared.Tests (6)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (16)
HubConnectionTests.cs (16)
1793Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/2 POST"));
1794Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/2 CONNECT"));
1795Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request finished HTTP/2 CONNECT"));
1852Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/1.1 POST"));
1853Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/1.1 GET"));
1854Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request finished HTTP/1.1 GET"));
1962Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/2 POST"));
1963Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/2 CONNECT"));
1964Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request finished HTTP/2 CONNECT"));
2404Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/2 POST") && context.Message.Contains("/negotiate?"));
2407Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/2 POST") && context.Message.Contains("?id="));
2408Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request finished HTTP/2 GET") && context.Message.Contains("?id="));
2411Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request finished HTTP/2 DELETE") && context.Message.Contains("?id="));
2500Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/2 POST") && context.Message.Contains("/negotiate?"));
2503Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/2 POST") && context.Message.Contains("?id="));
2504Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request finished HTTP/2 GET") && context.Message.Contains("?id="));
Microsoft.AspNetCore.SignalR.Tests (9)
Microsoft.AspNetCore.StaticFiles.Tests (1)
Microsoft.AspNetCore.TestHost.Tests (1)
Microsoft.AspNetCore.Tests (11)
WebApplicationTests.cs (10)
705Assert.Contains(config.Sources, source => source is JsonConfigurationSource jsonSource && jsonSource.Path == "appsettings.json");
709Assert.Contains(config.Sources, source => source is JsonConfigurationSource jsonSource && jsonSource.Path == "appsettings.Development.json");
763Assert.Contains(config.Sources, source => source is JsonConfigurationSource jsonSource && jsonSource.Path == "secrets.json");
1635Assert.Contains(events, args =>
2421Assert.Contains(builder.Services, service => service.ServiceType == typeof(HostBuilderContext));
2422Assert.Contains(builder.Services, service => service.ServiceType == typeof(IHostApplicationLifetime));
2423Assert.Contains(builder.Services, service => service.ServiceType == typeof(IHostLifetime));
2424Assert.Contains(builder.Services, service => service.ServiceType == typeof(IOptions<>));
2425Assert.Contains(builder.Services, service => service.ServiceType == typeof(ILoggerFactory));
2426Assert.Contains(builder.Services, service => service.ServiceType == typeof(ILogger<>));
Microsoft.Build.Engine.UnitTests (2)
Microsoft.Build.Tasks.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Microsoft.CodeAnalysis.LanguageServer.UnitTests (2)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (15)
VisualStudioMSBuildWorkspaceTests.cs (13)
767Assert.Contains(documents, d => d.Name == "App.xaml.cs");
768Assert.Contains(documents, d => d.Name == "MainWindow.xaml.cs");
774Assert.Contains(documents, d => d.Name == "App.g.cs");
775Assert.Contains(documents, d => d.Name == "MainWindow.g.cs");
1329Assert.Contains(metaRefs, r => r is PortableExecutableReference reference && reference.Display.Contains("CSharpProject.dll"));
1351Assert.Contains(project.MetadataReferences, r => r is PortableExecutableReference reference && reference.Display.Contains("CSharpProject.dll"));
1397Assert.Contains(metaRefs, r => r is PortableExecutableReference reference && reference.Display.Contains("CSharpProject.dll"));
1439Assert.Contains(vbProject.MetadataReferences, r => r is PortableExecutableReference reference && reference.Display.Contains("CSharpProject.dll"));
1907Assert.Contains(attrs, ad => ad.AttributeClass.Name == "MyAttribute");
1954Assert.Contains(attrs, ad => ad.AttributeClass.Name == "MyAttr");
3108Assert.Contains(proj.Documents, d => d.Name == "AssemblyInfo.cs");
3196Assert.Contains(project.AdditionalDocuments, doc => doc.Name == "COM1");
3197Assert.Contains(project.AdditionalDocuments, doc => doc.Name == "TEST::");
Microsoft.DotNet.Build.Tasks.Feed.Tests (6)
Microsoft.DotNet.XUnitAssert.Tests (4)
Microsoft.Extensions.Hosting.Testing.Tests (3)
Microsoft.Gen.Logging.Generated.Tests (2)
Sockets.FunctionalTests (6)
System.Windows.Forms.Design.Tests (1)
System.Windows.Forms.Tests (1)
xunit.assert (1)