IsAny(TValue) Method

Moq 2.6

Matches any value of the given TValue type.

Namespace:  Moq
Assembly:  Moq (in Moq.dll) Version: 2.6.1014.1 (2.6.0.0)

Syntax

C#
public static TValue IsAny<TValue>()

Type Parameters

TValue
Type of the value.

Remarks

Typically used when the actual argument value for a method call is not relevant.

Examples

CopyC#
// Throws an exception for a call to Remove with any string value.
mock.Expect(x => x.Remove(It.IsAny<string>())).Throws(new InvalidOperationException());

See Also