public void MSASCMD_S03_TC04_FolderDelete_Status9() { #region Call method FolderCreate to create a new folder as a child folder of the specified parent folder. FolderCreateResponse folderCreateResponse = this.GetFolderCreateResponse(this.LastFolderSyncKey, (byte)FolderType.UserCreatedMail, Common.GenerateResourceName(Site, "FolderDelete"), "0"); Site.Assert.AreEqual <int>( 1, int.Parse(folderCreateResponse.ResponseData.Status), "The server should return a status code 1 in the FolderCreate command response to indicate success."); #endregion #region Call method FolderDelete to delete a folder from the server, and set SyncKey value to an empty string. FolderDeleteRequest folderDeleteRequest = Common.CreateFolderDeleteRequest(string.Empty, folderCreateResponse.ResponseData.ServerId); FolderDeleteResponse folderDeleteResponse = this.CMDAdapter.FolderDelete(folderDeleteRequest); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R4060"); // Verify MS-ASCMD requirement: MS-ASCMD_R4060 Site.CaptureRequirementIfAreEqual <int>( 9, int.Parse(folderDeleteResponse.ResponseData.Status), 4060, @"[In Status(FolderDelete)] [When the scope is Global], [the cause of the status value 9 is] The client sent a malformed or mismatched synchronization key [, or the synchronization state is corrupted on the server]."); #endregion #region Call method FolderDelete to delete the created folder from the server. folderDeleteRequest = Common.CreateFolderDeleteRequest(folderCreateResponse.ResponseData.SyncKey, folderCreateResponse.ResponseData.ServerId); folderDeleteResponse = this.CMDAdapter.FolderDelete(folderDeleteRequest); Site.Assert.AreEqual <int>(1, int.Parse(folderDeleteResponse.ResponseData.Status), "The created Folder should be deleted."); #endregion }
public void MSASCMD_S03_TC05_FolderDelete_Status10() { #region Call method FolderCreate to create a new folder as a child folder of the specified parent folder. FolderCreateResponse folderCreateResponse = this.GetFolderCreateResponse(this.LastFolderSyncKey, (byte)FolderType.UserCreatedMail, Common.GenerateResourceName(Site, "FolderDelete"), "0"); Site.Assert.AreEqual <int>(1, int.Parse(folderCreateResponse.ResponseData.Status), "If the FolderCreate command creates a folder successfully, server should return a status code 1."); #endregion #region Call method FolderDelete without folder SyncKey to delete a folder from the server. FolderDeleteRequest folderDeleteRequest = Common.CreateFolderDeleteRequest(null, folderCreateResponse.ResponseData.ServerId); FolderDeleteResponse folderDeleteResponse = this.CMDAdapter.FolderDelete(folderDeleteRequest); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R4063"); // Verify MS-ASCMD requirement: MS-ASCMD_R4063 Site.CaptureRequirementIfAreEqual <int>( 10, int.Parse(folderDeleteResponse.ResponseData.Status), 4063, @"[In Status(FolderDelete)] [When the scope is Global], [the cause of the status value 10 is] The client sent a FolderCreate command request (section 2.2.2.3) that contains a semantic or syntactic error."); #endregion #region Call method FolderDelete to delete the created folder from the server. folderDeleteRequest = Common.CreateFolderDeleteRequest(folderCreateResponse.ResponseData.SyncKey, folderCreateResponse.ResponseData.ServerId); folderDeleteResponse = this.CMDAdapter.FolderDelete(folderDeleteRequest); Site.Assert.AreEqual <int>(1, int.Parse(folderDeleteResponse.ResponseData.Status), "The server should return a status code 1 in the FolderDelete command response to indicate success."); #endregion }
public void MSASCMD_S03_TC03_FolderDelete_Status4() { // Call method FolderDelete to delete an invalid folder from the server. FolderDeleteRequest folderDeleteRequest = Common.CreateFolderDeleteRequest(this.LastFolderSyncKey, "InvalidServerId"); FolderDeleteResponse folderDeleteResponse = this.CMDAdapter.FolderDelete(folderDeleteRequest); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R4048"); // The server should return a status code 4 in the FolderDelete command response to indicate the specified folder does not exist. // Verify MS-ASCMD requirement: MS-ASCMD_R4048 Site.CaptureRequirementIfAreEqual <int>( 4, int.Parse(folderDeleteResponse.ResponseData.Status), 4048, @"[In Status(FolderDelete)] [When the scope is] Item, [the meaning of the status value] 4 [is] The specified folder does not exist."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R4049"); // The server should return a status code 4 in the FolderDelete command response to indicate the specified folder does not exist. // Verify MS-ASCMD requirement: MS-ASCMD_R4049 Site.CaptureRequirementIfAreEqual <int>( 4, int.Parse(folderDeleteResponse.ResponseData.Status), 4049, @"[In Status(FolderDelete)] [When the scope is Item], [the cause of the status value 4 is] The client specified a nonexistent folder in a FolderDelete command request."); }
/// <summary> /// Deletes a folder from the server. /// </summary> /// <param name="request">A FolderDeleteRequest object that contains the request information.</param> /// <returns>FolderDelete command response</returns> public FolderDeleteResponse FolderDelete(FolderDeleteRequest request) { FolderDeleteResponse response = this.activeSyncClient.FolderDelete(request); this.VerifyTransportRequirements(); this.VerifyWBXMLCapture(CommandName.FolderDelete, response); this.VerifyFolderDeleteCommand(response); return(response); }
internal FolderDeleteResponse DeleteFolder(string syncKey, string folderId) { FolderDeleteRequest folderDeleteRequest = new FolderDeleteRequest { SyncKey = syncKey, ServerId = folderId }; return(this.FolderDelete(folderDeleteRequest)); }
public void MSASCMD_S04_TC09_FolderSync_DeleteFolder() { #region The client calls FolderCreate command to create a new folder as a child folder of the specified parent folder, then server returns ServerId for FolderCreate command. string folderName = Common.GenerateResourceName(Site, "FolderSync"); FolderCreateResponse folderCreateResponse = this.GetFolderCreateResponse(this.LastFolderSyncKey, (byte)FolderType.UserCreatedMail, folderName, "0"); Site.Assert.AreEqual <int>(1, int.Parse(folderCreateResponse.ResponseData.Status), "The server should return a status code 1 in the FolderCreate command response to indicate success."); #endregion #region Changes DeviceID. this.CMDAdapter.ChangeDeviceID("NewDeviceID"); this.RecordDeviceInfoChanged(); #endregion #region Calls method FolderSync to synchronize the collection hierarchy. FolderSyncRequest folderSyncRequestForNewDeviceID = Common.CreateFolderSyncRequest("0"); FolderSyncResponse folderSyncResponseForNewDeviceID = this.CMDAdapter.FolderSync(folderSyncRequestForNewDeviceID); // Gets the server ID for new folder after change DeviceID. string serverId = TestSuiteBase.GetCollectionId(folderSyncResponseForNewDeviceID, folderName); Site.Assert.IsNotNull(serverId, "Call method GetServerId to get a non-null ServerId to indicate success."); #endregion #region The client calls FolderDelete command to delete the created folder in step 2 from the server. FolderDeleteRequest folderDeleteRequest = Common.CreateFolderDeleteRequest(folderSyncResponseForNewDeviceID.ResponseData.SyncKey, serverId); FolderDeleteResponse folderDeleteResponse = this.CMDAdapter.FolderDelete(folderDeleteRequest); Site.Assert.AreEqual <int>(1, int.Parse(folderDeleteResponse.ResponseData.Status), "The server should return a status code 1 in the FolderDelete command response to indicate success."); #endregion #region Restore DeviceID and call FolderSync command this.CMDAdapter.ChangeDeviceID(Common.GetConfigurationPropertyValue("DeviceID", this.Site)); // The client calls FolderSync command to synchronize the collection hierarchy with original device id. FolderSyncRequest folderSyncRequest = Common.CreateFolderSyncRequest(folderCreateResponse.ResponseData.SyncKey); FolderSyncResponse folderSyncResponse = this.CMDAdapter.FolderSync(folderSyncRequest); Site.Assert.AreEqual <int>(1, int.Parse(folderSyncResponse.ResponseData.Status), "Server should return status 1 in the FolderSync response to indicate success."); Site.Assert.IsNotNull(folderSyncResponse.ResponseData.Changes, "Server should return Changes element in the FolderSync response after the collection hierarchy changed by call FolderDelete command."); Site.Assert.IsNotNull(folderSyncResponse.ResponseData.Changes.Delete, "Server should return Changes element in the FolderSync response after the specified folder deleted."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R5863"); // The folderDeleteSuccess is true indicates the folder which deleted by FolderDelete command is deleted successfully. // Verify MS-ASCMD requirement: MS-ASCMD_R5863 Site.CaptureRequirementIfIsNotNull( folderSyncResponse.ResponseData.Changes.Delete[0].ServerId, 5863, @"[In Delete(FolderSync)] [The Delete element] specifies that a folder on the server was deleted since the last folder synchronization."); #endregion }
public void MSASCMD_S03_TC01_FolderDelete_Success() { #region Call method FolderCreate to create a new folder as a child folder of the specified parent folder. FolderCreateResponse folderCreateResponse = this.GetFolderCreateResponse(this.LastFolderSyncKey, (byte)FolderType.UserCreatedMail, Common.GenerateResourceName(Site, "FolderDelete"), "0"); Site.Assert.AreEqual <int>( 1, int.Parse(folderCreateResponse.ResponseData.Status), "The server should return a status code 1 in the FolderCreate command response to indicate success."); #endregion #region Call method FolderDelete to delete the created folder from the server. FolderDeleteRequest folderDeleteRequest = Common.CreateFolderDeleteRequest(folderCreateResponse.ResponseData.SyncKey, folderCreateResponse.ResponseData.ServerId); FolderDeleteResponse folderDeleteResponse = this.CMDAdapter.FolderDelete(folderDeleteRequest); Site.Assert.AreEqual <int>( 1, int.Parse(folderDeleteResponse.ResponseData.Status), "The server should return a status code 1 in the FolderDelete command response to indicate success."); #endregion #region Call method FolderSync to synchronize the collection hierarchy. FolderSyncResponse folderSyncResponse = this.FolderSync(); Site.Assert.AreEqual <int>( 1, int.Parse(folderSyncResponse.ResponseData.Status), "The server should return a status code 1 in the FolderSync command response to indicate success."); bool folderDeleteSuccess = true; foreach (FolderSyncChangesAdd add in folderSyncResponse.ResponseData.Changes.Add) { if (add.ServerId == folderCreateResponse.ResponseData.ServerId) { folderDeleteSuccess = false; break; } } // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R97"); // The folderDeleteSuccess is true indicates the folder which deleted by FolderDelete command is deleted successfully. // Verify MS-ASCMD requirement: MS-ASCMD_R97 Site.CaptureRequirementIfIsTrue( folderDeleteSuccess, 97, @"[In FolderDelete] The FolderDelete command deletes a folder from the server."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R98"); // The folderDeleteSuccess is true indicates the folder which deleted by FolderDelete command is deleted successfully. // Verify MS-ASCMD requirement: MS-ASCMD_R98 Site.CaptureRequirementIfIsTrue( folderDeleteSuccess, 98, @"[In FolderDelete] The ServerId (section 2.2.3.151.2) of the folder is passed to the server in the FolderDelete command request (section 2.2.2.3), which deletes the collection with the matching identifier."); // The folderDeleteSuccess is true indicates the folder which deleted by FolderDelete command is deleted successfully. // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R4045"); // Verify MS-ASCMD requirement: MS-ASCMD_R4045 Site.CaptureRequirementIfIsTrue( folderDeleteSuccess, 4045, @"[In Status(FolderDelete)] [When the scope is Global], [the cause of the status value 1 is] Server successfully completed command."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R5783"); // If folder has been deleted successfully, the server must send a synchronization key to the client in a response. Site.CaptureRequirementIfIsNotNull( folderDeleteResponse.ResponseData.SyncKey, 5783, @"[In SyncKey(FolderCreate, FolderDelete, and FolderUpdate)] After a successful [FolderCreate command (section 2.2.2.2),] FolderDelete command (section 2.2.2.3) [, or FolderUpdate command (section 2.2.2.5)], the server MUST send a synchronization key to the client in a response."); #endregion }
public void MSASCMD_S03_TC02_FolderDelete_Status3() { // Call method FolderDelete to delete a Calendar folder from the server. FolderDeleteRequest folderDeleteRequest = Common.CreateFolderDeleteRequest(this.LastFolderSyncKey, this.User1Information.CalendarCollectionId); FolderDeleteResponse folderDeleteResponse = this.CMDAdapter.FolderDelete(folderDeleteRequest); Site.Assert.IsNotNull(folderDeleteResponse.ResponseData, "The FolderDelete element should not be null."); Site.Assert.IsNotNull(folderDeleteResponse.ResponseData.Status, "As child element of FolderDelete, the Status should not be null."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "MS-ASCMD_R99"); // Since the FolderDelete and Status element are not null, server sends a response indicating the status of the deletion. // Verify MS-ASCMD requirement: MS-ASCMD_R99 Site.CaptureRequirement( 99, @"[In FolderDelete] The server then sends a response indicating the status of the deletion."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R101"); // The server should return a status code 3 in the FolderDelete command response to indicate the specified folder is a special folder. // Verify MS-ASCMD requirement: MS-ASCMD_R101 Site.CaptureRequirementIfAreEqual <int>( 3, int.Parse(folderDeleteResponse.ResponseData.Status), 101, @"[In FolderDelete] Attempting to delete a recipient information cache using this command results in a Status element (section 2.2.3.162.3) value of 3."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R4046"); // The server should return a status code 3 in the FolderDelete command response to indicate the specified folder is a special folder. // Verify MS-ASCMD requirement: MS-ASCMD_R4046 Site.CaptureRequirementIfAreEqual <int>( 3, int.Parse(folderDeleteResponse.ResponseData.Status), 4046, @"[In Status(FolderDelete)] [When the scope is] Item, [the meaning of the status value] 3 [is] The specified folder is a special system folder, such as the Inbox folder, Outbox folder, Contacts folder, Recipient information, or Drafts folder, and cannot be deleted by the client."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R4047"); // The server should return a status code 3 in the FolderDelete command response to indicate the specified folder is a special folder. // Verify MS-ASCMD requirement: MS-ASCMD_R4047 Site.CaptureRequirementIfAreEqual <int>( 3, int.Parse(folderDeleteResponse.ResponseData.Status), 4047, @"[In Status(FolderDelete)] [When the scope is Item], [the cause of the status value 3 is] The client specified a special folder in a FolderDelete command request (section 2.2.2.3). special folders cannot be deleted."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R4040"); // The server should return a status code 3 in the FolderDelete command response to indicate the specified folder is a special folder. // Verify MS-ASCMD requirement: MS-ASCMD_R4040 Site.CaptureRequirementIfAreEqual <int>( 3, int.Parse(folderDeleteResponse.ResponseData.Status), 4040, @"[In Status(FolderDelete)] If the command failed, the Status element in the server response contains a code indicating the type of failure."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R5785"); // If the FolderDelete command request fails, server returns a null SyncKey. // Verify MS-ASCMD requirement: MS-ASCMD_R5785 Site.CaptureRequirementIfIsNull( folderDeleteResponse.ResponseData.SyncKey, 5785, @"[In SyncKey(FolderCreate, FolderDelete, and FolderUpdate)] If the [FolderCreate command,] FolderDelete command [, or FolderUpdate command] is not successful, the server MUST NOT return a SyncKey element."); // The recipient information cache is not supported when the value of the MS-ASProtocolVersion header is set to 12.1. // MS-ASProtocolVersion header value is determined using Common PTFConfig property named ActiveSyncProtocolVersion. if ("12.1" != Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site)) { // Call method FolderDelete to delete a recipient information cache from the server. folderDeleteRequest = Common.CreateFolderDeleteRequest(this.LastFolderSyncKey, "RI"); folderDeleteResponse = this.CMDAdapter.FolderDelete(folderDeleteRequest); Site.Assert.IsNotNull(folderDeleteResponse.ResponseData, "The FolderDelete element should not be null."); Site.Assert.IsNotNull(folderDeleteResponse.ResponseData.Status, "As child element of FolderDelete, the Status should not be null."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R100"); // The server should return a status code 3 in the FolderDelete command response to indicate the specified folder is a special folder. // Verify MS-ASCMD requirement: MS-ASCMD_R100 Site.CaptureRequirementIfAreEqual <int>( 3, int.Parse(folderDeleteResponse.ResponseData.Status), 100, @"[In FolderDelete] The FolderDelete command cannot be used to delete a recipient information cache."); } }
FolderDeleteResponse IEasConnection.FolderDelete(FolderDeleteRequest folderDeleteRequest) { FolderDeleteCommand folderDeleteCommand = new FolderDeleteCommand(this.EasConnectionSettings); return(folderDeleteCommand.Execute(folderDeleteRequest)); }
private FolderDeleteResponse FolderDelete(FolderDeleteRequest folderDeleteRequest) { return(EasConnectionWrapper.WrapException <FolderDeleteResponse>(() => this.wrappedObject.FolderDelete(folderDeleteRequest), (ConnectionsTransientException e) => new EasFolderDeleteFailedTransientException(e.Message, e), (ConnectionsPermanentException e) => new EasFolderDeleteFailedPermanentException(e.Message, e))); }
/// <summary> /// Creates a FolderDeleteRequest instance using the specified information /// </summary> /// <param name="syncKey">The syncKey of this request</param> /// <param name="serverId">Specified the deleted folder's server id</param> /// <returns>A FolderDeleteRequest instance</returns> public static FolderDeleteRequest CreateFolderDeleteRequest(string syncKey, string serverId) { FolderDeleteRequest request = new FolderDeleteRequest(); Request.FolderDelete requestData = new Request.FolderDelete { SyncKey = syncKey, ServerId = serverId }; request.RequestData = requestData; return request; }
/// <summary> /// Creates an empty FolderDeleteRequest instance /// </summary> /// <returns>A FolderDeleteRequest instance</returns> public static FolderDeleteRequest CreateFolderDeleteRequest() { FolderDeleteRequest request = new FolderDeleteRequest(); Request.FolderDelete requestData = new Request.FolderDelete(); request.RequestData = requestData; return request; }
FolderDeleteResponse IEasConnection.FolderDelete(FolderDeleteRequest folderDeleteRequest) { throw new NotImplementedException(); }