Method StartsWith
- Namespace
- Xunit
- Assembly
- xunit.v3.assert.dll
StartsWith(string?, string?)
Verifies that a string starts with a given string, using the current culture.
public static void StartsWith(string? expectedStartString, string? actualString)
Parameters
expectedStartStringstringThe string expected to be at the start of the string
actualStringstringThe string to be inspected
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(string?, string?, StringComparison)
Verifies that a string starts with a given sub-string, using the given comparison type.
public static void StartsWith(string? expectedStartString, string? actualString, StringComparison comparisonType)
Parameters
expectedStartStringstringThe sub-string expected to be at the start of the string
actualStringstringThe string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(Memory<char>, Memory<char>)
Verifies that a string starts with a given sub-string, using the current culture.
public static void StartsWith(Memory<char> expectedStartString, Memory<char> actualString)
Parameters
expectedStartStringMemory<char>The sub-string expected to be at the start of the string
actualStringMemory<char>The string to be inspected
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(Memory<char>, ReadOnlyMemory<char>)
Verifies that a string starts with a given sub-string, using the current culture.
public static void StartsWith(Memory<char> expectedStartString, ReadOnlyMemory<char> actualString)
Parameters
expectedStartStringMemory<char>The sub-string expected to be at the start of the string
actualStringReadOnlyMemory<char>The string to be inspected
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(ReadOnlyMemory<char>, Memory<char>)
Verifies that a string starts with a given sub-string, using the current culture.
public static void StartsWith(ReadOnlyMemory<char> expectedStartString, Memory<char> actualString)
Parameters
expectedStartStringReadOnlyMemory<char>The sub-string expected to be at the start of the string
actualStringMemory<char>The string to be inspected
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(ReadOnlyMemory<char>, ReadOnlyMemory<char>)
Verifies that a string starts with a given sub-string, using the default StringComparison.CurrentCulture comparison type.
public static void StartsWith(ReadOnlyMemory<char> expectedStartString, ReadOnlyMemory<char> actualString)
Parameters
expectedStartStringReadOnlyMemory<char>The sub-string expected to be at the start of the string
actualStringReadOnlyMemory<char>The string to be inspected
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(Memory<char>, Memory<char>, StringComparison)
Verifies that a string starts with a given sub-string, using the given comparison type.
public static void StartsWith(Memory<char> expectedStartString, Memory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)
Parameters
expectedStartStringMemory<char>The sub-string expected to be at the start of the string
actualStringMemory<char>The string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(Memory<char>, ReadOnlyMemory<char>, StringComparison)
Verifies that a string starts with a given sub-string, using the given comparison type.
public static void StartsWith(Memory<char> expectedStartString, ReadOnlyMemory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)
Parameters
expectedStartStringMemory<char>The sub-string expected to be at the start of the string
actualStringReadOnlyMemory<char>The string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(ReadOnlyMemory<char>, Memory<char>, StringComparison)
Verifies that a string starts with a given sub-string, using the given comparison type.
public static void StartsWith(ReadOnlyMemory<char> expectedStartString, Memory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)
Parameters
expectedStartStringReadOnlyMemory<char>The sub-string expected to be at the start of the string
actualStringMemory<char>The string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(ReadOnlyMemory<char>, ReadOnlyMemory<char>, StringComparison)
Verifies that a string starts with a given sub-string, using the given comparison type.
public static void StartsWith(ReadOnlyMemory<char> expectedStartString, ReadOnlyMemory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)
Parameters
expectedStartStringReadOnlyMemory<char>The sub-string expected to be at the start of the string
actualStringReadOnlyMemory<char>The string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(Span<char>, Span<char>)
Verifies that a string starts with a given sub-string, using the current culture.
public static void StartsWith(Span<char> expectedStartString, Span<char> actualString)
Parameters
expectedStartStringSpan<char>The sub-string expected to be at the start of the string
actualStringSpan<char>The string to be inspected
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(Span<char>, ReadOnlySpan<char>)
Verifies that a string starts with a given sub-string, using the current culture.
public static void StartsWith(Span<char> expectedStartString, ReadOnlySpan<char> actualString)
Parameters
expectedStartStringSpan<char>The sub-string expected to be at the start of the string
actualStringReadOnlySpan<char>The string to be inspected
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(ReadOnlySpan<char>, Span<char>)
Verifies that a string starts with a given sub-string, using the current culture.
public static void StartsWith(ReadOnlySpan<char> expectedStartString, Span<char> actualString)
Parameters
expectedStartStringReadOnlySpan<char>The sub-string expected to be at the start of the string
actualStringSpan<char>The string to be inspected
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(ReadOnlySpan<char>, ReadOnlySpan<char>)
Verifies that a string starts with a given sub-string, using the current culture.
public static void StartsWith(ReadOnlySpan<char> expectedStartString, ReadOnlySpan<char> actualString)
Parameters
expectedStartStringReadOnlySpan<char>The sub-string expected to be at the start of the string
actualStringReadOnlySpan<char>The string to be inspected
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(Span<char>, Span<char>, StringComparison)
Verifies that a string starts with a given sub-string, using the given comparison type.
public static void StartsWith(Span<char> expectedStartString, Span<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)
Parameters
expectedStartStringSpan<char>The sub-string expected to be at the start of the string
actualStringSpan<char>The string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(Span<char>, ReadOnlySpan<char>, StringComparison)
Verifies that a string starts with a given sub-string, using the given comparison type.
public static void StartsWith(Span<char> expectedStartString, ReadOnlySpan<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)
Parameters
expectedStartStringSpan<char>The sub-string expected to be at the start of the string
actualStringReadOnlySpan<char>The string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(ReadOnlySpan<char>, Span<char>, StringComparison)
Verifies that a string starts with a given sub-string, using the given comparison type.
public static void StartsWith(ReadOnlySpan<char> expectedStartString, Span<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)
Parameters
expectedStartStringReadOnlySpan<char>The sub-string expected to be at the start of the string
actualStringSpan<char>The string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not start with the expected sub-string
StartsWith(ReadOnlySpan<char>, ReadOnlySpan<char>, StringComparison)
Verifies that a string starts with a given sub-string, using the given comparison type.
public static void StartsWith(ReadOnlySpan<char> expectedStartString, ReadOnlySpan<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)
Parameters
expectedStartStringReadOnlySpan<char>The sub-string expected to be at the start of the string
actualStringReadOnlySpan<char>The string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not start with the expected sub-string