public void MSOXCFOLD_S02_TC06_RopMoveCopyMessagesFailure()
{
this.CheckWhetherSupportTransport();
this.Adapter.DoConnect(ConnectionType.PrivateMailboxServer);
List<uint> handlelist;
this.GenericFolderInitialization();
#region Step 1. Create a message in the root folder.
uint messageHandle = 0;
ulong messageId = 0;
this.CreateSaveMessage(this.RootFolderHandle, this.RootFolderId, ref messageId, ref messageHandle);
#endregion
#region Step 2. Call RopCreateFolder to create [MSOXCFOLDSubfolder1] under the root folder.
uint subfolderHandle1 = 0;
ulong subfolderId1 = 0;
this.CreateFolder(this.RootFolderHandle, Constants.Subfolder1, ref subfolderId1, ref subfolderHandle1);
#endregion
#region Step 3. Call RopMoveCopyMessages using a logon object handle as a source folder handle to move the message created in step 2 to [MSOXCFOLDSubfolder1].
ulong[] messageIds = new ulong[] { subfolderId1 };
List<uint> handleList = new List<uint>
{
// Use logon object handle as a source handle for RopMoveCopyMessages in which case is purposed to get an error code ecNotSupported [0x80040102].
this.LogonHandle, subfolderHandle1
};
RopMoveCopyMessagesRequest moveCopyMessagesRequest = new RopMoveCopyMessagesRequest
{
RopId = (byte)RopId.RopMoveCopyMessages,
LogonId = Constants.CommonLogonId,
SourceHandleIndex = 0x00,
DestHandleIndex = 0x01,
MessageIdCount = (ushort)messageIds.Length,
MessageIds = messageIds,
WantAsynchronous = 0x00,
WantCopy = 0
};
RopMoveCopyMessagesResponse moveCopyMessagesResponse = this.Adapter.MoveCopyMessages(moveCopyMessagesRequest, handleList, ref this.responseHandles);
#region Verify MS-OXCFOLD_R589 and MS-OXCFOLD_R590.
// Add the debug information.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R589");
// Verify MS-OXCFOLD requirement: MS-OXCFOLD_R589
Site.CaptureRequirementIfAreEqual<uint>(
0x80040102,
moveCopyMessagesResponse.ReturnValue,
589,
@"[In Processing a RopMoveCopyMessages ROP Request]The value of error code ecNotSupported is 0x80040102.");
// Add the debug information.
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R590");
// The MS-OXCFOLD_R589 captured error code [ecNotSupported], using logon handle as a source folder handle, capture this requirement directly.
Site.CaptureRequirement(
590,
@"[In Processing a RopMoveCopyMessages ROP Request] When the error code is ecNotSupported, it indicates that either the source object or the destination object is not a Folder object.");
#endregion
handleList.Clear();
#endregion
#region Step 4. Call RopMoveCopyMessages to move the message created in step 1 from the root folder to [MSOXCFOLDSubfolder1] synchronously.
messageIds = new ulong[] { messageId };
handlelist = new List<uint>
{
this.RootFolderHandle, subfolderHandle1
};
moveCopyMessagesRequest = new RopMoveCopyMessagesRequest
{
RopId = (byte)RopId.RopMoveCopyMessages,
LogonId = Constants.CommonLogonId,
SourceHandleIndex = 0x00,
DestHandleIndex = 0x01,
MessageIdCount = (ushort)messageIds.Length,
MessageIds = messageIds,
WantAsynchronous = 0x00,
WantCopy = 0x00
};
// WantCopy is zero (FALSE) indicates this is a move operation.
moveCopyMessagesResponse = this.Adapter.MoveCopyMessages(moveCopyMessagesRequest, handlelist, ref this.responseHandles);
Site.Assert.AreEqual<uint>(0, moveCopyMessagesResponse.ReturnValue, "The RopMoveCopyMessages ROP operation performs successfully.");
Site.Assert.AreEqual<uint>(0, moveCopyMessagesResponse.PartialCompletion, "The ROP successes for all subsets of targets");
#endregion
}