Beispiel #1
0
        public void CreateElementTest()
        {
            const string Name         = "name";
            const string NamepaceName = "namespaceName";
            XElement     element      = XDocumentHelpers.CreateElement("name", "namespaceName");

            CheckName(element, Name, NamepaceName);
        }
Beispiel #2
0
        public void CreateElementWithContentTest()
        {
            const string Name         = "name";
            const string NamepaceName = "namespaceName";
            var          content      = new XText("content");
            XElement     element      = XDocumentHelpers.CreateElement("name", "namespaceName", content);

            CheckName(element, Name, NamepaceName);
            List <XNode> nodes = element.Nodes().ToList();

            Assert.AreEqual(1, nodes.Count);
            Assert.AreEqual(content, nodes.Single());
        }