Class CollectionException
Exception thrown when Assert.Collection fails.
Namespace: Xunit.Sdk
Assembly: xunit.assert.dll
Syntax
public class CollectionException : XunitException
Constructors
| Improve this Doc View SourceCollectionException(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 SourceActualCount
The actual number of items in the collection.
Declaration
public int ActualCount { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Collection
The collection that failed the test.
Declaration
public object Collection { get; set; }
Property Value
Type | Description |
---|---|
Object |
ExpectedCount
The expected number of items in the collection.
Declaration
public int ExpectedCount { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
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 |
Message
Declaration
public override string Message { get; }
Property Value
Type | Description |
---|---|
String |
StackTrace
Declaration
public override string StackTrace { get; }
Property Value
Type | Description |
---|---|
String |