Exemple #1
0
        public virtual void TestParseValueAttributeValidRealLotsOfDigits()
        {
            XmlNode node = CreateNode("<something value=\"9999.9999\" />");
            BareANY real = new RealR2ElementParser().Parse(CreateContext("REAL"), node, this.xmlResult);

            Assert.AreEqual(new BigDecimal("9999.9999"), real.BareValue, "correct value returned");
            Assert.IsTrue(this.xmlResult.IsValid(), "no errors");
        }
Exemple #2
0
        public virtual void TestParseValueAttributeValidFraction()
        {
            XmlNode node = CreateNode("<something value=\"0.2345\" />");
            BareANY real = new RealR2ElementParser().Parse(CreateContext("REAL"), node, this.xmlResult);

            Assert.AreEqual(new BigDecimal("0.2345"), real.BareValue, "correct value returned");
            Assert.IsNull(real.NullFlavor, "no null flavor");
            Assert.IsTrue(this.xmlResult.IsValid(), "no errors");
        }
Exemple #3
0
        public virtual void TestParseValueAttributeValidWithDefaultOperator()
        {
            XmlNode node   = CreateNode("<something value=\"1345.67\" />");
            BareANY intAny = new RealR2ElementParser().Parse(CreateContext("SXCM<INT>"), node, this.xmlResult);

            Assert.AreEqual(new BigDecimal("1345.67"), intAny.BareValue, "correct value returned");
            Assert.IsTrue(this.xmlResult.IsValid(), "no errors");
            Assert.AreEqual(SetOperator.INCLUDE, ((ANYMetaData)intAny).Operator, "operator");
        }
Exemple #4
0
        public virtual void TestParseValueAttributeValidWithOperatorNotAllowed()
        {
            XmlNode node   = CreateNode("<something operator=\"P\" value=\"1345.67\" />");
            BareANY intAny = new RealR2ElementParser().Parse(CreateContext("INT"), node, this.xmlResult);

            Assert.AreEqual(new BigDecimal("1345.67"), intAny.BareValue, "correct value returned");
            Assert.IsNull(((ANYMetaData)intAny).Operator, "no operator");
            Assert.IsFalse(this.xmlResult.IsValid());
            Assert.AreEqual(1, this.xmlResult.GetHl7Errors().Count, "1 error expected");
        }