Esempio n. 1
0
        public void MSASCMD_S10_TC05_MoveItems_Status4()
        {
            #region User2 sends mail to User1 and does FolderSync in User1's mailbox.
            string subject = this.SendMailAndFolderSync();
            #endregion

            #region Call method Sync to synchronize changes of Inbox folder in User1's mailbox between the client and the server.
            SyncResponse syncResponse = this.GetMailItem(this.User1Information.InboxCollectionId, subject);
            string       serverId     = TestSuiteBase.FindServerId(syncResponse, "Subject", subject);
            #endregion

            #region Call method MoveItems with the email item's ServerId to move the email item from Inbox folder to Inbox folder.
            MoveItemsRequest  moveItemsRequest  = TestSuiteBase.CreateMoveItemsRequest(serverId, this.User1Information.InboxCollectionId, this.User1Information.InboxCollectionId);
            MoveItemsResponse moveItemsResponse = this.CMDAdapter.MoveItems(moveItemsRequest);

            this.CheckMoveItemsResponse(moveItemsResponse, 1);

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

            // Verify MS-ASCMD requirement: MS-ASCMD_R4219
            Site.CaptureRequirementIfAreEqual <int>(
                4,
                int.Parse(moveItemsResponse.ResponseData.Response[0].Status),
                4219,
                @"[In Status(MoveItems)] [When the scope is Item], [the cause of the status value 4 is] The client supplied a destination folder that is the same as the source.");
            #endregion
        }
Esempio n. 2
0
        public void MSASCMD_S10_TC04_MoveItems_Status2()
        {
            #region User2 sends mail to User1 and does FolderSync in User1's mailbox.
            string subject = this.SendMailAndFolderSync();
            #endregion

            #region Call method Sync to synchronize changes of Inbox folder in User1's mailbox between the client and the server.
            SyncResponse syncResponse = this.GetMailItem(this.User1Information.InboxCollectionId, subject);
            string       serverId     = TestSuiteBase.FindServerId(syncResponse, "Subject", subject);
            #endregion

            #region Call method MoveItems with the email item's ServerId to move the email item from Inbox folder to an invalid destination folder.
            MoveItemsRequest  moveItemsRequest  = TestSuiteBase.CreateMoveItemsRequest(serverId, this.User1Information.InboxCollectionId, "Invalid DstFldId");
            MoveItemsResponse moveItemsResponse = this.CMDAdapter.MoveItems(moveItemsRequest);

            this.CheckMoveItemsResponse(moveItemsResponse, 1);

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

            // Verify MS-ASCMD requirement: MS-ASCMD_R4212
            Site.CaptureRequirementIfAreEqual <int>(
                2,
                int.Parse(moveItemsResponse.ResponseData.Response[0].Status),
                4212,
                @"[In Status(MoveItems)] [When the scope is Item], [the cause of the status value 2 is] The destination folder collection ID (CollectionId element value) is not recognized by the server, possibly because the source folder has been deleted.");
            #endregion
        }
Esempio n. 3
0
        public void MSASCMD_S10_TC03_MoveItems_Status1_InvalidSrcMsgId()
        {
            #region User2 calls SendMail command to send a mail to User1.
            string subject = this.SendMailAndFolderSync();
            #endregion

            #region User1 calls Sync command to synchronize changes of Inbox folder and get the ServerId of sent email item and the latest SyncKey.
            SyncResponse syncResponseInbox = this.GetMailItem(this.User1Information.InboxCollectionId, subject);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, this.User1Information.InboxCollectionId, subject);
            string serverId = TestSuiteBase.FindServerId(syncResponseInbox, "Subject", subject);
            #endregion

            #region User1 calls MoveItems command with the received email item's ServerId to move the email item from Inbox folder to DeletedItems folder.
            MoveItemsRequest  moveItemsRequest  = TestSuiteBase.CreateMoveItemsRequest(serverId, this.User1Information.InboxCollectionId, this.User1Information.DeletedItemsCollectionId);
            MoveItemsResponse moveItemsResponse = this.CMDAdapter.MoveItems(moveItemsRequest);

            this.CheckMoveItemsResponse(moveItemsResponse, 1);
            TestSuiteBase.RemoveRecordCaseRelativeItems(this.User1Information, this.User1Information.InboxCollectionId, subject);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, this.User1Information.DeletedItemsCollectionId, subject);
            #endregion

            #region User1 calls MoveItems command with the received email item's ServerId again to move the email item from Inbox folder to DeletedItems folder after the email item is not exist in Inbox folder.
            moveItemsRequest  = TestSuiteBase.CreateMoveItemsRequest(serverId, this.User1Information.InboxCollectionId, this.User1Information.DeletedItemsCollectionId);
            moveItemsResponse = this.CMDAdapter.MoveItems(moveItemsRequest);

            this.CheckMoveItemsResponse(moveItemsResponse, 1);

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

            // Verify MS-ASCMD requirement: MS-ASCMD_R4208
            Site.CaptureRequirementIfAreEqual <int>(
                1,
                int.Parse(moveItemsResponse.ResponseData.Response[0].Status),
                4208,
                @"[In Status(MoveItems)] [When the scope is Item], [the cause of the status value 1 is] Or, the item with the Item ID (SrcMsgId element (section 2.2.3.160)) has been previously moved out of the folder with the Folder ID (SrcFldId element (section 2.2.3.159)).");
            #endregion
        }
