语言

Assert.DoesNotEndWith 方法

定义

重载

名称 说明
DoesNotEndWith(String, String, String)

测试指定的字符串是否不以指定的子字符串结尾,如果测试字符串不以子字符串结尾,则引发异常。

DoesNotEndWith(String, String, StringComparison, String)

测试指定的字符串是否不以指定的子字符串结尾,如果测试字符串不以子字符串结尾,则引发异常。

DoesNotEndWith(String, String, String, String, String)

测试指定的字符串是否不以指定的意外后缀结尾,如果测试字符串以后缀结尾,则引发异常。

DoesNotEndWith(String, String, StringComparison, String, String, String)

测试指定的字符串是否不以指定的意外后缀结尾,如果测试字符串以后缀结尾,则引发异常。

DoesNotEndWith(String, String, String)

Source:
Assert.EndsWith.cs
Source:
Assert.EndsWith.cs

测试指定的字符串是否不以指定的子字符串结尾,如果测试字符串不以子字符串结尾,则引发异常。

public static void DoesNotEndWith(string? substring, string? value, string message = "");
static member DoesNotEndWith : string * string * string -> unit
Public Shared Sub DoesNotEndWith (substring As String, value As String, Optional message As String = "")

参数

substring
String

应不为后缀的 value字符串。

value
String

预期不会以 . 结尾的 substring字符串。

message
String

结尾时valuesubstring要包含在异常中的消息。 消息显示在测试结果中。

例外

value 为 null,或 substring 为 null,或 value 以 substring. 结尾。

适用于

DoesNotEndWith(String, String, StringComparison, String)

Source:
Assert.EndsWith.cs
Source:
Assert.EndsWith.cs

测试指定的字符串是否不以指定的子字符串结尾,如果测试字符串不以子字符串结尾,则引发异常。

public static void DoesNotEndWith(string? substring, string? value, StringComparison comparisonType, string message = "");
static member DoesNotEndWith : string * string * StringComparison * string -> unit
Public Shared Sub DoesNotEndWith (substring As String, value As String, comparisonType As StringComparison, Optional message As String = "")

参数

substring
String

应不为后缀的 value字符串。

value
String

预期不会以 . 结尾的 substring字符串。

comparisonType
StringComparison

比较字符串 comparisonType的比较方法。

message
String

结尾时valuesubstring要包含在异常中的消息。 消息显示在测试结果中。

例外

value 为 null,或 substring 为 null,或 value 以 substring. 结尾。

适用于

DoesNotEndWith(String, String, String, String, String)

Source:
Assert.EndsWith.cs
Source:
Assert.EndsWith.cs
Source:
Assert.EndsWith.cs
Source:
Assert.EndsWith.cs

测试指定的字符串是否不以指定的意外后缀结尾,如果测试字符串以后缀结尾,则引发异常。

public static void DoesNotEndWith(string? notExpectedSuffix, string? value, string? message = "", string notExpectedSuffixExpression = "", string valueExpression = "");
static member DoesNotEndWith : string * string * string * string * string -> unit
Public Shared Sub DoesNotEndWith (notExpectedSuffix As String, value As String, Optional message As String = "", Optional notExpectedSuffixExpression As String = "", Optional valueExpression As String = "")

参数

notExpectedSuffix
String

应不为后缀的 value字符串。

value
String

应不以 . 结尾的 notExpectedSuffix字符串。

message
String

结尾时valuenotExpectedSuffix要包含在异常中的消息。 消息显示在测试结果中。

notExpectedSuffixExpression
String

notExpectedSuffix 的语法表达式,由编译器通过调用方参数表达式提供。 用户不应传递此参数的值。

valueExpression
String

编译器通过调用方参数表达式提供的值的语法表达式。 用户不应传递此参数的值。

例外

value 为 null,或 notExpectedSuffix 为 null,或 value 以 notExpectedSuffix. 结尾。

适用于

DoesNotEndWith(String, String, StringComparison, String, String, String)

Source:
Assert.EndsWith.cs
Source:
Assert.EndsWith.cs
Source:
Assert.EndsWith.cs
Source:
Assert.EndsWith.cs

测试指定的字符串是否不以指定的意外后缀结尾,如果测试字符串以后缀结尾,则引发异常。

public static void DoesNotEndWith(string? notExpectedSuffix, string? value, StringComparison comparisonType, string? message = "", string notExpectedSuffixExpression = "", string valueExpression = "");
static member DoesNotEndWith : string * string * StringComparison * string * string * string -> unit
Public Shared Sub DoesNotEndWith (notExpectedSuffix As String, value As String, comparisonType As StringComparison, Optional message As String = "", Optional notExpectedSuffixExpression As String = "", Optional valueExpression As String = "")

参数

notExpectedSuffix
String

应不为后缀的 value字符串。

value
String

应不以 . 结尾的 notExpectedSuffix字符串。

comparisonType
StringComparison

比较字符串 comparisonType的比较方法。

message
String

结尾时valuenotExpectedSuffix要包含在异常中的消息。 消息显示在测试结果中。

notExpectedSuffixExpression
String

notExpectedSuffix 的语法表达式,由编译器通过调用方参数表达式提供。 用户不应传递此参数的值。

valueExpression
String

编译器通过调用方参数表达式提供的值的语法表达式。 用户不应传递此参数的值。

例外

value 为 null,或 notExpectedSuffix 为 null,或 value 以 notExpectedSuffix. 结尾。

适用于