예제 #1
0
        /// <inheritdoc />
        public DiffSet Diff(NodeElement expected, IXmlPathStrict path, IXmlPathStrict pathExpected, Options options)
        {
            if (expected == null)
            {
                throw new ArgumentNullException("expected");
            }
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }
            if (pathExpected == null)
            {
                throw new ArgumentNullException("pathExpected");
            }

            if (!AreNamesEqual(expected.Name, options))
            {
                return(new DiffSetBuilder()
                       .Add(new Diff(DiffType.MismatchedElement, path.Element(Index), DiffTargets.Both))
                       .ToDiffSet());
            }

            return(new DiffSetBuilder()
                   .Add(attributes.Diff(expected.Attributes, path.Element(Index), pathExpected.Element(expected.Index), options))
                   .Add(Children.Diff(expected.Children, path.Element(Index), pathExpected.Element(expected.Index), options))
                   .ToDiffSet());
        }
예제 #2
0
        /// <inheritdoc />
        public DiffSet Diff(NodeDeclaration expected, IXmlPathStrict path, IXmlPathStrict pathExpected, Options options)
        {
            if (expected == null)
            {
                throw new ArgumentNullException("expected");
            }
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }

            return(attributes.Diff(expected.Attributes, path, pathExpected, options));
        }