test(core): pin batch-after-per-tag ordering; relocate batch tests beside the engine suite

This commit is contained in:
Joseph Doherty
2026-08-15 12:21:42 -04:00
parent cd4ce305a2
commit f81cbabd2d
3 changed files with 132 additions and 5 deletions
@@ -0,0 +1,27 @@
using Shouldly;
using Xunit;
using ZB.MOM.WW.OtOpcUa.Core.Abstractions;
namespace ZB.MOM.WW.OtOpcUa.Core.Abstractions.Tests;
/// <summary>Contract tests for the batched data-change payload types.</summary>
[Trait("Category", "Unit")]
public sealed class DataChangeBatchContractTests
{
private sealed record FakeHandle(string DiagnosticId) : ISubscriptionHandle;
/// <summary>Verifies the batch payload carries the subscription handle and its per-tag items.</summary>
[Fact]
public void Batch_args_carry_handle_and_items()
{
var handle = new FakeHandle("h1");
var snap = new DataValueSnapshot(42, 0u, DateTime.UtcNow, DateTime.UtcNow);
var args = new DataChangeBatchEventArgs(handle, new[] { new DataChangeItem("plc/tag1", snap) });
args.SubscriptionHandle.ShouldBe(handle);
args.Items.Count.ShouldBe(1);
args.Items[0].FullReference.ShouldBe("plc/tag1");
args.Items[0].Snapshot.ShouldBe(snap);
}
}