當前位置: 首頁>>代碼示例>>C#>>正文


C# WixTest.Light類代碼示例

本文整理匯總了C#中WixTest.Light的典型用法代碼示例。如果您正苦於以下問題:C# Light類的具體用法?C# Light怎麽用?C# Light使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Light類屬於WixTest命名空間,在下文中一共展示了Light類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: LongIdentifiers

        public void LongIdentifiers()
        {
            string longDirectoryName = "Directory_01234567890123456789012345678901234567890123456789012345678901234567890123456789";
            string longComponentName = "Component_01234567890123456789012345678901234567890123456789012345678901234567890123456789";
            string longFileName = "Test_txt_01234567890123456789012345678901234567890123456789012345678901234567890123456789";

            Candle candle = new Candle();
            candle.SourceFiles.Add(Path.Combine(IdentifierTests.TestDataDirectory, @"LongIdentifiers\product.wxs"));
            candle.ExpectedWixMessages.Add(new WixMessage(1026, string.Format("The Directory/@Id attribute's value, '{0}', is too long for an identifier.  Standard identifiers are 72 characters long or less.", longDirectoryName),WixMessage.MessageTypeEnum.Warning));
            candle.ExpectedWixMessages.Add(new WixMessage(1026, string.Format("The Component/@Id attribute's value, '{0}', is too long for an identifier.  Standard identifiers are 72 characters long or less.", longComponentName), WixMessage.MessageTypeEnum.Warning));
            candle.ExpectedWixMessages.Add(new WixMessage(1026, string.Format("The File/@Id attribute's value, '{0}', is too long for an identifier.  Standard identifiers are 72 characters long or less.", longFileName), WixMessage.MessageTypeEnum.Warning));
            candle.ExpectedWixMessages.Add(new WixMessage(1026, string.Format("The ComponentRef/@Id attribute's value, '{0}', is too long for an identifier.  Standard identifiers are 72 characters long or less.", longComponentName), WixMessage.MessageTypeEnum.Warning));
            candle.Run();

            Light light = new Light(candle);
            light.SuppressedICEs.Add("ICE03");
            light.Run();

            // verify long names in the resulting msi
            string query = string.Format("SELECT `Directory` FROM `Directory` WHERE `Directory` = '{0}'", longDirectoryName);
            string queryResult = Verifier.Query(light.OutputFile, query);
            Assert.Equal(longDirectoryName, queryResult);

            query = string.Format("SELECT `Component` FROM `Component` WHERE `Component` = '{0}'", longComponentName);
            queryResult = Verifier.Query(light.OutputFile, query);
            Assert.Equal(longComponentName, queryResult);

            query = string.Format("SELECT `File` FROM `File` WHERE `File` = '{0}'", longFileName);
            queryResult = Verifier.Query(light.OutputFile, query);
            Assert.Equal(longFileName, queryResult);

            query = string.Format("SELECT `Component_` FROM `FeatureComponents` WHERE `Component_` = '{0}'", longComponentName);
            queryResult = Verifier.Query(light.OutputFile, query);
            Assert.Equal(longComponentName, queryResult);
        }
開發者ID:zooba,項目名稱:wix3,代碼行數:35,代碼來源:Authoring.IdentifierTests.cs

示例2: NamedBindPath

        public void NamedBindPath()
        {
            // Create a temp text file to bind into the wix library
            DirectoryInfo tempDirectory = Directory.CreateDirectory(Utilities.FileUtilities.GetUniqueFileName());
            string testFileName = Path.Combine(tempDirectory.FullName, "TextFile1.txt");
            StreamWriter outputFile =  File.CreateText(testFileName);
            outputFile.Write("abc");
            outputFile.Close();

            // Build the library
            Lit lit = new Lit();
            lit.ObjectFiles.Add(Candle.Compile(Path.Combine(BindPathTests.TestDataDirectory, @"NamedBindPath\Product.wxs")));
            lit.BindPath = String.Concat("Test=", tempDirectory.FullName);
            lit.BindFiles = true;
            lit.Run();

            // Delete the source file
            File.Delete(testFileName);

            // Link the library and verify files are in the resulting msi layout
            Light light = new Light(lit);
            light.Run();

            string outputFileName = Path.Combine(Path.GetDirectoryName(lit.OutputFile), @"PFiles\WixTestFolder\TextFile1.txt");
            Assert.IsTrue(File.Exists(outputFileName), "File was not created in msi layout as expected.");
            Assert.IsTrue(File.ReadAllText(outputFileName).Equals("abc"), "File contents do not match expected.");
        }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:27,代碼來源:BindPaths.BindPathTests.cs

