public void MSASEMAIL_S01_TC20_ItemOperations_IncludedDataInResponse()
{
#region Call method SendMail to send an email.
string emailSubject = Common.GenerateResourceName(Site, "subject");
this.SendPlaintextEmail(emailSubject, string.Empty, string.Empty);
#endregion
#region Call ItemOperations command including BodyPreference element and BodyPartPreference element to fetch all the information about email using ServerId
// Call method Sync to synchronize(add or change) the e-mail items with the server.
Request.BodyPreference bodyPreference = new Request.BodyPreference
{
AllOrNone = true,
AllOrNoneSpecified = true,
TruncationSize = 5120,
TruncationSizeSpecified = true,
Type = 1
};
Request.BodyPartPreference bodyPartPreference = null;
if (Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site).Equals("14.1"))
{
bodyPartPreference = new Request.BodyPartPreference
{
AllOrNone = true,
AllOrNoneSpecified = true,
TruncationSize = 5120,
TruncationSizeSpecified = true,
Type = 2
};
}
// Get the new added email item
SyncStore syncChangeResult = this.GetSyncResult(emailSubject, this.User2Information.InboxCollectionId, bodyPreference);
Sync item = TestSuiteHelper.GetSyncAddItem(syncChangeResult, emailSubject);
// Fetch email from server
ItemOperationsRequest itemOperationRequest = TestSuiteHelper.CreateItemOperationsFetchRequest(this.User2Information.InboxCollectionId, item.ServerId, bodyPreference, bodyPartPreference, null);
ItemOperationsStore itemOperationResult = this.EMAILAdapter.ItemOperations(itemOperationRequest);
#endregion
#region Verify requirement
// If the server responds with an ItemOperations response, then MS-ASEMAIL_R61 can be captured.
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASEMAIL_R61");
// Verify MS-ASEMAIL requirement: MS-ASEMAIL_R61
Site.CaptureRequirementIfAreEqual<string>(
"1",
itemOperationResult.Status,
61,
@"[In ItemOperations Command Response] When a client uses an ItemOperations command request ([MS-ASCMD] section 2.2.2.9), as specified in section 3.1.5.1, to retrieve data from the server for one or more specific e-mail items, the server responds with an ItemOperations command response.");
#endregion
}
#endregion