Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "stubIbor") public void test_stub_ibor(FixedIborSwapConvention convention, com.opengamma.strata.basics.date.Tenor tenor)
        public virtual void test_stub_ibor(FixedIborSwapConvention convention, Tenor tenor)
        {
            LocalDate    tradeDate    = LocalDate.of(2015, 10, 20);
            SwapTrade    swap         = convention.createTrade(tradeDate, tenor, BuySell.BUY, 1, 0.01, REF_DATA);
            ResolvedSwap swapResolved = swap.Product.resolve(REF_DATA);
            LocalDate    endDate      = swapResolved.getLeg(PayReceive.PAY).get().EndDate;

            assertTrue(endDate.isAfter(tradeDate.plus(tenor).minusMonths(1)));
            assertTrue(endDate.isBefore(tradeDate.plus(tenor).plusMonths(1)));
        }
Пример #2
0
        public virtual void test_toTrade_periodTenor()
        {
            FixedIborSwapConvention @base = ImmutableFixedIborSwapConvention.of(NAME, FIXED, IBOR);
            LocalDate tradeDate           = LocalDate.of(2015, 5, 5);
            LocalDate startDate           = date(2015, 8, 7);
            LocalDate endDate             = date(2025, 8, 7);
            SwapTrade test     = @base.createTrade(tradeDate, Period.ofMonths(3), TENOR_10Y, BUY, NOTIONAL_2M, 0.25d, REF_DATA);
            Swap      expected = Swap.of(FIXED.toLeg(startDate, endDate, PAY, NOTIONAL_2M, 0.25d), IBOR.toLeg(startDate, endDate, RECEIVE, NOTIONAL_2M));

            assertEquals(test.Info.TradeDate, tradeDate);
            assertEquals(test.Product, expected);
        }