Wrapper conversion item class for the conversation id and the server id
Exemple #1
0
        public void MSASCON_S01_TC04_Sync_Filter()
        {
            #region Create a conversation and sync to get the created conversation item.
            string           conversationSubject   = Common.GenerateResourceName(Site, "Conversation");
            ConversationItem inboxConversationItem = this.CreateConversation(conversationSubject);
            #endregion

            #region Call Sync command with setting ConversationMode element to true.
            SyncStore syncStore = this.CallSyncCommand(User1Information.InboxCollectionId, true);

            int itemCount = 0;
            foreach (Sync item in syncStore.AddElements)
            {
                if (item.Email.Subject.Contains(conversationSubject))
                {
                    itemCount++;
                }
            }
            #endregion

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

            // Verify MS-ASCON requirement: MS-ASCON_R180
            // If the count of the items got from Sync command is equal to the count of the item in the conversation, then this requirement can be captured.
            Site.CaptureRequirementIfAreEqual <int>(
                inboxConversationItem.ServerId.Count,
                itemCount,
                180,
                @"[In Synchronizing a Conversation] When a conversation is synchronized, all e-mail messages that are part of the conversation and that are in the specified folder are synchronized.");
        }
Exemple #2
0
        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
        }
Exemple #3
0
        public void MSASCON_S03_TC01_ItemOperations_Ignore()
        {
            #region Create a conversation and get the created conversation item
            string           conversationSubject    = Common.GenerateResourceName(Site, "Conversation");
            ConversationItem sourceConversationItem = this.CreateConversation(conversationSubject);
            #endregion

            #region Call ItemOperations command to ignore the conversation
            // Move the created conversation from Inbox folder to Deleted Items folder with setting MoveAlways element.
            ItemOperationsResponse itemOperationResponse = this.ItemOperationsMove(sourceConversationItem.ConversationId, User1Information.DeletedItemsCollectionId, true);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, User1Information.InboxCollectionId, conversationSubject, true);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, User1Information.DeletedItemsCollectionId, conversationSubject, false);

            bool isVerifiedR214 = itemOperationResponse.ResponseData.Response.Move[0].Status != null && itemOperationResponse.ResponseData.Response.Move[0].ConversationId != null;

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R214");
            Site.Log.Add(LogEntryKind.Debug, "The value of the Status element is {0}, and the value of ConversationId element is {1}.", itemOperationResponse.ResponseData.Response.Move[0].Status, itemOperationResponse.ResponseData.Response.Move[0].ConversationId);

            // Verify MS-ASCON requirement: MS-ASCON_R214
            Site.CaptureRequirementIfIsTrue(
                isVerifiedR214,
                214,
                @"[In Ignoring a Conversation] The server sends an ItemOperations command response ([MS-ASCMD] section 2.2.1.10) that includes the itemoperations:Status element, as specified in section 2.2.2.10, and the itemoperations:ConversationId element (section 2.2.2.3.1).");

            Site.Assert.AreEqual("1", itemOperationResponse.ResponseData.Response.Move[0].Status, "The move operation should be success.");
            #endregion

            #region User1 synchronizes messages in the Inbox folder and Deleted Items folder after conversation moved
            DataStructures.Sync syncResult = this.SyncEmail(conversationSubject, User1Information.InboxCollectionId, false, null, null);
            Site.Assert.IsNull(syncResult, "No conversation messages should not be found in Inbox folder.");

            ConversationItem destinationCoversationItem = this.GetConversationItem(User1Information.DeletedItemsCollectionId, sourceConversationItem.ConversationId);
            Site.Assert.AreEqual(sourceConversationItem.ServerId.Count, destinationCoversationItem.ServerId.Count, "All conversation messages should be moved to Deleted Items folder.");
            #endregion

            #region User2 replies the received message to create a future e-mail message for that conversation.
            this.SwitchUser(this.User2Information, false);
            syncResult = this.SyncEmail(conversationSubject, User2Information.InboxCollectionId, true, null, null);

            string user1MailboxAddress = Common.GetMailAddress(User1Information.UserName, User1Information.UserDomain);
            string user2MailboxAddress = Common.GetMailAddress(User2Information.UserName, User2Information.UserDomain);

            // Smart reply the received email from User2 to User1.
            this.CallSmartReplyCommand(syncResult.ServerId, User2Information.InboxCollectionId, user2MailboxAddress, user1MailboxAddress, conversationSubject);

            // Switch the current user to User1.
            this.SwitchUser(this.User1Information, false);

            destinationCoversationItem = this.GetConversationItem(User1Information.DeletedItemsCollectionId, sourceConversationItem.ConversationId, sourceConversationItem.ServerId.Count + 1);
            Site.Assert.AreEqual(sourceConversationItem.ServerId.Count + 1, destinationCoversationItem.ServerId.Count, "The future message should be moved to Deleted Items folder.");

            // Check if the received email is in Inbox folder.
            syncResult = this.SyncEmail(conversationSubject, User1Information.InboxCollectionId, false, null, null);
            Site.Assert.IsNull(syncResult, "The future message should not be found in Inbox folder.");
            #endregion
        }
