stabilizaiton work - projects rework for maintenanceability and ui livening
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
// <copyright file="HybridLogicalClockTests.State.cs" company="StellaOps">
|
||||
// Copyright (c) StellaOps. Licensed under BUSL-1.1.
|
||||
// </copyright>
|
||||
using FluentAssertions;
|
||||
using Xunit;
|
||||
|
||||
namespace StellaOps.HybridLogicalClock.Tests;
|
||||
|
||||
public sealed partial class HybridLogicalClockTests
|
||||
{
|
||||
[Fact]
|
||||
public void Current_ReturnsLatestState()
|
||||
{
|
||||
var timeProvider = CreateTimeProvider();
|
||||
var clock = CreateClock(timeProvider);
|
||||
|
||||
var tick1 = clock.Tick();
|
||||
var current1 = clock.Current;
|
||||
|
||||
var tick2 = clock.Tick();
|
||||
var current2 = clock.Current;
|
||||
|
||||
current1.Should().Be(tick1);
|
||||
current2.Should().Be(tick2);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Tick_PersistsStateToStore()
|
||||
{
|
||||
var timeProvider = CreateTimeProvider();
|
||||
var stateStore = new InMemoryHlcStateStore();
|
||||
var clock = CreateClock(timeProvider, store: stateStore);
|
||||
|
||||
clock.Tick();
|
||||
|
||||
stateStore.GetAllStates().Count.Should().Be(1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user