refactor(historian): single-parse ExtractTagHistorize + review-nit tests/docs

Stop parsing TagConfig twice per tag on the deploy hot path: Phase7Composer's
equipment-tag Select lambda is now block-bodied (captures isHistorized/historianTagname
once), and DeploymentArtifact.BuildEquipmentTagPlans captures locals before result.Add.
Add wrong-type-historianTagname InlineData to ExtractTagHistorizeTests. Extend the
parity round-trip fixture with a 4th tag (isHistorized:false + JSON-null tagname)
exercising the artifact-side private guard path. Align DeploymentArtifact's
ExtractTagHistorize doc-comment with the composer-side phrasing (ExtractTagFullName /
ExtractTagAlarm cross-reference).
This commit is contained in:
Joseph Doherty
2026-06-14 19:02:02 -04:00
parent 440929c82a
commit c35c1d3734
4 changed files with 52 additions and 17 deletions
@@ -24,6 +24,8 @@ public class ExtractTagHistorizeTests
[InlineData("[1,2]", false, null)]
// Wrong type for isHistorized (string, not bool) ⇒ false.
[InlineData("{\"isHistorized\":\"yes\"}", false, null)]
// Wrong type for historianTagname (number, not string) ⇒ tagname null, flag still honoured.
[InlineData("{\"isHistorized\":true,\"historianTagname\":123}", true, null)]
public void ExtractTagHistorize_parses_or_returns_defaults(string? cfg, bool expectedHistorized, string? expectedTagname)
{
var (isHistorized, historianTagname) = Phase7Composer.ExtractTagHistorize(cfg);