public void AssemblyWithPartsXML()
        {
            a.Add(p1);
            a.Add(p2);
            PartExtension    e   = a.GetExtension("XML");
            XmlPartExtension xe  = e as XmlPartExtension;
            XmlElement       xml = xe.XmlElement;

            Assert.AreEqual("Assembly", xml.Name);
            Assert.AreEqual("5879", ChildText(xml, "PartNumber"));
            Assert.AreEqual("MyAssembly", ChildText(xml, "Description"));

            XmlElement  parts    = Child(xml, "Parts");
            XmlNodeList partList = parts.ChildNodes;

            Assert.AreEqual(2, partList.Count);

            XmlElement partElement = partList.Item(0) as XmlElement;

            Assert.AreEqual("PiecePart", partElement.Name);
            Assert.AreEqual("997624", ChildText(partElement, "PartNumber"));

            partElement = partList.Item(1) as XmlElement;
            Assert.AreEqual("PiecePart", partElement.Name);
            Assert.AreEqual("7734", ChildText(partElement, "PartNumber"));
        }
        public void PiecePart2XML()
        {
            PartExtension    e   = p2.GetExtension("XML");
            XmlPartExtension xe  = e as XmlPartExtension;
            XmlElement       xml = xe.XmlElement;

            Assert.AreEqual("PiecePart", xml.Name);
            Assert.AreEqual("7734", ChildText(xml, "PartNumber"));
            Assert.AreEqual("Hell", ChildText(xml, "Description"));
            Assert.AreEqual(666, double.Parse(ChildText(xml, "Cost")), .01);
        }
        public void PiecePart1XML()
        {
            PartExtension    e   = p1.GetExtension("XML");
            XmlPartExtension xe  = e as XmlPartExtension;
            XmlElement       xml = xe.XmlElement;

            Assert.AreEqual("PiecePart", xml.Name);
            Assert.AreEqual("997624", ChildText(xml, "PartNumber"));
            Assert.AreEqual("MyPart", ChildText(xml, "Description"));
            Assert.AreEqual(3.2, double.Parse(ChildText(xml, "Cost")), .01);
        }
        public void SimpleAssemblyXML()
        {
            PartExtension    e   = a.GetExtension("XML");
            XmlPartExtension xe  = e as XmlPartExtension;
            XmlElement       xml = xe.XmlElement;

            Assert.AreEqual("Assembly", xml.Name);
            Assert.AreEqual("5879", ChildText(xml, "PartNumber"));
            Assert.AreEqual("MyAssembly", ChildText(xml, "Description"));

            XmlElement  parts    = Child(xml, "Parts");
            XmlNodeList partList = parts.ChildNodes;

            Assert.AreEqual(0, partList.Count);
        }