public void MSASEMAIL_S01_TC12_SenderAndFromHaveSameValue()
{
#region The sender calls SendMail command with Sender element and From element having same value to send the email to recipient.
string emailSubject = Common.GenerateResourceName(Site, "subject");
string fromAddress = Common.GetMailAddress(this.User1Information.UserName, this.User1Information.UserDomain);
string senderAddress = Common.GetMailAddress(this.User1Information.UserName, this.User1Information.UserDomain);
this.SendPlaintextEmail(emailSubject, null, null, null, senderAddress, null, fromAddress);
#endregion
#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 The recipient calls Sync command to synchronize the email item on server.
SyncStore syncChangeResult = this.GetSyncResult(emailSubject, this.User2Information.InboxCollectionId, null);
Sync item = TestSuiteHelper.GetSyncAddItem(syncChangeResult, emailSubject);
#endregion
#region Verify requirement
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASEMAIL_R726");
// Verify MS-ASEMAIL requirement: MS-ASEMAIL_R726
// The Sender element is set by server and is read-only for client, so if the response doesn't include this element, that's to say, its value is null.
Site.CaptureRequirementIfIsTrue(
item.Email.Sender == null && string.Compare(fromAddress, senderAddress, StringComparison.CurrentCultureIgnoreCase) == 0,
726,
@"[In Sender] The email2:Sender element is not sent to the client when the email2:Sender element and the From element have the same value.");
#endregion
}
#endregion