Exemple #4
0
        public void MSASCON_S05_TC01_Search()
        {
            #region Create a conversation and get the created conversation item.
            string           conversationSubject    = Common.GenerateResourceName(Site, "Conversation");
            ConversationItem sourceConversationItem = this.CreateConversation(conversationSubject);
            #endregion

            #region Call MoveItems command to move one item of the conversation from Inbox folder to SentItems folder.
            Collection <string> moveItems = new Collection <string> {
                sourceConversationItem.ServerId[0]
            };

            // Call MoveItems command to move one item of the conversation from Inbox folder to SentItems folder.
            this.CallMoveItemsCommand(moveItems, User1Information.InboxCollectionId, User1Information.SentItemsCollectionId);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, User1Information.SentItemsCollectionId, conversationSubject, false);
            #endregion

            #region Call Search command to find the conversation.
            DataStructures.SearchStore searchResponse = this.CallSearchCommand(sourceConversationItem.ConversationId, 2, null, null);

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

            // Verify MS-ASCON requirement: MS-ASCON_R221
            // The Search command executed successfully, so this requirement can be captured.
            Site.CaptureRequirement(
                221,
                @"[In Processing a Search Command] The server sends a Search command response, as specified in [MS-ASCMD] section 2.2.2.14.");

            Site.Assert.AreEqual <int>(searchResponse.Results.Count, sourceConversationItem.ServerId.Count, "The count of the search result should be equal to the count of items in the conversation.");

            // If one of the found email is in Inbox folder and the other is in Sent Items folder, this requirement can be captured.
            bool allFoldersSearched = (searchResponse.Results[0].CollectionId == User1Information.InboxCollectionId && searchResponse.Results[1].CollectionId == User1Information.SentItemsCollectionId) || (searchResponse.Results[1].CollectionId == User1Information.InboxCollectionId && searchResponse.Results[0].CollectionId == User1Information.SentItemsCollectionId);

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R176");
            Site.Log.Add(LogEntryKind.Debug, "The emails found are in folders with CollectionId {0} and {1}.", searchResponse.Results[0].CollectionId, searchResponse.Results[1].CollectionId);

            // Verify MS-ASCON requirement: MS-ASCON_R176
            Site.CaptureRequirementIfIsTrue(
                allFoldersSearched,
                176,
                @"[In Finding a Conversation] Searching for a particular conversation will search across all folders for all e-mail messages that are in the conversation.");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R220");
            Site.Log.Add(LogEntryKind.Debug, "The emails found are in folders with CollectionId {0} and {1}.", searchResponse.Results[0].CollectionId, searchResponse.Results[1].CollectionId);

            // Verify MS-ASCON requirement: MS-ASCON_R220
            Site.CaptureRequirementIfIsTrue(
                allFoldersSearched,
                220,
                @"[In Processing a Search Command] When the server receives a request to find a conversation, as specified in section 3.1.4.7, the server searches across all folders for all e-mail messages that are in the conversation and returns this set of e-mail messages.");
            #endregion
        }
