Exemplo n.º 1
0
 public EditTimeProfileAnalysisChartPresenter(
     IEditTimeProfileAnalysisChartView view,
     ITimeProfileChartPresenter timeProfileChartPresenter,
     ITimeProfileChartDataCreator timeProfileChartDataCreator,
     IPopulationSimulationAnalysisStarter populationSimulationAnalysisStarter,
     IPopulationAnalysisTask populationAnalysisTask,
     IColorGenerator colorGenerator,
     IObservedDataTask observedDataTask,
     IPopulationPKAnalysisPresenter pkAnalysisPresenter,
     IDimensionRepository dimensionRepository,
     IPresentationSettingsTask presentationSettingsTask)
     : base(view, timeProfileChartPresenter, timeProfileChartDataCreator, populationSimulationAnalysisStarter, populationAnalysisTask, ApplicationIcons.TimeProfileAnalysis)
 {
     _colorGenerator                     = colorGenerator;
     _observedDataTask                   = observedDataTask;
     _pkAnalysisPresenter                = pkAnalysisPresenter;
     _dimensionRepository                = dimensionRepository;
     _presentationSettingsTask           = presentationSettingsTask;
     _timeProfileAnalysisChartView       = view;
     timeProfileChartPresenter.DragDrop += OnDragDrop;
     timeProfileChartPresenter.DragOver += OnDragOver;
     timeProfileChartPresenter.ObservedDataSettingsChanged += RefreshData;
     _chartDisplayMode           = ChartDisplayMode.Chart;
     _observedDataDragDropBinder = new ObservedDataDragDropBinder();
     _timeProfileAnalysisChartView.SetChartView(_populationAnalysisChartPresenter.BaseView);
     _timeProfileAnalysisChartView.SetPKAnalysisView(_pkAnalysisPresenter.BaseView);
 }
        protected override void Context()
        {
            _view = A.Fake <IEditTimeProfileAnalysisChartView>();
            _timeProfilerChartPresenter          = A.Fake <ITimeProfileChartPresenter>();
            _timeProfileChartDataCreator         = A.Fake <ITimeProfileChartDataCreator>();
            _populationSimulationAnalysisStarter = A.Fake <IPopulationSimulationAnalysisStarter>();
            _populationAnalysisTask = A.Fake <IPopulationAnalysisTask>();
            _colorGenerator         = A.Fake <IColorGenerator>();
            _observedDataTask       = A.Fake <IObservedDataTask>();
            _pkAnalysisPresenter    = A.Fake <IPopulationPKAnalysisPresenter>();
            _dimensionRepository    = A.Fake <IDimensionRepository>();

            _presenterSettingsTask = A.Fake <IPresentationSettingsTask>();
            sut = new EditTimeProfileAnalysisChartPresenter(_view, _timeProfilerChartPresenter, _timeProfileChartDataCreator,
                                                            _populationSimulationAnalysisStarter, _populationAnalysisTask, _colorGenerator, _observedDataTask, _pkAnalysisPresenter, _dimensionRepository, _presenterSettingsTask);

            _timeProfileAnalysisChart      = new TimeProfileAnalysisChart();
            _populationStatisticalAnalysis = new PopulationStatisticalAnalysis();
            _timeProfileAnalysisChart.PopulationAnalysis = _populationStatisticalAnalysis;
            _populationDataCollector = A.Fake <IPopulationDataCollector>();
            sut.InitializeAnalysis(_timeProfileAnalysisChart, _populationDataCollector);

            _observedDataRepository = DomainHelperForSpecs.ObservedData();
            var data = new DragDropInfo(
                new List <ITreeNode> {
                new ObservedDataNode(new ClassifiableObservedData {
                    Subject = _observedDataRepository
                })
            }
                );

            _dragEventArgs = new DragEventArgs(new DataObject(data), 0, 0, 0, DragDropEffects.All, DragDropEffects.All);

            _chartData = new ChartData <TimeProfileXValue, TimeProfileYValue>(null, null);
            var concentrationDimension = DomainHelperForSpecs.ConcentrationDimensionForSpecs();
            var yAxis = new AxisData(concentrationDimension, concentrationDimension.DefaultUnit, Scalings.Linear);

            _paneData = new PaneData <TimeProfileXValue, TimeProfileYValue>(yAxis);
            _chartData.AddPane(_paneData);
            A.CallTo(_timeProfileChartDataCreator).WithReturnType <ChartData <TimeProfileXValue, TimeProfileYValue> >().Returns(_chartData);

            var outputField = new PopulationAnalysisOutputField {
                Dimension = DomainHelperForSpecs.MassConcentrationDimensionForSpecs()
            };

            _populationStatisticalAnalysis.Add(outputField);

            A.CallTo(() => _dimensionRepository.MergedDimensionFor(A <NumericFieldContext> ._)).Returns(concentrationDimension);
        }
Exemplo n.º 3
0
 public void AttachPresenter(IPopulationPKAnalysisPresenter presenter)
 {
     _presenter = presenter;
     _populationAnalysisPivotView.BindUnitsMenuToPresenter(presenter);
 }