1 write to Message
Microsoft.Extensions.Diagnostics.Testing (1)
224 references to Message
Aspire.Hosting.Containers.Tests (1)
Aspire.Hosting.Testing.Tests (6)
ResourceLoggerForwarderServiceTests.cs (6)
119log => { Assert.Equal(LogLevel.Information, log.Level); Assert.Equal("1: 2000-12-29T20:59:59.0000000Z Test trace message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.Category); },
120log => { Assert.Equal(LogLevel.Information, log.Level); Assert.Equal("2: 2000-12-29T20:59:59.0000000Z Test debug message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.Category); },
121log => { Assert.Equal(LogLevel.Information, log.Level); Assert.Equal("3: 2000-12-29T20:59:59.0000000Z Test information message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.Category); },
122log => { Assert.Equal(LogLevel.Information, log.Level); Assert.Equal("4: 2000-12-29T20:59:59.0000000Z Test warning message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.Category); },
123log => { Assert.Equal(LogLevel.Error, log.Level); Assert.Equal("5: 2000-12-29T20:59:59.0000000Z Test error message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.Category); },
124log => { Assert.Equal(LogLevel.Error, log.Level); Assert.Equal("6: 2000-12-29T20:59:59.0000000Z Test critical message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.Category); });
Aspire.Hosting.Tests (15)
Microsoft.AspNetCore.HeaderParsing.Tests (3)
Microsoft.Extensions.AI.Integration.Tests (11)
ChatClientIntegrationTests.cs (11)
523entry => Assert.Contains("What\\u0027s the biggest animal?", entry.Message),
524entry => Assert.Contains("whale", entry.Message));
545Assert.Contains(logs, e => e.Message.Contains("What\\u0027s the biggest animal?"));
546Assert.Contains(logs, e => e.Message.Contains("whale"));
569entry => Assert.Contains("What is the current secret number?", entry.Message),
570entry => Assert.Contains("\"name\": \"GetSecretNumber\"", entry.Message),
571entry => Assert.Contains($"\"result\": {secretNumber}", entry.Message),
572entry => Assert.Contains(secretNumber.ToString(), entry.Message));
598Assert.Contains(logs, e => e.Message.Contains("What is the current secret number?"));
599Assert.Contains(logs, e => e.Message.Contains("\"name\": \"GetSecretNumber\""));
600Assert.Contains(logs, e => e.Message.Contains($"\"result\": {secretNumber}"));
Microsoft.Extensions.AI.Tests (8)
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (3)
Microsoft.Extensions.Diagnostics.Testing (1)
Microsoft.Extensions.Diagnostics.Testing.Tests (6)
Microsoft.Extensions.Hosting.Testing.Tests (2)
Microsoft.Extensions.Http.Diagnostics.Tests (6)
Microsoft.Extensions.Telemetry.Tests (14)
Logging\ExtendedLoggerTests.cs (14)
80Assert.Equal("MSG0", snap[0].Message);
96Assert.Equal("MSG2", snap[1].Message);
165Assert.Equal("MSG0", snap[0].Message);
172Assert.Equal("MSG2", snap[1].Message);
230Assert.Equal("MSG0", snap[0].Message);
237Assert.Equal("MSG0b", snap[1].Message);
244Assert.Equal("MSG2", snap[2].Message);
251Assert.Equal("MSG2b", snap[3].Message);
290Assert.Equal("MSG0", snap[0].Message);
359Assert.Equal("MSG0", snap[0].Message);
468Assert.Equal("MSG0", snap[0].Message);
473Assert.Equal("MSG0b", snap[1].Message);
478Assert.Equal("MSG2", snap[2].Message);
483Assert.Equal("MSG2b", snap[3].Message);
Microsoft.Gen.Logging.Generated.Tests (147)
LoggerFromMemberTests.cs (12)
25Assert.Equal("M0 arg0", collector.LatestRecord.Message);
42Assert.Equal("M0 arg0", collector.LatestRecord.Message);
63Assert.Equal("M0 arg0", collector.LatestRecord.Message);
80Assert.Equal("M0 arg0", collector.LatestRecord.Message);
101Assert.Equal("M0 arg0", collector.LatestRecord.Message);
115Assert.Equal("M0 arg0", collector.LatestRecord.Message);
131Assert.Equal("M1 arg0", logger.Collector.LatestRecord.Message);
141Assert.Equal("M1 arg1", logger.Collector.LatestRecord.Message);
144Assert.Equal("M0 arg1", logger2.Collector.LatestRecord.Message);
158Assert.Equal("M0 arg0", collector.LatestRecord.Message);
175Assert.Equal("M0 arg0", collector.LatestRecord.Message);
180Assert.Equal("M1 arg0", collector.LatestRecord.Message);
LoggerMessageAttributeTests.cs (13)
22Assert.Equal("M0 arg0", collector.LatestRecord.Message);
35Assert.Equal("M0 arg0", collector.LatestRecord.Message);
48Assert.Equal("M1 ---- arg1", collector.LatestRecord.Message);
54Assert.Equal("M2 ---- arg1", collector.LatestRecord.Message);
67Assert.Equal("M8 ------", collector.LatestRecord.Message);
73Assert.Equal("M9 ----", collector.LatestRecord.Message);
79Assert.Equal("M10 ------------------------", collector.LatestRecord.Message);
92Assert.Equal("M3 ---- ---- ---- ----", collector.LatestRecord.Message);
98Assert.Equal("M4 ---- ---- ---- ------------------------", collector.LatestRecord.Message);
111Assert.Equal("M5 ---- ---- ---- ---- ---- ---- ---- ---- ++++ ++++ +++++", collector.LatestRecord.Message);
139Assert.Equal("M1 ----", collector.LatestRecord.Message);
145Assert.Equal("M2 ---- ---- ----", collector.LatestRecord.Message);
157Assert.Equal(string.Empty, collector.LatestRecord.Message);
LogMethodTests.cs (76)
27Assert.Equal("Could not open socket to `microsoft.com`", collector.LatestRecord.Message);
34Assert.Equal("Could not open socket to `microsoft.com`", collector.LatestRecord.Message);
41Assert.Equal("Could not open socket to `microsoft.com`", collector.LatestRecord.Message);
54Assert.Equal("Could not open socket to `microsoft.com`", collector.LatestRecord.Message);
90Assert.Equal("Hello World", collector.LatestRecord.Message);
98Assert.Equal("Hello World", collector.LatestRecord.Message);
113Assert.Equal("M1", collector.LatestRecord.Message);
119Assert.Equal("M2 arg1", collector.LatestRecord.Message);
125Assert.Equal("M3 arg1 2", collector.LatestRecord.Message);
131Assert.Equal("M4", collector.LatestRecord.Message);
137Assert.Equal("M5 System.InvalidOperationException: B", collector.LatestRecord.Message);
143Assert.Equal("M6 2", collector.LatestRecord.Message);
149Assert.Equal("M7 1", collector.LatestRecord.Message);
154Assert.Equal("M81234567", collector.LatestRecord.Message);
159Assert.Equal("M9 1 2 3 4 5 6 7", collector.LatestRecord.Message);
164Assert.Equal("M101", collector.LatestRecord.Message);
224Assert.Equal("M0 Zero", collector.LatestRecord.Message);
232Assert.Equal("M1 One", collector.LatestRecord.Message);
240Assert.Equal(string.Empty, collector.LatestRecord.Message);
248Assert.Equal(string.Empty, collector.LatestRecord.Message);
256Assert.Equal("M4 Four", collector.LatestRecord.Message);
264Assert.Equal("M5 Five", collector.LatestRecord.Message);
272Assert.Equal(string.Empty, collector.LatestRecord.Message);
283Assert.Equal(string.Empty, logRecord.Message);
294Assert.Equal("M8", logRecord.Message);
309Assert.Equal(string.Empty, collector.LatestRecord.Message);
316Assert.Equal(string.Empty, collector.LatestRecord.Message);
323Assert.Equal(string.Empty, collector.LatestRecord.Message);
330Assert.Equal("\"Hello\" World", collector.LatestRecord.Message);
337Assert.Equal("\"p\" -> \"q\"", collector.LatestRecord.Message);
345Assert.Equal("\"\n\r\\", collector.LatestRecord.Message);
362Assert.Equal("M0", collector.LatestRecord.Message);
369Assert.Equal("M1 Foo", collector.LatestRecord.Message);
379Assert.Equal(string.Empty, logRecord.Message);
404Assert.Equal("M2", collector.LatestRecord.Message);
411Assert.Equal("M3", collector.LatestRecord.Message);
418Assert.Equal("M4", collector.LatestRecord.Message);
425Assert.Equal("M5", collector.LatestRecord.Message);
432Assert.Equal("M6", collector.LatestRecord.Message);
439Assert.Equal("M7", collector.LatestRecord.Message);
446Assert.Equal("M8", collector.LatestRecord.Message);
453Assert.Equal("M9", collector.LatestRecord.Message);
460Assert.Equal("M10 Warning", collector.LatestRecord.Message);
482Assert.Equal("No params here...", collector.LatestRecord.Message);
489Assert.Equal("No params here as well...", collector.LatestRecord.Message);
496Assert.Equal("No params here as well...", collector.LatestRecord.Message);
510Assert.Equal("M2 --- --- -----", collector.LatestRecord.Message);
527Assert.Equal("M0 System.ArgumentException: Bar", collector.LatestRecord.Message);
534Assert.Equal("M1 System.ArgumentException: Bar", collector.LatestRecord.Message);
541Assert.Equal("M2 One: System.ArgumentException: Foo", collector.LatestRecord.Message);
552Assert.Equal(string.Empty, collector.LatestRecord.Message);
565Assert.Equal("M0", collector.LatestRecord.Message);
576Assert.Equal(string.Empty, logRecord.Message);
591Assert.Equal("M8", collector.LatestRecord.Message);
598Assert.Equal("M9", collector.LatestRecord.Message);
605Assert.Equal("M10", collector.LatestRecord.Message);
612Assert.Equal("M11", collector.LatestRecord.Message);
619Assert.Equal("M12", collector.LatestRecord.Message);
633Assert.Equal("M0 0", collector.LatestRecord.Message);
641Assert.Equal("M1 42 42", collector.LatestRecord.Message);
649Assert.Equal("M2 42 43 44 45 46 47 48", collector.LatestRecord.Message);
663Assert.Equal("M3 43 42", collector.LatestRecord.Message);
679Assert.Equal("M0", collector.LatestRecord.Message);
693Assert.Equal("M0", collector.LatestRecord.Message);
728Assert.Contains("Hello from S", collector.LatestRecord.Message);
739Assert.Equal("M0 Test", record.Message);
756Assert.Equal("UseAtSymbol3, 42 42", collector.LatestRecord.Message);
762Assert.Equal("UseAtSymbol4 with error, 42 42", collector.LatestRecord.Message);
776Assert.Equal("M6 class 42", collector.LatestRecord.Message);
781Assert.Equal("M7 param 42", collector.LatestRecord.Message);
802Assert.Equal("M0 (null)", collector.LatestRecord.Message);
805Assert.Equal("M1 (null)", collector.LatestRecord.Message);
808Assert.Equal("M3 (null)", collector.LatestRecord.Message);
811Assert.Equal("M4 (null) (null) (null) (null) (null) (null) (null) (null) (null)", collector.LatestRecord.Message);
814Assert.Equal("M5 (null) (null) (null) (null) (null) (null) (null) (null) (null)", collector.LatestRecord.Message);
834Assert.Equal("M0 " + dt.ToString(CultureInfo.InvariantCulture), collector.LatestRecord.Message);
LogPropertiesTests.cs (12)
303Assert.Equal($"Both {StringProperty} and {classToLog} as params", _logger.Collector.LatestRecord.Message);
324Assert.Equal($"Testing nullable property within class here...", _logger.Collector.LatestRecord.Message);
344Assert.Equal($"Testing nullable property within class here...", _logger.Collector.LatestRecord.Message);
366Assert.Equal($"LogProperties: {StringParamValue}", latestRecord.Message);
390Assert.Equal("Testing non-nullable struct here...", latestRecord.Message);
420Assert.Equal("Testing nullable struct here...", latestRecord.Message);
449Assert.Equal("Testing explicit nullable struct here...", latestRecord.Message);
475Assert.Equal(string.Empty, latestRecord.Message);
502Assert.Equal("Testing interface-typed argument here...", latestRecord.Message);
526Assert.Empty(latestRecord.Message);
551Assert.Equal($"Struct is: {recordToLog}", latestRecord.Message);
577Assert.Equal($"Readonly struct is: {recordToLog}", latestRecord.Message);
TagProviderTests.cs (17)
35Assert.Equal($"Custom provided properties for {obj}.", latestRecord.Message);
58Assert.Equal($"LogProperties with provider: {StringParamValue}, {classToLog}", latestRecord.Message);
85Assert.Equal(string.Empty, latestRecord.Message);
108Assert.Equal(string.Empty, latestRecord.Message);
129Assert.Equal(string.Empty, latestRecord.Message);
140Assert.Equal(string.Empty, latestRecord.Message);
164Assert.Equal(string.Empty, latestRecord.Message);
190Assert.Equal(string.Empty, latestRecord.Message);
209Assert.Equal("Custom provided properties for (null).", latestRecord.Message);
228Assert.Equal("Custom provided properties for (null).", latestRecord.Message);
248Assert.Equal($"Custom provided properties for {classToLog}.", latestRecord.Message);
270Assert.Equal($"Custom provided properties for struct.", latestRecord.Message);
291Assert.Equal($"Custom provided properties for interface.", latestRecord.Message);
332Assert.Equal("No params.", latestRecord.Message);
359Assert.Equal($"Custom provided properties for both complex params and {StringParamValue}.", latestRecord.Message);
397Assert.Equal($"Custom provided properties for both complex params and {StringParamValue}.", latestRecord.Message);
422Assert.Equal($"Custom provided properties for both complex params and {StringParamValue}.", latestRecord.Message);