Microsoft.Protocols.TestSuites.MS_OXWSFOLD.S02_CopyFolder.MSOXWSFOLD_S02_TC01_CopyFolder C# (CSharp) Method

MSOXWSFOLD_S02_TC01_CopyFolder() private method

private MSOXWSFOLD_S02_TC01_CopyFolder ( ) : void
return void
        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.");
        }