930 references to Single
Aspire.Hosting.Elasticsearch.Tests (4)
AddElasticsearchTests.cs (4)
32var primaryEndpoint = Assert.Single(endpoints, e => e.Name == "http"); 41var internalEndpoint = Assert.Single(endpoints, e => e.Name == "internal"); 94var primaryEndpoint = Assert.Single(endpoints, e => e.Name == "http"); 103var internalEndpoint = Assert.Single(endpoints, e => e.Name == "internal");
Aspire.Hosting.Kafka.Tests (3)
AddKafkaTests.cs (3)
31var primaryEndpoint = Assert.Single(endpoints, e => e.Name == "tcp"); 40var internalEndpoint = Assert.Single(endpoints, e => e.Name == "internal"); 174var kafkaUiResource = Assert.Single(builder.Resources, r => r.Name == expectedContainerName);
Aspire.Hosting.PostgreSQL.Tests (1)
AddPostgresTests.cs (1)
22Assert.Single(redis.Resource.Annotations, a => a is HealthCheckAnnotation hca && hca.Key == "postgres_check");
Aspire.Hosting.Redis.Tests (1)
AddRedisTests.cs (1)
20Assert.Single(redis.Resource.Annotations, a => a is HealthCheckAnnotation hca && hca.Key == "redis_check");
Aspire.Hosting.Tests (6)
AddParameterTests.cs (4)
147var parameterResource = Assert.Single(appModel.Resources.OfType<ParameterResource>(), r => r.Name == "pass"); 197var parameterResource = Assert.Single(appModel.Resources.OfType<ParameterResource>(), r => r.Name == "pass"); 255var parameterResource = Assert.Single(appModel.Resources.OfType<ParameterResource>(), r => r.Name == "pass"); 310var parameterResource = Assert.Single(appModel.Resources.OfType<ParameterResource>(), r => r.Name == "val");
WithEnvironmentTests.cs (2)
257Assert.Single(runConfig, kvp => kvp.Key == envVarName && kvp.Value == sourceCon); 263Assert.Single(publishConfig, kvp => kvp.Key == envVarName && kvp.Value == "{sourceService.connectionString}");
IIS.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\MaxRequestBodySizeTests.cs (1)
161Assert.Single(TestSink.Writes, w => w.Message.Contains("Increasing the MaxRequestBodySize conflicts with the max value for IIS limit maxAllowedContentLength." +
src\Servers\IIS\IIS\test\Common.FunctionalTests\MaxRequestBodySizeTests.cs (1)
162Assert.Single(TestSink.Writes, w => w.Message.Contains("Increasing the MaxRequestBodySize conflicts with the max value for IIS limit maxAllowedContentLength." +
IIS.Tests (3)
ClientDisconnectTests.cs (1)
347Assert.Single(TestSink.Writes, w => w.EventId.Name == "ConnectionDisconnect");
MaxRequestBodySizeTests.cs (2)
357var appErrorLog = Assert.Single(TestSink.Writes, w => w.LoggerName == "Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer" && w.LogLevel > LogLevel.Debug); 358var badRequestLog = Assert.Single(TestSink.Writes, w => w.LoggerName == "Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer" && w.EventId == new EventId(4, "ConnectionBadRequest"));
IISExpress.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\MaxRequestBodySizeTests.cs (1)
161Assert.Single(TestSink.Writes, w => w.Message.Contains("Increasing the MaxRequestBodySize conflicts with the max value for IIS limit maxAllowedContentLength." +
src\Servers\IIS\IIS\test\Common.FunctionalTests\MaxRequestBodySizeTests.cs (1)
162Assert.Single(TestSink.Writes, w => w.Message.Contains("Increasing the MaxRequestBodySize conflicts with the max value for IIS limit maxAllowedContentLength." +
InMemory.FunctionalTests (12)
Http2\Http2ConnectionTests.cs (1)
5087Assert.Single(LogMessages, m => m.Exception is ConnectionResetException);
Http2\Http2TestBase.cs (1)
1324var message = Assert.Single(LogMessages, m => m.Exception is TException);
Http3\Http3TestBase.cs (1)
141var message = Assert.Single(LogMessages, m => m.Exception != null && exceptionType.IsAssignableFrom(m.Exception.GetType()));
HttpProtocolSelectionTests.cs (1)
94Assert.Single(LogMessages, message => message.LogLevel == LogLevel.Error
ResponseDrainingTests.cs (1)
76Assert.Single(LogMessages, w => w.EventId.Id == 28 && w.LogLevel <= LogLevel.Debug);
ResponseTests.cs (7)
939var logMessage = Assert.Single(LogMessages, message => message.EventId.Name == "ConnectionHeadResponseBodyWrite"); 982var logMessage = Assert.Single(LogMessages, message => message.LogLevel == LogLevel.Error); 1021var logMessage = Assert.Single(LogMessages, message => message.LogLevel == LogLevel.Error); 1061var logMessage = Assert.Single(LogMessages, message => message.LogLevel == LogLevel.Error); 1096var logMessage = Assert.Single(LogMessages, message => message.LogLevel == LogLevel.Error); 2711Assert.Single(LogMessages, message => message.LogLevel == LogLevel.Error); 2756Assert.Single(LogMessages, message => message.LogLevel == LogLevel.Error);
Microsoft.AspNetCore.Authentication.Test (12)
OAuthTests.cs (4)
136var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 137var correlation = Assert.Single(setCookie.Value, v => v.StartsWith(".AspNetCore.Correlation.", StringComparison.Ordinal)); 164var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 165var correlation = Assert.Single(setCookie.Value, v => v.StartsWith(".AspNetCore.Correlation.", StringComparison.Ordinal));
OpenIdConnect\OpenIdConnectTests.cs (8)
79var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 80var nonce = Assert.Single(setCookie.Value, v => v.StartsWith(OpenIdConnectDefaults.CookieNoncePrefix, StringComparison.Ordinal)); 106var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 107var nonce = Assert.Single(setCookie.Value, v => v.StartsWith(OpenIdConnectDefaults.CookieNoncePrefix, StringComparison.Ordinal)); 132var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 133var correlation = Assert.Single(setCookie.Value, v => v.StartsWith(".AspNetCore.Correlation.", StringComparison.Ordinal)); 159var setCookie = Assert.Single(res.Headers, h => h.Key == "Set-Cookie"); 160var correlation = Assert.Single(setCookie.Value, v => v.StartsWith(".AspNetCore.Correlation.", StringComparison.Ordinal));
Microsoft.AspNetCore.Components.Endpoints.Tests (8)
Builder\RazorComponentsEndpointConventionBuilderExtensionsTest.cs (1)
241var webJSEndpoint = Assert.Single(endpoints, e => e.Metadata.Contains(obj));
HotReloadServiceTests.cs (7)
50Assert.Single(endpointDataSource.Endpoints, e => e.Metadata.GetMetadata<RootComponentMetadata>() != null)); 84var endpoint = Assert.IsType<RouteEndpoint>(Assert.Single(endpointDataSource.Endpoints, 108var endpoint = Assert.IsType<RouteEndpoint>(Assert.Single(endpointDataSource.Endpoints, e => e.Metadata.GetMetadata<RootComponentMetadata>() != null)); 118var updatedEndpoint = Assert.IsType<RouteEndpoint>(Assert.Single(endpointDataSource.Endpoints, e => e.Metadata.GetMetadata<RootComponentMetadata>() != null)); 134var endpoint = Assert.IsType<RouteEndpoint>(Assert.Single(endpointDataSource.Endpoints, e => e.Metadata.GetMetadata<RootComponentMetadata>() != null)); 136var compositeEndpoint = Assert.IsType<RouteEndpoint>(Assert.Single(compositeEndpointDataSource.Endpoints, e => e.Metadata.GetMetadata<RootComponentMetadata>() != null)); 183var endpoint = Assert.IsType<RouteEndpoint>(Assert.Single(endpointDataSource.Endpoints, e => e.Metadata.GetMetadata<RootComponentMetadata>() != null));
Microsoft.AspNetCore.Components.Tests (4)
RendererTest.cs (1)
5651Assert.Single(logStream.Skip(1),
Routing\RouteTableFactoryTests.cs (3)
308Assert.Single(context.Parameters, p => p.Key == "parameter" && (string)p.Value == expectedValue); 325Assert.Single(context.Parameters, p => p.Key == "parameter" && (string)p.Value == expectedValue); 473var value = expectedValue != null ? Assert.Single(context.Parameters, p => p.Key == "parameter").Value : null;
Microsoft.AspNetCore.Components.WebAssembly.Tests (1)
Hosting\WebAssemblyHostBuilderTest.cs (1)
230Assert.Single(builder.Services, d => d.ServiceType == type);
Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests (1)
CertificateManagerTests.cs (1)
57var httpsCertificate = Assert.Single(httpsCertificates, c => c.Subject == TestCertificateSubject);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (76)
Logging\AcceptanceTests.cs (48)
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!"); 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); 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()); 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.CurrentCulture)); 423Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Delete.ToString()); 463Assert.Single(state, x => x.Key == HttpLoggingTagNames.Path && x.Value == RequestPath); 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.CurrentCulture)); 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); 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 && 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"); 657Assert.Single(state, x => x.Key == HttpLoggingTagNames.Method && x.Value == HttpMethod.Put.ToString());
Logging\AcceptanceTests.Mvc.cs (28)
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); 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); 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 && 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 && 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.Http.Extensions.Tests (6)
ProblemDetailsServiceCollectionExtensionsTest.cs (1)
81var service = Assert.Single(collection, (sd) => sd.ServiceType == typeof(IProblemDetailsService));
PropertyAsParameterInfoTests.cs (5)
81Assert.Single( 98Assert.Single( 101Assert.Single( 118Assert.Single( 121Assert.Single(
Microsoft.AspNetCore.Http.Tests (6)
ResponseCookiesTest.cs (6)
140Assert.Single(deletedCookies, cookie => cookie.StartsWith("key1", StringComparison.InvariantCulture) && cookie.Contains("path=/path1/")); 141Assert.Single(deletedCookies, cookie => cookie.StartsWith("key1", StringComparison.InvariantCulture) && cookie.Contains("path=/path2/")); 142Assert.Single(deletedCookies, cookie => cookie.StartsWith("key2", StringComparison.InvariantCulture) && cookie.Contains("path=/path1/") && cookie.Contains("domain=localhost")); 143Assert.Single(deletedCookies, cookie => cookie.StartsWith("key2", StringComparison.InvariantCulture) && cookie.Contains("path=/path2/") && cookie.Contains("domain=localhost")); 170Assert.Single(deletedCookies, cookie => cookie.StartsWith("key1", StringComparison.InvariantCulture) && cookie.Contains("path=/path1/")); 171Assert.Single(deletedCookies, cookie => cookie.StartsWith("key2", StringComparison.InvariantCulture) && cookie.Contains("path=/path1/") && cookie.Contains("domain=localhost"));
Microsoft.AspNetCore.HttpLogging.Tests (2)
HttpLoggingMiddlewareTests.cs (2)
1944var requestLog = Assert.Single(filteredLogs, w => w.Message.Contains("Request:")); 1948var responseLog = Assert.Single(filteredLogs, w => w.Message.Contains("Response:"));
Microsoft.AspNetCore.Identity.FunctionalTests (3)
MapIdentityApiTests.cs (3)
443Assert.Single(TestSink.Writes, w => 497Assert.Single(TestSink.Writes, w => 522Assert.Single(TestSink.Writes, w =>
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (59)
DefaultApiDescriptionProviderTest.cs (59)
153Assert.Single(descriptions, d => d.HttpMethod == "PUT"); 154Assert.Single(descriptions, d => d.HttpMethod == "POST"); 155Assert.Single(descriptions, d => d.HttpMethod == "GET"); 340var id = Assert.Single(parameters, p => p.Source == expected); 371var id = Assert.Single(parameters, p => p.Source == expected); 437var id1 = Assert.Single(description.ParameterDescriptions, p => p.Name == "id1"); 441var id2 = Assert.Single(description.ParameterDescriptions, p => p.Name == "id2"); 462Assert.Single(description.ParameterDescriptions, p => p.Name == "id1"); 463Assert.Single(description.ParameterDescriptions, p => p.Name == "id2"); 464Assert.Single(description.ParameterDescriptions, p => p.Name == "id3"); 465Assert.Single(description.ParameterDescriptions, p => p.Name == "id4"); 466Assert.Single(description.ParameterDescriptions, p => p.Name == "id5"); 1326var parameter = Assert.Single(parameters, p => p.Name == "ProductId"); 1330parameter = Assert.Single(parameters, p => p.Name == "Name"); 1334parameter = Assert.Single(parameters, p => p.Name == "Description"); 1424var parameter = Assert.Single(parameters, p => p.Name == "ProductId"); 1428parameter = Assert.Single(parameters, p => p.Name == "Name"); 1432parameter = Assert.Single(parameters, p => p.Name == "Description"); 1526var parameter = Assert.Single(parameters, p => p.Name == "ProductId"); 1530parameter = Assert.Single(parameters, p => p.Name == "Name"); 1534parameter = Assert.Single(parameters, p => p.Name == "Description"); 1553var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "Id"); 1557var product = Assert.Single(description.ParameterDescriptions, p => p.Name == "Product"); 1561var userId = Assert.Single(description.ParameterDescriptions, p => p.Name == "UserId"); 1565var comments = Assert.Single(description.ParameterDescriptions, p => p.Name == "Comments"); 1584var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "Name"); 1603var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "id"); 1622var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "id"); 1641var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "employee"); 1660var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "employee"); 1679var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "employee"); 1698var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "employee"); 1717var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "managerid"); 1721var product = Assert.Single(description.ParameterDescriptions, p => p.Name == "name"); 1741var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "Id"); 1745var product = Assert.Single(description.ParameterDescriptions, p => p.Name == "Product"); 1749var userId = Assert.Single(description.ParameterDescriptions, p => p.Name == "UserId"); 1753var comments = Assert.Single(description.ParameterDescriptions, p => p.Name == "Comments"); 1772var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "Id"); 1776var quantity = Assert.Single(description.ParameterDescriptions, p => p.Name == "Quantity"); 1780var productId = Assert.Single(description.ParameterDescriptions, p => p.Name == "Product.Id"); 1784var price = Assert.Single(description.ParameterDescriptions, p => p.Name == "Product.Price"); 1804var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "Id"); 1808var quantity = Assert.Single(description.ParameterDescriptions, p => p.Name == "Quantity"); 1812var productId = Assert.Single(description.ParameterDescriptions, p => p.Name == "Product.Id"); 1816var productPrice = Assert.Single(description.ParameterDescriptions, p => p.Name == "Product.Price"); 1839var id = Assert.Single(description.ParameterDescriptions, p => p.Name == $"{parentName}.Child.Id"); 1843var name = Assert.Single(description.ParameterDescriptions, p => p.Name == $"{parentName}.Child.Name"); 1870var id = Assert.Single(description.ParameterDescriptions, p => p.Name == $"{groupName}.{parentName}.Child.Id"); 1874var name = Assert.Single(description.ParameterDescriptions, p => p.Name == $"{groupName}.{parentName}.Child.Name"); 1952var id = Assert.Single(parameters, p => p.Name == "Id"); 1956var name = Assert.Single(parameters, p => p.Name == "Name"); 1974var name = Assert.Single(description.ParameterDescriptions, p => p.Name == "Name"); 1978var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "Id"); 1997var name = Assert.Single(description.ParameterDescriptions, p => p.Name == "name"); 2001var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "Id"); 2005var product = Assert.Single(description.ParameterDescriptions, p => p.Name == "Product"); 2009var userId = Assert.Single(description.ParameterDescriptions, p => p.Name == "UserId"); 2013var comments = Assert.Single(description.ParameterDescriptions, p => p.Name == "Comments");
Microsoft.AspNetCore.Mvc.Core.Test (115)
ApplicationModels\ApiBehaviorApplicationModelProviderTest.cs (1)
194var convention = (InferParameterBindingInfoConvention)Assert.Single(provider.ActionModelConventions, c => c is InferParameterBindingInfoConvention);
ApplicationModels\AuthorizationApplicationModelProviderTest.cs (3)
69Assert.Single(controller.Filters, f => f is AuthorizeFilter); 116Assert.Single(controller.Filters, f => f is AllowAnonymousFilter); 118Assert.Single(action.Filters, f => f is AllowAnonymousFilter);
ApplicationModels\ConsumesConstraintForFormFileParameterConventionTest.cs (1)
73return Assert.Single(controller.Actions, m => m.ActionName == actionName);
ApplicationModels\ControllerActionDescriptorProviderTests.cs (86)
123var main = Assert.Single(descriptors.Cast<ControllerActionDescriptor>(), 142var main = Assert.Single(descriptors.Cast<ControllerActionDescriptor>(), 146var id = Assert.Single(main.Parameters, p => p.Name == "id"); 152var entity = Assert.Single(main.Parameters, p => p.Name == "entity"); 167var main = Assert.Single(descriptors.Cast<ControllerActionDescriptor>(), 171var id = Assert.Single(main.Parameters, p => p.Name == "id"); 177var upperCaseId = Assert.Single(main.Parameters, p => p.Name == "ID"); 183var pascalCaseId = Assert.Single(main.Parameters, p => p.Name == "Id"); 200var fromBody = Assert.Single(descriptors.Cast<ControllerActionDescriptor>(), 221var notFromBody = Assert.Single(descriptors.Cast<ControllerActionDescriptor>(), 244var controller = Assert.Single(action.RouteValues, kvp => kvp.Key.Equals("controller")); 247var actionConstraint = Assert.Single(action.RouteValues, kvp => kvp.Key.Equals("action")); 261var anonymousAction = Assert.Single(descriptors, a => a.RouteValues["action"] == "AllowAnonymousAction"); 269var authorizeAction = Assert.Single(descriptors, a => a.RouteValues["action"] == "AuthorizeAction"); 345var controller = Assert.Single(action.RouteValues, kvp => kvp.Key.Equals("controller")); 348var actionConstraint = Assert.Single(action.RouteValues, kvp => kvp.Key.Equals("action")); 360var descriptorWithoutValue = Assert.Single( 364var descriptorWithValue = Assert.Single( 372Assert.Single( 377Assert.Single( 382Assert.Single( 389Assert.Single( 394Assert.Single( 462Assert.Single(actions, a => a.AttributeRouteInfo.Template.Equals("v1/List")); 463Assert.Single(actions, a => a.AttributeRouteInfo.Template.Equals("v1/All")); 464Assert.Single(actions, a => a.AttributeRouteInfo.Template.Equals("v2/List")); 465Assert.Single(actions, a => a.AttributeRouteInfo.Template.Equals("v2/All")); 492Assert.Single(actions, a => a.AttributeRouteInfo.Template.Equals("v1/List")); 493Assert.Single(actions, a => a.AttributeRouteInfo.Template.Equals("v2/List")); 506var action = Assert.Single(descriptors, d => d.ActionName == "AcceptVerbsOverride"); 548Assert.Single(putActions, a => a.AttributeRouteInfo.Template.Equals("v1/All")); 549Assert.Single(putActions, a => a.AttributeRouteInfo.Template.Equals("v2/All")); 555Assert.Single(routeActions, a => a.AttributeRouteInfo.Template.Equals("v1/List")); 556Assert.Single(routeActions, a => a.AttributeRouteInfo.Template.Equals("v2/List")); 587Assert.Single(postActions, a => a.AttributeRouteInfo.Template.Equals("v1")); 588Assert.Single(postActions, a => a.AttributeRouteInfo.Template.Equals("v2")); 594Assert.Single(putActions, a => a.AttributeRouteInfo.Template.Equals("v1/All")); 595Assert.Single(putActions, a => a.AttributeRouteInfo.Template.Equals("v2/All")); 600Assert.Single(unconstrainedActions, a => a.AttributeRouteInfo.Template.Equals("v1/List")); 601Assert.Single(unconstrainedActions, a => a.AttributeRouteInfo.Template.Equals("v2/List")); 616var controllerAndAction = Assert.Single(actions, a => a.ActionName.Equals(firstActionName)); 619var controllerActionAndOverride = Assert.Single(actions, a => a.ActionName.Equals(secondActionName)); 644var action = Assert.Single( 821var editAction = Assert.Single(actions, a => a.ActionName.Equals(editActionName)); 853var editAction = Assert.Single(actions, a => a.ActionName.Equals(editActionName)); 901var indexAction = Assert.Single(actionDescriptors, ad => ad.ActionName.Equals("Index")); 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)); 970var action = Assert.Single(actions, a => a.ActionName == "Edit"); 973action = Assert.Single(actions, a => a.ActionName == "Create"); 1050var action = Assert.Single(actions, a => a.ActionName == "Edit"); 1053action = Assert.Single(actions, a => a.ActionName == "Create"); 1190var action = Assert.Single(actions, a => a.AttributeRouteInfo.Template == "R1"); 1193Assert.Single(action.ActionConstraints, a => a is RouteAndConstraintAttribute); 1194Assert.Single(action.ActionConstraints, a => a is ConstraintAttribute); 1196action = Assert.Single(actions, a => a.AttributeRouteInfo.Template == "R2"); 1199Assert.Single(action.ActionConstraints, a => a is RouteAndConstraintAttribute); 1200Assert.Single(action.ActionConstraints, a => a is ConstraintAttribute); 1216var action = Assert.Single(actions, a => a.AttributeRouteInfo.Template == "C1/A1"); 1218Assert.Single(action.ActionConstraints, a => (a as RouteAndConstraintAttribute)?.Template == "C1"); 1219Assert.Single(action.ActionConstraints, a => (a as RouteAndConstraintAttribute)?.Template == "A1"); 1220Assert.Single(action.ActionConstraints, a => a is ConstraintAttribute); 1222action = Assert.Single(actions, a => a.AttributeRouteInfo.Template == "C2/A1"); 1224Assert.Single(action.ActionConstraints, a => (a as RouteAndConstraintAttribute)?.Template == "C2"); 1225Assert.Single(action.ActionConstraints, a => (a as RouteAndConstraintAttribute)?.Template == "A1"); 1226Assert.Single(action.ActionConstraints, a => a is ConstraintAttribute); 1243var action = Assert.Single(actions, a => a.AttributeRouteInfo.Template == "C1/A3"); 1245Assert.Single(action.ActionConstraints, a => (a as RouteAndConstraintAttribute)?.Template == "C1"); 1246Assert.Single(action.ActionConstraints, a => (a as RouteAndConstraintAttribute)?.Template == "A3"); 1247Assert.Single(action.ActionConstraints, a => a is ConstraintAttribute); 1249action = Assert.Single(actions, a => a.AttributeRouteInfo.Template == "C2/A3"); 1251Assert.Single(action.ActionConstraints, a => (a as RouteAndConstraintAttribute)?.Template == "C2"); 1252Assert.Single(action.ActionConstraints, a => (a as RouteAndConstraintAttribute)?.Template == "A3"); 1253Assert.Single(action.ActionConstraints, a => a is ConstraintAttribute); 1255action = Assert.Single(actions, a => a.AttributeRouteInfo.Template == "C1/A4"); 1257Assert.Single(action.ActionConstraints, a => (a as RouteAndConstraintAttribute)?.Template == "C1"); 1258Assert.Single(action.ActionConstraints, a => (a as RouteAndConstraintAttribute)?.Template == "A4"); 1259Assert.Single(action.ActionConstraints, a => a is ConstraintAttribute); 1261action = Assert.Single(actions, a => a.AttributeRouteInfo.Template == "C2/A4"); 1263Assert.Single(action.ActionConstraints, a => (a as RouteAndConstraintAttribute)?.Template == "C2"); 1264Assert.Single(action.ActionConstraints, a => (a as RouteAndConstraintAttribute)?.Template == "A4"); 1265Assert.Single(action.ActionConstraints, a => a is ConstraintAttribute); 1282var action = Assert.Single(actions, a => a.AttributeRouteInfo.Template == "A2"); 1284Assert.Single(action.ActionConstraints, a => (a as RouteAndConstraintAttribute)?.Template == "~/A2"); 1285Assert.Single(action.ActionConstraints, a => a is ConstraintAttribute);
ApplicationModels\DefaultApplicationModelProviderTest.cs (11)
180var action = Assert.Single(controllerModel.Actions, a => a.ActionMethod.Name == nameof(ModelBinderController.PostAction)); 224var action = Assert.Single(controllerModel.Actions, a => a.ActionMethod.Name == nameof(ModelBinderController.FormFilesSequences)); 272var action = Assert.Single(controllerModel.Actions, a => a.ActionName == nameof(ModelBinderController.PostAction1)); 300var action = Assert.Single(controllerModel.Actions, a => a.ActionName == nameof(ModelBinderController.PostAction2)); 326var action = Assert.Single(controllerModel.Actions, a => a.ActionMethod == methodInfo); 346var action = Assert.Single(controllerModel.Actions, a => a.ActionMethod == methodInfo); 366var action = Assert.Single(controllerModel.Actions, a => a.ActionMethod == methodInfo); 446var route = Assert.Single(attributeRoutes, r => r.Template == "A"); 449route = Assert.Single(attributeRoutes, r => r.Template == "B"); 468var route = Assert.Single(attributeRoutes, r => r.Template == "C"); 471route = Assert.Single(attributeRoutes, r => r.Template == "D");
ApplicationModels\InferParameterBindingInfoConventionTest.cs (2)
519var actionModel = Assert.Single(controllerModel.Actions, m => m.ActionName == actionName); 928return Assert.Single(controller.Actions, m => m.ActionName == actionName);
DependencyInjection\MvcBuilderExtensionsTest.cs (2)
129Assert.Single(collection, d => d.ServiceType.Equals(typeof(ControllerOne))); 130Assert.Single(collection, d => d.ServiceType.Equals(typeof(ControllerTwo)));
Formatters\OutputFormatterTests.cs (2)
123Assert.Single(contentTypes, ct => ct.ToString() == "application/json"); 124Assert.Single(contentTypes, ct => ct.ToString() == "application/xml");
ModelBinding\Metadata\DefaultModelMetadataProviderTest.cs (3)
97Assert.Single(metadata, m => m.PropertyName == "Property1"); 98Assert.Single(metadata, m => m.PropertyName == "Property2"); 112Assert.Single(metadata, m => m.PropertyName == "Property1");
ModelBinding\Validation\DefaultModelValidatorProviderTest.cs (2)
93Assert.Single(validatorItems, v => Assert.IsType<CustomModelValidatorAttribute>(v.Validator).Tag == "Class"); 94Assert.Single(validatorItems, v => Assert.IsType<CustomModelValidatorAttribute>(v.Validator).Tag == "Property");
Routing\AttributeRouteTest.cs (2)
190Assert.Single(e.Constraints, kvp => kvp.Key == "id"); 392Assert.Single(e.Constraints, kvp => kvp.Key == "id");
Microsoft.AspNetCore.Mvc.Cors.Test (10)
CorsApplicationModelProviderTest.cs (10)
37var constraint = Assert.Single(selector.ActionConstraints, c => c is HttpMethodActionConstraint); 56var constraint = Assert.Single(selector.ActionConstraints, c => c is HttpMethodActionConstraint); 74var constraint = Assert.Single(selector.ActionConstraints, c => c is HttpMethodActionConstraint); 93var constraint = Assert.Single(selector.ActionConstraints, c => c is HttpMethodActionConstraint); 112var constraint = Assert.Single(selector.ActionConstraints, c => c is HttpMethodActionConstraint); 130var constraint = Assert.Single(selector.ActionConstraints, c => c is HttpMethodActionConstraint); 151var constraint = Assert.Single(selector.ActionConstraints, c => c is HttpMethodActionConstraint); 170var constraint = Assert.Single(selector.ActionConstraints, c => c is HttpMethodActionConstraint); 189var constraint = Assert.Single(selector.ActionConstraints, c => c is HttpMethodActionConstraint); 207var constraint = Assert.Single(selector.ActionConstraints, c => c is HttpMethodActionConstraint);
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (10)
DataAnnotationsMetadataProviderTest.cs (6)
1029var groupTwo = Assert.Single(enumNameAndGroup, e => e.Value.Equals("2", StringComparison.Ordinal)); 1049var groupTwo = Assert.Single(enumNameAndGroup, e => e.Value.Equals("2", StringComparison.Ordinal)); 1069var groupThree = Assert.Single(enumNameAndGroup, e => e.Value.Equals("3", StringComparison.Ordinal)); 1088var groupThree = Assert.Single(enumNameAndGroup, e => e.Value.Equals("3", StringComparison.Ordinal)); 1164var attribute = Assert.Single(context.ValidationMetadata.ValidatorMetadata, m => m is RequiredAttribute); 1189var attribute = Assert.Single(context.ValidationMetadata.ValidatorMetadata, m => m is RequiredAttribute a);
DefaultModelClientValidatorProviderTest.cs (4)
95Assert.Single(validatorItems, v => Assert.IsType<CustomModelValidatorAttribute>(v.Validator).Tag == "Class"); 96Assert.Single(validatorItems, v => Assert.IsType<CustomModelValidatorAttribute>(v.Validator).Tag == "Property"); 120Assert.Single(validatorItems, v => v.Validator is RequiredAttributeAdapter); 164Assert.Single(validatorItems, v => v.Validator is RequiredAttributeAdapter);
Microsoft.AspNetCore.Mvc.FunctionalTests (43)
ApiExplorerTest.cs (36)
281var month = Assert.Single(description.ParameterDescriptions, p => p.Name == "month"); 286var day = Assert.Single(description.ParameterDescriptions, p => p.Name == "day"); 291var year = Assert.Single(description.ParameterDescriptions, p => p.Name == "year"); 317var month = Assert.Single(description.ParameterDescriptions, p => p.Name == "month"); 322var day = Assert.Single(description.ParameterDescriptions, p => p.Name == "day"); 327var year = Assert.Single(description.ParameterDescriptions, p => p.Name == "year"); 352var path = Assert.Single(description.ParameterDescriptions, p => p.Name == "path"); 355var pathAndQuery = Assert.Single(description.ParameterDescriptions, p => p.Name == "pathAndQuery"); 358Assert.Single(description.ParameterDescriptions, p => p.Name == "pathAndFromBody" && p.Source == "Body"); 359Assert.Single(description.ParameterDescriptions, p => p.Name == "pathAndFromBody" && p.Source == "Path"); 376var id = Assert.Single(description.ParameterDescriptions, p => p.Name == "id"); 428Assert.Single(result, d => d.HttpMethod == "PUT"); 429Assert.Single(result, d => d.HttpMethod == "POST"); 451Assert.Single(result, d => d.HttpMethod == "PUT"); 452Assert.Single(result, d => d.HttpMethod == "POST"); 855var textXml = Assert.Single(responseType.ResponseFormats, f => f.MediaType == "text/xml"); 857var applicationXml = Assert.Single(responseType.ResponseFormats, f => f.MediaType == "application/xml"); 860var textJson = Assert.Single(responseType.ResponseFormats, f => f.MediaType == "text/json"); 862var applicationJson = Assert.Single(responseType.ResponseFormats, f => f.MediaType == "application/json"); 881var applicationJson = Assert.Single( 886var textJson = Assert.Single(responseType.ResponseFormats, f => f.MediaType == "text/json"); 978var i = Assert.Single(parameters, p => p.Name == "i"); 982var s = Assert.Single(parameters, p => p.Name == "s"); 1003var i = Assert.Single(parameters, p => p.Name == "i"); 1007var s = Assert.Single(parameters, p => p.Name == "s"); 1027var id = Assert.Single(parameters, p => p.Name == "Id"); 1031var name = Assert.Single(parameters, p => p.Name == "Name"); 1051var id = Assert.Single(parameters, p => p.Name == "id"); 1055var product = Assert.Single(parameters, p => p.Name == "product"); 1075var customerId = Assert.Single(parameters, p => p.Name == "CustomerId"); 1079var referrer = Assert.Single(parameters, p => p.Name == "Referrer"); 1083var quantity = Assert.Single(parameters, p => p.Name == "Details.Quantity"); 1087var productId = Assert.Single(parameters, p => p.Name == "Details.Product.Id"); 1091var productName = Assert.Single(parameters, p => p.Name == "Details.Product.Name"); 1095var shippingInstructions = Assert.Single(parameters, p => p.Name == "Comments.ShippingInstructions"); 1099var feedback = Assert.Single(parameters, p => p.Name == "Comments.Feedback");
InputObjectValidationTests.cs (2)
148var errorKeyValuePair = Assert.Single(responseObject, keyValuePair => keyValuePair.Value.Length > 0); 176var errorKeyValuePair = Assert.Single(responseObject, keyValuePair => keyValuePair.Value.Length > 0);
JsonOutputFormatterTestBase.cs (2)
67var errors = Assert.Single(modelStateErrors, kvp => kvp.Key == "Id").Value; 72errors = Assert.Single(modelStateErrors, kvp => kvp.Key == "Name").Value;
RoutingTestsBase.cs (3)
167Assert.Single(result.DataTokens, kvp => kvp.Key == "actionName" && ((string)kvp.Value) == "DataTokens"); 179Assert.Single(result.DataTokens, kvp => kvp.Key == "actionName" && ((string)kvp.Value) == "Conventional"); 198Assert.Single(result, kvp => kvp.Key == "hasDataTokens" && ((bool)kvp.Value) == true);
Microsoft.AspNetCore.Mvc.IntegrationTests (391)
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 (22)
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;
ComplexRecordIntegrationTest.cs (106)
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; 698Assert.Single(modelState, e => e.Key == "parameter.Customer.Documents"); 699var entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId").Value; 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; 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; 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; 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; 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; 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; 3605var entry = Assert.Single(modelState, m => m.Key == "Age"); 3609entry = Assert.Single(modelState, m => m.Key == "Name"); 3754Assert.Single(modelState, e => e.Key == "Name"); 3755Assert.Single(modelState, e => e.Key == "Id"); 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]"); 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 (90)
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; 701Assert.Single(modelState, e => e.Key == "parameter.Customer.Documents"); 702var entry = Assert.Single(modelState, e => e.Key == "parameter.ProductId").Value; 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; 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; 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; 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; 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; 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;
DictionaryModelBinderIntegrationTest.cs (5)
48var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0].Key").Value; 52entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[0].Value").Value; 127var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[low].Key").Value; 132entry = Assert.Single(modelState, kvp => kvp.Key == "parameter[low].Value").Value; 814var entry = Assert.Single(modelState, kvp => kvp.Value.ValidationState == ModelValidationState.Invalid);
FormFileModelBindingIntegrationTest.cs (11)
67Assert.Single(modelState.Keys, k => k == "Address.Zip"); 68var key = Assert.Single(modelState.Keys, k => k == "Address.File"); 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"); 1024var entry = Assert.Single(modelState, e => e.Key == "p.Name").Value; 1028Assert.Single(modelState, e => e.Key == "p.Specs");
GenericModelBinderIntegrationTest.cs (14)
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; 337var entry = Assert.Single(modelState, e => e.Key == "[0][0].Key").Value; 341entry = Assert.Single(modelState, e => e.Key == "[0][0].Value").Value; 416var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value; 420entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value").Value; 460var entry = Assert.Single(modelState, e => e.Key == "[0].Key").Value; 464entry = Assert.Single(modelState, e => e.Key == "[0].Value").Value; 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; 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;
KeyValuePairModelBinderIntegrationTest.cs (26)
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; 381var entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Key").Value; 385entry = Assert.Single(modelState, kvp => kvp.Key == "parameter.Value.Id").Value; 426var entry = Assert.Single(modelState, kvp => kvp.Key == "prefix.Key").Value; 430entry = Assert.Single(modelState, kvp => kvp.Key == "prefix.Value.Id").Value; 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; 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;
SimpleTypeModelBinderIntegrationTest.cs (2)
59var key = Assert.Single(modelState.Keys, k => k == "CustomParameter.Address.Zip"); 103var key = Assert.Single(modelState.Keys, k => k == "Address.Zip");
TryUpdateModelIntegrationTest.cs (2)
1200var entry = Assert.Single(modelState, k => k.Key == "Address.ZipCode"); 1207entry = Assert.Single(modelState, k => k.Key == "Address.Street");
ValidationIntegrationTests.cs (50)
114var entry = Assert.Single( 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; 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; 2243var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value; 2248entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value").Value; 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 (51)
106var entry = Assert.Single( 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; 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; 2034var entry = Assert.Single(modelState, e => e.Key == "parameter[0].Key").Value; 2039entry = Assert.Single(modelState, e => e.Key == "parameter[0].Value").Value; 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.Test (5)
DependencyInjection\NewtonsoftJsonMvcBuilderExtensionsTest.cs (1)
26Assert.Single(services, d => d.ServiceType == typeof(IConfigureOptions<MvcNewtonsoftJsonOptions>));
DependencyInjection\NewtonsoftJsonMvcCoreBuilderExtensionsTest.cs (4)
30Assert.Single(services, d => d.ServiceType == typeof(IConfigureOptions<MvcNewtonsoftJsonOptions>)); 44var jsonHelper = Assert.Single(services, d => d.ServiceType == typeof(IJsonHelper)); 59var tempDataSerializer = Assert.Single(services, d => d.ServiceType == typeof(TempDataSerializer)); 74var jsonResultExecutor = Assert.Single(services, d => d.ServiceType == typeof(IActionResultExecutor<JsonResult>));
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (3)
DependencyInjection\RazorRuntimeCompilationMvcCoreBuilderExtensionsTest.cs (3)
25var serviceDescriptor = Assert.Single(services, service => service.ServiceType == typeof(IViewCompilerProvider)); 40var serviceDescriptor = Assert.Single(services, service => service.ServiceType == typeof(IActionDescriptorProvider)); 43serviceDescriptor = Assert.Single(services, service => service.ServiceType == typeof(MatcherPolicy));
Microsoft.AspNetCore.Mvc.Razor.Test (8)
DependencyInjection\MvcRazorMvcBuilderExtensionsTest.cs (4)
28var activatorDescriptor = Assert.Single(services.ToList(), d => d.ServiceType == typeof(ITagHelperActivator)); 54var tagHelperOne = Assert.Single(collection, t => t.ServiceType == typeof(TestTagHelperOne)); 58var tagHelperTwo = Assert.Single(collection, t => t.ServiceType == typeof(TestTagHelperTwo)); 62var activator = Assert.Single(collection, t => t.ServiceType == typeof(ITagHelperActivator));
DependencyInjection\MvcRazorMvcCoreBuilderExtensionsTest.cs (4)
68var activatorDescriptor = Assert.Single(services.ToList(), d => d.ServiceType == typeof(ITagHelperActivator)); 94var tagHelperOne = Assert.Single(collection, t => t.ServiceType == typeof(TestTagHelperOne)); 98var tagHelperTwo = Assert.Single(collection, t => t.ServiceType == typeof(TestTagHelperTwo)); 102var activator = Assert.Single(collection, t => t.ServiceType == typeof(ITagHelperActivator));
Microsoft.AspNetCore.Mvc.TagHelpers.Test (41)
AnchorTagHelperTest.cs (2)
79var attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("id")); 81attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("href"));
FormTagHelperTest.cs (12)
115var attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("method")); 117attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("action")); 169var attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("method")); 171attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("action")); 227var attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("action")); 285var attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("action")); 357var attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("id")); 359attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("method")); 361attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("action")); 472var routeValue = Assert.Single(routeValueDictionary, attr => attr.Key.Equals("val")); 474routeValue = Assert.Single(routeValueDictionary, attr => attr.Key.Equals("-Name")); 619var attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("action"));
ImageTagHelperTest.cs (4)
160var srcAttribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("src")); 212var srcAttribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("src")); 255var srcAttribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("src")); 287var srcAttribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("src"));
SelectTagHelperTest.cs (5)
246Assert.Single( 345Assert.Single( 525Assert.Single( 619var keyValuePair = Assert.Single( 695var keyValuePair = Assert.Single(
TagHelperOutputExtensionsTest.cs (9)
914var attribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("class")); 916attribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("class2")); 963var attribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("class")); 965attribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("for")); 986var classAttribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("class")); 1008var classAttribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("class")); 1034var classAttribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("class")); 1100var classAttribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("class")); 1144var classAttribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("class"));
ValidationMessageTagHelperTest.cs (8)
74var attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("id")); 76attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("class")); 78attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("data-valmsg-for")); 80attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("data-valmsg-replace")); 347var attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("data-foo")); 349attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("data-hello")); 409var attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("data-foo")); 411attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("data-hello"));
ValidationSummaryTagHelperTest.cs (1)
255var attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("class"));
Microsoft.AspNetCore.Mvc.Test (9)
MvcServiceCollectionExtensionsTest.cs (9)
310var descriptor = Assert.Single(services, d => d.ServiceType == typeof(ApplicationPartManager)); 316Assert.Single(manager.ApplicationParts.OfType<AssemblyPart>(), p => p.Assembly == mvcRazorAssembly); 317Assert.Single(manager.ApplicationParts.OfType<AssemblyPart>(), p => p.Assembly == mvcTagHelpersAssembly); 338var descriptor = Assert.Single(services, d => d.ServiceType == typeof(ApplicationPartManager)); 344Assert.Single(manager.ApplicationParts.OfType<AssemblyPart>(), p => p.Assembly == mvcRazorAssembly); 345Assert.Single(manager.ApplicationParts.OfType<AssemblyPart>(), p => p.Assembly == mvcTagHelpersAssembly); 364var descriptor = Assert.Single(services, d => d.ServiceType == typeof(ApplicationPartManager)); 388var descriptor = Assert.Single(services, d => d.ServiceType == typeof(ApplicationPartManager)); 436var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider));
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (30)
DefaultHtmlGeneratorTest.cs (8)
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"); 326var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "maxlength"); 486var attribute = Assert.Single(tagBuilder.Attributes, a => a.Key == "data-valmsg-for");
DependencyInjection\MvcViewFeaturesMvcBuilderExtensionsTest.cs (5)
45var descriptor = Assert.Single(builder.Services, item => item.ServiceType == typeof(ITempDataProvider)); 74var descriptor = Assert.Single(builder.Services, item => item.ServiceType == typeof(ITempDataProvider)); 88Assert.Single( 104var descriptor = Assert.Single(builder.Services, item => item.ServiceType == typeof(ITempDataProvider)); 119var descriptor = Assert.Single(builder.Services, item => item.ServiceType == typeof(ITempDataProvider));
DependencyInjection\MvcViewFeaturesMvcCoreBuilderExtensionsTest.cs (10)
23var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 38var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 69var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 84Assert.Single( 101var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 117var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 133var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 149var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 165var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider)); 181var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider));
ModelExplorerTest.cs (3)
51var baseProperty = Assert.Single(properties, p => p.Metadata.PropertyName == "Base1"); 56var derivedProperty = Assert.Single(properties, p => p.Metadata.PropertyName == "Derived1"); 75var baseProperty = Assert.Single(properties, p => p.Metadata.PropertyName == "Base1");
RemoteAttributeTest.cs (3)
95var resultName = Assert.Single( 113var resultName = Assert.Single( 133var resultName = Assert.Single(
Rendering\HtmlHelperSelectTest.cs (1)
1320var zeroSelect = Assert.Single(result, s => s.Value.Equals("0", StringComparison.Ordinal));
Microsoft.AspNetCore.Owin.Tests (1)
OwinExtensionTests.cs (1)
145var value = Assert.Single(
Microsoft.AspNetCore.Routing.Tests (10)
RouteConstraintBuilderTest.cs (2)
145Assert.Single(compositeConstraint.Constraints, c => c is MinLengthRouteConstraint); 146Assert.Single(compositeConstraint.Constraints, c => c is AlphaRouteConstraint);
RouteTest.cs (3)
326Assert.Single(compositeConstraint.Constraints, c => c is IntRouteConstraint); 327Assert.Single(compositeConstraint.Constraints, c => c is RangeRouteConstraint); 448Assert.Single(route.DataTokens, kvp => kvp.Key == "culture" && ((string)kvp.Value) == "en-CA");
Tree\TreeRouterTest.cs (5)
167var data = Assert.Single(context.RouteData.Values, v => v.Key == entry.Key); 219var data = Assert.Single(context.RouteData.Values, v => v.Key == entry.Key); 262var data = Assert.Single(context.RouteData.Values, v => v.Key == entry.Key); 1808Assert.Single(nestedValues, kvp => kvp.Key == "test_route_group"); 1850Assert.Single(nestedValues, kvp => kvp.Key == "test_route_group");
Microsoft.AspNetCore.Shared.Tests (1)
PropertyActivatorTest.cs (1)
115Assert.Single(propertiesToActivate, p => p.PropertyInfo == expectedPropertyInfo);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (14)
Interactive\NavigateTo\InteractiveNavigateToTests.cs (2)
589Assert.Single((await _aggregator.GetItemsAsync("Goo")), x => x.Kind != "Method"); 593Assert.Single((await _aggregator.GetItemsAsync("Goo")), x => x.Kind != "Method");
NavigateTo\NavigateToTests.cs (12)
981Assert.Single((await _aggregator.GetItemsAsync("Goo")), x => x.Kind != "Method"); 985Assert.Single((await _aggregator.GetItemsAsync("Goo")), x => x.Kind != "Method"); 1760Assert.Single(items, i => i.SecondarySort.StartsWith("0000") && IsFromFile(i, "File1.cs")); 1761Assert.Single(items, i => i.SecondarySort.StartsWith("0001") && IsFromFile(i, "File2.cs")); 1805Assert.Single(items, i => i.SecondarySort.StartsWith("0000") && IsFromFile(i, "File1.cs")); 1806Assert.Single(items, i => i.SecondarySort.StartsWith("0001") && IsFromFile(i, "File2.cs")); 1850Assert.Single(items, i => i.SecondarySort.StartsWith("0000") && IsFromFile(i, "File1.cs")); 1851Assert.Single(items, i => i.SecondarySort.StartsWith("0002") && IsFromFile(i, "File2.cs")); 1895Assert.Single(items, i => i.SecondarySort.StartsWith("0000") && IsFromFile(i, "File1.cs")); 1896Assert.Single(items, i => i.SecondarySort.StartsWith("0002") && IsFromFile(i, "File2.cs")); 1940Assert.Single(items, i => i.SecondarySort.StartsWith("0000") && IsFromFile(i, "File1.cs")); 1941Assert.Single(items, i => i.SecondarySort.StartsWith("0003") && IsFromFile(i, "File2.cs"));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
SymbolFinder\DependentTypeFinderTests.cs (2)
584Assert.Single(delegates, i => i.Locations.Any(loc => loc.IsInSource)); // We should find a single source delegate 614Assert.Single(enums, i => i.Locations.Any(loc => loc.IsInSource)); // We should find a single source type
Microsoft.CodeAnalysis.UnitTests (1)
AnalyzerAssemblyLoaderTests.cs (1)
1461Assert.Single(AppDomain.CurrentDomain.GetAssemblies(), x => x.FullName == assembly.FullName);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
VisualStudioMSBuildWorkspaceTests.cs (2)
103Assert.Single(projectInfo.Documents, d => d.Name == "CSharpClass.cs"); 3243var analyzerConfigDocument = Assert.Single(project.AnalyzerConfigDocuments, d => d.FilePath == expectedEditorConfigPath);
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
CommandLineProject\CommandLineProjectTests.cs (2)
180Assert.Single(info.MetadataReferences.OfType<PortableExecutableReference>(), r => r.FilePath == pathToAssembly); 192Assert.Single(info.MetadataReferences.OfType<PortableExecutableReference>(), r => r.FilePath == pathToAssembly);
SolutionTests\SolutionTests.cs (1)
5698Assert.Single(frozenCompilation2.References, r => r is CompilationReference c && c.Compilation == frozenCompilation1);
Microsoft.DotNet.Build.Tasks.Feed.Tests (1)
PublishToSymbolServerTest.cs (1)
179Assert.Single(buildEngine.BuildMessageEvents, x => x.Message.StartsWith("Would register request"));
Microsoft.DotNet.NuGetRepack.Tests (1)
VersionUpdaterTests.cs (1)
176Assert.Single(Directory.EnumerateFiles(outputDir), fullPath => Path.GetFileNameWithoutExtension(fullPath) == "TestPackageB.1.0.0");
Microsoft.DotNet.XUnitAssert.Tests (8)
CollectionAssertsTests.cs (8)
2501 Assert.Throws<ArgumentNullException>("collection", () => Assert.Single(default(IEnumerable<object>)!, _ => true)); 2502 Assert.Throws<ArgumentNullException>("predicate", () => Assert.Single(new object[0], null!)); 2510 var result = Assert.Single(collection, item => item.StartsWith("H")); 2520 var ex = Record.Exception(() => Assert.Single(collection, item => false)); 2536 var ex = Record.Exception(() => Assert.Single(collection, item => true)); 2553 var ex = Record.Exception(() => Assert.Single(collection, item => item == 4)); 2570 var value = Assert.Single(collection, c => c != 'Q'); 2580 var ex = Record.Exception(() => Assert.Single(collection, c => c == 'Q'));
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Logging\AcceptanceTests.cs (2)
51var nullEnricher = Assert.Single(enrichers, x => x is null); 54var enricher = Assert.Single(enrichers, x => x is not null);
Microsoft.Extensions.Http.Polly.Tests (6)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (6)
518Assert.Single(serviceCollection, sd => sd.ServiceType == typeof(IPolicyRegistry<string>)); 519Assert.Single(serviceCollection, sd => sd.ServiceType == typeof(IReadOnlyPolicyRegistry<string>)); 520Assert.Single(serviceCollection, sd => sd.ServiceType == typeof(IConcurrentPolicyRegistry<string>)); 549Assert.Single(serviceCollection, sd => sd.ServiceType == typeof(IPolicyRegistry<string>)); 550Assert.Single(serviceCollection, sd => sd.ServiceType == typeof(IReadOnlyPolicyRegistry<string>)); 551Assert.Single(serviceCollection, sd => sd.ServiceType == typeof(IConcurrentPolicyRegistry<string>));
xunit.assert (1)
AsyncCollectionAsserts.cs (1)
467 Single(AssertHelper.ToEnumerable(collection), predicate);