//-------------------------------------------------------------------------
        public virtual void test_of_2arg()
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.Map<MarketDataId<?>, Object> dataMap = com.google.common.collect.ImmutableMap.of(ID1, VAL1, ID2, VAL2);
            IDictionary <MarketDataId <object>, object> dataMap = ImmutableMap.of(ID1, VAL1, ID2, VAL2);
            MarketData test = MarketData.of(VAL_DATE, dataMap);

            assertEquals(test.containsValue(ID1), true);
            assertEquals(test.getValue(ID1), VAL1);
            assertEquals(test.findValue(ID1), VAL1);

            assertEquals(test.containsValue(ID2), true);
            assertEquals(test.getValue(ID2), VAL2);
            assertEquals(test.findValue(ID2), VAL2);

            assertEquals(test.containsValue(ID3), false);
            assertThrows(() => test.getValue(ID3), typeof(MarketDataNotFoundException));
            assertEquals(test.findValue(ID3), null);

            assertEquals(test.Ids, ImmutableSet.of(ID1, ID2));

            assertEquals(test.findIds(ID1.MarketDataName), ImmutableSet.of(ID1));
            assertEquals(test.findIds(new TestingName("Foo")), ImmutableSet.of());

            assertEquals(test.getTimeSeries(ID4), LocalDateDoubleTimeSeries.empty());
            assertEquals(test.getTimeSeries(ID5), LocalDateDoubleTimeSeries.empty());
        }
        /// <summary>
        /// Test two derived function composed together
        /// </summary>
        public virtual void calculateMeasuresNestedDerivedClasses()
        {
            TestTarget target = new TestTarget(10);
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.Map<com.opengamma.strata.calc.Measure, com.opengamma.strata.collect.result.Result<?>> delegateResults = com.google.common.collect.ImmutableMap.of(CASH_FLOWS, com.opengamma.strata.collect.result.Result.success(3), PAR_RATE, com.opengamma.strata.collect.result.Result.success(5), PRESENT_VALUE, com.opengamma.strata.collect.result.Result.success(7));
            IDictionary <Measure, Result <object> > delegateResults = ImmutableMap.of(CASH_FLOWS, Result.success(3), PAR_RATE, Result.success(5), PRESENT_VALUE, Result.success(7));
            DerivedFn derivedFn1 = new DerivedFn(BUCKETED_PV01);
            DerivedFn derivedFn2 = new DerivedFn(PRESENT_VALUE_MULTI_CCY);
            DerivedCalculationFunctionWrapper <TestTarget, int> wrapper = new DerivedCalculationFunctionWrapper <TestTarget, int>(derivedFn1, new DelegateFn(delegateResults));

            wrapper = new DerivedCalculationFunctionWrapper <>(derivedFn2, wrapper);

            ISet <Measure> measures = ImmutableSet.of(BUCKETED_PV01, PRESENT_VALUE_MULTI_CCY, CASH_FLOWS, PAR_RATE, PRESENT_VALUE);
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.Map<com.opengamma.strata.calc.Measure, com.opengamma.strata.collect.result.Result<?>> results = wrapper.calculate(target, measures, CalculationParameters.empty(), com.opengamma.strata.data.scenario.ScenarioMarketData.empty(), com.opengamma.strata.basics.ReferenceData.standard());
            IDictionary <Measure, Result <object> > results = wrapper.calculate(target, measures, CalculationParameters.empty(), ScenarioMarketData.empty(), ReferenceData.standard());

            assertThat(wrapper.supportedMeasures()).isEqualTo(measures);
            assertThat(wrapper.targetType()).isEqualTo(typeof(TestTarget));
            assertThat(results.Keys).isEqualTo(measures);
            assertThat(results[BUCKETED_PV01]).hasValue(35);
            assertThat(results[PRESENT_VALUE_MULTI_CCY]).hasValue(35);
            assertThat(results[CASH_FLOWS]).hasValue(3);
            assertThat(results[PAR_RATE]).hasValue(5);
            assertThat(results[PRESENT_VALUE]).hasValue(7);
        }
        //-------------------------------------------------------------------------
        // Check market data computation
        public virtual void market_data()
        {
            RatesCurveGroupDefinition group             = GROUPS_SYN_EUR;
            RatesProvider             multicurveTsLarge = MULTICURVE_INPUT_EUR_TSEMPTY.toBuilder().timeSeries(TS_LARGE).build();
            MarketData madTsEmpty = CALIBRATOR_SYNTHETIC.marketData(group, MULTICURVE_INPUT_EUR_TSEMPTY, REF_DATA);
            MarketData madTsLarge = CALIBRATOR_SYNTHETIC.marketData(group, multicurveTsLarge, REF_DATA);

            assertEquals(madTsEmpty.ValuationDate, VALUATION_DATE);
            foreach (CurveDefinition entry in group.CurveDefinitions)
            {
                ImmutableList <CurveNode> nodes = entry.Nodes;
                foreach (CurveNode node in nodes)
                {
                    ResolvedTrade tradeTsEmpty = node.resolvedTrade(1d, madTsEmpty, REF_DATA);
                    double        mqTsEmpty    = MQ_MEASURES.value(tradeTsEmpty, MULTICURVE_INPUT_EUR_TSEMPTY);
                    assertEquals(mqTsEmpty, (double?)madTsEmpty.getValue(node.requirements().GetEnumerator().next()), TOLERANCE_MQ);
                    ResolvedTrade tradeTsLarge = node.resolvedTrade(1d, madTsLarge, REF_DATA);
                    double        mqTsLarge    = MQ_MEASURES.value(tradeTsLarge, multicurveTsLarge);
                    assertEquals(mqTsLarge, (double?)madTsLarge.getValue(node.requirements().GetEnumerator().next()), TOLERANCE_MQ);
                    // Market Quote for Fixed v ibor swaps should have changed with the fixing
                    if ((tradeTsLarge is ResolvedSwapTrade) && (((ResolvedSwapTrade)tradeTsLarge)).Product.getLegs(SwapLegType.IBOR).size() == 1)
                    {
                        assertTrue(Math.Abs(mqTsEmpty - mqTsLarge) > TOLERANCE_MQ);
                    }
                }
            }
            assertEquals(madTsEmpty.TimeSeriesIds, ImmutableSet.of());
            assertEquals(madTsLarge.TimeSeriesIds, ImmutableSet.of(IndexQuoteId.of(EUR_EURIBOR_3M), IndexQuoteId.of(EUR_EURIBOR_6M)));
        }
        //-------------------------------------------------------------------------
        public virtual FunctionRequirements requirements(SecurityTrade trade, ISet <Measure> measures, CalculationParameters parameters, ReferenceData refData)
        {
            Security security = refData.getValue(trade.SecurityId);
            QuoteId  id       = QuoteId.of(trade.SecurityId.StandardId);

            return(FunctionRequirements.builder().valueRequirements(ImmutableSet.of(id)).outputCurrencies(security.Currency).build());
        }
        //-------------------------------------------------------------------------
        public FunctionRequirements requirements(SecurityId securityId, LegalEntityId issuerId, Currency currency)
        {
            // repo
            RepoGroup repoKey = repoCurveSecurityGroups.get(securityId);

            if (repoKey == null)
            {
                repoKey = repoCurveGroups.get(issuerId);
            }
            if (repoKey == null)
            {
                throw new System.ArgumentException(Messages.format("Legal entity discounting lookup has no repo curve defined for '{}' and '{}'", securityId, issuerId));
            }
            CurveId repoCurveId = repoCurves.get(Pair.of(repoKey, currency));

            if (repoCurveId == null)
            {
                throw new System.ArgumentException(Messages.format("Legal entity discounting lookup has no repo curve defined for '{}' and '{}'", securityId, issuerId));
            }
            // issuer
            LegalEntityGroup issuerKey = issuerCurveGroups.get(issuerId);

            if (issuerKey == null)
            {
                throw new System.ArgumentException(Messages.format("Legal entity discounting lookup has no issuer curve defined for '{}'", issuerId));
            }
            CurveId issuerCurveId = issuerCurves.get(Pair.of(issuerKey, currency));

            if (issuerCurveId == null)
            {
                throw new System.ArgumentException(Messages.format("Legal entity discounting lookup has no issuer curve defined for '{}'", issuerId));
            }
            // result
            return(FunctionRequirements.builder().valueRequirements(ImmutableSet.of(repoCurveId, issuerCurveId)).outputCurrencies(currency).observableSource(observableSource).build());
        }
