public void MSOXWSFOLD_S02_TC02_CopyMultipleFolders() { #region Copy the "drafts" and "deleteditems" folder to inbox // Set "drafts" and "deleteditems" folders' Id. DistinguishedFolderIdType copiedFolderId1 = new DistinguishedFolderIdType(); copiedFolderId1.Id = DistinguishedFolderIdNameType.drafts; DistinguishedFolderIdType copiedFolderId2 = new DistinguishedFolderIdType(); copiedFolderId2.Id = DistinguishedFolderIdNameType.deleteditems; // CopyFolder request. CopyFolderType copyFolderRequest = this.GetCopyFolderRequest(DistinguishedFolderIdNameType.inbox.ToString(), copiedFolderId1, copiedFolderId2); // Copy the "drafts" and "deleteditems" folder. CopyFolderResponseType copyFolderResponse = this.FOLDAdapter.CopyFolder(copyFolderRequest); // Check the response. Common.CheckOperationSuccess(copyFolderResponse, 2, this.Site); // Save copied folders' id. FolderIdType folderId1 = ((FolderInfoResponseMessageType)copyFolderResponse.ResponseMessages.Items[0]).Folders[0].FolderId; FolderIdType folderId2 = ((FolderInfoResponseMessageType)copyFolderResponse.ResponseMessages.Items[1]).Folders[0].FolderId; // Save the copied folders' id. this.NewCreatedFolderIds.Add(folderId1); this.NewCreatedFolderIds.Add(folderId2); #endregion }
public void MSOXWSFOLD_S02_TC04_CopyFolderFailed() { #region Create a new folder in the inbox folder // CreateFolder request. CreateFolderType createFolderRequest = this.GetCreateFolderRequest(DistinguishedFolderIdNameType.inbox.ToString(), new string[] { "Custom Folder" }, new string[] { "IPF.MyCustomFolderClass" }, null); // Create a new folder. CreateFolderResponseType createFolderResponse = this.FOLDAdapter.CreateFolder(createFolderRequest); // Check the response. Common.CheckOperationSuccess(createFolderResponse, 1, this.Site); // Save the new created folder's folder id. FolderIdType newFolderId = ((FolderInfoResponseMessageType)createFolderResponse.ResponseMessages.Items[0]).Folders[0].FolderId; this.NewCreatedFolderIds.Add(newFolderId); #endregion #region Delete the created folder // DeleteFolder request. DeleteFolderType deleteFolderRequest = this.GetDeleteFolderRequest(DisposalType.HardDelete, newFolderId); // Delete the specified folder. DeleteFolderResponseType deleteFolderResponse = this.FOLDAdapter.DeleteFolder(deleteFolderRequest); // Check the response. Common.CheckOperationSuccess(deleteFolderResponse, 1, this.Site); // The folder has been deleted, so its folder id has disappeared. this.NewCreatedFolderIds.Remove(newFolderId); #endregion #region Copy the deleted folder // CopyFolder request. CopyFolderType copyFolderRequest = this.GetCopyFolderRequest(DistinguishedFolderIdNameType.inbox.ToString(), newFolderId); // Copy the "drafts" folder. CopyFolderResponseType copyFolderResponse = this.FOLDAdapter.CopyFolder(copyFolderRequest); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSFOLD_R185223"); this.Site.CaptureRequirementIfAreEqual <ResponseClassType>( ResponseClassType.Error, copyFolderResponse.ResponseMessages.Items[0].ResponseClass, 185223, @"[In CopyFolder Operation]An unsuccessful CopyFolder operation request returns a CopyFolderResponse element with the ResponseClass attribute of the CopyFolderResponseMessage element set to ""Error""."); #endregion }
/// <summary> /// Copy one folder into another one. /// </summary> /// <param name="request">Request of CopyFolder operation.</param> /// <returns>Response of CopyFolder operation.</returns> public CopyFolderResponseType CopyFolder(CopyFolderType request) { // Send the request and get the response. CopyFolderResponseType response = this.exchangeServiceBinding.CopyFolder(request); Site.Assert.IsNotNull(response, "If the operation is successful, the response should not be null."); if (ResponseClassType.Success == response.ResponseMessages.Items[0].ResponseClass) { this.VerifyCopyFolderResponse(this.exchangeServiceBinding.IsSchemaValidated); this.VerifyAllRelatedRequirements(this.exchangeServiceBinding.IsSchemaValidated, response); } // Verify transport type related requirement. this.VerifyTransportType(); // Verify soap version. this.VerifySoapVersion(); return(response); }
public void MSOXWSFOLD_S02_TC01_CopyFolder() { #region Copy the "drafts" folder to the inbox folder // Identify the folders to be copied. DistinguishedFolderIdType copiedFolderId = new DistinguishedFolderIdType(); copiedFolderId.Id = DistinguishedFolderIdNameType.drafts; // CopyFolder request. CopyFolderType copyFolderRequest = this.GetCopyFolderRequest(DistinguishedFolderIdNameType.inbox.ToString(), copiedFolderId); // Copy the "drafts" folder. CopyFolderResponseType copyFolderResponse = this.FOLDAdapter.CopyFolder(copyFolderRequest); // Check the response. Common.CheckOperationSuccess(copyFolderResponse, 1, this.Site); // Variable to save the folder. FolderIdType folderId = ((FolderInfoResponseMessageType)copyFolderResponse.ResponseMessages.Items[0]).Folders[0].FolderId; // Save the copied folder's folder id. this.NewCreatedFolderIds.Add(folderId); #endregion // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSFOLD_R1852"); // Verify MS-OXWSFOLD requirement: MS-OXWSFOLD_R1852 this.Site.CaptureRequirementIfAreEqual <ResponseClassType>( ResponseClassType.Success, copyFolderResponse.ResponseMessages.Items[0].ResponseClass, 1852, @"[In CopyFolder Operation]A successful CopyFolder operation request returns a CopyFolderResponse element with the ResponseClass attribute of the CopyFolderResponseMessage element set to ""Success""."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSFOLD_R185222"); // Verify MS-OXWSFOLD requirement: MS-OXWSFOLD_R185222 this.Site.CaptureRequirementIfAreEqual <ResponseCodeType>( ResponseCodeType.NoError, copyFolderResponse.ResponseMessages.Items[0].ResponseCode, 185222, @"[In CopyFolder Operation]A successful CopyFolder operation request returns a CopyFolderResponse element with the ResponseCode element of the CopyFolderResponse element set to ""NoError""."); #region Get the new copied folder // GetFolder request. GetFolderType getSubFolderRequest = this.GetGetFolderRequest(DefaultShapeNamesType.AllProperties, folderId); // Get the specified folder. GetFolderResponseType getSubFolderResponse = this.FOLDAdapter.GetFolder(getSubFolderRequest); // Check the response. Common.CheckOperationSuccess(getSubFolderResponse, 1, this.Site); #endregion // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSFOLD_R211"); // The copied folder can be gotten successfully through returned folder id, so the draft folder was copied. this.Site.CaptureRequirement( 211, @"[In m:CopyFolderType Complex Type]The CopyFolderType complex type specifies a request message to copy folders in a server database."); }
public void MSOXWSFOLD_S02_TC03_CopyPublicFolder() { Site.Assume.IsTrue(Common.IsRequirementEnabled(55501, this.Site), "Exchange 2007 and Exchange 2010 support the CopyFolder operation if either the source folder or the destination folder is a public folder"); #region Create a new public folder in the public folder root // CreateFolder request. CreateFolderType createPublicFolderRequest = this.GetCreateFolderRequest(DistinguishedFolderIdNameType.publicfoldersroot.ToString(), new string[] { "Custom Folder" }, new string[] { "IPF.MyCustomFolderClass" }, null); // Create a new public folder. CreateFolderResponseType createPublicFolderResponse = this.FOLDAdapter.CreateFolder(createPublicFolderRequest); // Check the response. Common.CheckOperationSuccess(createPublicFolderResponse, 1, this.Site); // Save the new created public folder's folder id. FolderIdType newPublicFolderId = ((FolderInfoResponseMessageType)createPublicFolderResponse.ResponseMessages.Items[0]).Folders[0].FolderId; this.NewCreatedFolderIds.Add(newPublicFolderId); #endregion #region Create a new folder in the inbox folder // CreateFolder request. CreateFolderType createFolderRequest = this.GetCreateFolderRequest(DistinguishedFolderIdNameType.inbox.ToString(), new string[] { "Custom Folder" }, new string[] { "IPF.MyCustomFolderClass" }, null); // Create a new folder. CreateFolderResponseType createFolderResponse = this.FOLDAdapter.CreateFolder(createFolderRequest); // Check the response. Common.CheckOperationSuccess(createFolderResponse, 1, this.Site); // Save the new created folder's folder id. FolderIdType newFolderId = ((FolderInfoResponseMessageType)createFolderResponse.ResponseMessages.Items[0]).Folders[0].FolderId; this.NewCreatedFolderIds.Add(newFolderId); #endregion #region Copy the public folder to the folder created in inbox // CopyFolder request. CopyFolderType copyPublicFolderRequest = this.GetCopyFolderRequest(newFolderId.Id, newPublicFolderId); // Copy the public folder. CopyFolderResponseType copyPublicFolderResponse = this.FOLDAdapter.CopyFolder(copyPublicFolderRequest); // Check the response. Common.CheckOperationSuccess(copyPublicFolderResponse, 1, this.Site); // Variable to save the folder. FolderIdType copiedPublicFolderId = ((FolderInfoResponseMessageType)copyPublicFolderResponse.ResponseMessages.Items[0]).Folders[0].FolderId; // Save the copied folder's folder id. this.NewCreatedFolderIds.Add(copiedPublicFolderId); #endregion #region Get the new copied public folder that in inbox // GetFolder request. GetFolderType getNewCopiedPulicFolderRequest = this.GetGetFolderRequest(DefaultShapeNamesType.AllProperties, copiedPublicFolderId); // Get the new copied public folder. GetFolderResponseType getNewCopiedPublicFolderResponse = this.FOLDAdapter.GetFolder(getNewCopiedPulicFolderRequest); // Check the response. Common.CheckOperationSuccess(getNewCopiedPublicFolderResponse, 1, this.Site); #endregion #region Copy the folder in inbox to the public folder created // CopyFolder request. CopyFolderType copyFolderRequest = this.GetCopyFolderRequest(newPublicFolderId.Id, newFolderId); // Copy the public folder. CopyFolderResponseType copyFolderResponse = this.FOLDAdapter.CopyFolder(copyFolderRequest); // Check the response. Common.CheckOperationSuccess(copyFolderResponse, 1, this.Site); // Variable to save the folder. FolderIdType copiedFolderId = ((FolderInfoResponseMessageType)copyFolderResponse.ResponseMessages.Items[0]).Folders[0].FolderId; // Save the copied folder's folder id. this.NewCreatedFolderIds.Add(copiedFolderId); #endregion #region Get the new copied folder that in root public folder // GetFolder request. GetFolderType getNewCopiedFolderRequest = this.GetGetFolderRequest(DefaultShapeNamesType.AllProperties, copiedFolderId); // Get the new copied folder. GetFolderResponseType getNewCopiedFolderResponse = this.FOLDAdapter.GetFolder(getNewCopiedFolderRequest); // Check the response. Common.CheckOperationSuccess(getNewCopiedFolderResponse, 1, this.Site); #endregion // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSFOLD_R55501"); // Folder can be copied successfully either when the source folder or destination folder is public folder ,so this requirement can be captured. this.Site.CaptureRequirement( 55501, @"[In Appendix C: Product Behavior] Implementation does support the CopyFolder operation if either the source folder or the destination folder is a public folder.(Exchange Server 2007 and Exchange Server 2010 follow this behavior.)"); }
public void MSOXWSFOLD_S08_TC01_AllOperationsWithAllOptionalElements() { #region Configure SOAP header this.ConfigureSOAPHeader(); #endregion #region Create new folders in the inbox folder. // CreateFolder request. CreateFolderType createFolderRequest = this.GetCreateFolderRequest( DistinguishedFolderIdNameType.inbox.ToString(), new string[] { "Custom Folder1", "Custom Folder2", "Custom Folder3", "Custom Folder4" }, new string[] { "IPF.MyCustomFolderClass", "IPF.Appointment", "IPF.Contact", "IPF.Task" }, null); // Set ExtendedProperty defined in BaseFolderType. PathToExtendedFieldType publishInAddressBook = new PathToExtendedFieldType(); // A hexadecimal tag of the extended property. publishInAddressBook.PropertyTag = "0x671E"; publishInAddressBook.PropertyType = MapiPropertyTypeType.Boolean; ExtendedPropertyType pubAddressbook = new ExtendedPropertyType(); pubAddressbook.ExtendedFieldURI = publishInAddressBook; pubAddressbook.Item = "1"; ExtendedPropertyType[] extendedProperties = new ExtendedPropertyType[1]; extendedProperties[0] = pubAddressbook; createFolderRequest.Folders[0].ExtendedProperty = extendedProperties; createFolderRequest.Folders[1].ExtendedProperty = extendedProperties; createFolderRequest.Folders[2].ExtendedProperty = extendedProperties; createFolderRequest.Folders[3].ExtendedProperty = extendedProperties; // Define a permissionSet with all optional elements PermissionSetType permissionSet = new PermissionSetType(); permissionSet.Permissions = new PermissionType[1]; permissionSet.Permissions[0] = new PermissionType(); permissionSet.Permissions[0].ReadItems = new PermissionReadAccessType(); permissionSet.Permissions[0].ReadItems = PermissionReadAccessType.FullDetails; permissionSet.Permissions[0].ReadItemsSpecified = true; permissionSet.Permissions[0].CanCreateItems = true; permissionSet.Permissions[0].CanCreateItemsSpecified = true; permissionSet.Permissions[0].CanCreateSubFolders = true; permissionSet.Permissions[0].CanCreateSubFoldersSpecified = true; permissionSet.Permissions[0].IsFolderVisible = true; permissionSet.Permissions[0].IsFolderVisibleSpecified = true; permissionSet.Permissions[0].IsFolderContact = true; permissionSet.Permissions[0].IsFolderContactSpecified = true; permissionSet.Permissions[0].IsFolderOwner = true; permissionSet.Permissions[0].IsFolderOwnerSpecified = true; permissionSet.Permissions[0].IsFolderContact = true; permissionSet.Permissions[0].IsFolderContactSpecified = true; permissionSet.Permissions[0].EditItems = new PermissionActionType(); permissionSet.Permissions[0].EditItems = PermissionActionType.All; permissionSet.Permissions[0].EditItemsSpecified = true; permissionSet.Permissions[0].DeleteItems = new PermissionActionType(); permissionSet.Permissions[0].DeleteItems = PermissionActionType.All; permissionSet.Permissions[0].DeleteItemsSpecified = true; permissionSet.Permissions[0].PermissionLevel = new PermissionLevelType(); permissionSet.Permissions[0].PermissionLevel = PermissionLevelType.Custom; permissionSet.Permissions[0].UserId = new UserIdType(); permissionSet.Permissions[0].UserId.PrimarySmtpAddress = Common.GetConfigurationPropertyValue("User2Name", this.Site) + "@" + Common.GetConfigurationPropertyValue("Domain", this.Site); // Set PermissionSet for FolderType folder. ((FolderType)createFolderRequest.Folders[0]).PermissionSet = permissionSet; // Set PermissionSet for ContactsType folder. ((ContactsFolderType)createFolderRequest.Folders[2]).PermissionSet = permissionSet; // Set PermissionSet for TasksFolderType folder. ((TasksFolderType)createFolderRequest.Folders[3]).PermissionSet = permissionSet; // Create a new folder. CreateFolderResponseType createFolderResponse = this.FOLDAdapter.CreateFolder(createFolderRequest); // Check the response. Common.CheckOperationSuccess(createFolderResponse, 4, this.Site); // Folder ids. FolderIdType[] folderIds = new FolderIdType[createFolderResponse.ResponseMessages.Items.Length]; for (int index = 0; index < createFolderResponse.ResponseMessages.Items.Length; index++) { Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, createFolderResponse.ResponseMessages.Items[index].ResponseClass, "Folder should be created successfully!"); // Save folder ids. folderIds[index] = ((FolderInfoResponseMessageType)createFolderResponse.ResponseMessages.Items[index]).Folders[0].FolderId; // Save the new created folder's folder id. this.NewCreatedFolderIds.Add(folderIds[index]); } #endregion #region Create a managedfolder CreateManagedFolderRequestType createManagedFolderRequest = this.GetCreateManagedFolderRequest(Common.GetConfigurationPropertyValue("ManagedFolderName1", this.Site)); // Add an email address into request. EmailAddressType mailBox = new EmailAddressType() { EmailAddress = Common.GetConfigurationPropertyValue("User1Name", this.Site) + "@" + Common.GetConfigurationPropertyValue("Domain", this.Site) }; createManagedFolderRequest.Mailbox = mailBox; // Create the specified managed folder. CreateManagedFolderResponseType createManagedFolderResponse = this.FOLDAdapter.CreateManagedFolder(createManagedFolderRequest); // Check the response. Common.CheckOperationSuccess(createManagedFolderResponse, 1, this.Site); // Save the new created managed folder's folder id. FolderIdType newFolderId = ((FolderInfoResponseMessageType)createManagedFolderResponse.ResponseMessages.Items[0]).Folders[0].FolderId; this.NewCreatedFolderIds.Add(newFolderId); #endregion #region Get the new created folders // GetFolder request. GetFolderType getCreatedFolderRequest = this.GetGetFolderRequest(DefaultShapeNamesType.AllProperties, folderIds); // Get the new created folder. GetFolderResponseType getCreatedFolderResponse = this.FOLDAdapter.GetFolder(getCreatedFolderRequest); // Check the response. Common.CheckOperationSuccess(getCreatedFolderResponse, 4, this.Site); for (int index = 0; index < getCreatedFolderResponse.ResponseMessages.Items.Length; index++) { Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, getCreatedFolderResponse.ResponseMessages.Items[index].ResponseClass, "Folder information should be returned!"); } #endregion #region Update the new created folders // UpdateFolder request. UpdateFolderType updateFolderRequest = this.GetUpdateFolderRequest( new string[] { "Folder", "CalendarFolder", "ContactsFolder", "TasksFolder" }, new string[] { "SetFolderField", "SetFolderField", "SetFolderField", "SetFolderField" }, folderIds); // Update the folders' properties. UpdateFolderResponseType updateFolderResponse = this.FOLDAdapter.UpdateFolder(updateFolderRequest); // Check the response. Common.CheckOperationSuccess(updateFolderResponse, 4, this.Site); for (int index = 0; index < updateFolderResponse.ResponseMessages.Items.Length; index++) { Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, updateFolderResponse.ResponseMessages.Items[index].ResponseClass, "Folder should be updated successfully!"); } #endregion #region Copy the updated folders to "drafts" folder // Copy the folders into "drafts" folder CopyFolderType copyFolderRequest = this.GetCopyFolderRequest(DistinguishedFolderIdNameType.drafts.ToString(), folderIds); // Copy the folders. CopyFolderResponseType copyFolderResponse = this.FOLDAdapter.CopyFolder(copyFolderRequest); // Check the response. Common.CheckOperationSuccess(copyFolderResponse, 4, this.Site); // Copied Folders' id. FolderIdType[] copiedFolderIds = new FolderIdType[copyFolderResponse.ResponseMessages.Items.Length]; for (int index = 0; index < copyFolderResponse.ResponseMessages.Items.Length; index++) { Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, copyFolderResponse.ResponseMessages.Items[index].ResponseClass, "Folder should be updated successfully!"); // Variable to save the folders. copiedFolderIds[index] = ((FolderInfoResponseMessageType)copyFolderResponse.ResponseMessages.Items[index]).Folders[0].FolderId; // Save the copied folders' folder id. this.NewCreatedFolderIds.Add(copiedFolderIds[index]); } #endregion #region Move the updated folders to "deleteditems" folder // MoveFolder request. MoveFolderType moveFolderRequest = new MoveFolderType(); // Set the request's folderId field. moveFolderRequest.FolderIds = folderIds; // Set the request's destFolderId field. DistinguishedFolderIdType toFolderId = new DistinguishedFolderIdType(); toFolderId.Id = DistinguishedFolderIdNameType.deleteditems; moveFolderRequest.ToFolderId = new TargetFolderIdType(); moveFolderRequest.ToFolderId.Item = toFolderId; // Move the specified folders. MoveFolderResponseType moveFolderResponse = this.FOLDAdapter.MoveFolder(moveFolderRequest); // Check the response. Common.CheckOperationSuccess(moveFolderResponse, 4, this.Site); for (int index = 0; index < moveFolderResponse.ResponseMessages.Items.Length; index++) { Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, moveFolderResponse.ResponseMessages.Items[index].ResponseClass, "Folder should be updated successfully!"); } #endregion #region Delete all folders // All folder ids. FolderIdType[] allFolderIds = new FolderIdType[folderIds.Length + copiedFolderIds.Length]; for (int index = 0; index < allFolderIds.Length / 2; index++) { allFolderIds[index] = folderIds[index]; allFolderIds[index + folderIds.Length] = copiedFolderIds[index]; } // DeleteFolder request. DeleteFolderType deleteFolderRequest = this.GetDeleteFolderRequest(DisposalType.HardDelete, allFolderIds); // Delete the specified folder. DeleteFolderResponseType deleteFolderResponse = this.FOLDAdapter.DeleteFolder(deleteFolderRequest); // Check the response. Common.CheckOperationSuccess(deleteFolderResponse, 8, this.Site); for (int index = 0; index < deleteFolderResponse.ResponseMessages.Items.Length; index++) { Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, deleteFolderResponse.ResponseMessages.Items[index].ResponseClass, "Folder should be updated successfully!"); } #endregion }
public void MSOXWSFOLD_S08_TC02_AllOperationsWithoutAllOptionalElements() { #region Create new folders in the inbox folder. // CreateFolder request. CreateFolderType createFolderRequest = this.GetCreateFolderRequest( DistinguishedFolderIdNameType.inbox.ToString(), new string[] { "Custom Folder1", "Custom Folder2", "Custom Folder3", "Custom Folder4" }, new string[] { "IPF.MyCustomFolderClass", "IPF.Appointment", "IPF.Contact", "IPF.Task" }, null); // Remove FolderClass for FolderType folder. createFolderRequest.Folders[0].FolderClass = null; // Create a new folder. CreateFolderResponseType createFolderResponse = this.FOLDAdapter.CreateFolder(createFolderRequest); // Check the response. Common.CheckOperationSuccess(createFolderResponse, 4, this.Site); // Folder ids. FolderIdType[] folderIds = new FolderIdType[createFolderResponse.ResponseMessages.Items.Length]; for (int index = 0; index < createFolderResponse.ResponseMessages.Items.Length; index++) { Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, createFolderResponse.ResponseMessages.Items[index].ResponseClass, "Folder should be created successfully!"); // Save folder ids. folderIds[index] = ((FolderInfoResponseMessageType)createFolderResponse.ResponseMessages.Items[index]).Folders[0].FolderId; // Save the new created folder's folder id. this.NewCreatedFolderIds.Add(folderIds[index]); } #endregion #region Create a managedfolder CreateManagedFolderRequestType createManagedFolderRequest = this.GetCreateManagedFolderRequest(Common.GetConfigurationPropertyValue("ManagedFolderName1", this.Site)); // Create the specified managed folder. CreateManagedFolderResponseType createManagedFolderResponse = this.FOLDAdapter.CreateManagedFolder(createManagedFolderRequest); // Check the response. Common.CheckOperationSuccess(createManagedFolderResponse, 1, this.Site); // Save the new created managed folder's folder id. FolderIdType newManagedFolderId = ((FolderInfoResponseMessageType)createManagedFolderResponse.ResponseMessages.Items[0]).Folders[0].FolderId; this.NewCreatedFolderIds.Add(newManagedFolderId); #endregion #region Get the new created folders // GetFolder request. GetFolderType getCreatedFolderRequest = this.GetGetFolderRequest(DefaultShapeNamesType.AllProperties, folderIds); // Get the new created folder. GetFolderResponseType getCreatedFolderResponse = this.FOLDAdapter.GetFolder(getCreatedFolderRequest); // Check the response. Common.CheckOperationSuccess(getCreatedFolderResponse, 4, this.Site); for (int index = 0; index < getCreatedFolderResponse.ResponseMessages.Items.Length; index++) { Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, getCreatedFolderResponse.ResponseMessages.Items[index].ResponseClass, "Folder information should be returned!"); } #endregion #region Update the new created folders // UpdateFolder request. UpdateFolderType updateFolderRequest = this.GetUpdateFolderRequest( new string[] { "Folder", "CalendarFolder", "ContactsFolder", "TasksFolder" }, new string[] { "SetFolderField", "SetFolderField", "SetFolderField", "SetFolderField" }, folderIds); // Update the folders' properties. UpdateFolderResponseType updateFolderResponse = this.FOLDAdapter.UpdateFolder(updateFolderRequest); // Check the response. Common.CheckOperationSuccess(updateFolderResponse, 4, this.Site); for (int index = 0; index < updateFolderResponse.ResponseMessages.Items.Length; index++) { Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, updateFolderResponse.ResponseMessages.Items[index].ResponseClass, "Folder should be updated successfully!"); } #endregion #region Copy the updated folders to "drafts" folder // Copy the folders into "drafts" folder CopyFolderType copyFolderRequest = this.GetCopyFolderRequest(DistinguishedFolderIdNameType.drafts.ToString(), folderIds); // Copy the folders. CopyFolderResponseType copyFolderResponse = this.FOLDAdapter.CopyFolder(copyFolderRequest); // Check the response. Common.CheckOperationSuccess(copyFolderResponse, 4, this.Site); // Copied folders' id. FolderIdType[] copiedFolderIds = new FolderIdType[copyFolderResponse.ResponseMessages.Items.Length]; for (int index = 0; index < copyFolderResponse.ResponseMessages.Items.Length; index++) { Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, copyFolderResponse.ResponseMessages.Items[index].ResponseClass, "Folder should be updated successfully!"); // Variable to save the folders. copiedFolderIds[index] = ((FolderInfoResponseMessageType)copyFolderResponse.ResponseMessages.Items[index]).Folders[0].FolderId; // Save the copied folders' folder id. this.NewCreatedFolderIds.Add(copiedFolderIds[index]); } #endregion #region Move the updated folders to "deleteditems" folder // MoveFolder request. MoveFolderType moveFolderRequest = new MoveFolderType(); // Set the request's folderId field. moveFolderRequest.FolderIds = folderIds; // Set the request's destFolderId field. DistinguishedFolderIdType toFolderId = new DistinguishedFolderIdType(); toFolderId.Id = DistinguishedFolderIdNameType.deleteditems; moveFolderRequest.ToFolderId = new TargetFolderIdType(); moveFolderRequest.ToFolderId.Item = toFolderId; // Move the specified folders. MoveFolderResponseType moveFolderResponse = this.FOLDAdapter.MoveFolder(moveFolderRequest); // Check the response. Common.CheckOperationSuccess(moveFolderResponse, 4, this.Site); for (int index = 0; index < moveFolderResponse.ResponseMessages.Items.Length; index++) { Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, moveFolderResponse.ResponseMessages.Items[index].ResponseClass, "Folder should be updated successfully!"); } #endregion #region Delete all folders // All folder ids. FolderIdType[] allFolderIds = new FolderIdType[folderIds.Length + copiedFolderIds.Length]; for (int index = 0; index < allFolderIds.Length / 2; index++) { allFolderIds[index] = folderIds[index]; allFolderIds[index + folderIds.Length] = copiedFolderIds[index]; } // DeleteFolder request. DeleteFolderType deleteFolderRequest = this.GetDeleteFolderRequest(DisposalType.HardDelete, allFolderIds); // Delete the specified folder. DeleteFolderResponseType deleteFolderResponse = this.FOLDAdapter.DeleteFolder(deleteFolderRequest); // Check the response. Common.CheckOperationSuccess(deleteFolderResponse, 8, this.Site); for (int index = 0; index < deleteFolderResponse.ResponseMessages.Items.Length; index++) { Site.Assert.AreEqual <ResponseClassType>(ResponseClassType.Success, deleteFolderResponse.ResponseMessages.Items[index].ResponseClass, "Folder should be updated successfully!"); } #endregion }