Files
git.stella-ops.org/src/__Libraries/StellaOps.HybridLogicalClock.Tests/HlcTimestampTests.Format.cs

31 lines
796 B
C#

// <copyright file="HlcTimestampTests.Format.cs" company="StellaOps">
// Copyright (c) StellaOps. Licensed under BUSL-1.1.
// </copyright>
using FluentAssertions;
using Xunit;
namespace StellaOps.HybridLogicalClock.Tests;
public sealed partial class HlcTimestampTests
{
[Fact]
public void ToSortableString_FormatsCorrectly()
{
var timestamp = CreateTimestamp(1704067200000, "scheduler-east-1", 42);
var result = timestamp.ToSortableString();
result.Should().Be("1704067200000-scheduler-east-1-000042");
}
[Fact]
public void ToString_ReturnsSortableString()
{
var timestamp = CreateTimestamp(1704067200000, "node1", 42);
var result = timestamp.ToString();
result.Should().Be(timestamp.ToSortableString());
}
}