Microsoft.Protocols.TestSuites.MS_ASCMD.S15_SendMail.MSASCMD_S15_TC01_SendMail_Success C# (CSharp) Method

MSASCMD_S15_TC01_SendMail_Success() private method

private MSASCMD_S15_TC01_SendMail_Success ( ) : void
return void
        public void MSASCMD_S15_TC01_SendMail_Success()
        {
            #region User1 calls SendMail command to send email messages to user2.
            string emailSubject = Common.GenerateResourceName(Site, "subject");
            SendMailResponse sendMailResponse = this.SendPlainTextEmail(null, emailSubject, this.User1Information.UserName, this.User2Information.UserName, null);
            #endregion

            #region Verify Requirements MSASCMD_R463, MSASCMD_R4379, MSASCMD_R5091
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R463");

            // If the server returns an empty response after user calls SendMail command, it means the message was sent successfully, then MS-ASCMD_R463, MS-ASCMD_R4379, MS-ASCMD_R5091 are verified.
            // Verify MS-ASCMD requirement: MS-ASCMD_R463
            Site.CaptureRequirementIfAreEqual<string>(
                string.Empty,
                sendMailResponse.ResponseDataXML,
                463,
                @"[In Response] If the message was sent successfully, the server returns an empty response.");

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

            // If the server returns an empty response after user calls SendMail command, it means the message was sent successfully.
            // Verify MS-ASCMD requirement: MS-ASCMD_R4379
            Site.CaptureRequirementIfAreEqual<string>(
                string.Empty,
                sendMailResponse.ResponseDataXML,
                4379,
                @"[In Status(SendMail)] If the [SendMail] command succeeds, no XML body is returned in the response.");

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

            // If the server returns an empty response after user calls SendMail command, it means the message was sent successfully.
            // Verify MS-ASCMD requirement: MS-ASCMD_R5091
            Site.CaptureRequirementIfAreEqual<string>(
                string.Empty,
                sendMailResponse.ResponseDataXML,
                5091,
                @"[In Receiving and Accepting Meeting Requests] [Command sequence for receiving and accepting meeting requests., order 5: ] If the message was sent successfully, the server returns an empty response.");
            #endregion

            #region Sync user2 mailbox changes
            // Switch to user2 mailbox
            this.SwitchUser(this.User2Information);
            SyncResponse syncResponse = this.GetMailItem(this.User2Information.InboxCollectionId, emailSubject);

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

            // If syncReponse is not null, means user2 received the email from user1, then MS-ASCMD_R443 is verified
            // Verify MS-ASCMD requirement: MS-ASCMD_R443
            Site.CaptureRequirementIfIsNotNull(
                syncResponse,
                443,
                @"[In SendMail] The SendMail command is used by clients to send MIME-formatted email messages to the server.");

            #endregion

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