xmlunit-nunit3-constraints : Org.XmlUnit.Constraints Namespace

CompareConstraint Class

Constraint that compares two XML sources with each other.

Syntax

public class CompareConstraint : NUnit.Framework.Constraints.Constraint, Org.XmlUnit.Builder.IDifferenceEngineConfigurer<CompareConstraint>

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

Members

See Also: Inherited members from NUnit.Framework.Constraints.Constraint.

Public Methods

override
ApplyTo<TActual> (TActual) : NUnit.Framework.Constraints.ConstraintResult
Documentation for this section has not yet been entered.
IgnoreComments () : CompareConstraint
Ignore comments.
IgnoreCommentsUsingXSLTVersion (string) : CompareConstraint
Ignore comments.
IgnoreElementContentWhitespace () : CompareConstraint
Ignore element content whitespace differences.
IgnoreWhitespace () : CompareConstraint
Ignore whitespace differences.
static
IsIdenticalTo (object) : CompareConstraint
Create a CompareConstraint which compares the test-Object with the given control Object for identity.
static
IsSimilarTo (object) : CompareConstraint
Create a CompareConstraint which compares the test-Object with the given control Object for similarity.
NormalizeWhitespace () : CompareConstraint
Normalize whitespace before comparing.
WithAttributeFilter (Predicate<System.Xml.XmlAttribute>) : CompareConstraint
Registers a filter for attributes.
WithComparisonController (Org.XmlUnit.Diff.ComparisonController) : CompareConstraint
Throws an exception as you the ComparisonController is completely determined by the factory method used.
WithComparisonFormatter (Org.XmlUnit.Diff.IComparisonFormatter) : CompareConstraint
Use a custom Formatter for the Error Messages. The defaultFormatter is DefaultComparisonFormatter.
WithComparisonListeners (params Org.XmlUnit.Diff.ComparisonListener[]) : CompareConstraint
Use the given Org.XmlUnit.Diff.ComparisonListeners when comparing.
WithDifferenceEvaluator (Org.XmlUnit.Diff.DifferenceEvaluator) : CompareConstraint
Use the given Org.XmlUnit.Diff.DifferenceEvaluator when comparing.
WithDifferenceListeners (params Org.XmlUnit.Diff.ComparisonListener[]) : CompareConstraint
Use the given Org.XmlUnit.Diff.ComparisonListeners as difference listeners when comparing.
WithNamespaceContext (IDictionary<string, string>) : CompareConstraint
Establish a namespace context mapping from prefix to URI that will be used in Comparison.Detail.XPath.
WithNodeFilter (Predicate<System.Xml.XmlNode>) : CompareConstraint
Registers a filter for nodes.
WithNodeMatcher (Org.XmlUnit.Diff.INodeMatcher) : CompareConstraint
Use the given Org.XmlUnit.Diff.INodeMatcher when comparing.

Extension Methods

static
Singleton<T> (this T) : IEnumerable<T>
An enumerable containing a single element.
static
WithPlaceholderSupport<D> (this D) : D
Adds placeholder support to an IDifferenceEngineConfigurer.
static
WithPlaceholderSupportChainedAfter<D> (this D, Org.XmlUnit.Diff.DifferenceEvaluator) : D
Adds placeholder support to an IDifferenceEngineConfigurer considering an additional DifferenceEvaluator.
static
WithPlaceholderSupportUsingDelimiters<D> (this D, string, string) : D
Adds placeholder support to an IDifferenceEngineConfigurer.
static
WithPlaceholderSupportUsingDelimiters<D> (this D, string, string, string, string, string) : D
Adds placeholder support to an IDifferenceEngineConfigurer.
static
WithPlaceholderSupportUsingDelimitersChainedAfter<D> (this D, string, string, Org.XmlUnit.Diff.DifferenceEvaluator) : D
Adds placeholder support to an IDifferenceEngineConfigurer considering an additional DifferenceEvaluator.
static
WithPlaceholderSupportUsingDelimitersChainedAfter<D> (this D, string, string, string, string, string, Org.XmlUnit.Diff.DifferenceEvaluator) : D
Adds placeholder support to an IDifferenceEngineConfigurer considering an additional DifferenceEvaluator.

Member Details

ApplyTo<TActual> Generic Method

Documentation for this section has not yet been entered.

Syntax

public override NUnit.Framework.Constraints.ConstraintResult ApplyTo<TActual> (TActual actual)

Type Parameters

TActual
Documentation for this section has not yet been entered.

Parameters

actual
Documentation for this section has not yet been entered.

Returns

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

IgnoreComments Method

Ignore comments.

Syntax

public CompareConstraint IgnoreComments ()

Returns

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

IgnoreCommentsUsingXSLTVersion Method

Ignore comments.

Syntax

public CompareConstraint IgnoreCommentsUsingXSLTVersion (string xsltVersion)

Parameters

xsltVersion
use this version for the stylesheet

Returns

Documentation for this section has not yet been entered.

Remarks

