serilog / serilog-settings-configuration

A Serilog configuration provider that reads from Microsoft.Extensions.Configuration
Apache License 2.0
446 stars 129 forks source link

Make all JSON strings valid in tests #367

Closed 0xced closed 1 year ago

0xced commented 1 year ago

So that we can get rid of the ToValidJson extension method.

Now that raw string literals have been introduced (in #354) having valid readable JSON in strings for tests becomes easy. There is no need to escape quotes anymore with either \" or "".

This will also make it easier for newcomers to understand the tests at first glance. I had my WTF moment when I first saw JSON with single quotes. 🤔

0xced commented 1 year ago

In the second commit I have also enabled JSON language injection (with // language=json comments) so that Rider can perform nice syntax highlighting. See Language injections in C# in Rider.

How nice is it?

image

sungam3r commented 1 year ago

VS has syntax highlighting for JSON in raw string literals OOTB.