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.)"); } }
public void TestCase_S12_TC10_QueryChanges_DataElementTypeFilter_IncludeObjectGroupDataElement() { 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); AllFilter allFilter = new AllFilter(); allFilter.FilterOperation = 0; DataElementTypeFilter filterType = new DataElementTypeFilter(DataElementType.ObjectGroupDataElementData); filterType.FilterOperation = 1; List<Filter> filters = new List<Filter>(); filters.Add(allFilter); filters.Add(filterType); FsshttpbCellRequest cellRequest = SharedTestSuiteHelper.CreateFsshttpbCellRequest(); QueryChangesCellSubRequest queryChange = SharedTestSuiteHelper.BuildFsshttpbQueryChangesSubRequest(SequenceNumberGenerator.GetCurrentFSSHTTPBSubRequestID(), 0, true, true, true, 0, true, true, 0, null, 2, 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); this.Site.Assert.AreEqual<ErrorCodeType>( ErrorCodeType.Success, SharedTestSuiteHelper.ConvertToErrorCodeType(subResponse.ErrorCode, this.Site), "Test case cannot continue unless the query changes succeed."); FsshttpbResponse queryResponse = SharedTestSuiteHelper.ExtractFsshttpbResponse(subResponse, this.Site); SharedTestSuiteHelper.ExpectMsfsshttpbSubResponseSucceed(queryResponse, this.Site); bool isIncludeObjectGroupDataElement = queryResponse.DataElementPackage.DataElements.All(dataElement => dataElement.DataElementType == DataElementType.ObjectGroupDataElementData); this.Site.Assert.IsTrue( isIncludeObjectGroupDataElement, "The response should only contains the ObjectGroupDataElement."); }