A class indicates the ResolveNames request type.
Inheritance: AddressBookRequestBodyBase
        /// <summary>
        /// This method is used by the client to perform ambiguous name resolution(ANR).
        /// </summary>
        /// <param name="resolveNamesRequestBody">The ResolveNames request type request body.</param>
        /// <returns>The response body of the ResolveNames request type.</returns>
        public ResolveNamesResponseBody ResolveNames(ResolveNamesRequestBody resolveNamesRequestBody)
        {
            CommonResponse           commonResponse           = this.SendAddressBookRequest(resolveNamesRequestBody, RequestType.ResolveNames);
            ResolveNamesResponseBody resolveNamesResponseBody = ResolveNamesResponseBody.Parse(commonResponse.ResponseBodyRawData);

            this.VerifyResolveNamesResponseBody(resolveNamesResponseBody);
            if (resolveNamesResponseBody.HasRowsAndPropertyTags)
            {
                foreach (AddressBookPropertyRow row in resolveNamesResponseBody.RowData)
                {
                    this.VerifyAddressBookPropertyRowStructure(row);
                }

                this.VerifyLargePropertyTagArrayStructure(resolveNamesResponseBody.PropertyTags.Value);
            }

            return(resolveNamesResponseBody);
        }
        public void MSOXCMAPIHTTP_S02_TC12_ResolveNamesRequestType()
        {
            this.CheckMapiHttpIsSupported();

            #region Call Bind request type to established a session context with the address book server.
            this.Bind();
            #endregion

            #region Call ResolveNames request type to perform ANR.
            STAT stat = new STAT();
            stat.InitiateStat();
            byte[] auxIn = new byte[] { };

            ResolveNamesRequestBody resolveNamesRequestBody = new ResolveNamesRequestBody();
            resolveNamesRequestBody.Reserved = 0;
            resolveNamesRequestBody.HasState = true;
            resolveNamesRequestBody.State = stat;
            resolveNamesRequestBody.HasPropertyTags = true;
            LargePropertyTagArray largePropertyTagArray = new LargePropertyTagArray()
            {
                PropertyTagCount = 1,
                PropertyTags = new PropertyTag[]
                {
                    new PropertyTag 
                    {
                        PropertyType = (ushort)PropertyTypeValues.PtypString,
                        PropertyId = (ushort)PropertyID.PidTagDisplayName
                    }
                }
            };
            resolveNamesRequestBody.PropertyTags = largePropertyTagArray;
            resolveNamesRequestBody.HasNames = true;
            WStringsArray_r stringsArray = new WStringsArray_r();
            stringsArray.CValues = 5;
            stringsArray.LppszW = new string[stringsArray.CValues];
            stringsArray.LppszW[0] = this.AdminUserDN;
            stringsArray.LppszW[1] = string.Empty;
            stringsArray.LppszW[2] = Common.GetConfigurationPropertyValue("AmbiguousName", this.Site);
            stringsArray.LppszW[3] = null;
            stringsArray.LppszW[4] = "XXXXXX";

            resolveNamesRequestBody.Names = stringsArray;
            resolveNamesRequestBody.AuxiliaryBuffer = auxIn;
            resolveNamesRequestBody.AuxiliaryBufferSize = (uint)auxIn.Length;

            ResolveNamesResponseBody resolveNamesResponseBody = this.Adapter.ResolveNames(resolveNamesRequestBody);
            Site.Assert.AreEqual<uint>(0, resolveNamesResponseBody.ErrorCode, "ResolveNames should succeed and 0 is expected to be returned. The returned value is {0}.", resolveNamesResponseBody.ErrorCode);

            #region Capture code.
            bool isMinimalIdsCorrect = false;
            for (int i = 0; i < resolveNamesResponseBody.MinimalIds.Length; i++)
            {
                isMinimalIdsCorrect = resolveNamesResponseBody.MinimalIds[i] == (uint)ANRMinEntryIDs.MID_AMBIGUOUS ||
                                      resolveNamesResponseBody.MinimalIds[i] == (uint)ANRMinEntryIDs.MID_RESOLVED ||
                                      resolveNamesResponseBody.MinimalIds[i] == (uint)ANRMinEntryIDs.MID_UNRESOLVED;
            }

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

            // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R895
            this.Site.CaptureRequirementIfIsTrue(
                isMinimalIdsCorrect,
                895,
                @"[In ResolveNames Request Type] The ResolveNames request type is used by the client to perform ambiguous name resolution (ANR), as specified in [MS-OXNSPI] section 3.1.4.7.");

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

            // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R913
            this.Site.CaptureRequirementIfIsTrue(
                AdapterHelper.AreTwoLargePropertyTagArrayEqual(resolveNamesRequestBody.PropertyTags, resolveNamesResponseBody.PropertyTags.Value),
                913,
                @"[In ResolveNames Request Type Request Body] PropertyTags (optional) (variable): A LargePropTagArray structure (section 2.2.1.3) that specifies the properties that client requires for the rows returned.");

            // Add the debug information
            this.Site.Log.Add(
                LogEntryKind.Debug,
                "Verify MS-OXCMAPIHTTP_R946, the value of PropertyTags is {0}, the value of RowData is {1}.",
                resolveNamesResponseBody.PropertyTags.Value.PropertyTags,
                resolveNamesResponseBody.RowData);

            // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R946
            bool isVerifiedR946 = resolveNamesResponseBody.PropertyTags.GetType().Equals(typeof(LargePropertyTagArray)) &&
                                  resolveNamesResponseBody.PropertyTags.Value.PropertyTags != null &&
                                  resolveNamesResponseBody.RowData != null;

            this.Site.CaptureRequirementIfIsTrue(
                isVerifiedR946,
                946,
                @"[In ResolveNames Request Type Success Response Body] PropertyTags (optional) (variable): A LargePropTagArray structure (section 2.2.1.3) that specifies the properties returned for the rows in the RowData field.");

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

            // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R942
            bool isVerifiedR942 = resolveNamesResponseBody.MinimalIds.GetType().IsArray && isMinimalIdsCorrect;

            // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R942
            this.Site.CaptureRequirementIfIsTrue(
                isVerifiedR942,
                942,
                @"[In ResolveNames Request Type Success Response Body] MinimalIds (optional) (variable): An array of MinimalEntryID structures ([MS-OXNSPI] section 2.3.8.1), each of which specifies a Minimal Entry ID matching a name requested by the client.");

            #endregion
            #endregion

            #region Call ResolveNames request type with HasState, HasPropertyTags and HasNames set to false to perform ambiguous name resolution (ANR).
            resolveNamesRequestBody.HasState = false;
            resolveNamesRequestBody.HasPropertyTags = false;
            resolveNamesRequestBody.HasNames = false;

            resolveNamesResponseBody = this.Adapter.ResolveNames(resolveNamesRequestBody);
            Site.Assert.AreEqual<uint>(0, resolveNamesResponseBody.StatusCode, "ResolveNames should succeed and 0 is expected to be returned. The returned value is {0}.", resolveNamesResponseBody.StatusCode);
            #endregion

            #region Call ResolveNames request type with HasState and HasPropertyTags set to true, HasNames set to false to perform ambiguous name resolution (ANR).
            resolveNamesRequestBody.HasState = true;
            resolveNamesRequestBody.HasPropertyTags = true;
            resolveNamesRequestBody.HasNames = false;

            resolveNamesResponseBody = this.Adapter.ResolveNames(resolveNamesRequestBody);
            Site.Assert.AreEqual<uint>(0, resolveNamesResponseBody.StatusCode, "ResolveNames should succeed and 0 is expected to be returned. The returned value is {0}.", resolveNamesResponseBody.StatusCode);
            #endregion

            #region Call ResolveNames request type with HasState and HasNames set to true, HasPropertyTags set to false to perform ambiguous name resolution (ANR).
            resolveNamesRequestBody.HasState = true;
            resolveNamesRequestBody.HasPropertyTags = false;
            resolveNamesRequestBody.HasNames = true;

            resolveNamesResponseBody = this.Adapter.ResolveNames(resolveNamesRequestBody);
            Site.Assert.AreEqual<uint>(0, resolveNamesResponseBody.ErrorCode, "ResolveNames should succeed and 0 is expected to be returned. The returned value is {0}.", resolveNamesResponseBody.ErrorCode);
            #endregion

            #region Call ResolveNames request type with HasState set to false, HasPropertyTags and HasNames set to true to perform ambiguous name resolution (ANR).
            resolveNamesRequestBody.HasState = false;
            resolveNamesRequestBody.HasPropertyTags = true;
            resolveNamesRequestBody.HasNames = true;

            resolveNamesResponseBody = this.Adapter.ResolveNames(resolveNamesRequestBody);
            Site.Assert.AreEqual<uint>(0, resolveNamesResponseBody.StatusCode, "ResolveNames should succeed and 0 is expected to be returned. The returned value is {0}.", resolveNamesResponseBody.StatusCode);
            #endregion

            #region Call the Unbind request type to destroy the session context.
            this.Unbind();
            #endregion
        }
        /// <summary>
        /// This method is used by the client to perform ambiguous name resolution(ANR).
        /// </summary>
        /// <param name="resolveNamesRequestBody">The ResolveNames request type request body.</param>
        /// <returns>The response body of the ResolveNames request type.</returns>
        public ResolveNamesResponseBody ResolveNames(ResolveNamesRequestBody resolveNamesRequestBody)
        {
            CommonResponse commonResponse = this.SendAddressBookRequest(resolveNamesRequestBody, RequestType.ResolveNames);
            ResolveNamesResponseBody resolveNamesResponseBody = ResolveNamesResponseBody.Parse(commonResponse.ResponseBodyRawData);
            this.VerifyResolveNamesResponseBody(resolveNamesResponseBody);
            if (resolveNamesResponseBody.HasRowsAndPropertyTags)
            {
                foreach (AddressBookPropertyRow row in resolveNamesResponseBody.RowData)
                {
                    this.VerifyAddressBookPropertyRowStructure(row);
                }

                this.VerifyLargePropertyTagArrayStructure(resolveNamesResponseBody.PropertyTags.Value);
            }

            return resolveNamesResponseBody;
        }