public void MSOXCFOLD_S04_TC06_RopCopyPublicFolder()
        {
            if (!Common.IsRequirementEnabled(19702002, this.Site))
            {
                this.NeedCleanup = false;
                Site.Assert.Inconclusive("The server does not support the RopCopyFolder ROP ([MS-OXCROPS] section 2.2.4.8) for public folders.");
            }

            this.CheckWhetherSupportTransport();
            this.Logon();
            this.PublicFolderInitialization();

            #region Step 1. The client calls RopCreateFolder to create [MSOXCFOLDSubfolder1] under the root public folder.

            RopCreateFolderRequest createFolderRequest = new RopCreateFolderRequest
            {
                RopId = (byte)RopId.RopCreateFolder,
                LogonId = Constants.CommonLogonId,
                InputHandleIndex = Constants.CommonInputHandleIndex,
                OutputHandleIndex = Constants.CommonOutputHandleIndex,
                FolderType = (byte)FolderType.Genericfolder,
                UseUnicodeStrings = 0x0,
                OpenExisting = 0x01,
                Reserved = 0x0,
                DisplayName = Encoding.ASCII.GetBytes(Constants.Subfolder1),
                Comment = Encoding.ASCII.GetBytes(Constants.Subfolder1)
            };

            RopCreateFolderResponse createFolderResponse = this.Adapter.CreateFolder(createFolderRequest, this.publicRootFolderHandle, ref this.responseHandles);
            Site.Assert.AreEqual<uint>(0, createFolderResponse.ReturnValue, "RopCreateFolder ROP operation performs should successfully.");
            uint subfolderHandle1 = this.responseHandles[0][createFolderResponse.OutputHandleIndex];

            #endregion

            #region Step 2. The client calls RopCreateFolder to create [MSOXCFOLDSubfolder2] under the root public folder.

            createFolderRequest.DisplayName = Encoding.ASCII.GetBytes(Constants.Subfolder2);
            createFolderRequest.Comment = Encoding.ASCII.GetBytes(Constants.Subfolder2);

            createFolderResponse = this.Adapter.CreateFolder(createFolderRequest, this.publicRootFolderHandle, ref this.responseHandles);
            Site.Assert.AreEqual<uint>(0, createFolderResponse.ReturnValue, "RopCreateFolder ROP operation performs should successfully.");
            ulong subfolderId2 = createFolderResponse.FolderId;

            #endregion

            #region Step 3. The client calls RopCopyFolder to copy the [MSOXCFOLDSubfolder2] from the root public folder to [MSOXCFOLDSubfolder1].
            // Initialize a server object handle table.
            List<uint> handleList = new List<uint>
            {
                this.publicRootFolderHandle, subfolderHandle1
            };

            RopCopyFolderRequest copyFolderRequest = new RopCopyFolderRequest
            {
                RopId = (byte)RopId.RopCopyFolder,
                LogonId = Constants.CommonLogonId,
                SourceHandleIndex = 0x00,
                DestHandleIndex = 0x01,
                WantAsynchronous = 0x00,
                UseUnicode = 0x00,
                WantRecursive = 0xFF,
                FolderId = subfolderId2,
                NewFolderName = Encoding.ASCII.GetBytes(Constants.Subfolder3)
            };

            RopCopyFolderResponse copyFolderResponse = this.Adapter.CopyFolder(copyFolderRequest, handleList, ref this.responseHandles);

            Site.Assert.AreEqual<uint>(Constants.SuccessCode, copyFolderResponse.ReturnValue, "RopCopyFolder ROP operation performs successful!");
            handleList.Clear();

            #endregion

            #region Step 4. The client calls RopGetHierarchyTable to retrieve the hierarchy table of [MSOXCFOLDSubfolder1].

            RopGetHierarchyTableRequest getHierarchyTableRequest = new RopGetHierarchyTableRequest
            {
                RopId = (byte)RopId.RopGetHierarchyTable,
                LogonId = Constants.CommonLogonId,
                InputHandleIndex = Constants.CommonInputHandleIndex,
                OutputHandleIndex = Constants.CommonOutputHandleIndex,
                TableFlags = (byte)FolderTableFlags.None
            };

            RopGetHierarchyTableResponse getHierarchyTableResponse = this.Adapter.GetHierarchyTable(getHierarchyTableRequest, subfolderHandle1, ref this.responseHandles);
            Site.Assert.AreEqual<uint>(Constants.SuccessCode, getHierarchyTableResponse.ReturnValue, "RopGetHierarchyTable ROP operation performs successfully!");

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

            // Verify MS-OXCFOLD requirement: MS-OXCFOLD_R19702002
            Site.CaptureRequirementIfAreEqual<uint>(
                1,
                getHierarchyTableResponse.RowCount,
                19702002,
                @"[In Appendix A: Product Behavior] Implementation does support the  RopCopyFolder ROP ([MS-OXCROPS] section 2.2.4.8) for public folders. (Microsoft Exchange Server 2007 and Microsoft Exchange Server 2010 follow this behavior.)");

            #endregion
        }
        /// <summary>
        /// Creates a new folder on the destination parent folder, copying the properties and content of the source folder to the new folder.
        /// </summary>
        /// <param name="ropCopyFolderRequest">RopCopyFolderRequest object.</param>
        /// <param name="insideObjHandle">Server object handles in RopCopyFolderRequest.</param>
        /// <param name="responseSOHTable">Server objects handles in RopCopyFolderResponse.</param>
        /// <returns>RopCopyFolderResponse object.</returns>
        public RopCopyFolderResponse CopyFolder(RopCopyFolderRequest ropCopyFolderRequest, List<uint> insideObjHandle, ref List<List<uint>> responseSOHTable)
        {
            object temp = new object();
            this.ExcuteRopCall((ISerializable)ropCopyFolderRequest, insideObjHandle, ref temp, ref responseSOHTable, ref this.rawData);
            RopCopyFolderResponse ropCopyFolderResponse = (RopCopyFolderResponse)temp;

            #region Capture Code
            // The ReturnValue equal to 0x00000000 indicate ROP operation success
            if (0x00000000 == ropCopyFolderResponse.ReturnValue)
            {
                this.VerifyRopCopyFolder(ropCopyFolderResponse);
            }
            #endregion

            return ropCopyFolderResponse;
        }