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

VerifyRopTransportSendSuccessResponse() private method

Verify RopTransportSend Success Response
private VerifyRopTransportSendSuccessResponse ( RopTransportSendResponse ropTransportSendResponse, byte inputHandleIndex ) : void
ropTransportSendResponse RopTransportSendResponse The success response of RopTransportSend request
inputHandleIndex byte The field of InputHandleIndex in RopTransportSend request
return void
        private void VerifyRopTransportSendSuccessResponse(RopTransportSendResponse ropTransportSendResponse, byte inputHandleIndex)
        {
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2476");

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

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2478
            Site.CaptureRequirementIfAreEqual<byte>(
                (byte)RopId.RopTransportSend,
                ropTransportSendResponse.RopId,
                2478,
                @"[In RopTransportSend ROP Success Response Buffer] RopId (1 byte):For this operation[RopTransportSend], this field is set to 0x4A.");

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

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

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2480
            Site.CaptureRequirementIfAreEqual<byte>(
                inputHandleIndex,
                ropTransportSendResponse.InputHandleIndex,
                2480,
                @"[In RopTransportSend 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_R2482");

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

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

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

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2484,NoPropertiesReturned:{0}", ropTransportSendResponse.NoPropertiesReturned);

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2484
            // If NoPropertiesReturned is byte type and can be boolean type representation, then verify R2484
            bool isVerifyR2484 = (typeof(byte) == ropTransportSendResponse.NoPropertiesReturned.GetType()) &&
                                 ((Convert.ToBoolean(ropTransportSendResponse.NoPropertiesReturned) == true) ||
                                 (Convert.ToBoolean(ropTransportSendResponse.NoPropertiesReturned) == false));

            Site.CaptureRequirementIfIsTrue(
                isVerifyR2484,
                2484,
                @"[In RopTransportSend ROP Success Response Buffer]NoPropertiesReturned (1 byte): An Boolean.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2486
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(ushort),
                ropTransportSendResponse.PropertyValueCount.GetType(),
                2486,
                @"[In  RopTransportSend ROP Success Response Buffer]PropertyValueCount (2 bytes): An unsigned integer.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2488
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(TaggedPropertyValue[]),
                ropTransportSendResponse.PropertyValues.GetType(),
                2488,
                @"[In RopTransportSend ROP Success Response Buffer]PropertyValues (variable): An array of TaggedPropertyValue  structures.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2490
            Site.CaptureRequirementIfAreEqual<ushort>(
                ropTransportSendResponse.PropertyValueCount,
                (ushort)ropTransportSendResponse.PropertyValues.Length,
                2490,
                @"[In RopTransportSend ROP Success Response Buffer,PropertyValues (variable)]The number of structures contained in this field is specified by the PropertyValueCount field.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2485
            Site.CaptureRequirementIfIsTrue(
                (ropTransportSendResponse.NoPropertiesReturned == 0 && ropTransportSendResponse.PropertyValueCount > 0) || (ropTransportSendResponse.NoPropertiesReturned == 1 && ropTransportSendResponse.PropertyValueCount == 0),
                2485,
                @"[In RopTransportSend ROP Success Response Buffer,NoPropertiesReturned (1 byte)]This value specifies whether property values are returned.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2487
            Site.CaptureRequirementIfAreEqual<int>(
                ropTransportSendResponse.PropertyValueCount,
                ropTransportSendResponse.PropertyValues.Length,
                2487,
                @"[In RopTransportSend ROP Success Response Buffer,PropertyValueCount (2 bytes)]This value specifies the number of structures returned in the PropertyValues field.");

            foreach (TaggedPropertyValue taggedPropertyValue in ropTransportSendResponse.PropertyValues)
            {
                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R468");

                // Verify MS-OXCROPS requirement: MS-OXCDATA_R468
                Site.CaptureRequirementIfAreEqual<Type>(
                    typeof(PropertyTag),
                    taggedPropertyValue.PropertyTag.GetType(),
                    "MS-OXCDATA",
                    468,
                    @"[In TaggedPropertyValue Structure] PropertyTag (4 bytes): A PropertyTag structure, as specified in section 2.9, giving the values of the PropertyId and PropertyType fields for the property.");

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

                // Verify MS-OXCROPS requirement: MS-OXCDATA_R181
                Site.CaptureRequirementIfAreEqual<Type>(
                    typeof(ushort),
                    taggedPropertyValue.PropertyTag.PropertyType.GetType(),
                    "MS-OXCDATA",
                    181,
                    @"[In PropertyTag Structure] PropertyType (2 bytes): An unsigned integer that identifies the data type of the property value, as specified by the table in section 2.11.1.");

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

                // Verify MS-OXCROPS requirement: MS-OXCDATA_R182
                Site.CaptureRequirementIfAreEqual<Type>(
                    typeof(ushort),
                    taggedPropertyValue.PropertyTag.PropertyId.GetType(),
                    "MS-OXCDATA",
                    182,
                    @"[In PropertyTag Structure] PropertyId (2 bytes): An unsigned integer that identifies the property.");
            }
        }
MS_OXCROPSAdapter