public void MSASEMAIL_S01_TC14_ChangeReceivedAsBccInRequest()
{
Site.Assume.AreNotEqual<string>("12.1", Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site), "The ReceivedAsBcc element is not supported when the ActiveSyncProtocolVersion is 12.1.");
#region The sender calls SendMail method to send the email to recipient.
string emailSubject = Common.GenerateResourceName(Site, "subject");
this.SendPlaintextEmail(emailSubject, string.Empty, string.Concat(this.User3Information.UserName, '@', this.User3Information.UserDomain));
#endregion
#region Record user name, folder collectionId and item subject that are used in this case.
this.SwitchUser(this.User3Information, true);
this.RecordCaseRelativeItems(this.User3Information.UserName, this.User3Information.InboxCollectionId, emailSubject);
#endregion
#region The recipient calls Sync method to change the value of ReceivedAsBcc element.
// Synchronize the email item
SyncStore syncChangeResult = this.GetSyncResult(emailSubject, this.User3Information.InboxCollectionId, null);
Sync item = TestSuiteHelper.GetSyncAddItem(syncChangeResult, emailSubject);
// Try to change the value of ReceivedAsBcc
SyncRequest invalidSyncRequest = TestSuiteHelper.CreateSyncChangeRequest(
syncChangeResult.SyncKey,
this.User3Information.InboxCollectionId,
new Request.SyncCollectionChange { ServerId = item.ServerId });
SendStringResponse syncStringResponse = this.EMAILAdapter.InvalidSync(
invalidSyncRequest,
string.Format("<ApplicationData><ReceivedAsBcc xmlns=\"Email2\">{0}</ReceivedAsBcc></ApplicationData>", false),
"</Change>");
#endregion
#region Verify requirement
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASEMAIL_R648");
// Verify MS-ASEMAIL requirement: MS-ASEMAIL_R648
Site.CaptureRequirementIfAreEqual<string>(
"6",
TestSuiteHelper.GetStatusCode(syncStringResponse.ResponseDataXML),
648,
@"[In ReceivedAsBcc] If the client changes this element value, the server responds with Status element ([MS-ASCMD] section 2.2.3.167.16) value of 6 in the Sync command response ([MS-ASCMD] section 2.2.2.20).");
#endregion
}
#endregion