diff UnitTestsSources/FromDcmtkTests.cpp @ 1787:1b1d5470233f worklists

refactoring of DicomFindAnswers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Nov 2015 15:50:32 +0100
parents df331354cea2
children bdcc1dba4a53
line wrap: on
line diff
--- a/UnitTestsSources/FromDcmtkTests.cpp	Wed Nov 18 12:00:14 2015 +0100
+++ b/UnitTestsSources/FromDcmtkTests.cpp	Wed Nov 18 15:50:32 2015 +0100
@@ -43,6 +43,7 @@
 #include "../Core/Images/PngWriter.h"
 #include "../Core/Uuid.h"
 #include "../Resources/EncodingTests.h"
+#include "../OrthancServer/DicomProtocol/DicomFindAnswers.h"
 
 #include <dcmtk/dcmdata/dcelem.h>
 
@@ -606,3 +607,25 @@
   ASSERT_EQ("application/octet-stream", mime);
   ASSERT_EQ("Pixels", content);
 }
+
+
+TEST(DicomFindAnswers, Basic)
+{
+  DicomFindAnswers a;
+
+  {
+    DicomMap m;
+    m.SetValue(DICOM_TAG_PATIENT_ID, "hello");
+    a.Add(m);
+  }
+
+  {
+    DicomMap m;
+    m.SetValue(DICOM_TAG_PATIENT_ID, "world");
+    a.Add(m);
+  }
+
+  Json::Value j;
+  a.ToJson(j, true);
+  ASSERT_EQ(2u, j.size());
+}