Microsoft.Protocols.TestSuites.MS_OXCROPS.S06_PropertyROPs.MSOXCROPS_S06_TC03_TestRopProgress C# (CSharp) Method

MSOXCROPS_S06_TC03_TestRopProgress() private method

private MSOXCROPS_S06_TC03_TestRopProgress ( ) : void
return void
        public void MSOXCROPS_S06_TC03_TestRopProgress()
        {
            this.CheckTransportIsSupported();

            this.cropsAdapter.RpcConnect(
                Common.GetConfigurationPropertyValue("SutComputerName", this.Site),
                ConnectionType.PrivateMailboxServer,
                Common.GetConfigurationPropertyValue("UserEssdn", this.Site),
                Common.GetConfigurationPropertyValue("Domain", this.Site),
                Common.GetConfigurationPropertyValue("AdminUserName", this.Site),
                Common.GetConfigurationPropertyValue("PassWord", this.Site));

            // Refer to MS-OXCPRPT: The initial release version of Exchange 2010 does not implement the RopProgress ROP.
            if (Common.IsRequirementEnabled(86601, this.Site))
            {
                // Step 1: Preparations-Open a folder and construct emptyFolderRequest.
                #region Common methods

                // Log on to a private mailbox.
                RopLogonResponse logonResponse = Logon(LogonType.Mailbox, this.userDN, out inputObjHandle);
                RopCreateMessageRequest createMessageRequest = new RopCreateMessageRequest();
                RopSaveChangesMessageRequest saveChangesMessageRequest = new RopSaveChangesMessageRequest();
                RopReleaseRequest releaseRequest = new RopReleaseRequest();
                this.PrepareRops(logonResponse, ref createMessageRequest, ref saveChangesMessageRequest, ref releaseRequest);
                uint tableHandle;

                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Step 1:Call CreateVastMessages method to create Vast Messages In InBox.");

                string transportSeq = Common.GetConfigurationPropertyValue("TransportSeq", this.Site).ToLower();
                if (transportSeq == "mapi_http")
                {
                    this.CreateVastMessages(ref logonResponse, out tableHandle, TestSuiteBase.MessagesCount / 50, createMessageRequest, saveChangesMessageRequest, releaseRequest);
                }
                else
                {
                    this.CreateSingleProcessEachLoop(ref logonResponse, out tableHandle, TestSuiteBase.MessagesCount, createMessageRequest, saveChangesMessageRequest, releaseRequest);
                }

                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Step 1:Call CreateVastMessages method to create Vast Messages In InBox.");

                // Call GetOpenedFolderHandle to get the opened folder handle.
                uint openedFolderHandle = this.GetOpenedFolderHandle(logonResponse.FolderIds[4], inputObjHandle);

                #endregion

                // Step 2: Verify the RopProgress success response.
                #region RopProgress success response

                // Send the RopEmptyFolder request to delete all messages and subfolders from opened folder.
                #region RopEmptyFolder request

                RopProgressRequest progressRequest;
                RopEmptyFolderRequest emptyFolderRequest;

                emptyFolderRequest.RopId = (byte)RopId.RopEmptyFolder;
                emptyFolderRequest.LogonId = TestSuiteBase.LogonId;
                emptyFolderRequest.InputHandleIndex = TestSuiteBase.InputHandleIndex0;
                emptyFolderRequest.WantAsynchronous = TestSuiteBase.NonZero;
                emptyFolderRequest.WantDeleteAssociated = TestSuiteBase.NonZero;

                #endregion

                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Step 2: Begin to send the RopEmptyFolder request.");

                // Send the RopEmptyFolder request.
                this.responseSOHs = cropsAdapter.ProcessSingleRop(
                    emptyFolderRequest,
                    openedFolderHandle,
                    ref this.response,
                    ref this.rawData,
                    RopResponseType.SuccessResponse);

                if (response is RopProgressResponse)
                {
                    RopProgressResponse ropProgressResponse = (RopProgressResponse)response;

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

                    // Verify MS-OXCROPS requirement: MS-OXCROPS_R86601
                    Site.CaptureRequirementIfAreEqual<uint>(
                        TestSuiteBase.SuccessReturnValue,
                        ropProgressResponse.ReturnValue,
                        86601,
                        @"[In Appendix A: Product Behavior] Implementation does implement the RopProgress ROP ([MS-OXCROPS] section 2.2.8.13). (Exchange 2007 and Exchange 2013 follow this behavior.)");
                }

                #endregion

                if (Common.IsRequirementEnabled(3155, this.Site))
                {
                    // Step 3: Send the RopProgress request and verify the failure response.
                    #region Step 3: Send the RopProgress request and verify the failure response.

                    progressRequest.RopId = (byte)RopId.RopProgress;
                    progressRequest.LogonId = TestSuiteBase.LogonId;
                    progressRequest.InputHandleIndex = TestSuiteBase.InputHandleIndex1;
                    progressRequest.WantCancel = Convert.ToByte(TestSuiteBase.Zero);

                    Site.Log.Add(LogEntryKind.Debug, "Step 3: Begin to send the RopProgress request.");

                    // Send the RopProgress request and verify the success response.
                    this.responseSOHs = cropsAdapter.ProcessSingleRop(
                        progressRequest,
                        this.inputObjHandle,
                        ref this.response,
                        ref this.rawData,
                        RopResponseType.FailureResponse);

                    #endregion
                }
            }
        }