Exemple #6
0
        //-------------------------------------------------------------------------
        private void assertDefinition(RatesCurveGroupDefinition defn)
        {
            assertEquals(defn.Name, CurveGroupName.of("Default"));
            assertEquals(defn.Entries.size(), 3);
            assertEquals(defn.SeasonalityDefinitions.size(), 1);
            assertEquals(defn.SeasonalityDefinitions.get(CurveName.of("USD-CPI")).AdjustmentType, ShiftType.SCALED);

            RatesCurveGroupEntry entry0 = findEntry(defn, "USD-Disc");
            RatesCurveGroupEntry entry1 = findEntry(defn, "USD-3ML");
            RatesCurveGroupEntry entry2 = findEntry(defn, "USD-CPI");
            CurveDefinition      defn0  = defn.findCurveDefinition(entry0.CurveName).get();
            CurveDefinition      defn1  = defn.findCurveDefinition(entry1.CurveName).get();
            CurveDefinition      defn2  = defn.findCurveDefinition(entry2.CurveName).get();

            assertEquals(entry0.DiscountCurrencies, ImmutableSet.of(Currency.USD));
            assertEquals(entry0.Indices, ImmutableSet.of());
            assertEquals(defn0.Name, CurveName.of("USD-Disc"));
            assertEquals(defn0.YValueType, ValueType.ZERO_RATE);
            assertEquals(defn0.ParameterCount, 17);

            assertEquals(entry1.DiscountCurrencies, ImmutableSet.of());
            assertEquals(entry1.Indices, ImmutableSet.of(IborIndices.USD_LIBOR_3M));
            assertEquals(defn1.Name, CurveName.of("USD-3ML"));
            assertEquals(defn1.YValueType, ValueType.ZERO_RATE);
            assertEquals(defn1.ParameterCount, 27);

            assertEquals(entry2.DiscountCurrencies, ImmutableSet.of());
            assertEquals(entry2.Indices, ImmutableSet.of(PriceIndices.US_CPI_U));
            assertEquals(defn2.Name, CurveName.of("USD-CPI"));
            assertEquals(defn2.YValueType, ValueType.PRICE_INDEX);
            assertEquals(defn2.ParameterCount, 2);
        }
        public virtual void test_toImmutableSet()
        {
            IList <string> list = Arrays.asList("a", "ab", "b", "bb", "c", "a");
//JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter:
            ImmutableSet <string> test = list.Where(s => s.length() == 1).collect(Guavate.toImmutableSet());

            assertEquals(test, ImmutableSet.of("a", "b", "c"));
        }
        public virtual void tokens()
        {
            SecurityTokenEvaluator evaluator = new SecurityTokenEvaluator();
            ISet <string>          tokens    = evaluator.tokens(security());
            ISet <string>          expected  = ImmutableSet.of("id", "info", "currency", "priceInfo", "contractSize", "tickSize", "tickValue", "attributes");

            assertThat(tokens).isEqualTo(expected);
        }
        public virtual void test_calculate_failure()
        {
            BillTradeCalculationFunction <BillTrade> function = BillTradeCalculationFunction.TRADE;
            ScenarioMarketData md       = marketData();
            ISet <Measure>     measures = ImmutableSet.of(Measures.FORWARD_FX_RATE);

            assertTrue(function.calculate(TRADE, measures, PARAMS, md, REF_DATA)[Measures.FORWARD_FX_RATE].Failure);
        }
