Exemplo n.º 1
0
        //-------------------------------------------------------------------------
        public virtual void test_of()
        {
            DatesCdsTemplate test = DatesCdsTemplate.of(START, END, CONV1);

            assertEquals(test.StartDate, START);
            assertEquals(test.EndDate, END);
            assertEquals(test.Convention, CONV1);
        }
Exemplo n.º 2
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            DatesCdsTemplate test1 = DatesCdsTemplate.of(START, END, CONV1);

            coverImmutableBean(test1);
            DatesCdsTemplate test2 = DatesCdsTemplate.of(LocalDate.of(2015, 5, 20), LocalDate.of(2025, 6, 20), CdsConventions.USD_STANDARD);

            coverBeanEquals(test1, test2);
        }
Exemplo n.º 3
0
        //-------------------------------------------------------------------------
        public virtual void test_createTrade()
        {
            DatesCdsTemplate @base     = DatesCdsTemplate.of(START, END, CONV1);
            LocalDate        tradeDate = LocalDate.of(2015, 5, 5);
            CdsTrade         test      = @base.createTrade(LEGAL_ENTITY, tradeDate, BUY, NOTIONAL_2M, 0.05d, REF_DATA);
            Cds expected          = Cds.of(BUY, LEGAL_ENTITY, CONV1.Currency, NOTIONAL_2M, START, END, Frequency.P3M, CONV1.SettlementDateOffset.Calendar, 0.05d);
            PeriodicSchedule sch1 = expected.PaymentSchedule;

            expected = expected.toBuilder().paymentSchedule(sch1.toBuilder().startDateBusinessDayAdjustment(sch1.BusinessDayAdjustment).rollConvention(RollConventions.DAY_20).build()).build();
            assertEquals(test.Info.TradeDate, tradeDate);
            assertEquals(test.Product, expected);
            assertEquals(test.UpfrontFee, null);
        }
Exemplo n.º 4
0
 //-----------------------------------------------------------------------
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         DatesCdsTemplate other = (DatesCdsTemplate)obj;
         return(JodaBeanUtils.equal(startDate, other.startDate) && JodaBeanUtils.equal(endDate, other.endDate) && JodaBeanUtils.equal(convention, other.convention));
     }
     return(false);
 }
Exemplo n.º 5
0
        public virtual void test_serialization()
        {
            DatesCdsTemplate test = DatesCdsTemplate.of(START, END, CONV1);

            assertSerialization(test);
        }