Microsoft.Protocols.TestSuites.SharedTestSuite.S12_QueryChanges.TestCase_S12_TC18_QueryChanges_IncludeStorageManifest_One C# (CSharp) Method

TestCase_S12_TC18_QueryChanges_IncludeStorageManifest_One() private method

        public void TestCase_S12_TC18_QueryChanges_IncludeStorageManifest_One()
        {
            if (!Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 437, this.Site))
            {
                Site.Assume.Inconclusive("Implementation does not support Storage Manifest flag.");
            }

            // Initialize the service
            this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain);

            // Create query changes request with Include Storage Manifest with the value true.
            FsshttpbCellRequest cellRequest = SharedTestSuiteHelper.CreateFsshttpbCellRequest();
            QueryChangesCellSubRequest queryChange = SharedTestSuiteHelper.BuildFsshttpbQueryChangesSubRequest(SequenceNumberGenerator.GetCurrentFSSHTTPBSubRequestID(), 0, false, false, false, 0, true, true, 0, null, null, null, null);
            cellRequest.AddSubRequest(queryChange, null);

            CellSubRequestType cellSubRequest = SharedTestSuiteHelper.CreateCellSubRequest(SequenceNumberGenerator.GetCurrentToken(), cellRequest.ToBase64());
            CellStorageResponse cellStorageResponse = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { cellSubRequest });
            CellSubResponseType subResponse = SharedTestSuiteHelper.ExtractSubResponse<CellSubResponseType>(cellStorageResponse, 0, 0, this.Site);
            this.Site.Assert.AreEqual<ErrorCodeType>(
                ErrorCodeType.Success,
                SharedTestSuiteHelper.ConvertToErrorCodeType(subResponse.ErrorCode, this.Site),
                "Test case cannot continue unless the query changes succeed.");

            FsshttpbResponse fsshttpbResponse = SharedTestSuiteHelper.ExtractFsshttpbResponse(subResponse, this.Site);
            SharedTestSuiteHelper.ExpectMsfsshttpbSubResponseSucceed(fsshttpbResponse, this.Site);
            bool isIncludeStorageManifest = fsshttpbResponse.DataElementPackage.DataElements.FirstOrDefault(dataElement => dataElement.DataElementType == DataElementType.StorageManifestDataElementData) != null;

            Site.Log.Add(
                LogEntryKind.Debug,
                "When Include Storage Manifest (1 bit) is set, the server responds the storage manifest data element, actually it {0}",
                isIncludeStorageManifest ? "does" : "does not");

            // Verify MS-FSSHTTPB requirement: MS-FSSHTTPB_R437
            // If the storage manifest is returned, then capture MS-FSSHTTPB_R437
            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                Site.CaptureRequirementIfIsTrue(
                         isIncludeStorageManifest,
                         "MS-FSSHTTPB",
                         437,
                         @"[In Query Changes] F - Include Storage Manifest (1 bit): If set, a bit that specifies to include the storage manifest. (Microsoft SharePoint Server 2013/Microsoft SharePoint Foundation 2013 follow this behavior.)");
            }
            else
            {
                Site.Assert.IsTrue(isIncludeStorageManifest, @"[In Query Changes] F - Include Storage Manifest (1 bit): If set, a bit that specifies to include the storage manifest. (Microsoft SharePoint Server 2013/Microsoft SharePoint Foundation 2013 follow this behavior.)");
            }
        }
S12_QueryChanges