/// <summary>
        /// Verify RopSortTable Failure Response
        /// </summary>
        /// <param name="ropSortTableResponse">The response of RopSortTable request</param>
        /// <param name="inputHandleIndex">The field of InputHandleIndex in RopSortTable request</param>
        private void VerifyRopSortTableFailureResponse(RopSortTableResponse ropSortTableResponse, byte inputHandleIndex)
        {
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1115");

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1115
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(byte),
                ropSortTableResponse.RopId.GetType(),
                1115,
                @"[In RopSortTable ROP Failure Response Buffer] RopId (1 byte): An unsigned integer.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1117
            Site.CaptureRequirementIfAreEqual<byte>(
                (byte)RopId.RopSortTable,
                ropSortTableResponse.RopId,
                1117,
                @"[In RopSortTable ROP Failure Response Buffer] RopId (1 byte): For this operation[RopSortTable], this field is set to 0x13.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1118
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(byte),
                ropSortTableResponse.InputHandleIndex.GetType(),
                1118,
                @"[In RopSortTable ROP Failure Response Buffer] InputHandleIndex (1 byte): An unsigned integer.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1119
            Site.CaptureRequirementIfAreEqual<byte>(
                inputHandleIndex,
                ropSortTableResponse.InputHandleIndex,
                1119,
                @"[In RopSortTable ROP Failure 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_R1120");

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1120
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(uint),
                ropSortTableResponse.ReturnValue.GetType(),
                1120,
                @"[In RopSortTable ROP Failure Response Buffer] ReturnValue (4 bytes): An unsigned integer.");

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1122
            Site.CaptureRequirementIfAreNotEqual<uint>(
                SuccessReturnValue,
                ropSortTableResponse.ReturnValue,
                1122,
                @"[In RopSortTable ROP Failure Response Buffer] ReturnValue (4 bytes): For this response[Failure Response], this field is set to a value other than 0x00000000.");
        }
        /// <summary>
        /// Verify RopSortTable Response
        /// </summary>
        /// <param name="sortTableResponse">RopSortTableResponse structure data that needs verification</param>
        private void VerifyRopSortTableResponse(RopSortTableResponse sortTableResponse)
        {
            this.VerifyRPCLayerRequirement();

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

            // Verify MS-OXCTABL requirement: MS-OXCTABL_R83
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(byte),
                sortTableResponse.TableStatus.GetType(),
                83,
                @"[In RopSortTable ROP Response Buffer] TableStatus (1 byte): An enumeration that indicates the status of asynchronous operations being performed on the table.<6>");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R84: the current table status is {0}", sortTableResponse.TableStatus);

            // Verify MS-OXCTABL requirement: MS-OXCTABL_R84
            bool isVerifyR84 = (sortTableResponse.TableStatus == 0x00) ||
                               (sortTableResponse.TableStatus == 0x09) ||
                               (sortTableResponse.TableStatus == 0x0A) ||
                               (sortTableResponse.TableStatus == 0x0B) ||
                               (sortTableResponse.TableStatus == 0x0D) ||
                               (sortTableResponse.TableStatus == 0x0E) ||
                               (sortTableResponse.TableStatus == 0x0F);

            Site.CaptureRequirementIfIsTrue(
                isVerifyR84,
                84,
                @"[In RopSortTable ROP Response Buffer] This field MUST have one of the table status values[0x00,0x09,0x0A,0x0B,0x0D,0x0E,0x0F] that are specified in section 2.2.2.1.3.");

            // Table Status is TBLSTAT_COMPLETE with value 0x00 means no operations are in progress.
            if ((TableRopReturnValues)sortTableResponse.ReturnValue == TableRopReturnValues.success && !this.globalIsSortTableAsynchronous)
            {
                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R33");

                // Verify MS-OXCTABL requirement: MS-OXCTABL_R33
                Site.CaptureRequirementIfAreEqual(
                    0x00,
                    sortTableResponse.TableStatus,
                    33,
                    @"[In TableStatus] When the Table Status is TBLSTAT_COMPLETE with value 0x00 means no operations are in progress.");

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

                // Verify MS-OXCTABL requirement: MS-OXCTABL_R43
                Site.CaptureRequirementIfAreEqual(
                    0x00,
                    sortTableResponse.TableStatus,
                    43,
                    @"[In Asynchronous Flags] When TBL_ASYNC value is 0x00,the server will perform the operation synchronously.");
            }

            if (this.globalIsSortTableAsynchronous)
            {
                if (Common.IsRequirementEnabled(815, this.Site))
                {
                    // Add the debug information
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R815");

                    // Verify MS-OXCTABL requirement: MS-OXCTABL_R815
                    Site.CaptureRequirementIfAreEqual(
                        0x09,
                        sortTableResponse.TableStatus,
                        815,
                        @"[In Appendix A: Product Behavior] When the Table Status returned by the implementation is TBLSTAT_SORTING with value 0x09 means a RopSortTable ROP is in progress. (Microsoft Exchange Server 2007 follows this behavior.)");
                }

                if (Common.IsRequirementEnabled(42, this.Site))
                {
                    // Add the debug information
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R42");

                    // Verify MS-OXCTABL requirement: MS-OXCTABL_R42
                    Site.CaptureRequirementIfAreEqual(
                        0x09,
                        sortTableResponse.TableStatus,
                        42,
                        @"[In Appendix A: Product Behavior] When TBL_ASYNC value is 0x01,the implementation performs the ROP asynchronously. (Microsoft Exchange Server 2007 follows this behavior.)");
                }

                if (Common.IsRequirementEnabled(799, this.Site))
                {
                    // Add the debug information
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R799");

                    // Verify MS-OXCTABL requirement: MS-OXCTABL_R799
                    Site.CaptureRequirementIfAreNotEqual(
                        0x00,
                        sortTableResponse.TableStatus,
                        799,
                        @"[In Appendix A: Product Behavior] If the client requests that the implementation perform a RopSortTable ([MS-OXCROPS] section 2.2.5.2) ROP request asynchronously, it does not perform the operation synchronously and not return ""TBLSTAT_COMPLETE"" in the TableStatus field of the ROP response buffer. (Microsoft Exchange Server 2007 follows this behavior.)");
                }

                if (Common.IsRequirementEnabled(800, this.Site))
                {
                    // Add the debug information
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R800");

                    // Verify MS-OXCTABL requirement: MS-OXCTABL_R800
                    Site.CaptureRequirementIfAreEqual(
                        0x00,
                        sortTableResponse.TableStatus,
                        800,
                        @"[In Appendix A: Product Behavior] If the client requests that the implementation perform a RopSortTable ([MS-OXCROPS] section 2.2.5.2) ROP request asynchronously, it does perform the operation synchronously and return ""TBLSTAT_COMPLETE"" in the TableStatus field of the ROP response buffer. ( <20> Section 3.2.5.1: Exchange 2010, Exchange 2013, and Exchange 2016 do not support asynchronous operations on tables and ignore the TABL_ASYNC flags, as described in section 2.2.2.1.4.)");
                }

                // If the TBL_ASYNC bit of the SortTableFlags field is set, the server can execute the ROP as a table-asynchronous ROP
                // In asynchronous ROP, the TableStatus field in response is not TBLSTAT_COMPLETE.
                if (Common.IsRequirementEnabled(794, this.Site))
                {
                    // Add the debug information
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R794");

                    // Verify MS-OXCTABL requirement: MS-OXCTABL_R794
                    Site.CaptureRequirementIfAreNotEqual(
                        0x00,
                        sortTableResponse.TableStatus,
                        794,
                        @"[In Appendix A: Product Behavior] If the TBL_ASYNC bit of the SortTableFlags field is set, the implementation can execute the ROP as a table-asynchronous ROP,as specified in section 3.2.5.1. (Microsoft Exchange Server 2007 follows this behavior.)");
                }

                // In the environments that cannot support asynchronous, it will ignore the asynchronous flags, and return Table Status "TBLSTAT_COMPLETE" with value 0x00 when asynchronous flags is set to 0x01 in a RopSortTable ROP.
                if (Common.IsRequirementEnabled(772, this.Site))
                {
                    // Add the debug information
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R772");

                    // Verify MS-OXCTABL requirement: MS-OXCTABL_R772
                    Site.CaptureRequirementIfAreEqual(
                        0x00,
                        sortTableResponse.TableStatus,
                        772,
                        @"[In Appendix A: Product Behavior] Implementation does return Table Status ""TBLSTAT_COMPLETE"" with value 0x00 when asynchronous flags is set to 0x01 in a RopSortTable ROP on tables. (<5> Section 2.2.2.3.1: Exchange 2010, Exchange 2013, and Exchange 2016 will return Table Status ""TBLSTAT_COMPLETE"" with value 0x00 when asynchronous flags is set to 0x01 in a RopSortTable ROP on tables.)");
                }

                // Here it can partially verify MS-OXCTABL requirement: MS-OXCTABL_418
                // if the server executes the ROP asynchronously, the server return "TBLSTAT_SORTING" in the TableStatus field of the ROP response buffer and do the work asynchronously.
                if (Common.IsRequirementEnabled(418, this.Site))
                {
                    // Add the debug information
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R418");

                    // Verify MS-OXCTABL requirement: MS-OXCTABL_R418
                    Site.CaptureRequirementIfAreEqual(
                        0x09,
                        sortTableResponse.TableStatus,
                        418,
                        @"[In Appendix A: Product Behavior] However, if the implementation executes the ROP asynchronously, it return ""TBLSTAT_SORTING"", ""TBLSTAT_SETTING_COLS"", or ""TBLSTAT_RESTRICTING"" (depending on the ROP performed) in the TableStatus field of the ROP response buffer and do the work asynchronously. (Microsoft Exchange Server 2007 follows this behavior.)");
                }
            }
        }
        /// <summary>
        /// Verify RopSortTable Success Response
        /// </summary>
        /// <param name="ropSortTableResponse">The response of RopSortTable request</param>
        /// <param name="inputHandleIndex">The field of InputHandleIndex in RopSortTable request</param>
        private void VerifyRopSortTableSuccessResponse(RopSortTableResponse ropSortTableResponse, byte inputHandleIndex)
        {
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1104");

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

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1106
            Site.CaptureRequirementIfAreEqual<byte>(
                (byte)RopId.RopSortTable,
                ropSortTableResponse.RopId,
                1106,
                @"[In RopSortTable ROP Success Response Buffer] RopId (1 byte): For this operation[RopSortTable], this field[RopId (1 byte)] is set to 0x13.");

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

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

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1108
            Site.CaptureRequirementIfAreEqual<byte>(
                inputHandleIndex,
                ropSortTableResponse.InputHandleIndex,
                1108,
                @"[In RopSortTable ROP Success Response Buffer] InputHandleIndex (1 byte): This index that 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_R1109");

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

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1111
            Site.CaptureRequirementIfAreEqual<uint>(
                SuccessReturnValue,
                ropSortTableResponse.ReturnValue,
                1111,
                @"[In RopSortTable 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_R1112");

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1112
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(byte),
                ropSortTableResponse.TableStatus.GetType(),
                1112,
                @"[In RopSortTable ROP Success Response Buffer] TableStatus (1 byte): An enumeration.");

            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1113,TableStatus:{0}", ropSortTableResponse.TableStatus);

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R1113
            bool isVerifyR1113 = ((ropSortTableResponse.TableStatus & ((byte)TableStatus.TblstatComplete)) == ((byte)TableStatus.TblstatComplete))
                                 || ((ropSortTableResponse.TableStatus & ((byte)TableStatus.TblstatSorting)) == ((byte)TableStatus.TblstatSorting))
                                 || ((ropSortTableResponse.TableStatus & ((byte)TableStatus.TblstatSortError)) == ((byte)TableStatus.TblstatSortError))
                                 || ((ropSortTableResponse.TableStatus & ((byte)TableStatus.TblstatSettingCols)) == ((byte)TableStatus.TblstatSettingCols))
                                 || ((ropSortTableResponse.TableStatus & ((byte)TableStatus.TblstatSetColError)) == ((byte)TableStatus.TblstatSetColError))
                                 || ((ropSortTableResponse.TableStatus & ((byte)TableStatus.TblstatRestricting)) == ((byte)TableStatus.TblstatRestricting))
                                 || ((ropSortTableResponse.TableStatus & ((byte)TableStatus.TblstatRestrictError)) == ((byte)TableStatus.TblstatRestrictError));

            Site.CaptureRequirementIfIsTrue(
                isVerifyR1113,
                1113,
                @"[In RopSortTable ROP Success Response Buffer] TableStatus (1 byte): The possible values[the value of TBLSTAT_COMPLETE is 0x00, the value of TBLSTAT_SORTING is 0x09, the value of TBLSTAT_SORT_ERROR is 0x0A, the value of TBLSTAT_SETTING_COLS is 0x0B, the value of TBLSTAT_SETCOL_ERROR is 0x0D, the value of TBLSTAT_RESTRICTING is 0x0E and the value of TBLSTAT_RESTRICT_ERROR is 0x0F] for this enumeration are specified in [MS-OXCTABL] section 2.2.2.1.3.");
        }