test: preserve server SDK 2.0 value security and history contracts

This commit is contained in:
Joseph Doherty
2026-11-10 10:37:52 -05:00
parent ac5e9d84f0
commit 9cddc9306b
45 changed files with 1215 additions and 641 deletions
@@ -55,7 +55,7 @@ public sealed class NodeManagerSurgicalShapeUpdateTests : IDisposable
applied.ShouldBeTrue();
node.DataType.ShouldBe(DataTypeIds.Int32); // swapped in place
node.ValueRank.ShouldBe(ValueRanks.Scalar);
node.Value.ShouldBeNull(); // stale Float value dropped
node.Value.IsNull.ShouldBeTrue(); // stale Float value dropped
node.StatusCode.ShouldBe((StatusCode)StatusCodes.BadWaitingForInitialData);
await host.DisposeAsync();
@@ -79,9 +79,9 @@ public sealed class NodeManagerSurgicalShapeUpdateTests : IDisposable
applied.ShouldBeTrue();
node.ValueRank.ShouldBe(ValueRanks.OneDimension);
node.ArrayDimensions.ShouldNotBeNull();
node.ArrayDimensions.IsNull.ShouldBeFalse();
node.ArrayDimensions[0].ShouldBe(8u);
node.Value.ShouldBeNull(); // stale scalar value dropped
node.Value.IsNull.ShouldBeTrue(); // stale scalar value dropped
node.StatusCode.ShouldBe((StatusCode)StatusCodes.BadWaitingForInitialData);
await host.DisposeAsync();
@@ -106,7 +106,7 @@ public sealed class NodeManagerSurgicalShapeUpdateTests : IDisposable
applied.ShouldBeTrue();
node.ArrayDimensions[0].ShouldBe(8u);
node.Value.ShouldBeNull();
node.Value.IsNull.ShouldBeTrue();
node.StatusCode.ShouldBe((StatusCode)StatusCodes.BadWaitingForInitialData);
await host.DisposeAsync();
@@ -131,8 +131,8 @@ public sealed class NodeManagerSurgicalShapeUpdateTests : IDisposable
applied.ShouldBeTrue();
node.ValueRank.ShouldBe(ValueRanks.Scalar);
node.ArrayDimensions.ShouldBeNull();
node.Value.ShouldBeNull();
node.ArrayDimensions.IsNull.ShouldBeTrue();
node.Value.IsNull.ShouldBeTrue();
node.StatusCode.ShouldBe((StatusCode)StatusCodes.BadWaitingForInitialData);
await host.DisposeAsync();
@@ -154,7 +154,7 @@ public sealed class NodeManagerSurgicalShapeUpdateTests : IDisposable
applied.ShouldBeTrue();
node.ValueRank.ShouldBe(ValueRanks.OneDimension);
node.ArrayDimensions.ShouldNotBeNull();
node.ArrayDimensions.IsNull.ShouldBeFalse();
node.ArrayDimensions[0].ShouldBe(0u); // null length ⇒ [0], same as EnsureVariable
await host.DisposeAsync();
@@ -222,8 +222,8 @@ public sealed class NodeManagerSurgicalShapeUpdateTests : IDisposable
e.ShouldNotBeNull();
e.Changes.ShouldNotBeNull();
var changes = e.Changes.Value;
changes.Length.ShouldBe(1);
var changes = e.Changes!.Value;
changes.Count.ShouldBe(1);
changes[0].Affected.ShouldBe(node.NodeId);
changes[0].AffectedType.ShouldBe(VariableTypeIds.BaseDataVariableType);
changes[0].Verb.ShouldBe((byte)ModelChangeStructureVerbMask.DataTypeChanged);