EachItemConstraintResult
Provides a ConstraintResult for the constraints
that are applied to each item in the collection
namespace NUnit.Framework.Constraints
{
internal sealed class EachItemConstraintResult : ConstraintResult
{
private readonly object _nonMatchingItem;
private readonly int _nonMatchingItemIndex;
public EachItemConstraintResult(IConstraint constraint, object actualValue, object nonMatchingItem, int nonMatchingIndex)
: base(constraint, actualValue, false)
{
_nonMatchingItem = nonMatchingItem;
_nonMatchingItemIndex = nonMatchingIndex;
}
public override void WriteAdditionalLinesTo(MessageWriter writer)
{
string value = $"""{_nonMatchingItemIndex}""" + MsgUtils.FormatValue(_nonMatchingItem);
writer.WriteLine(value);
}
}
}