1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
4
using ICSharpCode.WixBinding;
7
using System.Collections.Generic;
9
namespace WixBinding.Tests.Diff
12
public class OneNewFileTestFixture : IDirectoryReader
14
WixPackageFilesDiffResult[] diffResults;
17
public void SetUpFixture()
19
WixDocument doc = new WixDocument();
20
doc.FileName = @"C:\Projects\Setup\Setup.wxs";
21
doc.LoadXml(GetWixXml());
22
WixPackageFilesDiff diff = new WixPackageFilesDiff(this);
23
diffResults = diff.Compare(doc.GetRootDirectory());
27
public void OneDiffResultFound()
29
Assert.AreEqual(1, diffResults.Length);
33
public void DiffResultFileName()
35
Assert.AreEqual(@"C:\Projects\Setup\bin\newfile.txt", diffResults[0].FileName);
39
public void DiffResultType()
41
Assert.AreEqual(WixPackageFilesDiffResultType.NewFile, diffResults[0].DiffType);
44
public string[] GetFiles(string path)
46
return new string[] {@"license.rtf", @"newfile.txt"};
49
public string[] GetDirectories(string path)
54
public bool DirectoryExists(string path)
61
return "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\r\n" +
62
"\t<Product Name='Test' \r\n" +
63
"\t Version='1.0' \r\n" +
64
"\t Language='1013' \r\n" +
65
"\t Manufacturer='#develop' \r\n" +
66
"\t Id='????????-????-????-????-????????????'>\r\n" +
67
"\t\t<Package/>\r\n" +
68
"\t\t<Directory Id='TARGETDIR' SourceName='SourceDir'>\r\n" +
69
"\t\t\t<Directory Id='ProgramFilesFolder' Name='PFiles'>\r\n" +
70
"\t\t\t\t<Directory Id='INSTALLDIR' Name='YourApp' LongName='Your Application'>\r\n" +
71
"\t\t\t\t\t<Component Id='MyComponent' DiskId='1'>\r\n" +
72
"\t\t\t\t\t\t<File Id='LicenseFile' Name='license.rtf' Source='bin\\license.rtf' />\r\n" +
73
"\t\t\t\t\t</Component>\r\n" +
74
"\t\t\t\t</Directory>\r\n" +
75
"\t\t\t</Directory>\r\n" +
76
"\t\t</Directory>\r\n" +