Interface IPropertyExpressionBuilder<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.
Namespace: Telerik.JustMock
Assembly: Telerik.JustMock.dll
Syntax
public interface IPropertyExpressionBuilder<T>
Type Parameters
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
System.Linq.Expressions.Expression<System.Func<T>>
A Func expression representing the property get operation. |
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
T
value
The exact value to match when the property is set. |
Returns
System.Linq.Expressions.Expression<System.Action>
An Action expression representing the property set 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
System.Linq.Expressions.Expression<System.Func<T>>
expression
A lambda expression that produces the value to match when the property is set. |
Returns
System.Linq.Expressions.Expression<System.Action>
An Action expression representing the property set operation with the specified matching logic. |