Esempio n. 4
0
        public void MSASCMD_S10_TC02_MoveItems_Status1_InvalidSrcFldId()
        {
            #region User2 sends mail to User1 and does FolderSync in User1's mailbox.
            string subject = this.SendMailAndFolderSync();
            #endregion

            #region Call method Sync to synchronize changes of Inbox folder in User1's mailbox between the client and the server, and get the ServerId of sent email item
            SyncResponse syncResponse = this.GetMailItem(this.User1Information.InboxCollectionId, subject);
            string       serverId     = TestSuiteBase.FindServerId(syncResponse, "Subject", subject);
            #endregion

            #region Call method MoveItems with the email item's ServerId to move the email item from an invalid source folder to DeletedItems folder.
            MoveItemsRequest  moveItemsRequest  = TestSuiteBase.CreateMoveItemsRequest(serverId, "Invalid SrcFldId", this.User1Information.DeletedItemsCollectionId);
            MoveItemsResponse moveItemsResponse = this.CMDAdapter.MoveItems(moveItemsRequest);

            this.CheckMoveItemsResponse(moveItemsResponse, 1);

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

            // Verify MS-ASCMD requirement: MS-ASCMD_R4201
            Site.CaptureRequirementIfAreEqual <int>(
                1,
                int.Parse(moveItemsResponse.ResponseData.Response[0].Status),
                4201,
                @"[In Status(MoveItems)] If the command failed, Status contains a code indicating the type of failure.");

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

            // Verify MS-ASCMD requirement: MS-ASCMD_R4207
            Site.CaptureRequirementIfAreEqual <int>(
                1,
                int.Parse(moveItemsResponse.ResponseData.Response[0].Status),
                4207,
                @"[In Status(MoveItems)] [When the scope is Item], [the cause of the status value 1 is] The source folder collection ID (CollectionId element (section 2.2.3.30.5) value) is not recognized by the server, possibly because the source folder has been deleted.");
            #endregion
        }
