From 681fd4748d3dfdc518748c7f1c4b24b5d9672b39 Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Thu, 30 Jun 2022 01:05:58 -0400 Subject: [PATCH] Fixed support for nodatime time with destructuring (#1175) --- ...daTimeNewtonsoftSerializationExtensions.cs | 8 +- .../Conventions/NodaTimeConvention.cs | 13 +- src/Foundation/NodaTimeDestructuringPolicy.cs | 107 +++++++++++++++ .../NodaTimeLoggerConfigurationExtensions.cs | 25 ++++ ...meSystemTextJsonSerializationExtensions.cs | 2 +- .../SerilogDestructuringTests.cs | 128 +++++++++++++++++- ...ructure_NodaTime_DateTimeZone.verified.txt | 3 + ...Destructure_NodaTime_Duration.verified.txt | 3 + ..._Destructure_NodaTime_Instant.verified.txt | 3 + ...Destructure_NodaTime_Interval.verified.txt | 3 + ...estructure_NodaTime_LocalDate.verified.txt | 3 + ...ucture_NodaTime_LocalDateTime.verified.txt | 3 + ...estructure_NodaTime_LocalTime.verified.txt | 3 + ...structure_NodaTime_OffsetDate.verified.txt | 3 + ...cture_NodaTime_OffsetDateTime.verified.txt | 3 + ...structure_NodaTime_OffsetTime.verified.txt | 3 + ...d_Destructure_NodaTime_Period.verified.txt | 3 + ...ucture_NodaTime_ZonedDateTime.verified.txt | 3 + 18 files changed, 308 insertions(+), 11 deletions(-) create mode 100644 src/Foundation/NodaTimeDestructuringPolicy.cs create mode 100644 src/Foundation/NodaTimeLoggerConfigurationExtensions.cs create mode 100644 test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_DateTimeZone.verified.txt create mode 100644 test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_Duration.verified.txt create mode 100644 test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_Instant.verified.txt create mode 100644 test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_Interval.verified.txt create mode 100644 test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_LocalDate.verified.txt create mode 100644 test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_LocalDateTime.verified.txt create mode 100644 test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_LocalTime.verified.txt create mode 100644 test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_OffsetDate.verified.txt create mode 100644 test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_OffsetDateTime.verified.txt create mode 100644 test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_OffsetTime.verified.txt create mode 100644 test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_Period.verified.txt create mode 100644 test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_ZonedDateTime.verified.txt diff --git a/src/Foundation.NewtonsoftJson/NodaTimeNewtonsoftSerializationExtensions.cs b/src/Foundation.NewtonsoftJson/NodaTimeNewtonsoftSerializationExtensions.cs index 0469327f3..e734249c9 100644 --- a/src/Foundation.NewtonsoftJson/NodaTimeNewtonsoftSerializationExtensions.cs +++ b/src/Foundation.NewtonsoftJson/NodaTimeNewtonsoftSerializationExtensions.cs @@ -23,7 +23,7 @@ public static JsonSerializer ConfigureNodaTimeForLaunchPad(this JsonSerializer o { options.Converters.Add(new StringEnumConverter(new CamelCaseNamingStrategy())); options.ConfigureForNodaTime(dateTimeZoneProvider); - ReplaceConverters(options.Converters); + ReplaceConverters(options.Converters, dateTimeZoneProvider); return options; } @@ -37,12 +37,12 @@ public static JsonSerializerSettings ConfigureNodaTimeForLaunchPad(this JsonSeri { options.Converters.Add(new StringEnumConverter(new CamelCaseNamingStrategy())); options.ConfigureForNodaTime(dateTimeZoneProvider); - ReplaceConverters(options.Converters); + ReplaceConverters(options.Converters, dateTimeZoneProvider); return options; } - private static void ReplaceConverters(IList converters) + private static void ReplaceConverters(IList converters, IDateTimeZoneProvider dateTimeZoneProvider) { ReplaceConverter( converters, @@ -127,7 +127,7 @@ private static void ReplaceConverters(IList converters) ReplaceConverter( converters, new NewtonsoftJsonCompositeNodaPatternConverter( - ZonedDateTimePattern.CreateWithInvariantCulture("uuuu'-'MM'-'dd'T'HH':'mm':'ss;FFFFFFFFFo z", DateTimeZoneProviders.Tzdb) + ZonedDateTimePattern.CreateWithInvariantCulture("uuuu'-'MM'-'dd'T'HH':'mm':'ss;FFFFFFFFFo z", dateTimeZoneProvider) ) ); } diff --git a/src/Foundation/Conventions/NodaTimeConvention.cs b/src/Foundation/Conventions/NodaTimeConvention.cs index 665ceaa28..4c1e09741 100644 --- a/src/Foundation/Conventions/NodaTimeConvention.cs +++ b/src/Foundation/Conventions/NodaTimeConvention.cs @@ -6,6 +6,8 @@ using Rocket.Surgery.Conventions; using Rocket.Surgery.Conventions.DependencyInjection; using Rocket.Surgery.LaunchPad.Foundation.Conventions; +using Rocket.Surgery.LaunchPad.Serilog; +using Serilog; [assembly: Convention(typeof(NodaTimeConvention))] @@ -16,7 +18,7 @@ namespace Rocket.Surgery.LaunchPad.Foundation.Conventions; /// /// [PublicAPI] -public class NodaTimeConvention : IServiceConvention +public class NodaTimeConvention : IServiceConvention, ISerilogConvention { private readonly FoundationOptions _options; @@ -29,6 +31,12 @@ public NodaTimeConvention(FoundationOptions? options = null) _options = options ?? new FoundationOptions(); } + /// + public void Register(IConventionContext context, IServiceProvider services, IConfiguration configuration, LoggerConfiguration loggerConfiguration) + { + loggerConfiguration.Destructure.NodaTimeTypes(services.GetRequiredService()); + } + /// /// Registers the specified context. /// @@ -43,7 +51,6 @@ public void Register(IConventionContext context, IConfiguration configuration, I } services.TryAddSingleton(SystemClock.Instance); - services.TryAddSingleton(); - services.TryAddSingleton(_options.DateTimeZoneSource); + services.TryAddSingleton(new DateTimeZoneCache(_options.DateTimeZoneSource)); } } diff --git a/src/Foundation/NodaTimeDestructuringPolicy.cs b/src/Foundation/NodaTimeDestructuringPolicy.cs new file mode 100644 index 000000000..18ad1ad87 --- /dev/null +++ b/src/Foundation/NodaTimeDestructuringPolicy.cs @@ -0,0 +1,107 @@ +using System.Text.Json; +using NodaTime; +using NodaTime.Text; +using Serilog.Core; +using Serilog.Events; + +namespace Rocket.Surgery.LaunchPad.Foundation; + +internal class NodaTimeDestructuringPolicy : IDestructuringPolicy +{ + private readonly ZonedDateTimePattern _zonedDateTimePattern; + + public NodaTimeDestructuringPolicy(IDateTimeZoneProvider provider) + { + _zonedDateTimePattern = ZonedDateTimePattern.CreateWithInvariantCulture("uuuu'-'MM'-'dd'T'HH':'mm':'ss;FFFFFFFFFo z", provider); + } + + public bool TryDestructure(object value, ILogEventPropertyValueFactory _, out LogEventPropertyValue? result) + { + ScalarValue a; + if (value is Instant instant1) + { + result = new ScalarValue(InstantPattern.ExtendedIso.Format(instant1)); + return true; + } + + if (value is LocalDateTime localDateTime) + { + result = new ScalarValue(LocalDateTimePattern.ExtendedIso.Format(localDateTime)); + return true; + } + + if (value is LocalDate localDate) + { + result = new ScalarValue(LocalDatePattern.Iso.Format(localDate)); + return true; + } + + if (value is LocalTime localTime) + { + result = new ScalarValue(LocalTimePattern.ExtendedIso.Format(localTime)); + return true; + } + + if (value is OffsetDateTime offsetDateTime) + { + result = new ScalarValue(OffsetDateTimePattern.ExtendedIso.Format(offsetDateTime)); + return true; + } + + if (value is OffsetDate offsetDate) + { + result = new ScalarValue(OffsetDatePattern.GeneralIso.Format(offsetDate)); + return true; + } + + if (value is OffsetTime offsetTime) + { + result = new ScalarValue(OffsetTimePattern.ExtendedIso.Format(offsetTime)); + return true; + } + + if (value is ZonedDateTime zonedDateTime) + { + result = new ScalarValue(_zonedDateTimePattern.Format(zonedDateTime)); + return true; + } + + if (value is DateTimeZone dateTimeZone) + { + result = new ScalarValue(dateTimeZone.Id); + return true; + } + + if (value is Duration duration) + { + result = new ScalarValue(DurationPattern.Roundtrip.Format(duration)); + return true; + } + + if (value is Period period) + { + result = new ScalarValue(PeriodPattern.NormalizingIso.Format(period)); + return true; + } + + if (value is Interval interval) + { + var values = new List(); + if (interval.HasStart) + { + values.Add(new LogEventProperty("Start", _.CreatePropertyValue(interval.Start))); + } + + if (interval.HasEnd) + { + values.Add(new LogEventProperty("End", _.CreatePropertyValue(interval.End))); + } + + result = new StructureValue(values); + return true; + } + + result = null; + return false; + } +} diff --git a/src/Foundation/NodaTimeLoggerConfigurationExtensions.cs b/src/Foundation/NodaTimeLoggerConfigurationExtensions.cs new file mode 100644 index 000000000..b5ef2f7a6 --- /dev/null +++ b/src/Foundation/NodaTimeLoggerConfigurationExtensions.cs @@ -0,0 +1,25 @@ +using NodaTime; +using Serilog; +using Serilog.Configuration; + +namespace Rocket.Surgery.LaunchPad.Foundation; + +/// +/// Adds the Destructure.NewtonsoftJsonTypes() extension to . +/// +public static class NodaTimeLoggerConfigurationExtensions +{ + /// + /// Enable destructuring of JSON.NET dynamic objects. + /// + /// The logger configuration to apply configuration to. + /// + /// An object allowing configuration to continue. + public static LoggerConfiguration NodaTimeTypes(this LoggerDestructuringConfiguration configuration, IDateTimeZoneProvider provider) + { + return configuration + .AsScalar().Destructure + .AsScalar().Destructure + .With(new NodaTimeDestructuringPolicy(provider)); + } +} diff --git a/src/Foundation/NodaTimeSystemTextJsonSerializationExtensions.cs b/src/Foundation/NodaTimeSystemTextJsonSerializationExtensions.cs index 972b026e6..48257e05b 100644 --- a/src/Foundation/NodaTimeSystemTextJsonSerializationExtensions.cs +++ b/src/Foundation/NodaTimeSystemTextJsonSerializationExtensions.cs @@ -97,7 +97,7 @@ public static JsonSerializerOptions ConfigureNodaTimeForLaunchPad(this JsonSeria ReplaceConverter( options.Converters, new SystemTextJsonCompositeNodaPatternConverter( - ZonedDateTimePattern.CreateWithInvariantCulture("uuuu'-'MM'-'dd'T'HH':'mm':'ss;FFFFFFFFFo z", DateTimeZoneProviders.Tzdb) + ZonedDateTimePattern.CreateWithInvariantCulture("uuuu'-'MM'-'dd'T'HH':'mm':'ss;FFFFFFFFFo z", dateTimeZoneProvider) ) ); diff --git a/test/Extensions.Tests/SerilogDestructuringTests.cs b/test/Extensions.Tests/SerilogDestructuringTests.cs index 2d05af0ee..f38a67163 100644 --- a/test/Extensions.Tests/SerilogDestructuringTests.cs +++ b/test/Extensions.Tests/SerilogDestructuringTests.cs @@ -4,6 +4,8 @@ using NetTopologySuite.Features; using NetTopologySuite.Geometries; using Newtonsoft.Json.Linq; +using NodaTime; +using NodaTime.Testing; using Rocket.Surgery.Extensions.Testing; using Rocket.Surgery.LaunchPad.Foundation; using Rocket.Surgery.LaunchPad.Spatial; @@ -89,19 +91,139 @@ public async Task Should_Destructure_NetTopologySuite_AttributesTable() await Verify(logs.Select(z => z.RenderMessage())); } + [Fact] + public async Task Should_Destructure_NodaTime_Instant() + { + var faker = new Faker { Random = new Randomizer(17) }; + + using var _ = CaptureLogs(out var logs); + Logger.LogInformation("This is just a test {@Data}", _clock.GetCurrentInstant()); + await Verify(logs.Select(z => z.RenderMessage())); + } + + [Fact] + public async Task Should_Destructure_NodaTime_LocalDateTime() + { + var faker = new Faker { Random = new Randomizer(17) }; + + using var _ = CaptureLogs(out var logs); + Logger.LogInformation("This is just a test {@Data}", LocalDateTime.FromDateTime(_clock.GetCurrentInstant().ToDateTimeUtc())); + await Verify(logs.Select(z => z.RenderMessage())); + } + + [Fact] + public async Task Should_Destructure_NodaTime_LocalDate() + { + var faker = new Faker { Random = new Randomizer(17) }; + + using var _ = CaptureLogs(out var logs); + Logger.LogInformation("This is just a test {@Data}", LocalDate.FromDateTime(_clock.GetCurrentInstant().ToDateTimeUtc())); + await Verify(logs.Select(z => z.RenderMessage())); + } + + [Fact] + public async Task Should_Destructure_NodaTime_LocalTime() + { + var faker = new Faker { Random = new Randomizer(17) }; + + using var _ = CaptureLogs(out var logs); + Logger.LogInformation("This is just a test {@Data}", LocalTime.FromHoursSinceMidnight(4)); + await Verify(logs.Select(z => z.RenderMessage())); + } + + [Fact] + public async Task Should_Destructure_NodaTime_OffsetDateTime() + { + var faker = new Faker { Random = new Randomizer(17) }; + + using var _ = CaptureLogs(out var logs); + Logger.LogInformation("This is just a test {@Data}", OffsetDateTime.FromDateTimeOffset(_clock.GetCurrentInstant().ToDateTimeOffset())); + await Verify(logs.Select(z => z.RenderMessage())); + } + + [Fact] + public async Task Should_Destructure_NodaTime_OffsetDate() + { + var faker = new Faker { Random = new Randomizer(17) }; + + using var _ = CaptureLogs(out var logs); + Logger.LogInformation("This is just a test {@Data}", OffsetDateTime.FromDateTimeOffset(_clock.GetCurrentInstant().ToDateTimeOffset()).ToOffsetDate()); + await Verify(logs.Select(z => z.RenderMessage())); + } + + [Fact] + public async Task Should_Destructure_NodaTime_OffsetTime() + { + var faker = new Faker { Random = new Randomizer(17) }; + + using var _ = CaptureLogs(out var logs); + Logger.LogInformation("This is just a test {@Data}", OffsetDateTime.FromDateTimeOffset(_clock.GetCurrentInstant().ToDateTimeOffset()).ToOffsetTime()); + await Verify(logs.Select(z => z.RenderMessage())); + } + + [Fact] + public async Task Should_Destructure_NodaTime_ZonedDateTime() + { + var faker = new Faker { Random = new Randomizer(17) }; + + using var _ = CaptureLogs(out var logs); + Logger.LogInformation("This is just a test {@Data}", ZonedDateTime.FromDateTimeOffset(_clock.GetCurrentInstant().ToDateTimeOffset())); + await Verify(logs.Select(z => z.RenderMessage())); + } + + [Fact] + public async Task Should_Destructure_NodaTime_DateTimeZone() + { + var faker = new Faker { Random = new Randomizer(17) }; + + using var _ = CaptureLogs(out var logs); + Logger.LogInformation("This is just a test {@Data}", DateTimeZoneProviders.Tzdb["America/New_York"]); + await Verify(logs.Select(z => z.RenderMessage())); + } + + [Fact] + public async Task Should_Destructure_NodaTime_Duration() + { + var faker = new Faker { Random = new Randomizer(17) }; + + using var _ = CaptureLogs(out var logs); + Logger.LogInformation("This is just a test {@Data}", Duration.FromDays(1)); + await Verify(logs.Select(z => z.RenderMessage())); + } + + [Fact] + public async Task Should_Destructure_NodaTime_Period() + { + var faker = new Faker { Random = new Randomizer(17) }; + + using var _ = CaptureLogs(out var logs); + Logger.LogInformation("This is just a test {@Data}", Period.FromDays(1)); + await Verify(logs.Select(z => z.RenderMessage())); + } + + [Fact] + public async Task Should_Destructure_NodaTime_Interval() + { + var faker = new Faker { Random = new Randomizer(17) }; + + using var _ = CaptureLogs(out var logs); + Logger.LogInformation("This is just a test {@Data}", new Interval(_clock.GetCurrentInstant(), _clock.GetCurrentInstant())); + await Verify(logs.Select(z => z.RenderMessage())); + } + public SerilogDestructuringTests(ITestOutputHelper outputHelper) : base( outputHelper, LogLevel.Information, configureLogger: configuration => configuration .Destructure.NewtonsoftJsonTypes() .Destructure.SystemTextJsonTypes() .Destructure.NetTopologySuiteTypes() + .Destructure.NodaTimeTypes(DateTimeZoneProviders.Tzdb) ) { - _outputHelper = outputHelper; - LogContext.PushProperty("SourceContext", nameof(SerilogDestructuringTests)); + _clock = new FakeClock(Instant.FromUtc(2022, 1, 1, 4, 4, 4)); } - private readonly ITestOutputHelper _outputHelper; + private readonly FakeClock _clock; [Theory] [InlineData(OgcGeometryType.Point, 5, false)] diff --git a/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_DateTimeZone.verified.txt b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_DateTimeZone.verified.txt new file mode 100644 index 000000000..c35ba5e95 --- /dev/null +++ b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_DateTimeZone.verified.txt @@ -0,0 +1,3 @@ +[ + This is just a test "America/New_York" +] \ No newline at end of file diff --git a/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_Duration.verified.txt b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_Duration.verified.txt new file mode 100644 index 000000000..fb3a6b75d --- /dev/null +++ b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_Duration.verified.txt @@ -0,0 +1,3 @@ +[ + This is just a test "1:00:00:00" +] \ No newline at end of file diff --git a/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_Instant.verified.txt b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_Instant.verified.txt new file mode 100644 index 000000000..e32c88661 --- /dev/null +++ b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_Instant.verified.txt @@ -0,0 +1,3 @@ +[ + This is just a test "2022-01-01T04:04:04Z" +] \ No newline at end of file diff --git a/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_Interval.verified.txt b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_Interval.verified.txt new file mode 100644 index 000000000..a077d3246 --- /dev/null +++ b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_Interval.verified.txt @@ -0,0 +1,3 @@ +[ + This is just a test { Start: "2022-01-01T04:04:04Z", End: "2022-01-01T04:04:04Z" } +] \ No newline at end of file diff --git a/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_LocalDate.verified.txt b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_LocalDate.verified.txt new file mode 100644 index 000000000..04fc37149 --- /dev/null +++ b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_LocalDate.verified.txt @@ -0,0 +1,3 @@ +[ + This is just a test "2022-01-01" +] \ No newline at end of file diff --git a/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_LocalDateTime.verified.txt b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_LocalDateTime.verified.txt new file mode 100644 index 000000000..324b5f465 --- /dev/null +++ b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_LocalDateTime.verified.txt @@ -0,0 +1,3 @@ +[ + This is just a test "2022-01-01T04:04:04" +] \ No newline at end of file diff --git a/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_LocalTime.verified.txt b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_LocalTime.verified.txt new file mode 100644 index 000000000..66e176a08 --- /dev/null +++ b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_LocalTime.verified.txt @@ -0,0 +1,3 @@ +[ + This is just a test "04:00:00" +] \ No newline at end of file diff --git a/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_OffsetDate.verified.txt b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_OffsetDate.verified.txt new file mode 100644 index 000000000..772e42fa5 --- /dev/null +++ b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_OffsetDate.verified.txt @@ -0,0 +1,3 @@ +[ + This is just a test "2022-01-01Z" +] \ No newline at end of file diff --git a/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_OffsetDateTime.verified.txt b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_OffsetDateTime.verified.txt new file mode 100644 index 000000000..e32c88661 --- /dev/null +++ b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_OffsetDateTime.verified.txt @@ -0,0 +1,3 @@ +[ + This is just a test "2022-01-01T04:04:04Z" +] \ No newline at end of file diff --git a/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_OffsetTime.verified.txt b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_OffsetTime.verified.txt new file mode 100644 index 000000000..0bd610a71 --- /dev/null +++ b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_OffsetTime.verified.txt @@ -0,0 +1,3 @@ +[ + This is just a test "04:04:04Z" +] \ No newline at end of file diff --git a/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_Period.verified.txt b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_Period.verified.txt new file mode 100644 index 000000000..da85fd9c2 --- /dev/null +++ b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_Period.verified.txt @@ -0,0 +1,3 @@ +[ + This is just a test "P1D" +] \ No newline at end of file diff --git a/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_ZonedDateTime.verified.txt b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_ZonedDateTime.verified.txt new file mode 100644 index 000000000..c50d5e3d3 --- /dev/null +++ b/test/Extensions.Tests/snapshots/SerilogDestructuringTests.Should_Destructure_NodaTime_ZonedDateTime.verified.txt @@ -0,0 +1,3 @@ +[ + This is just a test "2022-01-01T04:04:04Z UTC" +] \ No newline at end of file