public void getAndAssertChildren(ObjectsHierarchy hierarchy, string filter, int skipCount, int maxItems, RenditionData renditionData) { string[] foldersIds = hierarchy.FolderIds.ToArray(); string[] documentsIds = hierarchy.DocumentIds.ToArray(); string[] allCreatedObjectsIds = hierarchy.toIdsArray(); string rootFolderId = hierarchy.RootFolder.ObjectId; cmisObjectInFolderListType children = getAndAssertChildren(rootFolderId, filter, null, maxItems, skipCount, renditionData != null ? renditionData.getFilter() : null); cmisObjectType[] childrenObjects = new cmisObjectType[children.objects.Length]; for (int i = 0; i < children.objects.Length; ++i) { childrenObjects[i] = children.objects[i] != null ? children.objects[i].@object : null; } if (maxItems > 0) { int resultCount = (skipCount + maxItems) < allCreatedObjectsIds.Length ? maxItems : allCreatedObjectsIds.Length - skipCount; Assert.IsTrue(resultCount == childrenObjects.Length, "Count of returned items doesn't equal to expected count"); } else { assertObjectsByType(enumTypesOfFileableObjects.any, documentsIds, foldersIds, allCreatedObjectsIds, childrenObjects); } foreach (cmisObjectType cmisObject in childrenObjects) { assertObjectProperties(cmisObject.properties, filter); if (renditionData != null) { assertRenditions(cmisObject, renditionData.getFilter(), renditionData.getExpectedKinds(), renditionData.getExpectedMimetypes()); } } logger.log("Children were successfully received"); logger.log(""); }
private void getAndAssertDescedansts(FileableObject rootFolder, TreeNode <string> objectsTree, enumTypesOfFileableObjects type, int depth, string filter, enumVersioningState versioningState, RenditionData renditionData) { cmisObjectInFolderContainerType[] returnedObjects = null; if (!enumTypesOfFileableObjects.folders.Equals(type)) { logger.log("Receiving descendants for folder, folderId=" + rootFolder.ObjectId + "',depth='" + depth + "', filter='" + filter + "'"); logger.log("[NavigationService->getDescendants]"); returnedObjects = navigationServiceClient.getDescendants( getAndAssertRepositoryId(), rootFolder.ObjectId, Convert.ToString(depth), filter, false, enumIncludeRelationships.none, renditionData != null ? renditionData.getFilter() : null, false, null); } else { logger.log("Receiving folders tree, folderId=" + rootFolder.ObjectId + "',depth='" + depth + "', filter='" + filter + "'"); logger.log("[NavigationService->getFoldersTree]"); returnedObjects = navigationServiceClient.getFolderTree( getAndAssertRepositoryId(), rootFolder.ObjectId, Convert.ToString(depth), filter, false, enumIncludeRelationships.none, renditionData != null ? renditionData.getFilter() : null, false, null); } Assert.IsNotNull(returnedObjects, "returned ids are null"); assertObjectsTree(returnedObjects, objectsTree); List <cmisObjectInFolderContainerType> objectsList = convertTreeToObjectsList(returnedObjects); foreach (cmisObjectInFolderContainerType cmisObject in objectsList) { Assert.IsNotNull(cmisObject, "CmisObjectInFolderContainer is null"); Assert.IsNotNull(cmisObject.objectInFolder, "CmisObjectInFolder is null"); Assert.IsNotNull(cmisObject.objectInFolder.@object, "CmisObject is null"); assertObjectProperties([email protected], filter); if (renditionData != null) { assertRenditions(cmisObject.objectInFolder.@object, renditionData.getFilter(), renditionData.getExpectedKinds(), renditionData.getExpectedMimetypes()); } } logger.log("Objects were successfully received"); logger.log(""); }