예제 #1
0
        /// <summary>
        /// Call ItemOperations command to move a conversation to a folder.
        /// </summary>
        /// <param name="conversationId">The Id of conversation to be moved.</param>
        /// <param name="destinationFolder">The destination folder id.</param>
        /// <param name="moveAlways">Should future messages always be moved.</param>
        /// <returns>An instance of the ItemOperationsResponse.</returns>
        protected ItemOperationsResponse ItemOperationsMove(string conversationId, string destinationFolder, bool moveAlways)
        {
            Request.ItemOperationsMove move = new Request.ItemOperationsMove
            {
                DstFldId       = destinationFolder,
                ConversationId = conversationId
            };

            if (moveAlways)
            {
                move.Options = new Request.ItemOperationsMoveOptions {
                    MoveAlways = string.Empty
                };
            }

            ItemOperationsRequest  itemOperationRequest  = Common.CreateItemOperationsRequest(new object[] { move });
            ItemOperationsResponse itemOperationResponse = this.CONAdapter.ItemOperations(itemOperationRequest);

            Site.Assert.AreEqual("1", itemOperationResponse.ResponseData.Status, "The ItemOperations operation should be success.");
            Site.Assert.AreEqual(1, itemOperationResponse.ResponseData.Response.Move.Length, "The server should return one Move element in ItemOperationsResponse.");

            return(itemOperationResponse);
        }
        public void MSASCON_S03_TC03_ItemOperations_Status2()
        {
            #region Create a conversation and get the created conversation item
            string conversationSubject = Common.GenerateResourceName(Site, "Conversation");
            ConversationItem conversationItem = this.CreateConversation(conversationSubject);
            #endregion

            #region Call ItemOperations command with invalid MoveAlways element.
            // Create an ItemOperations request and set invalid content to the MoveAlways element.
            ItemOperationsMove move = new ItemOperationsMove
            {
                DstFldId = User1Information.DeletedItemsCollectionId,
                ConversationId = conversationItem.ConversationId,
                Options = new ItemOperationsMoveOptions { MoveAlways = "MoveAlwaysContent" }
            };

            ItemOperationsRequest itemOperationRequest = Common.CreateItemOperationsRequest(new object[] { move });
            ItemOperationsResponse itemOperationResponse = this.CONAdapter.ItemOperations(itemOperationRequest);
            Site.Assert.AreEqual("1", itemOperationResponse.ResponseData.Status, "The ItemOperations operation should be success.");
            Site.Assert.AreEqual(1, itemOperationResponse.ResponseData.Response.Move.Length, "The server should return a Move element in ItemOperationsResponse.");

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

            // Verify MS-ASCON requirement: MS-ASCON_R144
            Site.CaptureRequirementIfAreEqual(
                "2",
                itemOperationResponse.ResponseData.Response.Move[0].Status,
                144,
                @"[In Status] [The meaning of status value] 2  [is] Protocol error. The XML is not valid.");
            #endregion
        }