本文整理汇总了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();
}
示例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();
}
}
示例3: NoPedanticSwitch
public void NoPedanticSwitch()
{
Candle candle = new Candle();
candle.Pedantic = false;
candle.SourceFiles.Add(PedanticTests.TestFile);
candle.Run();
}
示例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();
}
示例5: NoErrorOnSpecifyingMinSizeInFileSearch
public void NoErrorOnSpecifyingMinSizeInFileSearch()
{
Candle candle = new Candle();
candle.SourceFiles.Add(Path.Combine(RegressionTests.TestDataDirectory,@"NoErrorOnSpecifyingMinSizeInFileSearch\FileSearch.wxs"));
candle.ExpectedExitCode = 0;
candle.Run();
}
示例6: SuppressAllWarningsSwitch
public void SuppressAllWarningsSwitch()
{
Candle candle = new Candle();
candle.SourceFiles.Add(testFile);
candle.SuppressAllWarnings = true;
candle.Run();
}
示例7: ShortcutDirectoryNotSet
public void ShortcutDirectoryNotSet()
{
Candle candle = new Candle();
candle.SourceFiles.Add(Path.Combine(RegressionTests.TestDataDirectory, @"ShortcutDirectoryNotSet\ShortcutProduct.wxs"));
candle.ExpectedExitCode = 0;
candle.Run();
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}