Exemple #10
0
        public virtual void tokens()
        {
            PositionTokenEvaluator evaluator = new PositionTokenEvaluator();
            ISet <string>          tokens    = evaluator.tokens(trade());
            ISet <string>          expected  = ImmutableSet.of("longQuantity", "shortQuantity", "quantity", "security", "info", "id", "attributes");

            assertThat(tokens).isEqualTo(expected);
        }
        public virtual void empty()
        {
            MarketData test = MarketData.empty(VAL_DATE);

            assertEquals(test.containsValue(ID1), false);
            assertEquals(test.Ids, ImmutableSet.of());
            assertEquals(test.getTimeSeries(ID4), LocalDateDoubleTimeSeries.empty());
        }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Returns the set of currencies referred to by the CMS.
 /// <para>
 /// This returns the complete set of payment currencies for the CMS.
 /// This will typically return one currency, but could return two.
 ///
 /// </para>
 /// </summary>
 /// <returns> the set of payment currencies referred to by this swap </returns>
 public ImmutableSet <Currency> allPaymentCurrencies()
 {
     if (payLeg == null)
     {
         return(ImmutableSet.of(cmsLeg.Currency));
     }
     return(ImmutableSet.of(cmsLeg.Currency, payLeg.Currency));
 }
Exemple #13
0
        public virtual void tokens()
        {
            TradeTokenEvaluator evaluator = new TradeTokenEvaluator();
            ISet <string>       tokens    = evaluator.tokens(trade());
            ISet <string>       expected  = ImmutableSet.of("quantity", "price", "security", "id", "counterparty", "tradeDate", "tradeTime", "zone", "settlementDate", "attributes", "info");

            assertThat(tokens).isEqualTo(expected);
        }