Exemple #5
0
        public void MSASCON_S04_TC01_MoveItems_Move()
        {
            #region Create a conversation and get the created conversation item.
            string           conversationSubject    = Common.GenerateResourceName(Site, "Conversation");
            ConversationItem sourceConversationItem = this.CreateConversation(conversationSubject);
            #endregion

            #region Call MoveItems command to move the conversation from Inbox folder to SentItems folder.
            MoveItemsResponse moveItemsResponse = this.CallMoveItemsCommand(sourceConversationItem.ServerId, User1Information.InboxCollectionId, User1Information.SentItemsCollectionId);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, User1Information.InboxCollectionId, conversationSubject, true);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, User1Information.SentItemsCollectionId, conversationSubject, false);

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

            // Verify MS-ASCON requirement: MS-ASCON_R218
            Site.CaptureRequirementIfIsNotNull(
                moveItemsResponse.ResponseData,
                218,
                @"[In Processing a MoveItems Command] The server sends a MoveItems command response, as specified in [MS-ASCMD] section 2.2.1.12.");
            #endregion

            #region Synchronize emails in the Inbox folder and Sent Items folder after conversation moved.
            // Call Sync command to get the emails of the conversation in Inbox folder.
            DataStructures.Sync syncResult = this.SyncEmail(conversationSubject, User1Information.InboxCollectionId, false, null, null);

            // Get the emails of the conversation in Sent Items folder.
            ConversationItem destinationCoversationItem = this.GetConversationItem(User1Information.SentItemsCollectionId, sourceConversationItem.ConversationId);

            // If the emails of the conversation in Inbox folder could not be found and the emails count of the conversation in Sent Items folder is equal to Inbox folder, then the original emails have been moved.
            bool allEmailsMoved = syncResult == null && sourceConversationItem.ServerId.Count == destinationCoversationItem.ServerId.Count;

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R170");
            Site.Log.Add(LogEntryKind.Debug, "The count of the emails of the specified conversation in Inbox folder is {0}, while it is {1} in Sent Items folder.", sourceConversationItem.ServerId.Count, destinationCoversationItem.ServerId.Count);

            // Verify MS-ASCON requirement: MS-ASCON_R170
            Site.CaptureRequirementIfIsTrue(
                allEmailsMoved,
                170,
                @"[In Moving a Conversation from the Current Folder] When a conversation is moved from the current folder to another folder, all e-mail messages that are in the conversation are moved from the current folder to the destination folder.");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R217");
            Site.Log.Add(LogEntryKind.Debug, "The count of the emails of the specified conversation in Inbox folder is {0}, while it is {1} in Sent Items folder.", sourceConversationItem.ServerId.Count, destinationCoversationItem.ServerId.Count);

            // Verify MS-ASCON requirement: MS-ASCON_R217
            Site.CaptureRequirementIfIsTrue(
                allEmailsMoved,
                217,
                @"[In Processing a MoveItems Command] When the server receives a request to move a conversation, as specified in section 3.1.4.5, the server moves all e-mail messages that are in the conversation from the current folder to the specified destination folder.");
            #endregion
        }
Exemple #6
0
        public void MSASCON_S03_TC05_ItemOperations_Status105()
        {
            #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 and set DstFldId to the recipient information cache.
            ItemOperationsResponse itemOperationResponse = this.ItemOperationsMove(conversationItem.ConversationId, User1Information.RecipientInformationCacheCollectionId, true);

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

            // Verify MS-ASCON requirement: MS-ASCON_R262
            Site.CaptureRequirementIfAreEqual(
                "105",
                itemOperationResponse.ResponseData.Response.Move[0].Status,
                262,
                @"[In Status] [The meaning of status value] 105 [is] Invalid Combination of IDs. The destination folder cannot be the Recipient Information Cache.");
            #endregion
        }
Exemple #7
0
        public void MSASCON_S03_TC06_ItemOperations_Status156()
        {
            #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 and set DstFldId to the Calendar folder.
            // Task folder is not the IPF.NOTE type.
            ItemOperationsResponse itemOperationResponse = this.ItemOperationsMove(conversationItem.ConversationId, User1Information.CalendarCollectionId, true);

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

            // Verify MS-ASCON requirement: MS-ASCON_R338
            Site.CaptureRequirementIfAreEqual(
                "156",
                itemOperationResponse.ResponseData.Response.Move[0].Status,
                338,
                @"[In Status] [The meaning of status value] 156 [is] Action not supported. The destination folder MUST be of type ""IPF.Note"".");
            #endregion
        }
        /// <summary>
        /// Gets the created ConversationItem.
        /// </summary>
        /// <param name="collectionId">The CollectionId of the parent folder which has the conversation.</param>
        /// <param name="conversationId">The ConversationId of the conversation.</param>
        /// <returns>A ConversationItem object.</returns>
        protected ConversationItem GetConversationItem(string collectionId, string conversationId)
        {
            // Call Sync command to get the emails in Inbox folder.
            SyncStore syncStore = this.CallSyncCommand(collectionId, false);

            // Get the emails from Sync response according to the ConversationId.
            ConversationItem conversationItem = new ConversationItem {
                ConversationId = conversationId
            };

            foreach (Sync addElement in syncStore.AddElements)
            {
                if (addElement.Email.ConversationId == conversationId)
                {
                    conversationItem.ServerId.Add(addElement.ServerId);
                }
            }

            Site.Assert.AreNotEqual <int>(0, conversationItem.ServerId.Count, "The conversation should have at least one email.");

            return(conversationItem);
        }
Exemple #9
0
        public void MSASCON_S03_TC04_ItemOperations_Status6()
        {
            #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 an invalid ConversationId.
            string conversationId = Convert.ToBase64String(Encoding.Default.GetBytes("NotExistConversationId"));
            ItemOperationsResponse itemOperationResponse = this.ItemOperationsMove(conversationId, User1Information.SentItemsCollectionId, true);

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

            // Verify MS-ASCON requirement: MS-ASCON_R146
            Site.CaptureRequirementIfAreEqual(
                "6",
                itemOperationResponse.ResponseData.Response.Move[0].Status,
                146,
                @"[In Status] [The meaning of status value] 6 [is] Not Found. The conversation [or destination folder] does not exist.");
            #endregion

            #region Call ItemOperations command with an invalid destination folder id.
            // Create an ItemOperations request and set an invalid destination folder id.
            itemOperationResponse = this.ItemOperationsMove(conversationItem.ConversationId, "NotExistFolderId", true);

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

            // Verify MS-ASCON requirement: MS-ASCON_R317
            Site.CaptureRequirementIfAreEqual(
                "6",
                itemOperationResponse.ResponseData.Response.Move[0].Status,
                317,
                @"[In Status] [The meaning of status value 6 is] Not Found. The [conversation or] destination folder does not exist.");
            #endregion
        }
