359 references to Message
IIS.FunctionalTests (9)
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (1)
230Assert.Contains(TestSink.Writes, context => context.Message.Contains(version + @"\aspnetcorev2_outofprocess.dll"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\MaxRequestBodySizeTests.cs (1)
161Assert.Single(TestSink.Writes, w => w.Message.Contains("Increasing the MaxRequestBodySize conflicts with the max value for IIS limit maxAllowedContentLength." +
src\Servers\IIS\IIS\test\Common.FunctionalTests\LoggingTests.cs (6)
302Assert.Contains(TestSink.Writes, context => context.Message.Contains(firstWriteString)); 317var aspnetcorev2Log = TestSink.Writes.First(w => w.Message.Contains("Description: IIS ASP.NET Core Module V2. Commit:")); 318var aspnetcoreHandlerLog = TestSink.Writes.First(w => w.Message.Contains("Description: IIS ASP.NET Core Module V2 Request Handler. Commit:")); 321var processIdMatch = processIdPattern.Match(aspnetcorev2Log.Message); 327AssertTimestampAndPIDPrefix(processId, aspnetcorev2Log.Message); 331AssertTimestampAndPIDPrefix(processId, aspnetcoreHandlerLog.Message);
src\Servers\IIS\IIS\test\Common.FunctionalTests\MaxRequestBodySizeTests.cs (1)
162Assert.Single(TestSink.Writes, w => w.Message.Contains("Increasing the MaxRequestBodySize conflicts with the max value for IIS limit maxAllowedContentLength." +
IIS.LongTests (5)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (5)
123Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains("Invoking where.exe to find dotnet.exe"))); 155Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains($"Found dotnet.exe in InstallLocation at '{installDir}\\dotnet.exe'"))); 982Assert.Contains(TestSink.Writes, context => context.Message.Contains("An unhandled exception was thrown by the application.")); 1006Assert.Contains(TestSink.Writes, context => context.Message.Contains(expectedLogString)); 1049Assert.Contains(TestSink.Writes, context => context.Message.Contains("Is Console redirection: True"));
IIS.NewHandler.FunctionalTests (5)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (5)
123Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains("Invoking where.exe to find dotnet.exe"))); 155Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains($"Found dotnet.exe in InstallLocation at '{installDir}\\dotnet.exe'"))); 982Assert.Contains(TestSink.Writes, context => context.Message.Contains("An unhandled exception was thrown by the application.")); 1006Assert.Contains(TestSink.Writes, context => context.Message.Contains(expectedLogString)); 1049Assert.Contains(TestSink.Writes, context => context.Message.Contains("Is Console redirection: True"));
IIS.NewShim.FunctionalTests (5)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (5)
123Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains("Invoking where.exe to find dotnet.exe"))); 155Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains($"Found dotnet.exe in InstallLocation at '{installDir}\\dotnet.exe'"))); 982Assert.Contains(TestSink.Writes, context => context.Message.Contains("An unhandled exception was thrown by the application.")); 1006Assert.Contains(TestSink.Writes, context => context.Message.Contains(expectedLogString)); 1049Assert.Contains(TestSink.Writes, context => context.Message.Contains("Is Console redirection: True"));
IISExpress.FunctionalTests (15)
InProcess\AppOfflineIISExpressTests.cs (1)
58Assert.Contains(TestSink.Writes, context => context.Message.Contains("Drained all requests, notifying managed."));
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (1)
230Assert.Contains(TestSink.Writes, context => context.Message.Contains(version + @"\aspnetcorev2_outofprocess.dll"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\MaxRequestBodySizeTests.cs (1)
161Assert.Single(TestSink.Writes, w => w.Message.Contains("Increasing the MaxRequestBodySize conflicts with the max value for IIS limit maxAllowedContentLength." +
src\Servers\IIS\IIS\test\Common.FunctionalTests\LoggingTests.cs (6)
302Assert.Contains(TestSink.Writes, context => context.Message.Contains(firstWriteString)); 317var aspnetcorev2Log = TestSink.Writes.First(w => w.Message.Contains("Description: IIS ASP.NET Core Module V2. Commit:")); 318var aspnetcoreHandlerLog = TestSink.Writes.First(w => w.Message.Contains("Description: IIS ASP.NET Core Module V2 Request Handler. Commit:")); 321var processIdMatch = processIdPattern.Match(aspnetcorev2Log.Message); 327AssertTimestampAndPIDPrefix(processId, aspnetcorev2Log.Message); 331AssertTimestampAndPIDPrefix(processId, aspnetcoreHandlerLog.Message);
src\Servers\IIS\IIS\test\Common.FunctionalTests\MaxRequestBodySizeTests.cs (1)
162Assert.Single(TestSink.Writes, w => w.Message.Contains("Increasing the MaxRequestBodySize conflicts with the max value for IIS limit maxAllowedContentLength." +
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (5)
123Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains("Invoking where.exe to find dotnet.exe"))); 155Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains($"Found dotnet.exe in InstallLocation at '{installDir}\\dotnet.exe'"))); 982Assert.Contains(TestSink.Writes, context => context.Message.Contains("An unhandled exception was thrown by the application.")); 1006Assert.Contains(TestSink.Writes, context => context.Message.Contains(expectedLogString)); 1049Assert.Contains(TestSink.Writes, context => context.Message.Contains("Is Console redirection: True"));
Interop.FunctionalTests (14)
Http3\Http3RequestTests.cs (8)
1613w.Message.StartsWith("WriteAsync", StringComparison.Ordinal)); 1618w.Message.StartsWith("ReadAsync", StringComparison.Ordinal)); 1796w.Message.Contains("GOAWAY stream ID 4611686018427387903.")); 1825Assert.Contains("The client closed the connection.", connectionAbortLog.Message); 2065w.Message.Contains("GOAWAY stream ID 4611686018427387903.")); 2095w.Message.Contains("GOAWAY stream ID 4.")); 2099Assert.Contains(TestSink.Writes, m => m.Message.Contains("Some connections failed to close gracefully during server shutdown.")); 2171Assert.DoesNotContain(TestSink.Writes, m => m.Message.Contains("Some connections failed to close gracefully during server shutdown."));
HttpClientHttp2InteropTests.cs (6)
1068Assert.Single(TestSink.Writes.Where(context => context.Message.Contains("received HEADERS frame for stream ID 1 with length 16384 and flags END_STREAM"))); 1069Assert.Single(TestSink.Writes.Where(context => context.Message.Contains("received CONTINUATION frame for stream ID 1 with length 4390 and flags END_HEADERS"))); 1116Assert.Single(TestSink.Writes.Where(context => context.Message.Contains("sending HEADERS frame for stream ID 1 with length 15610 and flags END_STREAM"))); 1117Assert.Equal(2, TestSink.Writes.Where(context => context.Message.Contains("sending CONTINUATION frame for stream ID 1 with length 15585 and flags NONE")).Count()); 1118Assert.Single(TestSink.Writes.Where(context => context.Message.Contains("sending CONTINUATION frame for stream ID 1 with length 14546 and flags END_HEADERS"))); 1178=> context.Message.Contains("received HEADERS frame for stream ID 1 with length 14540 and flags END_STREAM, END_HEADERS")));
Microsoft.AspNetCore.Diagnostics.Tests (1)
ExceptionHandlerTest.cs (1)
656&& w.Message == "No exception handler was found, rethrowing original exception.");
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (10)
JsonTranscodingServiceMethodProviderTests.cs (3)
132Assert.Equal(@"Found HttpRule mapping. Method SayHello on transcoding.JsonTranscodingGreeter. HttpRule payload: { ""get"": ""/v1/greeter/{name}"" }", write.Message); 151Assert.Contains(testSink.Writes, c => c.Message == "Unable to bind GetClientStreaming on transcoding.JsonTranscodingStreaming to gRPC JSON transcoding. Client and bidirectional streaming methods are not supported."); 152Assert.Contains(testSink.Writes, c => c.Message == "Unable to bind GetBidiStreaming on transcoding.JsonTranscodingStreaming to gRPC JSON transcoding. Client and bidirectional streaming methods are not supported.");
ServerStreamingServerCallHandlerTests.cs (3)
120Assert.Equal("Error when executing service method 'TestMethodName'.", exceptionWrite.Message); 162Assert.Equal("Error status code 'Aborted' with detail 'Detail!' raised.", exceptionWrite.Message); 199Assert.Equal("Error when executing service method 'TestMethodName'.", exceptionWrite.Message);
UnaryServerCallHandlerTests.cs (4)
870Assert.Equal("Error status code 'Unauthenticated' with detail 'Detail!' raised.", exceptionWrite.Message); 1057Assert.Equal("Error when executing service method 'TestMethodName'.", exceptionWrite.Message); 1087Assert.Equal("Error when executing service method 'TestMethodName'.", exceptionWrite.Message); 1627Assert.Equal($"Error status code 'InvalidArgument' with detail 'Invalid value '{value}' for enum type NestedEnum.' raised.", exceptionWrite.Message);
Microsoft.AspNetCore.Http.Extensions.Tests (34)
RequestDelegateFactoryTests.cs (6)
1144var message = Assert.Single(TestSink.Writes).Message; 1585Assert.Equal($@"Required parameter ""{expectedType}"" was not provided from query string.", log.Message); 1686Assert.Equal(@"Required parameter ""MyNullableBindAsyncStruct myNullableBindAsyncStruct"" was not provided from MyNullableBindAsyncStruct.BindAsync(HttpContext, ParameterInfo).", log.Message); 1690Assert.Equal(@"Required parameter ""MyBindAsyncRecord myBindAsyncRecord"" was not provided from MyBindAsyncRecord.BindAsync(HttpContext, ParameterInfo).", log.Message); 1949Assert.Equal(@"Reading the request body failed with an IOException.", logMessage.Message); 1982Assert.Equal(@"Reading the request body failed with an IOException.", logMessage.Message);
RequestDelegateGenerator\CompileTimeCreationTests.cs (2)
566Assert.Equal(@"Implicit body inferred for parameter ""todo"" but no body was provided. Did you mean to use a Service instead?", log1.Message); 574Assert.Equal(@"Implicit body inferred for parameter ""todo1"" but no body was provided. Did you mean to use a Service instead?", log2.Message);
RequestDelegateGenerator\RequestDelegateCreationTests.AsParameters.cs (3)
395Assert.Equal(@"Required parameter ""string RequiredRouteParam"" was not provided from route.", logs[0].Message); 399Assert.Equal(@"Required parameter ""string RequiredQueryParam"" was not provided from query string.", logs[1].Message); 403Assert.Equal(@"Required parameter ""string RequiredHeaderParam"" was not provided from header.", logs[2].Message);
RequestDelegateGenerator\RequestDelegateCreationTests.BindAsync.cs (1)
148Assert.Equal($@"Required parameter ""{bindAsyncType} myBindAsyncParam"" was not provided from {bindAsyncType}.BindAsync{parameters}.", log.Message);
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (3)
347Assert.Equal("Expected a supported form media type but got \"application/xml\".", logMessage.Message); 943Assert.Equal("Reading the request body failed with an IOException.", logMessage.Message); 977Assert.Equal(@"Failed to read parameter ""IFormFile file"" from the request body as form.", logMessage.Message);
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBody.cs (1)
477Assert.Equal(@"Required parameter ""Todo todo"" was not provided from body.", log.Message);
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBodyOrService.cs (1)
134Assert.Equal(@"Implicit body inferred for parameter ""todo"" but no body was provided. Did you mean to use a Service instead?", log.Message);
RequestDelegateGenerator\RequestDelegateCreationTests.Logging.cs (15)
51Assert.Equal(@"Required parameter ""StringValues headerValues"" was not provided from header.", logs[0].Message); 59Assert.Equal(@"Required parameter ""StringValues queryValues"" was not provided from query string.", logs[1].Message); 67Assert.Equal(@"Required parameter ""StringValues formValues"" was not provided from form.", logs[2].Message); 75Assert.Equal(@"Required parameter ""string routeValues"" was not provided from route.", logs[3].Message); 114Assert.Equal(@"Failed to bind parameter ""int tryParsable"" from ""invalid!"".", logs[0].Message); 122Assert.Equal(@"Failed to bind parameter ""int tryParsable2"" from ""invalid again!"".", logs[1].Message); 234Assert.Equal(@"Required parameter ""MyBindAsyncRecord myBindAsyncParam1"" was not provided from MyBindAsyncRecord.BindAsync(HttpContext, ParameterInfo).", logs[0].Message); 242Assert.Equal(@"Required parameter ""MyBindAsyncRecord myBindAsyncParam2"" was not provided from MyBindAsyncRecord.BindAsync(HttpContext, ParameterInfo).", logs[1].Message); 314Assert.Equal(@"Required parameter ""MySimpleBindAsyncRecord mySimpleBindAsyncRecord1"" was not provided from MySimpleBindAsyncRecord.BindAsync(HttpContext).", logs[0].Message); 322Assert.Equal(@"Required parameter ""MySimpleBindAsyncRecord mySimpleBindAsyncRecord2"" was not provided from MySimpleBindAsyncRecord.BindAsync(HttpContext).", logs[1].Message); 404Assert.Equal("Expected a supported JSON media type but got \"application/xml\".", logMessage.Message); 453Assert.Equal("Expected a supported JSON media type but got \"application/xml\".", logMessage.Message); 494Assert.Equal("Reading the request body failed with an IOException.", logMessage.Message); 532Assert.Equal(@"Failed to read parameter ""Todo todo"" from the request body as JSON.", logMessage.Message); 612Assert.Equal(@"Failed to read parameter ""Todo todo"" from the request body as JSON.", logMessage.Message);
RequestDelegateGenerator\RequestDelegateCreationTests.QueryParameters.cs (1)
72Assert.Equal($@"Required parameter ""{expectedType}"" was not provided from {parameterSource}.", log.Message);
RequestDelegateGenerator\RuntimeCreationTests.ComplexFormBinding.cs (1)
185Assert.Equal(@"Failed to bind parameter ""Dictionary<string, bool> elements"" from the request body as form.", log.Message);
Microsoft.AspNetCore.Http.Tests (1)
ResponseCookiesTest.cs (1)
54Assert.Equal("The cookie 'TestCookie' has set 'SameSite=None' and must also set 'Secure'.", writeContext.Message);
Microsoft.AspNetCore.HttpLogging.Tests (197)
HttpLoggingMiddlewareTests.cs (197)
135Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0")); 136Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET")); 137Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http")); 138Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: /foo")); 139Assert.Contains(TestSink.Writes, w => w.Message.Contains("PathBase: /foo")); 140Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive")); 141Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Body: test")); 167Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0")); 168Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET")); 169Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http")); 170Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: /foo")); 171Assert.Contains(TestSink.Writes, w => w.Message.Contains("PathBase: /foo")); 172Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive")); 173Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: test")); 199Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0")); 200Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET")); 201Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http")); 202Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: /foo")); 203Assert.Contains(TestSink.Writes, w => w.Message.Contains("PathBase: /foo")); 204Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive")); 205Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Body: test")); 231Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0")); 232Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Method: GET")); 233Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Scheme: http")); 234Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Path: /foo")); 235Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("PathBase: /foo")); 236Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("QueryString: ?foo")); 237Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive")); 238Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Body: test")); 263Assert.Contains(TestSink.Writes, w => w.Message.Contains("foo: [Redacted]")); 264Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("foo: bar")); 283Assert.Contains(TestSink.Writes, w => w.Message.Contains("foo: bar")); 284Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("foo: [Redacted]")); 285Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: [Redacted]")); 286Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive")); 303Assert.Contains(TestSink.Writes, w => w.Message.Contains("RequestBody: [Not consumed by app]")); 334Assert.Contains(TestSink.Writes, w => w.Message.Contains(expected)); 362Assert.Contains(TestSink.Writes, w => w.Message.Contains(expected)); 390Assert.Contains(TestSink.Writes, w => w.Message.Contains(expected)); 427Assert.Contains(TestSink.Writes, w => w.Message.Equals("RequestBody: " + expected)); 463Assert.Contains(TestSink.Writes, w => w.Message.Equals("RequestBody: " + expected)); 488Assert.Contains(TestSink.Writes, w => w.Message.Equals("RequestBody: " + expected)); 514Assert.Contains(TestSink.Writes, w => w.Message.Equals("RequestBody: " + expected)); 552Assert.Contains(TestSink.Writes, w => w.Message.Contains(expected)); 592Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains(expected)); 593Assert.Contains(TestSink.Writes, w => w.Message.Contains("Unrecognized Content-Type for request body.")); 631Assert.Contains(TestSink.Writes, w => w.Message.Contains(expected)); 669Assert.Contains(TestSink.Writes, w => w.Message.Contains("RequestBody:")); 670Assert.Contains(TestSink.Writes, w => w.Message.Contains(expected)); 708Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("RequestBody:")); 744Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0")); 745Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET")); 746Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http")); 747Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: /foo")); 748Assert.Contains(TestSink.Writes, w => w.Message.Contains("PathBase: /foo")); 749Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive")); 750Assert.Contains(TestSink.Writes, w => w.Message.Contains("RequestBody: test")); 751Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 418")); 752Assert.Contains(TestSink.Writes, w => w.Message.Contains("Content-Type: text/plain")); 753Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: Hello World")); 771Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0")); 772Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET")); 773Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http")); 774Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: /foo")); 775Assert.Contains(TestSink.Writes, w => w.Message.Contains("PathBase: /foo")); 776Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive")); 777Assert.Contains(TestSink.Writes, w => w.Message.Contains("RequestBody: test")); 778Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 418")); 779Assert.Contains(TestSink.Writes, w => w.Message.Contains("Content-Type: text/plain")); 780Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: Hello World")); 781Assert.Contains(TestSink.Writes, w => w.Message.Contains("foo: bar")); 800Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0")); 801Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET")); 802Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http")); 803Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Path: /foo")); 804Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("PathBase: /foo")); 805Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive")); 806Assert.Contains(TestSink.Writes, w => w.Message.Contains("RequestBody: test")); 807Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 418")); 808Assert.Contains(TestSink.Writes, w => w.Message.Contains("Content-Type: text/plain")); 809Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: Hello World")); 810Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: ReplacedPath")); 828Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 200")); 829Assert.Contains(TestSink.Writes, w => w.Message.Contains("Transfer-Encoding: test")); 830Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Body: test")); 852Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 200")); 853Assert.Contains(TestSink.Writes, w => w.Message.Contains("Transfer-Encoding: test")); 854Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: test")); 876Assert.Contains(TestSink.Writes, w => w.Message.StartsWith("Duration: ", StringComparison.Ordinal)); 899Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 200")); 900Assert.Contains(TestSink.Writes, w => w.Message.Contains("Transfer-Encoding: test")); 924Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 200")); 925Assert.Contains(TestSink.Writes, w => w.Message.Contains("Transfer-Encoding: test")); 926Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: test")); 948Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 200")); 949Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Server: Kestrel")); 950Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Body: test")); 972Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("StatusCode: 200")); 973Assert.Contains(TestSink.Writes, w => w.Message.Contains("Transfer-Encoding: test")); 974Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Body: test")); 994Assert.Contains(TestSink.Writes, w => w.Message.Contains("Test: [Redacted]")); 1017Assert.Contains(TestSink.Writes, w => w.Message.Contains("Test: Kestrel")); 1018Assert.Contains(TestSink.Writes, w => w.Message.Contains("Server: [Redacted]")); 1039Assert.Contains(TestSink.Writes, w => w.Message.Contains(expected)); 1081Assert.Contains(TestSink.Writes, w => w.Message.Contains(expected)); 1111Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 200")); 1112Assert.Contains(TestSink.Writes, w => w.Message.Contains("Transfer-Encoding: test")); 1113Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Body: test")); 1119Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: test")); 1149Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 200")); 1150Assert.Contains(TestSink.Writes, w => w.Message.Contains("Transfer-Encoding: test")); 1151Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Body: test")); 1176Assert.Contains(TestSink.Writes, w => w.Message.Contains("Unrecognized Content-Type for response body.")); 1191Assert.Contains(TestSink.Writes, w => w.Message.Contains("No Content-Type header for request body.")); 1230Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 101")); 1277Assert.Equal("No Content-Type header for request body.", contentTypeLog.Message); 1280var lines = requestLog.Message.Split(Environment.NewLine); 1334Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: Upgrade")); 1377Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("StatusCode: 101")); 1378Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Connection: Upgrade")); 1411Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 200")); 1412Assert.Contains(TestSink.Writes, w => w.Message.Contains("Transfer-Encoding: test")); 1413Assert.Contains(TestSink.Writes, w => w.Message.Contains("Content-Type: text/plain")); 1528var lines = Assert.Single(TestSink.Writes.Where(w => w.LogLevel >= LogLevel.Information)).Message.Split(Environment.NewLine); 1590var lines = Assert.Single(TestSink.Writes).Message.Split(Environment.NewLine); 1624Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0")); 1625Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET")); 1626Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http")); 1627Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: /foo")); 1628Assert.Contains(TestSink.Writes, w => w.Message.Contains("PathBase: /foo")); 1629Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive")); 1630Assert.Contains(TestSink.Writes, w => w.Message.Contains("RequestBody: test")); 1632Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("StatusCode: 418")); 1633Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Content-Type: text/plain; p=response")); 1634Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Body: Hello World")); 1652Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0")); 1653Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Method: GET")); 1654Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Scheme: http")); 1655Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Path: /foo")); 1656Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("PathBase: /foo")); 1657Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive")); 1658Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("RequestBody: test")); 1660Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 418")); 1661Assert.Contains(TestSink.Writes, w => w.Message.Contains("Content-Type: text/plain")); 1662Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: Hello World")); 1680Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0")); 1681Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET")); 1682Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http")); 1683Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: /foo")); 1684Assert.Contains(TestSink.Writes, w => w.Message.Contains("PathBase: /foo")); 1685Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive")); 1686Assert.Contains(TestSink.Writes, w => w.Message.Contains("RequestBody: test")); 1687Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 418")); 1688Assert.Contains(TestSink.Writes, w => w.Message.Contains("Content-Type: text/plain")); 1689Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: Hello World")); 1690Assert.Contains(TestSink.Writes, w => w.Message.Contains("foo: bar")); 1709Assert.Contains(TestSink.Writes, w => w.Message.Contains("Protocol: HTTP/1.0")); 1710Assert.Contains(TestSink.Writes, w => w.Message.Contains("Method: GET")); 1711Assert.Contains(TestSink.Writes, w => w.Message.Contains("Scheme: http")); 1712Assert.Contains(TestSink.Writes, w => w.Message.Contains("Path: /foo")); 1713Assert.Contains(TestSink.Writes, w => w.Message.Contains("PathBase: /foo")); 1714Assert.Contains(TestSink.Writes, w => w.Message.Contains("Connection: keep-alive")); 1715Assert.Contains(TestSink.Writes, w => w.Message.Contains("RequestBody: test")); 1717Assert.DoesNotContain(TestSink.Writes, w => w.Message.Contains("StatusCode: 418")); 1718Assert.Contains(TestSink.Writes, w => w.Message.Contains("Content-Type: text/plain")); 1719Assert.Contains(TestSink.Writes, w => w.Message.Contains("Body: Hello World")); 1720Assert.Contains(TestSink.Writes, w => w.Message.Contains("StatusCode: 412")); 1734Assert.DoesNotContain(filteredLogs, w => w.Message.Contains("Request")); 1735Assert.Contains(filteredLogs, w => w.Message.Contains("StatusCode: 200")); 1749Assert.Contains(filteredLogs, w => w.Message.Contains("Request")); 1750Assert.Contains(filteredLogs, w => w.Message.Contains("StatusCode: 200")); 1764Assert.DoesNotContain(filteredLogs, w => w.Message.Contains("Scheme")); 1765Assert.DoesNotContain(filteredLogs, w => w.Message.Contains("StatusCode: 200")); 1781Assert.Contains(filteredLogs, w => w.Message.Equals("RequestBody: fro[Truncated by RequestBodyLogLimit]")); 1782Assert.Contains(filteredLogs, w => w.Message.Equals("ResponseBody: testin")); 1807Assert.Contains(filteredLogs, w => w.Message.Contains("Request")); 1808Assert.DoesNotContain(filteredLogs, w => w.Message.Contains("Accept")); 1809Assert.Contains(filteredLogs, w => w.Message.Contains("StatusCode: 200")); 1810Assert.DoesNotContain(filteredLogs, w => w.Message.Contains("Content-Type: text/plain")); 1824Assert.DoesNotContain(filteredLogs, w => w.Message.Contains("Request")); 1825Assert.Contains(filteredLogs, w => w.Message.Contains("StatusCode: 200")); 1839Assert.Contains(filteredLogs, w => w.Message.Contains("Request")); 1840Assert.Contains(filteredLogs, w => w.Message.Contains("StatusCode: 200")); 1854Assert.DoesNotContain(filteredLogs, w => w.Message.Contains("Scheme")); 1855Assert.DoesNotContain(filteredLogs, w => w.Message.Contains("StatusCode: 200")); 1871Assert.Contains(filteredLogs, w => w.Message.Equals("RequestBody: fro[Truncated by RequestBodyLogLimit]")); 1872Assert.Contains(filteredLogs, w => w.Message.Equals("ResponseBody: testin")); 1897Assert.Contains(filteredLogs, w => w.Message.Contains("Request")); 1898Assert.DoesNotContain(filteredLogs, w => w.Message.Contains("Accept")); 1899Assert.Contains(filteredLogs, w => w.Message.Contains("StatusCode: 200")); 1900Assert.DoesNotContain(filteredLogs, w => w.Message.Contains("Content-Type: text/plain")); 1944var requestLog = Assert.Single(filteredLogs, w => w.Message.Contains("Request:")); 1945Assert.Contains("i0request: v0", requestLog.Message); 1946Assert.Contains("i1request: v1", requestLog.Message); 1948var responseLog = Assert.Single(filteredLogs, w => w.Message.Contains("Response:")); 1949Assert.Contains("i0response: v0", responseLog.Message); 1950Assert.Contains("i1response: v1", responseLog.Message);
Microsoft.AspNetCore.InternalTesting (1)
Logging\WriteContext.cs (1)
34return $"{LogLevel} {LoggerName}: {Message}";
Microsoft.AspNetCore.Mvc.FunctionalTests (2)
ApiExplorerTest.cs (2)
1564Assert.Contains(TestSink.Writes, w => w.Message.Equals("Executing API description provider 'DefaultApiDescriptionProvider' from assembly Microsoft.AspNetCore.Mvc.ApiExplorer v10.0.0.0.", StringComparison.Ordinal)); 1565Assert.Contains(TestSink.Writes, w => w.Message.Equals("Executing API description provider 'JsonPatchOperationsArrayProvider' from assembly Microsoft.AspNetCore.Mvc.NewtonsoftJson v42.42.42.42.", StringComparison.Ordinal));
Microsoft.AspNetCore.Routing.Tests (24)
DefaultLinkParserTest.cs (5)
37w => Assert.Equal("No endpoints found for address 0", w.Message)); 59w => Assert.Equal("Found the endpoints Test2 for address 0", w.Message), 60w => Assert.Equal("Path parsing failed for endpoints Test2 and URI path /", w.Message)); 83w => Assert.Equal("Found the endpoints Test1, Test2, Test3 for address 0", w.Message), 84w => Assert.Equal("Path parsing succeeded for endpoint Test2 and URI path /Home/Index/17", w.Message));
EndpointRoutingMiddlewareTest.cs (6)
260Assert.Equal("Matched endpoint 'myapp' is a fallback endpoint.", write.Message); 294Assert.Equal($"A request body size limit could not be applied. The {nameof(IHttpMaxRequestBodySizeFeature)} for the server is read-only.", write.Message); 323Assert.Equal($"A request body size limit could not be applied. This server does not support the {nameof(IHttpMaxRequestBodySizeFeature)}.", write.Message); 351Assert.Equal($"The endpoint does not specify the {nameof(IRequestSizeLimitMetadata)}.", write.Message); 385Assert.Equal("The maximum request body size has been disabled.", write.Message); 390Assert.Equal($"The maximum request body size has been set to {expectedRequestSizeLimit}.", write.Message);
Matching\DfaMatcherTest.cs (13)
804Assert.Equal("No candidates found for the request path '/'", log.Message); 834Assert.Equal("1 candidate(s) found for the request path '/One'", log.Message); 839Assert.Equal("Endpoint '/{p:int}' with route pattern '/{p:int}' was rejected by constraint 'p':'Microsoft.AspNetCore.Routing.Constraints.IntRouteConstraint' with value 'One' for the request path '/One'", log.Message); 844Assert.Equal("Endpoint '/{p:int}' with route pattern '/{p:int}' is not valid for the request path '/One'", log.Message); 874Assert.Equal("1 candidate(s) found for the request path '/One'", log.Message); 879Assert.Equal("Endpoint '/x-{id}-y' with route pattern '/x-{id}-y' was rejected by complex segment 'x-{id}-y' for the request path '/One'", log.Message); 884Assert.Equal("Endpoint '/x-{id}-y' with route pattern '/x-{id}-y' is not valid for the request path '/One'", log.Message); 916Assert.Equal("3 candidate(s) found for the request path '/One'", log.Message); 921Assert.Equal("Endpoint '/{one}' with route pattern '/{one}' is valid for the request path '/One'", log.Message); 926Assert.Equal("Endpoint '/{p:int}' with route pattern '/{p:int}' was rejected by constraint 'p':'Microsoft.AspNetCore.Routing.Constraints.IntRouteConstraint' with value 'One' for the request path '/One'", log.Message); 931Assert.Equal("Endpoint '/{p:int}' with route pattern '/{p:int}' is not valid for the request path '/One'", log.Message); 936Assert.Equal("Endpoint '/x-{id}-y' with route pattern '/x-{id}-y' was rejected by complex segment 'x-{id}-y' for the request path '/One'", log.Message); 941Assert.Equal("Endpoint '/x-{id}-y' with route pattern '/x-{id}-y' is not valid for the request path '/One'", log.Message);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (3)
ConnectionDispatcherTests.cs (1)
115Assert.Equal("An error occurred running an IConnectionCompleteFeature.OnCompleted callback.", errors[0].Message);
HeartbeatTests.cs (1)
136var warningMessage = TestSink.Writes.Single(message => message.LogLevel == LogLevel.Warning).Message;
MessageBodyTests.cs (1)
839m.Message.Contains(@"Connection id ""ConnectionId"", Request id ""RequestId"": started reading request body."));
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (4)
QuicStreamContextTests.cs (3)
51Assert.Contains(TestSink.Writes, m => m.Message.Contains(@"shutting down writes because: ""The QUIC transport's send loop completed gracefully."".")); 435Assert.Contains(TestSink.Writes, m => m.Message.Contains(@"shutting down writes because: ""The QUIC transport's send loop completed gracefully."".")); 479Assert.Contains(TestSink.Writes, m => m.Message.Contains(@"shutting down writes because: ""Test message""."));
WebHostTests.cs (1)
168Assert.Contains(TestSink.Writes, w => w.Message == CoreStrings.DynamicPortOnMultipleTransportsNotSupported);
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (24)
HubConnectionTests.cs (24)
1793Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/2 POST")); 1794Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/2 CONNECT")); 1795Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request finished HTTP/2 CONNECT")); 1852Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/1.1 POST")); 1853Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/1.1 GET")); 1854Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request finished HTTP/1.1 GET")); 1962Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/2 POST")); 1963Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/2 CONNECT")); 1964Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request finished HTTP/2 CONNECT")); 2404Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/2 POST") && context.Message.Contains("/negotiate?")); 2407Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/2 POST") && context.Message.Contains("?id=")); 2408Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request finished HTTP/2 GET") && context.Message.Contains("?id=")); 2411Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request finished HTTP/2 DELETE") && context.Message.Contains("?id=")); 2500Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/2 POST") && context.Message.Contains("/negotiate?")); 2503Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request starting HTTP/2 POST") && context.Message.Contains("?id=")); 2504Assert.Contains(TestSink.Writes, context => context.Message.Contains("Request finished HTTP/2 GET") && context.Message.Contains("?id=")); 2737Assert.EndsWith("The name of the user changed from 'test1' to 'test2'.", changeLog.Message);
Microsoft.AspNetCore.SignalR.Client.Tests (2)
HubConnectionTests.Reconnect.cs (2)
363Assert.Contains($"after {reconnectingCount} failed attempts", attemptsLog.Write.Message); 368Assert.Contains($"Reconnect attempt number 1 will start in ", waitingLog.Write.Message);
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
RedisHubLifetimeManagerTests.cs (1)
124Assert.Equal("Error connecting to Redis.", logs[0].Message);
Microsoft.AspNetCore.StaticFiles.Tests (2)
StaticFileMiddlewareTests.cs (2)
43Assert.Contains(TestSink.Writes, w => w.Message.Contains("The WebRootPath was not found") 44&& w.Message.Contains("Static files may be unavailable."));