New to Telerik JustMockStart a free 30-day trial

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:

C#
public interface IPropertyExpressionBuilder<T>

Methods

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.

C#
Expression<Func<T>> Get()
Returns:

Expression<Func<T>>

A Func expression representing the property get operation.

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.

C#
Expression<Action> Set(Expression<Func<T>> expression)
Parameters:expressionExpression<Func<T>>

A lambda expression that produces the value to match when the property is set.

Returns:

Expression<Action>

An Action expression representing the property set operation with the specified matching logic.

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.

C#
Expression<Action> Set(T value)
Parameters:valueT

The exact value to match when the property is set.

Returns:

Expression<Action>

An Action expression representing the property set operation.

In this article
DefinitionMethodsGet()Set(Expression<Func<T>>)Set(T)
Not finding the help you need?
Contact Support