Ejemplo n.º 1
0
        public virtual void TestParseValueAttributeValidWithDefaultOperator()
        {
            XmlNode node   = CreateNode("<something value=\"1345\" />");
            BareANY intAny = new IntR2ElementParser().Parse(CreateContext("SXCM<INT>"), node, this.xmlResult);

            Assert.AreEqual(System.Convert.ToInt32("1345"), intAny.BareValue, "correct value returned");
            Assert.IsTrue(this.xmlResult.IsValid(), "no errors");
            Assert.AreEqual(SetOperator.INCLUDE, ((ANYMetaData)intAny).Operator, "operator");
        }
Ejemplo n.º 2
0
        public virtual void TestParseValueAttributeValidWithOperatorNotAllowed()
        {
            XmlNode node   = CreateNode("<something operator=\"P\" value=\"1345\" />");
            BareANY intAny = new IntR2ElementParser().Parse(CreateContext("INT"), node, this.xmlResult);

            Assert.AreEqual(System.Convert.ToInt32("1345"), 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");
        }