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.");
}