Exemple #14
0
        //-------------------------------------------------------------------------
        public virtual void test_builder_list()
        {
            Swap test = Swap.builder().legs(ImmutableList.of(MOCK_GBP1, MOCK_USD1)).build();

            assertEquals(test.Legs, ImmutableList.of(MOCK_GBP1, MOCK_USD1));
            assertEquals(test.CrossCurrency, true);
            assertEquals(test.allPaymentCurrencies(), ImmutableSet.of(GBP, USD));
            assertEquals(test.allCurrencies(), ImmutableSet.of(GBP, EUR, USD));
        }
        public virtual void tokens()
        {
            Bean bean = BeanTokenEvaluatorTest.bean();
            BeanTokenEvaluator evaluator = new BeanTokenEvaluator();

            ISet <string>         tokens         = evaluator.tokens(bean);
            ImmutableSet <string> expectedTokens = ImmutableSet.of("buySell", "currency", "notional", "startDate", "endDate", "businessDayAdjustment", "paymentDate", "fixedRate", "index", "indexInterpolated", "fixingDateOffset", "dayCount", "discounting");

            assertThat(tokens).isEqualTo(expectedTokens);
        }
        //-------------------------------------------------------------------------

        public virtual void flatCombine_iterableWithFailures()
        {
            Result <string>         success1 = Result.success("success 1");
            Result <string>         success2 = Result.success("success 2");
            Result <string>         failure1 = Result.failure(MISSING_DATA, "failure 1");
            Result <string>         failure2 = Result.failure(ERROR, "failure 2");
            ISet <Result <string> > results  = ImmutableSet.of(success1, success2, failure1, failure2);

            assertThat(Result.flatCombine(results, Result.success)).isFailure(FailureReason.MULTIPLE);
        }
Exemple #17
0
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: @Override public com.google.common.collect.ImmutableSet<com.opengamma.strata.data.MarketDataId<?>> getVolatilityIds(com.opengamma.strata.basics.currency.CurrencyPair currencyPair)
        public ImmutableSet <MarketDataId <object> > getVolatilityIds(CurrencyPair currencyPair)
        {
            FxOptionVolatilitiesId id = volatilityIds.get(currencyPair);

            if (id == null)
            {
                throw new System.ArgumentException(msgPairNotFound(currencyPair));
            }
            return(ImmutableSet.of(id));
        }
Exemple #18
0
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: @Override public com.google.common.collect.ImmutableSet<com.opengamma.strata.data.MarketDataId<?>> getVolatilityIds(com.opengamma.strata.product.SecurityId securityId)
        public ImmutableSet <MarketDataId <object> > getVolatilityIds(SecurityId securityId)
        {
            BondFutureVolatilitiesId id = volatilityIds.get(securityId);

            if (id == null)
            {
                throw new System.ArgumentException(msgSecurityNotFound(securityId));
            }
            return(ImmutableSet.of(id));
        }
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: @Override public com.google.common.collect.ImmutableSet<com.opengamma.strata.data.MarketDataId<?>> getDiscountMarketDataIds(com.opengamma.strata.basics.currency.Currency currency)
        public ImmutableSet <MarketDataId <object> > getDiscountMarketDataIds(Currency currency)
        {
            CurveId id = discountCurves.get(currency);

            if (id == null)
            {
                throw new System.ArgumentException(msgCurrencyNotFound(currency));
            }
            return(ImmutableSet.of(id));
        }