since XMLUnit 2.5.0

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

IgnoreElementContentWhitespace Method

Ignore element content whitespace differences.

Syntax

public CompareConstraint IgnoreElementContentWhitespace ()

Returns

Documentation for this section has not yet been entered.

Remarks

since XMLUnit 2.6.0

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

IgnoreWhitespace Method

Ignore whitespace differences.

Syntax

public CompareConstraint IgnoreWhitespace ()

Returns

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

IsIdenticalTo Method

Create a CompareConstraint which compares the test-Object with the given control Object for identity.

Syntax

public static CompareConstraint IsIdenticalTo (object control)

Parameters

control
Documentation for this section has not yet been entered.

Returns

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

IsSimilarTo Method

Create a CompareConstraint which compares the test-Object with the given control Object for similarity.

Syntax

public static CompareConstraint IsSimilarTo (object control)

Parameters

control
Documentation for this section has not yet been entered.

Returns

Documentation for this section has not yet been entered.

Remarks

Example for Similar: The XML node "<a>Text</a>" and "<a><![CDATA[Text]]></a>" are similar and the Test will not fail.

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

NormalizeWhitespace Method

Normalize whitespace before comparing.

Syntax

public CompareConstraint NormalizeWhitespace ()

Returns

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

WithAttributeFilter Method

Registers a filter for attributes.

Syntax

public CompareConstraint WithAttributeFilter (Predicate<System.Xml.XmlAttribute> attributeFilter)

Parameters

attributeFilter
Documentation for this section has not yet been entered.

Returns

Documentation for this section has not yet been entered.

Remarks

Only attributes for which the predicate returns true are part of the comparison. By default all attributes are considered.

The "special" namespace, namespace-location and schema-instance-type attributes can not be ignored this way. If you want to suppress comparison of them you'll need to implement Org.XmlUnit.Diff.DifferenceEvaluator

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

WithComparisonController Method

Throws an exception as you the ComparisonController is completely determined by the factory method used.

Syntax

public CompareConstraint WithComparisonController (Org.XmlUnit.Diff.ComparisonController cc)

Parameters

cc
Documentation for this section has not yet been entered.

Returns

Documentation for this section has not yet been entered.

Remarks

since XMLUnit 2.5.1

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

WithComparisonFormatter Method

Use a custom Formatter for the Error Messages. The defaultFormatter is DefaultComparisonFormatter.

Syntax

public CompareConstraint WithComparisonFormatter (Org.XmlUnit.Diff.IComparisonFormatter comparisonFormatter)

Parameters

comparisonFormatter
Documentation for this section has not yet been entered.

Returns

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

WithComparisonListeners Method

Use the given Org.XmlUnit.Diff.ComparisonListeners when comparing.

Syntax

public CompareConstraint WithComparisonListeners (params Org.XmlUnit.Diff.ComparisonListener[] comparisonListeners)

Parameters

comparisonListeners
ComparisonListeners to use

Returns

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

WithDifferenceEvaluator Method

Use the given Org.XmlUnit.Diff.DifferenceEvaluator when comparing.

Syntax

public CompareConstraint WithDifferenceEvaluator (Org.XmlUnit.Diff.DifferenceEvaluator differenceEvaluator)

Parameters

differenceEvaluator
DifferenceEvaluator to use

Returns

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

WithDifferenceListeners Method

Use the given Org.XmlUnit.Diff.ComparisonListeners as difference listeners when comparing.

Syntax

public CompareConstraint WithDifferenceListeners (params Org.XmlUnit.Diff.ComparisonListener[] comparisonListeners)

Parameters

comparisonListeners
ComparisonListeners to use

Returns

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

WithNamespaceContext Method

Establish a namespace context mapping from prefix to URI that will be used in Comparison.Detail.XPath.

Syntax

public CompareConstraint WithNamespaceContext (IDictionary<string, string> ctx)

Parameters

ctx
Documentation for this section has not yet been entered.

Returns

Documentation for this section has not yet been entered.

Remarks

Without a namespace context (or with an empty context) the XPath expressions will only use local names for elements and attributes.

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

WithNodeFilter Method

Registers a filter for nodes.

Syntax

public CompareConstraint WithNodeFilter (Predicate<System.Xml.XmlNode> nodeFilter)

Parameters

nodeFilter
Documentation for this section has not yet been entered.

Returns

Documentation for this section has not yet been entered.

Remarks

Only nodes for which the predicate returns true are part of the comparison. By default nodes that are neither document types nor XML declarations are considered.

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240

WithNodeMatcher Method

Use the given Org.XmlUnit.Diff.INodeMatcher when comparing.

Syntax

public CompareConstraint WithNodeMatcher (Org.XmlUnit.Diff.INodeMatcher nodeMatcher)

Parameters

nodeMatcher
INodeMatcher to use

Returns

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Org.XmlUnit.Constraints
Assembly: xmlunit-nunit3-constraints (in xmlunit-nunit3-constraints.dll)
Assembly Versions: 2.9.2.240