1 implementation of Writes
Microsoft.AspNetCore.InternalTesting (1)
Logging\TestSink.cs (1)
31
public 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)
230
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains(version + @"\aspnetcorev2_outofprocess.dll"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\MaxRequestBodySizeTests.cs (1)
161
Assert.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)
302
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains(firstWriteString));
317
var aspnetcorev2Log = TestSink.
Writes
.First(w => w.Message.Contains("Description: IIS ASP.NET Core Module V2. Commit:"));
318
var 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)
162
Assert.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)
123
Assert.Equal(1, TestSink.
Writes
.Count(w => w.Message.Contains("Invoking where.exe to find dotnet.exe")));
155
Assert.Equal(1, TestSink.
Writes
.Count(w => w.Message.Contains($"Found dotnet.exe in InstallLocation at '{installDir}\\dotnet.exe'")));
982
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("An unhandled exception was thrown by the application."));
1006
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains(expectedLogString));
1049
Assert.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)
123
Assert.Equal(1, TestSink.
Writes
.Count(w => w.Message.Contains("Invoking where.exe to find dotnet.exe")));
155
Assert.Equal(1, TestSink.
Writes
.Count(w => w.Message.Contains($"Found dotnet.exe in InstallLocation at '{installDir}\\dotnet.exe'")));
982
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("An unhandled exception was thrown by the application."));
1006
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains(expectedLogString));
1049
Assert.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)
123
Assert.Equal(1, TestSink.
Writes
.Count(w => w.Message.Contains("Invoking where.exe to find dotnet.exe")));
155
Assert.Equal(1, TestSink.
Writes
.Count(w => w.Message.Contains($"Found dotnet.exe in InstallLocation at '{installDir}\\dotnet.exe'")));
982
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("An unhandled exception was thrown by the application."));
1006
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains(expectedLogString));
1049
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Is Console redirection: True"));
IIS.Tests (4)
ClientDisconnectTests.cs (1)
347
Assert.Single(TestSink.
Writes
, w => w.EventId.Name == "ConnectionDisconnect");
MaxRequestBodySizeTests.cs (2)
357
var appErrorLog = Assert.Single(TestSink.
Writes
, w => w.LoggerName == "Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer" && w.LogLevel > LogLevel.Debug);
358
var badRequestLog = Assert.Single(TestSink.
Writes
, w => w.LoggerName == "Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer" && w.EventId == new EventId(4, "ConnectionBadRequest"));
StrictTestServerTests.cs (1)
20
if (TestSink.
Writes
.FirstOrDefault(w => w.LogLevel > LogLevel.Information) is WriteContext writeContext)
IISExpress.FunctionalTests (12)
InProcess\AppOfflineIISExpressTests.cs (1)
58
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Drained all requests, notifying managed."));
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (1)
230
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains(version + @"\aspnetcorev2_outofprocess.dll"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\MaxRequestBodySizeTests.cs (1)
161
Assert.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)
302
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains(firstWriteString));
317
var aspnetcorev2Log = TestSink.
Writes
.First(w => w.Message.Contains("Description: IIS ASP.NET Core Module V2. Commit:"));
318
var 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)
162
Assert.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)
123
Assert.Equal(1, TestSink.
Writes
.Count(w => w.Message.Contains("Invoking where.exe to find dotnet.exe")));
155
Assert.Equal(1, TestSink.
Writes
.Count(w => w.Message.Contains($"Found dotnet.exe in InstallLocation at '{installDir}\\dotnet.exe'")));
982
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("An unhandled exception was thrown by the application."));
1006
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains(expectedLogString));
1049
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Is Console redirection: True"));
InMemory.FunctionalTests (16)
BadHttpRequestTests.cs (2)
227
Assert.All(TestSink.
Writes
.Where(w => w.LoggerName != "Microsoft.Hosting.Lifetime"), w => Assert.InRange(w.LogLevel, LogLevel.Trace, LogLevel.Debug));
228
Assert.Contains(TestSink.
Writes
, w => w.EventId.Id == 17);
ChunkedRequestTests.cs (1)
1072
Assert.All(TestSink.
Writes
, w => Assert.InRange(w.LogLevel, LogLevel.Trace, LogLevel.Information));
Http2\Http2StreamTests.cs (1)
4723
Assert.Contains(TestSink.
Writes
, w => w.EventId.Id == 13 && w.LogLevel == LogLevel.Error
Http2\Http2TimeoutTests.cs (1)
234
Assert.Contains(TestSink.
Writes
, w => w.EventId.Name == "ResponseMinimumDataRateNotSatisfied");
Http3\Http3TimeoutTests.cs (1)
418
Assert.Contains(TestSink.
Writes
, w => w.EventId.Name == "ResponseMinimumDataRateNotSatisfied");
RequestBodyTimeoutTests.cs (2)
143
Assert.Contains(TestSink.
Writes
, w => w.EventId.Id == 32 && w.LogLevel == LogLevel.Information);
144
Assert.Contains(TestSink.
Writes
, w => w.EventId.Id == 33 && w.LogLevel == LogLevel.Information);
RequestTests.cs (1)
2030
Assert.All(TestSink.
Writes
, w => Assert.InRange(w.LogLevel, LogLevel.Trace, LogLevel.Information));
ResponseTests.cs (7)
510
Assert.Contains(TestSink.
Writes
, w => w.EventId.Id == 17 && w.LogLevel <= LogLevel.Debug && w.Exception is BadHttpRequestException
1148
Assert.Contains(TestSink.
Writes
,
1205
Assert.Contains(TestSink.
Writes
,
1257
Assert.DoesNotContain(TestSink.
Writes
, c => c.EventId.Name == "ApplicationError");
4133
Assert.Contains(TestSink.
Writes
, w => w.EventId.Id == 13 && w.LogLevel == LogLevel.Error
4764
Assert.Contains(testSink.
Writes
, w => w.EventId.Id == 17 && w.LogLevel <= LogLevel.Debug && w.Exception is BadHttpRequestException
4770
Assert.DoesNotContain(testSink.
Writes
, w => w.EventId.Id == 17);
Interop.FunctionalTests (14)
Http3\Http3RequestTests.cs (8)
1054
var badLogWrite = TestSink.
Writes
.FirstOrDefault(w => w.LogLevel == LogLevel.Critical);
1140
var badLogWrite = TestSink.
Writes
.FirstOrDefault(w => w.LogLevel >= LogLevel.Critical);
1611
var hasWriteLog = TestSink.
Writes
.Any(
1616
var hasReadLog = TestSink.
Writes
.Any(
1905
Assert.Single(TestSink.
Writes
.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel.Transport.Quic" &&
1921
if (testLogs(TestSink.
Writes
))
2099
Assert.Contains(TestSink.
Writes
, m => m.Message.Contains("Some connections failed to close gracefully during server shutdown."));
2171
Assert.DoesNotContain(TestSink.
Writes
, m => m.Message.Contains("Some connections failed to close gracefully during server shutdown."));
HttpClientHttp2InteropTests.cs (6)
1068
Assert.Single(TestSink.
Writes
.Where(context => context.Message.Contains("received HEADERS frame for stream ID 1 with length 16384 and flags END_STREAM")));
1069
Assert.Single(TestSink.
Writes
.Where(context => context.Message.Contains("received CONTINUATION frame for stream ID 1 with length 4390 and flags END_HEADERS")));
1116
Assert.Single(TestSink.
Writes
.Where(context => context.Message.Contains("sending HEADERS frame for stream ID 1 with length 15610 and flags END_STREAM")));
1117
Assert.Equal(2, TestSink.
Writes
.Where(context => context.Message.Contains("sending CONTINUATION frame for stream ID 1 with length 15585 and flags NONE")).Count());
1118
Assert.Single(TestSink.
Writes
.Where(context => context.Message.Contains("sending CONTINUATION frame for stream ID 1 with length 14546 and flags END_HEADERS")));
1177
Assert.Single(TestSink.
Writes
.Where(context
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (7)
ServerStreamingServerCallHandlerTests.cs (3)
119
var exceptionWrite = TestSink.
Writes
.Single(w => w.EventId.Name == "ErrorExecutingServiceMethod");
161
var exceptionWrite = TestSink.
Writes
.Single(w => w.EventId.Name == "RpcConnectionError");
198
var exceptionWrite = TestSink.
Writes
.Single(w => w.EventId.Name == "ErrorExecutingServiceMethod");
UnaryServerCallHandlerTests.cs (4)
869
var exceptionWrite = TestSink.
Writes
.Single(w => w.EventId.Name == "RpcConnectionError");
1056
var exceptionWrite = TestSink.
Writes
.Single(w => w.EventId.Name == "ErrorExecutingServiceMethod");
1086
var exceptionWrite = TestSink.
Writes
.Single(w => w.EventId.Name == "ErrorExecutingServiceMethod");
1626
var exceptionWrite = TestSink.
Writes
.Single(w => w.EventId.Name == "RpcConnectionError");
Microsoft.AspNetCore.Hosting.Tests (3)
WebHostBuilderTests.cs (3)
1077
Assert.Contains(sink.
Writes
, w => w.State.ToString() == "From startup");
1230
Assert.Contains(sink.
Writes
, w => w.Exception?.Message == "Startup exception");
1254
Assert.Contains(testSink.
Writes
, w => w.Exception?.Message == "Startup exception");
Microsoft.AspNetCore.Http.Extensions.Tests (33)
RequestDelegateFactoryTests.cs (6)
771
Assert.Empty(TestSink.
Writes
);
1144
var message = Assert.Single(TestSink.
Writes
).Message;
1576
var logs = TestSink.
Writes
.ToArray();
1680
var log = Assert.Single(TestSink.
Writes
);
1947
var logMessage = Assert.Single(TestSink.
Writes
);
1980
var logMessage = Assert.Single(TestSink.
Writes
);
RequestDelegateGenerator\CompileTimeCreationTests.cs (2)
389
Assert.All(TestSink.
Writes
, context => Assert.Equal("RequiredParameterNotProvided", context.EventId.Name));
558
var logs = TestSink.
Writes
.ToArray();
RequestDelegateGenerator\RequestDelegateCreationTests.AsParameters.cs (1)
389
var logs = TestSink.
Writes
.ToArray();
RequestDelegateGenerator\RequestDelegateCreationTests.BindAsync.cs (1)
142
var log = Assert.Single(TestSink.
Writes
);
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (4)
344
var logMessage = Assert.Single(TestSink.
Writes
);
940
var logMessage = Assert.Single(TestSink.
Writes
);
974
var logMessage = Assert.Single(TestSink.
Writes
);
1014
Assert.Empty(TestSink.
Writes
);
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBody.cs (1)
469
var logs = TestSink.
Writes
.ToArray();
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBodyOrService.cs (1)
129
var logs = TestSink.
Writes
.ToArray();
RequestDelegateGenerator\RequestDelegateCreationTests.Logging.cs (15)
45
var logs = TestSink.
Writes
.ToArray();
108
var logs = TestSink.
Writes
.ToArray();
162
Assert.Empty(TestSink.
Writes
);
199
Assert.Empty(TestSink.
Writes
);
228
var logs = TestSink.
Writes
.ToArray();
279
Assert.Empty(TestSink.
Writes
);
308
var logs = TestSink.
Writes
.ToArray();
358
Assert.Empty(TestSink.
Writes
);
401
var logMessage = Assert.Single(TestSink.
Writes
);
450
var logMessage = Assert.Single(TestSink.
Writes
);
491
var logMessage = Assert.Single(TestSink.
Writes
);
529
var logMessage = Assert.Single(TestSink.
Writes
);
572
Assert.Empty(TestSink.
Writes
);
609
var logMessage = Assert.Single(TestSink.
Writes
);
651
Assert.Empty(TestSink.
Writes
);
RequestDelegateGenerator\RequestDelegateCreationTests.QueryParameters.cs (1)
62
var logs = TestSink.
Writes
.ToArray();
RequestDelegateGenerator\RuntimeCreationTests.ComplexFormBinding.cs (1)
179
var logs = TestSink.
Writes
.ToArray();
Microsoft.AspNetCore.Http.Tests (1)
ApplicationBuilderTests.cs (1)
124
Assert.DoesNotContain(TestSink.
Writes
, w => w.EventId.Name == "RequestPipelineEnd");
Microsoft.AspNetCore.HttpLogging.Tests (182)
HttpLoggingMiddlewareTests.cs (182)
112
Assert.Empty(TestSink.
Writes
);
135
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Protocol: HTTP/1.0"));
136
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Method: GET"));
137
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Scheme: http"));
138
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Path: /foo"));
139
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("PathBase: /foo"));
140
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Connection: keep-alive"));
141
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Body: test"));
167
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Protocol: HTTP/1.0"));
168
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Method: GET"));
169
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Scheme: http"));
170
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Path: /foo"));
171
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("PathBase: /foo"));
172
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Connection: keep-alive"));
173
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Body: test"));
199
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Protocol: HTTP/1.0"));
200
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Method: GET"));
201
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Scheme: http"));
202
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Path: /foo"));
203
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("PathBase: /foo"));
204
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Connection: keep-alive"));
205
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Body: test"));
231
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Protocol: HTTP/1.0"));
232
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Method: GET"));
233
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Scheme: http"));
234
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Path: /foo"));
235
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("PathBase: /foo"));
236
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("QueryString: ?foo"));
237
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Connection: keep-alive"));
238
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Body: test"));
263
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("foo: [Redacted]"));
264
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("foo: bar"));
283
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("foo: bar"));
284
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("foo: [Redacted]"));
285
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Connection: [Redacted]"));
286
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Connection: keep-alive"));
303
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("RequestBody: [Not consumed by app]"));
334
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains(expected));
362
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains(expected));
390
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains(expected));
427
Assert.Contains(TestSink.
Writes
, w => w.Message.Equals("RequestBody: " + expected));
463
Assert.Contains(TestSink.
Writes
, w => w.Message.Equals("RequestBody: " + expected));
488
Assert.Contains(TestSink.
Writes
, w => w.Message.Equals("RequestBody: " + expected));
514
Assert.Contains(TestSink.
Writes
, w => w.Message.Equals("RequestBody: " + expected));
552
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains(expected));
592
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains(expected));
593
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Unrecognized Content-Type for request body."));
631
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains(expected));
669
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("RequestBody:"));
670
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains(expected));
708
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("RequestBody:"));
726
Assert.Empty(TestSink.
Writes
);
744
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Protocol: HTTP/1.0"));
745
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Method: GET"));
746
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Scheme: http"));
747
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Path: /foo"));
748
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("PathBase: /foo"));
749
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Connection: keep-alive"));
750
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("RequestBody: test"));
751
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 418"));
752
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Content-Type: text/plain"));
753
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Body: Hello World"));
771
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Protocol: HTTP/1.0"));
772
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Method: GET"));
773
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Scheme: http"));
774
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Path: /foo"));
775
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("PathBase: /foo"));
776
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Connection: keep-alive"));
777
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("RequestBody: test"));
778
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 418"));
779
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Content-Type: text/plain"));
780
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Body: Hello World"));
781
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("foo: bar"));
800
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Protocol: HTTP/1.0"));
801
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Method: GET"));
802
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Scheme: http"));
803
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Path: /foo"));
804
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("PathBase: /foo"));
805
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Connection: keep-alive"));
806
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("RequestBody: test"));
807
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 418"));
808
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Content-Type: text/plain"));
809
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Body: Hello World"));
810
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Path: ReplacedPath"));
828
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 200"));
829
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Transfer-Encoding: test"));
830
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Body: test"));
852
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 200"));
853
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Transfer-Encoding: test"));
854
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Body: test"));
876
Assert.Contains(TestSink.
Writes
, w => w.Message.StartsWith("Duration: ", StringComparison.Ordinal));
899
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 200"));
900
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Transfer-Encoding: test"));
924
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 200"));
925
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Transfer-Encoding: test"));
926
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Body: test"));
948
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 200"));
949
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Server: Kestrel"));
950
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Body: test"));
972
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 200"));
973
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Transfer-Encoding: test"));
974
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Body: test"));
994
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Test: [Redacted]"));
1017
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Test: Kestrel"));
1018
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Server: [Redacted]"));
1039
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains(expected));
1059
Assert.Empty(TestSink.
Writes
);
1081
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains(expected));
1111
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 200"));
1112
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Transfer-Encoding: test"));
1113
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Body: test"));
1119
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Body: test"));
1149
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 200"));
1150
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Transfer-Encoding: test"));
1151
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Body: test"));
1176
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Unrecognized Content-Type for response body."));
1191
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("No Content-Type header for request body."));
1230
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 101"));
1276
Assert.True(TestSink.
Writes
.TryTake(out var contentTypeLog));
1279
Assert.True(TestSink.
Writes
.TryTake(out var requestLog));
1295
Assert.False(TestSink.
Writes
.TryTake(out var _));
1334
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Connection: Upgrade"));
1377
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 101"));
1378
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Connection: Upgrade"));
1411
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 200"));
1412
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Transfer-Encoding: test"));
1413
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Content-Type: text/plain"));
1528
var lines = Assert.Single(TestSink.
Writes
.Where(w => w.LogLevel >= LogLevel.Information)).Message.Split(Environment.NewLine);
1590
var lines = Assert.Single(TestSink.
Writes
).Message.Split(Environment.NewLine);
1624
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Protocol: HTTP/1.0"));
1625
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Method: GET"));
1626
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Scheme: http"));
1627
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Path: /foo"));
1628
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("PathBase: /foo"));
1629
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Connection: keep-alive"));
1630
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("RequestBody: test"));
1632
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 418"));
1633
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Content-Type: text/plain; p=response"));
1634
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Body: Hello World"));
1652
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Protocol: HTTP/1.0"));
1653
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Method: GET"));
1654
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Scheme: http"));
1655
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Path: /foo"));
1656
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("PathBase: /foo"));
1657
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("Connection: keep-alive"));
1658
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("RequestBody: test"));
1660
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 418"));
1661
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Content-Type: text/plain"));
1662
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Body: Hello World"));
1680
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Protocol: HTTP/1.0"));
1681
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Method: GET"));
1682
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Scheme: http"));
1683
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Path: /foo"));
1684
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("PathBase: /foo"));
1685
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Connection: keep-alive"));
1686
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("RequestBody: test"));
1687
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 418"));
1688
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Content-Type: text/plain"));
1689
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Body: Hello World"));
1690
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("foo: bar"));
1709
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Protocol: HTTP/1.0"));
1710
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Method: GET"));
1711
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Scheme: http"));
1712
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Path: /foo"));
1713
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("PathBase: /foo"));
1714
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Connection: keep-alive"));
1715
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("RequestBody: test"));
1717
Assert.DoesNotContain(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 418"));
1718
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Content-Type: text/plain"));
1719
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("Body: Hello World"));
1720
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("StatusCode: 412"));
1733
var filteredLogs = TestSink.
Writes
.Where(w => w.LoggerName.Contains("HttpLogging"));
1748
var filteredLogs = TestSink.
Writes
.Where(w => w.LoggerName.Contains("HttpLogging"));
1763
var filteredLogs = TestSink.
Writes
.Where(w => w.LoggerName.Contains("HttpLogging"));
1780
var filteredLogs = TestSink.
Writes
.Where(w => w.LoggerName.Contains("HttpLogging"));
1806
var filteredLogs = TestSink.
Writes
.Where(w => w.LoggerName.Contains("HttpLogging"));
1823
var filteredLogs = TestSink.
Writes
.Where(w => w.LoggerName.Contains("HttpLogging"));
1838
var filteredLogs = TestSink.
Writes
.Where(w => w.LoggerName.Contains("HttpLogging"));
1853
var filteredLogs = TestSink.
Writes
.Where(w => w.LoggerName.Contains("HttpLogging"));
1870
var filteredLogs = TestSink.
Writes
.Where(w => w.LoggerName.Contains("HttpLogging"));
1896
var filteredLogs = TestSink.
Writes
.Where(w => w.LoggerName.Contains("HttpLogging"));
1942
var filteredLogs = TestSink.
Writes
.Where(w => w.LoggerName.Contains("HttpLogging"));
Microsoft.AspNetCore.Identity.FunctionalTests (4)
MapIdentityApiTests.cs (4)
443
Assert.Single(TestSink.
Writes
, w =>
470
Assert.DoesNotContain(TestSink.
Writes
, w =>
497
Assert.Single(TestSink.
Writes
, w =>
522
Assert.Single(TestSink.
Writes
, w =>
Microsoft.AspNetCore.InternalTesting.Tests (5)
LoggedTestXunitTests.cs (5)
73
var message = Assert.Single(TestSink.
Writes
);
84
var message = Assert.Single(TestSink.
Writes
);
97
var message = Assert.Single(TestSink.
Writes
);
140
Assert.Equal(TestSink.
Writes
.Single(), context);
160
var message = Assert.Single(TestSink.
Writes
);
Microsoft.AspNetCore.Mvc.FunctionalTests (4)
ApiExplorerTest.cs (4)
1562
Assert.Contains(TestSink.
Writes
, w => w.EventId.Name?.Equals("ApiDescriptionProviderExecuting", StringComparison.Ordinal) == true);
1563
Assert.Contains(TestSink.
Writes
, w => w.LoggerName.Equals("Microsoft.AspNetCore.Mvc.ApiExplorer.ApiDescriptionGroupCollectionProvider", StringComparison.Ordinal));
1564
Assert.Contains(TestSink.
Writes
, w => w.Message.Equals("Executing API description provider 'DefaultApiDescriptionProvider' from assembly Microsoft.AspNetCore.Mvc.ApiExplorer v10.0.0.0.", StringComparison.Ordinal));
1565
Assert.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)
397
var errorLogs = TestSink.
Writes
.Where(w => w.LogLevel >= LogLevel.Error).Select(w => w.Exception);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (10)
CertificatePathWatcherTests.cs (1)
474
var writeContext = Assert.Single(testSink.
Writes
.Where(wc => wc.EventId.Name == eventName));
ConnectionDispatcherTests.cs (2)
66
var critical = TestSink.
Writes
.SingleOrDefault(m => m.LogLevel == LogLevel.Critical);
113
var errors = TestSink.
Writes
.Where(e => e.LogLevel >= LogLevel.Error).ToArray();
HeartbeatTests.cs (3)
136
var warningMessage = TestSink.
Writes
.Single(message => message.LogLevel == LogLevel.Warning).Message;
179
Assert.DoesNotContain(TestSink.
Writes
, w => w.EventId.Name == "HeartbeatSlow");
197
Assert.Equal(ex, TestSink.
Writes
.Single(message => message.LogLevel == LogLevel.Error).Exception);
HttpConnectionManagerTests.cs (2)
36
Assert.Single(TestSink.
Writes
.Where(c => c.EventId.Name == "ApplicationNeverCompleted"));
56
Assert.DoesNotContain(TestSink.
Writes
, c => c.EventId.Name == "ApplicationNeverCompleted");
MessageBodyTests.cs (2)
778
Assert.Contains(TestSink.
Writes
,
837
Assert.Contains(TestSink.
Writes
,
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (4)
QuicStreamContextTests.cs (3)
51
Assert.Contains(TestSink.
Writes
, m => m.Message.Contains(@"shutting down writes because: ""The QUIC transport's send loop completed gracefully.""."));
435
Assert.Contains(TestSink.
Writes
, m => m.Message.Contains(@"shutting down writes because: ""The QUIC transport's send loop completed gracefully.""."));
479
Assert.Contains(TestSink.
Writes
, m => m.Message.Contains(@"shutting down writes because: ""Test message""."));
WebHostTests.cs (1)
168
Assert.Contains(TestSink.
Writes
, w => w.Message == CoreStrings.DynamicPortOnMultipleTransportsNotSupported);
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (17)
HubConnectionTests.cs (17)
1793
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Request starting HTTP/2 POST"));
1794
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Request starting HTTP/2 CONNECT"));
1795
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Request finished HTTP/2 CONNECT"));
1852
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Request starting HTTP/1.1 POST"));
1853
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Request starting HTTP/1.1 GET"));
1854
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Request finished HTTP/1.1 GET"));
1962
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Request starting HTTP/2 POST"));
1963
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Request starting HTTP/2 CONNECT"));
1964
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Request finished HTTP/2 CONNECT"));
2404
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Request starting HTTP/2 POST") && context.Message.Contains("/negotiate?"));
2407
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Request starting HTTP/2 POST") && context.Message.Contains("?id="));
2408
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Request finished HTTP/2 GET") && context.Message.Contains("?id="));
2411
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Request finished HTTP/2 DELETE") && context.Message.Contains("?id="));
2500
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Request starting HTTP/2 POST") && context.Message.Contains("/negotiate?"));
2503
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Request starting HTTP/2 POST") && context.Message.Contains("?id="));
2504
Assert.Contains(TestSink.
Writes
, context => context.Message.Contains("Request finished HTTP/2 GET") && context.Message.Contains("?id="));
2736
var changeLog = Assert.Single(TestSink.
Writes
.Where(w => w.EventId.Name == "UserNameChanged"));
Microsoft.AspNetCore.SignalR.Tests (11)
HubConnectionHandlerTests.ClientResult.cs (4)
96
Assert.Single(TestSink.
Writes
.Where(write => write.EventId.Name == "ErrorDispatchingHubEvent"));
127
Assert.Single(TestSink.
Writes
.Where(write => write.EventId.Name == "ErrorDispatchingHubEvent"));
395
Assert.Contains(TestSink.
Writes
, c => c.EventId.Name == "UnexpectedCompletion");
440
Assert.Contains(TestSink.
Writes
, c => c.EventId.Name == "UnexpectedCompletion");
HubConnectionHandlerTests.cs (7)
499
var exceptionLog = TestSink.
Writes
.Where(w => string.Equals(w.LoggerName, "Microsoft.AspNetCore.SignalR.HubConnectionHandler") &&
529
var exceptionLog = TestSink.
Writes
.Where(w => string.Equals(w.LoggerName, "Microsoft.AspNetCore.SignalR.HubConnectionHandler") &&
580
var exceptionLog = TestSink.
Writes
.Where(w => string.Equals(w.LoggerName, "Microsoft.AspNetCore.SignalR.HubConnectionHandler") &&
3958
Assert.Single(TestSink.
Writes
.Where(w => w.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" &&
3983
Assert.Single(TestSink.
Writes
.Where(w => w.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" &&
4158
Assert.Single(TestSink.
Writes
.Where(w => w.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" &&
4195
Assert.Single(TestSink.
Writes
.Where(w => w.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" &&
Microsoft.AspNetCore.StaticFiles.Tests (1)
StaticFileMiddlewareTests.cs (1)
43
Assert.Contains(TestSink.
Writes
, w => w.Message.Contains("The WebRootPath was not found")
Sockets.FunctionalTests (15)
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (3)
928
Assert.Single(TestSink.
Writes
.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel.Connections" &&
1038
Assert.Single(TestSink.
Writes
.Where(c => c.EventId.Name == "ConnectionStop"));
1090
Assert.Single(TestSink.
Writes
.Where(c => c.EventId.Name == "ConnectionStop"));
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (12)
346
Assert.Equal(1, TestSink.
Writes
.Count(w => w.EventId.Name == "ConnectionStop"));
399
var presShutdownTransportLogs = TestSink.
Writes
.Where(
411
var coreLogs = TestSink.
Writes
.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel.Connections");
414
var transportLogs = TestSink.
Writes
.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel" ||
451
var transportLogs = TestSink.
Writes
.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets");
455
var coreLogs = TestSink.
Writes
.Where(w => w.LoggerName == "Microsoft.AspNetCore.Server.Kestrel");
922
Assert.Equal(0, TestSink.
Writes
.Count(w => w.EventId.Name == "ResponseMinimumDataRateNotSatisfied"));
923
Assert.Equal(1, TestSink.
Writes
.Count(w => w.EventId.Name == "ConnectionStop"));
1007
Assert.Equal(0, TestSink.
Writes
.Count(w => w.EventId.Name == "ResponseMinimumDataRateNotSatisfied"));
1008
Assert.Equal(1, TestSink.
Writes
.Count(w => w.EventId.Name == "ConnectionStop"));
1085
Assert.Equal(0, TestSink.
Writes
.Count(w => w.EventId.Name == "ResponseMinimumDataRateNotSatisfied"));
1086
Assert.Equal(1, TestSink.
Writes
.Count(w => w.EventId.Name == "ConnectionStop"));