Exemplo n.º 1
0
        public void FirstOrDefaultXsltElement_ElementName_ReturnsNull()
        {
            var parent    = new XsltElement("Parent");
            var childName = "testName";
            var child     = new XsltElement("element", new XAttribute("name", childName));

            parent.Add(child);

            var foundElement = parent.FirstOrDefaultXsltElement("someOtherName");

            Assert.Null(foundElement);
        }
Exemplo n.º 2
0
        public void FirstOrDefaultXsltElement_Element_ReturnsFirstElement()
        {
            var parent    = new XsltElement("Parent");
            var childName = "testName";
            var child     = new XsltElement("element", new XAttribute("name", childName));

            parent.Add(child);

            var foundElement = parent.FirstOrDefaultXsltElement(child);

            Assert.Same(child, foundElement);
        }
Exemplo n.º 3
0
 public static XsltElement AddAndReturnChild(this XsltElement parent, XsltElement child)
 {
     parent.Add(child);
     return(child);
 }