Microsoft.Protocols.TestSuites.MS_OXCMAPIHTTP.S02_RequestTypesForAddressBookServerEndpoint.MSOXCMAPIHTTP_S02_TC19_TestFlagWithPtypErrorCode C# (CSharp) 메소드

MSOXCMAPIHTTP_S02_TC19_TestFlagWithPtypErrorCode() 개인적인 메소드

private MSOXCMAPIHTTP_S02_TC19_TestFlagWithPtypErrorCode ( ) : void
리턴 void
        public void MSOXCMAPIHTTP_S02_TC19_TestFlagWithPtypErrorCode()
        {
            this.CheckMapiHttpIsSupported();

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

            #region Call QueryRows with all optional fields exist and the type of all properties specified.
            uint tableCount = 0;
            uint[] table = null;
            uint rowCount = ConstValues.QueryRowsRequestedRowNumber;
            STAT stat = new STAT();
            stat.InitiateStat();

            LargePropertyTagArray columns = new LargePropertyTagArray()
            {
                PropertyTagCount = 1,
                PropertyTags = new PropertyTag[]
                {
                    new PropertyTag
                    {
                        PropertyType = (ushort)PropertyType.PtypErrorCode,
                        PropertyId = (ushort)PropertyID.PidTagDisplayName
                    }
                }
            };

            QueryRowsRequestBody queryRowsRequestBody = this.BuildQueryRowsRequestBody(true, stat, tableCount, table, rowCount, true, columns);
            QueryRowsResponseBody queryRowsResponseBody = this.Adapter.QueryRows(queryRowsRequestBody);
            Site.Assert.AreEqual<uint>((uint)0, queryRowsResponseBody.ErrorCode, "QueryRows operation should succeed and 0 is expected to be returned. The return value is {0}.", queryRowsResponseBody.ErrorCode);
            #endregion

            #region Capture code
            AddressBookPropertyRow[] rowData = queryRowsResponseBody.RowData;
            for (int i = 0; i < rowData.Length; i++)
            {
                List<AddressBookPropertyValue> valueArray = new List<AddressBookPropertyValue>(rowData[i].ValueArray);

                for (int j = 0; j < valueArray.Count; j++)
                {
                    AddressBookFlaggedPropertyValue propertyValue = (AddressBookFlaggedPropertyValue)valueArray[j];

                    if (propertyValue.Flag == 0xA)
                    {
                        bool isVerifyR2024 = propertyValue.Value != null && columns.PropertyTags[j].PropertyType == 10;
                        // Add the debug information
                        this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R2024.");

                        // Verify MS-OXCDATA requirement: MS-OXCMAPIHTTP_R2024
                        this.Site.CaptureRequirementIfIsTrue(
                            isVerifyR2024,
                            2024,
                            @"[In AddressBookFlaggedPropertyValue Structure] Flag value 0xA meaning The PropertyValue field will be an AddressBookPropertyValue structure containing a value of PtypErrorCode, as specified in [MS-OXCDATA] section 2.11.1. ");
                    }
                }
            }
            #endregion

            #region Call Unbind request to destroy the session between the client and the server.
            this.Unbind();
            #endregion
        }