You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2011/03/24 22:06:26 UTC

svn commit: r1085145 - /chemistry/dotcmis/trunk/DotCMISUnitTest/TestFramework.cs

Author: fmui
Date: Thu Mar 24 21:06:26 2011
New Revision: 1085145

URL: http://svn.apache.org/viewvc?rev=1085145&view=rev
Log:
- fixed unit test

Modified:
    chemistry/dotcmis/trunk/DotCMISUnitTest/TestFramework.cs

Modified: chemistry/dotcmis/trunk/DotCMISUnitTest/TestFramework.cs
URL: http://svn.apache.org/viewvc/chemistry/dotcmis/trunk/DotCMISUnitTest/TestFramework.cs?rev=1085145&r1=1085144&r2=1085145&view=diff
==============================================================================
--- chemistry/dotcmis/trunk/DotCMISUnitTest/TestFramework.cs (original)
+++ chemistry/dotcmis/trunk/DotCMISUnitTest/TestFramework.cs Thu Mar 24 21:06:26 2011
@@ -303,24 +303,43 @@ namespace DotCMISUnitTest
 
             // check children
             found = false;
-            IObjectInFolderList children = Binding.GetNavigationService().GetChildren(RepositoryInfo.Id, folderId, null, null, null, null, null, null, null, null, null);
+            bool hasMore = true;
+            long maxItems = 100;
+            long skipCount = 0;
 
-            Assert.NotNull(children);
-            if (children.NumItems != null)
+            while (hasMore)
             {
-                Assert.True(children.NumItems > 0);
-            }
+                IObjectInFolderList children = Binding.GetNavigationService().GetChildren(RepositoryInfo.Id, folderId, null, null, null, null, null, null, maxItems, skipCount, null);
 
-            foreach (ObjectInFolderData obj in children.Objects)
-            {
-                Assert.NotNull(obj);
-                Assert.NotNull(obj.Object);
-                Assert.NotNull(obj.Object.Id);
-                if (obj.Object.Id == objectId)
+                Assert.NotNull(children);
+                if (children.NumItems != null)
                 {
-                    found = true;
+                    Assert.True(children.NumItems > 0);
+                }
+
+                foreach (ObjectInFolderData obj in children.Objects)
+                {
+                    Assert.NotNull(obj);
+                    Assert.NotNull(obj.Object);
+                    Assert.NotNull(obj.Object.Id);
+                    if (obj.Object.Id == objectId)
+                    {
+                        found = true;
+                    }
+                }
+
+                skipCount = skipCount + maxItems;
+
+                if (children.HasMoreItems.HasValue)
+                {
+                    hasMore = children.HasMoreItems.Value;
+                }
+                else
+                {
+                    hasMore = children.Objects.Count == maxItems;
                 }
             }
+
             Assert.True(found);
 
             // check descendants