930 references to Single
Aspire.Hosting.Elasticsearch.Tests (4)
Aspire.Hosting.Kafka.Tests (3)
Aspire.Hosting.PostgreSQL.Tests (1)
Aspire.Hosting.Redis.Tests (1)
Aspire.Hosting.Tests (6)
IIS.FunctionalTests (2)
IIS.Tests (3)
IISExpress.FunctionalTests (2)
InMemory.FunctionalTests (12)
Microsoft.AspNetCore.Authentication.Test (12)
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)
Microsoft.AspNetCore.Components.Tests (4)
Microsoft.AspNetCore.Components.WebAssembly.Tests (1)
Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests (1)
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)
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)
Microsoft.AspNetCore.Identity.FunctionalTests (3)
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\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");
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);
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");
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;
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;
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)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (3)
Microsoft.AspNetCore.Mvc.Razor.Test (8)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (41)
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"));
Microsoft.AspNetCore.Mvc.Test (9)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (30)
Microsoft.AspNetCore.Owin.Tests (1)
Microsoft.AspNetCore.Routing.Tests (10)
Microsoft.AspNetCore.Shared.Tests (1)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (14)
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)
Microsoft.CodeAnalysis.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
Microsoft.DotNet.Build.Tasks.Feed.Tests (1)
Microsoft.DotNet.NuGetRepack.Tests (1)
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)
Microsoft.Extensions.Http.Polly.Tests (6)
xunit.assert (1)