Method EndsWith
- Namespace
- Xunit
- Assembly
- xunit.v3.assert.dll
EndsWith(string?, string?)
Verifies that a string ends with a given sub-string, using the current culture.
public static void EndsWith(string? expectedEndString, string? actualString)
Parameters
expectedEndStringstringThe sub-string expected to be at the end of the string
actualStringstringThe string to be inspected
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(string?, string?, StringComparison)
Verifies that a string ends with a given sub-string, using the given comparison type.
public static void EndsWith(string? expectedEndString, string? actualString, StringComparison comparisonType)
Parameters
expectedEndStringstringThe sub-string expected to be at the end of the string
actualStringstringThe string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(Memory<char>, Memory<char>)
Verifies that a string ends with a given sub-string, using the current culture.
public static void EndsWith(Memory<char> expectedEndString, Memory<char> actualString)
Parameters
expectedEndStringMemory<char>The sub-string expected to be at the end of the string
actualStringMemory<char>The string to be inspected
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(Memory<char>, ReadOnlyMemory<char>)
Verifies that a string ends with a given sub-string, using the current culture.
public static void EndsWith(Memory<char> expectedEndString, ReadOnlyMemory<char> actualString)
Parameters
expectedEndStringMemory<char>The sub-string expected to be at the end of the string
actualStringReadOnlyMemory<char>The string to be inspected
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(ReadOnlyMemory<char>, Memory<char>)
Verifies that a string ends with a given sub-string, using the current culture.
public static void EndsWith(ReadOnlyMemory<char> expectedEndString, Memory<char> actualString)
Parameters
expectedEndStringReadOnlyMemory<char>The sub-string expected to be at the end of the string
actualStringMemory<char>The string to be inspected
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(ReadOnlyMemory<char>, ReadOnlyMemory<char>)
Verifies that a string ends with a given sub-string, using the current culture.
public static void EndsWith(ReadOnlyMemory<char> expectedEndString, ReadOnlyMemory<char> actualString)
Parameters
expectedEndStringReadOnlyMemory<char>The sub-string expected to be at the end of the string
actualStringReadOnlyMemory<char>The string to be inspected
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(Memory<char>, Memory<char>, StringComparison)
Verifies that a string ends with a given sub-string, using the given comparison type.
public static void EndsWith(Memory<char> expectedEndString, Memory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)
Parameters
expectedEndStringMemory<char>The sub-string expected to be at the end of the string
actualStringMemory<char>The string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(Memory<char>, ReadOnlyMemory<char>, StringComparison)
Verifies that a string ends with a given sub-string, using the given comparison type.
public static void EndsWith(Memory<char> expectedEndString, ReadOnlyMemory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)
Parameters
expectedEndStringMemory<char>The sub-string expected to be at the end of the string
actualStringReadOnlyMemory<char>The string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(ReadOnlyMemory<char>, Memory<char>, StringComparison)
Verifies that a string ends with a given sub-string, using the given comparison type.
public static void EndsWith(ReadOnlyMemory<char> expectedEndString, Memory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)
Parameters
expectedEndStringReadOnlyMemory<char>The sub-string expected to be at the end of the string
actualStringMemory<char>The string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(ReadOnlyMemory<char>, ReadOnlyMemory<char>, StringComparison)
Verifies that a string ends with a given sub-string, using the given comparison type.
public static void EndsWith(ReadOnlyMemory<char> expectedEndString, ReadOnlyMemory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)
Parameters
expectedEndStringReadOnlyMemory<char>The sub-string expected to be at the end of the string
actualStringReadOnlyMemory<char>The string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(Span<char>, Span<char>)
Verifies that a string ends with a given sub-string, using the current culture.
public static void EndsWith(Span<char> expectedEndString, Span<char> actualString)
Parameters
expectedEndStringSpan<char>The sub-string expected to be at the end of the string
actualStringSpan<char>The string to be inspected
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(Span<char>, ReadOnlySpan<char>)
Verifies that a string ends with a given sub-string, using the current culture.
public static void EndsWith(Span<char> expectedEndString, ReadOnlySpan<char> actualString)
Parameters
expectedEndStringSpan<char>The sub-string expected to be at the end of the string
actualStringReadOnlySpan<char>The string to be inspected
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(ReadOnlySpan<char>, Span<char>)
Verifies that a string ends with a given sub-string, using the current culture.
public static void EndsWith(ReadOnlySpan<char> expectedEndString, Span<char> actualString)
Parameters
expectedEndStringReadOnlySpan<char>The sub-string expected to be at the end of the string
actualStringSpan<char>The string to be inspected
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(ReadOnlySpan<char>, ReadOnlySpan<char>)
Verifies that a string ends with a given sub-string, using the current culture.
public static void EndsWith(ReadOnlySpan<char> expectedEndString, ReadOnlySpan<char> actualString)
Parameters
expectedEndStringReadOnlySpan<char>The sub-string expected to be at the end of the string
actualStringReadOnlySpan<char>The string to be inspected
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(Span<char>, Span<char>, StringComparison)
Verifies that a string ends with a given sub-string, using the given comparison type.
public static void EndsWith(Span<char> expectedEndString, Span<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)
Parameters
expectedEndStringSpan<char>The sub-string expected to be at the end of the string
actualStringSpan<char>The string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(Span<char>, ReadOnlySpan<char>, StringComparison)
Verifies that a string ends with a given sub-string, using the given comparison type.
public static void EndsWith(Span<char> expectedEndString, ReadOnlySpan<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)
Parameters
expectedEndStringSpan<char>The sub-string expected to be at the end of the string
actualStringReadOnlySpan<char>The string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(ReadOnlySpan<char>, Span<char>, StringComparison)
Verifies that a string ends with a given sub-string, using the given comparison type.
public static void EndsWith(ReadOnlySpan<char> expectedEndString, Span<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)
Parameters
expectedEndStringReadOnlySpan<char>The sub-string expected to be at the end of the string
actualStringSpan<char>The string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not end with the expected sub-string
EndsWith(ReadOnlySpan<char>, ReadOnlySpan<char>, StringComparison)
Verifies that a string ends with a given sub-string, using the given comparison type.
public static void EndsWith(ReadOnlySpan<char> expectedEndString, ReadOnlySpan<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)
Parameters
expectedEndStringReadOnlySpan<char>The sub-string expected to be at the end of the string
actualStringReadOnlySpan<char>The string to be inspected
comparisonTypeStringComparisonThe type of string comparison to perform
Exceptions
Thrown when the string does not end with the expected sub-string