Exemple #10
0
        public void MSASCON_S03_TC02_ItemOperations_MoveAlways()
        {
            #region Create a conversation and get the created conversation item
            string           conversationSubject    = Common.GenerateResourceName(Site, "Conversation");
            ConversationItem sourceConversationItem = this.CreateConversation(conversationSubject);
            #endregion

            #region Move one email in the conversation to Sent Items folder
            Collection <string> idToMove = new Collection <string>();
            idToMove.Add(sourceConversationItem.ServerId[0]);
            this.CallMoveItemsCommand(idToMove, User1Information.InboxCollectionId, User1Information.SentItemsCollectionId);
            #endregion

            #region Call ItemOperations command to move the conversation from Inbox to DeletedItems folder
            ItemOperationsResponse itemOperationResponse = this.ItemOperationsMove(sourceConversationItem.ConversationId, User1Information.DeletedItemsCollectionId, true);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, User1Information.InboxCollectionId, conversationSubject, true);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, User1Information.SentItemsCollectionId, conversationSubject, false);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, User1Information.DeletedItemsCollectionId, conversationSubject, false);

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

            // Verify MS-ASCON requirement: MS-ASCON_R143
            Site.CaptureRequirementIfAreEqual(
                "1",
                itemOperationResponse.ResponseData.Response.Move[0].Status,
                143,
                @"[In Status] [The meaning of status value] 1 [is] Success. The server successfully completed the operation.");

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

            // Verify MS-ASCON requirement: MS-ASCON_R216
            // If R143 has been captured and the ConversationId element is not null, then this requirement can be captured.
            Site.CaptureRequirementIfIsNotNull(
                itemOperationResponse.ResponseData.Response.Move[0].ConversationId,
                216,
                @"[In Always Moving a Conversation] The server sends an ItemOperations command response ([MS-ASCMD] section 2.2.1.10) that includes the itemoperations:Status element, as specified in section 2.2.2.10, and the itemoperations:ConversationId element (section 2.2.2.3.1).");
            #endregion

            #region User1 syncs messages in the Inbox folder and Deleted Items folder after conversation moved
            DataStructures.Sync syncResult = this.SyncEmail(conversationSubject, User1Information.InboxCollectionId, false, null, null);
            Site.Assert.IsNull(syncResult, "No conversation messages should not be found in Inbox folder.");

            ConversationItem destinationCoversationItem = this.GetConversationItem(User1Information.DeletedItemsCollectionId, sourceConversationItem.ConversationId);
            Site.Assert.AreEqual(sourceConversationItem.ServerId.Count - 1, destinationCoversationItem.ServerId.Count, "All conversation messages except in Sent Items Folder should be moved to Deleted Items folder.");
            #endregion

            #region User2 replies the received message to create a future e-mail message for that conversation.
            this.SwitchUser(this.User2Information, false);
            syncResult = this.SyncEmail(conversationSubject, User2Information.InboxCollectionId, true, null, null);

            string user1MailboxAddress = Common.GetMailAddress(User1Information.UserName, User1Information.UserDomain);
            string user2MailboxAddress = Common.GetMailAddress(User2Information.UserName, User2Information.UserDomain);

            // Smart reply the received email from User2 to User1.
            this.CallSmartReplyCommand(syncResult.ServerId, User2Information.InboxCollectionId, user2MailboxAddress, user1MailboxAddress, conversationSubject);

            // Switch the current user to User1.
            this.SwitchUser(this.User1Information, false);

            destinationCoversationItem = this.GetConversationItem(User1Information.DeletedItemsCollectionId, sourceConversationItem.ConversationId, sourceConversationItem.ServerId.Count + 1);
            Site.Assert.AreEqual(sourceConversationItem.ServerId.Count, destinationCoversationItem.ServerId.Count, "The future message should be moved to Deleted Items folder.");

            // Check if the received email is in Inbox folder.
            syncResult = this.SyncEmail(conversationSubject, User1Information.InboxCollectionId, false, null, null);
            Site.Assert.IsNull(syncResult, "The future message should not be found in Inbox folder.");

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

            // If all messages except the one in Sent Items Folder and future message are moved to DeletedItems folder, then this requirement can be captured.
            Site.CaptureRequirement(
                68,
                @"[In ConversationId (ItemOperations)] In an ItemOperations command request ([MS-ASCMD] section 2.2.1.10), the itemoperations:ConversationId element ([MS-ASCMD] section 2.2.3.35.1) is a required child element of the itemoperations:Move element ([MS-ASCMD] section 2.2.3.117.1) that specifies the conversation ID of the conversation that is to be moved.");

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

            // If all messages except the one in Sent Items Folder and future message are moved to DeletedItems folder, then this requirement can be captured.
            Site.CaptureRequirement(
                118,
                @"[In DstFldId] The itemoperations:DstFldId element ([MS-ASCMD] section 2.2.3.51.1) is a required child element of the itemoperations:Move element ([MS-ASCMD] section 2.2.3.117.1) in an ItemOperations command request ([MS-ASCMD] section 2.2.1.10) that specifies the folder to which the conversation is moved.");

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

            // If all messages except the one in Sent Items Folder and future message are moved to DeletedItems folder, then this requirement can be captured.
            Site.CaptureRequirement(
                130,
                @"[In MoveAlways] When a conversation is set to always be moved, all e-mail messages in the conversation, including all future e-mail messages in the conversation, are moved from all folders except the Sent Items folder to the destination folder that is specified by the DstFldId element (section 2.2.2.6).");

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

            // If all messages except the one in Sent Items Folder and future message are moved to DeletedItems folder, then this requirement can be captured.
            Site.CaptureRequirement(
                166,
                @"[In Ignoring a Conversation] When a conversation is ignored, all e-mail messages in the conversation, including all future e-mail messages for that conversation, are moved from all folders except Sent Items folder to the Deleted Items folder.");

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

            // If all messages except the one in Sent Items Folder and future message are moved to DeletedItems folder, then this requirement can be captured.
            Site.CaptureRequirement(
                172,
                @"[In Setting up a Conversation to Be Moved Always] When a conversation is set to be moved always, all e-mail messages in the conversation, including all future e-mail messages for that conversation, are moved from all folders except Sent Items folder to a destination folder.");

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

            // If all messages except the one in Sent Items Folder and future message are moved to DeletedItems folder, then this requirement can be captured.
            Site.CaptureRequirement(
                213,
                @"[In Ignoring a Conversation] When the server receives a request to ignore a conversation, as specified in section 3.1.4.4, the server moves all e-mail messages in the conversation, including all future e-mail messages for that conversation, from all folders except Sent Items folder to the Deleted Items folder.");

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

            // If all messages except the one in Sent Items Folder and future message are moved to DeletedItems folder, then this requirement can be captured.
            Site.CaptureRequirement(
                215,
                @"[In Always Moving a Conversation] When the server receives a request to always move a conversation, as specified in section 3.1.4.6, the server moves all e-mail messages in the conversation, including all future e-mail messages for that conversation, from all folders except Sent Items folder to the specified destination folder.");
            #endregion
        }
