示例#1
0
        public virtual void TestFormatNullWithCodeSystem()
        {
            string xml = new CsPropertyFormatterTest.TestableCsPropertyFormatter().Format(GetContext("option"), new CSImpl(Ca.Infoway.Messagebuilder.Domainvalue.Nullflavor.NullFlavor
                                                                                                                           .OTHER));

            Assert.IsTrue(this.result.IsValid());
            XmlDocument document = new DocumentFactory().CreateFromString(xml);
            XmlNodeList list     = document.GetElementsByTagName("option");

            Assert.AreEqual(1, list.Count, "option");
            XmlElement result = ((XmlElement)list.Item(0));

            Assert.AreEqual("OTH", result.GetAttribute("nullFlavor"), "nullFlavor");
            Assert.IsFalse(result.HasAttribute("codeSystem"), "should not have codeSystem");
        }
示例#2
0
        public virtual void TestGetAttributeNameValuePairsWithOriginalText()
        {
            CSImpl cs = new CSImpl(new CsPropertyFormatterTest.FakeCode(this));

            cs.OriginalText = "The Flintstones";
            string result = new CsPropertyFormatterTest.TestableCsPropertyFormatter().Format(GetContext("character"), cs);

            Assert.AreEqual(1, this.result.GetHl7Errors().Count);
            Assert.IsTrue(this.result.GetHl7Errors()[0].GetMessage().StartsWith("Could not locate a registered domain type to match "
                                                                                ));
            XmlDocument document = new DocumentFactory().CreateFromString(result);
            XmlNodeList list     = document.GetElementsByTagName("originalText");

            Assert.AreEqual(1, list.Count, "originalText");
        }