public void Diff_equal_with_different_index() { var actual = new NodeComment(123, 456, "Text"); var expected = new NodeComment(456, 456, "Text"); var diff = actual.Diff(expected, XmlPathRoot.Strict.Empty, XmlPathRoot.Strict.Empty, XmlOptions.Strict.Value); Assert.IsTrue(diff.IsEmpty); }
public void Constructs_ok([Column(0, 123)] int index) { var comment = new NodeComment(index, 456, " Jack Burton "); Assert.AreEqual(index, comment.Index); Assert.IsEmpty(comment.Children); Assert.AreEqual(" Jack Burton ", comment.Text); }
public void Diff_with_null_pathExpected_should_throw_exception() { var actual = new NodeComment(123, 456, "Text"); var expected = new NodeComment(123, 456, "Text"); actual.Diff(expected, XmlPathRoot.Strict.Empty, null, XmlOptions.Strict.Value); }
public void Diff_equal_with_same_index() { var actual = new NodeComment(123, 456, "Text"); var expected = new NodeComment(123, 456, "Text"); var diff = actual.Diff(expected, XmlPathRoot.Strict.Empty, XmlPathRoot.Strict.Empty, XmlOptions.Strict.Value); Assert.IsTrue(diff.IsEmpty); }
public void Diff_with_items_differing_by_type() { var actual = new NodeComment(123, 456, "TEXT"); var expected = MockRepository.GenerateStub <INode>(); var diff = actual.Diff(expected, XmlPathRoot.Strict.Empty, XmlPathRoot.Strict.Empty, XmlOptions.Strict.Value); AssertDiff(diff, new Diff(DiffType.UnexpectedComment, XmlPathRoot.Strict.Empty.Element(123), DiffTargets.Actual)); }
public void Diff_with_value_differing_by_case() { var actual = new NodeComment(123, 456, "Text"); var expected = new NodeComment(123, 456, "TEXT"); var diff = actual.Diff(expected, XmlPathRoot.Strict.Empty, XmlPathRoot.Strict.Empty, XmlOptions.Strict.Value); AssertDiff(diff, new Diff(DiffType.MismatchedComment, XmlPathRoot.Strict.Empty.Element(123), DiffTargets.Both)); }
public void Diff_with_items_differing_by_type() { var actual = new NodeComment(123, 456, "TEXT"); var expected = MockRepository.GenerateStub<INode>(); var diff = actual.Diff(expected, XmlPathRoot.Strict.Empty, XmlPathRoot.Strict.Empty, XmlOptions.Strict.Value); AssertDiff(diff, new Diff(DiffType.UnexpectedComment, XmlPathRoot.Strict.Empty.Element(123), DiffTargets.Actual)); }
private void AggregateComment(NodeComment node, int level) { AddLine(String.Format("<!--{0}-->", node.Text), level); }