Assert.DoesNotMatchRegex Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| DoesNotMatchRegex(String, String, String) |
Tests whether the specified string does not match a regular expression and throws an exception if the string MatchesRegex the expression. |
| DoesNotMatchRegex(Regex, String, String) |
Tests whether the specified string does not match a regular expression and throws an exception if the string MatchesRegex the expression. |
| DoesNotMatchRegex(String, String, String, String, String) |
Tests whether the specified string does not match a regular expression and throws an exception if the string MatchesRegex the expression. |
| DoesNotMatchRegex(Regex, String, String, String, String) |
Tests whether the specified string does not match a regular expression and throws an exception if the string MatchesRegex the expression. |
DoesNotMatchRegex(String, String, String)
- Source:
- Assert.Matches.cs
- Source:
- Assert.Matches.cs
Tests whether the specified string does not match a regular expression and throws an exception if the string MatchesRegex the expression.
public static void DoesNotMatchRegex(string? pattern, string? value, string message = "");
static member DoesNotMatchRegex : string * string * string -> unit
Public Shared Sub DoesNotMatchRegex (pattern As String, value As String, Optional message As String = "")
Parameters
- pattern
- String
The regular expression that value is
expected to not match.
- value
- String
The string that is expected not to match pattern.
- message
- String
The message to include in the exception when value
MatchesRegex pattern. The message is shown in test
results.
Exceptions
value is null, or pattern is null,
or value MatchesRegex pattern.
Applies to
DoesNotMatchRegex(Regex, String, String)
- Source:
- Assert.Matches.cs
- Source:
- Assert.Matches.cs
Tests whether the specified string does not match a regular expression and throws an exception if the string MatchesRegex the expression.
public static void DoesNotMatchRegex(System.Text.RegularExpressions.Regex? pattern, string? value, string message = "");
static member DoesNotMatchRegex : System.Text.RegularExpressions.Regex * string * string -> unit
Public Shared Sub DoesNotMatchRegex (pattern As Regex, value As String, Optional message As String = "")
Parameters
- pattern
- Regex
The regular expression that value is
expected to not match.
- value
- String
The string that is expected not to match pattern.
- message
- String
The message to include in the exception when value
MatchesRegex pattern. The message is shown in test
results.
Exceptions
value is null, or pattern is null,
or value MatchesRegex pattern.
Applies to
DoesNotMatchRegex(String, String, String, String, String)
- Source:
- Assert.Matches.cs
Tests whether the specified string does not match a regular expression and throws an exception if the string MatchesRegex the expression.
public static void DoesNotMatchRegex(string? pattern, string? value, string? message = "", string patternExpression = "", string valueExpression = "");
static member DoesNotMatchRegex : string * string * string * string * string -> unit
Public Shared Sub DoesNotMatchRegex (pattern As String, value As String, Optional message As String = "", Optional patternExpression As String = "", Optional valueExpression As String = "")
Parameters
- pattern
- String
The regular expression that value is
expected to not match.
- value
- String
The string that is expected not to match pattern.
- message
- String
The message to include in the exception when value
MatchesRegex pattern. The message is shown in test
results.
- patternExpression
- String
The syntactic expression of pattern as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.
- valueExpression
- String
The syntactic expression of value as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.
Exceptions
value is null, or pattern is null,
or value MatchesRegex pattern.
Applies to
DoesNotMatchRegex(Regex, String, String, String, String)
- Source:
- Assert.Matches.cs
Tests whether the specified string does not match a regular expression and throws an exception if the string MatchesRegex the expression.
public static void DoesNotMatchRegex(System.Text.RegularExpressions.Regex? pattern, string? value, string? message = "", string patternExpression = "", string valueExpression = "");
static member DoesNotMatchRegex : System.Text.RegularExpressions.Regex * string * string * string * string -> unit
Public Shared Sub DoesNotMatchRegex (pattern As Regex, value As String, Optional message As String = "", Optional patternExpression As String = "", Optional valueExpression As String = "")
Parameters
- pattern
- Regex
The regular expression that value is
expected to not match.
- value
- String
The string that is expected not to match pattern.
- message
- String
The message to include in the exception when value
MatchesRegex pattern. The message is shown in test
results.
- patternExpression
- String
The syntactic expression of pattern as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.
- valueExpression
- String
The syntactic expression of value as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.
Exceptions
value is null, or pattern is null,
or value MatchesRegex pattern.