Summary
The class layer has no contract tests. Several methods are broken (AddProperty, IsValid) and several transform attributes have dead code paths (ConditionGroupTransformAttribute.FromJson). Tests at this layer would have caught those bugs and will prevent regression after they're fixed.
New File(s)
tests/Classes.tests.ps1 (or split into ConditionGroup.tests.ps1, PropertySet.tests.ps1)
Tests to Add
ConditionGroup constructor
ConditionGroup methods
IsValid() returns $true for a flat leaf condition
IsValid() returns $false for a partial condition (missing Value)
ToString() for each shape: flat, AllOf, AnyOf, Not, nested
ConditionGroupTransformAttribute
PropertySet
PropertyDefinition.Validate
- Returns
$true when value is valid
- Returns
$false (and emits warning) for each constraint violation
- Returns
$true when no validation is configured
FeatureFlag
FromJson round-trips correctly
FromFile round-trips correctly
Save writes valid JSON that re-parses to equivalent object
Notes
Summary
The class layer has no contract tests. Several methods are broken (
AddProperty,IsValid) and several transform attributes have dead code paths (ConditionGroupTransformAttribute.FromJson). Tests at this layer would have caught those bugs and will prevent regression after they're fixed.New File(s)
tests/Classes.tests.ps1(or split intoConditionGroup.tests.ps1,PropertySet.tests.ps1)Tests to Add
ConditionGroup constructor
ConditionGroup methods
IsValid()returns$truefor a flat leaf conditionIsValid()returns$falsefor a partial condition (missing Value)ToString()for each shape: flat, AllOf, AnyOf, Not, nestedConditionGroupTransformAttribute
PropertySet
AddPropertyadds entry keyed byName(after fix for fix(PropertySet): AddProperty throws on every call — wrong hashtable.Add signature #11)AddPropertyreturns$thisfor chainingGetPropertyreturns the correctPropertyDefinitionContainsKeyreturns true/false correctlyFromFilesetsNamecorrectly (after fix for fix(PropertySet): FromFile silently sets Name to $null — .BaseName on a string #14)Save→FromFileround-trip preserves all properties and validation constraintsPropertyDefinition.Validate
$truewhen value is valid$false(and emits warning) for each constraint violation$truewhen no validation is configuredFeatureFlag
FromJsonround-trips correctlyFromFileround-trips correctlySavewrites valid JSON that re-parses to equivalent objectNotes