Microsoft.Protocols.TestSuites.MS_OXCPRPT.MS_OXCPRPTAdapter.CleanUpMethod C# (CSharp) Method

CleanUpMethod() private method

Test cleanup operation.
private CleanUpMethod ( ) : void
return void
        private void CleanUpMethod()
        {
            if (this.needDoCleanup)
            {
                if (this.isPublicFolderLogonType)
                {
                    for (int i = 0; i < 2; i++)
                    {
                        string subFolderName = FolderDisplayName + i.ToString();

                        // Get the subfolder ID according to its name.
                        ulong folderId = this.GetSubfolderIDByName(this.existingPublicFolderHandle, subFolderName);

                        // Cleanup the created public folder, including all messages and subfolders
                        this.RopDeleteFolder(this.existingPublicFolderHandle, folderId);
                    }
                }
                else
                {
                    // Cleanup the inbox folder, including all messages and subfolders
                    this.RopEmptyFolder(this.cprptInputBoxHandle, Convert.ToByte(false), true);
                }

                this.RopRelease(this.cprptLogonHandle);
            }

            bool isDisconnected = this.RpcDisconnect();
            this.Site.Assert.IsTrue(isDisconnected, "RPC disconnect should be executed successfully.");
        }
MS_OXCPRPTAdapter