コード例 #1
0
        public void GetXElement_SetVersion_ReturnsCorrectXml()
        {
            MapDescriptor mapDescriptor = new MapDescriptor();
            mapDescriptor.Script = "script";
            mapDescriptor.Version = 4;
            mapDescriptor.Designer = new XElement("Designer").ToString();

            var element = mapDescriptor.GetXElement();

            Assert.IsTrue(element.Attribute(MapDescriptor.CN_VERSION).Value == mapDescriptor.Version.ToString());
        }
コード例 #2
0
        public void GetXElement_SetDesigner_ReturnsCorrectXml()
        {
            MapDescriptor mapDescriptor = new MapDescriptor();
            mapDescriptor.Script = "script";
            mapDescriptor.Version = 4;
            mapDescriptor.Designer = new XElement("Designer").ToString();

            var element = mapDescriptor.GetXElement();

            Assert.IsTrue(element.Element(MapDescriptor.CN_DESIGNER) != null);
        }
コード例 #3
0
        public void GetXElement_AllPropertiesFiled_Has2Attributes1ChildNode()
        {
            MapDescriptor mapDescriptor = new MapDescriptor();
            mapDescriptor.Script = "script";
            mapDescriptor.Version = 4;
            mapDescriptor.Designer = new XElement("Designer").ToString();

            var element = mapDescriptor.GetXElement();

            Assert.IsTrue(element.Attributes().Count() == 2, "MapDescriptor have to have 2 attributes");
            Assert.IsTrue(element.Elements().Count() == 1, "MapDescriptor have to have 1 child node");
        }