feat(cli): historyread --held-marker-file for hand-paged reads

This commit is contained in:
Joseph Doherty
2026-11-24 00:42:46 -05:00
parent 3b630ab1a9
commit b50019db9c
3 changed files with 12 additions and 1 deletions
@@ -73,13 +73,16 @@ public class HistoryReadPagedCommandTests
{
var fake = new FakeOpcUaClientService();
fake.HistoryPages.Enqueue(new HistoryPage(StatusCodes.Good, [Value(1, 0)], [5]));
var held = Path.Combine(Path.GetTempPath(), "cli-held-" + Guid.NewGuid().ToString("N"));
using var console = TestConsoleHelper.CreateConsole();
var command = new HistoryReadCommand(new FakeOpcUaClientServiceFactory(fake))
{
Url = "opc.tcp://localhost:4840", NodeId = "ns=3;s=p1.x", PageSize = 1,
AbandonAfterPage = release ? 0 : 1, ReleaseAfterPage = release ? 1 : 0,
AbandonAfterPage = release ? 0 : 1, ReleaseAfterPage = release ? 1 : 0, HeldMarkerFile = held,
};
await command.ExecuteAsync(console);
File.Exists(held).ShouldBeTrue("the held marker is written at the abandon / release point");
File.Delete(held);
var output = TestConsoleHelper.GetOutput(console);
if (release)
{