xUnit.net
Public Member Functions | Properties | List of all members
Xunit.Sdk.CollectionException Class Reference

Exception thrown when Assert.Collection fails. More...

Inheritance diagram for Xunit.Sdk.CollectionException:
Xunit.Sdk.XunitException

Public Member Functions

 CollectionException (object collection, int expectedCount, int actualCount, int indexFailurePoint=-1, Exception innerException=null)
 Creates a new instance of the CollectionException class. More...
 
- Public Member Functions inherited from Xunit.Sdk.XunitException
 XunitException ()
 Initializes a new instance of the XunitException class. More...
 
 XunitException (string userMessage)
 Initializes a new instance of the XunitException class. More...
 
override string ToString ()
 

Properties

object Collection [get, set]
 The collection that failed the test. More...
 
int ActualCount [get, set]
 The actual number of items in the collection. More...
 
int ExpectedCount [get, set]
 The expected number of items in the collection. More...
 
int IndexFailurePoint [get, set]
 The index of the position where the first comparison failure occurred, or -1 if comparisions did not occur (because the actual and expected counts differed). More...
 
override string Message [get]
 
override string StackTrace [get]
 
- Properties inherited from Xunit.Sdk.XunitException
override string?? StackTrace [get]
 Gets a string representation of the frames on the call stack at the time the current exception was thrown. More...
 
string UserMessage [get, protected set]
 Gets the user message More...
 

Additional Inherited Members

- Protected Member Functions inherited from Xunit.Sdk.XunitException
 XunitException (string userMessage, Exception innerException)
 Initializes a new instance of the XunitException class. More...
 
 XunitException (string userMessage, string stackTrace)
 Initializes a new instance of the XunitException class. More...
 

Detailed Description

Exception thrown when Assert.Collection fails.

Constructor & Destructor Documentation

◆ CollectionException()

Xunit.Sdk.CollectionException.CollectionException ( object  collection,
int  expectedCount,
int  actualCount,
int  indexFailurePoint = -1,
Exception  innerException = null 
)
inline

Creates a new instance of the CollectionException class.

Parameters
collectionThe collection that failed the test.
expectedCountThe expected number of items in the collection.
actualCountThe actual number of items in the collection.
indexFailurePointThe index of the position where the first comparison failure occurred.
innerExceptionThe exception that was thrown during the comparison failure.

Property Documentation

◆ ActualCount

int Xunit.Sdk.CollectionException.ActualCount
getset

The actual number of items in the collection.

◆ Collection

object Xunit.Sdk.CollectionException.Collection
getset

The collection that failed the test.

◆ ExpectedCount

int Xunit.Sdk.CollectionException.ExpectedCount
getset

The expected number of items in the collection.

◆ IndexFailurePoint

int Xunit.Sdk.CollectionException.IndexFailurePoint
getset

The index of the position where the first comparison failure occurred, or -1 if comparisions did not occur (because the actual and expected counts differed).


The documentation for this class was generated from the following file: