public void TestKnownId() { var parameters = new WixBuilderParameters { Features = new[] { new Feature { Id = "ApplicationFiles", Title = "All Files", Description = "All Files", Content = new Content { Include = @"**/*" } } }, KnownIds = new[] { new KnownId { Id = "foo", Path = "Bin/foo.exe" } } }; var document = WixDocumentFor(parameters); var fileWithKnownId = (from file in document.Files where file.Id == "foo" select file).AssertSingle(); WixAssert.AssertFile(DirectoryFromRoot("Bin")["foo.exe"], fileWithKnownId); }
public void TestSingleFeatureComponents() { var parameters = new WixBuilderParameters { Features = new[] { new Feature { Id = "ApplicationFiles", Title = "Documentation", Description = "all the docs", Content = new Content { Include = @"Doc\*.*" } } } }; WixDocument wix = WixDocumentFor(parameters); WixFeature featureElement = wix.Features.AssertSingle(); Feature expectedFeature = parameters.Features[0]; WixAssert.AssertFeature(expectedFeature, featureElement); string componentRef = featureElement.ComponentReferences.AssertSingle(); WixComponent docComponent = wix.ResolveComponentReference(componentRef); WixAssert.AssertDirectoryComponent(DirectoryFromRoot("Doc"), docComponent); }
public void TestFeaturesReferencesCorrectComponents() { WixDocument wix = WixDocumentFor(ParametersForMultipleFeaturesTest()); Assert.AreEqual(2, wix.Features.Count()); WixFeature wixFeature = wix.Features.Where(feature => feature.Id == "Documentation").AssertSingle(); string componentRef = wixFeature.ComponentReferences.AssertSingle(); WixComponent component = wix.ResolveComponentReference(componentRef); WixAssert.AssertDirectoryComponent(DirectoryFromRoot("Doc"), component); }
public void TestMultipleEmptyFolders() { var parameters = new WixBuilderParameters { Features = new[] { new Feature { Id = "ApplicationFiles", Title = "Documentation", Description = "all the docs", Content = new Content { Include = @"native\**\*.*" } } } }; WixDocument wix = WixDocumentFor(parameters); WixFeature featureElement = wix.Features.AssertSingle(); Feature expectedFeature = parameters.Features[0]; WixAssert.AssertFeature(expectedFeature, featureElement); string componentRef = featureElement.ComponentReferences.AssertSingle(); WixComponent configComponent = wix.ResolveComponentReference(componentRef); WixAssert.AssertDirectoryComponent(DirectoryFromRoot("native/Db4objects.Db4o/Config"), configComponent); WixDirectory configDirectory = configComponent.ParentElement.ToWix <WixDirectory>(); Assert.AreEqual(DirectoryFromRoot("native/Db4objects.Db4o/Config").Name, configDirectory.Name); Assert.AreEqual(DirectoryFromRoot("native/Db4objects.Db4o").Name, configDirectory.ParentElement.ToWix <WixDirectory>().Name); Assert.AreEqual(DirectoryFromRoot("native").Name, configDirectory.ParentElement.ToWix <WixDirectory>().ParentElement.ToWix <WixDirectory>().Name); }