Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }