Exemple #1
0
        /// <summary>
        /// Call SendMail command to send one voice email
        /// </summary>
        /// <param name="emailSubject">Email subject</param>
        /// <param name="firstVoiceFilePath">First voice attachment file name</param>
        /// <param name="secondVoiceFilePath">Second voice attachment file name</param>
        /// <returns>Email item</returns>
        private Sync SendVoiceMail(string emailSubject, string firstVoiceFilePath, string secondVoiceFilePath)
        {
            // Create mail content
            string senderEmail   = Common.GetMailAddress(this.User1Information.UserName, this.User1Information.UserDomain);
            string receiverEmail = Common.GetMailAddress(this.User2Information.UserName, this.User2Information.UserDomain);
            string emailBody     = Common.GenerateResourceName(Site, "content");
            string callNumber    = "7125550123";

            // Create voice mail content mime
            string voiceMailMime = TestSuiteHelper.CreateVoiceAttachmentMime(
                senderEmail,
                receiverEmail,
                emailSubject,
                emailBody,
                callNumber,
                firstVoiceFilePath,
                secondVoiceFilePath);

            string           clientId        = TestSuiteHelper.GetClientId();
            SendMailRequest  sendMailRequest = TestSuiteHelper.CreateSendMailRequest(clientId, false, voiceMailMime);
            SendMailResponse response        = this.EMAILAdapter.SendMail(sendMailRequest);

            // Verify send voice mail success
            Site.Assert.AreEqual <string>(
                string.Empty,
                response.ResponseDataXML,
                "The server should return an empty xml response data to indicate SendMail command executes successfully.",
                response.ResponseDataXML);

            #region Record user name, folder collectionId and item subject that are used in this case.
            this.SwitchUser(this.User2Information, true);
            this.RecordCaseRelativeItems(this.User2Information.UserName, this.User2Information.InboxCollectionId, emailSubject);
            #endregion

            #region Sync changes in user2 mailbox .
            // Sync changes
            SyncStore result    = this.GetSyncResult(emailSubject, this.User2Information.InboxCollectionId, null);
            Sync      emailItem = TestSuiteHelper.GetSyncAddItem(result, emailSubject);
            #endregion

            return(emailItem);
        }