Esempio n. 1
0
        public virtual void TestFormatValueNull()
        {
            string result = new ScPropertyFormatter().Format(GetContext("name"), null);

            Assert.IsTrue(this.result.IsValid());
            Assert.IsTrue(StringUtils.IsBlank(result), "named null format");
        }
Esempio n. 2
0
        public virtual void TestFormatValueNullCode()
        {
            ScPropertyFormatter formatter   = new ScPropertyFormatter();
            CodedString <Code>  codedString = new CodedString <Code>("something", null);
            string result = formatter.Format(GetContext("name"), new SCImpl <Code>(codedString));

            Assert.IsTrue(this.result.IsValid());
            Assert.AreEqual(AddLineSeparator("<name>something</name>"), result, "something in text node");
        }
Esempio n. 3
0
        public virtual void TestFormatValueReservedXmlChars()
        {
            ScPropertyFormatter formatter   = new ScPropertyFormatter();
            CodedString <Code>  codedString = new CodedString <Code>("<cats think they're > humans & dogs 99% of the time/>", null);
            string result = formatter.Format(GetContext("name"), new SCImpl <Code>(codedString));

            Assert.IsTrue(this.result.IsValid());
            Assert.AreEqual("<name>&lt;cats think they&apos;re &gt; humans &amp; dogs 99% of the time/&gt;</name>".Trim(), result.Trim
                                (), "something in text node");
        }
Esempio n. 4
0
        public virtual void TestFormatValueCode()
        {
            ScPropertyFormatter formatter   = new ScPropertyFormatter();
            CodedString <Code>  codedString = new CodedString <Code>("something", Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive
                                                                     .CENTIMETRE, "aDisplayName", "aCodeSystemName", "aCodeSystemVersion");
            string result = formatter.Format(GetContext("name"), new SCImpl <Code>(codedString));

            Assert.IsTrue(this.result.IsValid());
            Assert.AreEqual(AddLineSeparator("<name code=\"cm\" codeSystem=\"2.16.840.1.113883.5.141\" codeSystemName=\"aCodeSystemName\" codeSystemVersion=\"aCodeSystemVersion\" displayName=\"aDisplayName\">something</name>"
                                             ), result, "something in text node");
        }