changeset 313:8bb2eb006e21

added unit test
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 14 Jul 2021 15:56:37 +0200
parents 117cf247c086
children 64763998cdff
files Framework/Plugins/IndexUnitTests.h
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Plugins/IndexUnitTests.h	Wed Jul 14 14:31:12 2021 +0200
+++ b/Framework/Plugins/IndexUnitTests.h	Wed Jul 14 15:56:37 2021 +0200
@@ -675,7 +675,15 @@
       a.compressedSize = 4242;
       a.compressedHash = "md5";
       db.AddAttachment(*manager, resources[attachmentLevel], a, 42);
-        
+      
+      deletedAttachments.clear();
+      a.uuid = "attachment2";
+      db.DeleteAttachment(*output, *manager, resources[attachmentLevel], Orthanc::FileContentType_DicomAsJson);
+      ASSERT_EQ(1u, deletedAttachments.size());
+      ASSERT_EQ("attachment", *deletedAttachments.begin());
+      
+      db.AddAttachment(*manager, resources[attachmentLevel], a, 43);
+      
       deletedAttachments.clear();
       deletedResources.clear();
       remainingAncestor.reset();
@@ -689,7 +697,7 @@
       else
       {
         ASSERT_EQ(1u, deletedAttachments.size());
-        ASSERT_EQ("attachment", *deletedAttachments.begin());
+        ASSERT_EQ("attachment2", *deletedAttachments.begin());
       }
       
       ASSERT_EQ(OrthancPluginResourceType_Instance, deletedResources["instance"]);