Microsoft.Protocols.TestSuites.MS_OXCROPS.MS_OXCROPSAdapter.VerifyRopQueryRowsSuccessResponse C# (CSharp) Method

VerifyRopQueryRowsSuccessResponse() private method

Verify RopQueryRows Success Response
private VerifyRopQueryRowsSuccessResponse ( RopQueryRowsResponse ropQueryRowsResponse, byte inputHandleIndex, PropertyTag propertyTags ) : void
ropQueryRowsResponse RopQueryRowsResponse The response of RopQueryRows request
inputHandleIndex byte The field of InputHandleIndex in RopQueryRows request
propertyTags PropertyTag Array of PropertyTag structures specifies the property values that are visible in table rows, set by a RopSetColumns request
return void
        private void VerifyRopQueryRowsSuccessResponse(RopQueryRowsResponse ropQueryRowsResponse, byte inputHandleIndex, PropertyTag[] propertyTags)
        {
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1176");

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1176
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(byte),
                ropQueryRowsResponse.RopId.GetType(),
                1176,
                @"[In RopQueryRows ROP Success Response Buffer] RopId (1 byte): An unsigned integer.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1178
            Site.CaptureRequirementIfAreEqual<byte>(
                (byte)RopId.RopQueryRows,
                ropQueryRowsResponse.RopId,
                1178,
                @"[In RopQueryRows ROP Success Response Buffer] RopId (1 byte): For this operation[RopQueryRows], this field[RopId (1 byte)] is set to 0x15.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1179
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(byte),
                ropQueryRowsResponse.InputHandleIndex.GetType(),
                1179,
                @"[In RopQueryRows ROP Success Response Buffer] InputHandleIndex (1 byte): An unsigned integer.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1180
            Site.CaptureRequirementIfAreEqual<byte>(
                inputHandleIndex,
                ropQueryRowsResponse.InputHandleIndex,
                1180,
                @"[In RopQueryRows ROP Success Response Buffer] InputHandleIndex (1 byte): This index MUST be set to the value specified in the InputHandleIndex field in the request.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1181
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(uint),
                ropQueryRowsResponse.ReturnValue.GetType(),
                1181,
                @"[In RopQueryRows ROP Success Response Buffer] ReturnValue (4 bytes): An unsigned integer.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1183
            Site.CaptureRequirementIfAreEqual<uint>(
                SuccessReturnValue,
                ropQueryRowsResponse.ReturnValue,
                1183,
                @"[In RopQueryRows ROP Success Response Buffer] ReturnValue (4 bytes): For this response[Success Response], this field is set to 0x00000000.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1184
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(byte),
                ropQueryRowsResponse.Origin.GetType(),
                1184,
                @"[In RopQueryRows ROP Success Response Buffer] Origin (1 byte): An enumeration.");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1185,Origin:{0}", ropQueryRowsResponse.Origin);

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1185
            bool isVerifyR1185 = ((ropQueryRowsResponse.Origin & (byte)Origin.Beginning) == (byte)Origin.Beginning)
                                 || ((ropQueryRowsResponse.Origin & (byte)Origin.Current) == (byte)Origin.Current)
                                 || ((ropQueryRowsResponse.Origin & (byte)Origin.End) == (byte)Origin.End);

            Site.CaptureRequirementIfIsTrue(
                isVerifyR1185,
                1185,
                @"[In RopQueryRows ROP Success Response Buffer] Origin (1 byte): The possible values[the value of BOOKMARK_BEGINNING is 0x00, the value of BOOKMARK_CURRENT is 0x01 and the value of BOOKMARK_END is 0x02] for this enumeration are specified in [MS-OXCTABL] section 2.2.2.5.2.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1187
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(ushort),
                ropQueryRowsResponse.RowCount.GetType(),
                1187,
                @"[In RopQueryRows ROP Success Response Buffer] RowCount (2 bytes): An unsigned integer.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1189
            // The class PropertyRowSet is List of PropertRow, if the type of Rows is PropertyRowSet can verify R1189 
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(PropertyRowSet),
                ropQueryRowsResponse.RowData.GetType(),
                1189,
                @"[In RopQueryRows ROP Success Response Buffer] RowData (variable): A list of PropertyRow structures.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1190
            Site.CaptureRequirementIfAreEqual<ushort>(
                ropQueryRowsResponse.RowCount,
                (ushort)ropQueryRowsResponse.RowData.Count,
                1190,
                @"[In RopQueryRows ROP Success Response Buffer] RowData (variable): The number of structures contained in this field is specified by the RowCount field.");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1192,RowData:{0}", ropQueryRowsResponse.RowData);

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1192
            // Assume the result is true. If one of rows element's count is not equal to the columns count, then false.
            bool isVerifyR1192 = true;
            foreach (PropertyRow propertyRow in ropQueryRowsResponse.RowData.PropertyRows)
            {
                isVerifyR1192 = isVerifyR1192 && (propertyRow.PropertyValues.Count == propertyTags.Length);

                // If one row element's count is not equal to the columns count then break the iteration
                if (!isVerifyR1192)
                {
                    break;
                }
            }

            Site.CaptureRequirementIfIsTrue(
                isVerifyR1192,
                1192,
                @"[In RopQueryRows ROP Success Response Buffer] RowData (variable): The columns used for these rows were those previously set on this table by a RopSetColumns ROP request (section 2.2.5.1).");
        }
MS_OXCROPSAdapter