Skip to content

test: add class-level contract tests for ConditionGroup, PropertySet, FeatureFlag, and transform attributes #24

@HeyItsGilbert

Description

@HeyItsGilbert

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ralphQueued for the ralph looptestsTest coverage gap or test quality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions