/// <summary>
        /// Verify RopDeleteProperties Failure Response
        /// </summary>
        /// <param name="ropDeletePropertiesResponse">The failure response of RopDeleteProperties request</param>
        /// <param name="inputHandleIndex">The field of InputHandleIndex in RopDeleteProperties request</param>
        private void VerifyRopDeletePropertiesFailureResponse(RopDeletePropertiesResponse ropDeletePropertiesResponse, byte inputHandleIndex)
        {
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2900");

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

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2902
            Site.CaptureRequirementIfAreEqual<byte>(
                (byte)RopId.RopDeleteProperties,
                ropDeletePropertiesResponse.RopId,
                2902,
                @"[In RopDeleteProperties ROP Failure Response Buffer,RopId (1 byte)]For this operation[RopDeleteProperties], this field is set to 0x0B.");

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

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

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2904
            Site.CaptureRequirementIfAreEqual<byte>(
                inputHandleIndex,
                ropDeletePropertiesResponse.InputHandleIndex,
                2904,
                @"[In RopDeleteProperties 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_R2906");

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

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2908
            Site.CaptureRequirementIfAreNotEqual<uint>(
                SuccessReturnValue,
                ropDeletePropertiesResponse.ReturnValue,
                2908,
                @"[In RopDeleteProperties ROP Failure Response Buffer,ReturnValue (4 bytes)]For this response[Failure Response ], this field is set to a value other than 0x00000000.");
        }
Пример #2
0
        /// <summary>
        /// Verify the RopDeleteProperties operation related requirements.
        /// </summary>
        /// <param name="ropDeletePropertiesResponse">The RopDeleteProperties response buffer structure.</param>
        /// <param name="objectType">Indicates which object type the RopDeleteProperties operation is acting on </param>
        private void VerifyRopDeleteProperties(RopDeletePropertiesResponse ropDeletePropertiesResponse, ServerObjectType objectType)
        {
            // Since the RopDeleteProperties ROP response was parsed successfully, MS-OXCPRPT_R48402 can be captured directly.
            Site.CaptureRequirement(
                 48402,
                 @"[In Processing RopDeleteProperties] The server responds with a RopDeleteProperties ROP response buffer. ");

            if (ropDeletePropertiesResponse.ReturnValue.Equals((uint)CPRPTErrorCode.None))
            {
                if (objectType == ServerObjectType.Message)
                {
                    // If the object type this operation acting on is Message object and this operation is performed successfully, then the following requirement can be captured.
                    Site.CaptureRequirement(
                        11401,
                        @"[In RopDeleteProperties ROP] This operation [RopDeleteProperties ROP] is valid on Message objects.");
                }

                if (objectType == ServerObjectType.Folder)
                {
                    // If the object type this operation acting on is Folder object and this operation is performed successfully, then the following requirement can be captured.
                    Site.CaptureRequirement(
                        11402,
                        @"[In RopDeleteProperties ROP] This operation [RopDeleteProperties ROP] is valid on Folder objects.");
                }

                if (objectType == ServerObjectType.Attachment)
                {
                    // If the object type this operation acting on is Attachment object and this operation is performed successfully, then the following requirement can be captured.
                    Site.CaptureRequirement(
                        11403,
                        @"[In RopDeleteProperties ROP] This operation [RopDeleteProperties ROP] is valid on Attachment objects.");
                }

                if (objectType == ServerObjectType.Logon)
                {
                    // If the object type this operation acting on is Logon object and this operation is performed successfully, then the following requirement can be captured.
                    Site.CaptureRequirement(
                        11404,
                        @"[In RopDeleteProperties ROP] This operation [RopDeleteProperties ROP] is valid on Logon objects.");
                }

                if (ropDeletePropertiesResponse.PropertyProblemCount != 0)
                {
                    // The parser has ensured the field satisfied the format, otherwise the response cannot be received.
                    Site.CaptureRequirement(
                       120,
                       @"[In RopDeleteProperties ROP Response Buffer] PropertyProblems (variable): An array of PropertyProblem structures ([MS-OXCDATA] section 2.7).");
                }

                // The parser has ensured the field satisfied the format, otherwise the response cannot be received.
                Site.CaptureRequirement(
                       119,
                       @"[In RopDeleteProperties ROP Response Buffer] PropertyProblemCount: 2 bytes integer.");
            }

            if (ropDeletePropertiesResponse.ReturnValue == 0x8004010F)
            {
                // The parser has ensured the field satisfied the format, otherwise the response cannot be received.
                Site.CaptureRequirement(
                        "MS-OXCDATA",
                        2055,
                        @"[In Additional Error Codes] The numeric value (hex) for error code NotFound is 0x8004010F, %x0F.01.04.80.");
            }

            ushort numberOfPropertyProblem = 0;
            if (ropDeletePropertiesResponse.PropertyProblemCount != 0x00)
            {
                numberOfPropertyProblem = (ushort)ropDeletePropertiesResponse.PropertyProblems.Length;
            }

            Site.CaptureRequirementIfAreEqual<ushort>(
                numberOfPropertyProblem,
                ropDeletePropertiesResponse.PropertyProblemCount,
                11901,
                @"[In RopDeleteProperties ROP Response Buffer] PropertyProblemCount: An integer that specifies the number of elements contained in the PropertyProblems field.");

            if (ropDeletePropertiesResponse.PropertyProblemCount != 0x00)
            {
                for (int counter = 0; counter < ropDeletePropertiesResponse.PropertyProblems.Length; counter++)
                {
                    this.VerifyPropertyProblemSturctureInCDATA();
                }
            }
        }
        /// <summary>
        /// Verify RopDeleteProperties Success Response
        /// </summary>
        /// <param name="ropDeletePropertiesResponse">The success response of RopDeleteProperties request</param>
        /// <param name="inputHandleIndex">The field of InputHandleIndex in RopDeleteProperties request</param>
        private void VerifyRopDeletePropertiesSuccessResponse(RopDeletePropertiesResponse ropDeletePropertiesResponse, byte inputHandleIndex)
        {
            // Add the debug information
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2886");

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

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2888
            Site.CaptureRequirementIfAreEqual<byte>(
                (byte)RopId.RopDeleteProperties,
                ropDeletePropertiesResponse.RopId,
                2888,
                @"[In RopDeleteProperties ROP Success Response Buffer,RopId (1 byte)]For this operation[RopDeleteProperties], this field is set to 0x0B.");

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

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

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2890
            Site.CaptureRequirementIfAreEqual<byte>(
                inputHandleIndex,
                ropDeletePropertiesResponse.InputHandleIndex,
                2890,
                @"[In RopDeleteProperties 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_R2892");

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

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

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2894
            Site.CaptureRequirementIfAreEqual<uint>(
                SuccessReturnValue,
                ropDeletePropertiesResponse.ReturnValue,
                2894,
                @"[In RopDeleteProperties 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_R2895");

            // Verify MS-OXCROPS requirement: MS-OXCROPS_R2895
            Site.CaptureRequirementIfAreEqual<Type>(
                typeof(ushort),
                ropDeletePropertiesResponse.PropertyProblemCount.GetType(),
                2895,
                @"[In RopDeleteProperties ROP Success Response Buffer]PropertyProblemCount (2 bytes): An unsigned integer.");

            // According to the de-serialize approach of ropDeletePropertiesResponse,if the PropertyProblemCount's value is greater than 0, the error operation occurs.
            if (ropDeletePropertiesResponse.PropertyProblemCount > 0)
            {
                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2897");

                // Verify MS-OXCROPS requirement: MS-OXCROPS_R2897
                Site.CaptureRequirementIfAreEqual<Type>(
                    typeof(PropertyProblem[]),
                    ropDeletePropertiesResponse.PropertyProblems.GetType(),
                    2897,
                    @"[In RopDeleteProperties ROP Success Response Buffer]PropertyProblems (variable): An array of PropertyProblem structures.");

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

                // Verify MS-OXCROPS requirement: MS-OXCROPS_R2898
                Site.CaptureRequirementIfAreEqual<int>(
                    ropDeletePropertiesResponse.PropertyProblemCount,
                    ropDeletePropertiesResponse.PropertyProblems.Length,
                    2898,
                    @"[In RopDeleteProperties ROP Success Response Buffer,PropertyProblems (variable)]The number of structures contained in this field is specified by the PropertyProblemCount field.");
            }
        }