コード例 #1
0
        /// <summary>
        /// This method is used to test Win32 Error related adapter requirements.
        /// </summary>
        /// <param name="instance">Specify the instance which need to be verified.</param>
        /// <param name="site">Specify the ITestSite instance.</param>
        public void VerifyWin32Error(Win32Error instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Win32 Error related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type Win32Error is null due to parsing error or type casting error.");
            }

            // Verify the stream object header related requirements.
            this.ExpectStreamObjectHeaderStart(instance.StreamObjectHeaderStart, instance.GetType(), site);

            // Directly capture requirement MS-FSSHTTPB_R769, if the header is StreamObjectHeaderStart32bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart32bit),
                     instance.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPB",
                     769,
                     @"[In Win32 Error] Error Win32 (4 bytes): A 32-bit stream object header (section 2.2.1.5.2) that specifies an error win32.");

            // Directly capture requirement MS-FSSHTTPB_R770, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     770,
                     @"[In Win32 Error] Error Code (4 bytes): An unsigned integer that specifies the Win32 error code.");

            // Verify the compound related requirements.
            this.ExpectSingleObject(instance.StreamObjectHeaderStart, site);
        }