Microsoft.Protocols.TestSuites.MS_WOPI.TestSuiteHelper.MergeWOPIPtfConfigFiles C# (CSharp) Method

MergeWOPIPtfConfigFiles() public static method

This method is used to merge the configuration of the WOPI PTF configuration files.
public static MergeWOPIPtfConfigFiles ( ITestSite siteInstance ) : void
siteInstance ITestSite A parameter represents the site.
return void
        public static void MergeWOPIPtfConfigFiles(ITestSite siteInstance)
        {
            if (!hasMergeWOPIPtfConfigFile)
            {
                // Set the default short name for WOPI.
                siteInstance.DefaultProtocolDocShortName = WopiProtocolShortName;

                // Merge the common configuration.
                string conmmonConfigFileName = Common.GetConfigurationPropertyValue("CommonConfigurationFileName", siteInstance);
                Common.MergeGlobalConfig(conmmonConfigFileName, siteInstance);

                // Merge the SHOULDMAY configuration
                Common.MergeSHOULDMAYConfig(siteInstance);
                hasMergeWOPIPtfConfigFile = true;
            }
        }

Usage Example

Example #1
0
        /// <summary>
        /// A method is used to verify whether test suite run in support products. If the value of "SutVersion" property in common configuration file is not included in "SupportProducts" property in "MS-WOPI_TestSuite.deployment.ptfconfig", the "MS-WOPI_Supported" SHOULDMAY property will always equal to false. And the unsupported initialization logic will not be executed in unsupported products.
        /// </summary>
        /// <param name="siteInstance">A parameter represents the site instance.</param>
        /// <returns>Return 'true' indicating the test suite is running in support products. The initialization logics should be performed.</returns>
        public static bool VerifyRunInSupportProducts(ITestSite siteInstance)
        {
            if (null == siteInstance)
            {
                throw new ArgumentNullException("siteInstance");
            }

            TestSuiteHelper.MergeWOPIPtfConfigFiles(siteInstance);
            return(Common.GetConfigurationPropertyValue <bool>("MS-WOPI_Supported", siteInstance));
        }