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


C# WixTest.Candle類代碼示例

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


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

示例1: LongFilePath

        public void LongFilePath()
        {
            //the max length of a path is 247 chars, the filepath is 259 chars

            string OutputPath = Utilities.FileUtilities.GetUniqueFileName();
            //add initial 170 chars
            OutputPath = Path.Combine(OutputPath, @"FilePathNewfolder11(20chars)\Newfolder12(20chars)Newfolder12(20chars)Newfolder13(20chars)Newfolder13(20chars)\Newfolder14(20chars)Newfolder15(20chars)Newfolder16(20chars)");

            int i = 245 - OutputPath.Length;
            while (i > 0)
            {
                OutputPath = Path.Combine(OutputPath, @"pt");
                i = 245 - OutputPath.Length;
            }
            if (OutputPath.Length < 246)
            {
                OutputPath = Path.Combine(OutputPath, "T");
            }

            Assert.IsTrue(OutputPath.Length  <248, "The output path is not less than 248 chars");
            Directory.CreateDirectory(OutputPath);

            Candle candle = new Candle();
            candle.SourceFiles.Add(Path.Combine(Tests.WixTests.SharedAuthoringDirectory, "BasicProduct.wxs"));
            candle.OutputFile = Path.Combine(OutputPath, "Prod.wixobj");

            Assert.IsTrue((candle.OutputFile.Length > 256) && (candle.OutputFile.Length < 260), "The output filepath{0} is not between 256 and 260 chars",candle .OutputFile .Length );

            candle.Run();
        }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:30,代碼來源:Output.FileSystemTests.cs

示例2: 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

示例3: NoPedanticSwitch

 public void NoPedanticSwitch()
 {
     Candle candle = new Candle();
     candle.Pedantic = false;
     candle.SourceFiles.Add(PedanticTests.TestFile);
     candle.Run();
 }
開發者ID:bleissem,項目名稱:wix3,代碼行數:7,代碼來源:PedanticTests.cs

示例4: FileNameWithSpace

 public void FileNameWithSpace()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(Tests.WixTests.SharedAuthoringDirectory, "BasicProduct.wxs"));
     candle.OutputFile = Path.Combine(Utilities.FileUtilities.GetUniqueFileName(), "Pro  duct.wixobj");
     candle.Run();
 }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:7,代碼來源:Output.FileSystemTests.cs

示例5: NoErrorOnSpecifyingMinSizeInFileSearch

 public void NoErrorOnSpecifyingMinSizeInFileSearch()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(RegressionTests.TestDataDirectory,@"NoErrorOnSpecifyingMinSizeInFileSearch\FileSearch.wxs"));
     candle.ExpectedExitCode = 0;
     candle.Run();
 }
開發者ID:bleissem,項目名稱:wix3,代碼行數:7,代碼來源:RegressionTests.cs

示例6: SuppressAllWarningsSwitch

 public void SuppressAllWarningsSwitch()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(testFile);
     candle.SuppressAllWarnings = true;
     candle.Run();
 }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:7,代碼來源:SuppressWarningsTests.cs

示例7: ShortcutDirectoryNotSet

 public void ShortcutDirectoryNotSet()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(RegressionTests.TestDataDirectory, @"ShortcutDirectoryNotSet\ShortcutProduct.wxs"));
     candle.ExpectedExitCode = 0;
     candle.Run();
 }
開發者ID:zooba,項目名稱:wix3,代碼行數:7,代碼來源:RegressionTests.cs

示例8: 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

示例9: NoSuppressWarningsSwitch

 public void NoSuppressWarningsSwitch()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(testFile);
     candle.ExpectedWixMessages.Add(new WixMessage(1096, WixMessage.MessageTypeEnum.Warning));
     candle.ExpectedWixMessages.Add(new WixMessage(1075, WixMessage.MessageTypeEnum.Warning));
     candle.Run();
 }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:8,代碼來源:SuppressWarningsTests.cs

示例10: NoTraceSwitch

 public void NoTraceSwitch()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(testFile);
     candle.Trace = false;
     candle.ExpectedWixMessages.Add(new WixMessage(1075, "The Product/@UpgradeCode attribute was not found; it is strongly recommended to ensure that this product can be upgraded.", WixMessage.MessageTypeEnum.Warning));
     candle.Run();
 }
開發者ID:zooba,項目名稱:wix3,代碼行數:8,代碼來源:TraceTests.cs

示例11: EmbedCabAttrWithoutCabinetAttr

 public void EmbedCabAttrWithoutCabinetAttr()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(RegressionTests.TestDataDirectory,@"EmbedCabAttrWithoutCabinetAttr\EmbedCabProduct.wxs"));
     candle.ExpectedExitCode = 10;
     candle.ExpectedWixMessages.Add(new WixMessage(10, "The Media/@Cabinet attribute was not found; it is required when attribute EmbedCab has a value of 'yes'.", WixMessage.MessageTypeEnum.Error));
     candle.Run();
 }
開發者ID:bleissem,項目名稱:wix3,代碼行數:8,代碼來源:RegressionTests.cs

示例12: VerifyDeprecatedSwitch

 public void VerifyDeprecatedSwitch()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(testFile);
     candle.OtherArguments = "-swall";
     candle.ExpectedWixMessages.Add(new WixMessage(1108, "The command line switch 'swall' is deprecated. Please use 'sw' instead.", WixMessage.MessageTypeEnum.Warning));
     candle.Run();
 }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:8,代碼來源:SuppressWarningsTests.cs

示例13: SuppressSpecificWarnings

 public void SuppressSpecificWarnings()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(testFile);
     candle.SuppressWarnings.Add(1075);
     candle.ExpectedWixMessages.Add(new WixMessage(1096, WixMessage.MessageTypeEnum.Warning));
     candle.Run();
 }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:8,代碼來源:SuppressWarningsTests.cs

示例14: MultipleWxsFiles

 public void MultipleWxsFiles()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(WixTests.SharedAuthoringDirectory, "BasicProduct.wxs"));
     candle.SourceFiles.Add(Path.Combine(Path.Combine(InputTests.TestDataDirectory, @"MultipleWxsFiles\product.wxs")));
     candle.SourceFiles.Add(Path.Combine(Path.Combine(InputTests.TestDataDirectory, @"MultipleWxsFiles\feature.wxs")));
     candle.Run();
 }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:8,代碼來源:Input.InputTests.cs

示例15: InvalidWxsFile

 public void InvalidWxsFile()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(InputTests.TestDataDirectory, @"InvalidWxsFile\Product.wxs"));
     candle.ExpectedWixMessages.Add(new WixMessage(104, "Not a valid source file; detail: Data at the root level is invalid. Line 1, position 1.", WixMessage.MessageTypeEnum.Error));
     candle.ExpectedExitCode = 104;
     candle.Run();
 }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:8,代碼來源:Input.InputTests.cs


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