2 writes to State
Microsoft.AspNetCore.InternalTesting (1)
Logging\TestLogger.cs (1)
53State = state,
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
src\Shared\SignalR\LogSinkProvider.cs (1)
41State = state,
122 references to State
Microsoft.AspNetCore.Antiforgery.Test (7)
DefaultAntiforgeryTest.cs (7)
385.Select(wc => wc.State?.ToString()) 403.Select(wc => wc.State?.ToString()) 421.Select(wc => wc.State?.ToString()) 439.Select(wc => wc.State?.ToString()) 1301.Select(wc => wc.State?.ToString()) 1340.Select(wc => wc.State?.ToString()) 1374.Select(wc => wc.State?.ToString())
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (1)
JsonTranscodingServiceMethodProviderTests.cs (1)
123var values = (IReadOnlyList<KeyValuePair<string, object?>>)w.State;
Microsoft.AspNetCore.Hosting.Tests (1)
WebHostBuilderTests.cs (1)
1077Assert.Contains(sink.Writes, w => w.State.ToString() == "From startup");
Microsoft.AspNetCore.Http.Extensions.Tests (15)
RequestDelegateGenerator\RequestDelegateCreationTests.Logging.cs (14)
52var log1Values = Assert.IsAssignableFrom<IReadOnlyList<KeyValuePair<string, object>>>(logs[0].State); 60var log2Values = Assert.IsAssignableFrom<IReadOnlyList<KeyValuePair<string, object>>>(logs[1].State); 68var log3Values = Assert.IsAssignableFrom<IReadOnlyList<KeyValuePair<string, object>>>(logs[2].State); 76var log4Values = Assert.IsAssignableFrom<IReadOnlyList<KeyValuePair<string, object>>>(logs[3].State); 115var log1Values = Assert.IsAssignableFrom<IReadOnlyList<KeyValuePair<string, object>>>(logs[0].State); 123var log2Values = Assert.IsAssignableFrom<IReadOnlyList<KeyValuePair<string, object>>>(logs[1].State); 235var log1Values = Assert.IsAssignableFrom<IReadOnlyList<KeyValuePair<string, object>>>(logs[0].State); 243var log2Values = Assert.IsAssignableFrom<IReadOnlyList<KeyValuePair<string, object>>>(logs[1].State); 315var log1Values = Assert.IsAssignableFrom<IReadOnlyList<KeyValuePair<string, object>>>(logs[0].State); 323var log2Values = Assert.IsAssignableFrom<IReadOnlyList<KeyValuePair<string, object>>>(logs[1].State); 405var logValues = Assert.IsAssignableFrom<IReadOnlyList<KeyValuePair<string, object>>>(logMessage.State); 454var logValues = Assert.IsAssignableFrom<IReadOnlyList<KeyValuePair<string, object>>>(logMessage.State); 534var logValues = Assert.IsAssignableFrom<IReadOnlyList<KeyValuePair<string, object>>>(logMessage.State); 614var logValues = Assert.IsAssignableFrom<IReadOnlyList<KeyValuePair<string, object>>>(logMessage.State);
RequestDelegateGenerator\RuntimeCreationTests.ComplexFormBinding.cs (1)
186var log1Values = Assert.IsAssignableFrom<IReadOnlyList<KeyValuePair<string, object>>>(log.State);
Microsoft.AspNetCore.HttpsPolicy.Tests (14)
HstsMiddlewareTests.cs (5)
215Assert.Equal($"The host '{hostUrl}' is excluded. Skipping HSTS header.", message.State.ToString(), ignoreCase: true); 270Assert.Equal("Adding HSTS header to response.", message.State.ToString()); 325Assert.Equal($"The host '{hostUrl}' is excluded. Skipping HSTS header.", message.State.ToString(), ignoreCase: true); 372Assert.Equal("The request is insecure. Skipping HSTS header.", message.State.ToString()); 418Assert.Equal("Adding HSTS header to response.", message.State.ToString());
HttpsRedirectionMiddlewareTests.cs (9)
62Assert.Equal("Failed to determine the https port for redirect.", message.State.ToString()); 118Assert.Equal($"Redirecting to '{expected}'.", message.State.ToString()); 174Assert.Equal($"Redirecting to '{expectedUrl}'.", message.State.ToString()); 275Assert.Equal("Https port '5050' discovered from server endpoints.", message.State.ToString()); 279Assert.Equal("Redirecting to 'https://localhost:5050/'.", message.State.ToString()); 363Assert.Equal("Https port '5050' discovered from server endpoints.", message.State.ToString()); 367Assert.Equal("Redirecting to 'https://localhost:5050/'.", message.State.ToString()); 409Assert.Equal("Failed to determine the https port for redirect.", message.State.ToString()); 453Assert.Equal("Failed to determine the https port for redirect.", message.State.ToString());
Microsoft.AspNetCore.InternalTesting (1)
Logging\WriteContext.cs (1)
28return Formatter(State, Exception);
Microsoft.AspNetCore.InternalTesting.Tests (4)
LoggedTestXunitTests.cs (4)
75Assert.Equal("Information", message.Formatter(message.State, null)); 86Assert.Equal("Debug", message.Formatter(message.State, null)); 99Assert.Equal("Information", message.Formatter(message.State, null)); 162Assert.Equal("Trace", message.Formatter(message.State, null));
Microsoft.AspNetCore.Localization.Tests (2)
CookieRequestCultureProviderTest.cs (2)
225Assert.Equal(expectedMessage, write.State.ToString()); 284Assert.Equal(expectedMessage, write.State.ToString());
Microsoft.AspNetCore.Mvc.Core.Test (34)
Filters\DisableRequestSizeLimitFilterTest.cs (3)
69write.State.ToString()); 91Assert.Equal($"A request body size limit could not be applied. The IHttpRequestBodySizeFeature for the server is read-only.", write.State.ToString()); 112Assert.Equal($"The request body size limit has been disabled.", write.State.ToString());
Filters\RequestFormLimitsFilterTest.cs (3)
76write.State.ToString()); 101write.State.ToString()); 127write.State.ToString());
Filters\RequestSizeLimitFilterTest.cs (3)
73write.State.ToString()); 96Assert.Equal($"A request body size limit could not be applied. The IHttpRequestBodySizeFeature for the server is read-only.", write.State.ToString()); 118Assert.Equal($"The maximum request body size has been set to 12345.", write.State.ToString());
Infrastructure\ActionSelectorTest.cs (1)
516Assert.Equal(expectedMessage, write.State?.ToString());
Infrastructure\ControllerActionInvokerTest.cs (1)
1574var messages = testSink.Writes.Select(write => write.State.ToString()).ToList();
Infrastructure\JsonResultExecutorTestBase.cs (2)
247Assert.Equal(expected, write.State.ToString()); 265Assert.Equal(expected, write.State.ToString());
ModelBinding\Binders\BodyModelBinderTests.cs (9)
613Assert.Equal($"Attempting to bind model of type '{typeof(Person)}' using the name 'someName' in request data ...", writeList[0].State.ToString()); 614Assert.Equal($"Rejected input formatter '{typeof(TestInputFormatter)}' for content type 'application/json'.", writeList[1].State.ToString()); 615Assert.Equal($"Selected input formatter '{typeof(TestInputFormatter)}' for content type 'application/json'.", writeList[2].State.ToString()); 644$"Attempting to bind model of type '{typeof(Person)}' using the name 'someName' in request data ...", write.State.ToString()), 646$"Rejected input formatter '{typeof(TestInputFormatter)}' for content type 'multipart/form-data'.", write.State.ToString()), 648$"Rejected input formatter '{typeof(TestInputFormatter)}' for content type 'multipart/form-data'.", write.State.ToString()), 650"No input formatter was found to support the content type 'multipart/form-data' for use with the [FromBody] attribute.", write.State.ToString()), 652$"To use model binding, remove the [FromBody] attribute from the property or parameter named '{bindingContext.ModelName}' with model type '{bindingContext.ModelType}'.", write.State.ToString()), 654$"Done attempting to bind model of type '{typeof(Person)}' using the name 'someName'.", write.State.ToString()));
MvcCoreLoggerExtensionsTest.cs (11)
63write.State.ToString()); 92write.State.ToString()); 121write.State.ToString()); 209write.State.ToString()); 255write.State.ToString()); 301write.State.ToString()); 347write.State.ToString()); 393write.State.ToString()); 424write.State.ToString()); 452write.State.ToString()); 480write.State.ToString());
Routing\MvcRouteHandlerTests.cs (1)
46Assert.Equal(expectedMessage, write.State?.ToString());
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (2)
XmlDataContractSerializerOutputFormatterTest.cs (1)
668write.State.ToString());
XmlSerializerOutputFormatterTest.cs (1)
486write.State.ToString());
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (2)
src\Mvc\Mvc.Core\test\Infrastructure\JsonResultExecutorTestBase.cs (2)
247Assert.Equal(expected, write.State.ToString()); 265Assert.Equal(expected, write.State.ToString());
Microsoft.AspNetCore.Mvc.Razor.Test (2)
TagHelpers\TagHelperComponentTagHelperTest.cs (2)
247Assert.Equal($"Tag helper component '{typeof(TestTagHelperComponent)}' initialized.", sink.Writes.First().State.ToString(), StringComparer.Ordinal); 280Assert.Equal($"Tag helper component '{typeof(TestTagHelperComponent)}' processed.", sink.Writes.First().State.ToString(), StringComparer.Ordinal);
Microsoft.AspNetCore.Mvc.RazorPages.Test (7)
Infrastructure\PageActionInvokerTest.cs (1)
1408var messages = testSink.Writes.Select(write => write.State.ToString()).ToList();
PageLoggerExtensionsTest.cs (6)
38write.State.ToString()); 66write.State.ToString()); 94write.State.ToString()); 122write.State.ToString()); 154write.State.ToString()); 185enumerator.Current.State.ToString());
Microsoft.AspNetCore.RateLimiting.Tests (1)
RateLimitingMiddlewareTests.cs (1)
162Assert.Equal("The request was canceled.", message.State.ToString());
Microsoft.AspNetCore.RequestDecompression.Tests (2)
DefaultRequestDecompressionProviderTests.cs (1)
174Assert.Equal(message, log.State.ToString());
RequestDecompressionMiddlewareTests.cs (1)
663Assert.Equal(message, log.State.ToString());
Microsoft.AspNetCore.ResponseCompression.Tests (1)
ResponseCompressionMiddlewareTest.cs (1)
1333Assert.Equal(message, log.State.ToString());
Microsoft.AspNetCore.Routing.Tests (3)
ConstraintMatcherTest.cs (1)
62Assert.Equal(expectedMessage, write.State?.ToString());
EndpointRoutingMiddlewareTest.cs (1)
88Assert.Equal(expectedMessage, write.State?.ToString());
RouterMiddlewareTest.cs (1)
93Assert.Equal(expectedMessage, write.State?.ToString());
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
CertificatePathWatcherTests.cs (1)
475var pairs = (IReadOnlyList<KeyValuePair<string, object>>)writeContext.State;
Microsoft.AspNetCore.Session.Tests (18)
SessionTests.cs (18)
369Assert.Contains("started", sessionLogMessages[0].State.ToString()); 371Assert.Contains("stored", sessionLogMessages[1].State.ToString()); 435Assert.Contains("started", sessionLogMessages[0].State.ToString()); 436Assert.Contains("stored", sessionLogMessages[1].State.ToString()); 437Assert.Contains("expired", sessionLogMessages[2].State.ToString()); 683Assert.Contains("Session cache read exception", message.State.ToString()); 732Assert.Contains("Session cache read exception", message.State.ToString()); 780Assert.Contains("Loading the session timed out.", message.State.ToString()); 881Assert.Contains("Session started", sessionLogMessage.State.ToString()); 886Assert.Contains("Error closing the session.", sessionMiddlewareLogMessage.State.ToString()); 944Assert.Contains("Session started", sessionLogMessages[0].State.ToString()); 947Assert.Contains("Committing the session timed out.", sessionLogMessages[1].State.ToString()); 952Assert.Contains("Committing the session was canceled.", sessionMiddlewareLogs[0].State.ToString()); 1011Assert.Contains("Session started", sessionLogMessages[0].State.ToString()); 1014Assert.Contains("Session stored", sessionLogMessages[1].State.ToString()); 1075Assert.Contains("Session started", sessionLogMessages[0].State.ToString()); 1078Assert.Contains("Session stored", sessionLogMessages[1].State.ToString()); 1126Assert.Contains("Error closing the session.", message.State.ToString());
Microsoft.AspNetCore.SignalR.Tests.Utils (3)
ServerLogScope.cs (1)
60logger.Log(write.LogLevel, write.EventId, write.State, write.Exception, write.Formatter);
src\Shared\SignalR\InProcessTestServer.cs (1)
144builder.AppendLine(FormattableString.Invariant($"{log.Timestamp:O} {log.Write.LoggerName} {log.Write.LogLevel}: {log.Write.Formatter(log.Write.State, log.Write.Exception)}"));
src\Shared\SignalR\VerifyNoErrorScope.cs (1)
51string lineMessage = r.LoggerName + " - " + r.EventId.ToString() + " - " + r.Formatter(r.State, r.Exception);
Microsoft.Extensions.Localization.Tests (1)
ResourceManagerStringLocalizerTest.cs (1)
140Assert.Equal("ResourceManagerStringLocalizer searched for 'a key!' in 'Resources.TestResource' with culture 'en-US'.", write.State.ToString());