Joutsen v0.5.0+12-g5dd5f7e
Classes | Public Member Functions | List of all members
Joutsen.NUnit3.SequencesEquivalentConstraint< TElement > Class Template Reference

A nunit constraint that checks if two sequences contain the same items inany order. More...

Classes

class  SequencesEquivalentConstraintResult
 A class representing the result of a SequencesEquivalentConstraint. More...
 

Public Member Functions

 SequencesEquivalentConstraint (IEnumerable< TElement > expected, IEqualityComparer< TElement > comparer)
 Creates a new instance of the constraint. More...
 
 SequencesEquivalentConstraint (IEnumerable< TElement > expected, global::System.Collections.IEqualityComparer comparer)
 Creates a new instance of the constraint. More...
 
override ConstraintResult ApplyTo< TActual > (TActual actual)
 Applies the constraint to the actual value. More...
 

Detailed Description

A nunit constraint that checks if two sequences contain the same items inany order.

Template Parameters
TElementthe type of the items of the sequences
Remarks
In order to be equivalent two sequneces need to contain equal items at the any index. In other words the one sequence needs contain items that equal any other item in the second sequence, regardless of the index they can be found at.
Since
0.2.1

Constructor & Destructor Documentation

◆ SequencesEquivalentConstraint() [1/2]

Joutsen.NUnit3.SequencesEquivalentConstraint< TElement >.SequencesEquivalentConstraint ( IEnumerable< TElement >  expected,
IEqualityComparer< TElement >  comparer 
)

Creates a new instance of the constraint.

Parameters
expectedthe expected sequence that will be used when the constraint is evaluated
comparerthe comparer instance to use when comparing the items of the sequences

◆ SequencesEquivalentConstraint() [2/2]

Joutsen.NUnit3.SequencesEquivalentConstraint< TElement >.SequencesEquivalentConstraint ( IEnumerable< TElement >  expected,
global::System.Collections.IEqualityComparer  comparer 
)

Creates a new instance of the constraint.

Parameters
expectedthe expected sequence that will be used when the constraint is evaluated
comparerthe comparer instance to use when comparing the items of the sequences

Member Function Documentation

◆ ApplyTo< TActual >()

override ConstraintResult Joutsen.NUnit3.SequencesEquivalentConstraint< TElement >.ApplyTo< TActual > ( TActual  actual)

Applies the constraint to the actual value.

Template Parameters
TActualthe type of the actual value
Parameters
actualthe value to test the constraint against
Returns
the result of the constraint evaluation