Share via


Assert.DoesNotStartWith Method

Definition

Overloads

DoesNotStartWith(String, String, String)

Tests whether the specified string does not begin with the specified substring and throws an exception if the test string does start with the substring.

DoesNotStartWith(String, String, StringComparison, String)

Tests whether the specified string does not begin with the specified substring and throws an exception if the test string does start with the substring.

DoesNotStartWith(String, String, String)

Source:
Assert.StartsWith.cs

Tests whether the specified string does not begin with the specified substring and throws an exception if the test string does start with the substring.

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

Parameters

substring
String

The string expected to be a prefix of value.

value
String

The string that is expected to begin with substring.

message
String

The message to include in the exception when value does not begin with substring. The message is shown in test results.

Exceptions

value is null, or substring is null, or value does not start with substring.

Applies to

DoesNotStartWith(String, String, StringComparison, String)

Source:
Assert.StartsWith.cs

Tests whether the specified string does not begin with the specified substring and throws an exception if the test string does start with the substring.

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

Parameters

substring
String

The string expected to be a prefix of value.

value
String

The string that is expected to begin with substring.

comparisonType
StringComparison

The comparison method to compare strings comparisonType.

message
String

The message to include in the exception when value does not begin with substring. The message is shown in test results.

Exceptions

value is null, or substring is null, or value does not start with substring.

Applies to