public virtual void test_min_resolve()
        {
            ResolvedCdsIndexTrade test = CdsIndexTrade.builder().product(PRODUCT).info(TRADE_INFO).build().resolve(REF_DATA);

            assertEquals(test.Product, PRODUCT.resolve(REF_DATA));
            assertEquals(test.Info, TRADE_INFO);
            assertFalse(test.UpfrontFee.Present);
        }
        public virtual void test_full_resolve()
        {
            ResolvedCdsIndexTrade test = sut().resolve(REF_DATA);

            assertEquals(test.Product, PRODUCT.resolve(REF_DATA));
            assertEquals(test.Info, TRADE_INFO);
            assertEquals(test.UpfrontFee.get(), UPFRONT.resolve(REF_DATA));
        }
Example #3
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            ResolvedCdsIndexTrade test1 = ResolvedCdsIndexTrade.builder().product(PRODUCT).upfrontFee(UPFRONT).info(TRADE_INFO).build();

            coverImmutableBean(test1);
            ResolvedCdsIndex      product = CdsIndex.of(BUY, INDEX_ID, LEGAL_ENTITIES, USD, 1.e9, START_DATE, END_DATE, P6M, SAT_SUN, 0.067).resolve(REF_DATA);
            ResolvedCdsIndexTrade test2   = ResolvedCdsIndexTrade.builder().product(product).info(TradeInfo.empty()).build();

            coverBeanEquals(test1, test2);
        }
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         ResolvedCdsIndexTrade other = (ResolvedCdsIndexTrade)obj;
         return(JodaBeanUtils.equal(info, other.info) && JodaBeanUtils.equal(product, other.product) && JodaBeanUtils.equal(upfrontFee, other.upfrontFee));
     }
     return(false);
 }
Example #5
0
        public virtual void test_builder_min()
        {
            ResolvedCdsIndexTrade test = ResolvedCdsIndexTrade.builder().product(PRODUCT).info(TRADE_INFO).build();

            assertEquals(test.Product, PRODUCT);
            assertEquals(test.Info, TRADE_INFO);
            assertFalse(test.UpfrontFee.Present);

            ResolvedCdsTrade singleName = test.toSingleNameCds();

            assertEquals(singleName.Product, PRODUCT.toSingleNameCds());
            assertEquals(singleName.Info, TRADE_INFO);
            assertFalse(singleName.UpfrontFee.Present);
        }
Example #6
0
        public virtual void test_builder_full()
        {
            ResolvedCdsIndexTrade test = ResolvedCdsIndexTrade.builder().product(PRODUCT).info(TRADE_INFO).upfrontFee(UPFRONT).build();

            assertEquals(test.Product, PRODUCT);
            assertEquals(test.Info, TRADE_INFO);
            assertEquals(test.UpfrontFee.get(), UPFRONT);

            ResolvedCdsTrade singleName = test.toSingleNameCds();

            assertEquals(singleName.Product, PRODUCT.toSingleNameCds());
            assertEquals(singleName.Info, TRADE_INFO);
            assertEquals(singleName.UpfrontFee.get(), UPFRONT);
        }
Example #7
0
        public virtual void test_serialization()
        {
            ResolvedCdsIndexTrade test = ResolvedCdsIndexTrade.builder().product(PRODUCT).upfrontFee(UPFRONT).info(TRADE_INFO).build();

            assertSerialization(test);
        }