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

TestCase_S12_TC01_QueryChanges_DataElementTypeFilter_ExcludeNone() private method

        public void TestCase_S12_TC01_QueryChanges_DataElementTypeFilter_ExcludeNone()
        {
            if (!Common.IsRequirementEnabled("MS-FSSHTTP-FSSHTTPB", 10003, this.Site))
            {
                Site.Assume.Inconclusive("Implementation does not support Query Changes sub-request with filters in the current test suite.");
            }

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

            CellSubRequestType subRequestWithoutFilter = SharedTestSuiteHelper.CreateCellSubRequestEmbeddedQueryChanges(SequenceNumberGenerator.GetCurrentFSSHTTPBSubRequestID());
            CellStorageResponse cellStorageResponseWithoutFilter = this.Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { subRequestWithoutFilter });
            CellSubResponseType subResponseWithoutFilter = SharedTestSuiteHelper.ExtractSubResponse<CellSubResponseType>(cellStorageResponseWithoutFilter, 0, 0, this.Site);
            this.Site.Assert.AreEqual<ErrorCodeType>(
                ErrorCodeType.Success,
                SharedTestSuiteHelper.ConvertToErrorCodeType(subResponseWithoutFilter.ErrorCode, this.Site),
                "Test case cannot continue unless the query changes succeed.");

            FsshttpbResponse queryResponseWithoutFilter = SharedTestSuiteHelper.ExtractFsshttpbResponse(subResponseWithoutFilter, this.Site);
            SharedTestSuiteHelper.ExpectMsfsshttpbSubResponseSucceed(queryResponseWithoutFilter, this.Site);

            DataElementTypeFilter noneFilterType = new DataElementTypeFilter(DataElementType.None);
            noneFilterType.FilterOperation = 0;
            List<Filter> filters = new List<Filter>();
            filters.Add(noneFilterType);

            // Create query changes request with the specified filters.
            FsshttpbCellRequest cellRequest = SharedTestSuiteHelper.CreateFsshttpbCellRequest();
            QueryChangesCellSubRequest queryChange = SharedTestSuiteHelper.BuildFsshttpbQueryChangesSubRequest(SequenceNumberGenerator.GetCurrentFSSHTTPBSubRequestID(), 0, true, false, true, 0, true, true, 0, null, null, filters, 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);
            FsshttpbResponse queryResponse = SharedTestSuiteHelper.ExtractFsshttpbResponse(subResponse, this.Site);

            this.Site.Assert.AreEqual<int>(
                    queryResponseWithoutFilter.DataElementPackage.DataElements.Count,
                    queryResponse.DataElementPackage.DataElements.Count,
                    "Exclude None will not exclude any data elements.");

            if (SharedContext.Current.IsMsFsshttpRequirementsCaptured)
            {
                // Verify MS-FSSHTTPB requirement: MS-FSSHTTPB_R10003
                Site.CaptureRequirement(
                         "MS-FSSHTTPB",
                         10003,
                         @"[In Appendix B: Product Behavior] Implementation support Query Changes sub-request with filters in the current test suite. (Microsoft SharePoint Server 2013 follow this behavior.)");
            }
        }
S12_QueryChanges