public void MSOXCMAPIHTTP_S02_TC14_GetPropList()
{
this.CheckMapiHttpIsSupported();
#region Call Bind request type to established a session context with the address book server.
this.Bind();
#endregion
#region Call GetPropList method with Flags field set to 0x1 and MinimalId set to 0 to get the default global address book object.
uint mid = 0;
GetPropListRequestBody getPropListRequestBody = this.BuildGetPropListRequestBody(0x1, mid);
GetPropListResponseBody getPropListResponseBody = this.Adapter.GetPropList(getPropListRequestBody);
Site.Assert.AreEqual<uint>((uint)0, getPropListResponseBody.ErrorCode, "GetPropList operation should succeed and 0 is expected to be returned. The return value is {0}.", getPropListResponseBody.ErrorCode);
// Add the debug information
this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R583");
// Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R583
// In this step, MinimalId is set to 0 to get the default global address book object. So if the returned propertyTags is not null,
// it indicates that this field contains the property tags of properties that have values on the requested object.
this.Site.CaptureRequirementIfIsNotNull(
getPropListResponseBody.PropertyTags,
583,
@"[In GetPropList Request Type Success Response Body] PropertyTags (optional) (variable): A LargePropertyTagArray structure (section 2.2.1.3) that contains the property tags of properties that have values on the requested object.");
#endregion
#region Call QueryColumns to get all of the properties that exist in the address book.
uint mapiFlags = 0x80000000;
QueryColumnsRequestBody queryColumnsRequestBody = this.BuildQueryColumnsRequestBody(mapiFlags);
QueryColumnsResponseBody queryColumnsResponseBody = this.Adapter.QueryColumns(queryColumnsRequestBody);
Site.Assert.AreEqual<uint>((uint)0, queryColumnsResponseBody.ErrorCode, "QueryColumns operation should succeed and 0 is expected to be returned. The return value is {0}.", queryColumnsResponseBody.ErrorCode);
// Add the debug information
this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R558");
// Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R558
this.Site.CaptureRequirementIfAreEqual<uint>(
queryColumnsResponseBody.Columns.Value.PropertyTagCount,
getPropListResponseBody.PropertyTags.Value.PropertyTagCount,
558,
@"[In GetPropList Request Type] The GetPropList request type is used by the client to get a list of all of the properties that have values on an object.");
#endregion
#region Call GetPropList method with Flags field set to 0x0 and MinimalId set to 0 to get the default global address book object.
getPropListRequestBody = this.BuildGetPropListRequestBody(0x0, mid);
GetPropListResponseBody getPropListResponseBody1 = this.Adapter.GetPropList(getPropListRequestBody);
Site.Assert.AreEqual<uint>((uint)0, getPropListResponseBody1.ErrorCode, "GetPropList operation should succeed and 0 is expected to be returned. The return value is {0}.", getPropListResponseBody.ErrorCode);
#endregion
#region Call GetPropList method with Flags field set to 0x2 to check that server will ignore other flag values rather than 0x1.
getPropListRequestBody = this.BuildGetPropListRequestBody(0x2, mid);
GetPropListResponseBody getPropListResponseBody2 = this.Adapter.GetPropList(getPropListRequestBody);
Site.Assert.AreEqual<uint>((uint)0, getPropListResponseBody2.ErrorCode, "GetPropList operation should succeed and 0 is expected to be returned. The return value is {0}.", getPropListResponseBody.ErrorCode);
// Add the debug information
this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R1321");
// Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R1321
this.Site.CaptureRequirementIfIsTrue(
AdapterHelper.AreTwoLargePropertyTagArrayEqual(getPropListResponseBody1.PropertyTags.Value, getPropListResponseBody2.PropertyTags.Value),
1321,
@"[In GetPropList Request Type Request Body] If this field [Flags] is set to different values other than the bit flag fSkipObjects (0x00000001), the server will return the same result.");
#endregion
#region Call the Unbind request type to destroy the session context.
this.Unbind();
#endregion
}