public virtual void test_of()
        {
            ValuationZoneTimeDefinition test = ValuationZoneTimeDefinition.of(LocalTime.MIDNIGHT, ZONE_ID, LOCAL_TIME_1, LOCAL_TIME_2, LOCAL_TIME_3);

            assertEquals(test.LocalTimes, ImmutableList.of(LOCAL_TIME_1, LOCAL_TIME_2, LOCAL_TIME_3));
            assertEquals(test.ZoneId, ZONE_ID);
        }
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            ValuationZoneTimeDefinition test1 = ValuationZoneTimeDefinition.of(LOCAL_TIME_1, ZONE_ID, LOCAL_TIME_2);

            coverImmutableBean(test1);
            ValuationZoneTimeDefinition test2 = ValuationZoneTimeDefinition.of(LOCAL_TIME_4, ZoneId.of("Europe/London"));

            coverBeanEquals(test1, test2);
        }
        public virtual void test_toZonedDateTime_single()
        {
            ValuationZoneTimeDefinition   test     = ValuationZoneTimeDefinition.of(LOCAL_TIME_4, ZONE_ID);
            MarketDataBox <LocalDate>     dates    = MarketDataBox.ofSingleValue(LocalDate.of(2016, 10, 21));
            MarketDataBox <ZonedDateTime> computed = test.toZonedDateTime(dates);
            MarketDataBox <ZonedDateTime> expected = MarketDataBox.ofSingleValue(dates.SingleValue.atTime(LOCAL_TIME_4).atZone(ZONE_ID));

            assertEquals(computed, expected);
        }
        public virtual void test_toZonedDateTime_scenario_long()
        {
            ValuationZoneTimeDefinition   test     = ValuationZoneTimeDefinition.of(LOCAL_TIME_1, ZONE_ID, LOCAL_TIME_1, LOCAL_TIME_2);
            MarketDataBox <LocalDate>     dates    = MarketDataBox.ofScenarioValues(LocalDate.of(2016, 10, 21), LocalDate.of(2016, 10, 22), LocalDate.of(2016, 10, 23));
            MarketDataBox <ZonedDateTime> computed = test.toZonedDateTime(dates);
            MarketDataBox <ZonedDateTime> expected = MarketDataBox.ofScenarioValue(ScenarioArray.of(dates.getValue(0).atTime(LOCAL_TIME_1).atZone(ZONE_ID), dates.getValue(1).atTime(LOCAL_TIME_2).atZone(ZONE_ID), dates.getValue(2).atTime(LOCAL_TIME_1).atZone(ZONE_ID)));

            assertEquals(computed, expected);
        }
Example #5
0
 //-----------------------------------------------------------------------
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         ValuationZoneTimeDefinition other = (ValuationZoneTimeDefinition)obj;
         return(JodaBeanUtils.equal(defaultLocalTime, other.defaultLocalTime) && JodaBeanUtils.equal(zoneId, other.zoneId) && JodaBeanUtils.equal(localTimes, other.localTimes));
     }
     return(false);
 }
        public virtual void test_serialization()
        {
            ValuationZoneTimeDefinition test = ValuationZoneTimeDefinition.of(LOCAL_TIME_1, ZONE_ID);

            assertSerialization(test);
        }