stabilizaiton work - projects rework for maintenanceability and ui livening
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
// <copyright file="HlcTimestampTests.Causality.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 IsBefore_And_IsAfter_RespectOrdering()
|
||||
{
|
||||
var earlier = CreateTimestamp(1000, "node1", 1);
|
||||
var later = CreateTimestamp(1000, "node1", 2);
|
||||
|
||||
earlier.IsBefore(later).Should().BeTrue();
|
||||
later.IsAfter(earlier).Should().BeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsConcurrent_SameTimeCounterDifferentNode_ReturnsTrue()
|
||||
{
|
||||
var a = CreateTimestamp(1000, "node-a", 3);
|
||||
var b = CreateTimestamp(1000, "node-b", 3);
|
||||
|
||||
a.IsConcurrent(b).Should().BeTrue();
|
||||
b.IsConcurrent(a).Should().BeTrue();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user