public virtual void TestNoValue() { string result = new PivlTsR2PropertyFormatter().Format(GetContext("periodicInterval", "PIVL<TS>"), new PIVL_R2Impl((PeriodicIntervalTimeR2 )null)); Assert.IsTrue(this.result.IsValid()); AssertXml("result", "<periodicInterval nullFlavor=\"NI\"/>", result); }
public virtual void TestNullFlavor() { string result = new PivlTsR2PropertyFormatter().Format(GetContext("periodicInterval", "PIVL<TS>"), new PIVL_R2Impl(Ca.Infoway.Messagebuilder.Domainvalue.Nullflavor.NullFlavor .TEMPORARILY_UNAVAILABLE)); Assert.IsTrue(this.result.IsValid()); AssertXml("result", "<periodicInterval nullFlavor=\"NAV\"/>", result); }
public virtual void TestMissingValues() { PeriodicIntervalTimeR2 pivl = new PeriodicIntervalTimeR2((Interval <PlatformDate>)null, (PhysicalQuantity)null); string result = new PivlTsR2PropertyFormatter().Format(GetContext("periodicInterval", "PIVL<TS>"), new PIVL_R2Impl(pivl)); // from a strict reading of the schema, this is a perfectly valid PIVL_TS AssertXml("result", "<periodicInterval></periodicInterval>", result); Assert.IsTrue(this.result.IsValid()); }
public virtual void TestFullPivl() { PlatformDate lowDate = DateUtil.GetDate(1999, 0, 23); PlatformDate lowDateWithPattern = new DateWithPattern(lowDate, "yyyyMMdd"); PlatformDate highDate = DateUtil.GetDate(2013, 4, 7); PlatformDate highDateWithPattern = new DateWithPattern(highDate, "yyyyMMdd"); Interval <PlatformDate> phase = IntervalFactory.CreateLowHigh(lowDateWithPattern, highDateWithPattern); PhysicalQuantity period = new PhysicalQuantity(new BigDecimal(11), Ca.Infoway.Messagebuilder.Domainvalue.Basic.DefaultTimeUnit .DAY); PeriodicIntervalTimeR2 pivl = new PeriodicIntervalTimeR2(phase, period, CalendarCycle.DAY_OF_THE_MONTH, true, null, null); string result = new PivlTsR2PropertyFormatter().Format(GetContext("periodicInterval", "PIVL<TS>"), new PIVL_R2Impl(pivl)); Assert.IsTrue(this.result.IsValid()); AssertXml("result", "<periodicInterval alignment=\"D\" institutionSpecified=\"true\"><phase><low value=\"19990123\"/><high value=\"20130507\"/></phase><period unit=\"d\" value=\"11\"/></periodicInterval>" , result); }