Esempio n. 1
0
        public virtual void TestValueShouldBeGreaterThanZero()
        {
            string     realValue  = "-0.56";
            BigDecimal bigDecimal = new BigDecimal(realValue);
            string     result     = new RealConfPropertyFormatterTest.TestableRealConfPropertyFormatter().Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl
                                                                                                                     (this.modelToXmlResult, null, "name", null, null, null, false), new REALImpl(bigDecimal));

            Assert.AreEqual("<name value=\"-0.56\"/>", result.Trim(), "xml output");
            Assert.AreEqual(1, this.modelToXmlResult.GetHl7Errors().Count, "1 error");
        }
Esempio n. 2
0
        public virtual void TestValueEqualsToZero()
        {
            string realValue = "0.0";
            IDictionary <string, string> result = new RealConfPropertyFormatterTest.TestableRealConfPropertyFormatter().GetAttributeNameValuePairsForTest
                                                      (new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl(this.modelToXmlResult, null, "name", null, null
                                                                                                                                 , null, false), new BigDecimal(realValue), null);

            Assert.AreEqual(1, result.Count, "map size");
            Assert.IsTrue(result.ContainsKey("value"), "key as expected");
            Assert.AreEqual("0.0", result.SafeGet("value"), "value as expected");
            Assert.IsTrue(this.modelToXmlResult.IsValid(), "no errors");
        }
Esempio n. 3
0
        public virtual void TestGetAttributeNameValuePairsNullValue()
        {
            IDictionary <string, string> result = new RealConfPropertyFormatterTest.TestableRealConfPropertyFormatter().GetAttributeNameValuePairsForTest
                                                      (new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl(this.modelToXmlResult, null, "name", null, null
                                                                                                                                 , null, false), null, new REALImpl());

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