API Reference
Class
PropertyAccessor
Provides flexible property access for test comparisons. Supports nested properties, array indexing, and JSON path notation.
Inheritance
- Object
- PropertyAccessor
Constructors
public PropertyAccessor(String propertyPath) #Creates a new accessor for the specified property path. Supports plain paths (A.B.C), the root sentinel "$" and reflective paths starting with "$.".
Parameters
- propertyPath System.String
Methods
public Boolean Exists(Object obj) #Returns:
BooleanChecks if the property exists on the object.
Parameters
- obj System.Object
public static PropertyAccessor ForJsonPath(String jsonPath) #Returns:
PropertyAccessorCreates a property accessor for a JSON path.
Parameters
- jsonPath System.String
public static PropertyAccessor ForPath(params String[] pathParts) #Returns:
PropertyAccessorCreates a property accessor for a nested property path.
Parameters
- pathParts System.String[]
public static PropertyAccessor ForProperty(String propertyName) #Returns:
PropertyAccessorCreates a property accessor for a simple property name.
Parameters
- propertyName System.String
public T GetValue<T>(Object obj) #Returns:
TGets the value from an object using the configured property path.
Type Parameters
- T
Parameters
- obj System.Object
Inherited Methods
Properties
public String Path { get; } #Original property path string passed to the accessor.