public virtual void TestFormatValueNonNull() { string result = new SetPropertyFormatter(this.formatterRegistry).Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (this.result, null, "blah", "SET<CE>", "x_BasicUnitsOfMeasure", Ca.Infoway.Messagebuilder.Xml.ConformanceLevel.MANDATORY , Cardinality.Create("1-4"), false, SpecificationVersion.R02_04_02, null, null, CodingStrength.CNE, null, false), SETImpl <ANY <object>, object> .Create <CE, Code>(typeof(CEImpl), MakeSet(Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive .CENTIMETRE, Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive.KILOGRAM))); Assert.IsTrue(this.result.IsValid()); AssertXml("non null", "<blah code=\"cm\" codeSystem=\"2.16.840.1.113883.5.141\"/><blah code=\"kg\" codeSystem=\"2.16.840.1.113883.5.141\"/>" , result); }
public virtual void TestFormatValueEmptySet() { string result = this.formatter.Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl(this.result , null, "blah", "SET<CD>", Ca.Infoway.Messagebuilder.Xml.ConformanceLevel.POPULATED, null, false, SpecificationVersion.R02_04_02 , null, null, CodingStrength.CNE, false), SETImpl <ANY <object>, object> .Create <CD, Code>(typeof(CDImpl), new HashSet <Code >())); Assert.IsTrue(this.result.IsValid()); AssertXml("non null", "<blah nullFlavor=\"NI\"/>", result); }
public virtual void TestFormatValueNonNull() { string result = new SetPropertyFormatter(this.formatterRegistry).Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (new ModelToXmlResult(), null, "blah", "SET<ST>", Ca.Infoway.Messagebuilder.Xml.ConformanceLevel.MANDATORY, Cardinality. Create("1-4"), false), SETImpl <ANY <object>, object> .Create <ST, string>(typeof(STImpl), MakeSet("Fred", "Wilma"))); AssertXml("non null", "<blah>Fred</blah><blah>Wilma</blah>", result); }
public virtual void TestFormatValueTooFew() { string result = new SetPropertyFormatter(this.formatterRegistry).Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (this.result, null, "blah", "SET<ST>", Ca.Infoway.Messagebuilder.Xml.ConformanceLevel.MANDATORY, Cardinality.Create("4-6" ), false), SETImpl <ANY <object>, object> .Create <ST, string>(typeof(STImpl), MakeSet("Fred", "Wilma", "Barney"))); Assert.IsFalse(this.result.IsValid()); Assert.AreEqual(1, this.result.GetHl7Errors().Count); Assert.AreEqual("Number of elements (3) is less than the specified minimum (4)", this.result.GetHl7Errors()[0].GetMessage ()); Assert.IsTrue(result.Contains("<blah>Fred</blah>")); Assert.IsTrue(result.Contains("<blah>Wilma</blah>")); Assert.IsTrue(result.Contains("<blah>Barney</blah>")); }
public virtual void TestFormatValueNonNull() { string result = new SetPropertyFormatter(this.formatterRegistry).Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (new ModelToXmlResult(), null, "blah", "SET<TEL.PHONEMAIL>", Ca.Infoway.Messagebuilder.Xml.ConformanceLevel.MANDATORY, Cardinality .Create("1-4"), false, SpecificationVersion.R02_04_03, null, null, null, false), SETImpl <ANY <object>, object> .Create <TEL , TelecommunicationAddress>(typeof(TELImpl), MakeTelecommunicationAddressSet("Fred"))); AssertXml("non null", "<blah specializationType=\"TEL.PHONE\" value=\"mailto:Fred\" xsi:type=\"TEL\"/>", result); }