Exemple #11
0
        public void MSASCON_S01_TC01_Sync_MarkRead()
        {
            #region Create a conversation and sync to get the created conversation item.
            string           conversationSubject = Common.GenerateResourceName(Site, "Conversation");
            ConversationItem conversationItem    = this.CreateConversation(conversationSubject);
            #endregion

            #region Mark the created conversation as read.
            this.SyncChange(this.LatestSyncKey, conversationItem.ServerId, User1Information.InboxCollectionId, true, null);

            // Check whether the read property is changed to read for all messages in the conversation.
            SyncStore syncItems = this.CallSyncCommand(User1Information.InboxCollectionId, false);

            bool markRead  = true;
            int  itemCount = 0;

            foreach (Sync item in syncItems.AddElements)
            {
                if (conversationItem.ServerId.Contains(item.ServerId))
                {
                    itemCount++;
                    if (item.Email.Read != true)
                    {
                        markRead = false;
                        break;
                    }
                }
            }

            Site.Assert.AreEqual <int>(2, itemCount, "The Sync response should have 2 emails belong to the conversation.");

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

            // Verify MS-ASCON requirement: MS-ASCON_R203
            // If all emails in the created conversation are marked as read, this requirement can be captured.
            Site.CaptureRequirementIfIsTrue(
                markRead,
                203,
                @"[In Marking a Conversation as Read or Unread] When the server receives a request to mark a conversation as read [or unread], as specified in section 3.1.4.3, the server marks all e-mails that are in the conversation and that are in the current folder as  read [or unread], whichever is specified in the client request.");

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

            // Verify MS-ASCON requirement: MS-ASCON_R326
            // If all emails in the created conversation are marked as read, this requirement can be captured.
            Site.CaptureRequirementIfIsTrue(
                markRead,
                326,
                @"[In Marking a Conversation as Read or Unread] When a conversation is marked as read [or unread], all e-mail messages that are in the conversation and that are in the current folder are marked as such [read].");
            #endregion

            #region Mark the created conversation as unread.
            // Mark unread for the created conversation.
            SyncStore syncStore = this.SyncChange(this.LatestSyncKey, conversationItem.ServerId, User1Information.InboxCollectionId, false, null);

            // Check whether read property is changed to unread for all messages in the conversation.
            syncItems = this.CallSyncCommand(User1Information.InboxCollectionId, false);

            bool markUnread = true;
            itemCount = 0;

            foreach (Sync item in syncItems.AddElements)
            {
                if (conversationItem.ServerId.Contains(item.ServerId))
                {
                    itemCount++;
                    if (item.Email.Read != false)
                    {
                        markUnread = false;
                        break;
                    }
                }
            }

            Site.Assert.AreEqual <int>(2, itemCount, "The Sync response should have 2 emails belong to the conversation.");

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

            // Verify MS-ASCON requirement: MS-ASCON_R284
            // If all emails in the created conversation are marked as unread, this requirement can be captured.
            Site.CaptureRequirementIfIsTrue(
                markUnread,
                284,
                @"[In Marking a Conversation as Read or Unread] When the server receives a request to mark a conversation as [read or] unread  as specified in section 3.1.4.3, the server marks all e-mails that are in the conversation and that are in the current folder as [read or] unread, whichever is specified in the client's request.");

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

            // Verify MS-ASCON requirement: MS-ASCON_R337
            // If all emails in the created conversation are marked as unread, this requirement can be captured.
            Site.CaptureRequirementIfIsTrue(
                markUnread,
                337,
                @"[In Marking a Conversation as Read or Unread] When a conversation is marked as [read or] unread, all e-mail messages that are in the conversation and that are in the current folder are marked as such [unread].");

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

            // Verify MS-ASCON requirement: MS-ASCON_R204
            Site.CaptureRequirementIfIsNotNull(
                syncStore,
                204,
                @"[In Marking a Conversation as Read or Unread] The server sends a Sync command response as specified in [MS-ASCMD] section 2.2.1.21.");
            #endregion
        }
