Table of Contents

Class CollectionException

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

Exception thrown when Assert.Collection fails.

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

Methods

ForMismatchedItem(Exception, int, int?, string)

Creates an instance of the CollectionException class to be thrown when an item comparison failed

public static CollectionException ForMismatchedItem(Exception exception, int indexFailurePoint, int? failurePointerIndent, string formattedCollection)

Parameters

exception Exception

The exception that was thrown

indexFailurePoint int

The item index for the failed item

failurePointerIndent int?

The number of spaces needed to indent the failure pointer

formattedCollection string

The formatted collection

Returns

CollectionException

ForMismatchedItemCount(int, int, string)

Creates an instance of the CollectionException class to be thrown when the item count in a collection does not match the expected count.

public static CollectionException ForMismatchedItemCount(int expectedCount, int actualCount, string formattedCollection)

Parameters

expectedCount int

The expected item count

actualCount int

The actual item count

formattedCollection string

The formatted collection

Returns

CollectionException