Esempio n. 5
0
        public void MSASCMD_S11_TC06_Ping_ChangesOccurred()
        {
            #region User2 calls CreateFolder command to create two sub folders in user Inbox folder
            this.SwitchUser(this.User2Information);
            int           folderCreateCount = 2;
            List <string> folderIDList      = new List <string>();
            for (int folderIndex = 0; folderIndex < folderCreateCount; folderIndex++)
            {
                string folderID = this.CreateFolder((byte)FolderType.UserCreatedMail, Common.GenerateResourceName(Site, "FolderCreate", (uint)(folderIndex + 1)), this.User2Information.InboxCollectionId);
                folderIDList.Add(folderID);

                // Sync the new created folder
                this.SyncChanges(folderID);
            }

            // Record created folders
            TestSuiteBase.RecordCaseRelativeFolders(this.User2Information, folderIDList.ToArray());
            #endregion

            #region User1 calls SendMail command to send one mail to user2, then user2 move the email to one of new created folder
            this.SwitchUser(this.User1Information);
            string emailSubject = Common.GenerateResourceName(Site, "subject");
            this.SendPlainTextEmail(null, emailSubject, this.User1Information.UserName, this.User2Information.UserName, null);

            // User2 calls Sync command to get the email, then moves to sub folder
            this.SwitchUser(this.User2Information);
            SyncResponse syncInboxFolderResponse = this.GetMailItem(this.User2Information.InboxCollectionId, emailSubject);
            string       emailItemServerID       = TestSuiteBase.FindServerId(syncInboxFolderResponse, "Subject", emailSubject);

            // User2 calls MoveItems command to move the email item from Inbox folder to one of created subfolder
            MoveItemsRequest  moveItemsRequest  = TestSuiteBase.CreateMoveItemsRequest(emailItemServerID, this.User2Information.InboxCollectionId, folderIDList[0]);
            MoveItemsResponse moveItemsResponse = this.CMDAdapter.MoveItems(moveItemsRequest);
            Site.Assert.AreEqual(3, Convert.ToInt32(moveItemsResponse.ResponseData.Response[0].Status), " If MoveItems command executes successfully, server should return status 3");
            #endregion

            #region Resend ping request to monitor the changes in sub folders and record duration
            DateTime     startTime    = DateTime.Now;
            PingRequest  pingRequest  = CreateMultiFolderPingRequest(folderIDList, Request.PingFolderClass.Email);
            PingResponse pingResponse = this.CMDAdapter.Ping(pingRequest);
            DateTime     endTime      = DateTime.Now;
            TimeSpan     duration     = endTime - startTime;
            #endregion

            #region Verify Requirements MS-ASCMD_R306, MS-ASCMD_R4235, MS-ASCMD_R4236, MS-ASCMD_R5714, MS-ASCMD_R5636
            // Ping command is used to monitor specified folder changes, if changes happened in the folders, server will return status 2 in Ping response, then MS-ASCMD_R306, MS-ASCMD_R4235, MS-ASCMD_R4236, MS-ASCMD_R5636 are verified.
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R306");

            // Verify MS-ASCMD requirement: MS-ASCMD_R306
            Site.CaptureRequirementIfIsNotNull(
                pingResponse.ResponseData.Status,
                306,
                @"[In Ping] The Ping command is used to request that the server monitor specified folders for changes that would require the client to resynchronize.");

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

            // Verify MS-ASCMD requirement: MS-ASCMD_R4235
            Site.CaptureRequirementIfAreEqual <int>(
                2,
                int.Parse(pingResponse.ResponseData.Status),
                4235,
                @"[In Status(Ping)] [When the scope is] Global, [the meaning of the status value] 2 [is] Changes occurred in at least one of the monitored folders.");

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

            // Verify MS-ASCMD requirement: MS-ASCMD_R5636
            Site.CaptureRequirementIfAreEqual <int>(
                2,
                int.Parse(pingResponse.ResponseData.Status),
                5636,
                @"[In Monitoring Folders for New Items] The server uses the last airsync:SyncKey element (as specified in section 2.2.3.166.4) value returned to the client when determining what to report in the Ping response.");

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

            // Verify MS-ASCMD requirement: MS-ASCMD_R4236
            Site.CaptureRequirementIfAreEqual <int>(
                2,
                int.Parse(pingResponse.ResponseData.Status),
                4236,
                @"[In Status(Ping)] [When the scope is] Global, [the meaning of the status value 2 is] The response specifies the changed folders.");

            if (Common.IsRequirementEnabled(5714, this.Site))
            {
                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R5714");

                // Verify MS-ASCMD requirement: MS-ASCMD_R5714
                Site.CaptureRequirementIfIsTrue(
                    pingRequest.RequestData.HeartbeatInterval != null && int.Parse(pingResponse.ResponseData.Status) == 2 && duration.Milliseconds < Convert.ToInt32(pingRequest.RequestData.HeartbeatInterval) * 1000,
                    5714,
                    @"[In Appendix A: Product Behavior] The body of the request contains an interval of time that specifies how long the implementation does wait before responding if no new items are added to the specified folders. (Exchange 2007 and above follow this behavior.)");
            }
            #endregion

            #region Send ping request with empty HeartbeatInterval element, if server returns status equal to 2 then MS-ASCMD_R5836 is verified.
            pingRequest = CreateMultiFolderPingRequest(folderIDList, Request.PingFolderClass.Email);
            pingRequest.RequestData.HeartbeatInterval = null;
            pingResponse = this.CMDAdapter.Ping(pingRequest);
            #endregion

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

            // Verify MS-ASCMD requirement: MS-ASCMD_R5836
            Site.CaptureRequirementIfAreEqual <int>(
                2,
                int.Parse(pingResponse.ResponseData.Status),
                5836,
                @"[In Status(Ping)] [When the scope is Global], The server saves the heartbeat interval value (section 2.2.3.79.1), so only the folder list is required on subsequent requests.");
        }