Exemple #12
0
        public void MSASCON_S01_TC03_Sync_Delete()
        {
            #region Create a conversation and sync to get the created conversation item.
            string           conversationSubject   = Common.GenerateResourceName(Site, "Conversation");
            ConversationItem inboxConversationItem = this.CreateConversation(conversationSubject);
            #endregion

            #region Delete the created conversation by Sync command.
            string[] serverIds = new string[inboxConversationItem.ServerId.Count];
            inboxConversationItem.ServerId.CopyTo(serverIds, 0);
            SyncStore syncStore = this.SyncDelete(User1Information.InboxCollectionId, this.LatestSyncKey, serverIds);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, User1Information.InboxCollectionId, conversationSubject, true);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, User1Information.DeletedItemsCollectionId, conversationSubject, false);

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

            // Verify MS-ASCON requirement: MS-ASCON_R201
            // If the response is not null, this requirement can be captured.
            Site.CaptureRequirementIfIsNotNull(
                syncStore,
                201,
                @"[In Deleting a Conversation] The server sends a Sync command response as specified in [MS-ASCMD] section 2.2.1.21.");
            #endregion

            #region Sync messages in the Inbox and Deleted Items folder after conversation deleted.
            Sync deleteResult = this.SyncEmail(conversationSubject, User1Information.InboxCollectionId, false, null, null);

            ConversationItem deleteConversationItem = this.GetConversationItem(User1Information.DeletedItemsCollectionId, inboxConversationItem.ConversationId);

            // Verify that server moves all e-mail messages that are in the conversation from the Inbox folder to the Deleted Items folder
            bool isDeleted = deleteConversationItem.ServerId.Count == inboxConversationItem.ServerId.Count && deleteResult == null;

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R199");
            Site.Log.Add(LogEntryKind.Debug, "The count of emails in the specified conversation moved to Deleted Items folder is {0}.", deleteConversationItem.ServerId.Count);
            Site.Log.Add(LogEntryKind.Debug, "The count of emails in the specified conversation deleted from Inbox folder is {0}.", inboxConversationItem.ServerId.Count);

            // Verify MS-ASCON requirement: MS-ASCON_R199
            // If all emails in the conversation are deleted, then this requirement is captured.
            Site.CaptureRequirementIfIsTrue(
                isDeleted,
                199,
                @"[In Deleting a Conversation] When the server receives a request to delete a conversation, as specified in section 3.1.4.1, the server moves all e-mail messages that are in the conversation from the current folder to the Deleted Items folder.");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R157");
            Site.Log.Add(LogEntryKind.Debug, "The count of emails in the specified conversation moved to Deleted Items folder is {0}.", deleteConversationItem.ServerId.Count);
            Site.Log.Add(LogEntryKind.Debug, "The count of emails in the specified conversation deleted from Inbox folder is {0}.", inboxConversationItem.ServerId.Count);

            // Verify MS-ASCON requirement: MS-ASCON_R157
            // If all emails in the conversation are deleted, then this requirement is captured.
            Site.CaptureRequirementIfIsTrue(
                isDeleted,
                157,
                @"[In Deleting a Conversation] When a conversation is deleted, all e-mail messages that are in the conversation are moved from the current folder to the Deleted Items folder.");
            #endregion

            #region User2 replies a message to create a future e-mail message for that conversation.
            // Switch the current user to User2.
            this.SwitchUser(this.User2Information, false);
            Sync syncResult = this.SyncEmail(conversationSubject, User2Information.InboxCollectionId, true, null, null);

            string user1MailboxAddress = Common.GetMailAddress(User1Information.UserName, User1Information.UserDomain);
            string user2MailboxAddress = Common.GetMailAddress(User2Information.UserName, User2Information.UserDomain);

            // Smart reply the received email from User2 to User1.
            this.CallSmartReplyCommand(syncResult.ServerId, User2Information.InboxCollectionId, user2MailboxAddress, user1MailboxAddress, conversationSubject);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, User1Information.InboxCollectionId, conversationSubject, false);

            // Switch the current user to User1.
            this.SwitchUser(this.User1Information, false);
            syncResult = this.SyncEmail(conversationSubject, User1Information.InboxCollectionId, true, null, null);
            ConversationItem futureInboxConversation = this.GetConversationItem(User1Information.InboxCollectionId, syncResult.Email.ConversationId);

            bool isFutureEmailMoved = futureInboxConversation.ServerId.Count == 1 && futureInboxConversation.ConversationId == inboxConversationItem.ConversationId;

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R158");
            Site.Log.Add(LogEntryKind.Debug, "The count of the received emails of the specified conversation in Inbox folder is {0}.", futureInboxConversation.ServerId.Count);
            Site.Log.Add(LogEntryKind.Debug, "The ConversationId of the received email in Inbox folder should be {0}, while it is {1} for the deleted emails.", futureInboxConversation.ConversationId, inboxConversationItem.ConversationId);

            // Verify MS-ASCON requirement: MS-ASCON_R158
            // New email of the conversation is received and it is not moved to Deleted Items folder, so this requirement can be captured.
            Site.CaptureRequirementIfIsTrue(
                isFutureEmailMoved,
                158,
                @"[In Deleting a Conversation] Future e-mail messages for the same conversation are not affected.");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCON_R200");
            Site.Log.Add(LogEntryKind.Debug, "The count of the received emails of the specified conversation in Inbox folder is {0}.", futureInboxConversation.ServerId.Count);
            Site.Log.Add(LogEntryKind.Debug, "The ConversationId of the received email in Inbox folder should be {0}, while it is {1} for the deleted emails.", futureInboxConversation.ConversationId, inboxConversationItem.ConversationId);

            // Verify MS-ASCON requirement: MS-ASCON_R200
            // New email of the conversation is received and it is not moved to Deleted Items folder, so this requirement can be captured.
            Site.CaptureRequirementIfIsTrue(
                isFutureEmailMoved,
                200,
                @"[In Deleting a Conversation] The server does not move future e-mail messages for the conversation.");
            #endregion
        }
