fix: preserve SDK 2.0 client value and lifetime contracts

This commit is contained in:
Joseph Doherty
2026-11-10 10:19:42 -05:00
parent 0ecea3c6be
commit 3ca06e1b87
38 changed files with 591 additions and 186 deletions
@@ -33,9 +33,9 @@ public class HistoryUpdateCommandTests
.BuildDetails().ShouldBeOfType<UpdateDataDetails>();
d.PerformInsertReplace.ShouldBe(PerformUpdateType.Insert);
d.UpdateValues.Count.ShouldBe(2);
d.UpdateValues[1].Value.ShouldBe(2.5);
d.UpdateValues[1].WrappedValue.ShouldBe(Variant.From(2.5));
d.UpdateValues[0].SourceTimestamp.ShouldBe(new DateTime(2026, 1, 15, 8, 0, 0, DateTimeKind.Utc));
d.NodeId.Identifier.ShouldBe("HistNode");
d.NodeId.IdentifierAsString.ShouldBe("HistNode");
}
/// <summary>Replace and update map to their update types.</summary>
@@ -60,7 +60,7 @@ public class HistoryUpdateCommandTests
{
var d = Make(values: [value], times: ["2026-01-15T08:00:00Z"], type: type)
.BuildDetails().ShouldBeOfType<UpdateDataDetails>();
d.UpdateValues[0].Value.ShouldBeOfType(expected);
ZB.MOM.WW.OtOpcUa.Client.Shared.Helpers.ValueConverter.ToClrObject(d.UpdateValues[0].WrappedValue).ShouldBeOfType(expected);
}
/// <summary>delete-raw builds DeleteRawModifiedDetails with IsDeleteModified=false.</summary>
@@ -211,7 +211,7 @@ public class HistoryUpdateCommandTests
public async Task Execute_UnnamedStatus_PrintsHex()
{
const uint unnamed = 0x8FFF0000u;
StatusCodes.GetBrowseName(unnamed).ShouldBeNullOrEmpty(); // precondition: genuinely unnamed
new StatusCode(unnamed).SymbolicId.ShouldBeNullOrEmpty(); // precondition: genuinely unnamed
var svc = new FakeOpcUaClientService
{
HistoryUpdateResult = new HistoryUpdateOutcome(StatusCodes.Good, [StatusCodes.Good],