예제 #1
0
        public virtual void TestParseValueAttributeValidWithDefaultOperator()
        {
            XmlNode node   = CreateNode("<something value=\"12.00\" currency=\"CAD\" />");
            BareANY intAny = new MoR2ElementParser().Parse(CreateContextSxcm(), node, this.result);

            Assert.AreEqual(new Money(new BigDecimal(12.00), Ca.Infoway.Messagebuilder.Domainvalue.Basic.Currency.CANADIAN_DOLLAR), intAny
                            .BareValue, "correct value returned");
            Assert.IsTrue(this.result.IsValid(), "no errors");
            Assert.AreEqual(SetOperator.INCLUDE, ((ANYMetaData)intAny).Operator, "operator");
        }
예제 #2
0
        public virtual void TestParseValueAttributeValidWithOperatorNotAllowed()
        {
            XmlNode node   = CreateNode("<something operator=\"P\" value=\"12.00\" currency=\"CAD\" />");
            BareANY intAny = new MoR2ElementParser().Parse(CreateContext(), node, this.result);

            Assert.AreEqual(new Money(new BigDecimal(12.00), Ca.Infoway.Messagebuilder.Domainvalue.Basic.Currency.CANADIAN_DOLLAR), intAny
                            .BareValue, "correct value returned");
            Assert.IsNull(((ANYMetaData)intAny).Operator, "no operator");
            Assert.IsFalse(this.result.IsValid());
            Assert.AreEqual(1, this.result.GetHl7Errors().Count, "1 error expected");
        }