コード例 #1
0
        public virtual void TestFormatSxcmValueNonNullWithNoOperator()
        {
            MoR2PropertyFormatter formatter = new MoR2PropertyFormatter();
            Money         money             = new Money(new BigDecimal("12.00"), Ca.Infoway.Messagebuilder.Domainvalue.Basic.Currency.CANADIAN_DOLLAR);
            FormatContext context           = GetContext("amount", "SXCM<TS>");
            MOImpl        dataType          = new MOImpl(money);
            string        result            = formatter.Format(context, dataType);

            Assert.AreEqual("<amount currency=\"CAD\" value=\"12.00\"/>", result.Trim(), "something in text node");
            Assert.IsTrue(context.GetModelToXmlResult().IsValid());
        }
コード例 #2
0
        public virtual void TestFormatValueNonNullWithOperatorNotAllowed()
        {
            MoR2PropertyFormatter formatter = new MoR2PropertyFormatter();
            Money         money             = new Money(new BigDecimal("12.00"), Ca.Infoway.Messagebuilder.Domainvalue.Basic.Currency.CANADIAN_DOLLAR);
            FormatContext context           = GetContext("amount");
            MOImpl        dataType          = new MOImpl(money);

            dataType.Operator = SetOperator.CONVEX_HULL;
            string result = formatter.Format(context, dataType);

            Assert.AreEqual("<amount currency=\"CAD\" value=\"12.00\"/>", result.Trim(), "something in text node");
            Assert.IsFalse(context.GetModelToXmlResult().IsValid());
            Assert.AreEqual(1, context.GetModelToXmlResult().GetHl7Errors().Count);
            Assert.IsTrue(context.GetModelToXmlResult().GetHl7Errors()[0].GetMessage().ToLower().Contains("operator"));
        }