public void TestCase_S12_TC07_QueryChanges_DataElementTypeFilter_IncludeStorageManifestDataElement()
{
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.StorageManifestDataElementData);
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);
bool isIncludeStorageManifestDataElement = queryResponse.DataElementPackage.DataElements.All(dataElement => dataElement.DataElementType == DataElementType.StorageManifestDataElementData);
SharedTestSuiteHelper.ExpectMsfsshttpbSubResponseSucceed(queryResponse, this.Site);
this.Site.Assert.IsTrue(
isIncludeStorageManifestDataElement,
"The response should only contains the StorageManifestDataElement.");
}