File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/tests/net-core/Builder Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -486,6 +486,24 @@ public void TestDiff_withIgnoreElementContentWhitespaces_shouldSucceed() {
486486 Assert . IsFalse ( myDiff . HasDifferences ( ) , "XML similar " + myDiff . ToString ( ) ) ;
487487 }
488488
489+ [ Test ]
490+ public void CanIgnoreSequenceOfChildNodes ( ) {
491+ var xml1 = "<A><B>1</B><C>2</C></A>" ;
492+ var xml2 = "<A><C>2</C><B>1</B></A>" ;
493+
494+ var source1 = Input . FromString ( xml1 ) . Build ( ) ;
495+ var source2 = Input . FromString ( xml2 ) . Build ( ) ;
496+
497+ var diff = DiffBuilder
498+ . Compare ( source1 )
499+ . WithTest ( source2 )
500+ . WithDifferenceEvaluator ( DifferenceEvaluators . DowngradeDifferencesToEqual ( ComparisonType . CHILD_NODELIST_SEQUENCE ) )
501+ . WithNodeMatcher ( new DefaultNodeMatcher ( ElementSelectors . ByName ) )
502+ . CheckForSimilar ( )
503+ . Build ( ) ;
504+ Assert . IsFalse ( diff . HasDifferences ( ) , "XML equal " + diff ) ;
505+ }
506+
489507 internal class DummyComparisonFormatter : IComparisonFormatter {
490508 public string GetDescription ( Comparison difference ) {
491509 return "foo" ;
You can’t perform that action at this time.
0 commit comments