Exemple #1
0
        public void Diff_with_null_pathExpected_should_throw_exception()
        {
            var actual   = new NodeElement(123, 123, "Name", NodeAttributeCollection.Empty, EmptyArray <INode> .Instance);
            var expected = new NodeElement(123, 123, "Name", NodeAttributeCollection.Empty, EmptyArray <INode> .Instance);

            actual.Diff(expected, XmlPathRoot.Strict.Empty, null, XmlOptions.Strict.Value);
        }
Exemple #2
0
        public void Diff_with_items_differing_by_type()
        {
            var actual   = new NodeElement(123, 456, "Name", NodeAttributeCollection.Empty, EmptyArray <INode> .Instance);
            var expected = MockRepository.GenerateStub <INode>();
            var diff     = actual.Diff(expected, XmlPathRoot.Strict.Empty, XmlPathRoot.Strict.Empty, XmlOptions.Strict.Value);

            AssertDiff(diff, new Diff(DiffType.UnexpectedElement, XmlPathRoot.Strict.Empty.Element(123), DiffTargets.Actual));
        }
Exemple #3
0
        public void Diff_equal_with_item_differing_by_name_case()
        {
            var actual   = new NodeElement(123, 456, "Name", NodeAttributeCollection.Empty, EmptyArray <INode> .Instance);
            var expected = new NodeElement(123, 456, "NAME", NodeAttributeCollection.Empty, EmptyArray <INode> .Instance);
            var diff     = actual.Diff(expected, XmlPathRoot.Strict.Empty, XmlPathRoot.Strict.Empty, XmlOptions.Custom.IgnoreElementsNameCase.Value);

            Assert.IsTrue(diff.IsEmpty);
        }
Exemple #4
0
        public void Diff_with_item_differing_by_name_case()
        {
            var actual   = new NodeElement(123, 456, "Name", NodeAttributeCollection.Empty, EmptyArray <INode> .Instance);
            var expected = new NodeElement(123, 456, "NAME", NodeAttributeCollection.Empty, EmptyArray <INode> .Instance);
            var diff     = actual.Diff(expected, XmlPathRoot.Strict.Empty, XmlPathRoot.Strict.Empty, XmlOptions.Strict.Value);

            AssertDiff(diff, new Diff(DiffType.MismatchedElement, XmlPathRoot.Strict.Empty.Element(123), DiffTargets.Both));
        }
Exemple #5
0
        public void Diff_equal_with_same_index()
        {
            var actual   = new NodeElement(123, 456, "Name", NodeAttributeCollection.Empty, EmptyArray <INode> .Instance);
            var expected = new NodeElement(123, 456, "Name", NodeAttributeCollection.Empty, EmptyArray <INode> .Instance);
            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 NodeElement(123, 456, "Name", NodeAttributeCollection.Empty, EmptyArray<INode>.Instance);
     var expected = MockRepository.GenerateStub<INode>();
     var diff = actual.Diff(expected, XmlPathRoot.Strict.Empty, XmlPathRoot.Strict.Empty, XmlOptions.Strict.Value);
     AssertDiff(diff, new Diff(DiffType.UnexpectedElement, XmlPathRoot.Strict.Empty.Element(123), DiffTargets.Actual));
 }
 public void Diff_equal_with_item_differing_by_name_case()
 {
     var actual = new NodeElement(123, 456, "Name", NodeAttributeCollection.Empty, EmptyArray<INode>.Instance);
     var expected = new NodeElement(123, 456, "NAME", NodeAttributeCollection.Empty, EmptyArray<INode>.Instance);
     var diff = actual.Diff(expected, XmlPathRoot.Strict.Empty, XmlPathRoot.Strict.Empty, XmlOptions.Custom.IgnoreElementsNameCase.Value);
     Assert.IsTrue(diff.IsEmpty);
 }
 public void Diff_with_item_differing_by_name_case()
 {
     var actual = new NodeElement(123, 456, "Name", NodeAttributeCollection.Empty, EmptyArray<INode>.Instance);
     var expected = new NodeElement(123, 456, "NAME", NodeAttributeCollection.Empty, EmptyArray<INode>.Instance);
     var diff = actual.Diff(expected, XmlPathRoot.Strict.Empty, XmlPathRoot.Strict.Empty, XmlOptions.Strict.Value);
     AssertDiff(diff, new Diff(DiffType.MismatchedElement, XmlPathRoot.Strict.Empty.Element(123), DiffTargets.Both));
 }
 public void Diff_equal_with_same_index()
 {
     var actual = new NodeElement(123, 456, "Name", NodeAttributeCollection.Empty, EmptyArray<INode>.Instance);
     var expected = new NodeElement(123, 456, "Name", NodeAttributeCollection.Empty, EmptyArray<INode>.Instance);
     var diff = actual.Diff(expected, XmlPathRoot.Strict.Empty, XmlPathRoot.Strict.Empty, XmlOptions.Strict.Value);
     Assert.IsTrue(diff.IsEmpty);
 }
 public void Diff_with_null_pathExpected_should_throw_exception()
 {
     var actual = new NodeElement(123, 123, "Name", NodeAttributeCollection.Empty, EmptyArray<INode>.Instance);
     var expected = new NodeElement(123, 123, "Name", NodeAttributeCollection.Empty, EmptyArray<INode>.Instance);
     actual.Diff(expected, XmlPathRoot.Strict.Empty, null, XmlOptions.Strict.Value);
 }