using Shouldly; using Xunit; using ZB.MOM.WW.OtOpcUa.Core.Abstractions; namespace ZB.MOM.WW.OtOpcUa.Core.Abstractions.Tests; /// Contract tests for the batched data-change payload types. [Trait("Category", "Unit")] public sealed class DataChangeBatchContractTests { private sealed record FakeHandle(string DiagnosticId) : ISubscriptionHandle; /// Verifies the batch payload carries the subscription handle and its per-tag items. [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); } }