コード例 #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);
        }
コード例 #2
0
        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);
        }
コード例 #3
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);
        }