示例3: PreMsi50ShortcutProperty

        public void PreMsi50ShortcutProperty()
        {
            // Loop through a list of pre-MSI 5.0 Windows Installer version
            foreach (MSIVersions.Versions version in Enum.GetValues(typeof(MSIVersions.Versions)))
            {
                // Skip MSI 5.0 and later
                if (MSIVersions.GetVersion(version) >= MSIVersions.GetVersion(MSIVersions.Versions.MSI50))
                {
                    continue;
                }

                Candle candle = new Candle();
                candle.SourceFiles.Add(Path.Combine(ShortcutPropertyTests.TestDataDirectory, @"PreMsi50ShortcutProperty\product.wxs"));
                candle.PreProcessorParams.Add("InstallerVersion", MSIVersions.GetVersionInMSIFormat(version));
                candle.Run();

                Light light = new Light(candle);

                // Only run validation on MSIs built with the current or earlier than current versions of Windows Installer
                if (DTF.Installer.Version < MSIVersions.GetVersion(version))
                {
                    light.SuppressMSIAndMSMValidation = true;
                }

                light.Run();
            }
        }
開發者ID:zooba,項目名稱:wix3,代碼行數:27,代碼來源:Shortcuts.ShortcutPropertyTests.cs

示例4: SimplePedantic

        public void SimplePedantic()
        {
            Candle candle = new Candle();
            candle.SourceFiles.Add(Path.Combine(WixTests.SharedAuthoringDirectory, "BasicProduct.wxs"));
            candle.Run();

            Light light = new Light(candle);
            light.Pedantic = true;
            light.Run();
        }
開發者ID:zooba,項目名稱:wix3,代碼行數:10,代碼來源:Messages.PedanticTests.cs

示例5: InvalidCultures

        public void InvalidCultures()
        {
            Candle candle = new Candle();
            candle.SourceFiles.Add(WixTests.BasicProductWxs);
            candle.Run();

            Light light = new Light(candle);
            light.Cultures = "en-US;in-VA;lid";
            light.Run();
        }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:10,代碼來源:Cultures.CultureTests.cs

示例6: SimpleSuppressICE

        public void SimpleSuppressICE()
        {
            Candle candle = new Candle();
            candle.SourceFiles.Add(Path.Combine(SuppressICEsTests.TestDataDirectory, @"SimpleSuppressICE\product.wxs"));
            candle.Run();

            Light light = new Light(candle);
            light.SuppressedICEs.Add("ICE18");
            light.Run();
        }
開發者ID:zooba,項目名稱:wix3,代碼行數:10,代碼來源:ICEs.SuppressICEsTests.cs

示例7: SF1824809

        public void SF1824809()
        {
            Candle candle = new Candle();
            candle.SourceFiles.Add(Path.Combine(RegressionTests.TestDataDirectory, @"SF1824809\product.wxs"));
            candle.Run();

            Light light = new Light();
            light.ObjectFiles = candle.ExpectedOutputFiles;
            light.Run();
        }
開發者ID:bleissem,項目名稱:wix3,代碼行數:10,代碼來源:RegressionTests.cs

示例8: SimpleSuppressWarnings

        public void SimpleSuppressWarnings()
        {
            Candle candle = new Candle();
            candle.SourceFiles.Add(Environment.ExpandEnvironmentVariables(Path.Combine(SuppressWarningsTests.TestDataDirectory, @"Shared\Warning1079.wxs")));
            candle.Run();

            Light light = new Light(candle);
            light.SuppressWarnings.Add("1079");
            light.Run();
        }
開發者ID:bleissem,項目名稱:wix3,代碼行數:10,代碼來源:Warnings.SuppressWarningsTests.cs

示例9: SimpleReuseCab

        public void SimpleReuseCab()
        {
            Candle candle = new Candle();
            candle.SourceFiles.Add(Path.Combine(ReuseCabTests.TestDataDirectory, @"SimpleReuseCab\product.wxs"));
            candle.Run();

            Light light = new Light(candle);
            light.ReuseCab = true;
            light.CachedCabsPath = Path.Combine(ReuseCabTests.TestDataDirectory, "SimpleReuseCab");
            light.Run();
        }
