Exemplo n.º 1
0
        public virtual void getMarketDataKey()
        {
            QuoteId quoteId = QuoteId.of(StandardId.of("test", "1"), FieldName.of("fieldName"), ObservableSource.NONE);

            assertThat(KEY.MarketDataId).isEqualTo(quoteId);
            assertThat(QuoteScenarioArrayId.of(quoteId)).isEqualTo(KEY);
        }
Exemplo n.º 2
0
 private Quote(QuoteId quoteId, double value)
 {
     JodaBeanUtils.notNull(quoteId, "quoteId");
     JodaBeanUtils.notNull(value, "value");
     this.quoteId = quoteId;
     this.value   = value;
 }
Exemplo n.º 3
0
        public virtual void coverage()
        {
            Quote test = Quote.of(QUOTE_ID_1, 1.234);

            coverImmutableBean(test);
            Quote test2 = Quote.of(QuoteId.of(StandardId.of("a", "b")), 4.321);

            coverBeanEquals(test, test2);
        }
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            QuoteId test = QuoteId.of(ID1);

            coverImmutableBean(test);
            QuoteId test2 = QuoteId.of(ID2, FIELD2, OBS_SOURCE2);

            coverBeanEquals(test, test2);
        }
        public virtual void test_of_3args()
        {
            QuoteId test = QuoteId.of(ID1, FIELD2, OBS_SOURCE2);

            assertEquals(test.StandardId, ID1);
            assertEquals(test.FieldName, FIELD2);
            assertEquals(test.ObservableSource, OBS_SOURCE2);
            assertEquals(test.MarketDataType, typeof(Double));
            assertEquals(test.ToString(), "QuoteId:OG-Ticker~1/Field2/Vendor2");
        }
        //-------------------------------------------------------------------------
        public virtual void test_of_1arg()
        {
            QuoteId test = QuoteId.of(ID1);

            assertEquals(test.StandardId, ID1);
            assertEquals(test.FieldName, FieldName.MARKET_VALUE);
            assertEquals(test.ObservableSource, ObservableSource.NONE);
            assertEquals(test.MarketDataType, typeof(Double));
            assertEquals(test.ToString(), "QuoteId:OG-Ticker~1/MarketValue");
        }
Exemplo n.º 7
0
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case 3355:         // id
                    this.id = (QuoteId)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
Exemplo n.º 8
0
 //-----------------------------------------------------------------------
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         QuoteId other = (QuoteId)obj;
         return(JodaBeanUtils.equal(standardId, other.standardId) && JodaBeanUtils.equal(fieldName, other.fieldName) && JodaBeanUtils.equal(observableSource, other.observableSource));
     }
     return(false);
 }
Exemplo n.º 9
0
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case 664377527:         // quoteId
                    this.quoteId = (QuoteId)newValue;
                    break;

                case 111972721:         // value
                    this.value = (double?)newValue.Value;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
Exemplo n.º 10
0
 /// <summary>
 /// Returns a key identifying the same market data as the quote key.
 /// </summary>
 /// <param name="quoteId">  key identifying the quote </param>
 /// <returns> a key identifying the same market data as the quote key </returns>
 public static QuoteScenarioArrayId of(QuoteId quoteId)
 {
     return(new QuoteScenarioArrayId(quoteId));
 }
Exemplo n.º 11
0
 /// <summary>
 /// Returns a key identifying the market data with the specified ID and field name.
 /// </summary>
 /// <param name="id">  the ID of the quote </param>
 /// <param name="fieldName">  the field name of the market data record containing the quote data </param>
 /// <returns> a key identifying the market data with the specified ID and field name </returns>
 public static QuoteScenarioArrayId of(StandardId id, FieldName fieldName)
 {
     return(new QuoteScenarioArrayId(QuoteId.of(id, fieldName)));
 }
Exemplo n.º 12
0
 private QuoteScenarioArrayId(QuoteId id)
 {
     JodaBeanUtils.notNull(id, "id");
     this.id = id;
 }
Exemplo n.º 13
0
        public virtual void test_serialization()
        {
            QuoteId test = QuoteId.of(ID1);

            assertSerialization(test);
        }
Exemplo n.º 14
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Obtains an instance from the quote identifier and value.
 /// </summary>
 /// <param name="quoteId">  the quote identifier </param>
 /// <param name="value">  the value for the given quote </param>
 /// <returns> the quote instance for the given values </returns>
 public static Quote of(QuoteId quoteId, double value)
 {
     return(new Quote(quoteId, value));
 }