Beispiel #1
0
        public void testParseLanguageWithAccreditationBeforeLanguage()
        {
            string adl = System.IO.File.ReadAllText(@"..\..\..\..\java-libs\adl-parser\src\test\resources\adl-test-entry.archetype_language_order_of_translation_details.test.adl");

            se.acode.openehr.parser.ADLParser  parser    = new se.acode.openehr.parser.ADLParser(adl);
            org.openehr.am.archetype.Archetype archetype = parser.parse();
            Assert.IsNotNull(archetype);

            Map translations = archetype.getTranslations();

            TranslationDetails td = (TranslationDetails)translations.get("de");

            Assert.IsNotNull(td);
            Map map = td.getAuthor();

            Assert.IsNotNull(map);
            Assert.AreEqual("Harry Potter", map.get("name"));
            Assert.AreEqual("*****@*****.**",
                            map.get("email"));

            Assert.AreEqual(null, td.getAccreditation());

            map = td.getOtherDetails();
            Assert.AreEqual("Ron Weasley", map.get("review 1"));
            Assert.AreEqual("Rubeus Hagrid", map.get("review 2"));
        }
Beispiel #2
0
        public void testTranslationDetails()
        {
            string adl = System.IO.File.ReadAllText(@"..\..\..\..\java-libs\adl-parser\src\test\resources\adl-test-entry.testtranslations.test.adl");

            se.acode.openehr.parser.ADLParser  parser    = new se.acode.openehr.parser.ADLParser(adl);
            org.openehr.am.archetype.Archetype archetype = parser.parse();
            Assert.IsNotNull(archetype);

            java.util.Map      translations = archetype.getTranslations();
            TranslationDetails transDet     = (TranslationDetails)translations.get("de");

            Assert.AreEqual("test Accreditation!", transDet.getAccreditation());
            Assert.AreEqual("test organisation", transDet.getAuthor().get("organisation"));
            TranslationDetails transDet2 = (TranslationDetails)translations.get("es");

            Assert.AreEqual(null, transDet2.getAccreditation());
            Assert.AreEqual(null, transDet2.getAuthor().get("organisation"));
        }
Beispiel #3
0
        public void testParseLanguageSection()
        {
            string adl = System.IO.File.ReadAllText(@"..\..\..\..\java-libs\adl-parser\src\test\resources\adl-test-entry.archetype_language.test.adl");

            se.acode.openehr.parser.ADLParser  parser    = new se.acode.openehr.parser.ADLParser(adl);
            org.openehr.am.archetype.Archetype archetype = parser.parse();
            Assert.IsNotNull(archetype);

            java.util.Map translations = archetype.getTranslations();
            Assert.IsNotNull(translations);
            TranslationDetails td = (TranslationDetails)translations.get("de");

            Assert.IsNotNull(td, "translation de missing");
            java.util.Map map = td.getAuthor();
            Assert.IsNotNull(map);
            Assert.AreEqual("Harry Potter", map.get("name"));
            Assert.AreEqual("*****@*****.**", map.get("email"));

            Assert.AreEqual("British Medical Translator id 00400595", td.getAccreditation());

            map = td.getOtherDetails();
            Assert.AreEqual("Ron Weasley", map.get("review 1"));
            Assert.AreEqual("Rubeus Hagrid", map.get("review 2"));
        }