Ejemplo n.º 1
0
 public void TestIsIdenticalTo_withIgnoreCommentsVersion_shouldSucceed(string xsltVersion)
 {
     Assert.That("<a><!-- Test --></a>",
                 CompareConstraint.IsIdenticalTo("<a></a>").IgnoreCommentsUsingXSLTVersion(xsltVersion));
 }
Ejemplo n.º 2
0
 public void IsIdenticalTo_WithIgnoreWhitespaces_ShouldSucceed()
 {
     Assert.That("<a>\n  <b/>\n</a>",
                 CompareConstraint.IsIdenticalTo("<a><b/></a>").IgnoreWhitespace());
 }
Ejemplo n.º 3
0
 public void TestIsIdenticalTo_withIgnoreComments_shouldSucceed()
 {
     Assert.That("<a><!-- Test --></a>",
                 CompareConstraint.IsIdenticalTo("<a></a>").IgnoreComments());
 }
Ejemplo n.º 4
0
 public void CantSetComparisonController()
 {
     Assert.That(() => CompareConstraint.IsSimilarTo("<foo/>")
                 .WithComparisonController(null),
                 Throws.TypeOf <NotImplementedException>());
 }
Ejemplo n.º 5
0
 public void TestIsSimilarTo_WithErrorForElementOrder_FailsWithExpectedMessage()
 {
     Assert.That("<a><c/><b/></a>", CompareConstraint.IsSimilarTo("<a><b/><c/></a>")
                 .WithNodeMatcher(new DefaultNodeMatcher(ElementSelectors.ByNameAndText)));
 }
Ejemplo n.º 6
0
 public void TestIsSimilarTo_withSwappedElements_shouldSucceed()
 {
     Assert.That("<a><c/><b/></a>", CompareConstraint.IsSimilarTo("<a><b/><c/></a>")
                 .WithNodeMatcher(new DefaultNodeMatcher(ElementSelectors.ByNameAndText)));
 }
Ejemplo n.º 7
0
 public void TestIsIdenticalTo_withNormalizeWhitespace_shouldSucceed()
 {
     Assert.That("<a>\n  <b>\n  Test\n  Node\n  </b>\n</a>",
                 CompareConstraint.IsIdenticalTo("<a><b>Test Node</b></a>")
                 .NormalizeWhitespace());
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Creates the result.
 /// </summary>
 public CompareConstraintResult(CompareConstraint constraint, object actualValue, Diff.Diff diffResult)
     : base(constraint, actualValue, !diffResult.HasDifferences())
 {
     this.constraint = constraint;
     this.diffResult = diffResult;
 }
Ejemplo n.º 9
0
 public static TestCompareConstraintWrapper IsSimilarTo(object control)
 {
     return(new TestCompareConstraintWrapper(CompareConstraint.IsSimilarTo(control)));
 }
Ejemplo n.º 10
0
 internal TestCompareConstraintWrapper(CompareConstraint compareMatcher)
 {
     this.compareMatcher = compareMatcher;
 }