TestimoX

API Reference

Class

PropertyAccessor

Namespace TestimoX.Testing
Assembly TestimoX

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 requiredposition: 0

Methods

public Boolean Exists(Object obj) #
Returns: Boolean

Checks if the property exists on the object.

Parameters

obj System.Object requiredposition: 0
public static PropertyAccessor ForJsonPath(String jsonPath) #
Returns: PropertyAccessor

Creates a property accessor for a JSON path.

Parameters

jsonPath System.String requiredposition: 0
public static PropertyAccessor ForPath(params String[] pathParts) #
Returns: PropertyAccessor

Creates a property accessor for a nested property path.

Parameters

pathParts System.String[] requiredposition: 0
public static PropertyAccessor ForProperty(String propertyName) #
Returns: PropertyAccessor

Creates a property accessor for a simple property name.

Parameters

propertyName System.String requiredposition: 0
public T GetValue<T>(Object obj) #
Returns: T

Gets the value from an object using the configured property path.

Type Parameters

T

Parameters

obj System.Object requiredposition: 0
GetValue``1(System.Object obj) #

Gets the value as a specific type.

Parameters

obj System.Object required

Properties

public String Path { get; } #

Original property path string passed to the accessor.