/// <summary> /// Verify the RopSetProperties operation related requirements. /// </summary> /// <param name="ropSetPropertiesResponse">The RopSetProperties response buffer structure.</param> /// <param name="objectType">Indicates which object type the RopSetProperties operation is acting on.</param> private void VerifyRopSetProperties(RopSetPropertiesResponse ropSetPropertiesResponse, ServerObjectType objectType) { // Since the RopSetProperties ROP response was parsed successfully, MS-OXCPRPT_R47502 can be captured directly. Site.CaptureRequirement( 47502, @"[In Processing RopSetProperties] The server responds with a RopSetProperties ROP response buffer."); if (ropSetPropertiesResponse.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( 10201, @"[In RopSetProperties ROP] This operation [RopSetProperties 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( 10202, @"[In RopSetProperties ROP] This operation [RopSetProperties 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( 10203, @"[In RopSetProperties ROP] This operation [RopSetProperties 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( 10204, @"[In RopSetProperties ROP] This operation [RopSetProperties ROP] is valid on Logon objects."); } // The parser has ensured the field satisfied the format, otherwise the response cannot be received. Site.CaptureRequirement( 107, @"[In RopSetProperties ROP Response Buffer] propertyProblemCount: 2 bytes integer."); ushort numberOfPropertyProblem = 0; if (ropSetPropertiesResponse.PropertyProblemCount != 0) { // The parser has ensured the field satisfied the format, otherwise the response cannot be received. Site.CaptureRequirement( 108, @"[In RopSetProperties ROP Response Buffer] propertyProblems (variable): An array of PropertyProblem structures ([MS-OXCDATA] section 2.7)."); for (int counter = 0; counter < ropSetPropertiesResponse.PropertyProblems.Length; counter++) { this.VerifyPropertyProblemSturctureInCDATA(); } numberOfPropertyProblem = (ushort)ropSetPropertiesResponse.PropertyProblems.Length; } Site.CaptureRequirementIfAreEqual<ushort>( numberOfPropertyProblem, ropSetPropertiesResponse.PropertyProblemCount, 10701, @"[In RopSetProperties ROP Response Buffer] propertyProblemCount: An integer that specifies the number of elements contained in the PropertyProblems field."); } }
/// <summary> /// Verify RopSetProperties Success Response /// </summary> /// <param name="ropSetPropertiesResponse">The success response of RopSetProperties request</param> /// <param name="inputHandleIndex">The field of InputHandleIndex in RopSetProperties request</param> private void VerifyRopSetPropertiesSuccessResponse(RopSetPropertiesResponse ropSetPropertiesResponse, byte inputHandleIndex) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2805"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2805 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropSetPropertiesResponse.RopId.GetType(), 2805, @"[In RopSetProperties ROP Success Response Buffer]RopId (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2807"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2807 Site.CaptureRequirementIfAreEqual<byte>( (byte)RopId.RopSetProperties, ropSetPropertiesResponse.RopId, 2807, @"[In RopSetProperties ROP Success Response Buffer,RopId (1 byte)]For this operation[ RopSetProperties], this field is set to 0x0A."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2808"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2808 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropSetPropertiesResponse.InputHandleIndex.GetType(), 2808, @"[In RopSetProperties ROP Success Response Buffer]InputHandleIndex (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2809"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2809 Site.CaptureRequirementIfAreEqual<byte>( inputHandleIndex, ropSetPropertiesResponse.InputHandleIndex, 2809, @"[In RopSetProperties 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_R2811"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2811 Site.CaptureRequirementIfAreEqual<Type>( typeof(uint), ropSetPropertiesResponse.ReturnValue.GetType(), 2811, @"[In RopSetProperties ROP Success Response Buffer]ReturnValue (4 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2813"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2813 Site.CaptureRequirementIfAreEqual<uint>( SuccessReturnValue, ropSetPropertiesResponse.ReturnValue, 2813, @"[In RopSetProperties 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_R2814"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2814 Site.CaptureRequirementIfAreEqual<Type>( typeof(ushort), ropSetPropertiesResponse.PropertyProblemCount.GetType(), 2814, @"[In RopSetProperties ROP Success Response Buffer]PropertyProblemCount (2 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2816"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2816 Site.CaptureRequirementIfAreEqual<Type>( typeof(PropertyProblem[]), ropSetPropertiesResponse.PropertyProblems.GetType(), 2816, @"[In RopSetProperties ROP Success Response Buffer]PropertyProblems (variable): An array of PropertyProblem structures."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2817"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2817 Site.CaptureRequirementIfAreEqual<int>( ropSetPropertiesResponse.PropertyProblemCount, ropSetPropertiesResponse.PropertyProblems.Length, 2817, @"[In RopSetProperties ROP Success Response Buffer,PropertyProblems (variable)]The number of structures contained in this field is specified by the PropertyProblemCount field."); }
/// <summary> /// Verify RopSetProperties Failure Response /// </summary> /// <param name="ropSetPropertiesResponse">The failure response of RopSetProperties request</param> /// <param name="inputHandleIndex">The field of InputHandleIndex in RopSetProperties request</param> private void VerifyRopSetPropertiesFailureResponse(RopSetPropertiesResponse ropSetPropertiesResponse, byte inputHandleIndex) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2819"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2819 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropSetPropertiesResponse.RopId.GetType(), 2819, @"[In RopSetProperties ROP Failure Response Buffer]RopId (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2821"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2821 Site.CaptureRequirementIfAreEqual<byte>( (byte)RopId.RopSetProperties, ropSetPropertiesResponse.RopId, 2821, @"[In RopSetProperties ROP Failure Response Buffer,RopId (1 byte)]For this operation[RopSetProperties], this field is set to 0x0A."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2822"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2822 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropSetPropertiesResponse.InputHandleIndex.GetType(), 2822, @"[In RopSetProperties ROP Failure Response Buffer]InputHandleIndex (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2823"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2823 Site.CaptureRequirementIfAreEqual<byte>( inputHandleIndex, ropSetPropertiesResponse.InputHandleIndex, 2823, @"[In RopSetProperties 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_R2825"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2825 Site.CaptureRequirementIfAreEqual<Type>( typeof(uint), ropSetPropertiesResponse.ReturnValue.GetType(), 2825, @"[In RopSetProperties ROP Failure Response Buffer]ReturnValue (4 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2827"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2827 Site.CaptureRequirementIfAreNotEqual<uint>( SuccessReturnValue, ropSetPropertiesResponse.ReturnValue, 2827, @"[In RopSetProperties ROP Failure Response Buffer,ReturnValue (4 bytes)]For this response[Failure Response ], this field is set to a value other than 0x00000000."); }
/// <summary> /// Set properties' value for a message /// </summary> /// <param name="messageHandle">Unsigned integer value indicates a message object handle.</param> /// <param name="pts">PropertyObj list value</param> /// <param name="rpmSetResponse">The response of calling RopSetProperties.</param> protected void SetPropertiesForMessage(uint messageHandle, List<PropertyObj> pts, out RopSetPropertiesResponse rpmSetResponse) { List<TaggedPropertyValue> pvs = new List<TaggedPropertyValue>(); int valueSize = 0; foreach (PropertyObj pt in pts) { PropertyTag pg = new PropertyTag { PropertyId = (ushort)pt.PropertyID, PropertyType = (ushort)pt.ValueTypeCode }; TaggedPropertyValue pv = new TaggedPropertyValue { PropertyTag = pg, Value = (byte[])pt.Value }; valueSize += pv.Size(); pvs.Add(pv); } RopSetPropertiesRequest rpmSetRequest = new RopSetPropertiesRequest() { RopId = (byte)RopId.RopSetProperties, LogonId = CommonLogonId, // The logonId 0x00 is associated with this operation. InputHandleIndex = CommonInputHandleIndex, // This index specifies the location 0x00 in the Server Object Handle Table where the handle for the input Server Object is stored. PropertyValueCount = (ushort)pvs.Count, PropertyValueSize = (ushort)(valueSize + 2), PropertyValues = pvs.ToArray() }; this.ResponseSOHs = this.MSOXCMSGAdapter.DoRopCall(rpmSetRequest, messageHandle, ref this.response, ref this.rawData, GetPropertiesFlags.None); rpmSetResponse = (RopSetPropertiesResponse)this.response; Site.Assert.AreEqual<uint>(TestSuiteBase.Success, rpmSetResponse.PropertyProblemCount, "If ROP succeeds, the PropertyProblemCount of its response is 0(success)."); }