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)
- 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
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
.