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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user