コード例 #1
0
        /// <summary>
        /// Fetch all the information about calendars using longIds or ServerIds
        /// </summary>
        /// <param name="itemOperationsRequest">The request for ItemOperations</param>
        /// <returns>The fetch items information</returns>
        public ItemOperationsStore ItemOperations(ItemOperationsRequest itemOperationsRequest)
        {
            ItemOperationsResponse response = this.activeSyncClient.ItemOperations(itemOperationsRequest, DeliveryMethodForFetch.Inline);
            ItemOperationsStore    itemOperationResponse = Common.LoadItemOperationsResponse(response);

            Site.Assert.IsNotNull(itemOperationResponse, "ItemOperation command response should be returned successfully.");
            this.VerifyTransport();
            this.VerifyItemOperationsResponse(itemOperationResponse);

            return(itemOperationResponse);
        }
コード例 #2
0
        /// <summary>
        /// Delete all items from the specified collection
        /// </summary>
        /// <param name="collectionId">The specified collection id</param>
        public void DeleteAllItems(string collectionId)
        {
            ItemOperationsRequest itemOperationsRequest       = TestSuiteHelper.CreateItemOperationsEmptyFolderContentsRequest(collectionId);
            ItemOperationsStore   emptyFolderContentsResponse = this.CALAdapter.ItemOperations(itemOperationsRequest);

            // Verify itemOperations response, if the command executes successfully, the Status in response should be 1.
            Site.Assert.AreEqual <string>(
                "1",
                emptyFolderContentsResponse.Status,
                "If the command executes successfully, the Status in response should be 1.");
        }
コード例 #3
0
        /// <summary>
        /// This method is used to verify the ItemOperation response related requirements.
        /// </summary>
        /// <param name="itemOperationResponse">Specified ItemOperationsStore result returned from the server</param>
        private void VerifyItemOperationsResponse(ItemOperationsStore itemOperationResponse)
        {
            if (null != itemOperationResponse.Items)
            {
                for (int i = itemOperationResponse.Items.Count - 1; i >= 0; i--)
                {
                    // Add the debug information
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCAL_R529");

                    // Verify MS-ASCAL requirement: MS-ASCAL_R529
                    // If the Calendar exists, it means ItemOperations Command Response can have any of the elements which belong to Calendar class.
                    // so this requirement can be verified.
                    Site.CaptureRequirementIfIsNotNull(
                        itemOperationResponse.Items[i].Calendar,
                        529,
                        @"[In ItemOperations Command Response] Any of the elements that belong to the Calendar class, as specified in section 2.2.2, can be included in an ItemOperations command response.");

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

                    // Verify MS-ASCAL requirement: MS-ASCAL_R531
                    // If Calendar exists, this requirement can be captured.
                    Site.CaptureRequirementIfIsNotNull(
                        itemOperationResponse.Items[i].Calendar,
                        531,
                        @"[In ItemOperations Command Response] Top-level Calendar class elements, as specified in section 2.2.2, MUST be returned as child elements of the itemoperations:Properties element ([MS-ASCMD] section 2.2.3.128) in the ItemOperations command response.");
                }
            }
        }