public virtual void TestIntervalEquals() { Interval <PlatformDate> interval1 = IntervalFactory.CreateLowHigh(new PlatformDate(1234), new PlatformDate(5678)); Interval <PlatformDate> interval2 = IntervalFactory.CreateLowHigh(new PlatformDate(1234), new PlatformDate(5678)); Assert.AreEqual(interval1, interval2); }
public virtual void TestGtsEquals() { PeriodicIntervalTime pivl1 = PeriodicIntervalTime.CreatePeriodPhase(new DateDiff(new PhysicalQuantity(new BigDecimal(4), Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive.DAY)), IntervalFactory.CreateLowHigh(new PlatformDate (1234), new PlatformDate(5678))); GeneralTimingSpecification gts1 = new GeneralTimingSpecification(IntervalFactory.CreateLowHigh(new PlatformDate(2222), new PlatformDate(3333)), pivl1); PeriodicIntervalTime pivl2 = PeriodicIntervalTime.CreatePeriodPhase(new DateDiff(new PhysicalQuantity(new BigDecimal(4), Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive.DAY)), IntervalFactory.CreateLowHigh(new PlatformDate (1234), new PlatformDate(5678))); GeneralTimingSpecification gts2 = new GeneralTimingSpecification(IntervalFactory.CreateLowHigh(new PlatformDate(2222), new PlatformDate(3333)), pivl2); Assert.AreEqual(gts1, gts2); }
public virtual void TestNullParameters() { IntervalFactory.CreateCentre((PlatformDate)null); IntervalFactory.CreateCentre((PlatformDate)null, (NullFlavor)null); IntervalFactory.CreateCentreHigh((PlatformDate)null, (PlatformDate)null); IntervalFactory.CreateCentreHigh((PlatformDate)null, (PlatformDate)null, (NullFlavor)null, (NullFlavor)null); IntervalFactory.CreateCentreWidth((PlatformDate)null, (Diff <PlatformDate>)null); IntervalFactory.CreateCentreWidth((PlatformDate)null, (Diff <PlatformDate>)null, (NullFlavor)null); IntervalFactory.CreateHigh((PlatformDate)null); IntervalFactory.CreateHigh((PlatformDate)null, (NullFlavor)null); IntervalFactory.CreateLow((PlatformDate)null); IntervalFactory.CreateLow((PlatformDate)null, (NullFlavor)null); IntervalFactory.CreateLowCentre((PlatformDate)null, (PlatformDate)null); IntervalFactory.CreateLowCentre((PlatformDate)null, (PlatformDate)null, (NullFlavor)null, (NullFlavor)null); IntervalFactory.CreateLowHigh((PlatformDate)null, (PlatformDate)null); IntervalFactory.CreateLowHigh((PlatformDate)null, (PlatformDate)null, (NullFlavor)null, (NullFlavor)null); IntervalFactory.CreateLowWidth((PlatformDate)null, (Diff <PlatformDate>)null); IntervalFactory.CreateLowWidth((PlatformDate)null, (Diff <PlatformDate>)null, (NullFlavor)null); IntervalFactory.CreateSimple((PlatformDate)null); IntervalFactory.CreateWidth((Diff <PlatformDate>)null); IntervalFactory.CreateWidthHigh((Diff <PlatformDate>)null, (PlatformDate)null); IntervalFactory.CreateWidthHigh((Diff <PlatformDate>)null, (PlatformDate)null, (NullFlavor)null); }
public virtual void TestPivlEquals() { PeriodicIntervalTime pivl1 = PeriodicIntervalTime.CreatePeriodPhase(new DateDiff(new PhysicalQuantity(new BigDecimal(4), Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive.DAY)), IntervalFactory.CreateLowHigh(new PlatformDate (1234), new PlatformDate(5678))); PeriodicIntervalTime pivl2 = PeriodicIntervalTime.CreatePeriodPhase(new DateDiff(new PhysicalQuantity(new BigDecimal(4), Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive.DAY)), IntervalFactory.CreateLowHigh(new PlatformDate (1234), new PlatformDate(5678))); Assert.AreEqual(pivl1, pivl2); pivl1 = PeriodicIntervalTime.CreateFrequency(5, new PhysicalQuantity(new BigDecimal(4), Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive .DAY)); pivl2 = PeriodicIntervalTime.CreateFrequency(5, new PhysicalQuantity(new BigDecimal(4), Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive .DAY)); Assert.AreEqual(pivl1, pivl2); }
/// <summary>Constructs an Interval using the supplied parameters.</summary> /// <remarks>Constructs an Interval using the supplied parameters.</remarks> /// <TBD></TBD> /// <param name="low">the low bound</param> /// <param name="high">the high bound</param> /// <returns>the constructed interval</returns> public static Interval <T> CreateLowHigh <T>(T low, T high) { return(IntervalFactory.CreateLowHigh(low, high, null, null)); }