Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 4
0
 public void DescribeTo(IDescription desc)
 {
     desc.Value("property", PropertyName);
     desc.Child("matches", m_propertyValueMatcher);
 }
Ejemplo n.º 5
0
 public override void DescribeTo(IDescription description)
 {
     description.Child("Not", m_matcher);
 }