GetItemOperationsRequest() static private method

Get the request of ItemOperations command.
static private GetItemOperationsRequest ( string collectionId, string serverId, Request bodyPartPreference, Request bodyPreference ) : ItemOperationsRequest
collectionId string The collection id of the folder to fetch.
serverId string The server id of the mail.
bodyPartPreference Microsoft.Protocols.TestSuites.Common.Request The BodyPartPreference in the Options element.
bodyPreference Microsoft.Protocols.TestSuites.Common.Request The BodyPreference in the Options element.
return ItemOperationsRequest
コード例 #1
0
        public void MSASCON_S03_TC07_ItemOperations_Status164()
        {
            this.CheckActiveSyncVersionIsNot140();

            #region User2 sends an email to User1
            this.SwitchUser(this.User2Information, true);

            string subject             = Common.GenerateResourceName(Site, "Subject");
            string user1MailboxAddress = Common.GetMailAddress(User1Information.UserName, User1Information.UserDomain);
            string user2MailboxAddress = Common.GetMailAddress(User2Information.UserName, User2Information.UserDomain);

            this.CallSendMailCommand(user2MailboxAddress, user1MailboxAddress, subject, null);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, User1Information.InboxCollectionId, subject, false);
            #endregion

            #region Call ItemOperations command with BodyPartPreference element and set the Type element to 3
            this.SwitchUser(this.User1Information, false);

            DataStructures.Sync syncItem           = this.SyncEmail(subject, User1Information.InboxCollectionId, true, null, null);
            BodyPartPreference  bodyPartPreference = new BodyPartPreference()
            {
                Type = 3,
            };

            ItemOperationsRequest  itemOperationsRequest  = TestSuiteHelper.GetItemOperationsRequest(User1Information.InboxCollectionId, syncItem.ServerId, bodyPartPreference, null);
            ItemOperationsResponse itemOperationsResponse = this.CONAdapter.ItemOperations(itemOperationsRequest);
            Site.Assert.AreEqual("1", itemOperationsResponse.ResponseData.Status, "The ItemOperations operation should be success.");
            this.VerifyMessagePartStatus164(byte.Parse(itemOperationsResponse.ResponseData.Response.Fetch[0].Status));
            #endregion
        }
コード例 #2
0
        /// <summary>
        /// Call ItemOperations command to fetch an email in the specific folder.
        /// </summary>
        /// <param name="collectionId">The folder collection id to be fetched.</param>
        /// <param name="serverId">The ServerId of the item</param>
        /// <param name="bodyPartPreference">The BodyPartPreference element.</param>
        /// <param name="bodyPreference">The bodyPreference element.</param>
        /// <returns>An Email instance that includes the fetch result.</returns>
        protected Email ItemOperationsFetch(string collectionId, string serverId, Request.BodyPartPreference bodyPartPreference, Request.BodyPreference bodyPreference)
        {
            ItemOperationsRequest  itemOperationsRequest  = TestSuiteHelper.GetItemOperationsRequest(collectionId, serverId, bodyPartPreference, bodyPreference);
            ItemOperationsResponse itemOperationsResponse = this.CONAdapter.ItemOperations(itemOperationsRequest);

            Site.Assert.AreEqual("1", itemOperationsResponse.ResponseData.Status, "The ItemOperations operation should be success.");

            ItemOperationsStore itemOperationsStore = Common.LoadItemOperationsResponse(itemOperationsResponse);

            Site.Assert.AreEqual(1, itemOperationsStore.Items.Count, "Only one email is supposed to be fetched.");
            Site.Assert.AreEqual("1", itemOperationsStore.Items[0].Status, "The fetch result should be success.");
            Site.Assert.IsNotNull(itemOperationsStore.Items[0].Email, "The fetched email should not be null.");

            return(itemOperationsStore.Items[0].Email);
        }