StringAssert.DoesNotMatch 方法 (String, Regex)

验证指定的字符串是否与正则表达式不匹配。

命名空间:  Microsoft.VisualStudio.TestTools.UnitTesting
程序集:  Microsoft.VisualStudio.QualityTools.UnitTestFramework(在 Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll 中)

语法

声明
Public Shared Sub DoesNotMatch ( _
    value As String, _
    pattern As Regex _
)
public static void DoesNotMatch(
    string value,
    Regex pattern
)
public:
static void DoesNotMatch(
    String^ value, 
    Regex^ pattern
)
static member DoesNotMatch : 
        value:string * 
        pattern:Regex -> unit 
public static function DoesNotMatch(
    value : String, 
    pattern : Regex
)

参数

  • value
    类型:System.String
    不应与 pattern 匹配的字符串。

异常

异常 条件
AssertFailedException

value 与 pattern匹配。

备注

如果字符串与表达式匹配,则断言失败。

.NET Framework 安全性

请参见

参考

StringAssert 类

DoesNotMatch 重载

Microsoft.VisualStudio.TestTools.UnitTesting 命名空间