/// <summary> /// Verify RopReloadCachedInformation Success Response /// </summary> /// <param name="ropReloadCachedInformationResponse">The response of RopReloadCachedInformation request</param> /// <param name="inputHandleIndex">The field of InputHandleIndex in RopReloadCachedInformation request</param> private void VerifyRopReloadCachedInformationSuccessResponse(RopReloadCachedInformationResponse ropReloadCachedInformationResponse, byte inputHandleIndex) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1956"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1956 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropReloadCachedInformationResponse.RopId.GetType(), 1956, @"[In RopReloadCachedInformation ROP Success Response Buffer]RopId (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1958"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1958 Site.CaptureRequirementIfAreEqual<byte>( (byte)RopId.RopReloadCachedInformation, ropReloadCachedInformationResponse.RopId, 1958, @"[In RopReloadCachedInformation ROP Success Response Buffer,RopId (1 byte)]For this operation[RopReloadCachedInformation], this field is set to 0x10."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1959"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1959 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropReloadCachedInformationResponse.InputHandleIndex.GetType(), 1959, @"[In RopReloadCachedInformation ROP Success Response Buffer]InputHandleIndex (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1960"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1960 Site.CaptureRequirementIfAreEqual<byte>( inputHandleIndex, ropReloadCachedInformationResponse.InputHandleIndex, 1960, @"[In RopReloadCachedInformation ROP Success Response Buffer,InputHandleIndex (1 byte)]This index MUST be set to the value specified in the InputHandleIndex specified field in the request."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1962"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1962 Site.CaptureRequirementIfAreEqual<Type>( typeof(uint), ropReloadCachedInformationResponse.ReturnValue.GetType(), 1962, @"[In RopReloadCachedInformation ROP Success Response Buffer]ReturnValue (4 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1964"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1964 Site.CaptureRequirementIfAreEqual<uint>( SuccessReturnValue, ropReloadCachedInformationResponse.ReturnValue, 1964, @"[In RopReloadCachedInformation 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_R1965,HasNamedProperties:{0}", ropReloadCachedInformationResponse.HasNamedProperties); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1965 // If HasNamedProperties is byte type and can be boolean type representation, then verify R1965 bool isVerifyR1965 = (typeof(byte) == ropReloadCachedInformationResponse.HasNamedProperties.GetType()) && ((Convert.ToBoolean(ropReloadCachedInformationResponse.HasNamedProperties) == true) || (Convert.ToBoolean(ropReloadCachedInformationResponse.HasNamedProperties) == false)); Site.CaptureRequirementIfIsTrue( isVerifyR1965, 1965, @"[In RopReloadCachedInformation ROP Success Response Buffer]HasNamedProperties (1 byte): A Boolean."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1967"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1967 Site.CaptureRequirementIfAreEqual<Type>( typeof(TypedString), ropReloadCachedInformationResponse.SubjectPrefix.GetType(), 1967, @"[In RopReloadCachedInformation ROP Success Response Buffer]SubjectPrefix (variable): A TypedString structure."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1970"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1970 Site.CaptureRequirementIfAreEqual<Type>( typeof(TypedString), ropReloadCachedInformationResponse.NormalizedSubject.GetType(), 1970, @"[In RopReloadCachedInformation ROP Success Response Buffer]NormalizedSubject (variable): A TypedString structure."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1973"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1973 Site.CaptureRequirementIfAreEqual<Type>( typeof(ushort), ropReloadCachedInformationResponse.RecipientCount.GetType(), 1973, @"[In RopReloadCachedInformation ROP Success Response Buffer]RecipientCount (2 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1975"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1975 Site.CaptureRequirementIfAreEqual<Type>( typeof(ushort), ropReloadCachedInformationResponse.ColumnCount.GetType(), 1975, @"[In RopReloadCachedInformation ROP Success Response Buffer]ColumnCount (2 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1977"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1977 Site.CaptureRequirementIfAreEqual<Type>( typeof(PropertyTag[]), ropReloadCachedInformationResponse.RecipientColumns.GetType(), 1977, @"[In RopReloadCachedInformation ROP Success Response Buffer]RecipientColumns (variable): An array of PropertyTag structures."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1978"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1978 Site.CaptureRequirementIfAreEqual<ushort>( ropReloadCachedInformationResponse.ColumnCount, (ushort)ropReloadCachedInformationResponse.RecipientColumns.Length, 1978, @"[In RopReloadCachedInformation ROP Success Response Buffer,RecipientColumns (variable)]The number of structures contained in this field[RecipientColumns (variable)] is specified by the ColumnCount field."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1981"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1981 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropReloadCachedInformationResponse.RowCount.GetType(), 1981, @"[In RopReloadCachedInformation ROP Success Response Buffer]RowCount (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1983"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1983 Site.CaptureRequirementIfAreEqual<Type>( typeof(OpenRecipientRow[]), ropReloadCachedInformationResponse.RecipientRows.GetType(), 1983, @"[In RopReloadCachedInformation ROP Success Response Buffer]RecipientRows (variable): A list of OpenRecipientRow structures."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1984"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1984 Site.CaptureRequirementIfAreEqual<byte>( ropReloadCachedInformationResponse.RowCount, (byte)ropReloadCachedInformationResponse.RecipientRows.Length, 1984, @"[In RopReloadCachedInformation ROP Success Response Buffer,RecipientRows (variable)]The number of structures contained in this field[RecipientRows (variable)] is specified by the RowCount field."); }
/// <summary> /// Verify RopReloadCachedInformation Failure Response /// </summary> /// <param name="ropReloadCachedInformationResponse">The response of RopReloadCachedInformation request</param> /// <param name="inputHandleIndex">The field of InputHandleIndex in RopReloadCachedInformation request</param> private void VerifyRopReloadCachedInformationFailureResponse(RopReloadCachedInformationResponse ropReloadCachedInformationResponse, byte inputHandleIndex) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1986"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1986 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropReloadCachedInformationResponse.RopId.GetType(), 1986, @"[In RopReloadCachedInformation ROP Failure Response Buffer]RopId (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1988"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1988 Site.CaptureRequirementIfAreEqual<byte>( (byte)RopId.RopReloadCachedInformation, ropReloadCachedInformationResponse.RopId, 1988, @"[In RopReloadCachedInformation ROP Failure Response Buffer,RopId (1 byte)]For this operation[RopReloadCachedInformation], this field is set to 0x10."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1989"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1989 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropReloadCachedInformationResponse.InputHandleIndex.GetType(), 1989, @"[In RopReloadCachedInformation ROP Failure Response Buffer]InputHandleIndex (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1990"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1990 Site.CaptureRequirementIfAreEqual<byte>( inputHandleIndex, ropReloadCachedInformationResponse.InputHandleIndex, 1990, @"[In RopReloadCachedInformation 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_R1992"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1992 Site.CaptureRequirementIfAreEqual<Type>( typeof(uint), ropReloadCachedInformationResponse.ReturnValue.GetType(), 1992, @"[In RopReloadCachedInformation ROP Failure Response Buffer]ReturnValue (4 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1994"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1994 Site.CaptureRequirementIfAreNotEqual<uint>( SuccessReturnValue, ropReloadCachedInformationResponse.ReturnValue, 1994, @"[In RopReloadCachedInformation ROP Failure Response Buffer,ReturnValue (4 bytes)]For this response[Failure Response], this field is set to a value other than 0x00000000."); }
/// <summary> /// Compare the information of Message object from RopOpenMessageResponse and RopReloadCachedInformationResponse. /// </summary> /// <param name="openResp">The response of RopOpenMessage.</param> /// <param name="reloadResp">The response of RopReloadCachedInformation.</param> /// <returns>A Boolean indicates whether the information is same.</returns> private bool CompareResponseOfOpenMessageAndRopReloadCachedInformation(RopOpenMessageResponse openResp, RopReloadCachedInformationResponse reloadResp) { if (openResp.HasNamedProperties != reloadResp.HasNamedProperties) { return false; } if (!openResp.SubjectPrefix.Equals(reloadResp.SubjectPrefix)) { return false; } if (!openResp.NormalizedSubject.Equals(reloadResp.NormalizedSubject)) { return false; } if (!openResp.RecipientCount.Equals(reloadResp.RecipientCount)) { return false; } if (!openResp.ColumnCount.Equals(reloadResp.ColumnCount)) { return false; } if (!openResp.RowCount.Equals(reloadResp.RowCount)) { return false; } if ((openResp.RecipientColumns == null && reloadResp.RecipientColumns != null) || (openResp.RecipientColumns != null && reloadResp.RecipientColumns == null)) { return false; } if (openResp.RecipientColumns != null && reloadResp.RecipientColumns != null) { if (openResp.RecipientColumns.Length != reloadResp.RecipientColumns.Length) { return false; } for (int i = 0; i < openResp.RecipientColumns.Length; i++) { if (!openResp.RecipientColumns[i].Equals(reloadResp.RecipientColumns[i])) { return false; } } } if ((openResp.RecipientRows == null && reloadResp.RecipientRows != null) || (openResp.RecipientRows != null && reloadResp.RecipientRows == null)) { return false; } if (openResp.RecipientRows != null && reloadResp.RecipientRows != null) { if (openResp.RecipientRows.Length != reloadResp.RecipientRows.Length) { return false; } for (int i = 0; i < openResp.RecipientRows.Length; i++) { if (!openResp.RecipientRows[i].Equals(reloadResp.RecipientRows[i])) { return false; } } } return true; }