Esempio n. 1
0
        internal void SiteCollectionNavigation(string url)
        {
            using (var cc = TestCommon.CreateClientContext(url))
            {
                // Publishing needs to be activated for this test and we need a termset to be present
                ImplementPrerequisites(cc);

                #region Managed_Structural
                // Retrieved target xml data is not matching with source xml navigation types so changing navigation settings to get correct data.
                ChangeNavigationSettings(cc, StandardNavigationSource.TaxonomyProvider, StandardNavigationSource.PortalProvider);

                var result             = TestProvisioningTemplate(cc, "navigation_add_1605.xml", Handlers.Navigation);
                NavigationValidator nv = new NavigationValidator();
                nv.SchemaVersion = XMLConstants.PROVISIONING_SCHEMA_NAMESPACE_2016_05;
                Assert.IsTrue(nv.Validate(result.SourceTemplate.Navigation, result.TargetTemplate.Navigation, result.SourceTokenParser));
                #endregion

                #region Structural_Managed
                ChangeNavigationSettings(cc, StandardNavigationSource.PortalProvider, StandardNavigationSource.TaxonomyProvider);

                var result2             = TestProvisioningTemplate(cc, "navigation_add2_1605.xml", Handlers.Navigation);
                NavigationValidator nv2 = new NavigationValidator();
                nv2.SchemaVersion = XMLConstants.PROVISIONING_SCHEMA_NAMESPACE_2016_05;
                Assert.IsTrue(nv2.Validate(result2.SourceTemplate.Navigation, result2.TargetTemplate.Navigation, result2.SourceTokenParser));
                #endregion
            }
        }
Esempio n. 2
0
        internal void WebNavigation(string url)
        {
            using (var cc = TestCommon.CreateClientContext(url))
            {
                // Publishing needs to be activated for this test and we need a termset to be present
                ImplementPrerequisites(cc);

                #region Managed_Structural
                // Retrieved target xml data is not matching with source xml navigation types so changing navigation settings to get correct data.
                ChangeNavigationSettings(cc, StandardNavigationSource.TaxonomyProvider, StandardNavigationSource.PortalProvider);

                // Explicitely clear out the base template for this test as otherwise we're not getting any results back
                ProvisioningTemplateCreationInformation ptci = new ProvisioningTemplateCreationInformation(cc.Web)
                {
                    BaseTemplate      = null,
                    HandlersToProcess = Handlers.Navigation,
                };

                var result             = TestProvisioningTemplate(cc, "navigation_add_1605.xml", Handlers.Navigation, null, ptci);
                NavigationValidator nv = new NavigationValidator
                {
                    SchemaVersion = XMLConstants.PROVISIONING_SCHEMA_NAMESPACE_2016_05
                };
                Assert.IsTrue(nv.Validate(result.SourceTemplate.Navigation, result.TargetTemplate.Navigation, result.SourceTokenParser));
                #endregion

                #region Structural_Managed
                ChangeNavigationSettings(cc, StandardNavigationSource.PortalProvider, StandardNavigationSource.TaxonomyProvider);

                var result2             = TestProvisioningTemplate(cc, "navigation_add2_1605.xml", Handlers.Navigation, null, ptci);
                NavigationValidator nv2 = new NavigationValidator
                {
                    SchemaVersion = XMLConstants.PROVISIONING_SCHEMA_NAMESPACE_2016_05
                };
                Assert.IsTrue(nv2.Validate(result2.SourceTemplate.Navigation, result2.TargetTemplate.Navigation, result2.SourceTokenParser));
                #endregion

                #region Inherit_Structural
                ChangeNavigationSettings(cc, StandardNavigationSource.InheritFromParentWeb, StandardNavigationSource.PortalProvider);

                var result3             = TestProvisioningTemplate(cc, "navigation_add3_1605.xml", Handlers.Navigation, null, ptci);
                NavigationValidator nv3 = new NavigationValidator
                {
                    SchemaVersion = XMLConstants.PROVISIONING_SCHEMA_NAMESPACE_2016_05
                };
                Assert.IsTrue(nv3.Validate(result3.SourceTemplate.Navigation, result3.TargetTemplate.Navigation, result3.SourceTokenParser));
                #endregion
            }
        }