public override void DescribeTo(IDescription description) { var matcherArray = _matcherCollection.ToArray(); if (matcherArray.Length == 0) { description.AppendText("an empty list"); return; } description.AppendText("a list containing:"); using (description.IndentBy(4)) { description.AppendNewLine(); var first = true; foreach (var matcher in matcherArray) { if (!first) { description.AppendText(",").AppendNewLine(); } description.AppendDescriptionOf(matcher); first = false; } } }
protected override bool Matches(T item, IDescription mismatchDescription) { foreach (var matcher in matchers) { if (matcher.Matches(item)) { continue; } mismatchDescription.AppendDescriptionOf(matcher).AppendText(" "); matcher.DescribeMismatch(item, mismatchDescription); return(false); } return(true); }
public override void DescribeTo(IDescription description) { description.AppendDescriptionOf(matcher); }