Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
almostchristian committed Nov 21, 2019
1 parent 043df81 commit 0140f73
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,37 @@ public void AuditSinksAreConfigured()
Assert.Equal(1, DummyRollingFileAuditSink.Emitted.Count);
}

[Fact]
public void AuditToSubLoggersAreConfigured()
{
var json = @"{
""Serilog"": {
""Using"": [""TestDummies""],
""AuditTo"": [{
""Name"": ""Logger"",
""Args"": {
""configureLogger"" : {
""AuditTo"": [{
""Name"": ""DummyRollingFile"",
""Args"": {""pathFormat"" : ""C:\\""}
}]}
}
}]
}
}";

var log = ConfigFromJson(json)
.CreateLogger();

DummyRollingFileSink.Reset();
DummyRollingFileAuditSink.Reset();

log.Write(Some.InformationEvent());

Assert.Equal(0, DummyRollingFileSink.Emitted.Count);
Assert.Equal(1, DummyRollingFileAuditSink.Emitted.Count);
}

[Fact]
public void TestMinimumLevelOverrides()
{
Expand Down

0 comments on commit 0140f73

Please sign in to comment.