private void OnPaneMinimize(object sender, EventArgs e) { PaneCaption caption = (PaneCaption)sender; PaneData paneData = (PaneData)caption.Tag; _paneButtons.SetButtonPressed(paneData.PaneId, false); }
protected override void Context() { base.Context(); var timeDimension = DomainHelperForSpecs.TimeDimensionForSpecs(); var concDimension = DomainHelperForSpecs.ConcentrationDimensionForSpecs(); _xAxis = new AxisData(timeDimension, timeDimension.DefaultUnit, Scalings.Linear) { Caption = "X" }; _yAxis = new AxisData(concDimension, concDimension.DefaultUnit, Scalings.Linear) { Caption = "Y" }; _chartData = new ChartData <TimeProfileXValue, TimeProfileYValue>(_xAxis, null, null, null); var pane1 = new PaneData <TimeProfileXValue, TimeProfileYValue>(_yAxis) { Caption = "Male" }; var pane2 = new PaneData <TimeProfileXValue, TimeProfileYValue>(_yAxis) { Caption = "Female" }; _chartData.AddPane(pane1); _chartData.AddPane(pane2); var curve1 = new CurveData <TimeProfileXValue, TimeProfileYValue> { Caption = "Liver" }; curve1.Add(new TimeProfileXValue(1), new TimeProfileYValue { Y = 10 }); curve1.Add(new TimeProfileXValue(2), new TimeProfileYValue { LowerValue = 20, UpperValue = 30 }); pane1.AddCurve(curve1); var curve2 = new CurveData <TimeProfileXValue, TimeProfileYValue> { Caption = "Kidney" }; curve2.Add(new TimeProfileXValue(3), new TimeProfileYValue { Y = 40 }); pane2.AddCurve(curve2); _observedData = DomainHelperForSpecs.ObservedData(); var displayPathMapper = A.Fake <IQuantityPathToQuantityDisplayPathMapper>(); var dimensionRepository = A.Fake <IDimensionRepository>(); var observedDataMapper = new DataRepositoryToObservedCurveDataMapper(displayPathMapper, dimensionRepository); var obserevdDataCurves = observedDataMapper.MapFrom(_observedData, new ObservedDataCollection(), concDimension); obserevdDataCurves.Each(pane1.AddObservedCurve); observedDataMapper.MapFrom(_observedData, new ObservedDataCollection(), concDimension).Each(curve => { curve.Visible = false; pane1.AddObservedCurve(curve); }); }
protected override void Context() { base.Context(); _paneData1 = Helper.CreateBoxWhiskerPaneData11(sut); _paneData2 = Helper.CreateBoxWhiskerPaneData12(sut); sut.AddPane(_paneData2); sut.AddPane(_paneData1); }
protected override void Context() { base.Context(); _chartData = new ChartData <BoxWhiskerXValue, BoxWhiskerYValue>(null, ChartDataHelperForSpecs.FieldValueComparersR1(), Helper.XValueNames, Helper.XValueComparer()); _paneData1 = Helper.CreateBoxWhiskerPaneData11(_chartData); _paneData2 = Helper.CreateBoxWhiskerPaneData12(_chartData); _chartData.AddPane(_paneData2); _chartData.AddPane(_paneData1); }
///<summary> /// Sets DockStyle.Fill for the last visible pane and DockStyle.Top /// for the remaining ones. Also updates splitter visibility. ///</summary> private void AdjustDockAndSplitters(PaneData toggledPane, bool toggledPaneState) { bool lastPane = true; int visiblePanes = 0; for (int i = PanesCount - 1; i >= 0; i--) { ToolStripButton btn = (ToolStripButton)_paneButtons.Items[i]; PaneData paneData = (PaneData)btn.Tag; // don't check Visible because it will return false if the sidebar // as a whole is hidden bool visible = btn.Checked; if (paneData == toggledPane) { visible = toggledPaneState; } if (visible) { visiblePanes++; paneData.PaneBackground.Dock = lastPane ? DockStyle.Fill : DockStyle.Top; paneData.PaneSplitter.Visible = !lastPane; lastPane = false; } else { paneData.PaneSplitter.Visible = false; } int paneIndex = PanesCount - 1 - i; _contentPane.Controls.SetChildIndex(paneData.PaneSplitter, paneIndex * 3); _contentPane.Controls.SetChildIndex(paneData.PaneBackground, paneIndex * 3 + 1); _contentPane.Controls.SetChildIndex(paneData.PaneCaption, paneIndex * 3 + 2); } if (visiblePanes > 0) { for (int i = 0; i < PanesCount; i++) { ToolStripButton btn = (ToolStripButton)_paneButtons.Items[i]; PaneData paneData = (PaneData)btn.Tag; bool visible = btn.Checked; // if ( paneData == toggledPane ) // visible = toggledPaneState; if (visible) { PaneCaptionButtons buttons = (visiblePanes > 1) ? PaneCaptionButtons.Minimize : PaneCaptionButtons.None; paneData.PaneCaption.CaptionButtons = buttons; } } } // _paneButtons.Visible = ( _paneButtons.Items.Count > 1 ); }
private void CheckPopulatePane(PaneData paneData) { if (!_populatedPanes.Contains(paneData.PaneId)) { _populatedPanes.Add(paneData.PaneId); paneData.Pane.Populate(); paneData.Pane.SetActiveWorkspace(Core.WorkspaceManager.ActiveWorkspace); } }
public void RegisterPane(AbstractViewPane pane, string id, string caption, Image icon) { PaneCaption paneCaption = new PaneCaption(); paneCaption.Text = caption; paneCaption.Dock = DockStyle.Top; paneCaption.CaptionButtons = PaneCaptionButtons.Minimize; paneCaption.Click += OnPaneCaptionClick; paneCaption.MinimizeClick += OnPaneMinimize; paneCaption.ColorScheme = _colorScheme; _contentPane.Controls.Add(paneCaption); _contentPane.Controls.SetChildIndex(paneCaption, 0); int paneHeight = pane.Height; SidebarPaneBackground background = new SidebarPaneBackground(); background.SetContents(pane); background.ColorScheme = _colorScheme; background.Dock = DockStyle.Top; background.Visible = false; background.Height = 0; _contentPane.Controls.Add(background); _contentPane.Controls.SetChildIndex(background, 0); pane.ShowSelection = false; pane.Enter += OnPaneEnter; pane.Leave += OnPaneLeave; Splitter paneSplitter = new Splitter(); paneSplitter.Dock = DockStyle.Top; paneSplitter.Height = 3; _contentPane.Controls.Add(paneSplitter); _contentPane.Controls.SetChildIndex(paneSplitter, 0); PaneData paneData = new PaneData(id, background, pane, paneCaption, paneSplitter, paneHeight); paneCaption.Tag = paneData; IColorSchemeable schemeable = pane as IColorSchemeable; if (schemeable != null) { schemeable.ColorScheme = _colorScheme; } ToolStripButton button = _paneButtons.AddButton(paneData, icon, caption); button.CheckedChanged += OnToolbarButtonClicked; AdjustDockAndSplitters(null, false); if (PaneAdded != null) { PaneAdded(this, EventArgs.Empty); } }
protected override void Context() { base.Context(); var timeDimension = DomainHelperForSpecs.TimeDimensionForSpecs(); var concDimension = DomainHelperForSpecs.ConcentrationDimensionForSpecs(); _xAxis = new AxisData(timeDimension, timeDimension.DefaultUnit, Scalings.Linear) { Caption = "X" }; _yAxis = new AxisData(concDimension, concDimension.DefaultUnit, Scalings.Linear) { Caption = "Y" }; _chartData = new ChartData <RangeXValue, RangeYValue>(_xAxis, null); var pane1 = new PaneData <RangeXValue, RangeYValue>(_yAxis) { Caption = "Male" }; var pane2 = new PaneData <RangeXValue, RangeYValue>(_yAxis) { Caption = "Female" }; _chartData.AddPane(pane1); _chartData.AddPane(pane2); var curve1 = new CurveData <RangeXValue, RangeYValue> { Caption = "Liver" }; curve1.Add(new RangeXValue(1) { Minimum = 0, Maximum = 1.5f, NumberOfItems = 5 }, new RangeYValue { LowerPercentile = 10, Median = 20, UpperPercentile = 30 }); curve1.Add(new RangeXValue(2) { Minimum = 1.8f, Maximum = 2.5f, NumberOfItems = 10 }, new RangeYValue { LowerPercentile = 20, Median = 30, UpperPercentile = 40 }); pane1.AddCurve(curve1); var curve2 = new CurveData <RangeXValue, RangeYValue> { Caption = "Kidney" }; curve2.Add(new RangeXValue(3) { Minimum = 2f, Maximum = 4f, NumberOfItems = 15 }, new RangeYValue { LowerPercentile = 30, Median = 40, UpperPercentile = 50 }); pane2.AddCurve(curve2); }
protected void AddCurveToTable <TX, TY>(DataTable dataTable, PaneData <TXValue, TYValue> pane, CurveData <TX, TY> curve, bool exportForPivot, Func <DataRow, CurveData <TX, TY>, bool, IEnumerable <DataRow> > specificValueRetriever) where TX : IXValue where TY : IYValue { var row = dataTable.NewRow(); row[PANE_CAPTION] = pane.Caption; row[CURVE_CAPTION] = curve.Caption; specificValueRetriever(row, curve, exportForPivot).Each(dataTable.Rows.Add); }
private bool showInLegend(PaneData <BoxWhiskerXValue, BoxWhiskerYValue> pane, CurveData <BoxWhiskerXValue, BoxWhiskerYValue> curve, List <string> legendEntries) { var legendEntry = GetLegendEntry(curve); if (!legendEntries.Contains(legendEntry)) { legendEntries.Add(legendEntry); return(true); } return(false); }
private void SetActivePane(Control senderCtl) { PaneData paneData = DataForPane(senderCtl); if (_lastActivePaneData != null) { _lastActivePaneData.Pane.ShowSelection = false; } _lastActivePaneData = paneData; _lastActivePaneData.Pane.ShowSelection = true; }
private PaneData DataForPane(Control pane) { foreach (ToolStripButton btn in _paneButtons.Items) { PaneData data = (PaneData)btn.Tag; if (data.Pane == pane) { return(data); } } throw new Exception("Could not find PaneData for pane " + pane); }
/// <summary> /// Tries to select the resource in any of the sidebar panes. /// </summary> /// <param name="res"></param> public void ForceSelectResource(IResource res) { foreach (ToolStripButton btn in _paneButtons.Items) { PaneData paneData = (PaneData)btn.Tag; CheckPopulatePane(paneData); if (paneData.Pane.SelectResource(res, false)) { ActivatePane(paneData.PaneId); break; } } }
public void UpdateActiveWorkspace() { IResource workspace = Core.WorkspaceManager.ActiveWorkspace; foreach (ToolStripButton btn in _paneButtons.Items) { PaneData paneData = (PaneData)btn.Tag; if (_populatedPanes.Contains(paneData.PaneId)) { paneData.Pane.SetActiveWorkspace(workspace); } } }
protected override void Context() { _chartData = ChartDataHelperForSpecs.CreateBoxWhiskerChartData(); var name = "TMax"; _axisData = ChartDataHelperForSpecs.CreateAxisData(name); sut = new PaneData <BoxWhiskerXValue, BoxWhiskerYValue>(_axisData, new Dictionary <string, string> { { name, name } }, ChartDataHelperForSpecs.FieldValueComparersR1()); sut.Caption = name; sut.Id = name; sut.Chart = _chartData; }
public static PaneData <BoxWhiskerXValue, BoxWhiskerYValue> CreateBoxWhiskerPaneData11(ChartData <BoxWhiskerXValue, BoxWhiskerYValue> chartData) { var name = "AUC"; var pane11Data = new PaneData <BoxWhiskerXValue, BoxWhiskerYValue>(CreateAxisData(name), new Dictionary <string, string> { { name, name } }, FieldValueComparersR1()); pane11Data.WithId(name); pane11Data.Caption = name; pane11Data.AddCurve(CreateBoxWhiskerCurveData112(pane11Data)); pane11Data.AddCurve(CreateBoxWhiskerCurveData111(pane11Data)); return(pane11Data); }
private IEnumerable <Series> addCurveAsSeries <TCurve>(PaneData <TX, TY> paneData, XYDiagram diagram, Func <PaneData <TX, TY>, IEnumerable <TCurve> > curveRetrieverFunc, Func <TCurve, IReadOnlyList <Series> > seriesMapFunc) { var allSeriesList = new List <Series>(); foreach (var curveData in curveRetrieverFunc(paneData)) { var curveSeriesList = seriesMapFunc(curveData).Where(s => s != null).ToList(); AssignCurveSeriesList(curveSeriesList, diagram.Panes.GetPaneByName(paneData.Id), diagram.SecondaryAxesY.GetAxisByName(paneData.Id)); allSeriesList.AddRange(curveSeriesList); } return(allSeriesList); }
protected override void Context() { var chartData = ChartDataHelperForSpecs.CreateBoxWhiskerChartData(); _paneData = ChartDataHelperForSpecs.CreateBoxWhiskerPaneData11(chartData); var name = "Male"; sut = new CurveData <BoxWhiskerXValue, BoxWhiskerYValue>(new Dictionary <string, string> { { name, name } }); sut.Id = name; sut.Caption = name; sut.Pane = _paneData; }
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); }
///<summary> /// Updates the heights of panes so that all visible panes get their share of height. ///</summary> private void UpdatePaneSizes(int minHeight) { int totalNeedHeight = 0; for (int i = 0; i < PanesCount; i++) { ToolStripButton btn = (ToolStripButton)_paneButtons.Items[i]; PaneData paneData = (PaneData)btn.Tag; if (btn.Checked) { int needHeight = minHeight - paneData.PaneBackground.Height; if (needHeight > 0) { totalNeedHeight += needHeight; } } } if (totalNeedHeight > 0) { int totalAvailHeight = 0; for (int i = 0; i < PanesCount; i++) { PaneData paneData = DataAt(i); if (paneData.PaneBackground.Height > minHeight) { int availHeight = paneData.PaneBackground.Height - minHeight; if (availHeight > totalNeedHeight) { availHeight = totalNeedHeight; } paneData.PaneBackground.Height = paneData.PaneBackground.Height - availHeight; totalAvailHeight += availHeight; } else if (paneData.PaneBackground.Height < minHeight) { int needHeight = minHeight - paneData.PaneBackground.Height; if (needHeight < totalAvailHeight) { needHeight = totalAvailHeight; } paneData.PaneBackground.Height = paneData.PaneBackground.Height + needHeight; totalNeedHeight -= needHeight; totalAvailHeight -= needHeight; } } } }
public void PopulateViewPanes() { foreach (ToolStripButton btn in _paneButtons.Items) { if (btn.Checked) { PaneData paneData = (PaneData)btn.Tag; if (!_populatedPanes.Contains(paneData.PaneId)) { _populatedPanes.Add(paneData.PaneId); paneData.Pane.Populate(); } } } _paneButtons.CheckButtonsState(); }
public static PaneData <BoxWhiskerXValue, BoxWhiskerYValue> CreateBoxWhiskerPaneData12(ChartData <BoxWhiskerXValue, BoxWhiskerYValue> chartData) { var name = "Cmax"; var pane12Data = new PaneData <BoxWhiskerXValue, BoxWhiskerYValue>(new AxisData(DimensionTest2, UnitTest2000, Scalings.Log) { Caption = name }, new Dictionary <string, string> { { name, name } }, FieldValueComparersR1()); pane12Data.WithId(name); pane12Data.Caption = name; pane12Data.AddCurve(CreateBoxWhiskerCurveData121(pane12Data)); return(pane12Data); }
protected override void Context() { base.Context(); var timeDimension = DomainHelperForSpecs.TimeDimensionForSpecs(); var concDimension = DomainHelperForSpecs.ConcentrationDimensionForSpecs(); _xAxis = new AxisData(timeDimension, timeDimension.DefaultUnit, Scalings.Linear) { Caption = "X" }; _yAxis = new AxisData(concDimension, concDimension.DefaultUnit, Scalings.Linear) { Caption = "Y" }; _chartData = new ChartData <TimeProfileXValue, TimeProfileYValue>(_xAxis, null, null, null); var pane1 = new PaneData <TimeProfileXValue, TimeProfileYValue>(_yAxis) { Caption = "Male" }; var pane2 = new PaneData <TimeProfileXValue, TimeProfileYValue>(_yAxis) { Caption = "Female" }; _chartData.AddPane(pane1); _chartData.AddPane(pane2); var curve1 = new CurveData <TimeProfileXValue, TimeProfileYValue> { Caption = "Liver" }; curve1.Add(new TimeProfileXValue(1), new TimeProfileYValue { Y = 10 }); curve1.Add(new TimeProfileXValue(2), new TimeProfileYValue { LowerValue = 20, UpperValue = 30 }); pane1.AddCurve(curve1); var curve2 = new CurveData <TimeProfileXValue, TimeProfileYValue> { Caption = "Kidney" }; curve2.Add(new TimeProfileXValue(3), new TimeProfileYValue { Y = 40 }); pane2.AddCurve(curve2); }
protected AxisOptions GetAxisOptionsForPlot(PaneData <TXValue, TYValue> plot, List <AxisOptions.GroupLine> groupLines = null) { var axisOptions = new AxisOptions(DefaultConverter.Instance) { Title = plot.Caption, YLabel = plot.Axis.Caption, BackgroundColor = _diagramBackColor.Name, YMode = plot.Axis.Scaling == Scalings.Log ? AxisOptions.AxisMode.log : AxisOptions.AxisMode.normal, XMode = plot.ChartAxis.Scaling == Scalings.Log ? AxisOptions.AxisMode.log : AxisOptions.AxisMode.normal, }; if (groupLines != null) { axisOptions.GroupLines = groupLines; } return(axisOptions); }
private void connectCurvesDefinedIn(PaneData <RangeXValue, RangeYValue> panes) { var orderedCurveByXvalue = panes.Curves.Where(x => x.XValues.Any()) .OrderBy(x => x.XValues[0]).ToList(); //Some curves are invalid, we do not try to connect anything in that case if (orderedCurveByXvalue.Count != panes.Curves.Count) { return; } for (int i = 1; i < orderedCurveByXvalue.Count; i++) { var firstCurve = orderedCurveByXvalue[i - 1]; var secondCurve = orderedCurveByXvalue[i]; firstCurve.Add(secondCurve.XValues[0], secondCurve.YValues[0]); } }
private CurveData <TX, TY> getOrCreateCurve(PaneData <TX, TY> pane, IReadOnlyDictionary <string, string> seriesFieldValues) { string curveCaption = captionFor(seriesFieldValues.Values); string curveId = idFromCaption(curveCaption); var series = pane.Curves[curveId]; if (series != null) { return(series); } // add new curve series = new CurveData <TX, TY>(seriesFieldValues) { Id = curveId, Caption = curveCaption, }; pane.AddCurve(series); return(series); }
private PaneData <TX, TY> getOrCreatePane(ChartData <TX, TY> chart, IReadOnlyDictionary <string, string> paneFieldValues, IReadOnlyList <IComparer <object> > curveFieldValueComparers, INumericValueField axisField) { string paneCaption = captionFor(paneFieldValues.Values); string paneId = idFromCaption(paneCaption); // Id cannot be empty string var pane = chart.Panes.FindById(paneId); if (pane != null) { return(pane); } // add new pane pane = new PaneData <TX, TY>(CreateAxisDataFor(axisField), paneFieldValues, curveFieldValueComparers) { Id = paneId, Caption = paneCaption }; chart.AddPane(pane); return(pane); }
protected override void Context() { base.Context(); var dim = DomainHelperForSpecs.LengthDimensionForSpecs(); _populationDataCollector = A.Fake <IPopulationDataCollector>(); _chartData = new ChartData <TimeProfileXValue, TimeProfileYValue>(new AxisData(dim, dim.DefaultUnit, Scalings.Linear), null); var pane = new PaneData <TimeProfileXValue, TimeProfileYValue>(new AxisData(dim, dim.DefaultUnit, Scalings.Linear)); _chartData.AddPane(pane); var curve = new CurveData <TimeProfileXValue, TimeProfileYValue>() { Pane = pane, QuantityPath = "PATH", }; pane.AddCurve(curve); A.CallTo(() => _pkMapper.MapFrom(A <DataColumn> ._, A <PKValues> ._, A <PKParameterMode> ._, A <string> ._)) .Invokes(x => _dataColumn = x.GetArgument <DataColumn>(0)); }
protected override void Context() { base.Context(); var dim = DomainHelperForSpecs.ConcentrationDimensionForSpecs(); _populationDataCollector = A.Fake <IPopulationDataCollector>(); _chartData = new ChartData <TimeProfileXValue, TimeProfileYValue>(new AxisData(dim, dim.DefaultUnit, Scalings.Linear), null); var pane = new PaneData <TimeProfileXValue, TimeProfileYValue>(new AxisData(dim, dim.DefaultUnit, Scalings.Linear)); _chartData.AddPane(pane); var curve = new CurveData <TimeProfileXValue, TimeProfileYValue>() { Pane = pane, QuantityPath = "PATH", }; curve.Add(new TimeProfileXValue(1), new TimeProfileYValue { Y = 10 }); curve.Add(new TimeProfileXValue(2), new TimeProfileYValue { Y = 20 }); pane.AddCurve(curve); var rangeCurve = new CurveData <TimeProfileXValue, TimeProfileYValue>() { Pane = pane, QuantityPath = "RANGE_PATH", }; rangeCurve.Add(new TimeProfileXValue(1), new TimeProfileYValue { Y = 10, LowerValue = 1, UpperValue = 2 }); pane.AddCurve(rangeCurve); A.CallTo(() => _populationDataCollector.MolWeightFor("PATH")).Returns(100); A.CallTo(() => _pkMapper.MapFrom(A <DataColumn> ._, A <PKValues> ._, A <PKParameterMode> ._, A <string> ._)) .Invokes(x => _dataColumn = x.GetArgument <DataColumn>(0)); }
protected override void Context() { _exportTask = A.Fake <IPKAnalysisExportTask>(); _pkAnalysesTask = A.Fake <IPKAnalysesTask>(); _view = A.Fake <IPopulationPKAnalysisView>(); _populationPKAnalysisToDTOMapper = A.Fake <IPopulationPKAnalysisToPKAnalysisDTOMapper>(); _populationPKAnalysisToDataTableMapper = A.Fake <IPopulationPKAnalysisToDataTableMapper>(); _pkParameterRepository = A.Fake <IPKParameterRepository>(); _presenterSettingsTask = A.Fake <IPresentationSettingsTask>(); sut = new PopulationPKAnalysisPresenter(_view, _pkAnalysesTask, _exportTask, _populationPKAnalysisToDTOMapper, _pkParameterRepository, _presenterSettingsTask); _populationDataCollector = A.Fake <IPopulationDataCollector>(); _timeProfileChartData = new ChartData <TimeProfileXValue, TimeProfileYValue>(null, null); var pane = new PaneData <TimeProfileXValue, TimeProfileYValue>(null) { Caption = "TOTO" }; _curve1 = new TimeProfileCurveData { Caption = "A", Pane = pane }; _curve2 = new TimeProfileCurveData { Caption = "B", Pane = pane }; _pk1 = new PKAnalysis(); _pk2 = new PKAnalysis(); _allPKanalysis = new List <PopulationPKAnalysis> { new PopulationPKAnalysis(_curve1, _pk1), new PopulationPKAnalysis(_curve2, _pk2), }; A.CallTo(() => _pkAnalysesTask.CalculateFor(_populationDataCollector, _timeProfileChartData)).Returns(_allPKanalysis); A.CallTo(() => _view.BindTo(A <PKAnalysisDTO> ._)).Invokes(x => _dataTable = x.GetArgument <PKAnalysisDTO>(0).DataTable); A.CallTo(() => _populationPKAnalysisToDataTableMapper.MapFrom(A <IReadOnlyList <PopulationPKAnalysis> > ._, true)).Returns(_dataTable); }