3 writes to Response
Microsoft.AspNetCore.Authentication.Test (3)
JwtBearerTests.cs (1)
1259Response = await server.CreateClient().SendAsync(request),
JwtBearerTests_Handler.cs (1)
1318Response = await server.CreateClient().SendAsync(request),
TestExtensions.cs (1)
28Response = await server.CreateClient().SendAsync(request),
248 references to Response
Microsoft.AspNetCore.Authentication.Test (248)
CookieTests.cs (18)
1252Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 1254var location = transaction.Response.Headers.Location; 1287Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 1314Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 1342Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 1365Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 1388Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 1391var location = transaction.Response.Headers.Location; 1413Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 1436Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 1439var location = transaction.Response.Headers.Location; 1461Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 1463var location = transaction.Response.Headers.Location; 1486Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 1488var location = transaction.Response.Headers.Location; 1628Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 1630var location = transaction.Response.Headers.Location; 1731Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode);
FacebookTests.cs (19)
58Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 74Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 110Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 111var query = transaction.Response.Headers.Location.Query; 139var res = transaction.Response; 171var res = transaction.Response; 203var res = transaction.Response; 231Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 232var location = transaction.Response.Headers.Location.AbsoluteUri; 264Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 265var location = transaction.Response.Headers.Location.AbsoluteUri; 299Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 300var location = transaction.Response.Headers.Location.AbsoluteUri; 366Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 367Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 434Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 435var locationUri = transaction.Response.Headers.Location; 448Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 449Assert.Equal("/challenge", transaction.Response.Headers.GetValues("Location").First());
GoogleTests.cs (59)
55Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 56var location = transaction.Response.Headers.Location; 86Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 99Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 112Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 125Assert.Equal(HttpStatusCode.Unauthorized, transaction.Response.StatusCode); 151Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 152var query = transaction.Response.Headers.Location.Query; 187Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 190var query = QueryHelpers.ParseQuery(transaction.Response.Headers.Location.Query); 239Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 242var query = QueryHelpers.ParseQuery(transaction.Response.Headers.Location.Query); 295Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 298var query = QueryHelpers.ParseQuery(transaction.Response.Headers.Location.Query); 334Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 335var query = transaction.Response.Headers.Location.Query; 359Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 401Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 402Assert.Equal("/error?FailureMessage=AccessDenied", transaction.Response.Headers.GetValues("Location").First()); 437Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 438Assert.Equal("https://example.com/custom-denied-page?rurl=http%3A%2F%2Fwww.google.com%2F", transaction.Response.Headers.GetValues("Location").First()); 480Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 481Assert.StartsWith("/error?FailureMessage=", transaction.Response.Headers.GetValues("Location").First()); 519Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 520Assert.Equal("/error?FailureMessage=itfailed" + UrlEncoder.Default.Encode(";Description=whyitfailed;Uri=https://example.com/fail"), transaction.Response.Headers.GetValues("Location").First()); 558Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 559Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 566Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 578Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 628Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 630transaction.Response.Headers.GetValues("Location").First()); 680Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 682transaction.Response.Headers.GetValues("Location").First()); 721Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 722Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 729Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 761Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 762Assert.Equal("/", transaction.Response.Headers.GetValues("Location").First()); 809Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 810Assert.Equal("/foo", transaction.Response.Headers.GetValues("Location").First()); 852Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 854transaction.Response.Headers.GetValues("Location").First()); 882Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 883Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 890Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 926Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 927Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 934Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 970Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 971Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 978Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 1007Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 1008Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 1015Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 1016Assert.StartsWith("https://www.facebook.com/", transaction.Response.Headers.Location.OriginalString); 1067Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 1068var locationUri = transaction.Response.Headers.Location; 1081Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 1082Assert.Equal("/challenge", transaction.Response.Headers.GetValues("Location").First());
JwtBearerTests.cs (45)
81Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 119Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 120Assert.Equal(tokenText, await response.Response.Content.ReadAsStringAsync()); 163Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 172Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 216Assert.Equal(HttpStatusCode.Unauthorized, transaction.Response.StatusCode); 246Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 256Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 265Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 274Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 292Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 293Assert.Equal("Bearer error=\"invalid_token\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 319Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 320Assert.Equal($"Bearer error=\"invalid_token\", error_description=\"{message}\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 343Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 344Assert.Equal($"Bearer error=\"invalid_token\", error_description=\"{message}\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 363Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 364Assert.Equal("Bearer error=\"invalid_token\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 383Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 385response.Response.Headers.WwwAuthenticate.First().ToString()); 416Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 451Assert.Equal(builder.ToString(), response.Response.Headers.WwwAuthenticate.First().ToString()); 465Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 466Assert.Equal("Bearer", response.Response.Headers.WwwAuthenticate.First().ToString()); 477Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 478Assert.Equal("Bearer", response.Response.Headers.WwwAuthenticate.First().ToString()); 517Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 546Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 580Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 652Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 724Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 784Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 785Assert.Empty(response.Response.Headers.WwwAuthenticate); 807Assert.Equal(HttpStatusCode.Forbidden, response.Response.StatusCode); 834Assert.Equal(HttpStatusCode.Forbidden, response.Response.StatusCode); 862Assert.Equal(418, (int)response.Response.StatusCode); 863Assert.Equal("You Shall Not Pass", await response.Response.Content.ReadAsStringAsync()); 952Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 953var responseBody = await response.Response.Content.ReadAsStringAsync(); 996Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 997var responseBody = await response.Response.Content.ReadAsStringAsync(); 1262transaction.ResponseText = await transaction.Response.Content.ReadAsStringAsync(); 1264if (transaction.Response.Content != null && 1265transaction.Response.Content.Headers.ContentType != null && 1266transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
JwtBearerTests_Handler.cs (45)
72Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 109Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 110Assert.Equal(tokenText, await response.Response.Content.ReadAsStringAsync()); 153Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 162Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 203Assert.Equal(HttpStatusCode.Unauthorized, transaction.Response.StatusCode); 232Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 242Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 251Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 260Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 275Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 276Assert.Equal("Bearer error=\"invalid_token\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 299Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 300Assert.Equal($"Bearer error=\"invalid_token\", error_description=\"{message}\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 320Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 321Assert.Equal($"Bearer error=\"invalid_token\", error_description=\"{message}\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 337Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 338Assert.Equal("Bearer error=\"invalid_token\"", response.Response.Headers.WwwAuthenticate.First().ToString()); 354Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 356response.Response.Headers.WwwAuthenticate.First().ToString()); 386Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 421Assert.Equal(builder.ToString(), response.Response.Headers.WwwAuthenticate.First().ToString()); 434Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 435Assert.Equal("Bearer", response.Response.Headers.WwwAuthenticate.First().ToString()); 446Assert.Equal(HttpStatusCode.Unauthorized, response.Response.StatusCode); 447Assert.Equal("Bearer", response.Response.Headers.WwwAuthenticate.First().ToString()); 483Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 509Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 542Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 610Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 676Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 732Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 733Assert.Empty(response.Response.Headers.WwwAuthenticate); 754Assert.Equal(HttpStatusCode.Forbidden, response.Response.StatusCode); 780Assert.Equal(HttpStatusCode.Forbidden, response.Response.StatusCode); 807Assert.Equal(418, (int)response.Response.StatusCode); 808Assert.Equal("You Shall Not Pass", await response.Response.Content.ReadAsStringAsync()); 896Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 897var responseBody = await response.Response.Content.ReadAsStringAsync(); 939Assert.Equal(HttpStatusCode.OK, response.Response.StatusCode); 940var responseBody = await response.Response.Content.ReadAsStringAsync(); 1321transaction.ResponseText = await transaction.Response.Content.ReadAsStringAsync(); 1323if (transaction.Response.Content != null && 1324transaction.Response.Content.Headers.ContentType != null && 1325transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
MicrosoftAccountTests.cs (19)
65Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 66var query = transaction.Response.Headers.Location.Query; 80Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 93Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 106Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 119Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 120var location = transaction.Response.Headers.Location.AbsoluteUri; 144var res = transaction.Response; 162var res = transaction.Response; 180var res = transaction.Response; 243Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 244Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 251Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 267Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 270var query = QueryHelpers.ParseQuery(transaction.Response.Headers.Location.Query); 334Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 335var locationUri = transaction.Response.Headers.Location; 348Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 349Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First());
OAuthTests.cs (14)
132var res = transaction.Response; 160var res = transaction.Response; 190var res = transaction.Response; 216var res = transaction.Response; 245var res = transaction.Response; 274var res = transaction.Response; 313Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 314Assert.Equal("https://www.example.com/access-denied?ReturnUrl=http%3A%2F%2Ftesthost%2Fredirect", transaction.Response.Headers.Location.ToString()); 348Assert.Equal(HttpStatusCode.NotAcceptable, transaction.Response.StatusCode); 349Assert.Null(transaction.Response.Headers.Location); 384Assert.Equal(HttpStatusCode.NotAcceptable, transaction.Response.StatusCode); 385Assert.Null(transaction.Response.Headers.Location); 420Assert.Equal(HttpStatusCode.NotAcceptable, transaction.Response.StatusCode); 421Assert.Null(transaction.Response.Headers.Location);
TestExtensions.cs (6)
30if (transaction.Response.Headers.Contains("Set-Cookie")) 32transaction.SetCookie = transaction.Response.Headers.GetValues("Set-Cookie").ToList(); 34transaction.ResponseText = await transaction.Response.Content.ReadAsStringAsync(); 36if (transaction.Response.Content != null && 37transaction.Response.Content.Headers.ContentType != null && 38transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
TwitterTests.cs (23)
71Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 72var query = transaction.Response.Headers.Location.Query; 133Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 146Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 159Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 181Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 182var location = transaction.Response.Headers.Location.AbsoluteUri; 209Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 210var location = transaction.Response.Headers.Location.AbsoluteUri; 212Assert.True(transaction.Response.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookie)); 259Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 260var location = transaction.Response.Headers.Location.AbsoluteUri; 262Assert.True(transaction.Response.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookie)); 366Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 367var location = transaction.Response.Headers.Location.AbsoluteUri; 369Assert.True(transaction.Response.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookie)); 431Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 432Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 436Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 444Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode); 510Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode); 511Assert.Equal("/me", transaction.Response.Headers.GetValues("Location").First()); 526Assert.Equal(HttpStatusCode.OK, transaction.Response.StatusCode);