Microsoft.Protocols.TestSuites.MS_OXCFOLD.S02_MessageRopOperations.MSOXCFOLD_S02_TC09_RopHardDeleteMessagesFailure C# (CSharp) Method

MSOXCFOLD_S02_TC09_RopHardDeleteMessagesFailure() private method

private MSOXCFOLD_S02_TC09_RopHardDeleteMessagesFailure ( ) : void
return void
        public void MSOXCFOLD_S02_TC09_RopHardDeleteMessagesFailure()
        {
            this.CheckWhetherSupportTransport();
            this.Adapter.DoConnect(ConnectionType.PrivateMailboxServer);
            this.GenericFolderInitialization();

            #region Step 1. Create a message in the root folder.
            uint messageHandle = 0;
            ulong messageId = 0;
            this.CreateSaveMessage(this.RootFolderHandle, this.RootFolderId, ref messageId, ref messageHandle);
            #endregion

            #region Step 2. Hard delete the message created in step 1 with a logon object handle.
            ulong[] messageIds = new ulong[] { messageId };

            RopHardDeleteMessagesRequest hardDeleteMessagesRequest = new RopHardDeleteMessagesRequest
            {
                RopId = (byte)RopId.RopHardDeleteMessages,
                LogonId = Constants.CommonLogonId,
                InputHandleIndex = Constants.CommonInputHandleIndex,
                WantAsynchronous = 0x00,
                NotifyNonRead = 0x00,
                MessageIdCount = (ushort)messageIds.Length,
                MessageIds = messageIds
            };

            // Use logon object handle to hard-delete message is purposed to get error code ecNotSupported [0x80040102].  
            RopHardDeleteMessagesResponse hardDeleteMessagesResponse = this.Adapter.HardDeleteMessages(hardDeleteMessagesRequest, this.LogonHandle, ref this.responseHandles);

            #region Verify MS-OXCFOLD_R644 and MS-OXCFOLD_R645.

            // Add the debug information.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R644");

            // Verify MS-OXCFOLD requirement: MS-OXCFOLD_R644.
            Site.CaptureRequirementIfAreEqual<uint>(
                0x80040102,
                hardDeleteMessagesResponse.ReturnValue,
                644,
                @"[In Processing a RopHardDeleteMessages ROP Request]The value of error code ecNotSupported is 0x80040102.");

            // Add the debug information.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R645");

            // The MS-OXCFOLD_R644 captured error code [ecNotSupported], capture this requirement directly.
            Site.CaptureRequirement(
                645,
                @"[In Processing a RopHardDeleteMessages ROP Request] When the error code is ecNotSupported, it indicates that the object that this ROP [RopHardDeleteMessages ROP] was called on is not a Folder object.");
            #endregion
            #endregion
        }