Skip to content

Commit

Permalink
Fallback to Microsoft Logging Formatter when mixing positional with s…
Browse files Browse the repository at this point in the history
…tructured (test coverage) (#757)
  • Loading branch information
snakefoot authored Aug 8, 2024
1 parent 9c877a7 commit 6a377ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/NLog.Extensions.Logging.Tests/LoggerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public void TestInvalidFormatString()
[Fact]
public void TestInvalidFormatString2()
{
var runner = GetRunner<Runner>(new NLogProviderOptions { CaptureMessageTemplates = true });
var runner = GetRunner<Runner>(new NLogProviderOptions { CaptureMessageTemplates = false });
var ex = Assert.Throws<AggregateException>(() => runner.Logger.LogDebug("{0}{1}", "Test"));
Assert.IsType<FormatException>(ex.InnerException);
}
Expand All @@ -236,7 +236,7 @@ public void TestInvalidMixFormatString()
[Fact]
public void TestInvalidMixFormatString2()
{
var runner = GetRunner<Runner>(new NLogProviderOptions { CaptureMessageTemplates = true });
var runner = GetRunner<Runner>(new NLogProviderOptions { CaptureMessageTemplates = false });
runner.Logger.LogDebug("{0}{Mix}", "Mix", "Test");
Assert.Equal("NLog.Extensions.Logging.Tests.LoggerTests.Runner|DEBUG|MixTest|0=Mix, Mix=Test", runner.LastTargetMessage);
}
Expand Down

0 comments on commit 6a377ff

Please sign in to comment.