public void DescribeTo(IDescription desc) { if (desc != this)//prevent accidental self recursion { desc.Value(ToString()); } }
public static void PrintExpectButGot(IDescription desc, Object actual, IMatcher matcher) { if (desc.IsNull) { return; } desc.Value("matcherType", GetMatcherType(matcher)); desc.Child("expected", matcher); String s = actual as String; if (s != null) { int len = s.Length; if (len == 0) { desc.Child("but was (empty string,quoted)", "'" + actual + "'"); } else if (s.Trim().Length == 0) { desc.Child("but was (blank string,length " + len + ",quoted)", "'" + actual + "'"); } else { desc.Child("but was (string,length " + len + ",quoted)", "'" + actual + "'"); } } else { desc.Child("but was", actual); } }
public override void DescribeTo(IDescription description) { description.Value("Equals", m_expectVal); }
public void DescribeTo(IDescription desc) { desc.Value("property", PropertyName); desc.Child("matches", m_propertyValueMatcher); }