Microsoft.Protocols.TestSuites.MS_SITESS.S05_ExportWorkflowTemplate.MSSITESS_S05_TC03_ExportWorkflowTemplateInvalidTemplate C# (CSharp) Méthode

MSSITESS_S05_TC03_ExportWorkflowTemplateInvalidTemplate() private méthode

        public void MSSITESS_S05_TC03_ExportWorkflowTemplateInvalidTemplate()
        {
            Site.Assume.IsTrue(Common.IsRequirementEnabled(5331, this.Site), @"Test is executed only when R5331Enabled is set to true.");

            #region Variables
            string templateName = Common.GetConfigurationPropertyValue(Constants.InvalidWorkflowTemplateName, this.Site);
            string destinationUrl = Common.GetConfigurationPropertyValue(Constants.DataPath, this.Site);
            bool isErrorOccured = false;

            #endregion Variables

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

            // Try to invoke ExportWorkflowTemplate operation with invalid template name, so an exception is expected.
            try
            {
                this.sitessAdapter.ExportWorkflowTemplate(
                    this.solutionName + Constants.WspExtension,
                    Constants.SolutionTitle,
                    Constants.SolutionDescription,
                    templateName,
                    destinationUrl);

                Site.Log.Add(LogEntryKind.Comment, "ExportWorkflowTemplate succeed!");
            }
            catch (SoapException e)
            {
                isErrorOccured = true;

                #region Capture requirements
                this.VerifySoapFault(isErrorOccured);
                this.VerifySoapFaultDetail(e);
                #endregion Capture requirements
            }

            #region Capture requirements
            // If an exception is thrown, R396 can be captured.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R396.");

            // Verify MS-SITESS requirement: MS-SITESS_R396
            bool isVerifyR396 = isErrorOccured;

            Site.CaptureRequirementIfIsTrue(
                isVerifyR396,
                396,
                @"[In ExportWorkflowTemplate] [workflowTemplateName:] If a workflow template with the specified name does not exist, the server will return a SOAP fault with an implementation-specific error code.");

            // If code can run to here, it means that Microsoft SharePoint Foundation 2010 and above support operation ExportWorkflowTemplate.
            this.VerifyOperationExportWorkflowTemplate();
            #endregion Capture requirements
        }