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 void DescribeTo(IDescription desc) { desc.Text("not null"); desc.Child("type", m_expectType.FullName); if (m_matcher != null) { desc.Child("matching", m_matcher); } }
public override void DescribeTo(IDescription description) { description.Child("matches", m_childMatcher); }
public void DescribeTo(IDescription desc) { desc.Value("property", PropertyName); desc.Child("matches", m_propertyValueMatcher); }
public override void DescribeTo(IDescription description) { description.Child("Not", m_matcher); }