public virtual void TestValueNegative() { string realValue = "-0.56"; BigDecimal bigDecimal = new BigDecimal(realValue); string result = new RealR2PropertyFormatterTest.TestableRealR2PropertyFormatter().Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (this.modelToXmlResult, null, "name", "REAL", null, null, false), new REALImpl(bigDecimal)); Assert.AreEqual("<name value=\"-0.56\"/>", result.Trim(), "xml output"); Assert.IsTrue(this.modelToXmlResult.IsValid(), "no errors"); }
public virtual void TestSxcmNoOperator() { string realValue = "123.56"; BigDecimal bigDecimal = new BigDecimal(realValue); REALImpl dataType = new REALImpl(bigDecimal); string result = new RealR2PropertyFormatterTest.TestableRealR2PropertyFormatter().Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (this.modelToXmlResult, null, "name", "SXCM<REAL>", null, null, false), dataType); Assert.AreEqual("<name value=\"123.56\"/>", result.Trim(), "xml output"); Assert.IsTrue(this.modelToXmlResult.IsValid()); }
public virtual void TestOperatorNotAllowed() { string realValue = "123.56"; BigDecimal bigDecimal = new BigDecimal(realValue); REALImpl dataType = new REALImpl(bigDecimal); dataType.Operator = SetOperator.EXCLUDE; string result = new RealR2PropertyFormatterTest.TestableRealR2PropertyFormatter().Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (this.modelToXmlResult, null, "name", "REAL", null, null, false), dataType); Assert.AreEqual("<name value=\"123.56\"/>", result.Trim(), "xml output"); Assert.IsFalse(this.modelToXmlResult.IsValid()); Assert.AreEqual(1, this.modelToXmlResult.GetHl7Errors().Count); }