GetSyncRequest() 정적인 개인적인 메소드

Get the request of Sync command.
static private GetSyncRequest ( string collectionId, string syncKey, Request bodyPartPreference, Request bodyPreference, bool conversationMode ) : SyncRequest
collectionId string The collection id of the folder to sync.
syncKey string The SyncKey of the latest sync.
bodyPartPreference Microsoft.Protocols.TestSuites.Common.Request The bodyPartPreference in the options element.
bodyPreference Microsoft.Protocols.TestSuites.Common.Request The bodyPreference in the options element.
conversationMode bool The value of ConversationMode element.
리턴 SyncRequest
예제 #1
0
        public void MSASCON_S01_TC08_Sync_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 sync command with BodyPartPreference element and set the Type element to 3
            this.SwitchUser(this.User1Information, false);

            // Check whether the mail has been received.
            this.SyncEmail(subject, User1Information.InboxCollectionId, true, null, null);

            Request.BodyPartPreference bodyPartPreference = new Request.BodyPartPreference()
            {
                Type = 3,
            };

            // Call initial Sync command.
            SyncRequest syncRequest = Common.CreateInitialSyncRequest(User1Information.InboxCollectionId);
            SyncStore   syncStore   = this.CONAdapter.Sync(syncRequest);

            syncRequest = TestSuiteHelper.GetSyncRequest(User1Information.InboxCollectionId, syncStore.SyncKey, bodyPartPreference, null, false);
            syncStore   = this.CONAdapter.Sync(syncRequest);
            this.VerifyMessagePartStatus164(syncStore.Status);
            #endregion
        }
예제 #2
0
        /// <summary>
        /// Find the specified email.
        /// </summary>
        /// <param name="subject">The subject of the email to find.</param>
        /// <param name="collectionId">The folder collectionId which needs to be synchronized.</param>
        /// <param name="isRetryNeeded">A Boolean value indicates whether need retry.</param>
        /// <param name="bodyPartPreference">The bodyPartPreference in the options element.</param>
        /// <param name="bodyPreference">The bodyPreference in the options element.</param>
        /// <returns>The found email object.</returns>
        protected Sync SyncEmail(string subject, string collectionId, bool isRetryNeeded, Request.BodyPartPreference bodyPartPreference, Request.BodyPreference bodyPreference)
        {
            // Call initial Sync command.
            SyncRequest syncRequest = Common.CreateInitialSyncRequest(collectionId);
            SyncStore   syncStore   = this.CONAdapter.Sync(syncRequest);

            // Find the specific email.
            syncRequest = TestSuiteHelper.GetSyncRequest(collectionId, syncStore.SyncKey, bodyPartPreference, bodyPreference, false);
            Sync syncResult = this.CONAdapter.SyncEmail(syncRequest, subject, isRetryNeeded);

            this.LatestSyncKey = syncStore.SyncKey;

            return(syncResult);
        }
예제 #3
0
        /// <summary>
        /// Sync items in the specified folder.
        /// </summary>
        /// <param name="collectionId">The CollectionId of the folder.</param>
        /// <param name="conversationMode">The value of ConversationMode element.</param>
        /// <returns>A SyncStore instance that contains the result.</returns>
        protected SyncStore CallSyncCommand(string collectionId, bool conversationMode)
        {
            // Call initial Sync command.
            SyncRequest syncRequest = Common.CreateInitialSyncRequest(collectionId);

            SyncStore syncStore = this.CONAdapter.Sync(syncRequest);

            // Verify Sync command response.
            Site.Assert.AreEqual <byte>(
                1,
                syncStore.CollectionStatus,
                "If the Sync command executes successfully, the Status in response should be 1.");

            if (conversationMode && Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site) != "12.1")
            {
                syncRequest = TestSuiteHelper.GetSyncRequest(collectionId, syncStore.SyncKey, null, null, true);
            }
            else
            {
                syncRequest = TestSuiteHelper.GetSyncRequest(collectionId, syncStore.SyncKey, null, null, false);
            }

            syncStore = this.CONAdapter.Sync(syncRequest);

            // Verify Sync command response.
            Site.Assert.AreEqual <byte>(
                1,
                syncStore.CollectionStatus,
                "If the Sync command executes successfully, the Status in response should be 1.");

            bool checkSyncStore = syncStore.AddElements != null && syncStore.AddElements.Count != 0;

            Site.Assert.IsTrue(checkSyncStore, "The items should be gotten from the Sync command response.");

            this.LatestSyncKey = syncStore.SyncKey;

            return(syncStore);
        }
예제 #4
0
        public void MSASCON_S01_TC06_Sync_NoConversationId()
        {
            #region Initialize sync and get synckey.
            SyncRequest syncRequest = Common.CreateInitialSyncRequest(User1Information.CalendarCollectionId);
            SyncStore   syncStore   = this.CONAdapter.Sync(syncRequest);
            #endregion

            #region Create a calendar item and sync to get the ConversationId node in the response xml.
            string calendarSubject = Common.GenerateResourceName(Site, "TestCalendar");
            this.SyncAdd(User1Information.CalendarCollectionId, calendarSubject, syncStore.SyncKey);
            TestSuiteBase.RecordCaseRelativeItems(this.User1Information, User1Information.CalendarCollectionId, calendarSubject, false);

            // Call initial Sync command.
            syncRequest = Common.CreateInitialSyncRequest(User1Information.CalendarCollectionId);
            syncStore   = this.CONAdapter.Sync(syncRequest);

            // Sync calendar folder
            syncRequest = TestSuiteHelper.GetSyncRequest(User1Information.CalendarCollectionId, syncStore.SyncKey, null, null, false);
            this.CONAdapter.Sync(syncRequest);
            System.Xml.XmlDocument xmlDoc          = new System.Xml.XmlDocument();
            XmlElement             lastRawResponse = (XmlElement)this.CONAdapter.LastRawResponseXml;
            xmlDoc.LoadXml(lastRawResponse.InnerXml);
            System.Xml.XmlNodeList conversationIdNodes = xmlDoc.GetElementsByTagName("ConversationId");

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

            // Verify MS-ASCON requirement: MS-ASCON_R77
            // If the ConversionId node does not exist, then this requirement can be captured.
            Site.CaptureRequirementIfAreEqual(
                0,
                conversationIdNodes.Count,
                77,
                @"[In ConversationId (Sync)] The email2:ConversationId element is not present if there is no conversation ID associated with the message.");
            #endregion
        }