//-------------------------------------------------------------------------
        public virtual void coverage()
        {
            ExtendedMarketData <string> test = ExtendedMarketData.of(ID1, VAL1, BASE_DATA);

            coverImmutableBean(test);
            ExtendedMarketData <string> test2 = ExtendedMarketData.of(ID2, VAL2, ImmutableMarketData.of(VAL_DATE, ImmutableMap.of()));

            coverBeanEquals(test, test2);
        }
示例#2
0
        //-----------------------------------------------------------------------
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            if (obj != null && obj.GetType() == this.GetType())
            {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: ExtendedMarketData<?> other = (ExtendedMarketData<?>) obj;
                ExtendedMarketData <object> other = (ExtendedMarketData <object>)obj;
                return(JodaBeanUtils.equal(id, other.id) && JodaBeanUtils.equal(value, other.value) && JodaBeanUtils.equal(underlying, other.underlying));
            }
            return(false);
        }
        /// <summary>
        /// Tests the combinedWith method when the MarketData instances are not both ImmutableMarketData.
        /// </summary>
        public virtual void test_combinedWith_differentTypes()
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.Map<MarketDataId<?>, Object> dataMap1 = com.google.common.collect.ImmutableMap.of(ID1, VAL1, ID2, VAL2);
            IDictionary <MarketDataId <object>, object> dataMap1 = ImmutableMap.of(ID1, VAL1, ID2, VAL2);
            MarketData test1 = MarketData.of(VAL_DATE, dataMap1);
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.Map<MarketDataId<?>, Object> dataMap2 = com.google.common.collect.ImmutableMap.of(ID1, VAL1);
            IDictionary <MarketDataId <object>, object> dataMap2 = ImmutableMap.of(ID1, VAL1);
            MarketData test2 = MarketData.of(VAL_DATE, dataMap2);
            ExtendedMarketData <string> test3 = ExtendedMarketData.of(ID1, VAL3, test2);

            MarketData test = test3.combinedWith(test1);

            assertEquals(test.getValue(ID1), VAL3);
            assertEquals(test.getValue(ID2), VAL2);
            assertEquals(test.Ids, ImmutableSet.of(ID1, ID2));
        }
        public virtual void of_override()
        {
            ExtendedMarketData <string> test = ExtendedMarketData.of(ID1, VAL3, BASE_DATA);

            assertEquals(test.Id, ID1);
            assertEquals(test.Value, VAL3);
            assertEquals(test.ValuationDate, VAL_DATE);
            assertEquals(test.containsValue(ID1), true);
            assertEquals(test.containsValue(ID2), true);
            assertEquals(test.containsValue(ID3), false);
            assertEquals(test.getValue(ID1), VAL3);
            assertEquals(test.getValue(ID2), VAL2);
            assertThrows(() => test.getValue(ID3), typeof(MarketDataNotFoundException));
            assertEquals(test.findValue(ID1), VAL3);
            assertEquals(test.findValue(ID2), VAL2);
            assertEquals(test.findValue(ID3), null);
            assertEquals(test.Ids, ImmutableSet.of(ID1, ID2));
            assertEquals(test.getTimeSeries(ID4), TIME_SERIES);
        }
        public virtual void serialization()
        {
            ExtendedMarketData <string> test = ExtendedMarketData.of(ID1, VAL3, BASE_DATA);

            assertSerialization(test);
        }