Table of Contents

Method DoesNotMatch

Namespace
Xunit
Assembly
xunit.v3.assert.dll

DoesNotMatch(string, string?)

Verifies that a string does not match a regular expression.

public static void DoesNotMatch(string expectedRegexPattern, string? actualString)

Parameters

expectedRegexPattern string

The regex pattern expected not to match

actualString string

The string to be inspected

Exceptions

Thrown when the string matches the regex pattern

DoesNotMatch(Regex, string?)

Verifies that a string does not match a regular expression.

public static void DoesNotMatch(Regex expectedRegex, string? actualString)

Parameters

expectedRegex Regex

The regex expected not to match

actualString string

The string to be inspected

Exceptions

Thrown when the string matches the regex