diff UnitTests/ServerIndex.cpp @ 190:b6cef9d45cc3

getallpublicids
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 13 Nov 2012 11:20:50 +0100
parents 090cefdab1d1
children a1b9d1e1497b
line wrap: on
line diff
--- a/UnitTests/ServerIndex.cpp	Mon Nov 12 18:03:48 2012 +0100
+++ b/UnitTests/ServerIndex.cpp	Tue Nov 13 11:20:50 2012 +0100
@@ -54,6 +54,24 @@
     index.CreateResource("g", ResourceType_Study)      // 6
   };
 
+  {
+    Json::Value t;
+    index.GetAllPublicIds(t, ResourceType_Patient);
+
+    ASSERT_EQ(1, t.size());
+    ASSERT_EQ("a", t[0u].asString());
+
+    index.GetAllPublicIds(t, ResourceType_Series);
+    ASSERT_EQ(1, t.size());
+    ASSERT_EQ("c", t[0u].asString());
+
+    index.GetAllPublicIds(t, ResourceType_Study);
+    ASSERT_EQ(2, t.size());
+
+    index.GetAllPublicIds(t, ResourceType_Instance);
+    ASSERT_EQ(3, t.size());
+  }
+
   index.SetGlobalProperty("Hello", "World");
 
   index.AttachChild(a[0], a[1]);