Exemple #20
0
        //-------------------------------------------------------------------------
        public virtual void test_requirementsAndCurrency()
        {
            ISet <Measure>       measures = FUNCTION.supportedMeasures();
            FunctionRequirements reqs     = FUNCTION.requirements(TRADE, measures, CreditDataSet.INDEX_PARAMS, CreditDataSet.REF_DATA);

            assertThat(reqs.OutputCurrencies).containsOnly(USD);
            assertThat(reqs.ValueRequirements).isEqualTo(ImmutableSet.of(CreditDataSet.INDEX_CREDIT_CURVE_ID, CreditDataSet.USD_DSC_CURVE_ID, CreditDataSet.INDEX_RECOVERY_CURVE_ID));
            assertThat(reqs.TimeSeriesRequirements).isEqualTo(ImmutableSet.of());
            assertThat(FUNCTION.naturalCurrency(TRADE, CreditDataSet.REF_DATA)).isEqualTo(USD);
        }
        /// <summary>
        /// Tests the tokens() method when the bean has a single property. The tokens should include the single property
        /// name plus the tokens of the property value.
        /// </summary>
        public virtual void tokensSingleProperty()
        {
            SwapLegAmount      amount    = SwapLegAmount.builder().amount(CurrencyAmount.of(Currency.AUD, 7)).payReceive(PayReceive.PAY).type(SwapLegType.FIXED).currency(Currency.AUD).build();
            LegAmounts         amounts   = LegAmounts.of(amount);
            BeanTokenEvaluator evaluator = new BeanTokenEvaluator();

            ISet <string> tokens = evaluator.tokens(amounts);

            assertThat(tokens).isEqualTo(ImmutableSet.of("amounts", "0", "aud", "pay", "fixed"));
        }
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: @Override public com.google.common.collect.ImmutableSet<com.opengamma.strata.data.MarketDataId<?>> getForwardMarketDataIds(com.opengamma.strata.basics.index.Index index)
        public ImmutableSet <MarketDataId <object> > getForwardMarketDataIds(Index index)
        {
            CurveId id = forwardCurves.get(index);

            if (id == null)
            {
                throw new System.ArgumentException(msgIndexNotFound(index));
            }
            return(ImmutableSet.of(id));
        }
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: @Override public com.google.common.collect.ImmutableSet<com.opengamma.strata.data.MarketDataId<?>> getVolatilityIds(com.opengamma.strata.basics.index.IborIndex index)
        public ImmutableSet <MarketDataId <object> > getVolatilityIds(IborIndex index)
        {
            SwaptionVolatilitiesId id = volatilityIds.get(index);

            if (id == null)
            {
                throw new System.ArgumentException(msgIndexNotFound(index));
            }
            return(ImmutableSet.of(id));
        }
        //-------------------------------------------------------------------------
        public virtual void test_builder()
        {
            ImmutableMarketData test = ImmutableMarketData.builder(VAL_DATE.plusDays(1)).valuationDate(VAL_DATE).addValue(ID1, "123").addValueUnsafe(ID2, "124").addValueMap(ImmutableMap.of(ID3, "201")).addTimeSeries(ID4, TIME_SERIES).build();

            assertEquals(test.ValuationDate, VAL_DATE);
            assertEquals(test.Values.get(ID1), "123");
            assertEquals(test.Values.get(ID2), "124");
            assertEquals(test.Ids, ImmutableSet.of(ID1, ID2, ID3));
            assertEquals(test.TimeSeries.get(ID4), TIME_SERIES);
        }
        public virtual void test_of_CurrencyCurrency_reverseStandardOrder()
        {
            CurrencyPair test = CurrencyPair.of(USD, GBP);

            assertEquals(test.Base, USD);
            assertEquals(test.Counter, GBP);
            assertEquals(test.Identity, false);
            assertEquals(test.toSet(), ImmutableSet.of(GBP, USD));
            assertEquals(test.ToString(), "USD/GBP");
        }
        //-------------------------------------------------------------------------
        public virtual void test_of_CurrencyCurrency()
        {
            CurrencyPair test = CurrencyPair.of(GBP, USD);

            assertEquals(test.Base, GBP);
            assertEquals(test.Counter, USD);
            assertEquals(test.Identity, false);
            assertEquals(test.toSet(), ImmutableSet.of(GBP, USD));
            assertEquals(test.ToString(), "GBP/USD");
        }
