Microsoft.Protocols.TestSuites.MS_OXCPRPT.MS_OXCPRPTAdapter.VerifyRopGetPropertiesSpecific C# (CSharp) Method

VerifyRopGetPropertiesSpecific() private method

Verify the RopGetPropertiesSpecific operation related requirements.
private VerifyRopGetPropertiesSpecific ( RopGetPropertiesSpecificResponse ropGetPropertiesSpecificResponse, ServerObjectType objectType, bool isOrdered, bool isPropertySizeLimitZero, bool isPropertyLagerThanLimit, bool isValueContainsNotEnoughMemory ) : void
ropGetPropertiesSpecificResponse Microsoft.Protocols.TestSuites.Common.RopGetPropertiesSpecificResponse The RopGetPropertiesSpecific response buffer structure.
objectType ServerObjectType Indicates which object type the RopGetPropertiesSpecific operation is acting on.
isOrdered bool A boolean value which indicates whether the order of elements in request/response buffer is right.
isPropertySizeLimitZero bool Indicates if PropertySizeLimit is set to 0.
isPropertyLagerThanLimit bool Indicates if returned value size is larger than the size limit.
isValueContainsNotEnoughMemory bool Indicates if the value is larger than limit or not.
return void
        private void VerifyRopGetPropertiesSpecific(
            RopGetPropertiesSpecificResponse ropGetPropertiesSpecificResponse,
            ServerObjectType objectType,
            bool isOrdered,
            bool isPropertySizeLimitZero,
            bool isPropertyLagerThanLimit,
            bool isValueContainsNotEnoughMemory)
        {
            // Since the RopGetPropertiesSpecific ROP response was parsed successfully, MS-OXCPRPT_R45602 can be captured directly.
            Site.CaptureRequirement(
                45602,
                @"[In Processing RopGetPropertiesSpecific] The server responds with a RopGetPropertiesSpecific ROP response buffer. ");

            // Verify MS-OXCPRPT requirement: MS-OXCPRPT_R56
            // Since the return value is in order, it verifies the return value is returned in order as the properties specified in the PropertyTags field. So MS-OXCPRPT_R56 can be captured.
            Site.CaptureRequirementIfIsTrue(
                isOrdered,
                56,
                @"[In RopGetPropertiesSpecific ROP] The RopGetPropertiesSpecific ROP ([MS-OXCROPS] section 2.2.8.3) queries for and returns the values of properties specified in the PropertyTags field.");

            // Verify MS-OXCPRPT requirement: MS-OXCPRPT_R45702
            // Since the response for RopGetPropertiesSpecific doesn't contain PropertyTags information, if the returned values for PropertyTags fields in RopGetPropertiesSpecific are same with the setting values in RopSetProperties. 
            // It means the properties to be returned are specified in the PropertyTags field of the request. 
            Site.CaptureRequirementIfIsTrue(
                isOrdered,
                45702,
                @"[In Processing RopGetPropertiesSpecific] The properties to be returned are specified in the PropertyTags field of the ROP request buffer.");

            // The order has been verified when de-serializing the related structures and represented by the variable isOrdered.
            Site.CaptureRequirementIfIsTrue(
               isOrdered,
               "MS-OXCDATA",
               64,
               @"[In PropertyRow Structures] For the RopGetPropertiesSpecific ROP, property values are returned in the order that the properties were requested.");

            // Verify MS-OXCPRPT requirement: MS-OXCPRPT_R45701
            // The order has been verified when de-serializing the related structures and represented by the variable isOrdered.
            Site.CaptureRequirementIfIsTrue(
                isOrdered,
                45701,
                @"[In Processing RopGetPropertiesSpecific] The server MUST order properties in the PropertyValues field of the ROP response buffer in the same order in which properties are specified in the PropertyTags field.");

            // Verify MS-OXCPRPT requirement: MS-OXCPRPT_R76
            // The order has been verified when de-serializing the related structures and represented by the variable isOrdered.
            Site.CaptureRequirementIfIsTrue(
                isOrdered,
                76,
                @"[In RopGetPropertiesSpecific ROP Response Buffer] RowData (variable): A PropertyRow structure ([MS-OXCDATA] section 2.8.1) that contains the values of the properties specified in the ROP request buffer.");

            if (isPropertySizeLimitZero)
            {
                bool isPropertyLimitedByBufferSize = false;
                uint len = 0;
                foreach (PropertyValue value in ropGetPropertiesSpecificResponse.RowData.PropertyValues)
                {
                    len = len + (uint)value.Size();
                }

                isPropertyLimitedByBufferSize = len < uint.MaxValue;

                Site.CaptureRequirementIfIsTrue(
                    isPropertyLimitedByBufferSize,
                    62,
                    @"[In RopGetPropertiesSpecific ROP Request Buffer] PropertySizeLimit: If this value is zero, the property values are limited only by the size of the ROP response buffer. ");
            }

            if (ropGetPropertiesSpecificResponse.ReturnValue.Equals((uint)CPRPTErrorCode.None))
            {
                switch (objectType)
                {
                    case 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(
                            5801,
                            @"[In RopGetPropertiesSpecific ROP] Message objects are supported for this operation [RopGetPropertiesSpecific ROP].");
                        break;
                    case 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(
                            5803,
                            @"[In RopGetPropertiesSpecific ROP] Attachment objects are supported for this operation [RopGetPropertiesSpecific ROP].");
                        break;
                    case 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(
                            5802,
                            @"[In RopGetPropertiesSpecific ROP] Folder objects are supported for this operation [RopGetPropertiesSpecific ROP].");
                        break;
                    case 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(
                            5804,
                            @"[In RopGetPropertiesSpecific ROP] Logon objects are supported for this operation [RopGetPropertiesSpecific ROP].");
                        break;
                    default:
                        Site.Assert.Fail("The returned server object type is {0}, which is invalid.", objectType);
                        break;
                }
            }

            if (Common.IsRequirementEnabled(86703, this.Site))
            {
                if (this.cprptCurrentType == ServerObjectType.Message || this.cprptCurrentType == ServerObjectType.Attachment)
                {
                    if (isPropertyLagerThanLimit)
                    {
                        // If MS-OXCPRPT_R86703 is enabled, when the property is a PtypBinary type, a PtypObject type, or a string property, 
                        // the NotEnoughMemory (0x8007000E) will be returned, if the value is larger than either the available space in the ROP response buffer or the size specified in the PropertySizeLimit field of the ROP request buffer.
                        // MS-OXCPRPT_R86703 is captured in model. This requirement is captured here since the requirements from other protocols cannot be handled in model.
                        Site.CaptureRequirementIfIsTrue(
                             isValueContainsNotEnoughMemory,
                             "MS-OXCDATA",
                             2052,
                             @"[In Additional Error Codes] NotEnoughMemory (E_NOMEMORY, MAPI_E_NOT_ENOUGH_MEMORY) will be returned, On get, indicates that the property or column value is too large to be retrieved by the request, and the property value needs to be accessed with the RopOpenStream ROP ([MS-OXCROPS] section 2.2.9.1).");
                    }
                }
            }
        }
        #endregion
MS_OXCPRPTAdapter