stabilizaiton work - projects rework for maintenanceability and ui livening

This commit is contained in:
master
2026-02-03 23:40:04 +02:00
parent 074ce117ba
commit 557feefdc3
3305 changed files with 186813 additions and 107843 deletions

View File

@@ -0,0 +1,47 @@
using StellaOps.TestKit;
using Xunit;
namespace StellaOps.Canonical.Json.Tests;
public partial class CanonVersionTests
{
[Trait("Category", TestCategories.Unit)]
[Fact]
public void IsVersioned_VersionedJson_ReturnsTrue()
{
var json = """{"_canonVersion":"stella:canon:v1","foo":"bar"}"""u8;
Assert.True(CanonVersion.IsVersioned(json));
}
[Trait("Category", TestCategories.Unit)]
[Fact]
public void IsVersioned_LegacyJson_ReturnsFalse()
{
var json = """{"foo":"bar"}"""u8;
Assert.False(CanonVersion.IsVersioned(json));
}
[Trait("Category", TestCategories.Unit)]
[Fact]
public void IsVersioned_EmptyJson_ReturnsFalse()
{
var json = "{}"u8;
Assert.False(CanonVersion.IsVersioned(json));
}
[Trait("Category", TestCategories.Unit)]
[Fact]
public void IsVersioned_TooShort_ReturnsFalse()
{
var json = """{"_ca":"v"}"""u8;
Assert.False(CanonVersion.IsVersioned(json));
}
[Trait("Category", TestCategories.Unit)]
[Fact]
public void IsVersioned_WrongFieldName_ReturnsFalse()
{
var json = """{"_version":"stella:canon:v1","foo":"bar"}"""u8;
Assert.False(CanonVersion.IsVersioned(json));
}
}