Partager via


StringAssert.DoesNotMatch Method

Definition

Overloads

DoesNotMatch(String, Regex)

Tests whether the specified string does not match a regular expression and throws an exception if the string matches the expression.

DoesNotMatch(String, Regex, String)

Tests whether the specified string does not match a regular expression and throws an exception if the string matches the expression.

DoesNotMatch(String, Regex, String, Object[])

Tests whether the specified string does not match a regular expression and throws an exception if the string matches the expression.

DoesNotMatch(String, Regex)

Tests whether the specified string does not match a regular expression and throws an exception if the string matches the expression.

public:
 static void DoesNotMatch(System::String ^ value, System::Text::RegularExpressions::Regex ^ pattern);
public static void DoesNotMatch (string value, System.Text.RegularExpressions.Regex pattern);
static member DoesNotMatch : string * System.Text.RegularExpressions.Regex -> unit
Public Shared Sub DoesNotMatch (value As String, pattern As Regex)

Parameters

value
String

The string that is expected not to match pattern.

pattern
Regex

The regular expression that value is expected to not match.

Exceptions

Thrown if value matches pattern.

Applies to

DoesNotMatch(String, Regex, String)

Tests whether the specified string does not match a regular expression and throws an exception if the string matches the expression.

public:
 static void DoesNotMatch(System::String ^ value, System::Text::RegularExpressions::Regex ^ pattern, System::String ^ message);
public static void DoesNotMatch (string value, System.Text.RegularExpressions.Regex pattern, string message);
static member DoesNotMatch : string * System.Text.RegularExpressions.Regex * string -> unit
Public Shared Sub DoesNotMatch (value As String, pattern As Regex, message As String)

Parameters

value
String

The string that is expected not to match pattern.

pattern
Regex

The regular expression that value is expected to not match.

message
String

The message to include in the exception when value matches pattern. The message is shown in test results.

Exceptions

Thrown if value matches pattern.

Applies to

DoesNotMatch(String, Regex, String, Object[])

Tests whether the specified string does not match a regular expression and throws an exception if the string matches the expression.

public:
 static void DoesNotMatch(System::String ^ value, System::Text::RegularExpressions::Regex ^ pattern, System::String ^ message, ... cli::array <System::Object ^> ^ parameters);
public static void DoesNotMatch (string value, System.Text.RegularExpressions.Regex pattern, string message, params object[] parameters);
static member DoesNotMatch : string * System.Text.RegularExpressions.Regex * string * obj[] -> unit
Public Shared Sub DoesNotMatch (value As String, pattern As Regex, message As String, ParamArray parameters As Object())

Parameters

value
String

The string that is expected not to match pattern.

pattern
Regex

The regular expression that value is expected to not match.

message
String

The message to include in the exception when value matches pattern. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if value matches pattern.

Applies to