Telerik® JustMock™ by Progress

Setups target property set operation to act in a specific way.

Examples

CopyC#
Mock.ArrangeSet(() =>; foo.MyValue = 10).Throws(new InvalidOperationException());
This will throw InvalidOperationException for when foo.MyValue is set with 10.

Namespace: Telerik.JustMock.Helpers
Assembly: Telerik.JustMock (in Telerik.JustMock.dll) Version: 2013.3.1021.0 (2013.3.1021.0)

Syntax

C#
public static ActionExpectation ArrangeSet<T>(
	this T obj,
	Action<T> action
)
Visual Basic
<ExtensionAttribute> _
Public Shared Function ArrangeSet(Of T) ( _
	obj As T, _
	action As Action(Of T) _
) As ActionExpectation

Parameters

obj
Type: T
Target mock object.
action
Type: System..::..Action<(Of <(<'T>)>)>
Target action.

Type Parameters

T
Mock type.

Return Value

Reference to ActionExpectation to setup the mock.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also