@Test public void methodVsCalculator() { double yield1 = METHOD_SECURITY.yieldFromCurves(BILL_IAM_SEC, CURVE_BUNDLE); double yield2 = BILL_IAM_SEC.accept(YFCC, CURVE_BUNDLE); assertEquals( "Bill Security: discounting method - yield from curves", yield1, yield2, TOLERANCE_YIELD); yield1 = METHOD_SECURITY.yieldFromPrice(BILL_IAM_SEC, PRICE); yield2 = BILL_IAM_SEC.accept(YFPC, PRICE); assertEquals( "Bill Security: discounting method - yield from price", yield1, yield2, TOLERANCE_YIELD); }
@Test /** Tests the present value: Method vs Calculator */ public void presentValueMethodVsCalculator() { final CurrencyAmount pvMethod = METHOD_SECURITY.presentValue(BILL_IAM_SEC, CURVE_BUNDLE); final double pvCalculator = BILL_IAM_SEC.accept(PVC, CURVE_BUNDLE); assertEquals( "Bill Security: discounting method - present value", pvMethod.getAmount(), pvCalculator, TOLERANCE_PV); }
@Test public void presentValueCurveSensitivityMethodVsCalculator() { final InterestRateCurveSensitivity pvcsMethod = METHOD_SECURITY.presentValueCurveSensitivity(BILL_IAM_SEC, CURVE_BUNDLE); final InterestRateCurveSensitivity pvcsCalculator = new InterestRateCurveSensitivity(BILL_IAM_SEC.accept(PVCSC, CURVE_BUNDLE)); AssertSensivityObjects.assertEquals( "Bill Security: discounting method - curve sensitivity", pvcsMethod, pvcsCalculator, TOLERANCE_PV); }