/// <summary> /// Verify RopSetMessageReadFlag Failure Response /// </summary> /// <param name="ropSetMessageReadFlagResponse">The response of RopSetMessageReadFlag request</param> /// <param name="responseHandleIndex">The field of ResponseHandleIndex in RopSetMessageReadFlag request</param> private void VerifyRopSetMessageReadFlagFailureResponse(RopSetMessageReadFlagResponse ropSetMessageReadFlagResponse, byte responseHandleIndex) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2116"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2116 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropSetMessageReadFlagResponse.RopId.GetType(), 2116, @"[In RopSetMessageReadFlag ROP Failure Response Buffer]RopId (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2118"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2118 Site.CaptureRequirementIfAreEqual<byte>( (byte)RopId.RopSetMessageReadFlag, ropSetMessageReadFlagResponse.RopId, 2118, @"[In RopSetMessageReadFlag ROP Failure Response Buffer,RopId (1 byte)] For this operation[RopSetMessageReadFlag], this field is set to 0x11."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2119"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2119 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropSetMessageReadFlagResponse.ResponseHandleIndex.GetType(), 2119, @"[In RopSetMessageReadFlag ROP Failure Response Buffer]ResponseHandleIndex (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2120"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2120 Site.CaptureRequirementIfAreEqual<byte>( responseHandleIndex, ropSetMessageReadFlagResponse.ResponseHandleIndex, 2120, @"[In RopSetMessageReadFlag ROP Failure Response Buffer,ResponseHandleIndex (1 byte)]This index MUST be set to the value specified in the ResponseHandleIndex field in the request."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2122"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2122 Site.CaptureRequirementIfAreEqual<Type>( typeof(uint), ropSetMessageReadFlagResponse.ReturnValue.GetType(), 2122, @"[In RopSetMessageReadFlag ROP Failure Response Buffer]ReturnValue (4 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2124"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2124 Site.CaptureRequirementIfAreNotEqual<uint>( SuccessReturnValue, ropSetMessageReadFlagResponse.ReturnValue, 2124, @"[In RopSetMessageReadFlag ROP Failure Response Buffer,ReturnValue (4 bytes)]For this response[Failure Response], this field is set to a value other than 0x00000000."); }
/// <summary> /// Verify the property of ReadStatusChanged /// </summary> /// <param name="ropSetMessageReadFlagResponse"> A structure of RopSetMessageReadFlagResponse </param> /// <param name="ropSetMessageReadFlagRequest">Return RopSetMessageReadFlagRequest</param> private void VerifyMessageSyntaxReadStatusChanged(RopSetMessageReadFlagResponse ropSetMessageReadFlagResponse, RopSetMessageReadFlagRequest ropSetMessageReadFlagRequest) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMSG_R846"); // Verify MS-OXCMSG requirement: MS-OXCMSG_R846 Site.CaptureRequirementIfAreEqual<int>( 1, ropSetMessageReadFlagResponse.ReadStatusChanged.ToString().Length, 846, @"[In RopSetMessageReadFlag ROP Response Buffer] ReadStatusChanged: 1 byte containing one of the following values [0x00, Nonzero]."); if (ropSetMessageReadFlagResponse.ReadStatusChanged != 0) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMSG_R848"); // Verify MS-OXCMSG requirement: MS-OXCMSG_R848 Site.CaptureRequirementIfAreEqual<byte>( ropSetMessageReadFlagRequest.LogonId, (byte)ropSetMessageReadFlagResponse.LogonId, 848, @"[In RopSetMessageReadFlag ROP Response Buffer] LogonId: 1 byte containing the LogonID from the request when the value in the ReadStatusChanged field is nonzero."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMSG_R851"); bool isR851Verified = Common.CompareByteArray(ropSetMessageReadFlagRequest.ClientData, ropSetMessageReadFlagResponse.ClientData); // Verify MS-OXCMSG requirement: MS-OXCMSG_R851 this.Site.CaptureRequirementIfIsTrue( isR851Verified, 851, @"[In RopSetMessageReadFlag ROP Response Buffer] ClientData: 24 bytes containing the ClientData field from the request when the value in the ReadStatusChanged field is nonzero."); } else { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMSG_R849"); // Verify MS-OXCMSG requirement: MS-OXCMSG_R849 Site.CaptureRequirementIfIsNull( ropSetMessageReadFlagResponse.LogonId, 849, @"[In RopSetMessageReadFlag ROP Response Buffer] [LogonId] 0 bytes otherwise [when the value in ReadStatusChanged is zero]."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMSG_R852"); // Verify MS-OXCMSG requirement: MS-OXCMSG_R852 this.Site.CaptureRequirementIfIsNull( ropSetMessageReadFlagResponse.ClientData, 852, @"[In RopSetMessageReadFlag ROP Response Buffer] [ClientData] 0 bytes otherwise [when the value in ReadStatusChanged is zero]."); } }
/// <summary> /// Verify RopSetMessageReadFlag Success Response /// </summary> /// <param name="ropSetMessageReadFlagResponse">The response of RopSetMessageReadFlag request</param> /// <param name="responseHandleIndex">The field of ResponseHandleIndex in RopSetMessageReadFlag request</param> /// <param name="logonId">The field of LogonId in RopSetMessageReadFlag request</param> /// <param name="clientData">The field of ClientData in RopSetMessageReadFlag request</param> private void VerifyRopSetMessageReadFlagSuccessResponse( RopSetMessageReadFlagResponse ropSetMessageReadFlagResponse, byte responseHandleIndex, byte logonId, byte[] clientData) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2097"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2097 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropSetMessageReadFlagResponse.RopId.GetType(), 2097, @"[In RopSetMessageReadFlag ROP Success Response Buffer]RopId (1 byte): An unsigned integer"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2099"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2099 Site.CaptureRequirementIfAreEqual<byte>( (byte)RopId.RopSetMessageReadFlag, ropSetMessageReadFlagResponse.RopId, 2099, @"[In RopSetMessageReadFlag ROP Success Response Buffer,RopId (1 byte)]For this operation[RopSetMessageReadFlag], this field is set to 0x11."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2100"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2100 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropSetMessageReadFlagResponse.ResponseHandleIndex.GetType(), 2100, @"[In RopSetMessageReadFlag ROP Success Response Buffer]ResponseHandleIndex (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2101"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2101 Site.CaptureRequirementIfAreEqual<byte>( responseHandleIndex, ropSetMessageReadFlagResponse.ResponseHandleIndex, 2101, @"[In RopSetMessageReadFlag ROP Success Response Buffer,ResponseHandleIndex (1 byte)]This index MUST be set to the value specified in the ResponseHandleIndex field in the request."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2103"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2103 Site.CaptureRequirementIfAreEqual<Type>( typeof(uint), ropSetMessageReadFlagResponse.ReturnValue.GetType(), 2103, @"[In RopSetMessageReadFlag ROP Success Response Buffer]ReturnValue (4 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2105"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2105 Site.CaptureRequirementIfAreEqual<uint>( SuccessReturnValue, ropSetMessageReadFlagResponse.ReturnValue, 2105, @"[In RopSetMessageReadFlag 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_R2106,ReadStatusChanged:{0}", ropSetMessageReadFlagResponse.ReadStatusChanged); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2106 // If ReadStatusChanged is byte type and can be boolean type representation, then verify R2106 bool isVerifyR2106 = (typeof(byte) == ropSetMessageReadFlagResponse.ReadStatusChanged.GetType()) && ((Convert.ToBoolean(ropSetMessageReadFlagResponse.ReadStatusChanged) == true) || (Convert.ToBoolean(ropSetMessageReadFlagResponse.ReadStatusChanged) == false)); Site.CaptureRequirementIfIsTrue( isVerifyR2106, 2106, @"[In RopSetMessageReadFlag ROP Success Response Buffer]ReadStatusChanged (1 byte): A Boolean."); if (ropSetMessageReadFlagResponse.LogonId != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2108"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2108 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropSetMessageReadFlagResponse.LogonId.GetType(), 2108, @"[In RopSetMessageReadFlag ROP Success Response Buffer]LogonId (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2111"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2111 Site.CaptureRequirementIfAreEqual<byte>( logonId, (byte)ropSetMessageReadFlagResponse.LogonId, 2111, @"[In RopSetMessageReadFlag ROP Success Response Buffer,LogonId (1 byte)]This field MUST be set to the value of the LogonId field in the request."); } if (ropSetMessageReadFlagResponse.ClientData != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2112, the actual type of ClientData is {0} and length of it is {1}", ropSetMessageReadFlagResponse.ClientData.GetType().Name, ropSetMessageReadFlagResponse.ClientData.Length); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2112 // If ClientData is array of byte and the length is 24, then verify R2112 bool isVerifyR2112 = (typeof(byte[]) == ropSetMessageReadFlagResponse.ClientData.GetType()) && (ropSetMessageReadFlagResponse.ClientData.Length == 24); Site.CaptureRequirementIfIsTrue( isVerifyR2112, 2112, @"[In RopSetMessageReadFlag ROP Success Response Buffer]ClientData (24 bytes):An array of bytes."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R2115, the ClientData value in request is {0} and in response is {1}", BitConverter.ToString(clientData), BitConverter.ToString(ropSetMessageReadFlagResponse.ClientData)); // Verify MS-OXCROPS requirement: MS-OXCROPS_R2115 // Assume the result is true. If the parameter clientData not equal response clientData, then false. bool isVerifyR2115 = true; if (clientData.Length != ropSetMessageReadFlagResponse.ClientData.Length) { isVerifyR2115 = false; } else { for (int i = 0; i < ropSetMessageReadFlagResponse.ClientData.Length; i++) { if (ropSetMessageReadFlagResponse.ClientData[i] != clientData[i]) { isVerifyR2115 = false; break; } } } Site.CaptureRequirementIfIsTrue( isVerifyR2115, 2115, @"[In RopSetMessageReadFlag ROP Success Response Buffer,ClientData (24 bytes)]This field MUST be set to the value of the ClientData field in the request."); } }