fix: preserve SDK 2.0 client value and lifetime contracts
This commit is contained in:
@@ -23,6 +23,26 @@ public class ReadWriteViewModelTests
|
||||
_vm = new ReadWriteViewModel(_service, dispatcher);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ReadCommand_FormatsSdkArraysByteStringsAndEmptyText()
|
||||
{
|
||||
_vm.IsConnected = true;
|
||||
_vm.SelectedNodeId = "ns=2;s=SomeNode";
|
||||
foreach (var (value, expected) in new (Variant Value, string Expected)[]
|
||||
{
|
||||
(Variant.From(new int[] { 1, 2 }.ToArrayOf()), "[1,2]"),
|
||||
(Variant.From(ArrayOf<int>.Empty), "[]"),
|
||||
(Variant.From(ByteString.From(new byte[] { 3, 4 })), "[3,4]"),
|
||||
(Variant.From(LocalizedText.Null), ""),
|
||||
(Variant.Null, "(null)")
|
||||
})
|
||||
{
|
||||
_service.ReadResult = new DataValue(value, StatusCodes.Good);
|
||||
await _vm.ReadCommand.ExecuteAsync(null);
|
||||
_vm.CurrentValue.ShouldBe(expected);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the read command cannot execute when disconnected.</summary>
|
||||
[Fact]
|
||||
public void ReadCommand_CannotExecute_WhenDisconnected()
|
||||
|
||||
Reference in New Issue
Block a user