This class is used to tell the client which fragments of a large data element have been uploaded to the server.
Inheritance: SpecializedKnowledgeData
示例#1
0
        /// <summary>
        /// This method is used to test Fragment Knowledge 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 VerifyFragmentKnowledge(FragmentKnowledge instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Fragment Knowledge related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type FragmentKnowledge is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R563, if stream object start type is StreamObjectHeaderStart32bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderStart32bit),
                instance.StreamObjectHeaderStart.GetType(),
                "MS-FSSHTTPB",
                563,
                @"[In Fragment Knowledge] Fragment Knowledge Start (4 bytes): A 32-bit stream object header (section 2.2.1.5.2) that specifies a fragment knowledge start.");

            // Directly capture requirement MS-FSSHTTPB_R564, if there are no parsing errors.
            site.CaptureRequirement(
                "MS-FSSHTTPB",
                564,
                @"[In Fragment Knowledge] Fragment Knowledge Entries (variable): One or more fragment knowledge entry (section 2.2.1.13.3.1) structures specifying the fragments which have been uploaded.");

            // Directly capture requirement MS-FSSHTTPB_R565, if the stream object end is StreamObjectHeaderEnd16bit.
            site.CaptureRequirementIfAreEqual <Type>(
                typeof(StreamObjectHeaderEnd16bit),
                instance.StreamObjectHeaderEnd.GetType(),
                "MS-FSSHTTPB",
                565,
                @"[In Fragment Knowledge] Fragment Knowledge End (2 bytes): A 16-bit stream object header (section 2.2.1.5.4) that specifies a Fragment knowledge end.");

            // Verify the stream object header end related requirements.
            this.ExpectCompoundObject(instance.StreamObjectHeaderStart, site);
            this.ExpectStreamObjectHeaderEnd(instance.StreamObjectHeaderEnd, instance.GetType(), site);
        }
        /// <summary>
        /// This method is used to test Fragment Knowledge 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 VerifyFragmentKnowledge(FragmentKnowledge instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the Fragment Knowledge related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type FragmentKnowledge is null due to parsing error or type casting error.");
            }

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

            // Capture requirement MS-FSSHTTPB_R563, if stream object start type is StreamObjectHeaderStart32bit. 
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderStart32bit),
                     instance.StreamObjectHeaderStart.GetType(),
                     "MS-FSSHTTPB",
                     563,
                     @"[In Fragment Knowledge] Fragment Knowledge Start (4 bytes): A 32-bit stream object header (section 2.2.1.5.2) that specifies a fragment knowledge start.");

            // Directly capture requirement MS-FSSHTTPB_R564, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     564,
                     @"[In Fragment Knowledge] Fragment Knowledge Entries (variable): One or more fragment knowledge entry (section 2.2.1.13.3.1) structures specifying the fragments which have been uploaded.");

            // Directly capture requirement MS-FSSHTTPB_R565, if the stream object end is StreamObjectHeaderEnd16bit.
            site.CaptureRequirementIfAreEqual<Type>(
                     typeof(StreamObjectHeaderEnd16bit),
                     instance.StreamObjectHeaderEnd.GetType(),
                     "MS-FSSHTTPB",
                     565,
                     @"[In Fragment Knowledge] Fragment Knowledge End (2 bytes): A 16-bit stream object header (section 2.2.1.5.4) that specifies a Fragment knowledge end.");

            // Verify the stream object header end related requirements.
            this.ExpectCompoundObject(instance.StreamObjectHeaderStart, site);
            this.ExpectStreamObjectHeaderEnd(instance.StreamObjectHeaderEnd, instance.GetType(), site);
        }