Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3224 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
5 changed files with 83 additions and 24 deletions
@ -0,0 +1,65 @@
@@ -0,0 +1,65 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using ICSharpCode.WixBinding; |
||||
using NUnit.Framework; |
||||
using System; |
||||
using System.Collections; |
||||
using System.Collections.Specialized; |
||||
using System.IO; |
||||
using System.Xml; |
||||
using WixBinding.Tests.PackageFiles; |
||||
using WixBinding.Tests.Utils; |
||||
|
||||
namespace WixBinding.Tests.Document |
||||
{ |
||||
/// <summary>
|
||||
/// When a duplicate component id exists and the parent directory is used any dots should
|
||||
/// be removed from the parent directory.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class GenerateComponentIdFromDirectoryWithDotsTestFixture |
||||
{ |
||||
string id = String.Empty; |
||||
|
||||
[SetUp] |
||||
public void SetUpFixture() |
||||
{ |
||||
WixDocument doc = new WixDocument(); |
||||
doc.LoadXml(GetWixXml()); |
||||
id = WixComponentElement.GenerateIdFromFileName(doc, @"C:\Projects\My.Project\MyApp.exe"); |
||||
} |
||||
|
||||
[Test] |
||||
public void IdHasDotsRemoved() |
||||
{ |
||||
Assert.AreEqual("MyProjectMyAppExe", id); |
||||
} |
||||
|
||||
static string GetWixXml() |
||||
{ |
||||
return "<Wix xmlns=\"http://schemas.microsoft.com/wix/2006/wi\">\r\n" + |
||||
"\t<Product Name=\"MySetup\" \r\n" + |
||||
"\t Manufacturer=\"\" \r\n" + |
||||
"\t Id=\"F4A71A3A-C271-4BE8-B72C-F47CC956B3AA\" \r\n" + |
||||
"\t Language=\"1033\" \r\n" + |
||||
"\t Version=\"1.0.0.0\">\r\n" + |
||||
"\t\t<Package Id=\"6B8BE64F-3768-49CA-8BC2-86A76424DFE9\"/>\r\n" + |
||||
"\t\t<Directory Id=\"TARGETDIR\" SourceName=\"SourceDir\">\r\n" + |
||||
"\t\t\t<Directory Id=\"ProgramFilesFolder\" Name=\"PFiles\">\r\n" + |
||||
"\t\t\t\t<Directory Id=\"INSTALLDIR\" Name=\"OtherFolder\">\r\n" + |
||||
"\t\t\t\t\t<Component Id=\"MyAppExe\" Guid=\"999DE542-C4A9-48DA-ACF8-09949CDCD808\" DiskId=\"1\">\r\n" + |
||||
"\t\t\t\t\t</Component>\r\n" + |
||||
"\t\t\t\t</Directory>\r\n" + |
||||
"\t\t\t</Directory>\r\n" + |
||||
"\t\t</Directory>\r\n" + |
||||
"\t</Product>\r\n" + |
||||
"</Wix>"; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue