Matches a string argument if it matches the given regular expression pattern.
Namespace:
MoqAssembly: Moq (in Moq.dll) Version: 2.5.1.153 (2.5.1.0)
Syntax
Parameters
- regex
- Type: System..::.String
The pattern to use to match the string argument value.
Examples
The following example shows how to expect a call to a method where the
string argument matches the given regular expression:
CopyC#
mock.Expect(x => x.Check(It.IsRegex("[a-z]+"))).Returns(1);