/// <inheritdoc/>
        public string GetDescription(Comparison difference)
        {
            ComparisonType type        = difference.Type;
            string         description = type.GetDescription();

            Comparison.Detail controlDetails = difference.ControlDetails;
            Comparison.Detail testDetails    = difference.TestDetails;
            string            controlTarget  = GetShortString(controlDetails.Target,
                                                              controlDetails.XPath, type);
            string testTarget = GetShortString(testDetails.Target,
                                               testDetails.XPath, type);

            if (type == ComparisonType.ATTR_NAME_LOOKUP)
            {
                return(string.Format("Expected {0} '{1}' - comparing {2} to {3}",
                                     description,
                                     controlDetails.XPath,
                                     controlTarget, testTarget));
            }
            return(string.Format("Expected {0} '{1}' but was '{2}' - comparing {3} to {4}",
                                 description,
                                 GetValue(controlDetails.Value, type),
                                 GetValue(testDetails.Value, type),
                                 controlTarget, testTarget));
        }
 /// <inheritdoc/>
 public string GetDetails(Comparison.Detail difference, ComparisonType type,
                          bool formatXml)
 {
     if (difference.Target == null)
     {
         return("<NULL>");
     }
     return(GetFullFormattedXml(difference.Target, type, formatXml));
 }
Beispiel #3
0
 private string GetDetails(Comparison.Detail difference, ComparisonType type)
 {
     return(compFormatter.GetDetails(difference, type, true));
 }