Table of Contents

Class ContainsException

Namespace
Xunit.Sdk
Assembly
xunit.v3.assert.dll

Exception thrown when Assert.Contains fails.

public class ContainsException : XunitException, ISerializable, IAssertionException
Inheritance
ContainsException
Implements
Inherited Members

Methods

ForCollectionFilterNotMatched(string)

Creates a new instance of the ContainsException class to be thrown when the requested filter did not match any items in the collection.

public static ContainsException ForCollectionFilterNotMatched(string collection)

Parameters

collection string

The collection

Returns

ContainsException

ForCollectionItemNotFound(string, string)

Creates a new instance of the ContainsException class to be thrown when the requested item was not available in the collection.

public static ContainsException ForCollectionItemNotFound(string item, string collection)

Parameters

item string

The expected item value

collection string

The collection

Returns

ContainsException

ForKeyNotFound(string, string)

Creates a new instance of the ContainsException class to be thrown when the requested key was not available in the dictionary.

public static ContainsException ForKeyNotFound(string expectedKey, string keys)

Parameters

expectedKey string

The expected key value

keys string

The dictionary keys

Returns

ContainsException

ForSetItemNotFound(string, string)

Creates a new instance of the ContainsException class to be thrown when the requested item was not found in the set.

public static ContainsException ForSetItemNotFound(string item, string set)

Parameters

item string

The expected item

set string

The set

Returns

ContainsException

ForSubMemoryNotFound(string, string)

Creates a new instance of the ContainsException class to be thrown when the requested sub-memory was not found in the memory.

public static ContainsException ForSubMemoryNotFound(string expectedSubMemory, string memory)

Parameters

expectedSubMemory string

The expected sub-memory

memory string

The memory

Returns

ContainsException

ForSubSpanNotFound(string, string)

Creates a new instance of the ContainsException class to be thrown when the requested sub-span was not found in the span.

public static ContainsException ForSubSpanNotFound(string expectedSubSpan, string span)

Parameters

expectedSubSpan string

The expected sub-span

span string

The span

Returns

ContainsException

ForSubStringNotFound(string, string?)

Creates a new instance of the ContainsException class to be thrown when the requested sub-string was not found in the string.

public static ContainsException ForSubStringNotFound(string expectedSubString, string? @string)

Parameters

expectedSubString string

The expected sub-string

string string

The string

Returns

ContainsException