public void NullMergerThrows()
        {
            var doc  = new XmlDocument();
            var node = doc.CreateNode(XmlNodeType.Element, "somenode", null);

            Assert.Throws <ArgumentNullException>(() => MergeAtomicElementService.Run(null, ref node, node, node));
        }
Ejemplo n.º 2
0
        private static XmlNode RunServiceCore(string common, string ours, string theirs,
                                              MergeSituation mergeSituation, out XmlNode returnAncestorNode, out ListenerForUnitTests listener)
        {
            XmlNode ourNode;
            XmlNode ourParent;
            XmlNode theirNode;
            XmlNode ancestorNode;

            XmlTestHelper.CreateThreeNodes(ours, theirs, common, out ourNode, out ourParent, out theirNode, out ancestorNode);
            returnAncestorNode = ancestorNode;

            var merger = GetMerger(mergeSituation, out listener);

            Assert.DoesNotThrow(() => MergeAtomicElementService.Run(merger, ourParent, ref ourNode, theirNode, ancestorNode));

            return(ourNode);
        }
        public void NotAtomicStrategyReturnsFalse()
        {
            XmlNode root;
            var     doc = GetDocument(out root);
            XmlNode ourNode;
            XmlNode theirNode;
            XmlNode ancestorNode;

            CreateThreeNodes(doc, root,
                             out ancestorNode, "originalAttr", "originalValue",
                             out ourNode, "originalAttr", "newValue",
                             out theirNode, "originalAttr", "originalValue");

            ListenerForUnitTests listener;
            var merger = GetMerger(out listener, false);

            Assert.Throws <InvalidOperationException>(() => MergeAtomicElementService.Run(merger, ref ourNode, theirNode, ancestorNode));
        }
        public void AllNullNodesThrows()
        {
            XmlNode node = null;

            Assert.Throws <ArgumentNullException>(() => MergeAtomicElementService.Run(new XmlMerger(new NullMergeSituation()), ref node, node, node));
        }