Telerik® JustMock™ by Progress

Applies a matcher to a 'ref' parameter. By default, 'ref' parameters work like implicitly arranged return values. In other words, you arrange a method to return a given value through its 'ref' and 'out' parameters. Use this method to specify that the argument should have a matcher applied just like regular arguments.

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

Syntax

C#
public static Arg..::..OutRefResult<T> Ref<T>(
	T value
)
Visual Basic
Public Shared Function Ref(Of T) ( _
	value As T _
) As Arg..::..OutRefResult(Of T)

Parameters

value
Type: T
A matcher or a value.

Type Parameters

T
Type for the argument

Return Value

A special value with member 'Value' that must be passed by ref.

Examples

interface IHasRef { int PassRef(ref int a); } var mock = Mock.Create<IHasRef>() Mock.Arrange(() => mock.PassRef(ref Arg.Ref(100).Value).Returns(200); The above example arranges PassRef to return 200 whenever its argument is 100.

See Also