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()); }
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); }
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"); }