Exemple #27
0
        //-------------------------------------------------------------------------
        public virtual void test_requirementsAndCurrency()
        {
            CapitalIndexedBondTradeCalculationFunction <CapitalIndexedBondTrade> function = CapitalIndexedBondTradeCalculationFunction.TRADE;
            ISet <Measure>       measures = function.supportedMeasures();
            FunctionRequirements reqs     = function.requirements(TRADE, measures, PARAMS, REF_DATA);

            assertThat(reqs.OutputCurrencies).containsOnly(CURRENCY);
            assertThat(reqs.ValueRequirements).isEqualTo(ImmutableSet.of(INF_CURVE_ID, REPO_CURVE_ID, ISSUER_CURVE_ID));
            assertThat(reqs.TimeSeriesRequirements).isEqualTo(ImmutableSet.of(IndexQuoteId.of(US_CPI_U)));
            assertThat(function.naturalCurrency(TRADE, REF_DATA)).isEqualTo(CURRENCY);
        }
Exemple #28
0
        //-------------------------------------------------------------------------
        public virtual void test_requirementsAndCurrency()
        {
            FxVanillaOptionTradeCalculationFunction function = new FxVanillaOptionTradeCalculationFunction();
            ISet <Measure>       measures = function.supportedMeasures();
            FunctionRequirements reqs     = function.requirements(TRADE, measures, PARAMS, REF_DATA);

            assertThat(reqs.OutputCurrencies).containsExactly(EUR, USD);
            assertThat(reqs.ValueRequirements).isEqualTo(ImmutableSet.of(DISCOUNT_CURVE_EUR_ID, DISCOUNT_CURVE_USD_ID, VOL_ID));
            assertThat(reqs.TimeSeriesRequirements).Empty;
            assertThat(function.naturalCurrency(TRADE, REF_DATA)).isEqualTo(EUR);
        }
        //-------------------------------------------------------------------------
        public virtual void test_requirementsAndCurrency()
        {
            CdsTradeCalculationFunction function = new CdsTradeCalculationFunction();
            ISet <Measure>       measures        = function.supportedMeasures();
            FunctionRequirements reqs            = function.requirements(TRADE, measures, CreditDataSet.CDS_PARAMS, CreditDataSet.REF_DATA);

            assertThat(reqs.OutputCurrencies).containsOnly(USD);
            assertThat(reqs.ValueRequirements).isEqualTo(ImmutableSet.of(CreditDataSet.CDS_CREDIT_CURVE_ID, CreditDataSet.USD_DSC_CURVE_ID, CreditDataSet.CDS_RECOVERY_CURVE_ID));
            assertThat(reqs.TimeSeriesRequirements).isEqualTo(ImmutableSet.of());
            assertThat(function.naturalCurrency(TRADE, CreditDataSet.REF_DATA)).isEqualTo(USD);
        }
        //-------------------------------------------------------------------------
        public virtual void test_requirementsAndCurrency()
        {
            TermDepositTradeCalculationFunction function = new TermDepositTradeCalculationFunction();
            ISet <Measure>       measures = function.supportedMeasures();
            FunctionRequirements reqs     = function.requirements(TRADE, measures, PARAMS, REF_DATA);

            assertThat(reqs.OutputCurrencies).containsOnly(CURRENCY);
            assertThat(reqs.ValueRequirements).isEqualTo(ImmutableSet.of(DISCOUNT_CURVE_ID));
            assertThat(reqs.TimeSeriesRequirements).isEqualTo(ImmutableSet.of());
            assertThat(function.naturalCurrency(TRADE, REF_DATA)).isEqualTo(CURRENCY);
        }