Esempio n. 1
0
        //-------------------------------------------------------------------------
        public virtual void test_requirements()
        {
            CalculationFunctions functions        = CalculationFunctions.of(ImmutableMap.of(typeof(TestTarget), new TestFunction()));
            CalculationRules     calculationRules = CalculationRules.of(functions, USD);
            IList <TestTarget>   targets          = ImmutableList.of(TARGET1);
            IList <Column>       columns          = ImmutableList.of(Column.of(TestingMeasures.PRESENT_VALUE));

            CalculationTasks test = CalculationTasks.of(calculationRules, targets, columns);

            MarketDataRequirements requirements = test.requirements(REF_DATA);
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.Set<? extends com.opengamma.strata.data.MarketDataId<?>> nonObservables = requirements.getNonObservables();
            ISet <MarketDataId <object> > nonObservables = requirements.NonObservables;
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: com.google.common.collect.ImmutableSet<? extends com.opengamma.strata.data.ObservableId> observables = requirements.getObservables();
            ImmutableSet <ObservableId> observables = requirements.Observables;
            ImmutableSet <ObservableId> timeSeries  = requirements.TimeSeries;

            assertThat(nonObservables).hasSize(1);
            assertThat(nonObservables.GetEnumerator().next()).isEqualTo(TestId.of("1"));

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: com.opengamma.strata.data.MarketDataId<?> observableId = com.opengamma.strata.calc.marketdata.TestObservableId.of("2", CalculationTaskTest.OBS_SOURCE);
            MarketDataId <object> observableId = TestObservableId.of("2", CalculationTaskTest.OBS_SOURCE);

            assertThat(observables).hasSize(1);
            assertThat(observables.GetEnumerator().next()).isEqualTo(observableId);

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: com.opengamma.strata.data.MarketDataId<?> timeSeriesId = com.opengamma.strata.calc.marketdata.TestObservableId.of("3", CalculationTaskTest.OBS_SOURCE);
            MarketDataId <object> timeSeriesId = TestObservableId.of("3", CalculationTaskTest.OBS_SOURCE);

            assertThat(timeSeries).hasSize(1);
            assertThat(timeSeries.GetEnumerator().next()).isEqualTo(timeSeriesId);
        }
Esempio n. 2
0
 public FunctionRequirements requirements(TestTarget target, ISet <Measure> measures, CalculationParameters parameters, ReferenceData refData)
 {
     return(FunctionRequirements.builder().valueRequirements(ImmutableSet.of(TestId.of("1"), TestObservableId.of("2"))).timeSeriesRequirements(TestObservableId.of("3")).observableSource(OBS_SOURCE).build());
 }