/// <summary> /// Verify RopReadRecipients Failure Response /// </summary> /// <param name="ropReadRecipientsResponse">The response of RopReadRecipients request</param> /// <param name="inputHandleIndex">The field of InputHandleIndex in RopReadRecipients request</param> private void VerifyRopReadRecipientsFailureResponse(RopReadRecipientsResponse ropReadRecipientsResponse, byte inputHandleIndex) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1934"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1934 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropReadRecipientsResponse.RopId.GetType(), 1934, @"[In RopReadRecipients ROP Failure Response Buffer]RopId (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1936"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1936 Site.CaptureRequirementIfAreEqual<byte>( (byte)RopId.RopReadRecipients, ropReadRecipientsResponse.RopId, 1936, @"[In RopReadRecipients ROP Failure Response Buffer,RopId (1 byte)]For this operation[RopReadRecipients], this field is set to 0x0F."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1937"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1937 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropReadRecipientsResponse.InputHandleIndex.GetType(), 1937, @"[In RopReadRecipients ROP Failure Response Buffer]InputHandleIndex (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1938"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1938 Site.CaptureRequirementIfAreEqual<byte>( inputHandleIndex, ropReadRecipientsResponse.InputHandleIndex, 1938, @"[In RopReadRecipients 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_R1940"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1940 Site.CaptureRequirementIfAreEqual<Type>( typeof(uint), ropReadRecipientsResponse.ReturnValue.GetType(), 1940, @"[In RopReadRecipients ROP Failure Response Buffer]ReturnValue (4 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1942"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1942 Site.CaptureRequirementIfAreNotEqual<uint>( SuccessReturnValue, ropReadRecipientsResponse.ReturnValue, 1942, @"[In RopReadRecipients ROP Failure Response Buffer,ReturnValue (4 bytes)] For this response, this field is set to a value other than 0x00000000."); }
/// <summary> /// Verify the property of SyntaxRowCount /// </summary> /// <param name="retuResponse"> The response of RopReadRecipients. </param> private void VerifyMessageSyntaxRowCount(RopReadRecipientsResponse retuResponse) { int rowCount = retuResponse.RowCount; if (retuResponse.RecipientRows == null) { return; } // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMSG_R763"); // Verify MS-OXCMSG requirement: MS-OXCMSG_R763 bool isVerifyR763 = false; if (rowCount >= 0x00 && rowCount < 0xFF) { isVerifyR763 = true; } Site.CaptureRequirementIfIsTrue( isVerifyR763, 763, @"[In RopReadRecipients ROP Response Buffer] [RowCount] Is greater than or equal to 0x00 and less than 0xFF."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMSG_R762"); // Verify MS-OXCMSG requirement: MS-OXCMSG_R762 this.Site.CaptureRequirementIfAreEqual<int>( retuResponse.RecipientRows.Length, retuResponse.RowCount, 762, @"[In RopReadRecipients ROP Response Buffer] RowCount: 1 byte containing the number of elements in the RecipientRows field."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMSG_R765"); // Verify MS-OXCMSG requirement: MS-OXCMSG_R765 this.Site.CaptureRequirementIfAreEqual<int>( retuResponse.RowCount, retuResponse.RecipientRows.Length, 765, @"[In RopReadRecipients ROP Response Buffer] RecipientRows: An array of ReadRecipientRow structures whose number of elements equals the RowCount field."); }
/// <summary> /// Verify RopReadRecipients Success Response /// </summary> /// <param name="ropReadRecipientsResponse">The response of RopReadRecipients request</param> /// <param name="inputHandleIndex">The field of InputHandleIndex in RopReadRecipients request</param> private void VerifyRopReadRecipientsSuccessResponse(RopReadRecipientsResponse ropReadRecipientsResponse, byte inputHandleIndex) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1906"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1906 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropReadRecipientsResponse.RopId.GetType(), 1906, @"[In RopReadRecipients ROP Success Response Buffer]RopId (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1908"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1908 Site.CaptureRequirementIfAreEqual<byte>( (byte)RopId.RopReadRecipients, ropReadRecipientsResponse.RopId, 1908, @"[In RopReadRecipients ROP Success Response Buffer,RopId (1 byte)]For this operation[RopReadRecipients], this field is set to 0x0F."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1909"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1909 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropReadRecipientsResponse.InputHandleIndex.GetType(), 1909, @"[In RopReadRecipients ROP Success Response Buffer]InputHandleIndex (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1910"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1910 Site.CaptureRequirementIfAreEqual<byte>( inputHandleIndex, ropReadRecipientsResponse.InputHandleIndex, 1910, @"[In RopReadRecipients 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_R1912"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1912 Site.CaptureRequirementIfAreEqual<Type>( typeof(uint), ropReadRecipientsResponse.ReturnValue.GetType(), 1912, @"[In RopReadRecipients ROP Success Response Buffer]ReturnValue (4 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1914"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1914 Site.CaptureRequirementIfAreEqual<uint>( SuccessReturnValue, ropReadRecipientsResponse.ReturnValue, 1914, @"[In RopReadRecipients 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_R1915"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1915 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropReadRecipientsResponse.RowCount.GetType(), 1915, @"[In RopReadRecipients ROP Success Response Buffer]RowCount (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1918"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1918 Site.CaptureRequirementIfAreEqual<ushort>( ropReadRecipientsResponse.RowCount, (ushort)ropReadRecipientsResponse.RecipientRows.Length, 1918, @"[In RopReadRecipients ROP Success Response Buffer,RecipientRows (variable)]The number of structures contained in this field is specified by the RowCount field."); // RecipientRows is array of ReadRecipientRow if it has element can get the first element as instance of ReadRecipientRow to verify ReadRecipientRow structure if (ropReadRecipientsResponse.RecipientRows.Length > 0) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1920"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1920 // RecipientRows is array of ReadRecipientRow, in the precondition statement RecipientRows has element. // Get the first element as instance of ReadRecipientRow to verify ReadRecipientRow structure Site.CaptureRequirementIfAreEqual<Type>( typeof(uint), ropReadRecipientsResponse.RecipientRows[0].RowId.GetType(), 1920, @"[In ReadRecipientRow structure]RowId (4 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1922"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1922 // RecipientRows is array of ReadRecipientRow, in the precondition statement RecipientRows has element. // Get the first element as instance of ReadRecipientRow to verify ReadRecipientRow structure Site.CaptureRequirementIfAreEqual<int>( 1, Marshal.SizeOf(ropReadRecipientsResponse.RecipientRows[0].RecipientType), 1922, @"[In ReadRecipientRow structure]RecipientType (1 byte): An enumeration."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1923,RecipientType:{0}", ropReadRecipientsResponse.RecipientRows[0].RecipientType); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1923 // RecipientRows is array of ReadRecipientRow, in the precondition statement RecipientRows has element. // Get the first element as instance of ReadRecipientRow to verify ReadRecipientRow structure bool isVerifyR1923 = ((ropReadRecipientsResponse.RecipientRows[0].RecipientType & ((byte)RecipientType.PrimaryRecipient)) == ((byte)RecipientType.PrimaryRecipient)) || ((ropReadRecipientsResponse.RecipientRows[0].RecipientType & ((byte)RecipientType.CcRecipient)) == ((byte)RecipientType.CcRecipient)) || ((ropReadRecipientsResponse.RecipientRows[0].RecipientType & ((byte)RecipientType.BccRecipient)) == ((byte)RecipientType.BccRecipient)); Site.CaptureRequirementIfIsTrue( isVerifyR1923, 1923, @"[In ReadRecipientRow structure,RecipientType (1 byte)]The possible values[0x01, 0x02 and 0x03] for this enumeration are specified in [MS-OXCMSG] section 2.2.3.1.2."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1925"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1925 // RecipientRows is array of ReadRecipientRow, in the precondition statement RecipientRows has element. // Get the first element as instance of ReadRecipientRow to verify ReadRecipientRow structure Site.CaptureRequirementIfAreEqual<int>( 2, Marshal.SizeOf(ropReadRecipientsResponse.RecipientRows[0].CodePageId), 1925, @"[In ReadRecipientRow structure]CodePageId (2 bytes): An identifier."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1927"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1927 // RecipientRows is array of ReadRecipientRow, in the precondition statement RecipientRows has element. // Get the first element as instance of ReadRecipientRow to verify ReadRecipientRow structure Site.CaptureRequirementIfAreEqual<int>( 2, Marshal.SizeOf(ropReadRecipientsResponse.RecipientRows[0].Reserved), 1927, @"[In ReadRecipientRow structure]Reserved (2 bytes): Reserved."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1928"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1928 // RecipientRows is array of ReadRecipientRow, in the precondition statement RecipientRows has element. // Get the first element as instance of ReadRecipientRow to verify ReadRecipientRow structure Site.CaptureRequirementIfAreEqual<ushort>( 0x0000, ropReadRecipientsResponse.RecipientRows[0].Reserved, 1928, @"[In ReadRecipientRow structure,Reserved (2 bytes)]The server MUST set this field to 0x0000."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1929"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1929 // RecipientRows is array of ReadRecipientRow, in the precondition statement RecipientRows has element. // Get the first element as instance of ReadRecipientRow to verify ReadRecipientRow structure Site.CaptureRequirementIfAreEqual<Type>( typeof(ushort), ropReadRecipientsResponse.RecipientRows[0].RecipientRowSize.GetType(), 1929, @"[In ReadRecipientRow structure]RecipientRowSize (2 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1931"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1931 // RecipientRows is array of ReadRecipientRow, in the precondition statement RecipientRows has element. // Get the first element as instance of ReadRecipientRow to verify ReadRecipientRow structure Site.CaptureRequirementIfAreEqual<Type>( typeof(RecipientRow), ropReadRecipientsResponse.RecipientRows[0].RecipientRow.GetType(), 1931, @"[In ReadRecipientRow structure]RecipientRow (variable): A RecipientRow structure."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1933"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1933 // RecipientRows is array of ReadRecipientRow, in the precondition statement RecipientRows has element. // Get the first element as instance of ReadRecipientRow to verify ReadRecipientRow structure Site.CaptureRequirementIfAreEqual<ushort>( ropReadRecipientsResponse.RecipientRows[0].RecipientRowSize, (ushort)ropReadRecipientsResponse.RecipientRows[0].RecipientRow.Size(), 1933, @"[In ReadRecipientRow structure,RecipientRow (variable)]The size of this field, in bytes, is specified by the RecipientRowSize field."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1917"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1917 Site.CaptureRequirementIfAreEqual<Type>( ropReadRecipientsResponse.RecipientRows.GetType(), typeof(ReadRecipientRow[]), 1917, @"[In RopReadRecipients ROP Success Response Buffer]RecipientRows (variable): A list of ReadRecipientRow structures."); foreach (ReadRecipientRow readRecipientRow in ropReadRecipientsResponse.RecipientRows) { this.VerifyRecipientRowStructure(readRecipientRow.RecipientRow); } } }