Esempio n. 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);
        }
Esempio n. 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));
        }
Esempio n. 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);
        }
Esempio n. 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));
        }
Esempio n. 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);
        }
Esempio n. 6
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));
 }
Esempio n. 7
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);
 }
Esempio n. 8
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));
 }
Esempio n. 9
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);
 }
Esempio n. 10
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);
 }