Beispiel #1
0
        public void ToXml_ReturnsValidXmlDoc()
        {
            var grid = new UniversalGrid <string>(10, 15);

            grid.SetObject("X", 5, 5);

            var xmlDoc = grid.ToXml();

            Assert.That(xmlDoc.Root.Name.LocalName, Is.EqualTo("grid"));
            Assert.That(xmlDoc.Root.Attribute("width").Value, Is.EqualTo("10"));
            Assert.That(xmlDoc.Root.Attribute("height").Value, Is.EqualTo("15"));
            Assert.That(xmlDoc.Root.Attribute("viewport").Value, Is.EqualTo("0 0 9 14"));
            Assert.That(xmlDoc.Root.Elements().ElementAt(5).Elements().ElementAt(5).Value, Is.EqualTo("X"));

            Console.WriteLine(xmlDoc);
        }