1 write to TestSink
Microsoft.AspNetCore.InternalTesting (1)
406 references to TestSink
IIS.FunctionalTests (6)
IIS.LongTests (5)
IIS.NewHandler.FunctionalTests (5)
IIS.NewShim.FunctionalTests (5)
IIS.Tests (4)
IISExpress.FunctionalTests (12)
InMemory.FunctionalTests (28)
ResponseTests.cs (14)
281TestSink,
295TestSink,
310TestSink,
325TestSink,
340TestSink,
355TestSink,
510Assert.Contains(TestSink.Writes, w => w.EventId.Id == 17 && w.LogLevel <= LogLevel.Debug && w.Exception is BadHttpRequestException
905TestSink.MessageLogged += context =>
1107TestSink.MessageLogged += context =>
1148Assert.Contains(TestSink.Writes,
1161TestSink.MessageLogged += context =>
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
Interop.FunctionalTests (14)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (7)
Microsoft.AspNetCore.Http.Extensions.Tests (33)
Microsoft.AspNetCore.Http.Tests (1)
Microsoft.AspNetCore.HttpLogging.Tests (183)
HttpLoggingMiddlewareTests.cs (183)
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"));
1443TestSink.MessageLogged += (context) => { writeCount++; };
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)
Microsoft.AspNetCore.InternalTesting (1)
Microsoft.AspNetCore.InternalTesting.Tests (12)
Microsoft.AspNetCore.Mvc.FunctionalTests (4)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (19)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (4)
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.Client.Tests (2)
Microsoft.AspNetCore.SignalR.Tests (11)
Microsoft.AspNetCore.StaticFiles.Tests (1)
Sockets.FunctionalTests (27)