Microsoft.Protocols.TestSuites.MS_SITESS.S02_ManageSubSite.MSSITESS_S02_TC07_GetSiteTemplateNotInstalledLCID C# (CSharp) Méthode

MSSITESS_S02_TC07_GetSiteTemplateNotInstalledLCID() private méthode

private MSSITESS_S02_TC07_GetSiteTemplateNotInstalledLCID ( ) : void
Résultat void
        public void MSSITESS_S02_TC07_GetSiteTemplateNotInstalledLCID()
        {
            #region Variables
            uint invalidLocaleId = uint.Parse(Common.GetConfigurationPropertyValue(Constants.NotInstalledLCID, this.Site));
            Template[] templateList;
            uint getTemplateResult = 0;
            string errorCode = string.Empty;
            bool isErrorOccured = false;
            #endregion Variables

            // Initialize the web service with an authenticated account.
            this.sitessAdapter.InitializeWebService(UserAuthenticationOption.Authenticated);

            try
            {
                // Invoke the GetSiteTemplates operation with invalid parameters, soap fault or empty TemplateList is expected.
                getTemplateResult = this.sitessAdapter.GetSiteTemplates(invalidLocaleId, out templateList);
            }
            catch (SoapException e)
            {
                errorCode = Common.ExtractErrorCodeFromSoapFault(e);
                isErrorOccured = true;
                templateList = null;
            }

            #region Capture requirements
            if (Common.IsRequirementEnabled(400, this.Site))
            {
                // SharePoint Foundation 2010 returns a successful GetSiteTemplatesResponse with an empty TemplateList element
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R400, the getTemplateResult is {0}", getTemplateResult);

                // Verify MS-SITESS requirement: MS-SITESS_R400
                bool templateListEmpty = false;
                if (templateList == null)
                {
                    templateListEmpty = true;
                }
                else
                {
                    templateListEmpty = templateList.Length == 0;
                }

                bool isVerifyR400 = getTemplateResult == 0 && templateListEmpty;

                Site.CaptureRequirementIfIsTrue(
                    isVerifyR400,
                    400,
                    @"[In Appendix B: Product Behavior] <7> Section 3.1.4.5.2.2: Implementation does not return the SOAP fault. It returns a successful GetSiteTemplatesResponse with an empty TemplateList element.(Microsoft SharePoint Foundation 2010 and SharePoint Foundation 2013 follow this behavior.)");
            }

            if (Common.IsRequirementEnabled(1561, this.Site))
            {
                // If the error code is 0x81070209, MS-SITESS_R1561 can be captured.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R1561, the error code is {0}", errorCode);

                // Verify MS-SITESS requirement: MS-SITESS_R1561
                Site.CaptureRequirementIfIsTrue(
                    isErrorOccured && errorCode.Equals("0x81070209"),
                    1561,
                    @"[In GetSiteTemplatesResponse] [TemplateList:] In case the LCID included in the request message indicates a language that is not installed on the server, Implementation does return a SOAP fault with the error code [0x81070209] specified in the following table.<7> (Windows SharePoint Services 3.0, Office SharePoint Server 2007 and SharePoint Server 2016 follow this behavior.)");
            }
            #endregion Capture requirements
        }