Class CompareTool.CompareResult
Class containing results of the comparison of two documents.
public class CompareTool.CompareResult
- Inheritance
-
CompareTool.CompareResult
- Inherited Members
Constructors
CompareResult(int)
Creates new empty instance of CompareResult with given limit of difference messages.
public CompareResult(int messageLimit)
Parameters
messageLimit
intmaximum number of difference messages to be handled by this CompareResult.
Fields
differences
protected IDictionary<ObjectPath, string> differences
Field Value
messageLimit
protected int messageLimit
Field Value
Methods
AddError(ObjectPath, string)
Adds an error message for the ObjectPath.
protected virtual void AddError(ObjectPath path, string message)
Parameters
path
ObjectPathObjectPath for the two corresponding objects in the compared documents
message
stringan error message
GetDifferences()
Returns map with ObjectPath as keys and difference descriptions as values.
public virtual IDictionary<ObjectPath, string> GetDifferences()
Returns
- IDictionary<ObjectPath, string>
differences map which could be used to find in the document the objects that are different.
GetErrorCount()
Returns number of differences between two documents detected during comparison.
public virtual int GetErrorCount()
Returns
- int
number of differences.
GetReport()
Converts this CompareResult into text form.
public virtual string GetReport()
Returns
- string
text report on the differences between two documents.
IsMessageLimitReached()
Checks whether maximum number of difference messages to be handled by this CompareResult is reached.
protected virtual bool IsMessageLimitReached()
Returns
- bool
true if limit of difference messages is reached, false otherwise.
IsOk()
Verifies if documents are considered equal after comparison.
public virtual bool IsOk()
Returns
- bool
true if documents are equal, false otherwise.
WriteReportToXml(Stream)
Converts this CompareResult into xml form.
public virtual void WriteReportToXml(Stream stream)
Parameters
stream
Streamoutput stream to which xml report will be written.