Table of Contents

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

expectedEndString string

The sub-string expected to be at the end of the string

actualString string

The 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

expectedEndString string

The sub-string expected to be at the end of the string

actualString string

The string to be inspected

comparisonType StringComparison

The 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

expectedEndString Memory<char>

The sub-string expected to be at the end of the string

actualString Memory<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

expectedEndString Memory<char>

The sub-string expected to be at the end of the string

actualString ReadOnlyMemory<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

expectedEndString ReadOnlyMemory<char>

The sub-string expected to be at the end of the string

actualString Memory<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

expectedEndString ReadOnlyMemory<char>

The sub-string expected to be at the end of the string

actualString ReadOnlyMemory<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

expectedEndString Memory<char>

The sub-string expected to be at the end of the string

actualString Memory<char>

The string to be inspected

comparisonType StringComparison

The 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

expectedEndString Memory<char>

The sub-string expected to be at the end of the string

actualString ReadOnlyMemory<char>

The string to be inspected

comparisonType StringComparison

The 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

expectedEndString ReadOnlyMemory<char>

The sub-string expected to be at the end of the string

actualString Memory<char>

The string to be inspected

comparisonType StringComparison

The 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

expectedEndString ReadOnlyMemory<char>

The sub-string expected to be at the end of the string

actualString ReadOnlyMemory<char>

The string to be inspected

comparisonType StringComparison

The 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

expectedEndString Span<char>

The sub-string expected to be at the end of the string

actualString Span<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

expectedEndString Span<char>

The sub-string expected to be at the end of the string

actualString ReadOnlySpan<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

expectedEndString ReadOnlySpan<char>

The sub-string expected to be at the end of the string

actualString Span<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

expectedEndString ReadOnlySpan<char>

The sub-string expected to be at the end of the string

actualString ReadOnlySpan<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

expectedEndString Span<char>

The sub-string expected to be at the end of the string

actualString Span<char>

The string to be inspected

comparisonType StringComparison

The 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

expectedEndString Span<char>

The sub-string expected to be at the end of the string

actualString ReadOnlySpan<char>

The string to be inspected

comparisonType StringComparison

The 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

expectedEndString ReadOnlySpan<char>

The sub-string expected to be at the end of the string

actualString Span<char>

The string to be inspected

comparisonType StringComparison

The 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

expectedEndString ReadOnlySpan<char>

The sub-string expected to be at the end of the string

actualString ReadOnlySpan<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Exceptions

Thrown when the string does not end with the expected sub-string