Base:
property
Response
Microsoft.AspNetCore.Http.HttpContext.Response
26 writes to Response
Microsoft.AspNetCore.Http.Extensions.Tests (7)
ProblemDetailsDefaultWriterTest.cs (1)
680Response = { Body = body, StatusCode = statusCode },
ProblemDetailsServiceTest.cs (6)
26Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest }, 52Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest }, 71Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest }, 87Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest }, 102Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest }, 122Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest },
Microsoft.AspNetCore.Http.Results.Tests (18)
BadRequestOfTResultTests.cs (1)
71Response =
ConflictOfTResultTests.cs (1)
70Response =
HttpResultsHelperTests.cs (1)
236Response =
InternalServerErrorOfTResultTests.cs (1)
71Response =
JsonResultTests.cs (5)
62Response = 90Response = 123Response = 152Response = 184Response =
OkOfTResultTests.cs (1)
52Response =
ProblemResultTests.cs (5)
26Response = 58Response = 87Response = 119Response = 151Response =
UnprocessableEntityOfTResultTests.cs (1)
69Response =
ValidationProblemResultTests.cs (2)
29Response = 62Response =
Microsoft.AspNetCore.Mvc.Core.Test (1)
Infrastructure\DefaultApiProblemDetailsWriterTest.cs (1)
207Response = { Body = body, StatusCode = statusCode },
616 references to Response
Aspire.Dashboard.Tests (7)
BrowserSecurityHeadersMiddlewareTests.cs (7)
28Assert.NotEqual(StringValues.Empty, httpContext.Response.Headers.ContentSecurityPolicy); 29Assert.DoesNotContain("default-src", httpContext.Response.Headers.ContentSecurityPolicy.ToString()); 43Assert.NotEqual(StringValues.Empty, httpContext.Response.Headers.ContentSecurityPolicy); 44Assert.Contains("default-src", httpContext.Response.Headers.ContentSecurityPolicy.ToString()); 61Assert.NotEqual(StringValues.Empty, httpContext.Response.Headers.ContentSecurityPolicy); 62Assert.Contains(expectedContent, httpContext.Response.Headers.ContentSecurityPolicy.ToString()); 77Assert.Equal(StringValues.Empty, httpContext.Response.Headers.ContentSecurityPolicy);
HttpAbstractions.SampleApp (1)
Program.cs (1)
41var response = context.Response;
Microsoft.AspNetCore.Components.Endpoints.Tests (27)
EndpointHtmlRendererTest.cs (11)
807Assert.Equal(302, ctx.Response.StatusCode); 808Assert.Equal("http://localhost/redirect", ctx.Response.Headers.Location); 886httpContext.Response.Body = bodyStream; 899httpContext.Response.Body.Position = 0; 902Assert.Equal(400, httpContext.Response.StatusCode); 915httpContext.Response.Body = bodyStream; 928httpContext.Response.Body.Position = 0; 931Assert.Equal(400, httpContext.Response.StatusCode); 1008httpContext.Response.Body = bodyStream; 1042Assert.Equal(400, httpContext.Response.StatusCode); 1043httpContext.Response.Body.Position = 0;
RazorComponentEndpointInvokerTest.cs (1)
51Assert.Equal(StatusCodes.Status400BadRequest, context.Response.StatusCode);
RazorComponentResultTest.cs (15)
58httpContext.Response.Body = responseBody; 65Assert.Equal("text/html; charset=utf-8", httpContext.Response.ContentType); 66Assert.Equal(200, httpContext.Response.StatusCode); 80httpContext.Response.Body = responseBody; 87Assert.Equal("application/test-content-type", httpContext.Response.ContentType); 88Assert.Equal(123, httpContext.Response.StatusCode); 98httpContext.Response.Body = responseBody; 129httpContext.Response.Body = responseBody; 160httpContext.Response.Body = responseBody; 188httpContext.Response.Body = responseBody; 214httpContext.Response.Body = responseBody; 233Assert.Equal("https://test/somewhere/else", httpContext.Response.Headers.Location); 264httpContext.Response.Body = responseBody; 316httpContext.Response.Body = responseBody; 419httpContext.Response.Body = responseBody;
Microsoft.AspNetCore.Components.Server.Tests (7)
CircuitDisconnectMiddlewareTest.cs (7)
41Assert.Equal(StatusCodes.Status405MethodNotAllowed, context.Response.StatusCode); 70Assert.Equal(StatusCodes.Status400BadRequest, context.Response.StatusCode); 97Assert.Equal(StatusCodes.Status400BadRequest, context.Response.StatusCode); 129Assert.Equal(StatusCodes.Status400BadRequest, context.Response.StatusCode); 162Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 199Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 237Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode);
Microsoft.AspNetCore.Components.WebAssembly.Server.Tests (18)
ContentEncodingNegotiatorTests.cs (18)
29Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 31Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader)); 51Assert.False(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 52Assert.False(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader)); 72Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 74Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader)); 95Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 97Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader)); 118Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 120Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader)); 141Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 143Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader)); 164Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 166Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader)); 186Assert.False(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 187Assert.False(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader)); 207Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.ContentEncoding, out var selectedEncoding)); 209Assert.True(httpContext.Response.Headers.TryGetValue(HeaderNames.Vary, out var varyHeader));
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (2)
MiddlewareTests.cs (2)
45Assert.Equal(StatusCodes.Status503ServiceUnavailable, context.Response.StatusCode); 165Assert.Equal(StatusCodes.Status503ServiceUnavailable, context.Response.StatusCode);
Microsoft.AspNetCore.Cors.Test (39)
CorsMiddlewareTests.cs (4)
427Assert.Equal(200, httpContext.Response.StatusCode); 428Assert.Empty(httpContext.Response.Headers); 666var response = httpContext.Response; 765Assert.Equal(StatusCodes.Status204NoContent, httpContext.Response.StatusCode);
CorsServiceTests.cs (35)
570service.ApplyResult(result, httpContext.Response); 573Assert.Empty(httpContext.Response.Headers); 590service.ApplyResult(result, httpContext.Response); 593Assert.Equal("http://example.com", httpContext.Response.Headers["Access-Control-Allow-Origin"]); 610service.ApplyResult(result, httpContext.Response); 613Assert.DoesNotContain("Access-Control-Allow-Origin", httpContext.Response.Headers.Keys); 630service.ApplyResult(result, httpContext.Response); 633Assert.Equal("true", httpContext.Response.Headers["Access-Control-Allow-Credentials"]); 650service.ApplyResult(result, httpContext.Response); 653Assert.Equal("Origin", httpContext.Response.Headers["Vary"]); 667httpContext.Response.Headers["Vary"] = "Cookie"; 671service.ApplyResult(result, httpContext.Response); 674Assert.Equal("Cookie,Origin", httpContext.Response.Headers["Vary"]); 691service.ApplyResult(result, httpContext.Response); 694Assert.DoesNotContain("Access-Control-Allow-Credentials", httpContext.Response.Headers.Keys); 711service.ApplyResult(result, httpContext.Response); 714Assert.DoesNotContain("Access-Control-Allow-Methods", httpContext.Response.Headers.Keys); 732service.ApplyResult(result, httpContext.Response); 735Assert.Equal("PUT", httpContext.Response.Headers["Access-Control-Allow-Methods"]); 752service.ApplyResult(result, httpContext.Response); 755Assert.DoesNotContain("Access-Control-Allow-Headers", httpContext.Response.Headers.Keys); 773service.ApplyResult(result, httpContext.Response); 776Assert.Equal("foo", httpContext.Response.Headers["Access-Control-Allow-Headers"]); 793service.ApplyResult(result, httpContext.Response); 796Assert.DoesNotContain("Access-Control-Expose-Headers", httpContext.Response.Headers.Keys); 814service.ApplyResult(result, httpContext.Response); 817Assert.DoesNotContain("Access-Control-Expose-Headers", httpContext.Response.Headers.Keys); 835service.ApplyResult(result, httpContext.Response); 838Assert.Equal("foo,bar", httpContext.Response.Headers[CorsConstants.AccessControlExposeHeaders]); 855service.ApplyResult(result, httpContext.Response); 858Assert.Equal("foo", httpContext.Response.Headers["Access-Control-Expose-Headers"]); 876service.ApplyResult(result, httpContext.Response); 879Assert.DoesNotContain("Access-Control-Max-Age", httpContext.Response.Headers.Keys); 896service.ApplyResult(result, httpContext.Response); 899Assert.Equal("30", httpContext.Response.Headers["Access-Control-Max-Age"]);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (1)
Latency\AddServerTimingHeaderMiddlewareTests.cs (1)
45var header = context.Response.Headers[AddServerTimingHeaderMiddleware.ServerTimingHeaderName];
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (67)
Infrastructure\TestHelpers.cs (1)
29httpContext.Response.Body = bodyStream ?? new MemoryStream();
JsonTranscodingServerCallContextTests.cs (1)
66httpContext.Response.Body = new MemoryStream();
ServerStreamingServerCallHandlerTests.cs (4)
63Assert.Equal(200, httpContext.Response.StatusCode); 64Assert.Equal("application/json; charset=utf-8", httpContext.Response.ContentType); 244Assert.Equal(200, httpContext.Response.StatusCode); 245Assert.Equal("application/xml", httpContext.Response.ContentType);
UnaryServerCallHandlerTests.cs (61)
73Assert.Equal(200, httpContext.Response.StatusCode); 74Assert.Equal("application/json; charset=utf-8", httpContext.Response.ContentType); 80httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 81using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 118httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 119using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 149httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 150var sr = new StreamReader(httpContext.Response.Body); 178httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 179using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 715httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 716using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 745Assert.Equal(400, httpContext.Response.StatusCode); 747httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 748using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 783Assert.Equal(400, httpContext.Response.StatusCode); 785httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 786using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 812Assert.Equal(400, httpContext.Response.StatusCode); 815httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 816using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 837Assert.Equal(401, httpContext.Response.StatusCode); 839httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 840using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 862Assert.Equal(401, httpContext.Response.StatusCode); 864httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 865using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 929Assert.Equal(400, httpContext.Response.StatusCode); 931httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 932using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1007Assert.Equal(500, httpContext.Response.StatusCode); 1009httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 1010using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1049Assert.Equal(500, httpContext.Response.StatusCode); 1051httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 1052using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1079Assert.Equal(500, httpContext.Response.StatusCode); 1081httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 1082using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1108Assert.Equal(401, httpContext.Response.StatusCode); 1110httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 1111using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1150Assert.Equal(200, httpContext.Response.StatusCode); 1151Assert.Equal("application/json; charset=utf-8", httpContext.Response.ContentType); 1153httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 1154using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1204Assert.Equal(200, httpContext.Response.StatusCode); 1205Assert.Equal("application/json; charset=utf-8", httpContext.Response.ContentType); 1207httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 1208using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1234httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 1235using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1363Assert.Equal(200, httpContext.Response.StatusCode); 1364Assert.Equal("application/xml", httpContext.Response.ContentType); 1366httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 1367var responseXml = XDocument.Load(httpContext.Response.Body); 1471Assert.Equal(500, httpContext.Response.StatusCode); 1473httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 1474using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1734httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 1735using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
Microsoft.AspNetCore.Hosting.Tests (3)
WebHostBuilderTests.cs (3)
1519httpContext.Response.Body = new MemoryStream(); 1521httpContext.Response.Body.Seek(0, SeekOrigin.Begin); 1522var bodyText = new StreamReader(httpContext.Response.Body).ReadToEnd();
Microsoft.AspNetCore.Http (1)
DefaultHttpContext.cs (1)
247return HttpContextDebugFormatter.ContextToString(this, ReasonPhrases.GetReasonPhrase(Response.StatusCode));
Microsoft.AspNetCore.Http.Connections.Tests (122)
HttpConnectionDispatcherTests.cs (109)
68context.Response.Body = ms; 92context.Response.Body = ms; 118context.Response.Body = ms; 155context.Response.Body = ms; 183context.Response.Body = ms; 221context.Response.Body = responseBody; 270context.Response.Body = ms; 301context.Response.Body = strm; 320Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 326AssertResponseHasCacheHeaders(context.Response); 343context.Response.Body = strm; 361Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 381context.Response.Body = strm; 399Assert.Equal(StatusCodes.Status405MethodNotAllowed, context.Response.StatusCode); 420context.Response.Body = strm; 438Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 459context.Response.Body = strm; 522context.Response.Body = strm; 591context.Response.Body = responseBody; 730AssertResponseHasCacheHeaders(context.Response); 737AssertResponseHasCacheHeaders(pollContext.Response); 756context.Response.Body = responseBody; 791Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 803Assert.Equal("application/octet-stream", context.Response.ContentType); 854context.Response.Body = strm; 869Assert.Equal(StatusCodes.Status400BadRequest, context.Response.StatusCode); 875AssertResponseHasCacheHeaders(context.Response); 900context.Response.Body = responseBody; 915Assert.Equal(StatusCodes.Status400BadRequest, context.Response.StatusCode); 930context.Response.Body = strm; 943Assert.Equal(StatusCodes.Status400BadRequest, context.Response.StatusCode); 1017Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1049Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1076Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1080Assert.Equal(StatusCodes.Status204NoContent, context.Response.StatusCode); 1081AssertResponseHasCacheHeaders(context.Response); 1112Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1116Assert.Equal(StatusCodes.Status204NoContent, context.Response.StatusCode); 1117AssertResponseHasCacheHeaders(context.Response); 1148Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1155Assert.Equal(StatusCodes.Status204NoContent, context.Response.StatusCode); 1156AssertResponseHasCacheHeaders(context.Response); 1201Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1202AssertResponseHasCacheHeaders(context.Response); 1295context.Response.Body = new BlockingStream(sync); 1333context.Response.Body = new BlockingStream(sync, isSSE: true); 1457Assert.Equal(StatusCodes.Status409Conflict, context2.Response.StatusCode); 1515Assert.Equal(StatusCodes.Status204NoContent, context1.Response.StatusCode); 1516AssertResponseHasCacheHeaders(context1.Response); 1581Assert.Equal(StatusCodes.Status409Conflict, context1.Response.StatusCode); 1583AssertResponseHasCacheHeaders(context1.Response); 1587Assert.Equal(StatusCodes.Status409Conflict, context2.Response.StatusCode); 1589AssertResponseHasCacheHeaders(context2.Response); 1625Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 1629AssertResponseHasCacheHeaders(context.Response); 1665Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1697Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1726Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1738Assert.Equal(StatusCodes.Status204NoContent, context.Response.StatusCode); 1739AssertResponseHasCacheHeaders(context.Response); 1780Assert.Equal(StatusCodes.Status204NoContent, context1.Response.StatusCode); 1781Assert.Equal(string.Empty, GetContentAsString(context1.Response.Body)); 1782AssertResponseHasCacheHeaders(context1.Response); 1783Assert.Equal(StatusCodes.Status200OK, context2.Response.StatusCode); 1784Assert.Equal("Hello, World", GetContentAsString(context2.Response.Body)); 1785AssertResponseHasCacheHeaders(context2.Response); 1859Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1871Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1911Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 1923Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 2038deleteContext.Response.Body = ms; 2043Assert.Equal(StatusCodes.Status400BadRequest, deleteContext.Response.StatusCode); 2044Assert.Equal("text/plain", deleteContext.Response.ContentType); 2092Assert.Equal(StatusCodes.Status202Accepted, deleteContext.Response.StatusCode); 2093Assert.Equal("text/plain", deleteContext.Response.ContentType); 2134Assert.Equal(StatusCodes.Status202Accepted, deleteContext.Response.StatusCode); 2135Assert.Equal("text/plain", deleteContext.Response.ContentType); 2196Assert.Equal(StatusCodes.Status202Accepted, deleteContext.Response.StatusCode); 2197Assert.Equal("text/plain", deleteContext.Response.ContentType); 2239context.Response.Body = ms; 2249context.Response.Body = ms; 2272context.Response.Body = ms; 2298context.Response.Body = ms; 2327context.Response.Body = ms; 2356context.Response.Body = ms; 2503Assert.Equal(409, context.Response.StatusCode); 2567context.Response.Body = responseBody; 2595Assert.Equal(404, context.Response.StatusCode); 2627context.Response.Body = responseBody; 2652Assert.Equal(404, context.Response.StatusCode); 2684context.Response.Body = responseBody; 2750Assert.Equal(StatusCodes.Status500InternalServerError, pollContext.Response.StatusCode); 2752AssertResponseHasCacheHeaders(pollContext.Response); 2802Assert.Equal(StatusCodes.Status202Accepted, deleteContext.Response.StatusCode); 2803Assert.Equal("text/plain", deleteContext.Response.ContentType); 2981pollContext.Response.Body.Position = 0; 2982Assert.Equal(3, await pollContext.Response.Body.ReadAsync(memory).DefaultTimeout()); 2993pollContext.Response.Body.Position = 0; 2994Assert.Equal(3, await pollContext.Response.Body.ReadAsync(memory).DefaultTimeout()); 3038pollContext.Response.Body.Position = 0; 3039Assert.Equal(3, await pollContext.Response.Body.ReadAsync(memory).DefaultTimeout()); 3048pollContext.Response.Body.Position = 0; 3049Assert.Equal(3, await pollContext.Response.Body.ReadAsync(memory).DefaultTimeout()); 3170context.Response.Body.Position = 0; 3171Assert.Equal(1, await context.Response.Body.ReadAsync(memory).DefaultTimeout()); 3692context.Response.Body = strm; 3713Assert.Equal(status, context.Response.StatusCode); 3725AssertResponseHasCacheHeaders(context.Response); 3745context.Response.Body = new MemoryStream();
LongPollingTests.cs (7)
36Assert.Equal(204, context.Response.StatusCode); 56Assert.Equal(0, context.Response.ContentLength); 57Assert.Equal(200, context.Response.StatusCode); 73context.Response.Body = ms; 80Assert.Equal(200, context.Response.StatusCode); 96context.Response.Body = ms; 106Assert.Equal(200, context.Response.StatusCode);
ServerSentEventsTests.cs (6)
34Assert.Equal("text/event-stream", context.Response.ContentType); 35Assert.Equal("no-cache,no-store", context.Response.Headers["Cache-Control"]); 36Assert.Equal("no-cache", context.Response.Headers["Pragma"]); 71context.Response.Body = ms; 93context.Response.Body = ms; 122context.Response.Body = ms;
Microsoft.AspNetCore.Http.Extensions.Tests (132)
HttpResponseJsonExtensionsTests.cs (69)
26context.Response.Body = body; 29await context.Response.WriteAsJsonAsync(1); 32Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 33Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 45context.Response.Body = body; 48await context.Response.WriteAsJsonAsync<Uri?>(value: null); 51Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 63context.Response.Body = body; 68await context.Response.WriteAsJsonAsync(new int[] { 1, 2, 3 }, options); 71Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 96context.Response.Body = body; 99context.Response.StatusCode = StatusCodes.Status418ImATeapot; 100await context.Response.WriteAsJsonAsync(1); 103Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 104Assert.Equal(StatusCodes.Status418ImATeapot, context.Response.StatusCode); 113context.Response.Body = body; 116await context.Response.WriteAsJsonAsync(1, options: null, contentType: "application/custom-type"); 119Assert.Equal("application/custom-type", context.Response.ContentType); 127context.Response.Body = new TestStream(); 132var writeTask = context.Response.WriteAsJsonAsync(1, cts.Token); 147context.Response.Body = body; 154await context.Response.WriteAsJsonAsync(value); 167context.Response.Body = body; 170await context.Response.WriteAsJsonAsync(1, typeof(int)); 173Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 174Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 186context.Response.Body = body; 189await context.Response.WriteAsJsonAsync(value: null, typeof(int?)); 192Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 204context.Response.Body = body; 207await Assert.ThrowsAsync<ArgumentNullException>(async () => await context.Response.WriteAsJsonAsync(value: null, type: null!)); 216context.Response.Body = body; 228context.Response.Body = body; 235await context.Response.WriteAsJsonAsync(value, typeof(TestObject)); 248context.Response.Body = body; 251context.Response.StatusCode = StatusCodes.Status418ImATeapot; 252await context.Response.WriteAsJsonAsync(1, typeof(int)); 255Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 256Assert.Equal(StatusCodes.Status418ImATeapot, context.Response.StatusCode); 265context.Response.Body = body; 268await context.Response.WriteAsJsonAsync(AsyncEnumerable()); 271Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 272Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 290context.Response.Body = body; 293await context.Response.WriteAsJsonAsync(AsyncEnumerable(), typeof(IAsyncEnumerable<int>)); 296Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 297Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 316context.Response.Body = body; 321await context.Response.WriteAsJsonAsync(AsyncEnumerable()); 324Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 325Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 350context.Response.Body = body; 355await context.Response.WriteAsJsonAsync(AsyncEnumerable(), typeof(IAsyncEnumerable<int>)); 358Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 359Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 383context.Response.Body = body; 389await Assert.ThrowsAnyAsync<OperationCanceledException>(() => context.Response.WriteAsJsonAsync(AsyncEnumerable(), typeof(IAsyncEnumerable<int>), cts.Token)); 392Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 393Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 417context.Response.Body = body; 423await Assert.ThrowsAnyAsync<OperationCanceledException>(() => context.Response.WriteAsJsonAsync(AsyncEnumerable(), cts.Token)); 426Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 427Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 451context.Response.Body = body; 457await context.Response.WriteAsJsonAsync(new int[] { 1, 2, 3 }, (JsonTypeInfo<int[]>)options.GetTypeInfo(typeof(int[]))); 460Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType); 472context.Response.Body = body; 478await context.Response.WriteAsJsonAsync(value : null, options.GetTypeInfo(typeof(Uri))); 481Assert.Equal(ContentTypeConstants.JsonContentTypeWithCharset, context.Response.ContentType);
RequestDelegateFactoryTests.cs (41)
767Assert.Equal(200, httpContext.Response.StatusCode); 768Assert.False(httpContext.Response.HasStarted); 896Assert.Equal(400, httpContext.Response.StatusCode); 1294Assert.Equal(httpContext.Response, httpResponseArgument); 1347httpContext.Response.Body = responseBodyStream; 1380httpContext.Response.Body = responseBodyStream; 1409httpContext.Response.Body = responseBodyStream; 1476httpContext.Response.Body = responseBodyStream; 1515httpContext.Response.Body = responseBodyStream; 1560httpContext.Response.Body = responseBodyStream; 1580Assert.Equal(400, httpContext.Response.StatusCode); 1589Assert.Equal(200, httpContext.Response.StatusCode); 1679Assert.Equal(400, httpContext.Response.StatusCode); 1695Assert.Equal(200, httpContext.Response.StatusCode); 1754Assert.Equal(200, httpContext.Response.StatusCode); 1773httpContext.Response.Body = responseBodyStream; 1788Assert.Equal(200, httpContext.Response.StatusCode); 1803httpContext.Response.Body = responseBodyStream; 1818Assert.Equal(200, httpContext.Response.StatusCode); 1833httpContext.Response.Body = responseBodyStream; 1848Assert.Equal(200, httpContext.Response.StatusCode); 1863httpContext.Response.Body = responseBodyStream; 1875Assert.Equal(200, httpContext.Response.StatusCode); 1903httpContext.Response.Body = responseBodyStream; 1915Assert.Equal(200, httpContext.Response.StatusCode); 1951Assert.Equal(413, httpContext.Response.StatusCode); 1984Assert.Equal(413, httpContext.Response.StatusCode); 2159httpContext.Response.Body = responseBodyStream; 2180Assert.Equal(200, httpContext.Response.StatusCode); 2196httpContext.Response.Body = responseBodyStream; 2223Assert.Equal(200, httpContext.Response.StatusCode); 2278httpContext.Response.Body = responseBodyStream; 2294Assert.Equal(200, httpContext.Response.StatusCode); 2373httpContext.Response.Body = responseBodyStream; 2389Assert.Equal(200, httpContext.Response.StatusCode); 2407httpContext.Response.Body = responseBodyStream; 2426Assert.Equal(400, httpContext.Response.StatusCode); 2492httpContext.Response.Body = responseBodyStream; 2508Assert.Equal(200, httpContext.Response.StatusCode); 3152Assert.Equal(200, httpContext.Response.StatusCode); 3199Assert.Equal(400, httpContext.Response.StatusCode);
RequestDelegateFactoryTests.FormMapping.cs (2)
201Assert.Equal(StatusCodes.Status200OK, httpContext.Response.StatusCode); 234Assert.Equal(StatusCodes.Status200OK, httpContext.Response.StatusCode);
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
203httpContext.Response.Body = outStream;
ResponseExtensionTests.cs (12)
14context.Response.StatusCode = 201; 15context.Response.Headers["custom"] = "value"; 16context.Response.Body.Write(new byte[100], 0, 100); 18context.Response.Clear(); 20Assert.Equal(200, context.Response.StatusCode); 21Assert.Equal(string.Empty, context.Response.Headers["custom"].ToString()); 22Assert.Equal(0, context.Response.Body.Length); 31Assert.Throws<InvalidOperationException>(() => context.Response.Clear()); 43context.Response.StatusCode = StatusCodes.Status200OK; 45context.Response.Redirect(location, permanent, preserveMethod); 47Assert.Equal(location, context.Response.Headers.Location.First()); 48Assert.Equal(expectedStatusCode, context.Response.StatusCode);
SendFileResponseExtensionsTests.cs (7)
14var response = new DefaultHttpContext().Response; 22var response = context.Response; 39var response = context.Response; 52var response = context.Response; 67var response = context.Response; 79var response = context.Response; 95var response = context.Response;
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
203httpContext.Response.Body = outStream;
Microsoft.AspNetCore.Http.Results.Tests (35)
BadRequestOfTResultTests.cs (2)
59Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode); 102Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode);
BadRequestResultTests.cs (1)
42Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode);
ConflictOfTResultTests.cs (1)
58Assert.Equal(StatusCodes.Status409Conflict, httpContext.Response.StatusCode);
ConflictResultTests.cs (1)
43Assert.Equal(StatusCodes.Status409Conflict, httpContext.Response.StatusCode);
CreatedAtRouteOfTResultTests.cs (1)
183httpContext.Response.Body = new MemoryStream();
CreatedAtRouteResultTests.cs (1)
129httpContext.Response.Body = new MemoryStream();
CreatedOfTResultTests.cs (1)
180httpContext.Response.Body = new MemoryStream();
CreatedResultTests.cs (1)
117httpContext.Response.Body = new MemoryStream();
EmptyResultTests.cs (1)
41httpContext.Response.Body = new MemoryStream();
InternalServerErrorOfTResultTests.cs (2)
59Assert.Equal(StatusCodes.Status500InternalServerError, httpContext.Response.StatusCode); 102Assert.Equal(StatusCodes.Status500InternalServerError, httpContext.Response.StatusCode);
InternalServerErrorResultTests.cs (1)
42Assert.Equal(StatusCodes.Status500InternalServerError, httpContext.Response.StatusCode);
JsonResultTests.cs (7)
32Assert.Equal(411, httpContext.Response.StatusCode); 50Assert.Equal(407, httpContext.Response.StatusCode); 100Assert.Equal(StatusCodes.Status200OK, httpContext.Response.StatusCode); 133Assert.Equal(StatusCodes.Status500InternalServerError, httpContext.Response.StatusCode); 162Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode); 194Assert.Equal(StatusCodes.Status418ImATeapot, httpContext.Response.StatusCode); 240Assert.Equal(StatusCodes.Status413RequestEntityTooLarge, httpContext.Response.StatusCode);
NotFoundOfTResultTests.cs (1)
143httpContext.Response.Body = new MemoryStream();
NotFoundResultTests.cs (1)
92httpContext.Response.Body = new MemoryStream();
OkOfTResultTests.cs (1)
79Assert.Equal(StatusCodes.Status200OK, httpContext.Response.StatusCode);
OkResultTests.cs (1)
41Assert.Equal(StatusCodes.Status200OK, httpContext.Response.StatusCode);
ProblemResultTests.cs (6)
36Assert.Equal(StatusCodes.Status500InternalServerError, httpContext.Response.StatusCode); 68Assert.Equal(StatusCodes.Status500InternalServerError, httpContext.Response.StatusCode); 97Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode); 129Assert.Equal(StatusCodes.Status418ImATeapot, httpContext.Response.StatusCode); 161Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode); 188Assert.Equal(StatusCodes.Status413RequestEntityTooLarge, httpContext.Response.StatusCode);
PushStreamResultTests.cs (1)
22httpContext.Response.Body = ms;
UnprocessableEntityOfTResultTests.cs (1)
57Assert.Equal(StatusCodes.Status422UnprocessableEntity, httpContext.Response.StatusCode);
UnprocessableEntityResultTests.cs (1)
42Assert.Equal(StatusCodes.Status422UnprocessableEntity, httpContext.Response.StatusCode);
ValidationProblemResultTests.cs (2)
39Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode); 72Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode);
Microsoft.AspNetCore.Http.Tests (30)
ApplicationBuilderTests.cs (5)
22Assert.Equal(404, httpContext.Response.StatusCode); 34httpContext.Response.StatusCode = 200; 39Assert.Equal(200, httpContext.Response.StatusCode); 100Assert.Equal(404, httpContext.Response.StatusCode); 123Assert.Equal(StatusCodes.Status204NoContent, httpContext.Response.StatusCode);
Internal\DefaultHttpResponseTests.cs (13)
63var bodyPipe = response.Response.BodyWriter; 85Assert.Same(originalStream, context.Response.Body); 88context.Response.Body = replacementStream; 90Assert.Same(replacementStream, context.Response.Body); 93context.Response.Body = originalStream; 95Assert.Same(originalStream, context.Response.Body); 118await context.Response.StartAsync(); 138await context.Response.StartAsync(ct); 157await context.Response.StartAsync(); 167context.Response.Body = mock; 169await context.Response.StartAsync(default); 183context.Response.RegisterForDispose(instance); 242return context.Response;
Timeouts\RequestTimeoutsMiddlewareTests.cs (12)
192context.Response.Headers.Add("ToBeCleared", "Later"); 197Assert.Equal(StatusCodes.Status418ImATeapot, context.Response.StatusCode); 198Assert.Empty(context.Response.Headers); 208context.Response.Headers.Add("ToBeCleared", "Later"); 213Assert.Equal(StatusCodes.Status418ImATeapot, context.Response.StatusCode); 214Assert.Empty(context.Response.Headers); 225context.Response.Headers.Add("ToBeCleared", "Later"); 233Assert.Equal(111, context.Response.StatusCode); 234Assert.Empty(context.Response.Headers); 245context.Response.Headers.Add("NotGonnaBeCleared", "Not Today!"); 250Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 251Assert.NotEmpty(context.Response.Headers);
Microsoft.AspNetCore.HttpLogging.Tests (15)
HttpLoggingMiddlewareTests.cs (10)
1211httpContext.Response.StatusCode = StatusCodes.Status101SwitchingProtocols; 1212httpContext.Response.Headers[HeaderNames.Connection] = HeaderNames.Upgrade; 1261httpContext.Response.StatusCode = StatusCodes.Status101SwitchingProtocols; 1262httpContext.Response.Headers.Connection = HeaderNames.Upgrade; 1315httpContext.Response.StatusCode = StatusCodes.Status101SwitchingProtocols; 1316httpContext.Response.Headers[HeaderNames.Connection] = HeaderNames.Upgrade; 1358httpContext.Response.StatusCode = StatusCodes.Status101SwitchingProtocols; 1359httpContext.Response.Headers[HeaderNames.Connection] = HeaderNames.Upgrade; 1436httpContext.Response.StatusCode = StatusCodes.Status101SwitchingProtocols; 1437httpContext.Response.Headers[HeaderNames.Connection] = HeaderNames.Upgrade;
W3CLoggingMiddlewareTests.cs (5)
84httpContext.Response.StatusCode = 200; 129httpContext.Response.StatusCode = 200; 170httpContext.Response.StatusCode = 200; 202httpContext.Response.StatusCode = 200; 249httpContext.Response.StatusCode = 200;
Microsoft.AspNetCore.Mvc.Core.Test (32)
CreatedAtActionResultTests.cs (1)
79httpContext.Response.Body = new MemoryStream();
CreatedAtRouteResultTests.cs (1)
93httpContext.Response.Body = new MemoryStream();
CreatedResultTests.cs (1)
126httpContext.Response.Body = new MemoryStream();
FileResultHelperTest.cs (2)
95Assert.Equal("application/my-type", httpContext.Response.ContentType); 96Assert.Equal(Stream.Null, httpContext.Response.Body);
Formatters\JsonOutputFormatterTestBase.cs (1)
170httpContext.Response.Body = responseStream ?? new MemoryStream();
Formatters\NoContentFormatterTests.cs (2)
158httpContext.Response.StatusCode = StatusCodes.Status201Created; 172Assert.Equal(StatusCodes.Status201Created, httpContext.Response.StatusCode);
HttpNotFoundObjectResultTest.cs (1)
59httpContext.Response.Body = new MemoryStream();
HttpOkObjectResultTest.cs (1)
63Assert.Equal(StatusCodes.Status200OK, httpContext.Response.StatusCode);
Infrastructure\ControllerActionInvokerTest.cs (1)
1716httpContext.Response.Body = new MemoryStream();
Infrastructure\JsonResultExecutorTestBase.cs (1)
481httpContext.Response.Body = new MemoryStream();
Infrastructure\ObjectResultExecutorTest.cs (16)
27httpContext.Response.ContentType = "text/json"; 41MediaTypeAssert.Equal("text/xml; charset=utf-8", httpContext.Response.ContentType); 55httpContext.Response.ContentType = "text/plain"; 66MediaTypeAssert.Equal("text/plain; charset=utf-8", httpContext.Response.ContentType); 78httpContext.Response.ContentType = "application/json"; 88Assert.Equal("application/json; charset=utf-8", httpContext.Response.ContentType); 120httpContext.Response.ContentType = "application/xml"; // This will not be used 134MediaTypeAssert.Equal("application/problem+xml; charset=utf-8", httpContext.Response.ContentType); 145httpContext.Response.ContentType = "application/json"; // This will not be used 156MediaTypeAssert.Equal("application/problem+xml; charset=utf-8", httpContext.Response.ContentType); 167httpContext.Response.ContentType = "application/json"; // This will not be used 178MediaTypeAssert.Equal("application/problem+xml; charset=utf-8", httpContext.Response.ContentType); 190httpContext.Response.ContentType = "application/xml"; // This will not be used 204MediaTypeAssert.Equal("application/problem+json; charset=utf-8", httpContext.Response.ContentType); 229MediaTypeAssert.Equal("application/problem+xml; charset=utf-8", httpContext.Response.ContentType); 250MediaTypeAssert.Equal("application/problem+xml; charset=utf-8", httpContext.Response.ContentType);
RedirectToActionResultTest.cs (4)
107Assert.Equal(expectedStatusCode, httpContext.Response.StatusCode); 108Assert.Equal(expectedUrl, httpContext.Response.Headers["Location"]); 135Assert.Equal(expectedStatusCode, httpContext.Response.StatusCode); 136Assert.Equal(expectedUrl, httpContext.Response.Headers["Location"]);
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (2)
XmlDataContractSerializerOutputFormatterTest.cs (1)
806httpContext.Response.Body = new MemoryStream();
XmlSerializerOutputFormatterTest.cs (1)
588httpContext.Response.Body = new MemoryStream();
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (3)
JsonResultTest.cs (1)
42httpContext.Response.Body = new MemoryStream();
src\Mvc\Mvc.Core\test\Formatters\JsonOutputFormatterTestBase.cs (1)
170httpContext.Response.Body = responseStream ?? new MemoryStream();
src\Mvc\Mvc.Core\test\Infrastructure\JsonResultExecutorTestBase.cs (1)
481httpContext.Response.Body = new MemoryStream();
Microsoft.AspNetCore.Mvc.RazorPages.Test (2)
PageModelTest.cs (1)
1746Assert.Same(httpContext.Response, pageModel.Response);
PageTest.cs (1)
46Assert.Same(httpContext.Response, page.Response);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (16)
CookieTempDataProviderTest.cs (2)
90var setCookieHeader = SetCookieHeaderValue.Parse(context.Response.Headers["Set-Cookie"].ToString()); 283var responseCookies = httpContext.Response.GetTypedHeaders().SetCookie;
ViewComponentResultTest.cs (3)
417httpContext.Response.Body = new MemoryStream(); 459httpContext.Response.Body = new MemoryStream(); 691httpContext.Response.Body = new MemoryStream();
ViewExecutorTest.cs (11)
95context.Response.Body = stream.Object; 134context.Response.Body = memoryStream; 135context.Response.ContentType = responseContentType; 155MediaTypeAssert.Equal(expectedContentType, context.Response.ContentType); 189context.Response.Body = memoryStream; 209Assert.Equal(200, context.Response.StatusCode); 226context.Response.Body = memoryStream; 246Assert.Equal(500, context.Response.StatusCode); 261context.Response.Body = memoryStream; 309context.Response.Body = memoryStream; 350context.Response.Body = stream.Object;
Microsoft.AspNetCore.OpenApi.Tests (12)
Extensions\OpenApiEndpointRouteBuilderExtensionsTests.cs (12)
59context.Response.Body = responseBodyStream; 69Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 90context.Response.Body = responseBodyStream; 99Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 100Assert.Equal(expectedContentType, context.Response.ContentType); 121context.Response.Body = responseBodyStream; 131Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 146context.Response.Body = responseBodyStream; 156Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 174context.Response.Body = responseBodyStream; 184Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 185Assert.Equal(expectedContentType, context.Response.ContentType);
Microsoft.AspNetCore.RateLimiting.Tests (21)
RateLimitingApplicationBuilderExtensionsTests.cs (1)
62Assert.Equal(429, context.Response.StatusCode);
RateLimitingMetricsTests.cs (3)
48Assert.Equal(StatusCodes.Status503ServiceUnavailable, context.Response.StatusCode); 105Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 160Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode);
RateLimitingMiddlewareTests.cs (17)
106Assert.Equal(StatusCodes.Status503ServiceUnavailable, context.Response.StatusCode); 131Assert.Equal(StatusCodes.Status429TooManyRequests, context.Response.StatusCode); 155Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 213Assert.Equal(StatusCodes.Status429TooManyRequests, context.Response.StatusCode); 249Assert.Equal(StatusCodes.Status429TooManyRequests, context.Response.StatusCode); 280Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 312Assert.Equal(StatusCodes.Status429TooManyRequests, context.Response.StatusCode); 344Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 376Assert.Equal(StatusCodes.Status429TooManyRequests, context.Response.StatusCode); 419Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 454Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 460Assert.Equal(StatusCodes.Status400BadRequest, context.Response.StatusCode); 505Assert.Equal(StatusCodes.Status429TooManyRequests, context.Response.StatusCode); 541Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 549Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode); 579Assert.Equal(StatusCodes.Status404NotFound, context.Response.StatusCode); 619Assert.Equal(StatusCodes.Status403Forbidden, context.Response.StatusCode);
Microsoft.AspNetCore.ResponseCompression.Tests (2)
ResponseCompressionBodyTest.cs (2)
20httpContext.Response.Headers.Vary = providedVaryHeader; 25Assert.Equal(expectedVaryHeader, httpContext.Response.Headers.Vary);
Microsoft.AspNetCore.Routing.Tests (15)
Builder\RequestDelegateEndpointRouteBuilderExtensionsTest.cs (6)
84httpContext.Response.Body = responseBodyStream; 117httpContext.Response.Body = responseBodyStream; 152httpContext.Response.Body = responseBodyStream; 182httpContext.Response.Body = responseBodyStream; 231httpContext.Response.Body = responseBodyStream; 266httpContext.Response.Body = responseBodyStream;
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (9)
645Assert.Equal(StatusCodes.Status400BadRequest, httpContext.Response.StatusCode); 832Assert.Equal(400, httpContext.Response.StatusCode); 852Assert.Equal(400, httpContext.Response.StatusCode); 899httpContext.Response.Body = outStream; 904var httpResponse = httpContext.Response; 908Assert.Equal(200, httpContext.Response.StatusCode); 976httpContext.Response.Body = outStream; 979Assert.Equal(200, httpContext.Response.StatusCode); 980var httpResponse = httpContext.Response;
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
HeaderCollectionBenchmark.cs (1)
350_response = context.Response;
ResponseHeaderCollectionBenchmark.cs (1)
198_response = context.Response;
Microsoft.AspNetCore.StaticFiles.Tests (1)
StaticFileContextTest.cs (1)
132httpContext.Response.Body = body;