-
Notifications
You must be signed in to change notification settings - Fork 9
DiagnosingMatcher
grahamrhay edited this page Nov 11, 2010
·
1 revision
#DiagnosingMatcher
A diagnosing matcher allows a better description of any mismatch:
public class NullOrEmptyString : DiagnosingMatcher<string>
{
protected override bool Matches(string item, IDescription mismatchDescription)
{
if (string.IsNullOrEmpty(item) == false)
{
mismatchDescription.AppendText(item);
return false;
}
return true;
}
public override void DescribeTo(IDescription description)
{
description.AppendText("a null or empty string");
}
}