開發者ID:zooba,項目名稱:wix3,代碼行數:11,代碼來源:Cabs.ReuseCabTests.cs

示例10: DuplicateRemoveFolders

        public void DuplicateRemoveFolders()
        {
            Candle candle = new Candle();
            candle.SourceFiles.Add(Path.Combine(RemoveFolderTests.TestDataDirectory, @"DuplicateRemoveFolders\product.wxs"));
            candle.Run();

            Light light = new Light(candle);
            light.ExpectedWixMessages.Add(new WixMessage(130, "The primary key 'RemoveFolder1' is duplicated in table 'RemoveFile'.  Please remove one of the entries or rename a part of the primary key to avoid the collision.", WixMessage.MessageTypeEnum.Error));
            light.ExpectedExitCode = 130;
            light.Run();
        }
開發者ID:bleissem,項目名稱:wix3,代碼行數:11,代碼來源:Components.RemoveFolderTests.cs

示例11: ValidIdentifier

        public void ValidIdentifier()
        {
            Candle candle = new Candle();
            candle.SourceFiles.Add(Path.Combine(LocalizationTests.TestDataDirectory, @"ValidIdentifier\product.wxs"));
            candle.Run();

            Light light = new Light(candle);
            light.LocFiles.Add(Path.Combine(LocalizationTests.TestDataDirectory, @"ValidIdentifier\en-us.wxl"));
            light.Cultures = "en-us";
            light.Run();
        }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:11,代碼來源:Localization.LocalizationTests.cs

示例12: SimpleWarningsAsErrors

        public void SimpleWarningsAsErrors()
        {
            Candle candle = new Candle();
            candle.SourceFiles.Add(Path.Combine(WarningsAsErrorsTests.TestDataDirectory, @"Shared\Warning1079.wxs"));
            candle.Run();

            Light light = new Light(candle);
            light.TreatAllWarningsAsErrors = true;
            light.ExpectedWixMessages.Add(new WixMessage(1079, WixMessage.MessageTypeEnum.Error));
            light.ExpectedExitCode = 1079;
            light.Run();
        }
開發者ID:bleissem,項目名稱:wix3,代碼行數:12,代碼來源:Warnings.WarningsAsErrorsTests.cs

示例13: NullValues

        public void NullValues()
        {
            Candle candle = new Candle();
            candle.SourceFiles.Add(Path.Combine(CustomTableTests.TestDataDirectory, @"NullValues\product.wxs"));
            candle.Run();

            Light light = new Light(candle);
            light.ExpectedWixMessages.Add(new WixMessage(53, "There is no data for column 'Column2' in a contained row of custom table 'CustomTable1'.  A non-null value must be supplied for this column.", WixMessage.MessageTypeEnum.Error));
            light.ExpectedWixMessages.Add(new WixMessage(53, "There is no data for column 'Column2' in a contained row of custom table 'CustomTable1'.  A non-null value must be supplied for this column.", WixMessage.MessageTypeEnum.Error));
            light.ExpectedExitCode = 53;
            light.Run();
        }
開發者ID:bleissem,項目名稱:wix3,代碼行數:12,代碼來源:CustomTables.CustomTableTests.cs

示例14: ChainDuplicatePackageGroupRefs

        public void ChainDuplicatePackageGroupRefs()
        {
            string candleOutput = Candle.Compile(Path.Combine(ChainTests.TestDataDirectory, @"ChainDuplicatePackageGroupRefs\Product.wxs"));

            Light light = new Light();
            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(343, Message.MessageTypeEnum.Error)); //A circular reference of ordering dependencies was detected.
            light.IgnoreWixMessageOrder = true;
            light.ExpectedExitCode = 343;
            light.Run();
        }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:12,代碼來源:Bundle.ChainTests.cs

示例15: ValidServiceConfig

        public void ValidServiceConfig()
        {
            Candle candle = new Candle();
            candle.SourceFiles.Add(Path.Combine(RegressionTests.TestDataDirectory,@"ValidServiceConfig\product.wxs"));
            candle.Extensions.Add("WixUtilExtension");
            candle.Run();

            Light light = new Light(candle);
            light.Extensions.Add("WixUtilExtension");
            light.OutputFile = string.Empty;
            light.Run();
        }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:12,代碼來源:UtilExtension.RegressionTests.cs


注:本文中的WixTest.Light類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。