protected override void Context()
        {
            _view = A.Fake <IParameterIdentificationChartFeedbackView>();
            _chartDisplayPresenter           = A.Fake <IChartDisplayPresenter>();
            _dimensionFactory                = A.Fake <IDimensionFactory>();
            _predictedVsObservedChartService = A.Fake <IPredictedVsObservedChartService>();
            _displayUnitRetriever            = A.Fake <IDisplayUnitRetriever>();
            _parameterIdentification         = A.Fake <ParameterIdentification>();
            _observationColumns              = new List <DataColumn>();
            _curveList     = new List <Curve>();
            _baseGrid      = DomainHelperForSpecs.ObservedData().BaseGrid;
            _outputMapping = new OutputMapping();

            sut = new ParameterIdentificationPredictedVsObservedFeedbackPresenter(_view, _chartDisplayPresenter, _dimensionFactory, _displayUnitRetriever, _predictedVsObservedChartService);

            A.CallTo(() => _parameterIdentification.AllOutputMappings).Returns(new[] { _outputMapping });
            A.CallTo(() => _parameterIdentification.AllObservationColumnsFor(A <string> ._)).Returns(_observationColumns);
            _observationColumns.Add(new DataColumn());
            _observationColumns.Add(new DataColumn());

            A.CallTo(() => _predictedVsObservedChartService.AddCurvesFor(_observationColumns, A <DataColumn> ._, A <ParameterIdentificationPredictedVsObservedChart> ._, A <Action <DataColumn, Curve> > ._)).Invokes(x =>
            {
                var action = x.Arguments.Get <Action <DataColumn, Curve> >(3);
                _observationColumns.Each(observation =>
                {
                    var curve = new Curve {
                        Name = "Best"
                    };

                    action(new DataColumn(ShortGuid.NewGuid(), A.Fake <IDimension>(), _baseGrid), curve);
                    _curveList.Add(curve);
                });
                _chart = x.GetArgument <ParameterIdentificationPredictedVsObservedChart>(2);
            });
        }
Ejemplo n.º 2
0
        protected override void Context()
        {
            _view = A.Fake <IParameterIdentificationChartFeedbackView>();
            _chartDisplayPresenter = A.Fake <IChartDisplayPresenter>();
            _dimensionFactory      = A.Fake <IDimensionFactory>();
            _displayUnitRetriever  = A.Fake <IDisplayUnitRetriever>();

            sut = new ParameterIdentificationTimeProfileFeedbackPresenter(_view, _chartDisplayPresenter, _dimensionFactory, _displayUnitRetriever);

            _runState      = A.Fake <ParameterIdentificationRunState>();
            _bestResult    = A.Fake <OptimizationRunResult>();
            _currentResult = A.Fake <OptimizationRunResult>();

            A.CallTo(() => _runState.BestResult).Returns(_bestResult);
            A.CallTo(() => _runState.CurrentResult).Returns(_currentResult);

            _parameterIdentification = A.Fake <ParameterIdentification>();
            _outputMapping1          = A.Fake <OutputMapping>();
            _outputMapping2          = A.Fake <OutputMapping>();
            _outputMapping3          = A.Fake <OutputMapping>();
            A.CallTo(() => _outputMapping1.FullOutputPath).Returns("A|B|C");
            A.CallTo(() => _outputMapping2.FullOutputPath).Returns("A|B|C");
            A.CallTo(() => _outputMapping3.FullOutputPath).Returns("A|B|C|D");
            A.CallTo(() => _parameterIdentification.AllOutputMappings).Returns(new[] { _outputMapping1, _outputMapping2, _outputMapping3 });

            var baseGrid1 = new BaseGrid("TimeCol1", DomainHelperForSpecs.TimeDimensionForSpecs());

            _obsCol1 = new DataColumn("ObsCol1", DomainHelperForSpecs.ConcentrationDimensionForSpecs(), baseGrid1);

            var baseGrid2 = new BaseGrid("TimeCol2", DomainHelperForSpecs.TimeDimensionForSpecs());

            _obsCol2 = new DataColumn("ObsCol2", DomainHelperForSpecs.ConcentrationDimensionForSpecs(), baseGrid2);

            var baseGrid3 = new BaseGrid("TimeCol3", DomainHelperForSpecs.TimeDimensionForSpecs());

            _obsCol3 = new DataColumn("ObsCol3", DomainHelperForSpecs.ConcentrationDimensionForSpecs(), baseGrid3);

            A.CallTo(() => _parameterIdentification.AllObservationColumnsFor(_outputMapping1.FullOutputPath)).Returns(new[] { _obsCol1, _obsCol2 });
            A.CallTo(() => _parameterIdentification.AllObservationColumnsFor(_outputMapping3.FullOutputPath)).Returns(new[] { _obsCol3 });
        }