public virtual void test_pv01()
        {
            FxSingleTradeCalculationFunction function           = new FxSingleTradeCalculationFunction();
            ScenarioMarketData             md                   = marketData();
            RatesProvider                  provider             = RATES_LOOKUP.ratesProvider(md.scenario(0));
            DiscountingFxSingleTradePricer pricer               = DiscountingFxSingleTradePricer.DEFAULT;
            PointSensitivities             pvPointSens          = pricer.presentValueSensitivity(RTRADE, provider);
            CurrencyParameterSensitivities pvParamSens          = provider.parameterSensitivity(pvPointSens);
            MultiCurrencyAmount            expectedPv01         = pvParamSens.total().multipliedBy(1e-4);
            CurrencyParameterSensitivities expectedBucketedPv01 = pvParamSens.multipliedBy(1e-4);

            ISet <Measure> measures = ImmutableSet.of(Measures.PV01_CALIBRATED_SUM, Measures.PV01_CALIBRATED_BUCKETED);

            assertThat(function.calculate(TRADE, measures, PARAMS, md, REF_DATA)).containsEntry(Measures.PV01_CALIBRATED_SUM, Result.success(MultiCurrencyScenarioArray.of(ImmutableList.of(expectedPv01)))).containsEntry(Measures.PV01_CALIBRATED_BUCKETED, Result.success(ScenarioArray.of(ImmutableList.of(expectedBucketedPv01))));
        }
        public virtual void test_simpleMeasures()
        {
            FxSingleTradeCalculationFunction function = new FxSingleTradeCalculationFunction();
            ScenarioMarketData             md         = marketData();
            RatesProvider                  provider   = RATES_LOOKUP.ratesProvider(md.scenario(0));
            DiscountingFxSingleTradePricer pricer     = DiscountingFxSingleTradePricer.DEFAULT;
            MultiCurrencyAmount            expectedPv = pricer.presentValue(RTRADE, provider);
            double expectedParSpread = pricer.parSpread(RTRADE, provider);
            MultiCurrencyAmount expectedCurrencyExp = pricer.currencyExposure(RTRADE, provider);
            MultiCurrencyAmount expectedCash        = pricer.currentCash(RTRADE, provider);
            FxRate expectedForwardFx = pricer.forwardFxRate(RTRADE, provider);

            ISet <Measure> measures = ImmutableSet.of(Measures.PRESENT_VALUE, Measures.PAR_SPREAD, Measures.CURRENCY_EXPOSURE, Measures.CURRENT_CASH, Measures.FORWARD_FX_RATE, Measures.RESOLVED_TARGET);

            assertThat(function.calculate(TRADE, measures, PARAMS, md, REF_DATA)).containsEntry(Measures.PRESENT_VALUE, Result.success(MultiCurrencyScenarioArray.of(ImmutableList.of(expectedPv)))).containsEntry(Measures.PAR_SPREAD, Result.success(DoubleScenarioArray.of(ImmutableList.of(expectedParSpread)))).containsEntry(Measures.CURRENCY_EXPOSURE, Result.success(MultiCurrencyScenarioArray.of(ImmutableList.of(expectedCurrencyExp)))).containsEntry(Measures.CURRENT_CASH, Result.success(MultiCurrencyScenarioArray.of(ImmutableList.of(expectedCash)))).containsEntry(Measures.FORWARD_FX_RATE, Result.success(ScenarioArray.of(ImmutableList.of(expectedForwardFx)))).containsEntry(Measures.RESOLVED_TARGET, Result.success(RTRADE));
        }