<PackageReference Include="NUnit" Version="4.3.1" />

EachItemConstraintResult

Provides a ConstraintResult for the constraints that are applied to each item in the collection
using System.Runtime.CompilerServices; namespace NUnit.Framework.Constraints { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(0)] internal sealed class EachItemConstraintResult : ConstraintResult { private readonly object _nonMatchingItem; private readonly int _nonMatchingItemIndex; public EachItemConstraintResult(IConstraint constraint, [System.Runtime.CompilerServices.Nullable(2)] object actualValue, object nonMatchingItem, int nonMatchingIndex) : base(constraint, actualValue, false) { _nonMatchingItem = nonMatchingItem; _nonMatchingItemIndex = nonMatchingIndex; } public override void WriteAdditionalLinesTo(MessageWriter writer) { DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(40, 1); defaultInterpolatedStringHandler.AppendLiteral(" First non-matching item at index ["); defaultInterpolatedStringHandler.AppendFormatted(_nonMatchingItemIndex); defaultInterpolatedStringHandler.AppendLiteral("]: "); string value = defaultInterpolatedStringHandler.ToStringAndClear() + MsgUtils.FormatValue(_nonMatchingItem); writer.WriteLine(value); } } }