コード例 #1
0
        /// <summary>
        /// Verify the message of RopSetReadFlags.
        /// </summary>
        /// <param name="setReadFlagsResponse"> The response of RopSetReadFlags.</param>
        private void VerifyRopSetReadFlagsResponse(RopSetReadFlagsResponse setReadFlagsResponse)
        {
            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMSG_R834. The value of PartialCompletion is {0}.", setReadFlagsResponse.PartialCompletion);

            // Verify MS-OXCMSG requirement: MS-OXCMSG_R834
            bool isVerifiedR834 = (typeof(byte) == setReadFlagsResponse.PartialCompletion.GetType()) &&
                                 ((Convert.ToBoolean(setReadFlagsResponse.PartialCompletion) == true) ||
                                 (Convert.ToBoolean(setReadFlagsResponse.PartialCompletion) == false));

            this.Site.CaptureRequirementIfIsTrue(
                isVerifiedR834,
                834,
                @"[In RopSetReadFlags ROP Response Buffer] PartialCompletion: 1 byte boolean flag.");
        }
コード例 #2
0
        /// <summary>
        /// Verify RopSetReadFlags Response
        /// </summary>
        /// <param name="ropSetReadFlagsResponse">The response of RopSetReadFlags request</param>
        /// <param name="inputHandleIndex">The field of InputHandleIndex in RopSetReadFlags request</param>
        private void VerifyRopSetReadFlagsResponse(RopSetReadFlagsResponse ropSetReadFlagsResponse, byte inputHandleIndex)
        {
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2067");

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2067
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(byte),
                ropSetReadFlagsResponse.RopId.GetType(),
                2067,
                @"[In RopSetReadFlags ROP Response Buffer] RopId (1 byte): An unsigned integer.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2069
            Site.CaptureRequirementIfAreEqual<byte>(
                (byte)RopId.RopSetReadFlags,
                ropSetReadFlagsResponse.RopId,
                2069,
                @"[In RopSetReadFlags ROP Response Buffer,RopId (1 byte)]For this operation[RopSetReadFlags], this field is set to 0x66.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2070
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(byte),
                ropSetReadFlagsResponse.InputHandleIndex.GetType(),
                2070,
                @"[In RopSetReadFlags ROP Response Buffer]InputHandleIndex (1 byte): An unsigned integer.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2071
            Site.CaptureRequirementIfAreEqual<byte>(
                inputHandleIndex,
                ropSetReadFlagsResponse.InputHandleIndex,
                2071,
                @"[In RopSetReadFlags ROP 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_R2073");

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2073
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(uint),
                ropSetReadFlagsResponse.ReturnValue.GetType(),
                2073,
                @"[In RopSetReadFlags ROP Response Buffer]ReturnValue (4 bytes): An unsigned integer.");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2075,PartialCompletion:{0}", ropSetReadFlagsResponse.PartialCompletion);

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2075
            // If PartialCompletion is byte type and can be boolean type representation, then verify R2075
            bool isVerifyR2075 = (typeof(byte) == ropSetReadFlagsResponse.PartialCompletion.GetType()) &&
                                 ((Convert.ToBoolean(ropSetReadFlagsResponse.PartialCompletion) == true) ||
                                 (Convert.ToBoolean(ropSetReadFlagsResponse.PartialCompletion) == false));

            Site.CaptureRequirementIfIsTrue(
                isVerifyR2075,
                2075,
                @"[In RopSetReadFlags ROP Response Buffer]PartialCompletion (1 byte): An Boolean.");
        }