Merge B1-ablegacy: v3 RawPath read-path
This commit is contained in:
@@ -94,9 +94,13 @@ public sealed class BuildOptionsTests
|
||||
options.Devices[0].DeviceName.ShouldBe("cli-MicroLogix");
|
||||
}
|
||||
|
||||
/// <summary>Verifies that tag list is forwarded verbatim to the options.</summary>
|
||||
/// <summary>
|
||||
/// Verifies that the typed tag list is delivered as v3 <see cref="RawTagEntry"/> records: RawPath =
|
||||
/// the def's Name, DeviceName = the def's DeviceHostAddress, and the TagConfig blob round-trips the
|
||||
/// def's address / dataType / writable through the real mapper.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void BuildOptions_forwards_tag_list_verbatim()
|
||||
public void BuildOptions_delivers_tags_as_rawtag_entries()
|
||||
{
|
||||
var cmd = new TestCommand
|
||||
{
|
||||
@@ -107,7 +111,18 @@ public sealed class BuildOptionsTests
|
||||
|
||||
var options = cmd.Build(SampleTags);
|
||||
|
||||
options.Tags.ShouldBe(SampleTags);
|
||||
options.RawTags.Count.ShouldBe(SampleTags.Count);
|
||||
for (var i = 0; i < SampleTags.Count; i++)
|
||||
{
|
||||
var def = SampleTags[i];
|
||||
var entry = options.RawTags[i];
|
||||
entry.RawPath.ShouldBe(def.Name);
|
||||
entry.DeviceName.ShouldBe(def.DeviceHostAddress);
|
||||
AbLegacyTagDefinitionFactory.FromTagConfig(entry.TagConfig, entry.RawPath, out var round).ShouldBeTrue();
|
||||
round.Address.ShouldBe(def.Address);
|
||||
round.DataType.ShouldBe(def.DataType);
|
||||
round.Writable.ShouldBe(def.Writable);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Verifies that timeout-ms option is propagated to the driver options.</summary>
|
||||
@@ -139,7 +154,7 @@ public sealed class BuildOptionsTests
|
||||
|
||||
var options = cmd.Build([]);
|
||||
|
||||
options.Tags.ShouldBeEmpty();
|
||||
options.RawTags.ShouldBeEmpty();
|
||||
options.Devices.Count.ShouldBe(1);
|
||||
options.Devices[0].PlcFamily.ShouldBe(AbLegacyPlcFamily.Plc5);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user