예제 #1
0
        public virtual void test_builder_min()
        {
            ResolvedCdsTrade test = ResolvedCdsTrade.builder().product(PRODUCT).info(TRADE_INFO).build();

            assertEquals(test.Product, PRODUCT);
            assertEquals(test.Info, TRADE_INFO);
            assertFalse(test.UpfrontFee.Present);
        }
예제 #2
0
        public virtual void test_builder_full()
        {
            ResolvedCdsTrade test = ResolvedCdsTrade.builder().product(PRODUCT).info(TRADE_INFO).upfrontFee(UPFRONT).build();

            assertEquals(test.Product, PRODUCT);
            assertEquals(test.Info, TRADE_INFO);
            assertEquals(test.UpfrontFee.get(), UPFRONT);
        }
예제 #3
0
        public virtual void test_full_resolve()
        {
            ResolvedCdsTrade 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));
        }
예제 #4
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            ResolvedCdsTrade test1 = ResolvedCdsTrade.builder().product(PRODUCT).upfrontFee(UPFRONT).info(TRADE_INFO).build();

            coverImmutableBean(test1);
            ResolvedCds      product = Cds.of(BUY, LEGAL_ENTITY, USD, 1.e9, START_DATE, END_DATE, Frequency.P6M, SAT_SUN, 0.067).resolve(REF_DATA);
            ResolvedCdsTrade test2   = ResolvedCdsTrade.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())
     {
         ResolvedCdsTrade other = (ResolvedCdsTrade)obj;
         return(JodaBeanUtils.equal(info, other.info) && JodaBeanUtils.equal(product, other.product) && JodaBeanUtils.equal(upfrontFee, other.upfrontFee));
     }
     return(false);
 }
예제 #6
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);
        }
예제 #7
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);
        }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Reduce this instance to {@code ResolvedCdsTrade}.
 /// <para>
 /// The resultant object is used for pricing CDS index trades under the homogeneous pool assumption on constituent
 /// credit curves.
 ///
 /// </para>
 /// </summary>
 /// <returns> the CDS trade </returns>
 public ResolvedCdsTrade toSingleNameCds()
 {
     return(ResolvedCdsTrade.builder().product(product.toSingleNameCds()).info(info).upfrontFee(upfrontFee).build());
 }
예제 #9
0
        public virtual void test_serialization()
        {
            ResolvedCdsTrade test = ResolvedCdsTrade.builder().product(PRODUCT).upfrontFee(UPFRONT).info(TRADE_INFO).build();

            assertSerialization(test);
        }