public void SingleDirectoryElement()
        {
            string xml = "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\r\n" +
                         "\t<Fragment>\r\n" +
                         "\t\t<Directory Id='TARGETDIR' Name='SourceDir'>\r\n" +
                         "\t\t</Directory>\r\n" +
                         "\t</Fragment>\r\n" +
                         "</Wix>";
            WixDocumentReader wixReader      = new WixDocumentReader(xml);
            DomRegion         region         = wixReader.GetElementRegion("Directory", "TARGETDIR");
            DomRegion         expectedRegion = new DomRegion(3, 3, 4, 14);

            Assert.AreEqual(expectedRegion, region);
        }
        public void ElementStartsImmediatelyAfterDialogEndElement()
        {
            string xml = "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\r\n" +
                         "\t<Fragment>\r\n" +
                         "\t\t<UI>\r\n" +
                         "<Dialog Id='WelcomeDialog'></Dialog><Property/>\r\n" +
                         "\t\t</UI>\r\n" +
                         "\t</Fragment>\r\n" +
                         "</Wix>";

            WixDocumentReader wixReader      = new WixDocumentReader(xml);
            DomRegion         region         = wixReader.GetElementRegion("Dialog", "WelcomeDialog");
            DomRegion         expectedRegion = new DomRegion(4, 1, 4, 36);

            Assert.AreEqual(expectedRegion, region);
        }
        public void EmptyDialogElement()
        {
            string xml = "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\r\n" +
                         "\t<Fragment>\r\n" +
                         "\t\t<UI>\r\n" +
                         "<Dialog Id='WelcomeDialog'/>\r\n" +
                         "\t\t</UI>\r\n" +
                         "\t</Fragment>\r\n" +
                         "</Wix>";

            WixDocumentReader wixReader      = new WixDocumentReader(xml);
            DomRegion         region         = wixReader.GetElementRegion("Dialog", "WelcomeDialog");
            DomRegion         expectedRegion = new DomRegion(4, 1, 4, 28);

            Assert.AreEqual(expectedRegion, region);
        }
        public void DialogSpansTwoLines()
        {
            string xml = "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\r\n" +
                         "\t<Fragment>\r\n" +
                         "\t\t<UI>\r\n" +
                         "\t\t\t<Dialog Id='WelcomeDialog' Height='100' Width='200'>\r\n" +
                         "\t\t\t</Dialog>\r\n" +
                         "\t\t</UI>\r\n" +
                         "\t</Fragment>\r\n" +
                         "</Wix>";

            WixDocumentReader wixReader      = new WixDocumentReader(xml);
            DomRegion         region         = wixReader.GetElementRegion("Dialog", "WelcomeDialog");
            DomRegion         expectedRegion = new DomRegion(4, 4, 5, 12);

            Assert.AreEqual(expectedRegion, region);
        }