Publish Ludarium source
Public source validation / source (push) Successful in 2m16s

This commit is contained in:
Ludarium release export
2026-09-03 02:08:58 +02:00
commit df869819ce
339 changed files with 46455 additions and 0 deletions
@@ -0,0 +1,22 @@
using Ludarium.Application;
using Ludarium.Domain;
namespace Ludarium.UnitTests;
public sealed class ClaimPolicyTests
{
[Fact]
public void LockedManualClaimOverridesAutomaticEvidenceAndSupersessionIsAppendOnly()
{
var entity = Guid.NewGuid(); var now = DateTimeOffset.UtcNow;
var automatic = Claim(Guid.NewGuid(), entity, "Automatic title", Confidence.Deterministic, false, now);
var manual = Claim(Guid.NewGuid(), entity, "Operator title", Confidence.High, true, now.AddSeconds(1));
var corrected = Claim(Guid.NewGuid(), entity, "Corrected title", Confidence.Deterministic, true, now.AddSeconds(2), manual.Id);
Assert.Equal("Operator title", ClaimPolicy.SelectEffective([automatic, manual])?.Value);
Assert.Equal("Corrected title", ClaimPolicy.SelectEffective([automatic, manual, corrected])?.Value);
Assert.Equal(3, new[] { automatic, manual, corrected }.Length);
}
private static MetadataClaim Claim(Guid id, Guid entity, string value, Confidence confidence, bool locked, DateTimeOffset at, Guid? supersedes = null) =>
new(id, "Game", entity, "title", value, locked ? "Manual" : "Analyzer", "test", confidence, [], locked, at, supersedes);
}