Exemplo n.º 1
0
        protected override void Context()
        {
            _view = A.Fake <ISimulationTimeProfileChartView>();
            _chartDisplayPresenter          = A.Fake <IChartDisplayPresenter>();
            _pkAnalysisPresenter            = A.Fake <IIndividualPKAnalysisPresenter>();
            _chartEditorPresenter           = A.Fake <IChartEditorPresenter>();
            _chartEditorAndDisplayPresenter = A.Fake <IChartEditorAndDisplayPresenter>();
            _dataColumnToPathElementsMapper = A.Fake <IDataColumnToPathElementsMapper>();
            _chartTask                = A.Fake <IChartTask>();
            _dimensionFactory         = A.Fake <IDimensionFactory>();
            _observedDataTask         = A.Fake <IObservedDataTask>();
            _chartLayoutTask          = A.Fake <IChartEditorLayoutTask>();
            _chartUpdateTask          = A.Fake <IChartUpdater>();
            _presentationSettingsTask = A.Fake <IPresentationSettingsTask>();
            _allTemplates             = new List <ChartEditorLayoutTemplate>();
            A.CallTo(() => _chartLayoutTask.AllTemplates()).Returns(_allTemplates);
            A.CallTo(() => _chartEditorAndDisplayPresenter.EditorPresenter).Returns(_chartEditorPresenter);
            A.CallTo(() => _chartEditorAndDisplayPresenter.DisplayPresenter).Returns(_chartDisplayPresenter);
            A.CallTo(() => _chartEditorPresenter.ColumnSettingsFor(A <BrowserColumns> ._)).Returns(new GridColumnSettings(BrowserColumns.Origin.ToString()));
            A.CallTo(() => _chartEditorPresenter.ColumnSettingsFor(A <AxisOptionsColumns> ._)).Returns(new GridColumnSettings(AxisOptionsColumns.AxisType.ToString()));
            A.CallTo(() => _chartEditorPresenter.ColumnSettingsFor(A <CurveOptionsColumns> ._)).Returns(new GridColumnSettings(CurveOptionsColumns.xData.ToString()));
            _chartTemplatingTask   = A.Fake <IChartTemplatingTask>();
            _projectRetriever      = A.Fake <IProjectRetriever>();
            _chartPresenterContext = new ChartPresenterContext(_chartEditorAndDisplayPresenter, _curveNamer, _dataColumnToPathElementsMapper, _chartTemplatingTask, _presentationSettingsTask, _chartLayoutTask, _projectRetriever, _dimensionFactory);
            _curveNamer            = A.Fake <ICurveNamer>();

            sut = new SimulationTimeProfileChartPresenter(_view, _chartPresenterContext, _pkAnalysisPresenter, _chartTask, _observedDataTask, _chartTemplatingTask, _chartUpdateTask);
        }
        protected override void Context()
        {
            _view = A.Fake <ISimulationTimeProfileChartView>();
            _chartDisplayPresenter          = A.Fake <IChartDisplayPresenter>();
            _pkAnalysisPresenter            = A.Fake <IIndividualPKAnalysisPresenter>();
            _chartEditorPresenter           = A.Fake <IChartEditorPresenter>();
            _chartEditorAndDisplayPresenter = A.Fake <IChartEditorAndDisplayPresenter>();
            A.CallTo(() => _chartEditorAndDisplayPresenter.Control).Returns(new Control());
            _dataColumnToPathElementsMapper = A.Fake <IDataColumnToPathElementsMapper>();
            _quantityDisplayPathMapper      = A.Fake <IQuantityPathToQuantityDisplayPathMapper>();
            _chartTask        = A.Fake <IChartTask>();
            _observedDataTask = A.Fake <IObservedDataTask>();
            _chartLayoutTask  = A.Fake <IChartEditorLayoutTask>();
            _allTemplates     = new List <ChartEditorLayoutTemplate>();
            A.CallTo(() => _chartLayoutTask.AllTemplates()).Returns(_allTemplates);
            A.CallTo(() => _chartEditorAndDisplayPresenter.EditorPresenter).Returns(_chartEditorPresenter);
            A.CallTo(() => _chartEditorAndDisplayPresenter.DisplayPresenter).Returns(_chartDisplayPresenter);
            A.CallTo(() => _chartEditorPresenter.GetDataBrowserColumnSettings(A <BrowserColumns> .Ignored)).Returns(new GridColumnSettings(BrowserColumns.Origin.ToString()));
            A.CallTo(() => _chartEditorPresenter.GetAxisOptionsColumnSettings(A <AxisOptionsColumns> .Ignored)).Returns(new GridColumnSettings(AxisOptionsColumns.AxisType.ToString()));
            A.CallTo(() => _chartEditorPresenter.GetCurveOptionsColumnSettings(A <CurveOptionsColumns> .Ignored)).Returns(new GridColumnSettings(CurveOptionsColumns.xData.ToString()));
            _chartTemplatingTask   = A.Fake <IChartTemplatingTask>();
            _projectRetriever      = A.Fake <IProjectRetriever>();
            _userSettings          = A.Fake <IUserSettings>();
            _chartPresenterContext = A.Fake <ChartPresenterContext>();

            A.CallTo(() => _chartPresenterContext.ChartEditorAndDisplayPresenter).Returns(_chartEditorAndDisplayPresenter);
            A.CallTo(() => _chartPresenterContext.QuantityDisplayPathMapper).Returns(_quantityDisplayPathMapper);
            A.CallTo(() => _chartPresenterContext.EditorLayoutTask).Returns(_chartLayoutTask);
            A.CallTo(() => _chartPresenterContext.TemplatingTask).Returns(_chartTemplatingTask);
            A.CallTo(() => _chartPresenterContext.ProjectRetriever).Returns(_projectRetriever);

            sut = new SimulationTimeProfileChartPresenter(_view, _chartPresenterContext, _pkAnalysisPresenter, _chartTask, _observedDataTask, _chartTemplatingTask, _userSettings);
        }