Exemple #13
0
        public void MSASCON_S01_TC02_Sync_Flag()
        {
            #region Create a conversation and sync to get the created conversation item.
            string           conversationSubject = Common.GenerateResourceName(Site, "Conversation");
            ConversationItem conversationItem    = this.CreateConversation(conversationSubject);
            #endregion

            #region Set active flag to the most recent email of the conversation.
            SyncStore syncItems = this.CallSyncCommand(User1Information.InboxCollectionId, false);

            // Get the most recent email in the conversation.
            string mostRecentEmailServerId = null;
            Email  mostRecentEmail         = new Email {
                ConversationIndex = string.Empty
            };
            foreach (Sync syncItem in syncItems.AddElements)
            {
                if (conversationItem.ServerId.Contains(syncItem.ServerId) && Convert.FromBase64String(syncItem.Email.ConversationIndex).Length > Convert.FromBase64String(mostRecentEmail.ConversationIndex).Length)
                {
                    mostRecentEmail         = syncItem.Email;
                    mostRecentEmailServerId = syncItem.ServerId;
                }
            }

            // Set the flag status of the most recent email to 2.
            SyncStore syncStore = this.SyncChange(this.LatestSyncKey, new Collection <string>()
            {
                mostRecentEmailServerId
            }, User1Information.InboxCollectionId, null, "2");

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

            // Verify MS-ASCON requirement: MS-ASCON_R209
            Site.CaptureRequirementIfIsNotNull(
                syncStore,
                209,
                @"[In Flagging a Conversation for Follow-up] The server sends a Sync command response, as specified in [MS-ASCMD] section 2.2.1.21.");

            // Check whether flag status property is changed to 2 for the most recent flag in the conversation.
            syncItems = this.CallSyncCommand(User1Information.InboxCollectionId, false);

            bool setFlags = false;
            foreach (Sync item in syncItems.AddElements)
            {
                if (item.Email.ConversationId == mostRecentEmail.ConversationId && item.Email.Flag.Status == "2")
                {
                    if (item.ServerId == mostRecentEmailServerId)
                    {
                        setFlags = true;
                        continue;
                    }
                    else
                    {
                        setFlags = false;
                        break;
                    }
                }
            }

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

            // Verify MS-ASCON requirement: MS-ASCON_R324
            Site.CaptureRequirementIfIsTrue(
                setFlags,
                324,
                @"[In Flagging a Conversation for Follow-up] When a conversation is flagged for follow-up, the most recent e-mail message that is in the conversation and that is in the current folder is flagged.");

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

            // Verify MS-ASCON requirement: MS-ASCON_R206
            Site.CaptureRequirementIfIsTrue(
                setFlags,
                206,
                @"[In Flagging a Conversation for Follow-up] When the server receives a request to flag a conversation for follow-up, as specified in section 3.1.4.2, the server flags the most recent e-mail message that is in the conversation and that is in the current folder.");
            #endregion

            #region Clear flag of the conversation.
            // Set conversation flag's status to 0 for clearing the active flag.
            this.SyncChange(this.LatestSyncKey, conversationItem.ServerId, User1Information.InboxCollectionId, null, "0");

            // Check whether flag of all messages are cleared.
            syncItems = this.CallSyncCommand(User1Information.InboxCollectionId, false);

            bool clearFlags = true;
            int  itemCount  = 0;

            foreach (Sync item in syncItems.AddElements)
            {
                if (conversationItem.ServerId.Contains(item.ServerId))
                {
                    itemCount++;
                    if (!string.IsNullOrEmpty(item.Email.Flag.Status))
                    {
                        clearFlags = false;
                        break;
                    }
                }
            }

            Site.Assert.AreEqual <int>(2, itemCount, "The Sync response should have 2 emails belong to the conversation.");

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

            // Verify MS-ASCON requirement: MS-ASCON_R207
            Site.CaptureRequirementIfIsTrue(
                clearFlags,
                207,
                @"[In Flagging a Conversation for Follow-up] If a flag is cleared on a conversation, the server clears flags on all e-mail messages that are in the conversation and that are in the current folder");

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

            // Verify MS-ASCON requirement: MS-ASCON_R325
            Site.CaptureRequirementIfIsTrue(
                clearFlags,
                325,
                @"[In Flagging a Conversation for Follow-up] Clearing a flag on a conversation will clear flags on all e-mail messages that are in the conversation and that are in the current folder.");
            #endregion

            #region Mark complete flag to the conversation.
            // Set conversation flags status to 1 for setting a complete flag.
            this.SyncChange(this.LatestSyncKey, conversationItem.ServerId, User1Information.InboxCollectionId, null, "1");

            // Check whether flag status property is changed to 1 for all messages in the conversation.
            syncItems = this.CallSyncCommand(User1Information.InboxCollectionId, false);

            bool markCompleteFlags = true;
            itemCount = 0;

            foreach (Sync item in syncItems.AddElements)
            {
                if (conversationItem.ServerId.Contains(item.ServerId))
                {
                    itemCount++;
                    if (item.Email.Flag.Status != "1")
                    {
                        markCompleteFlags = false;
                        break;
                    }
                }
            }

            Site.Assert.AreEqual <int>(2, itemCount, "The Sync response should have 2 emails belong to the conversation.");

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

            // Verify MS-ASCON requirement: MS-ASCON_R162
            // If all emails in the conversation are marked as complete, then this requirement can be captured
            Site.CaptureRequirementIfIsTrue(
                markCompleteFlags,
                162,
                @"[In Flagging a Conversation for Follow-up] Marking a flagged conversation as complete will mark all flagged e-mail messages that are in the conversation and that are in the current folder as complete.");

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

            // Verify MS-ASCON requirement: MS-ASCON_R208
            // If all emails in the conversation are marked as complete, then this requirement can be captured
            Site.CaptureRequirementIfIsTrue(
                markCompleteFlags,
                208,
                @"[In Flagging a Conversation for Follow-up] If a flagged conversation is marked as complete, the server marks all flagged e-mail messages that are in the conversation and that are in the current folder as complete.");
            #endregion
        }