Show / Hide Table of Contents

Class CollectionException

Exception thrown when Assert.Collection fails.

Inheritance
Object
XunitException
CollectionException
Inherited Members
XunitException.UserMessage
XunitException.ToString()
Namespace: Xunit.Sdk
Assembly: xunit.assert.dll
Syntax
public class CollectionException : XunitException

Constructors

| Improve this Doc View Source

CollectionException(Object, Int32, Int32, Int32, Exception)

Creates a new instance of the CollectionException class.

Declaration
public CollectionException(object collection, int expectedCount, int actualCount, int indexFailurePoint = null, Exception innerException = null)
Parameters
Type Name Description
Object collection

The collection that failed the test.

Int32 expectedCount

The expected number of items in the collection.

Int32 actualCount

The actual number of items in the collection.

Int32 indexFailurePoint

The index of the position where the first comparison failure occurred.

Exception innerException

The exception that was thrown during the comparison failure.

Properties

| Improve this Doc View Source

ActualCount

The actual number of items in the collection.

Declaration
public int ActualCount { get; set; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Collection

The collection that failed the test.

Declaration
public object Collection { get; set; }
Property Value
Type Description
Object
| Improve this Doc View Source

ExpectedCount

The expected number of items in the collection.

Declaration
public int ExpectedCount { get; set; }
Property Value
Type Description
Int32
| Improve this Doc View Source

IndexFailurePoint

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).

Declaration
public int IndexFailurePoint { get; set; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Message

Declaration
public override string Message { get; }
Property Value
Type Description
String
| Improve this Doc View Source

StackTrace

Declaration
public override string StackTrace { get; }
Property Value
Type Description
String
Overrides
XunitException.StackTrace
  • Improve this Doc
  • View Source
Back to top Generated by DocFX