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);
        }
示例#2
0
        public void SetUpFixture()
        {
            WixDocumentReader wixReader = new WixDocumentReader(GetWixXml());

            dialogIds        = wixReader.GetDialogIds();
            welcomeDialogId  = dialogIds[0];
            progressDialogId = dialogIds[1];

            wixReader             = new WixDocumentReader(GetWixXml());
            welcomeDialogLocation = wixReader.GetStartElementLocation("Dialog", welcomeDialogId);

            wixReader             = new WixDocumentReader(GetWixXml());
            missingDialogLocation = wixReader.GetStartElementLocation("Dialog", "missingDialogId");
        }
        public void EmptyElement()
        {
            string xml = "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\r\n" +
                         "\t<Product Name='DialogTest' \r\n" +
                         "\t         Version='1.0' \r\n" +
                         "\t         Language='1013' \r\n" +
                         "\t         Manufacturer='#develop' \r\n" +
                         "\t         Id='????????-????-????-????-????????????'/>\r\n" +
                         "</Wix>";
            WixDocumentReader wixReader        = new WixDocumentReader(xml);
            TextLocation      location         = wixReader.GetEndElementLocation("Product", "????????-????-????-????-????????????");
            TextLocation      expectedLocation = TextLocation.Empty;

            Assert.AreEqual(expectedLocation, location);
        }
        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);
        }
示例#7
0
 public void SetUpFixture()
 {
     wixReader = new WixDocumentReader(GetWixXml());
 }