* Add structured log persistence spec * Clarify structured log persistence spec * Plan structured log persistence implementation * Regenerate structured log persistence tasks * Address structured log persistence analysis findings * Add structured log SQLite persistence * Address structured log persistence review * Harden structured log write buffer shutdown * Start structured log SQLite migrations before buffer
20 lines
765 B
C#
20 lines
765 B
C#
using System.Globalization;
|
|
|
|
namespace Elsa.Diagnostics.StructuredLogs.Persistence.Sqlite.IntegrationTests;
|
|
|
|
public class SqliteStructuredLogTimestampTests
|
|
{
|
|
[Fact]
|
|
public async Task WriteAsync_StoresTimestampsAsUtcIso8601()
|
|
{
|
|
await using var host = new SqliteStructuredLogTestHost();
|
|
var timestamp = new DateTimeOffset(2026, 5, 13, 12, 30, 45, TimeSpan.FromHours(2));
|
|
|
|
await host.WriteAsync(StructuredLogTestEvents.Create("timestamp", timestamp));
|
|
|
|
var rawTimestamp = Assert.Single(await host.ReadRawTimestampsAsync());
|
|
Assert.EndsWith("+00:00", rawTimestamp, StringComparison.Ordinal);
|
|
Assert.Equal(timestamp.ToUniversalTime(), DateTimeOffset.Parse(rawTimestamp, CultureInfo.InvariantCulture));
|
|
}
|
|
}
|