示例#1
0
        public string GetCorrectValue(QueryValueType type)
        {
            int index = (int)type;

            if (values.Length <= index)
            {
                return("");
            }
            else
            {
                string result = "";
                switch (type)
                {
                case QueryValueType.Index:
                case QueryValueType.Message:
                    result = values[index];
                    break;

                case QueryValueType.Date:
                    result = values[index];
                    break;

                case QueryValueType.Pay:
                case QueryValueType.Dedit:
                    result = GetCorrectFormat(values[index]);
                    break;
                }
                return(result);
            }
        }
 /// <summary>
 /// Changes http request header encoding type
 /// </summary>
 /// <param name="headerEncodingType">The header encoding type</param>
 public void ChangeHeaderEncodingType(QueryValueType headerEncodingType)
 {
     this.activeSyncClient.QueryValueType = headerEncodingType;
 }
示例#3
0
 public QueryValue(object value, QueryValueType valueType)
 {
     this.Value     = value;
     this.ValueType = valueType;
 }
        /// <summary>
        /// Verify the LongId command parameter.
        /// </summary>
        /// <param name="queryValueType">The query value type of the request.</param>
        protected void VerifyLongIdCommandParameter(QueryValueType queryValueType)
        {
            #region Call SendMail command to send email to User2.
            IDictionary<HTTPPOSTRequestPrefixField, string> requestPrefix = new Dictionary<HTTPPOSTRequestPrefixField, string>();
            string sendMailSubject = Common.GenerateResourceName(Site, "SendMail");
            string smartForwardSubject = Common.GenerateResourceName(Site, "SmartForward");
            string smartReplySubject = Common.GenerateResourceName(Site, "SmartReply");

            // Call ConfigureRequestPrefixFields to change the QueryValueType.
            requestPrefix.Add(HTTPPOSTRequestPrefixField.QueryValueType, queryValueType.ToString());
            this.HTTPAdapter.ConfigureRequestPrefixFields(requestPrefix);

            // Call FolderSync command to synchronize the collection hierarchy.
            this.CallFolderSyncCommand();
            string userOneMailboxAddress = Common.GetMailAddress(this.UserOneInformation.UserName, this.UserOneInformation.UserDomain);
            string userTwoMailboxAddress = Common.GetMailAddress(this.UserTwoInformation.UserName, this.UserTwoInformation.UserDomain);

            // Call SendMail command to send email to User2.
            this.CallSendMailCommand(userOneMailboxAddress, userTwoMailboxAddress, sendMailSubject, null);
            #endregion

            #region Call SmartForward command with the LongId command parameter returned from Search response.
            // Call ConfigureRequestPrefixFields to switch the credential to User2 and synchronize the collection hierarchy.
            this.SwitchUser(this.UserTwoInformation, true);

            // Add the received email to the created items collection of User2.
            this.AddCreatedItemToCollection("User2", this.UserTwoInformation.InboxCollectionId, sendMailSubject);

            // Call Search command to find the received email and get the LongId of it.
            Response.SearchResponseStoreResult searchResult = this.LoopToSearchItem(this.UserTwoInformation.InboxCollectionId, sendMailSubject);

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

            // Verify MS-ASHTTP requirement: MS-ASHTTP_R484
            // SendMail command executed successfully and the received email can be got from server, so this requirement can be captured.
            Site.CaptureRequirementIfIsNotNull(
                searchResult,
                484,
                @"[In Command Codes] [Command] SendMail sends mail to the server.");

            string userThreeMailboxAddress = Common.GetMailAddress(this.UserThreeInformation.UserName, this.UserThreeInformation.UserDomain);

            // Call SmartForward command to forward the received email to User3 with the LongId command parameter returned from Search response.
            this.CallSmartForwardCommand(userTwoMailboxAddress, userThreeMailboxAddress, null, smartForwardSubject, null, searchResult.LongId, null);
            #endregion

            #region Get the received email.
            // Call ConfigureRequestPrefixFields to switch the credential to User3 and synchronize the collection hierarchy.
            this.SwitchUser(this.UserThreeInformation, true);

            // Add the received email to CreatedItemsForUserThree collection to delete.
            this.AddCreatedItemToCollection("User3", this.UserThreeInformation.InboxCollectionId, smartForwardSubject);

            // Call Sync command to get the ServerId of the received email.
            string itemServerId = this.LoopToSyncItem(this.UserThreeInformation.InboxCollectionId, smartForwardSubject, true);

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

            // Verify MS-ASHTTP requirement: MS-ASHTTP_R488
            // SmartForward command executed successfully with the ServerId of the original email, so this requirement can be captured.
            Site.CaptureRequirementIfIsNotNull(
                itemServerId,
                488,
                @"[In Command Codes] [Command] SmartForward forwards a Message object without retrieving the full Message object from the server.");

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

            // Verify MS-ASHTTP requirement: MS-ASHTTP_R118
            // SmartForward command executed successfully with setting LongId command parameter, so this requirement can be captured.
            Site.CaptureRequirement(
                118,
                @"[In Command-Specific URI Parameters] [Parameter] LongId [is used by] SmartForward.");
            #endregion

            #region Call SmartReply command with the LongId command parameter returned from Search response.
            // If the query value type is PlainText, call SmartReply command and verify related requirements.
            if (queryValueType == QueryValueType.PlainText)
            {
                // Call Search command to find the received email and get the LongId of it.
                searchResult = this.LoopToSearchItem(this.UserThreeInformation.InboxCollectionId, smartForwardSubject);

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

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R512
                // The LongId returned from Search command response is not null, this requirement can be captured.
                Site.CaptureRequirementIfIsNotNull(
                    searchResult.LongId,
                    512,
                    @"[In Command-Specific URI Parameters] [Parameter] LongId [is described as] A string that references a result set that was returned in the Search command response.");
              
                // Call SmartReply command to reply the received email to User2 with the LongId command parameter.
                this.CallSmartReplyCommand(userThreeMailboxAddress, userTwoMailboxAddress, null, smartReplySubject, null, searchResult.LongId, null);

                // Call ConfigureRequestPrefixFields to switch the credential to User2 and synchronize the collection hierarchy.
                this.SwitchUser(this.UserTwoInformation, false);

                // Add the received email to CreatedItemsForUserTwo collection to delete.
                this.AddCreatedItemToCollection("User2", this.UserTwoInformation.InboxCollectionId, smartReplySubject);

                // Call Sync command to get the ServerId of the received email.
                itemServerId = this.LoopToSyncItem(this.UserTwoInformation.InboxCollectionId, smartReplySubject, true);

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

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R489
                // SmartReply command executed successfully with the ServerId of the original email, so this requirement can be captured.
                Site.CaptureRequirementIfIsNotNull(
                    itemServerId,
                    489,
                    @"[In Command Codes] [Command] SmartReply replies to a Message object without retrieving the full Message object from the server.");

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

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R528
                // SmartReply command executed successfully with setting LongId command parameter, so this requirement can be captured.
                Site.CaptureRequirement(
                    528,
                    @"[In Command-Specific URI Parameters] [Parameter] LongId [is used by] SmartReply.");
            }
            #endregion

            #region Reset the query value type and user credential.
            requestPrefix[HTTPPOSTRequestPrefixField.QueryValueType] = Common.GetConfigurationPropertyValue("HeaderEncodingType", this.Site);
            this.HTTPAdapter.ConfigureRequestPrefixFields(requestPrefix);
            this.SwitchUser(this.UserOneInformation, false);
            #endregion
        }
        /// <summary>
        /// Verify the SaveInSent command parameter.
        /// </summary>
        /// <param name="queryValueType">The query value type of the request.</param>
        /// <param name="sendMailSaveInSent">The value of the SaveInSent command parameter in SendMail command.</param>
        /// <param name="smartForwardSaveInSent">The value of the SaveInSent command parameter in SmartForward command.</param>
        /// <param name="smartReplySaveInSent">The value of the SaveInSent command parameter in SmartReply command.</param>
        protected void VerifySaveInSentCommandParameter(QueryValueType queryValueType, string sendMailSaveInSent, string smartForwardSaveInSent, string smartReplySaveInSent)
        {
            #region Call FolderSync and Sync commands to get the initial status.
            IDictionary<HTTPPOSTRequestPrefixField, string> requestPrefix = new Dictionary<HTTPPOSTRequestPrefixField, string>();
            string sendMailSubject = Common.GenerateResourceName(Site, "SendMail");
            string smartForwardSubject = Common.GenerateResourceName(Site, "SmartForward");
            string smartReplySubject = Common.GenerateResourceName(Site, "SmartReply");

            // Call ConfigureRequestPrefixFields to change the QueryValueType.
            requestPrefix.Add(HTTPPOSTRequestPrefixField.QueryValueType, queryValueType.ToString());
            this.HTTPAdapter.ConfigureRequestPrefixFields(requestPrefix);

            // Call FolderSync command to synchronize the collection hierarchy.
            FolderSyncResponse folderSyncResponse = this.CallFolderSyncCommand();

            // Call Sync command to synchronize changes in Sent Items folder.
            SyncResponse syncResponse = this.CallInitialSyncCommand(Common.GetDefaultFolderServerId(folderSyncResponse, FolderType.SentItems, Site));

            if (Common.IsRequirementEnabled(1202, this.Site))
            {
                bool isR1202Satisfied = TestSuiteHelper.VerifySyncRequiredResponseHeaders(folderSyncResponse.Headers.AllKeys);

                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASHTTP_R1202");
                Site.Log.Add(LogEntryKind.Debug, "The FolderSync command response header is {0}." + folderSyncResponse.Headers.ToString());
                Site.Log.Add(LogEntryKind.Debug, "The Sync command response header is {0}." + syncResponse.Headers.ToString());

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R1202
                // If the FolderSync response header contains X-MS-RP, MS-ASProtocolCommands, and MS-ASProtocolVersions headers, this requirement can be captured.
                Site.CaptureRequirementIfIsTrue(
                    isR1202Satisfied,
                    1202,
                    @"[In Appendix A: Product Behavior] If the client sends a request to synchronize the folder hierarchy with a synchronization key of 0, the implementation does include an X-MS-RP header, MS-ASProtocolCommands header, and a MS-ASProtocolVersions header in its response to the client. (Exchange 2007 SP1 and above follow this behavior.)");
            }
            #endregion

            #region Call SendMail command with setting SaveInSent command parameter.
            string userOneMailboxAddress = Common.GetMailAddress(this.UserOneInformation.UserName, this.UserOneInformation.UserDomain);
            string userTwoMailboxAddress = Common.GetMailAddress(this.UserTwoInformation.UserName, this.UserTwoInformation.UserDomain);

            // Call SendMail command to send email to User2 with setting SaveInSent command parameter.
            this.CallSendMailCommand(userOneMailboxAddress, userTwoMailboxAddress, sendMailSubject, sendMailSaveInSent);

            // Add the received email to CreatedItemsForUserTwo collection to delete.
            this.SwitchUser(this.UserTwoInformation, true);
            this.AddCreatedItemToCollection("User2", this.UserTwoInformation.InboxCollectionId, sendMailSubject);
            this.SwitchUser(this.UserOneInformation, true);

            // Call Sync command to get the ServerId of the saved email.
            string itemServerId = this.LoopToSyncItem(this.UserOneInformation.SentItemsCollectionId, sendMailSubject, TestSuiteHelper.IsRetryNeeded(sendMailSaveInSent));
            this.VerifySaveInSentCommandParameter_SendMail(queryValueType, itemServerId);

            // Add the saved email to CreatedItemsForUserOne collection to delete.
            if (sendMailSaveInSent == "T" || sendMailSaveInSent == "1")
            {
                this.AddCreatedItemToCollection("User1", this.UserOneInformation.SentItemsCollectionId, sendMailSubject);
            }
            #endregion

            #region Call SmartForward to forward the received email with setting SaveInSent, CollectionId and ItemId command parameters.
            // Call ConfigureRequestPrefixFields to switch the credential to User2 and synchronize the collection hierarchy.
            this.SwitchUser(this.UserTwoInformation, false);

            // Call Sync command to get the ServerId of the received email.
            itemServerId = this.LoopToSyncItem(this.UserTwoInformation.InboxCollectionId, sendMailSubject, true);

            string userThreeMailboxAddress = Common.GetMailAddress(this.UserThreeInformation.UserName, this.UserThreeInformation.UserDomain);

            // Call SmartForward command to forward the received email to User3 with SaveInSent command parameter.
            this.CallSmartForwardCommand(userTwoMailboxAddress, userThreeMailboxAddress, itemServerId, smartForwardSubject, smartForwardSaveInSent, null, null);

            // Add the received email to CreatedItemsForUserThree collection to delete.
            this.SwitchUser(this.UserThreeInformation, true);
            this.AddCreatedItemToCollection("User3", this.UserThreeInformation.InboxCollectionId, smartForwardSubject);
            this.SwitchUser(this.UserTwoInformation, false);

            // Call Sync command to get the ServerId of the saved email.
            itemServerId = this.LoopToSyncItem(this.UserTwoInformation.SentItemsCollectionId, smartForwardSubject, TestSuiteHelper.IsRetryNeeded(smartForwardSaveInSent));
            this.VerifySaveInSentCommandParameter_SmartForward(queryValueType, itemServerId);

            // Add the saved email to CreatedItemsForUserTwo collection to delete.
            if (smartForwardSaveInSent == "T" || smartForwardSaveInSent == "1")
            {
                this.AddCreatedItemToCollection("User2", this.UserTwoInformation.SentItemsCollectionId, smartForwardSubject);
            }
            #endregion

            #region Call SmartReply to reply the received email with setting SaveInSent, CollectionId and ItemId command parameters.
            // Call ConfigureRequestPrefixFields to switch the credential to User3 and synchronize the collection hierarchy.
            this.SwitchUser(this.UserThreeInformation, false);

            // Call Sync command to get the ServerId of the received email.
            itemServerId = this.LoopToSyncItem(this.UserThreeInformation.InboxCollectionId, smartForwardSubject, true);
            if (queryValueType == QueryValueType.PlainText)
            {
                this.VerifyCollectionIdItemIdCommandParameters_SmartForward(itemServerId);
            }
    
            // Call SmartReply command to reply to the received email to User2 with SaveInSent command parameter.
            this.CallSmartReplyCommand(userThreeMailboxAddress, userTwoMailboxAddress, itemServerId, smartReplySubject, smartReplySaveInSent, null, null);

            // Add the received email to CreatedItemsForUserTwo collection to delete.
            this.AddCreatedItemToCollection("User2", this.UserTwoInformation.InboxCollectionId, smartReplySubject);

            // Call Sync command to get the ServerId of the saved email.
            itemServerId = this.LoopToSyncItem(this.UserThreeInformation.SentItemsCollectionId, smartReplySubject, TestSuiteHelper.IsRetryNeeded(smartReplySaveInSent));
            this.VerifySaveInSentCommandParameter_SmartReply(queryValueType, itemServerId);

            // Add the saved email to CreatedItemsForUserThree collection to delete.
            if (smartReplySaveInSent == "T" || smartReplySaveInSent == "1")
            {
                this.AddCreatedItemToCollection("User3", this.UserThreeInformation.SentItemsCollectionId, smartReplySubject);
            }
            #endregion

            #region Get the received email by SmartReply command and reset the request prefix.
            // Call ConfigureRequestPrefixFields to switch the credential to User2 and synchronize the collection hierarchy.
            this.SwitchUser(this.UserTwoInformation, false);

            // Call Sync command to get the ServerId of the received email.
            itemServerId = this.LoopToSyncItem(this.UserTwoInformation.InboxCollectionId, smartReplySubject, true);
            if (queryValueType == QueryValueType.PlainText)
            {
                this.VerifyCollectionIdItemIdCommandParameters_SmartReply(itemServerId);
            }

            // Call ConfigureRequestPrefixFields to reset the QueryValueType and credential.
            requestPrefix[HTTPPOSTRequestPrefixField.QueryValueType] = Common.GetConfigurationPropertyValue("HeaderEncodingType", this.Site);
            this.HTTPAdapter.ConfigureRequestPrefixFields(requestPrefix);
            this.SwitchUser(this.UserOneInformation, false);
            #endregion
        }
        /// <summary>
        /// Verify the GetAttachment command parameter.
        /// </summary>
        /// <param name="queryValueType">The query value type of the request.</param>
        /// <returns>The response of GetAttachment command.</returns>
        protected SendStringResponse VerifyGetAttachmentsCommandParameter(QueryValueType queryValueType)
        {
            #region Call SendMail command to send an email with attachment.
            // Call ConfigureRequestPrefixFields to change the QueryValueType.
            IDictionary<HTTPPOSTRequestPrefixField, string> requestPrefix = new Dictionary<HTTPPOSTRequestPrefixField, string>();
            requestPrefix.Add(HTTPPOSTRequestPrefixField.QueryValueType, queryValueType.ToString());
            this.HTTPAdapter.ConfigureRequestPrefixFields(requestPrefix);

            // Call FolderSync command to synchronize the collection hierarchy.
            this.CallFolderSyncCommand();

            // Create SendMail command request.
            string sendMailSubject = Common.GenerateResourceName(Site, "EmailWithAttachment");
            string mimeFileName = "EmailWithAttachment.txt";
            Site.Assert.IsTrue(File.Exists(mimeFileName), "The mime file {0} with attachment content should exist.", mimeFileName);
            string mime = "To: " + this.UserTwoInformation.UserName + "\n" + "Subject: " + sendMailSubject + "\n" + File.ReadAllText(mimeFileName);
            SendMailRequest request = Common.CreateSendMailRequest(null, Guid.NewGuid().ToString("N"), mime);

            // Call SendMail command by HTTP POST.
            SendStringResponse sendMailResponse = this.HTTPAdapter.HTTPPOST(CommandName.SendMail, null, request.GetRequestDataSerializedXML());

            // Check the command is executed successfully.
            this.CheckResponseStatus(sendMailResponse.ResponseDataXML);
            #endregion

            #region Call GetAttachment command to get the attachment from received email.
            // Switch the user to User2 and synchronize the collection hierarchy.
            this.SwitchUser(this.UserTwoInformation, true);

            // Add the ServerId of the received email to CreatedItemsForUserTwo collection to delete.
            this.AddCreatedItemToCollection("User2", this.UserTwoInformation.InboxCollectionId, sendMailSubject);

            // Loop to call Sync command to get the FileReference of the attachment.
            Response.SearchResponseStoreResult searchResult = this.LoopToSearchItem(this.UserTwoInformation.InboxCollectionId, sendMailSubject);
            string fileReference = this.GetFileReferenceFromSearchResult(searchResult);
            Site.Assert.IsNotNull(fileReference, "The FileReference of the attachment in email {0} should be got.", sendMailSubject);

            // Call GetAttachment command using the FileReference as AttachmentName command parameter.
            Dictionary<CmdParameterName, object> commandParameters = new Dictionary<CmdParameterName, object>
            {
                {
                    CmdParameterName.AttachmentName, fileReference
                }
            };

            SendStringResponse getAttachmentResponse = this.HTTPAdapter.HTTPPOST(CommandName.GetAttachment, commandParameters, Common.CreateGetAttachmentRequest().GetRequestDataSerializedXML());

            // Check the command is executed successfully.
            this.CheckResponseStatus(getAttachmentResponse.ResponseDataXML);
            #endregion

            #region Reset the request prefix.
            // Call ConfigureRequestPrefixFields to reset the QueryValueType and credential.
            requestPrefix[HTTPPOSTRequestPrefixField.QueryValueType] = Common.GetConfigurationPropertyValue("HeaderEncodingType", this.Site);
            this.HTTPAdapter.ConfigureRequestPrefixFields(requestPrefix);
            this.SwitchUser(this.UserOneInformation, false);
            #endregion

            return getAttachmentResponse;
        }
        /// <summary>
        /// Verify the capture codes about SaveInSent command parameter using in SmartReply command.
        /// </summary>
        /// <param name="queryValueType">The query value type of the request.</param>
        /// <param name="itemServerId">The ServerId of the email received by the receiver.</param>
        protected void VerifySaveInSentCommandParameter_SmartReply(QueryValueType queryValueType, string itemServerId)
        {
            if (queryValueType == QueryValueType.Base64)
            {
                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASHTTP_R88");

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R88
                // The SmartReply command executes successfully when the Options command parameter is set, so this requirement can be captured.
                Site.CaptureRequirement(
                    88,
                    @"[In Command Parameters] [Parameter] Options [ is used by] SmartReply.");

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

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R525
                // The SmartReply command executes successfully when the Options command parameter is set to "1", so this requirement can be captured.
                Site.CaptureRequirement(
                    525,
                    @"[In Command Parameters] [When flag] SaveInSent [value is] 0x01, [it is ] valid for SmartReply.");
            }
            else
            {
                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASHTTP_R530");

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R530
                // The SmartReply command executes successfully when the SaveInSent command parameter is set, so this requirement can be captured.
                Site.CaptureRequirement(
                    530,
                    @"[In Command-Specific URI Parameters] [Parameter] SaveInSent [is used by] SmartReply. ");

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

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R122
                // The sent email could not be found in Sent Items folder when the SaveInSent command parameter is not set, so this requirement can be captured.
                Site.CaptureRequirementIfIsNull(
                    itemServerId,
                    122,
                    @"[In Command-Specific URI Parameters] The SaveInSent parameter is set to F by default. ");
            }
        }
        /// <summary>
        /// Verify the capture codes about SaveInSent command parameter using in SmartForward command.
        /// </summary>
        /// <param name="queryValueType">The query value type of the request.</param>
        /// <param name="itemServerId">The ServerId of the email received by the receiver.</param>
        protected void VerifySaveInSentCommandParameter_SmartForward(QueryValueType queryValueType, string itemServerId)
        {
            if (queryValueType == QueryValueType.Base64)
            {
                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASHTTP_R532");

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R532
                // The SmartForward command executes successfully when the Options command parameter is set, so this requirement can be captured.
                Site.CaptureRequirement(
                    532,
                    @"[In Command Parameters] [Parameter] Options [ is used by] SmartForward.");

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

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R524
                // The SmartForward command executes successfully when the Options command parameter is set to "1", so this requirement can be captured.
                Site.CaptureRequirement(
                    524,
                    @"[In Command Parameters] [When flag] SaveInSent [value is] 0x01, [it is ] valid for SmartForward.");
            }
            else
            {
                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASHTTP_R437");

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R437
                // The ServerId of the saved item is null, so this requirement can be captured.
                Site.CaptureRequirementIfIsNull(
                    itemServerId,
                    437,
                    @"[In Command-Specific URI Parameters] [Set this parameter [SaveInSent] to T to instruct the server to save the Message object in the user's Sent Items folder;] otherwise, set the parameter [SaveInSent] to F.");

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

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R120
                // The SmartForward command executes successfully when the SaveInSent command parameter is set, so this requirement can be captured.
                Site.CaptureRequirement(
                    120,
                    @"[In Command-Specific URI Parameters] [Parameter] SaveInSent [is used by] SmartForward.");
            }
        }
        /// <summary>
        /// Verify the capture codes about SaveInSent command parameter using in SendMail command.
        /// </summary>
        /// <param name="queryValueType">The query value type of the request.</param>
        /// <param name="itemServerId">The ServerId of the email received by the receiver.</param>
        protected void VerifySaveInSentCommandParameter_SendMail(QueryValueType queryValueType, string itemServerId)
        {
            if (queryValueType == QueryValueType.Base64)
            {
                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASHTTP_R92");

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R92
                // The sent email could be found in Sent Items folder when the Options command parameter is set to "1", so this requirement can be captured.
                Site.CaptureRequirementIfIsNotNull(
                    itemServerId,
                    92,
                    @"[In Command Parameters] [When flag] SaveInSent [value is] 0x01,  [ the meaning is ] setting this flag [SaveInSent] to instruct the server to save the Message object in the user's Sent Items folder.");

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

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R93
                // The SendMail command executes successfully when the Options command parameter is set to "1", so this requirement can be captured.
                Site.CaptureRequirement(
                    93,
                    @"[In Command Parameters] [When flag] SaveInSent [value is] 0x01, [it is ] valid for SendMail.");

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

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R533
                // The SendMail command executes successfully when the Options command parameter is set, so this requirement can be captured.
                Site.CaptureRequirement(
                    533,
                    @"[In Command Parameters] [Parameter] Options [ is used by] SendMail.");

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

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R486
                // The sent email could be found in Sent Items folder when the Options command parameter is set to "1", so this requirement can be captured.
                Site.CaptureRequirementIfIsNotNull(
                    itemServerId,
                    486,
                    @"[In Command Parameters] [Parameter] Options [is described as] A single-byte bitmask that specifies command options.");
            }
            else
            {
                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASHTTP_R531");

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R531
                // The SendMail command executes successfully when the SaveInSent command parameter is set, so this requirement can be captured.
                Site.CaptureRequirement(
                    531,
                    @"[In Command-Specific URI Parameters] [Parameter] SaveInSent [is used by] SendMail. ");

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

                // Verify MS-ASHTTP requirement: MS-ASHTTP_R121
                // The sent email could be found in Sent Items folder when the SaveInSent command parameter is set to "T", so this requirement can be captured.
                Site.CaptureRequirementIfIsNotNull(
                    itemServerId,
                    121,
                    @"[In Command-Specific URI Parameters] Set this parameter [SaveInSent] to T to instruct the server to save the Message object in the user's Sent Items folder [; otherwise, set the parameter [SaveInSent] to F]. ");
            }
        }