1 implementation of Writes
Microsoft.AspNetCore.InternalTesting (1)
Logging\TestSink.cs (1)
31public IProducerConsumerCollection<WriteContext> Writes { get => _writes; set => _writes = new ConcurrentQueue<WriteContext>(value); }
365 references to Writes
IIS.FunctionalTests (6)
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 (3)
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:"));
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"));
IIS.Tests (4)
ClientDisconnectTests.cs (1)
347Assert.Single(TestSink.Writes, w => w.EventId.Name == "ConnectionDisconnect");
MaxRequestBodySizeTests.cs (2)
357var appErrorLog = Assert.Single(TestSink.Writes, w => w.LoggerName == "Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer" && w.LogLevel > LogLevel.Debug); 358var badRequestLog = Assert.Single(TestSink.Writes, w => w.LoggerName == "Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer" && w.EventId == new EventId(4, "ConnectionBadRequest"));
StrictTestServerTests.cs (1)
20if (TestSink.Writes.FirstOrDefault(w => w.LogLevel > LogLevel.Information) is WriteContext writeContext)
IISExpress.FunctionalTests (12)
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 (3)
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:"));
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"));
InMemory.FunctionalTests (16)
BadHttpRequestTests.cs (2)
227Assert.All(TestSink.Writes.Where(w => w.LoggerName != "Microsoft.Hosting.Lifetime"), w => Assert.InRange(w.LogLevel, LogLevel.Trace, LogLevel.Debug)); 228Assert.Contains(TestSink.Writes, w => w.EventId.Id == 17);
ChunkedRequestTests.cs (1)
1072Assert.All(TestSink.Writes, w => Assert.InRange(w.LogLevel, LogLevel.Trace, LogLevel.Information));
Http2\Http2StreamTests.cs (1)
4723Assert.Contains(TestSink.Writes, w => w.EventId.Id == 13 && w.LogLevel == LogLevel.Error
Http2\Http2TimeoutTests.cs (1)
234Assert.Contains(TestSink.Writes, w => w.EventId.Name == "ResponseMinimumDataRateNotSatisfied");
Http3\Http3TimeoutTests.cs (1)
418Assert.Contains(TestSink.Writes, w => w.EventId.Name == "ResponseMinimumDataRateNotSatisfied");
RequestBodyTimeoutTests.cs (2)
143Assert.Contains(TestSink.Writes, w => w.EventId.Id == 32 && w.LogLevel == LogLevel.Information); 144Assert.Contains(TestSink.Writes, w => w.EventId.Id == 33 && w.LogLevel == LogLevel.Information);
RequestTests.cs (1)
2030Assert.All(TestSink.Writes, w => Assert.InRange(w.LogLevel, LogLevel.Trace, LogLevel.Information));
ResponseTests.cs (7)
510Assert.Contains(TestSink.Writes, w => w.EventId.Id == 17 && w.LogLevel <= LogLevel.Debug && w.Exception is BadHttpRequestException 1148Assert.Contains(TestSink.Writes, 1205Assert.Contains(TestSink.Writes, 1257Assert.DoesNotContain(TestSink.Writes, c => c.EventId.Name == "ApplicationError"); 4133Assert.Contains(TestSink.Writes, w => w.EventId.Id == 13 && w.LogLevel == LogLevel.Error 4764Assert.Contains(testSink.Writes, w => w.EventId.Id == 17 && w.LogLevel <= LogLevel.Debug && w.Exception is BadHttpRequestException 4770Assert.DoesNotContain(testSink.Writes, w => w.EventId.Id == 17);
Interop.FunctionalTests (14)
Http3\Http3RequestTests.cs (8)
1054var badLogWrite = TestSink.Writes.FirstOrDefault(w => w.LogLevel == LogLevel.Critical); 1140var badLogWrite = TestSink.Writes.FirstOrDefault(w => w.LogLevel >= LogLevel.Critical); 1611var hasWriteLog = TestSink.Writes.Any( 1616var hasReadLog = TestSink.Writes.Any( 1905Assert.Single(TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel.Transport.Quic" && 1921if (testLogs(TestSink.Writes)) 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"))); 1177Assert.Single(TestSink.Writes.Where(context
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (7)
ServerStreamingServerCallHandlerTests.cs (3)
119var exceptionWrite = TestSink.Writes.Single(w => w.EventId.Name == "ErrorExecutingServiceMethod"); 161var exceptionWrite = TestSink.Writes.Single(w => w.EventId.Name == "RpcConnectionError"); 198var exceptionWrite = TestSink.Writes.Single(w => w.EventId.Name == "ErrorExecutingServiceMethod");
UnaryServerCallHandlerTests.cs (4)
869var exceptionWrite = TestSink.Writes.Single(w => w.EventId.Name == "RpcConnectionError"); 1056var exceptionWrite = TestSink.Writes.Single(w => w.EventId.Name == "ErrorExecutingServiceMethod"); 1086var exceptionWrite = TestSink.Writes.Single(w => w.EventId.Name == "ErrorExecutingServiceMethod"); 1626var exceptionWrite = TestSink.Writes.Single(w => w.EventId.Name == "RpcConnectionError");
Microsoft.AspNetCore.Hosting.Tests (3)
WebHostBuilderTests.cs (3)
1077Assert.Contains(sink.Writes, w => w.State.ToString() == "From startup"); 1230Assert.Contains(sink.Writes, w => w.Exception?.Message == "Startup exception"); 1254Assert.Contains(testSink.Writes, w => w.Exception?.Message == "Startup exception");
Microsoft.AspNetCore.Http.Extensions.Tests (33)
RequestDelegateFactoryTests.cs (6)
771Assert.Empty(TestSink.Writes); 1144var message = Assert.Single(TestSink.Writes).Message; 1576var logs = TestSink.Writes.ToArray(); 1680var log = Assert.Single(TestSink.Writes); 1947var logMessage = Assert.Single(TestSink.Writes); 1980var logMessage = Assert.Single(TestSink.Writes);
RequestDelegateGenerator\CompileTimeCreationTests.cs (2)
389Assert.All(TestSink.Writes, context => Assert.Equal("RequiredParameterNotProvided", context.EventId.Name)); 558var logs = TestSink.Writes.ToArray();
RequestDelegateGenerator\RequestDelegateCreationTests.AsParameters.cs (1)
389var logs = TestSink.Writes.ToArray();
RequestDelegateGenerator\RequestDelegateCreationTests.BindAsync.cs (1)
142var log = Assert.Single(TestSink.Writes);
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (4)
344var logMessage = Assert.Single(TestSink.Writes); 940var logMessage = Assert.Single(TestSink.Writes); 974var logMessage = Assert.Single(TestSink.Writes); 1014Assert.Empty(TestSink.Writes);
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBody.cs (1)
469var logs = TestSink.Writes.ToArray();
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBodyOrService.cs (1)
129var logs = TestSink.Writes.ToArray();
RequestDelegateGenerator\RequestDelegateCreationTests.Logging.cs (15)
45var logs = TestSink.Writes.ToArray(); 108var logs = TestSink.Writes.ToArray(); 162Assert.Empty(TestSink.Writes); 199Assert.Empty(TestSink.Writes); 228var logs = TestSink.Writes.ToArray(); 279Assert.Empty(TestSink.Writes); 308var logs = TestSink.Writes.ToArray(); 358Assert.Empty(TestSink.Writes); 401var logMessage = Assert.Single(TestSink.Writes); 450var logMessage = Assert.Single(TestSink.Writes); 491var logMessage = Assert.Single(TestSink.Writes); 529var logMessage = Assert.Single(TestSink.Writes); 572Assert.Empty(TestSink.Writes); 609var logMessage = Assert.Single(TestSink.Writes); 651Assert.Empty(TestSink.Writes);
RequestDelegateGenerator\RequestDelegateCreationTests.QueryParameters.cs (1)
62var logs = TestSink.Writes.ToArray();
RequestDelegateGenerator\RuntimeCreationTests.ComplexFormBinding.cs (1)
179var logs = TestSink.Writes.ToArray();
Microsoft.AspNetCore.Http.Tests (1)
ApplicationBuilderTests.cs (1)
124Assert.DoesNotContain(TestSink.Writes, w => w.EventId.Name == "RequestPipelineEnd");
Microsoft.AspNetCore.HttpLogging.Tests (182)
HttpLoggingMiddlewareTests.cs (182)
112Assert.Empty(TestSink.Writes); 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:")); 726Assert.Empty(TestSink.Writes); 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)); 1059Assert.Empty(TestSink.Writes); 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")); 1276Assert.True(TestSink.Writes.TryTake(out var contentTypeLog)); 1279Assert.True(TestSink.Writes.TryTake(out var requestLog)); 1295Assert.False(TestSink.Writes.TryTake(out var _)); 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")); 1733var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1748var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1763var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1780var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1806var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1823var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1838var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1853var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1870var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1896var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging")); 1942var filteredLogs = TestSink.Writes.Where(w => w.LoggerName.Contains("HttpLogging"));
Microsoft.AspNetCore.Identity.FunctionalTests (4)
MapIdentityApiTests.cs (4)
443Assert.Single(TestSink.Writes, w => 470Assert.DoesNotContain(TestSink.Writes, w => 497Assert.Single(TestSink.Writes, w => 522Assert.Single(TestSink.Writes, w =>
Microsoft.AspNetCore.InternalTesting.Tests (5)
LoggedTestXunitTests.cs (5)
73var message = Assert.Single(TestSink.Writes); 84var message = Assert.Single(TestSink.Writes); 97var message = Assert.Single(TestSink.Writes); 140Assert.Equal(TestSink.Writes.Single(), context); 160var message = Assert.Single(TestSink.Writes);
Microsoft.AspNetCore.Mvc.FunctionalTests (4)
ApiExplorerTest.cs (4)
1562Assert.Contains(TestSink.Writes, w => w.EventId.Name?.Equals("ApiDescriptionProviderExecuting", StringComparison.Ordinal) == true); 1563Assert.Contains(TestSink.Writes, w => w.LoggerName.Equals("Microsoft.AspNetCore.Mvc.ApiExplorer.ApiDescriptionGroupCollectionProvider", StringComparison.Ordinal)); 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.Server.HttpSys.FunctionalTests (1)
RequestTests.cs (1)
397var errorLogs = TestSink.Writes.Where(w => w.LogLevel >= LogLevel.Error).Select(w => w.Exception);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (10)
CertificatePathWatcherTests.cs (1)
474var writeContext = Assert.Single(testSink.Writes.Where(wc => wc.EventId.Name == eventName));
ConnectionDispatcherTests.cs (2)
66var critical = TestSink.Writes.SingleOrDefault(m => m.LogLevel == LogLevel.Critical); 113var errors = TestSink.Writes.Where(e => e.LogLevel >= LogLevel.Error).ToArray();
HeartbeatTests.cs (3)
136var warningMessage = TestSink.Writes.Single(message => message.LogLevel == LogLevel.Warning).Message; 179Assert.DoesNotContain(TestSink.Writes, w => w.EventId.Name == "HeartbeatSlow"); 197Assert.Equal(ex, TestSink.Writes.Single(message => message.LogLevel == LogLevel.Error).Exception);
HttpConnectionManagerTests.cs (2)
36Assert.Single(TestSink.Writes.Where(c => c.EventId.Name == "ApplicationNeverCompleted")); 56Assert.DoesNotContain(TestSink.Writes, c => c.EventId.Name == "ApplicationNeverCompleted");
MessageBodyTests.cs (2)
778Assert.Contains(TestSink.Writes, 837Assert.Contains(TestSink.Writes,
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 (17)
HubConnectionTests.cs (17)
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=")); 2736var changeLog = Assert.Single(TestSink.Writes.Where(w => w.EventId.Name == "UserNameChanged"));
Microsoft.AspNetCore.SignalR.Tests (11)
HubConnectionHandlerTests.ClientResult.cs (4)
96Assert.Single(TestSink.Writes.Where(write => write.EventId.Name == "ErrorDispatchingHubEvent")); 127Assert.Single(TestSink.Writes.Where(write => write.EventId.Name == "ErrorDispatchingHubEvent")); 395Assert.Contains(TestSink.Writes, c => c.EventId.Name == "UnexpectedCompletion"); 440Assert.Contains(TestSink.Writes, c => c.EventId.Name == "UnexpectedCompletion");
HubConnectionHandlerTests.cs (7)
499var exceptionLog = TestSink.Writes.Where(w => string.Equals(w.LoggerName, "Microsoft.AspNetCore.SignalR.HubConnectionHandler") && 529var exceptionLog = TestSink.Writes.Where(w => string.Equals(w.LoggerName, "Microsoft.AspNetCore.SignalR.HubConnectionHandler") && 580var exceptionLog = TestSink.Writes.Where(w => string.Equals(w.LoggerName, "Microsoft.AspNetCore.SignalR.HubConnectionHandler") && 3958Assert.Single(TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && 3983Assert.Single(TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && 4158Assert.Single(TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && 4195Assert.Single(TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" &&
Microsoft.AspNetCore.StaticFiles.Tests (1)
StaticFileMiddlewareTests.cs (1)
43Assert.Contains(TestSink.Writes, w => w.Message.Contains("The WebRootPath was not found")
Sockets.FunctionalTests (15)
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (3)
928Assert.Single(TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel.Connections" && 1038Assert.Single(TestSink.Writes.Where(c => c.EventId.Name == "ConnectionStop")); 1090Assert.Single(TestSink.Writes.Where(c => c.EventId.Name == "ConnectionStop"));
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (12)
346Assert.Equal(1, TestSink.Writes.Count(w => w.EventId.Name == "ConnectionStop")); 399var presShutdownTransportLogs = TestSink.Writes.Where( 411var coreLogs = TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel.Connections"); 414var transportLogs = TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel" || 451var transportLogs = TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets"); 455var coreLogs = TestSink.Writes.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel"); 922Assert.Equal(0, TestSink.Writes.Count(w => w.EventId.Name == "ResponseMinimumDataRateNotSatisfied")); 923Assert.Equal(1, TestSink.Writes.Count(w => w.EventId.Name == "ConnectionStop")); 1007Assert.Equal(0, TestSink.Writes.Count(w => w.EventId.Name == "ResponseMinimumDataRateNotSatisfied")); 1008Assert.Equal(1, TestSink.Writes.Count(w => w.EventId.Name == "ConnectionStop")); 1085Assert.Equal(0, TestSink.Writes.Count(w => w.EventId.Name == "ResponseMinimumDataRateNotSatisfied")); 1086Assert.Equal(1, TestSink.Writes.Count(w => w.EventId.Name == "ConnectionStop"));