コード例 #1
0
        public virtual void TestFormatInvalidNameUses()
        {
            EnR2PropertyFormatter formatter = new EnR2PropertyFormatter();
            EntityName            name      = new TrivialName("something");

            name.AddUse(Ca.Infoway.Messagebuilder.Domainvalue.Basic.EntityNameUse.ALPHABETIC);
            name.AddUse(Ca.Infoway.Messagebuilder.Domainvalue.Basic.EntityNameUse.IDEOGRAPHIC);
            string result = formatter.Format(GetContext("name", "TN"), new ENImpl <EntityName>(name));

            Assert.IsFalse(this.result.IsValid());
            Assert.AreEqual(1, this.result.GetHl7Errors().Count);
            AssertXml("something in text node", "<name use=\"ABC IDE\">something</name>", result, true);
        }
コード例 #2
0
        public virtual void TestFormatNameUses()
        {
            TnPropertyFormatter formatter = new TnPropertyFormatter();
            EntityName          name      = new TrivialName("something");

            name.AddUse(Ca.Infoway.Messagebuilder.Domainvalue.Basic.EntityNameUse.ALPHABETIC);
            name.AddUse(Ca.Infoway.Messagebuilder.Domainvalue.Basic.EntityNameUse.IDEOGRAPHIC);
            // since the uses as a set, order is not guaranteed
            string result = formatter.Format(GetContext("name"), new ENImpl <EntityName>(name));

            Assert.IsTrue(result.StartsWith("<name use=\""), "open tag");
            Assert.IsTrue(result.Contains("ABC IDE") || result.Contains("IDE ABC"), "ABC");
            Assert.IsTrue(result.Trim().EndsWith("\">something</name>"), "close tag");
        }