201 references to GetValues
Aspire.Dashboard.Tests (16)
Integration\OtlpCorsHttpServiceTests.cs (9)
64Assert.Equal("http://localhost:8000", responseMessage1.Headers.GetValues("Access-Control-Allow-Origin").Single()); 65Assert.Equal("POST", responseMessage1.Headers.GetValues("Access-Control-Allow-Methods").Single()); 66Assert.Equal("X-Requested-With", responseMessage1.Headers.GetValues("Access-Control-Allow-Headers").Single()); 78Assert.Equal("http://localhost:8001", responseMessage2.Headers.GetValues("Access-Control-Allow-Origin").Single()); 79Assert.Equal("POST", responseMessage2.Headers.GetValues("Access-Control-Allow-Methods").Single()); 80Assert.Equal("X-Requested-With", responseMessage2.Headers.GetValues("Access-Control-Allow-Headers").Single()); 133Assert.Equal("*", responseMessage.Headers.GetValues("Access-Control-Allow-Origin").Single()); 134Assert.Equal("POST", responseMessage.Headers.GetValues("Access-Control-Allow-Methods").Single()); 135Assert.Equal("x-requested-with,x-custom,Content-Type", responseMessage.Headers.GetValues("Access-Control-Allow-Headers").Single());
Integration\OtlpHttpServiceTests.cs (5)
53Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single()); 179Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single()); 294Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single()); 323Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single()); 352Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single());
Integration\StartupTests.cs (2)
412Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single()); 697Assert.NotEmpty(response.Headers.GetValues(HeaderNames.ContentSecurityPolicy).Single());
IIS.FunctionalTests (12)
Http2TrailersResetTests.cs (8)
76Assert.Equal("TrailerValue", response.TrailingHeaders.GetValues("TrailerName").Single()); 89Assert.Equal("Trailer Value", response.TrailingHeaders.GetValues("TrailerName").Single()); 104Assert.Equal("Trailer Value", response.TrailingHeaders.GetValues("TrailerName").Single()); 122Assert.Equal("Trailer Value", response.TrailingHeaders.GetValues("TrailerName").Single()); 141Assert.Equal("Trailer Value", response.TrailingHeaders.GetValues("TrailerName").Single()); 154Assert.Equal(new[] { "TrailerValue0", "TrailerValue1" }, response.TrailingHeaders.GetValues("TrailerName")); 167Assert.Equal("TrailerValue", response.TrailingHeaders.GetValues("TrailerName").Single()); 184Assert.Equal("Trailer Value", response.TrailingHeaders.GetValues("TrailerName").Single());
Http3Tests.cs (3)
73Assert.Equal(altsvc, response1.Headers.GetValues(HeaderNames.AltSvc).SingleOrDefault()); 94Assert.Equal(altsvc, response2.Headers.GetValues(HeaderNames.AltSvc).SingleOrDefault()); 113Assert.Equal("value", response.TrailingHeaders.GetValues("custom").SingleOrDefault());
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (1)
213Assert.Equal(body, response.Headers.GetValues("BodyAsString").Single());
IISExpress.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (1)
213Assert.Equal(body, response.Headers.GetValues("BodyAsString").Single());
Interop.FunctionalTests (8)
Http2\Http2RequestTests.cs (3)
191Assert.Equal("abc", response.Headers.GetValues("test").Single()); 192Assert.Equal(longValue, response.Headers.GetValues(longKey).Single()); 286Assert.Equal("value!", trailers.GetValues("test-trailer").Single());
Http3\Http3RequestTests.cs (1)
1387var value = response.TrailingHeaders.GetValues($"trailer-{i}").Single();
HttpClientHttp2InteropTests.cs (4)
539Assert.Equal("TestValue", response.TrailingHeaders.GetValues("TestTrailer").Single()); 576Assert.Equal("TestValue", response.TrailingHeaders.GetValues("TestTrailer").Single()); 688Assert.Equal("TestValue", response.TrailingHeaders.GetValues("TestTrailer").Single()); 1113Assert.Equal(oneKbString + i, response.Headers.GetValues("header" + i).Single());
Microsoft.AspNetCore.Authentication.Test (37)
CookieTests.cs (5)
51var responded = transaction.Response.Headers.GetValues("Location"); 63var responded = transaction.Response.Headers.GetValues("Location"); 75var responded = transaction.Response.Headers.GetValues("Location"); 87var responded = transaction.Response.Headers.GetValues("Location"); 1917transaction.SetCookie = transaction.Response.Headers.GetValues("Set-Cookie").SingleOrDefault();
FacebookTests.cs (2)
367Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 449Assert.Equal("/challenge", transaction.Response.Headers.GetValues("Location").First());
GoogleTests.cs (16)
402Assert.Equal("/error?FailureMessage=AccessDenied", transaction.Response.Headers.GetValues("Location").First()); 438Assert.Equal("https://example.com/custom-denied-page?rurl=http%3A%2F%2Fwww.google.com%2F", transaction.Response.Headers.GetValues("Location").First()); 481Assert.StartsWith("/error?FailureMessage=", transaction.Response.Headers.GetValues("Location").First()); 520Assert.Equal("/error?FailureMessage=itfailed" + UrlEncoder.Default.Encode(";Description=whyitfailed;Uri=https://example.com/fail"), transaction.Response.Headers.GetValues("Location").First()); 559Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 630transaction.Response.Headers.GetValues("Location").First()); 682transaction.Response.Headers.GetValues("Location").First()); 722Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 762Assert.Equal("/", transaction.Response.Headers.GetValues("Location").First()); 810Assert.Equal("/foo", transaction.Response.Headers.GetValues("Location").First()); 854transaction.Response.Headers.GetValues("Location").First()); 883Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 927Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 971Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 1008Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 1082Assert.Equal("/challenge", transaction.Response.Headers.GetValues("Location").First());
MicrosoftAccountTests.cs (2)
244Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 349Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First());
OpenIdConnect\OpenIdConnectAuthenticateTests.cs (1)
100Assert.StartsWith("/error?FailureMessage=", transaction.Response.Headers.GetValues("Location").First());
OpenIdConnect\OpenIdConnectChallengeTests.cs (1)
391Assert.Equal("Oolong", res.Headers.GetValues("tea").Single());
OpenIdConnect\TestServerExtensions.cs (1)
37transaction.SetCookie = transaction.Response.Headers.GetValues("Set-Cookie").ToList();
TestExtensions.cs (1)
32transaction.SetCookie = transaction.Response.Headers.GetValues("Set-Cookie").ToList();
TwitterTests.cs (2)
432Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 511Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First());
WsFederation\WsFederationTest.cs (3)
194var cookie = response.Headers.GetValues(HeaderNames.SetCookie).Single(); 196Assert.Equal("OnRemoteSignOut", response.Headers.GetValues("EventHeader").Single()); 264var cookies = SetCookieHeaderValue.ParseList(response.Headers.GetValues(HeaderNames.SetCookie).ToList());
WsFederation\WsFederationTest_Handler.cs (3)
192var cookie = response.Headers.GetValues(HeaderNames.SetCookie).Single(); 194Assert.Equal("OnRemoteSignOut", response.Headers.GetValues("EventHeader").Single()); 262var cookies = SetCookieHeaderValue.ParseList(response.Headers.GetValues(HeaderNames.SetCookie).ToList());
Microsoft.AspNetCore.CookiePolicy.Test (1)
TestExtensions.cs (1)
29transaction.SetCookie = transaction.Response.Headers.GetValues("Set-Cookie").ToList();
Microsoft.AspNetCore.Cors.Test (4)
CorsMiddlewareTests.cs (4)
59Assert.Equal(OriginUrl, response.Headers.GetValues(CorsConstants.AccessControlAllowOrigin).FirstOrDefault()); 101Assert.Equal(OriginUrl, response.Headers.GetValues(CorsConstants.AccessControlAllowOrigin).FirstOrDefault()); 102Assert.Equal("AllowedHeader", response.Headers.GetValues(CorsConstants.AccessControlExposeHeaders).FirstOrDefault()); 151Assert.Equal(OriginUrl, response.Headers.GetValues(CorsConstants.AccessControlAllowOrigin).FirstOrDefault());
Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests (1)
HealthCheckMiddlewareTests.cs (1)
434Assert.Equal(new string[] { "Thu, 01 Jan 1970 00:00:00 GMT" }, response.Content.Headers.GetValues(HeaderNames.Expires));
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
Latency\ChecpointAcceptanceTests.cs (2)
111.GetValues("Server-Timing") 129var timeHeaders = response.Headers.GetValues("Server-Timing").ToArray();
Microsoft.AspNetCore.HeaderPropagation.Tests (17)
HeaderPropagationIntegrationTest.cs (4)
118Assert.Equal(new[] { "test" }, handler.Headers.GetValues("out")); 145Assert.Equal(new[] { "value" }, handler.Headers.GetValues("first")); 147Assert.Equal(new[] { "other" }, handler.Headers.GetValues("second")); 191Assert.Equal(new[] { "test" }, handler.Headers.GetValues("different"));
HeaderPropagationMessageHandlerTest.cs (13)
50Assert.Equal(new[] { "test" }, Handler.Headers.GetValues("out")); 65Assert.Equal(new[] { "one", "two" }, Handler.Headers.GetValues("out")); 79Assert.Equal(new[] { "text/plain; charset=utf-8" }, Handler.Content.Headers.GetValues("Content-Type")); 93Assert.Equal(new[] { "test" }, Handler.Content.Headers.GetValues("Content-Language")); 107Assert.Equal(new[] { "one", "two" }, Handler.Content.Headers.GetValues("Content-Language")); 122Assert.Equal(new[] { "test" }, Handler.Headers.GetValues("out")); 166Assert.Equal(new[] { "test" }, Handler.Headers.GetValues("inout")); 167Assert.Equal(new[] { "test2" }, Handler.Headers.GetValues("another")); 205Assert.Equal(expectedValues, Handler.Headers.GetValues("inout")); 221Assert.Equal(new[] { "value" }, Handler.Headers.GetValues("name")); 237Assert.Equal(new[] { "value" }, Handler.Headers.GetValues("name")); 239Assert.Equal(new[] { "value" }, Handler.Headers.GetValues("name")); 256Assert.Equal(new[] { "value" }, Handler.Headers.GetValues("name"));
Microsoft.AspNetCore.Http.Extensions.Tests (2)
HttpResponseJsonExtensionsTests.cs (2)
514var headerValue = Assert.Single(result.Headers.GetValues("Test")); 546var headerValue = Assert.Single(result.Headers.GetValues("Test"));
Microsoft.AspNetCore.HttpsPolicy.Tests (4)
HstsMiddlewareTests.cs (3)
71Assert.Equal("max-age=2592000", response.Headers.GetValues(HeaderNames.StrictTransportSecurity).FirstOrDefault()); 117Assert.Equal(expected, response.Headers.GetValues(HeaderNames.StrictTransportSecurity).FirstOrDefault()); 163Assert.Equal(expected, response.Headers.GetValues(HeaderNames.StrictTransportSecurity).FirstOrDefault());
HttpsPolicyTests.cs (1)
77Assert.Equal(expectedHstsHeader, response.Headers.GetValues(HeaderNames.StrictTransportSecurity).FirstOrDefault());
Microsoft.AspNetCore.Identity.InMemory.Test (1)
FunctionalTest.cs (1)
446transaction.SetCookie = transaction.Response.Headers.GetValues("Set-Cookie").FirstOrDefault();
Microsoft.AspNetCore.Mvc.FunctionalTests (32)
AntiforgeryTestHelper.cs (1)
24var setCookieArray = response.Headers.GetValues("Set-Cookie").ToArray();
AntiforgeryTests.cs (6)
38var header = Assert.Single(response.Headers.GetValues("X-Frame-Options")); 41var setCookieHeader = response.Headers.GetValues("Set-Cookie").ToArray(); 93var header = Assert.Single(response.Headers.GetValues("X-Frame-Options")); 96var setCookieHeader = response.Headers.GetValues("Set-Cookie").ToArray(); 172var header = Assert.Single(response.Headers.GetValues("X-Frame-Options")); 175var setCookieHeader = response.Headers.GetValues("Set-Cookie").ToArray();
AuthMiddlewareAndFilterTestBase.cs (1)
283return response.Headers.GetValues("Set-Cookie").FirstOrDefault();
AuthMiddlewareUsingRequireAuthTest.cs (1)
85return response.Headers.GetValues("Set-Cookie").FirstOrDefault();
BasicTests.cs (1)
165Assert.Equal("Hello, World!", Assert.Single(response.Headers.GetValues("Message")));
CorsTestsBase.cs (14)
170responseHeaders.GetValues(CorsConstants.AccessControlAllowOrigin).ToArray()); 173responseHeaders.GetValues(CorsConstants.AccessControlAllowCredentials).ToArray()); 176responseHeaders.GetValues(CorsConstants.AccessControlExposeHeaders).ToArray()); 203responseHeaders.GetValues(CorsConstants.AccessControlAllowOrigin).ToArray()); 206responseHeaders.GetValues(CorsConstants.AccessControlAllowCredentials).ToArray()); 209responseHeaders.GetValues(CorsConstants.AccessControlAllowHeaders).ToArray()); 212responseHeaders.GetValues(CorsConstants.AccessControlAllowMethods).ToArray()); 313responseHeaders.GetValues(CorsConstants.AccessControlAllowOrigin).ToArray()); 316responseHeaders.GetValues(CorsConstants.AccessControlAllowHeaders).ToArray()); 319responseHeaders.GetValues(CorsConstants.AccessControlAllowMethods).ToArray()); 345responseHeaders.GetValues(CorsConstants.AccessControlAllowOrigin).ToArray()); 348responseHeaders.GetValues(CorsConstants.AccessControlAllowCredentials).ToArray()); 351responseHeaders.GetValues(CorsConstants.AccessControlAllowHeaders).ToArray()); 354responseHeaders.GetValues(CorsConstants.AccessControlAllowMethods).ToArray());
FiltersTest.cs (1)
125Assert.Equal(new[] { "True" }, response.Headers.GetValues("X-ServiceActionFilter"));
GlobalAuthorizationFilterTestBase.cs (1)
71var cookie2 = response.Headers.GetValues("Set-Cookie").SingleOrDefault();
RazorPagesTest.cs (1)
1513var setCookie = response.Headers.GetValues("Set-Cookie").ToArray();
RazorPagesWithBasePathTest.cs (2)
749Assert.Equal(new[] { "PageModelFilterValue" }, response.Headers.GetValues("PageModelFilterKey")); 750Assert.Equal(new[] { "PageFilterValue" }, response.Headers.GetValues("PageFilterKey"));
SystemTextJsonOutputFormatterTest.cs (1)
82var headerValue = Assert.Single(response.Headers.GetValues("Test"));
TestingInfrastructureTests.cs (2)
65var xPassThruValue = Assert.Single(response.Headers.GetValues("X-Pass-Thru")); 88var xPassThruValue = Assert.Single(response.Headers.GetValues("X-Pass-Thru"));
Microsoft.AspNetCore.OutputCaching.Tests (4)
OutputCacheTests.cs (4)
1056Assert.Equal(initialResponse.Headers.GetValues(header.Key), subsequentResponse.Headers.GetValues(header.Key)); 1073Assert.NotEqual(initialResponse.Headers.GetValues("X-Value"), subsequentResponse.Headers.GetValues("X-Value"));
Microsoft.AspNetCore.ResponseCaching.Tests (4)
ResponseCachingTests.cs (4)
960Assert.Equal(initialResponse.Headers.GetValues(header.Key), subsequentResponse.Headers.GetValues(header.Key)); 977Assert.NotEqual(initialResponse.Headers.GetValues("X-Value"), subsequentResponse.Headers.GetValues("X-Value"));
Microsoft.AspNetCore.ResponseCompression.Tests (3)
ResponseCompressionMiddlewareTest.cs (3)
1292foreach (var value in response.Headers.GetValues(HeaderNames.Vary)) 1311foreach (var value in response.Headers.GetValues(HeaderNames.Vary)) 1325Assert.NotNull(response.Content.Headers.GetValues(HeaderNames.ContentMD5));
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (29)
Http3Tests.cs (3)
81Assert.Equal(altsvc, response1.Headers.GetValues(HeaderNames.AltSvc).SingleOrDefault()); 118Assert.Equal(altsvc, response2.Headers.GetValues(HeaderNames.AltSvc).SingleOrDefault()); 152Assert.Equal("value", response.TrailingHeaders.GetValues("custom").SingleOrDefault());
ResponseCachingTests.cs (2)
480return response.Headers.GetValues("x-request-count").FirstOrDefault(); 491return response.Headers.GetValues("x-request-count").FirstOrDefault();
ResponseHeaderTests.cs (14)
152Assert.Equal(new string[] { "close" }, response.Headers.GetValues("Connection")); 178Assert.Equal(new string[] { "close" }, response.Headers.GetValues("Connection")); 207Assert.Equal(new string[] { "close" }, response.Headers.GetValues("Connection")); 237Assert.Equal(2, response.Headers.GetValues("Custom1").Count()); 238Assert.Equal("value1a", response.Headers.GetValues("Custom1").First()); 239Assert.Equal("value1b", response.Headers.GetValues("Custom1").Skip(1).First()); 240Assert.Single(response.Headers.GetValues("Custom2")); 241Assert.Equal("value2a, value2b", response.Headers.GetValues("Custom2").First()); 267Assert.Equal(2, response.Headers.GetValues("Custom1").Count()); 268Assert.Equal("value1a", response.Headers.GetValues("Custom1").First()); 269Assert.Equal("value1b", response.Headers.GetValues("Custom1").Skip(1).First()); 270Assert.Single(response.Headers.GetValues("Custom2")); 271Assert.Equal("value2a, value2b", response.Headers.GetValues("Custom2").First()); 297Assert.Equal(headers.GetValues(headerName), expectedValue);
ResponseTrailersTests.cs (10)
93Assert.Equal("TrailerValue", response.TrailingHeaders.GetValues("TrailerName").Single()); 112Assert.Equal("Trailer Value", response.TrailingHeaders.GetValues("TrailerName").Single()); 140Assert.Equal(body.Length.ToString(CultureInfo.InvariantCulture), response.Content.Headers.GetValues(HeaderNames.ContentLength).Single()); 168Assert.Equal("Trailer Value", response.TrailingHeaders.GetValues("TrailerName").Single()); 194Assert.Equal("Trailer Value", response.TrailingHeaders.GetValues("TrailerName").Single()); 239Assert.Equal("TrailerValue", response.TrailingHeaders.GetValues("TrailerName").Single()); 262Assert.Equal("Trailer Value", response.TrailingHeaders.GetValues("TrailerName").Single()); 283Assert.Equal(new[] { "TrailerValue0", "TrailerValue1" }, response.TrailingHeaders.GetValues("TrailerName")); 311Assert.Equal(values, response.TrailingHeaders.GetValues("ThisIsALongerHeaderNameThatStillWorksForReals")); 336Assert.Equal(headers.GetValues(headerName), expectedValue);
Microsoft.AspNetCore.Session.Tests (5)
SessionTests.cs (5)
203var cookie = SetCookieHeaderValue.ParseList(response.Headers.GetValues("Set-Cookie").ToList()).First(); 263var cookie = SetCookieHeaderValue.ParseList(response.Headers.GetValues("Set-Cookie").ToList()).First(); 321var cookie = SetCookieHeaderValue.ParseList(response.Headers.GetValues("Set-Cookie").ToList()).First(); 425var cookie = SetCookieHeaderValue.ParseList(response.Headers.GetValues("Set-Cookie").ToList()).First(); 494var cookie = SetCookieHeaderValue.ParseList(response.Headers.GetValues("Set-Cookie").ToList()).First();
Microsoft.AspNetCore.SignalR.Client.Tests (1)
HttpConnectionTests.Transport.cs (1)
167var requestedWithHeader = request.Headers.GetValues(HeaderNames.XRequestedWith);
Microsoft.AspNetCore.StaticFiles.Tests (2)
DefaultFilesMiddlewareTests.cs (1)
267var actualURL = response.Headers.GetValues("Location").FirstOrDefault();
DirectoryBrowserMiddlewareTests.cs (1)
272Assert.Equal("http://localhost" + requestUrl + "/" + queryString, response.Headers.GetValues("Location").FirstOrDefault());
Microsoft.AspNetCore.TestHost.Tests (10)
ClientHandlerTests.cs (8)
364Assert.Equal("TestValue:1", response.Headers.GetValues("TestHeader").First()); 367Assert.Equal("TestValue:2", response.Headers.GetValues("TestHeader").First()); 380Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First()); 416Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First()); 435Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First()); 453Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First()); 475Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First()); 534Assert.Equal("TestValue", response.Headers.GetValues("TestHeader").First());
TestClientTests.cs (2)
438Assert.Equal("true", response.Headers.GetValues("test-header").Single()); 485Assert.Equal("true", response.Headers.GetValues("test-header").Single());
Microsoft.AspNetCore.WebSockets.Tests (2)
WebSocketCompressionMiddlewareTests.cs (2)
41Assert.Equal("permessage-deflate; server_no_context_takeover", response.Headers.GetValues(HeaderNames.SecWebSocketExtensions).Aggregate((l, r) => $"{l}; {r}")); 103Assert.Equal(expectedResponse, response.Headers.GetValues(HeaderNames.SecWebSocketExtensions).Aggregate((l, r) => $"{l}; {r}"));
Microsoft.Extensions.ML (2)
ModelLoaders\UriModelLoader.cs (2)
112return resp.Headers.GetValues(ETagHeader).First() == eTag; 151_eTag = resp.Headers.GetValues(ETagHeader).First();
Sockets.FunctionalTests (1)
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (1)
139Assert.Equal(headers.GetValues(headerName).Single(), expectedValue);