protected override void Context() { _globalPKAnalysisPresenter = A.Fake <IGlobalPKAnalysisPresenter>(); _concentrationDim = A.Fake <IDimension>(); _timeDim = A.Fake <IDimension>(); _view = A.Fake <IIndividualPKAnalysisView>(); _pkaAnalysisTask = A.Fake <IPKAnalysisTask>(); _simulation = A.Fake <IndividualSimulation>(); _simulations = new List <Simulation>(); _simulations.Add(_simulation); _exportTask = A.Fake <IPKAnalysisExportTask>(); _individualPKAnalysisToDTOMapper = A.Fake <IIndividualPKAnalysisToPKAnalysisDTOMapper>(); _pkParameterRepository = A.Fake <IPKParameterRepository>(); ; var dataRepository = new DataRepository(); _baseGrid = new BaseGrid("Base", _timeDim); _col1 = new DataColumn { DataInfo = new DataInfo(ColumnOrigins.Calculation, AuxiliaryType.Undefined, "mg", DateTime.Now, string.Empty, string.Empty, 5), Dimension = _concentrationDim }; _col2 = new DataColumn { Dimension = _concentrationDim, DataInfo = new DataInfo(ColumnOrigins.Calculation, AuxiliaryType.Undefined, "mg", DateTime.Now, string.Empty, string.Empty, 5) }; _col3 = new DataColumn { Dimension = _concentrationDim, DataInfo = new DataInfo(ColumnOrigins.Calculation, AuxiliaryType.Undefined, "mg", DateTime.Now, string.Empty, string.Empty, 5) }; dataRepository.Add(_col1); dataRepository.Add(_col2); _simulation.DataRepository = dataRepository; var curve1 = A.Fake <Curve>(); A.CallTo(() => curve1.yData).Returns(_col1); A.CallTo(() => curve1.xData).Returns(_baseGrid); var curve2 = A.Fake <Curve>(); A.CallTo(() => curve2.yData).Returns(_col2); A.CallTo(() => curve2.xData).Returns(_baseGrid); var curve3 = A.Fake <Curve>(); A.CallTo(() => curve3.yData).Returns(_col3); A.CallTo(() => curve3.xData).Returns(_col1); _curves = new List <Curve> { curve1, curve2, curve3 }; _allPKAnalysis = new List <Tuple <DataColumn, PKAnalysis> >(); _pkAnalysis1 = createPKAnalysis(); _pkAnalysis2 = createPKAnalysis(); _allPKAnalysis.Add(new Tuple <DataColumn, PKAnalysis>(_col1, _pkAnalysis1)); _allPKAnalysis.Add(new Tuple <DataColumn, PKAnalysis>(_col2, _pkAnalysis2)); _allGlobalPKParameters = new List <IParameter>(); A.CallTo(_pkaAnalysisTask).WithReturnType <IEnumerable <Tuple <DataColumn, PKAnalysis> > >().Returns(_allPKAnalysis); A.CallTo(_pkaAnalysisTask).WithReturnType <IEnumerable <IParameter> >().Returns(_allGlobalPKParameters); _presenterSettingsTask = A.Fake <IPresentationSettingsTask>(); sut = new IndividualPKAnalysisPresenter(_view, _pkaAnalysisTask, _exportTask, _globalPKAnalysisPresenter, _individualPKAnalysisToDTOMapper, _pkParameterRepository, _presenterSettingsTask); }
public IndividualPKAnalysisPresenter(IIndividualPKAnalysisView view, IPKAnalysisTask pkAnalysisTask, IPKAnalysisExportTask exportTask, IGlobalPKAnalysisPresenter globalPKAnalysisPresenter, IIndividualPKAnalysisToPKAnalysisDTOMapper pKAnalysisToDTOMapper, IPKParameterRepository pkParameterRepository, IPresentationSettingsTask presentationSettingsTask) : base(view, pkParameterRepository, presentationSettingsTask) { _pkAnalysisTask = pkAnalysisTask; _globalPKAnalysisPresenter = globalPKAnalysisPresenter; _exportTask = exportTask; _view.ShowControls = false; _curveCache = new Cache <DataColumn, Curve>(onMissingKey: x => null); AddSubPresenters(_globalPKAnalysisPresenter); _view.AddGlobalPKAnalysisView(_globalPKAnalysisPresenter.View); _pKAnalysisToDTOMapper = pKAnalysisToDTOMapper; }
public void AttachPresenter(IGlobalPKAnalysisPresenter presenter) { _presenter = presenter; _columUnitsMenuBinder.BindTo(presenter); }