//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(ThreeLegBasisSwapConvention convention, com.opengamma.strata.basics.date.Tenor tenor) public virtual void test_stub_ibor(ThreeLegBasisSwapConvention 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))); }
public virtual void test_toTrade_periodTenor() { ThreeLegBasisSwapConvention @base = ImmutableThreeLegBasisSwapConvention.of(NAME, FIXED, IBOR6M, IBOR12M); 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), IBOR6M.toLeg(startDate, endDate, PAY, NOTIONAL_2M), IBOR12M.toLeg(startDate, endDate, RECEIVE, NOTIONAL_2M)); assertEquals(test.Info.TradeDate, tradeDate); assertEquals(test.Product, expected); }