Assert.DoesNotEndWith 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
| DoesNotEndWith(String, String, String) |
Tests whether the specified string does not end with the specified substring and throws an exception if the test string does not end with the substring. |
| DoesNotEndWith(String, String, StringComparison, String) |
Tests whether the specified string does not end with the specified substring and throws an exception if the test string does not end with the substring. |
| DoesNotEndWith(String, String, String, String, String) |
Tests whether the specified string does not end with the specified unexpected suffix and throws an exception if the test string ends with the suffix. |
| DoesNotEndWith(String, String, StringComparison, String, String, String) |
Tests whether the specified string does not end with the specified unexpected suffix and throws an exception if the test string does ends with the suffix. |
DoesNotEndWith(String, String, String)
- Source:
- Assert.EndsWith.cs
- Source:
- Assert.EndsWith.cs
Tests whether the specified string does not end with the specified substring and throws an exception if the test string does not end with the substring.
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 = "")
Parameters
- substring
- String
The string expected not to be a suffix of value.
- value
- String
The string that is expected not to end with substring.
- message
- String
The message to include in the exception when value
ends with substring. The message is
shown in test results.
Exceptions
value is null, or substring is null,
or value ends with substring.
Applies to
DoesNotEndWith(String, String, StringComparison, String)
- Source:
- Assert.EndsWith.cs
- Source:
- Assert.EndsWith.cs
Tests whether the specified string does not end with the specified substring and throws an exception if the test string does not end with the substring.
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 = "")
Parameters
- substring
- String
The string expected not to be a suffix of value.
- value
- String
The string that is expected not to end with substring.
- comparisonType
- StringComparison
The comparison method to compare strings comparisonType.
- message
- String
The message to include in the exception when value
ends with substring. The message is
shown in test results.
Exceptions
value is null, or substring is null,
or value ends with substring.
Applies to
DoesNotEndWith(String, String, String, String, String)
- Source:
- Assert.EndsWith.cs
Tests whether the specified string does not end with the specified unexpected suffix and throws an exception if the test string ends with the suffix.
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 = "")
Parameters
- notExpectedSuffix
- String
The string expected not to be a suffix of value.
- value
- String
The string that is expected to not end with notExpectedSuffix.
- message
- String
The message to include in the exception when value
ends with notExpectedSuffix. The message is
shown in test results.
- notExpectedSuffixExpression
- String
The syntactic expression of notExpectedSuffix 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 notExpectedSuffix is null,
or value ends with notExpectedSuffix.
Applies to
DoesNotEndWith(String, String, StringComparison, String, String, String)
- Source:
- Assert.EndsWith.cs
Tests whether the specified string does not end with the specified unexpected suffix and throws an exception if the test string does ends with the suffix.
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 = "")
Parameters
- notExpectedSuffix
- String
The string expected not to be a suffix of value.
- value
- String
The string that is expected to not end with notExpectedSuffix.
- comparisonType
- StringComparison
The comparison method to compare strings comparisonType.
- message
- String
The message to include in the exception when value
ends with notExpectedSuffix. The message is
shown in test results.
- notExpectedSuffixExpression
- String
The syntactic expression of notExpectedSuffix 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 notExpectedSuffix is null,
or value ends with notExpectedSuffix.