Share via


Assert.DoesNotStartWith Method

Definition

Overloads

DoesNotStartWith(String, String, StringComparison, String, String, String)

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

DoesNotStartWith(String, String, String, String, String)

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

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, StringComparison, String, String, String)

Source:
Assert.StartsWith.cs

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

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

Parameters

notExpectedPrefix
String

The string not expected to be a prefix of value.

value
String

The string that is not expected to begin with notExpectedPrefix.

comparisonType
StringComparison

The comparison method to compare strings comparisonType.

message
String

The message to include in the exception when value begins with notExpectedPrefix. The message is shown in test results.

notExpectedPrefixExpression
String

The syntactic expression of notExpectedPrefix 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 notExpectedPrefix is null, or value does not start with notExpectedPrefix.

Applies to

DoesNotStartWith(String, String, String, String, String)

Source:
Assert.StartsWith.cs

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

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

Parameters

notExpectedPrefix
String

The string not expected to be a prefix of value.

value
String

The string that is not expected to begin with notExpectedPrefix.

message
String

The message to include in the exception when value begins with notExpectedPrefix. The message is shown in test results.

notExpectedPrefixExpression
String

The syntactic expression of notExpectedPrefix 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 notExpectedPrefix is null, or value does not start with notExpectedPrefix.

Applies to

DoesNotStartWith(String, String, String)

Source:
Assert.StartsWith.cs
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
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