Esempio n. 1
0
        public virtual void TestGetAttributeNameValuePairsBooleanFalseBL()
        {
            IDictionary <string, string> result = new BlR2PropertyFormatterTest.TestableBlR2PropertyFormatter().GetAttributeNameValuePairsForTest
                                                      (new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl(this.result, null, "name", "BL", null, null,
                                                                                                                                 false), false, null);

            Assert.AreEqual(1, result.Count, "map size");
            Assert.IsTrue(this.result.IsValid());
            Assert.IsTrue(result.ContainsKey("value"), "key as expected");
            Assert.AreEqual("false", result.SafeGet("value"), "value as expected");
        }
Esempio n. 2
0
        public virtual void TestNullValueBN()
        {
            // this test should go through the full formatter (as NFs can sometimes cause a short-circuit of the code path to follow)
            Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl context = new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl
                                                                                                (this.result, null, "name", "BN", null, null, false);
            string xml = new BlR2PropertyFormatterTest.TestableBlR2PropertyFormatter().Format(context, new BLImpl());

            Assert.IsFalse(this.result.IsValid());
            Assert.AreEqual(1, this.result.GetHl7Errors().Count);
            AssertXml("xml output", "<name nullFlavor=\"NI\"/>", xml);
        }
Esempio n. 3
0
        public virtual void TestGetAttributeNameValuePairsNullValueBL()
        {
            IDictionary <string, string> result = new BlR2PropertyFormatterTest.TestableBlR2PropertyFormatter().GetAttributeNameValuePairsForTest
                                                      (new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl(this.result, null, "name", "BL", null, null,
                                                                                                                                 false), null, new BLImpl());

            // a null value for BL elements results in a nullFlavor attribute
            Assert.AreEqual(1, result.Count, "map size");
            Assert.IsTrue(this.result.IsValid());
            Assert.IsTrue(result.ContainsKey("nullFlavor"), "key as expected");
            Assert.AreEqual(AbstractPropertyFormatter.NULL_FLAVOR_NO_INFORMATION, result.SafeGet("nullFlavor"), "value as expected");
        }