diff OrthancFramework/UnitTestsSources/FrameworkTests.cpp @ 4399:80fd140b12ba

New command-line option: "--openapi" to write the OpenAPI documentation of the REST API to a file
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Dec 2020 12:21:03 +0100
parents 52166629239f
children d9473bd5ed43
line wrap: on
line diff
--- a/OrthancFramework/UnitTestsSources/FrameworkTests.cpp	Tue Dec 22 09:39:06 2020 +0100
+++ b/OrthancFramework/UnitTestsSources/FrameworkTests.cpp	Wed Dec 23 12:21:03 2020 +0100
@@ -787,6 +787,23 @@
   ASSERT_FALSE(IsResourceLevelAboveOrEqual(ResourceType_Instance, ResourceType_Study));
   ASSERT_FALSE(IsResourceLevelAboveOrEqual(ResourceType_Instance, ResourceType_Series));
   ASSERT_TRUE(IsResourceLevelAboveOrEqual(ResourceType_Instance, ResourceType_Instance));
+
+  ASSERT_STREQ("Patients", GetResourceTypeText(ResourceType_Patient, true /* plural */, true /* upper case */));
+  ASSERT_STREQ("patients", GetResourceTypeText(ResourceType_Patient, true, false));
+  ASSERT_STREQ("Patient", GetResourceTypeText(ResourceType_Patient, false, true));
+  ASSERT_STREQ("patient", GetResourceTypeText(ResourceType_Patient, false, false));
+  ASSERT_STREQ("Studies", GetResourceTypeText(ResourceType_Study, true, true));
+  ASSERT_STREQ("studies", GetResourceTypeText(ResourceType_Study, true, false));
+  ASSERT_STREQ("Study", GetResourceTypeText(ResourceType_Study, false, true));
+  ASSERT_STREQ("study", GetResourceTypeText(ResourceType_Study, false, false));
+  ASSERT_STREQ("Series", GetResourceTypeText(ResourceType_Series, true, true));
+  ASSERT_STREQ("series", GetResourceTypeText(ResourceType_Series, true, false));
+  ASSERT_STREQ("Series", GetResourceTypeText(ResourceType_Series, false, true));
+  ASSERT_STREQ("series", GetResourceTypeText(ResourceType_Series, false, false));
+  ASSERT_STREQ("Instances", GetResourceTypeText(ResourceType_Instance, true, true));
+  ASSERT_STREQ("instances", GetResourceTypeText(ResourceType_Instance, true, false));
+  ASSERT_STREQ("Instance", GetResourceTypeText(ResourceType_Instance, false, true));
+  ASSERT_STREQ("instance", GetResourceTypeText(ResourceType_Instance, false, false));
 }