InterfaceIPropertyExpressionBuilder<T>
Defines methods for building LINQ expressions that represent property get and set operations. This interface is used to facilitate setting up expectations and verifications for property access. It provides a strongly-typed approach to creating expressions that can be used to intercept, verify, and emulate property behavior during testing.
Definition
Namespace:Telerik.JustMock
Assembly:Telerik.JustMock.dll
Type Parameters:
T
Syntax:
public interface IPropertyExpressionBuilder<T>
Methods
Get()
Builds an expression for property get arrangement. This method creates an expression that represents retrieving the value of the property, which can be used to arrange behavior when the property is accessed, such as returning specific values or throwing exceptions.
Declaration
Expression<Func<T>> Get()
Returns
Expression<Func<T>>
A Func expression representing the property get operation.
Set(Expression<Func<T>>)
Builds an expression for property set arrangement using a lambda. This method allows for more complex matching logic when arranging property set operations, such as matching ranges of values or applying custom validation criteria.
Declaration
Expression<Action> Set(Expression<Func<T>> expression)
Parameters
expression
Expression<Func<T>>
A lambda expression that produces the value to match when the property is set.
Returns
An Action expression representing the property set operation with the specified matching logic.
Set(T)
Builds an expression for property set arrangement with a specific value. This method creates an expression that represents assigning the specified value to the property, which can be used to verify that a property was set to a particular value or to arrange behavior when such an assignment occurs.
Declaration
Expression<Action> Set(T value)
Parameters
value
T
The exact value to match when the property is set.
Returns
An Action expression representing the property set operation.