SerilogSinksInMemory
SerilogSinksInMemory copied to clipboard
Support extra assertions
Hi,
I have been working on a similar project until I realized this existed :)
I want to bring a few points though, that I planned to implement on my project and could be a nice addition here. I'd be very happy to contribute with their implementation:
Support contains on property value with WithValueContaining()
File: src/Serilog.Sinks.InMemory.Assertions/LogEventPropertyValueAssertions.cs
Implement properties value verification with Contains pattern
Motivation: For system that extract Metrics and have all their Monitoring based on logs, the properties are the most reliable data from the logs and the most interesting piece to test to ensure the healthy of monitoring dashboards. I propose it to have the same assertions that are provided for the log messages.
Support property verification only with HaveAnyMessage()
File: src/Serilog.Sinks.InMemory.Assertions/InMemorySinkAssertions.cs
Implement more intuitive properties-only assertions, instead of allowing a HaveMessage()
with empty parameters. Or even provide a way to check Properties directly, treating them as first class citizens.
Support contains on message value with HaveMessageContaining()
File: src/Serilog.Sinks.InMemory.Assertions/InMemorySinkAssertions.cs
Implement more intuitive message assertion with Contains pattern, instead requiring 2 calls HaveMessage().Containing()