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

IsInvalidInputHandleNeeded() private method

Check whether the default invalid handle is needed.
private IsInvalidInputHandleNeeded ( ISerializable ropRequest, RopResponseType expectedRopResponseType ) : bool
ropRequest ISerializable ROP request objects.
expectedRopResponseType RopResponseType The expected ROP response type.
return bool
        private bool IsInvalidInputHandleNeeded(ISerializable ropRequest, RopResponseType expectedRopResponseType)
        {
            if (!Common.IsOutputHandleInRopRequest(ropRequest) && expectedRopResponseType == RopResponseType.FailureResponse)
            {
                byte[] request = ropRequest.Serialize();

                // The default handle is also needed by some cases to verify the failure response caused by an invalid input handle.
                // The input handle index is the third byte and its value is 1 in this test suite for this situation.
                byte inputHandleIndex = request[2];
                if (inputHandleIndex == 1)
                {
                    return true;
                }
            }

            return false;
        }
MS_OXCROPSAdapter