public void MSOXCMSG_S08_TC02_RopGetAttachmentSuccessfully()
        {
            this.CheckMapiHttpIsSupported();
            this.ConnectToServer(ConnectionType.PrivateMailboxServer);

            #region Call RopLogon to log on a mailbox.
            RopLogonResponse logonResponse = this.Logon(LogonType.Mailbox, out this.insideObjHandle);
            #endregion

            #region Call RopCreateMessage to create a message
            uint targetMessageHandle = this.CreatedMessage(logonResponse.FolderIds[4], this.insideObjHandle);
            #endregion

            #region Call RopSaveChangesMessage to save the message
            RopSaveChangesMessageResponse saveChangesMessageResponse;
            saveChangesMessageResponse = this.SaveMessage(targetMessageHandle, (byte)SaveFlags.ForceSave);
            Site.Assert.AreEqual<uint>(TestSuiteBase.Success, saveChangesMessageResponse.ReturnValue, TestSuiteBase.ROPSucceedMsg);
            #endregion

            #region Call RopOpenMessage to open the message.
            RopOpenMessageResponse openMessageResponse;
            uint openedMessageHandle = this.OpenSpecificMessage(logonResponse.FolderIds[4], saveChangesMessageResponse.MessageId, this.insideObjHandle, MessageOpenModeFlags.ReadWrite, out openMessageResponse);
            Site.Assert.AreEqual<uint>(TestSuiteBase.Success, openMessageResponse.ReturnValue, TestSuiteBase.ROPSucceedMsg);
            #endregion

            #region Call RopCreateAttachment to create the attachment1 of the message
            RopCreateAttachmentResponse createAttachmentResponse;
            uint attachmentId1;
            uint attachmentHandle = this.CreateAttachment(openedMessageHandle, out createAttachmentResponse, out attachmentId1);
            #endregion

            #region Call SetPropertiesSpecific to set PidTagDisplayName property.
            List<PropertyObj> propertyList = new List<PropertyObj>
            {
                new PropertyObj(PropertyNames.PidTagDisplayName, Common.GetBytesFromUnicodeString("First attachment"))
            };

            this.SetPropertiesForMessage(attachmentHandle, propertyList);
            #endregion

            #region Call RopSaveChangesAttachment to save the attachment1.
            RopSaveChangesAttachmentResponse saveChangesAttachmentResponse;
            this.SaveAttachment(attachmentHandle, out saveChangesAttachmentResponse);
            #endregion

            #region Call RopRelease to release attachment1.
            this.ReleaseRop(attachmentHandle);
            #endregion

            #region Call RopCreateAttachment to create the attachment2 of the message
            uint attachmentId2;
            attachmentHandle = this.CreateAttachment(openedMessageHandle, out createAttachmentResponse, out attachmentId2);
            #endregion

            #region Call SetPropertiesSpecific to set PidTagDisplayName property.
            propertyList = new List<PropertyObj>
            {
                new PropertyObj(PropertyNames.PidTagDisplayName, Common.GetBytesFromUnicodeString("Second attachment"))
            };

            this.SetPropertiesForMessage(attachmentHandle, propertyList);
            #endregion

            #region Call RopSaveChangesAttachment to save the attachment2.
            this.SaveAttachment(attachmentHandle, out saveChangesAttachmentResponse);
            #endregion

            #region Call RopRelease to release attachment2.
            this.ReleaseRop(attachmentHandle);

            bool isVerifiedR1836 = !(attachmentId1 == attachmentId2);

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

            // Verify MS-OXCMSG requirement: MS-OXCMSG_R1836
            Site.CaptureRequirementIfIsTrue(
                isVerifiedR1836,
                1836,
                @"[In PidTagAttachNumber Property] The value of property PidTagAttachNumber is different among the two Attachment objects in a message.");
            #endregion

            #region Call RopGetValidAttachments and expect a successful response
            if (Common.IsRequirementEnabled(1715, this.Site))
            {
                RopGetValidAttachmentsRequest getValidAttachmentsRequest = new RopGetValidAttachmentsRequest()
                {
                    RopId = (byte)RopId.RopGetValidAttachments,
                    LogonId = CommonLogonId,
                    InputHandleIndex = CommonInputHandleIndex
                };
                this.ResponseSOHs = this.MSOXCMSGAdapter.DoRopCall(getValidAttachmentsRequest, openedMessageHandle, ref this.response, ref this.rawData, GetPropertiesFlags.None);
                RopGetValidAttachmentsResponse getValidAttachmentsResponse = (RopGetValidAttachmentsResponse)this.response;

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

                // Verify MS-OXCMSG requirement: MS-OXCMSG_R1715
                // Calling RopGetValidAttachments succeeds indicates that implementation supports the RopGetValidAttachments ROP.
                this.Site.CaptureRequirementIfAreEqual<uint>(
                    TestSuiteBase.Success,
                    getValidAttachmentsResponse.ReturnValue,
                    1715,
                    @"[In Appendix A: Product Behavior] Implementation does support the RopGetValidAttachments ROP. (Exchange 2007 follows this behavior.)");
            }
            #endregion

            #region Call RopGetAttachmentTable with TableFlags set to 0x00 and expect a successful response.
            RopGetAttachmentTableRequest getAttachmentTableRequest = new RopGetAttachmentTableRequest()
            {
                RopId = (byte)RopId.RopGetAttachmentTable,
                LogonId = CommonLogonId, // The logonId 0x00 is associated with this operation.
                InputHandleIndex = CommonInputHandleIndex, // This index specifies the location 0x01 in the Server Object Handle Table where the handle for the input Server Object is stored. 
                OutputHandleIndex = CommonOutputHandleIndex, // This index specifies the location 0x01 in the Server Object Handle Table where the handle for the output Server Object is stored. 
                TableFlags = 0x00 // Open the table 
            };
            this.ResponseSOHs = this.MSOXCMSGAdapter.DoRopCall(getAttachmentTableRequest, openedMessageHandle, ref this.response, ref this.rawData, GetPropertiesFlags.None);
            RopGetAttachmentTableResponse getAttachmentTableResponse = (RopGetAttachmentTableResponse)this.response;
            Site.Assert.AreEqual<uint>(TestSuiteBase.Success, getAttachmentTableResponse.ReturnValue, TestSuiteBase.ROPSucceedMsg);
            uint attachmentTableHandle = this.ResponseSOHs[0][getAttachmentTableResponse.OutputHandleIndex];

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

            // Verify MS-OXCMSG requirement: MS-OXCMSG_R890
            // Calling RopGetAttachmentTable succeeds and the handle of the attachment table is not null indicate that RopGetAttachmentTable ROP retrieves a handle to a Table object.
            this.Site.CaptureRequirementIfIsNotNull(
                attachmentTableHandle,
                890,
                @"[In RopGetAttachmentTable ROP] The RopGetAttachmentTable ROP ([MS-OXCROPS] section 2.2.6.17) retrieves a handle to a Table object that represents the attachments stored on the Message object.");

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

            // Verify MS-OXCMSG requirement: MS-OXCMSG_R905
            this.Site.CaptureRequirementIfAreEqual<uint>(
                TestSuiteBase.Success,
                getAttachmentTableResponse.ReturnValue,
                905,
                @"[In RopGetAttachmentTable ROP Request Buffer] [TableFlags] [Standard (0x00)] Open the table.");
            #endregion

            #region Call RopGetAttachmentTable with TableFlags set to 0x40 and expect a successful response
            getAttachmentTableRequest.TableFlags = 0x40; // Open the table 
            this.ResponseSOHs = this.MSOXCMSGAdapter.DoRopCall(getAttachmentTableRequest, openedMessageHandle, ref this.response, ref this.rawData, GetPropertiesFlags.None);
            getAttachmentTableResponse = (RopGetAttachmentTableResponse)this.response;
            Site.Assert.AreEqual<uint>(TestSuiteBase.Success, getAttachmentTableResponse.ReturnValue, TestSuiteBase.ROPSucceedMsg);
            attachmentTableHandle = this.ResponseSOHs[0][getAttachmentTableResponse.OutputHandleIndex];
            #endregion

            #region Call RopSetColumns to set the display name of the attachment table and expect a successful response
            PropertyTag[] propertyTags = new PropertyTag[2];
            propertyTags[0] = PropertyHelper.PropertyTagDic[PropertyNames.PidTagDisplayName];
            propertyTags[1] = PropertyHelper.PropertyTagDic[PropertyNames.PidTagAttachNumber];

            this.SetColumnsSuccess(propertyTags, attachmentTableHandle);

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

            // Verify MS-OXCMSG requirement: MS-OXCMSG_R906
            this.Site.CaptureRequirementIfAreEqual<uint>(
                TestSuiteBase.Success,
                getAttachmentTableResponse.ReturnValue,
                906,
                @"[In RopGetAttachmentTable ROP Request Buffer] [TableFlags] [Unicode (0x40)] Open the table.");
            #endregion

            #region Call RopQueryColumnsAll to get all the string type properties in the attachment table and expect all the string type properties are returned in Unicode format
            RopQueryColumnsAllRequest queryColumnsAllRequest = new RopQueryColumnsAllRequest()
            {
                RopId = (byte)RopId.RopQueryColumnsAll,
                LogonId = CommonLogonId,
                InputHandleIndex = CommonInputHandleIndex
            };
            this.ResponseSOHs = this.MSOXCMSGAdapter.DoRopCall(queryColumnsAllRequest, attachmentTableHandle, ref this.response, ref this.rawData, GetPropertiesFlags.None);
            RopQueryColumnsAllResponse queryColumnsAllResponse = (RopQueryColumnsAllResponse)this.response;
            Site.Assert.AreEqual<uint>(TestSuiteBase.Success, queryColumnsAllResponse.ReturnValue, TestSuiteBase.ROPSucceedMsg);
            #endregion

            #region Call RopQueryRows to query all rows.
            RopQueryRowsResponse queryRowsResponse = this.QueryRowsSuccess(attachmentTableHandle);

            bool isVerifiedR907 = false;

            for (int i = 0; i < queryRowsResponse.RowCount; i++)
            {
                byte[] rowData = queryRowsResponse.RowData.PropertyRows[i].PropertyValues[0].Value;
                if (Common.IsUtf16LEString(rowData))
                {
                    isVerifiedR907 = true;
                }
                else
                {
                    isVerifiedR907 = false;
                    break;
                }
            }

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

            // Verify MS-OXCMSG requirement: MS-OXCMSG_R907
            // Property type ptypString indicates that the string data is in Unicode format, and then MS-OXCMSG_R907 can be verified.     
            this.Site.CaptureRequirementIfIsTrue(
                isVerifiedR907,
                907,
                @"[In RopGetAttachmentTable ROP Request Buffer] [TableFlags] [Unicode (0x40)] Also requests that the columns containing string data be returned in Unicode format.");

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

            bool isExitsFirstAttach = false;
            bool isExitsSecondAttach = false;

            Site.Assert.AreEqual<int>(2, queryRowsResponse.RowCount, "The message should include 2 attachments.");

            for (int i = 0; i < queryRowsResponse.RowCount; i++)
            {
                int attachmentID = BitConverter.ToInt32(queryRowsResponse.RowData.PropertyRows[i].PropertyValues[1].Value, 0);

                if (attachmentID == attachmentId1)
                {
                    isExitsFirstAttach = true;
                }

                if (attachmentID == attachmentId2)
                {
                    isExitsSecondAttach = true;
                }
            }

            bool isVerifiedR312 = isExitsFirstAttach && isExitsSecondAttach;

            // Verify MS-OXCMSG requirement: MS-OXCMSG_R312
            // Because according to above step, the message include 2 attachments.
            // When a client calls the RopGetAttachmentTable ROP, the server returns a table of properties for each Attachment object associated with the Message object.
            // If the table from server only includes 2 rows and the PidTagAttachNumber property columns include all attachment ids of attachment associated with Message object.
            // R312 will be verified.
            this.Site.CaptureRequirementIfIsTrue(
                isVerifiedR312,
                312,
                @"[In Sending a RopGetAttachmentTable ROP Request] When a client calls the RopGetAttachmentTable ROP ([MS-OXCROPS] section 2.2.6.17), the server returns a table of properties for each Attachment object associated with the Message object, as specified in [MS-OXCTABL].");

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMSG_R490");
            bool isVerifiedR490 = isVerifiedR312;

            // Verify MS-OXCMSG requirement: MS-OXCMSG_R490
            // Because the PidTagAttachNumber can be obtained from the table return from server when call RopGetAttachmentTable ROP.
            // So R490 will be verified.
            this.Site.CaptureRequirementIfIsTrue(
                isVerifiedR490,
                490,
                @"[In Receiving a RopGetAttachmentTable ROP Request] The Table object returned by the RopGetAttachmentTable ROP ([MS-OXCROPS] section 2.2.6.17) allows access to the properties of Attachment objects.");
            #endregion

            #region Call RopRelease to release the created message.
            this.ReleaseRop(openedMessageHandle);
            #endregion
        }
        public void MSOXCMSG_S08_TC10_ErrorCodeRelatedWithAttachmentROPs()
        {
            this.CheckMapiHttpIsSupported();
            this.ConnectToServer(ConnectionType.PrivateMailboxServer);

            #region Call RopLogon to log on a mailbox.
            RopLogonResponse logonResponse = this.Logon(LogonType.Mailbox, out this.insideObjHandle);
            #endregion

            #region Call RopCreateMessage to create a message
            uint targetMessageHandle = this.CreatedMessage(logonResponse.FolderIds[4], this.insideObjHandle);
            #endregion

            #region Call RopSaveChangesMessage to save the message
            RopSaveChangesMessageResponse saveChangesMessageResponse;
            saveChangesMessageResponse = this.SaveMessage(targetMessageHandle, (byte)SaveFlags.ForceSave);
            #endregion

            #region Call RopOpenMessage to open the message.
            RopOpenMessageResponse openMessageResponse;
            uint openedMessageHandle = this.OpenSpecificMessage(logonResponse.FolderIds[4], saveChangesMessageResponse.MessageId, this.insideObjHandle, MessageOpenModeFlags.ReadWrite, out openMessageResponse);
            Site.Assert.AreEqual<uint>(TestSuiteBase.Success, openMessageResponse.ReturnValue, TestSuiteBase.ROPSucceedMsg);
            #endregion

            #region Call RopCreateAttachment with InputHandleIndex set to 0x01 and expect a failure response.
            RopCreateAttachmentRequest createAttachmentRequest = new RopCreateAttachmentRequest()
            {
                RopId = (byte)RopId.RopCreateAttachment,
                LogonId = CommonLogonId, // The logonId 0x00 is associated with this operation.
                InputHandleIndex = 0x01, // Set InputHandleIndex to 0x01 which doesn't refer to a Message object.
                OutputHandleIndex = CommonOutputHandleIndex // This index specifies the location 0x01 in the Server Object Handle Table where the handle for the output Server Object is stored. 
            };
            this.ResponseSOHs = this.MSOXCMSGAdapter.DoRopCall(createAttachmentRequest, targetMessageHandle, ref this.response, ref this.rawData, GetPropertiesFlags.None);
            RopCreateAttachmentResponse createAttachmentResponse = (RopCreateAttachmentResponse)this.response;

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

            // Verify MS-OXCMSG requirement: MS-OXCMSG_R1712
            this.Site.CaptureRequirementIfAreEqual<uint>(
                0x000004B9,
                createAttachmentResponse.ReturnValue,
                1712,
                @"[In Receiving a RopCreateAttachment ROP Request] [ecNullObject (0x000004B9)] The value of the InputHandleIndex field on which this ROP [RopCreateAttachment] was called does not refer to a Message object.");
            #endregion

            #region Call RopCreateAttachment to create an attachment and expect a successful response.
            uint attachmentId;
            uint attachmentHandle = this.CreateAttachment(openedMessageHandle, out createAttachmentResponse, out attachmentId);
            #endregion

            #region Call RopSaveChangesAttachment and set the attachmentID to the message ID and expect a failure response.
            RopSaveChangesAttachmentRequest saveChangesAttachmentRequest = new RopSaveChangesAttachmentRequest()
            {
                RopId = (byte)RopId.RopSaveChangesAttachment,
                LogonId = CommonLogonId, // The logonId 0x00 is associated with this operation.
                ResponseHandleIndex = CommonOutputHandleIndex, // This index specifies the location in the Server object handle table that is referenced in the response.
                InputHandleIndex = CommonInputHandleIndex, // This index specifies the location 0x00 in the Server Object Handle Table where the handle for the input Server Object is stored. 
                SaveFlags = (byte)SaveFlags.ForceSave
            };
            this.ResponseSOHs = this.MSOXCMSGAdapter.DoRopCall(saveChangesAttachmentRequest, openedMessageHandle, ref this.response, ref this.rawData, GetPropertiesFlags.None);
            RopSaveChangesAttachmentResponse saveChangesAttachmentResponse = (RopSaveChangesAttachmentResponse)this.response;
            Site.Assert.AreNotEqual<uint>(TestSuiteBase.Success, saveChangesAttachmentResponse.ReturnValue, TestSuiteBase.ROPSucceedMsg);

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

            // Verify MS-OXCMSG requirement: MS-OXCMSG_R467
            this.Site.CaptureRequirementIfAreEqual<uint>(
                0x80040102,
                saveChangesAttachmentResponse.ReturnValue,
                467,
                @"[In Receiving a RopSaveChangesAttachment ROP Request] [ecNotSupported (0x80040102)] The value of the InputHandleIndex field on which this ROP [RopSaveChangesAttachment] was called does not refer to an Attachment object.");
            #endregion

            #region Call RopSaveChangesAttachment and set SaveFlags to 0x03 which doesn't specified in the Open Specification and expect a failure response.
            saveChangesAttachmentRequest.SaveFlags = 0x03; // Set SaveFlags to 0x03 which doesn't specified in the Open Specification
            this.ResponseSOHs = this.MSOXCMSGAdapter.DoRopCall(saveChangesAttachmentRequest, attachmentHandle, ref this.response, ref this.rawData, GetPropertiesFlags.None);
            saveChangesAttachmentResponse = (RopSaveChangesAttachmentResponse)this.response;
            Site.Assert.AreNotEqual<uint>(TestSuiteBase.Success, saveChangesAttachmentResponse.ReturnValue, TestSuiteBase.ROPSucceedMsg);

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

            // Verify MS-OXCMSG requirement: MS-OXCMSG_R466
            this.Site.CaptureRequirementIfAreEqual<uint>(
                0x80040102,
                saveChangesAttachmentResponse.ReturnValue,
                466,
                @"[In Receiving a RopSaveChangesAttachment ROP Request] [ecNotSupported (0x80040102)] The value of the SaveFlags field is not a supported combination as specified in section 2.2.3.3.1.");
            #endregion

            #region Call RopSaveChangesAttachment to save the newly created attachment.
            this.SaveAttachment(attachmentHandle, out saveChangesAttachmentResponse);
            #endregion

            #region Call RopOpenAttachment with InputHandleIndex set to 0x01 which doesn't refer to a message object and expect a failure response
            RopOpenAttachmentRequest openAttachmentRequest = new RopOpenAttachmentRequest()
            {
                RopId = (byte)RopId.RopOpenAttachment,
                LogonId = CommonLogonId, // The logonId 0x00 is associated with this operation.
                InputHandleIndex = 0x01, // Set InputHandleIndex to 0x01 which doesn't refer to a Message object.
                OutputHandleIndex = CommonOutputHandleIndex, // This index specifies the location 0x01 in the Server Object Handle Table where the handle for the output Server Object is stored. 
                OpenAttachmentFlags = 0x01,
                AttachmentID = attachmentId
            };
            this.ResponseSOHs = this.MSOXCMSGAdapter.DoRopCall(openAttachmentRequest, openedMessageHandle, ref this.response, ref this.rawData, GetPropertiesFlags.None);
            RopOpenAttachmentResponse openAttachmentResponseFirst = (RopOpenAttachmentResponse)this.response;
            Site.Assert.AreNotEqual<uint>(TestSuiteBase.Success, openAttachmentResponseFirst.ReturnValue, "The InputHandleIndex is wrong.");

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

            // Verify MS-OXCMSG requirement: MS-OXCMSG_R1620
            this.Site.CaptureRequirementIfAreEqual<uint>(
                0x000004B9,
                openAttachmentResponseFirst.ReturnValue,
                1620,
                @"[In Receiving a RopOpenAttachment ROP Request] [ecNullObject (0x000004B9)] The value of the InputHandleIndex field on which this ROP [RopOpenAttachment] was called does not refer to a Message object.");
            #endregion

            #region Call RopRelease to release attachment.
            this.ReleaseRop(attachmentHandle);
            #endregion

            #region Call RopGetAttachmentTable with InputHandleIndex set to 0x01 and expect a failure response
            RopGetAttachmentTableRequest getAttachmentTableRequest = new RopGetAttachmentTableRequest()
            {
                RopId = (byte)RopId.RopGetAttachmentTable,
                LogonId = CommonLogonId, // The logonId 0x00 is associated with this operation.
                InputHandleIndex = 0x01, // Set InputHandleIndex to 0x01 which doesn't refer to a Message object
                OutputHandleIndex = CommonOutputHandleIndex, // This index specifies the location 0x01 in the Server Object Handle Table where the handle for the output Server Object is stored. 
                TableFlags = 0x00 // Open the table 
            };
            this.ResponseSOHs = this.MSOXCMSGAdapter.DoRopCall(getAttachmentTableRequest, openedMessageHandle, ref this.response, ref this.rawData, GetPropertiesFlags.None);
            RopGetAttachmentTableResponse getAttachmentTableResponse = (RopGetAttachmentTableResponse)this.response;

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

            // Verify MS-OXCMSG requirement: MS-OXCMSG_R1526
            this.Site.CaptureRequirementIfAreEqual<uint>(
                0x000004B9,
                getAttachmentTableResponse.ReturnValue,
                1526,
                @"[In Receiving a RopGetAttachmentTable ROP Request] [ecNullObject (0x000004B9)] The value of the InputHandleIndex field on which this ROP [RopGetAttachmentTable] was called does not refer to a Message object.");
            #endregion

            #region Call RopDeleteAttachment and set InputHandleIndex to 0x01 and expect a failure response.
            RopDeleteAttachmentRequest deleteAttachmentRequest = new RopDeleteAttachmentRequest()
            {
                RopId = (byte)RopId.RopDeleteAttachment,
                LogonId = CommonLogonId, // The logonId 0x00 is associated with this operation.
                InputHandleIndex = CommonInputHandleIndex, // Set InputHandleIndex to 0x00 which doesn't refer to a Message object.
                AttachmentID = attachmentId
            };

            // Set InputHandleIndex to 0x00 which doesn't refer to a Message object.
            this.ResponseSOHs = this.MSOXCMSGAdapter.DoRopCall(deleteAttachmentRequest, TestSuiteBase.InvalidInputHandle, ref this.response, ref this.rawData, GetPropertiesFlags.None);
            RopDeleteAttachmentResponse deleteAttachmentResponse = (RopDeleteAttachmentResponse)this.response;

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

            // Verify MS-OXCMSG requirement: MS-OXCMSG_R1524
            this.Site.CaptureRequirementIfAreEqual<uint>(
                0x000004B9,
                deleteAttachmentResponse.ReturnValue,
                1524,
                @"[In Receiving a RopDeleteAttachment ROP Request] [ecNullObject (0x000004B9)] The value of the InputHandleIndex field on which this ROP [RopDeleteAttachment] was called does not refer to a Message object.");
            #endregion

            #region Call RopDeleteAttachment and set AttachmentID to a nonexisting one and expect a failure response.
            deleteAttachmentRequest.InputHandleIndex = 0x00;
            deleteAttachmentRequest.AttachmentID = attachmentId + 5;
            this.ResponseSOHs = this.MSOXCMSGAdapter.DoRopCall(deleteAttachmentRequest, openedMessageHandle, ref this.response, ref this.rawData, GetPropertiesFlags.None);
            deleteAttachmentResponse = (RopDeleteAttachmentResponse)this.response;

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

            // Verify MS-OXCMSG requirement: MS-OXCMSG_R1063
            this.Site.CaptureRequirementIfAreEqual<uint>(
                0x8004010F,
                deleteAttachmentResponse.ReturnValue,
                1063,
                @"[In Receiving a RopDeleteAttachment ROP Request] [ecNotFound (0x8004010F)] The value of the AttachmentID field does not correspond to an attachment on the Message object.");
            #endregion

            #region Call RopDeleteAttachment to delete the attachment and expect a successful response.
            deleteAttachmentRequest.AttachmentID = attachmentId;
            this.ResponseSOHs = this.MSOXCMSGAdapter.DoRopCall(deleteAttachmentRequest, openedMessageHandle, ref this.response, ref this.rawData, GetPropertiesFlags.None);
            deleteAttachmentResponse = (RopDeleteAttachmentResponse)this.response;
            Site.Assert.AreEqual<uint>(TestSuiteBase.Success, deleteAttachmentResponse.ReturnValue, TestSuiteBase.ROPSucceedMsg);
            #endregion

            #region Call RopOpenAttachment to open the deleted attachment and expect a failure response.
            RopOpenAttachmentResponse openAttachmentResponse;
            this.OpenAttachment(openedMessageHandle, out openAttachmentResponse, attachmentId, OpenAttachmentFlags.ReadWrite);

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

            // Verify MS-OXCMSG requirement: MS-OXCMSG_R440
            this.Site.CaptureRequirementIfAreEqual<uint>(
                0x8004010F,
                openAttachmentResponse.ReturnValue,
                440,
                @"[In Receiving a RopOpenAttachment ROP Request] [ecNotFound (0x8004010F)] The value of the AttachmentID field does not correspond to an attachment on the Message object.");
            #endregion

            #region Call RopRelease to release the created message and attachment.
            this.ReleaseRop(attachmentHandle);
            this.ReleaseRop(targetMessageHandle);
            #endregion
        }