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

MSSITESS_S02_TC05_DeleteWebFailureNonExistentUrl() private méthode

private MSSITESS_S02_TC05_DeleteWebFailureNonExistentUrl ( ) : void
Résultat void
        public void MSSITESS_S02_TC05_DeleteWebFailureNonExistentUrl()
        {
            Site.Assume.IsTrue(Common.IsRequirementEnabled(3791, this.Site), @"Test is executed only when R3791Enabled is set to true.");

            #region Variables

            string webUrl = Common.GetConfigurationPropertyValue(Constants.SiteName, this.Site)
                + "/"
                + Common.GetConfigurationPropertyValue(Constants.NonExistentSiteName, this.Site);
            bool isErrorReturned = false;

            #endregion Variables

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

            try
            {
                this.sitessAdapter.DeleteWeb(webUrl);

                Site.Log.Add(LogEntryKind.Comment, "DeleteWeb succeed!");
            }
            catch (SoapException)
            {
                isErrorReturned = true;
            }

            #region Capture requirements
            // If the SOAP fault occurs, R411 can be captured.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R411, the error {0} returned.", isErrorReturned ? "is" : "is not");

            // Verify MS-SITESS requirement: MS-SITESS_R411
            Site.CaptureRequirementIfIsTrue(
                isErrorReturned,
                411,
                @"[In DeleteWeb] [The client sends a DeleteWebSoapIn request message] Otherwise [if delete the subsite unsuccessful], the server MUST return a SOAP fault that is defined in the DeleteWebResponse message.");

            // Verify that Microsoft SharePoint Foundation 2010 and above support operation DeleteWeb.
            this.VerifyOperationDeleteWeb();
            #endregion Capture requirements
        }