Exemple #1
0
        public virtual void test_getEndDate()
        {
            SwapLeg leg1 = MockSwapLeg.of(FIXED, PAY, date(2015, 6, 29), date(2017, 6, 30), Currency.USD);
            SwapLeg leg2 = MockSwapLeg.of(FIXED, RECEIVE, date(2015, 6, 30), date(2017, 6, 29), Currency.USD);

            assertEquals(Swap.of(leg1).EndDate, AdjustableDate.of(date(2017, 6, 30)));
            assertEquals(Swap.of(leg2).EndDate, AdjustableDate.of(date(2017, 6, 29)));
            assertEquals(Swap.of(leg1, leg2).EndDate, AdjustableDate.of(date(2017, 6, 30)));
            assertEquals(Swap.of(leg2, leg1).EndDate, AdjustableDate.of(date(2017, 6, 30)));
        }
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         MockSwapLeg other = (MockSwapLeg)obj;
         return(JodaBeanUtils.equal(type, other.type) && JodaBeanUtils.equal(payReceive, other.payReceive) && JodaBeanUtils.equal(startDate, other.startDate) && JodaBeanUtils.equal(endDate, other.endDate) && JodaBeanUtils.equal(currency, other.currency));
     }
     return(false);
 }