Esempio n. 6
0
        public void MSASCMD_S10_TC01_MoveItems_Success()
        {
            #region User2 sends mail to User1 and does FolderSync in User1's mailbox.
            string subject = this.SendMailAndFolderSync();
            #endregion

            #region Call method Sync to synchronize changes of Inbox folder in User1's mailbox between the client and the server, and get the ServerId of sent email item and the SyncKey
            SyncResponse syncResponseInbox = this.GetMailItem(this.User1Information.InboxCollectionId, subject);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, this.User1Information.InboxCollectionId, subject);
            string syncKeyInbox = this.LastSyncKey;
            string serverId     = TestSuiteBase.FindServerId(syncResponseInbox, "Subject", subject);
            #endregion

            #region Call method Sync to synchronize changes of DeletedItems folder in User1's mailbox between the client and the server, and get the SyncKey
            this.SyncChanges(this.User1Information.DeletedItemsCollectionId);
            string syncKeyDeletedItems = this.LastSyncKey;
            #endregion

            #region Call method MoveItems with the email item's ServerId to move the email item from Inbox folder to DeletedItems folder.
            MoveItemsRequest  moveItemsRequest  = TestSuiteBase.CreateMoveItemsRequest(serverId, this.User1Information.InboxCollectionId, this.User1Information.DeletedItemsCollectionId);
            MoveItemsResponse moveItemsResponse = this.CMDAdapter.MoveItems(moveItemsRequest);

            this.CheckMoveItemsResponse(moveItemsResponse, 1);

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

            // Verify MS-ASCMD requirement: MS-ASCMD_R4217
            Site.CaptureRequirementIfAreEqual <string>(
                "3",
                moveItemsResponse.ResponseData.Response[0].Status,
                4217,
                @"[In Status(MoveItems)] [When the scope is Global], [the cause of the status value 3 is] Server successfully completed command.");

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

            Site.CaptureRequirementIfAreEqual <string>(
                serverId,
                moveItemsResponse.ResponseData.Response[0].SrcMsgId,
                3977,
                "[In SrcMsgId] The SrcMsgId element is a required child element of the Response element in MoveItems command responses that specifies the server ID of the item that was moved.");

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

            Site.CaptureRequirementIfAreNotEqual <string>(
                serverId,
                moveItemsResponse.ResponseData.Response[0].DstMsgId,
                285,
                "[In MoveItems] The MoveItems command moves an item or items from one folder on the server to another [folder].");

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

            Site.CaptureRequirementIfAreNotEqual <string>(
                serverId,
                moveItemsResponse.ResponseData.Response[0].DstMsgId,
                290,
                "[In MoveItems] An item that has been successfully moved to a different folder can be assigned a new server ID by the server.");
            #endregion

            #region Call method Sync to synchronize changes of Inbox folder and DeletedItems folder in User1's mailbox, and record the item changes for clean up
            bool isItemDeleted = this.CheckDeleteInSyncResponse(syncKeyInbox, this.User1Information.InboxCollectionId, serverId);
            Site.Assert.IsTrue(isItemDeleted, "The item with ServerId: {0} should be deleted for collection ID: {0}.", serverId, this.User1Information.InboxCollectionId);
            TestSuiteBase.RemoveRecordCaseRelativeItems(this.User1Information, this.User1Information.InboxCollectionId, subject);

            bool isItemAdded = this.CheckAddInSyncResponse(syncKeyDeletedItems, this.User1Information.DeletedItemsCollectionId, subject);

            Site.Assert.IsTrue(isItemAdded, "The item with ServerId: {0} should be added for Deleted Items folder", serverId);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, this.User1Information.DeletedItemsCollectionId, subject);

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

            // Verify MS-ASCMD requirement: MS-ASCMD_R289
            // This requirement can be captured directly after previous step when synchronize changes of Inbox folder, there is a Delete operation,
            // and synchronize changes of DeletedItems folder, there is an Add operation.
            Site.CaptureRequirement(
                289,
                @"[In MoveItems] When items are moved between folders on the server, the client receives Delete (section 2.2.3.42) and Add (section 2.2.3.7) operations the next time the client synchronizes the affected folders.");

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

            // Verify MS-ASCMD requirement: MS-ASCMD_R5879
            // This requirement can be captured directly after previous step when synchronize changes of Inbox folder, there is a Delete operation on the source item
            // and synchronize changes of DeletedItems folder, there is an Add operation on the item with same subject.
            Site.CaptureRequirement(
                5879,
                @"[In SrcFldId] [The SrcFldId element] specifies the server ID of the source folder (that is, the folder that contains the items to be moved).");
            #endregion
        }