public void MSSITESS_S05_TC02_ExportWorkflowTemplateInvalidLibrary()
{
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.WorkflowTemplateName, this.Site);
string libraryName = Common.GetConfigurationPropertyValue(Constants.InvalidLibraryName, this.Site);
string destinationUrl = Common.GetConfigurationPropertyValue(Constants.SiteCollectionPath, this.Site) + "/" + libraryName;
bool isErrorOccured = false;
string errorCode = string.Empty;
#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;
errorCode = Common.ExtractErrorCodeFromSoapFault(e);
#region Capture requirements
// Verify errorCode when soap exception is thrown.
this.VerifySoapFault(isErrorOccured);
this.VerifySoapFaultDetail(e);
#endregion Capture requirements
}
#region Capture requirements
// If an exception is thrown, R397 can be captured.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R397, the error code is {0}", errorCode);
// Verify MS-SITESS requirement: MS-SITESS_R397
bool isVerifyR397 = isErrorOccured && string.IsNullOrEmpty(errorCode);
Site.CaptureRequirementIfIsTrue(
isVerifyR397,
397,
@"[In ExportWorkflowTemplate] [destinationListUrl:] If a document library with the specified name does not exist, the server MUST return a SOAP fault with no 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
}