コード例 #1
0
        public virtual void TestFormatStWithCdataValue()
        {
            AnyPropertyFormatter formatter = new AnyPropertyFormatter();
            FormatContext        context   = GetContext("name", "ANY");
            ANYImpl <object>     dataType  = new ANYImpl <object>("something", null, StandardDataType.ST);

            dataType.IsCdata = true;
            string result = formatter.Format(context, dataType);

            Assert.AreEqual(AddLineSeparator("<name xsi:type=\"ST\"><![CDATA[something]]></name>"), result, "something in text node");
            Assert.IsTrue(this.result.IsValid());
        }
コード例 #2
0
        public virtual void TestUrgPqLabForBC()
        {
            UncertainRange <PhysicalQuantity> urg = new UncertainRange <PhysicalQuantity>(new PhysicalQuantity(new BigDecimal(1), null)
                                                                                          , new PhysicalQuantity(new BigDecimal(124), Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive.GRAMS_PER_LITRE
                                                                                                                 ), null, null, Representation.LOW_HIGH, Ca.Infoway.Messagebuilder.Domainvalue.Nullflavor.NullFlavor.NO_INFORMATION, null
                                                                                          , null, true, false);
            AnyPropertyFormatter formatter = new AnyPropertyFormatter();
            FormatContext        context   = GetContext("name", "ANY", SpecificationVersion.V02R04_BC);
            ANYImpl <object>     any       = new ANYImpl <object>(urg, null, StandardDataType.URG_PQ_LAB);

            any.OriginalText = "<124";
            string result = formatter.Format(context, any);

            AssertXml("result", "<name specializationType=\"URG_PQ.LAB\" xsi:type=\"URG_PQ\"><originalText>&lt;124</originalText><low inclusive=\"true\" nullFlavor=\"NI\" value=\"1\"/><high inclusive=\"false\" unit=\"g/L\" value=\"124\"/></name>"
                      , result);
            Assert.IsTrue(this.result.IsValid());
        }