protected override void Context()
        {
            _sensitivityAnalysisParametersView = A.Fake <ISensitivityAnalysisParametersView>();
            _sensitivityParameterFactory       = A.Fake <ISensitivityParameterFactory>();
            _sensitivityParameterToSensitivityParameterDTOMapper = A.Fake <ISensitivityParameterToSensitivityParameterDTOMapper>();
            _sensitivityAnalysisSetNMaxPresenter  = A.Fake <ISensitivityAnalysisSetValuePresenter>();
            _sensitivityAnalysisSetRangePresenter = A.Fake <ISensitivityAnalysisSetValuePresenter>();
            _sensitivityAnalysisTask = A.Fake <ISensitivityAnalysisTask>();

            sut = new SensitivityAnalysisParametersPresenter(_sensitivityAnalysisParametersView, _sensitivityParameterFactory,
                                                             _sensitivityParameterToSensitivityParameterDTOMapper, _sensitivityAnalysisSetNMaxPresenter,
                                                             _sensitivityAnalysisSetRangePresenter, _sensitivityAnalysisTask);
            _sensitivityAnalysis = new SensitivityAnalysis();

            _parameterDTO = A.Fake <IParameterDTO>();
            A.CallTo(() => _parameterDTO.Value).Returns(4.0);
            _selectedSensitivityParameter   = A.Fake <SensitivityParameter>();
            _unSelectedSensitivityParameter = A.Fake <SensitivityParameter>();
            _sensitivityAnalysis.AddSensitivityParameter(_selectedSensitivityParameter);
            _sensitivityAnalysis.AddSensitivityParameter(_unSelectedSensitivityParameter);
            A.CallTo(() => _selectedSensitivityParameter.NumberOfStepsParameter).Returns(new Parameter());
            A.CallTo(() => _selectedSensitivityParameter.VariationRangeParameter).Returns(new Parameter());
            A.CallTo(() => _unSelectedSensitivityParameter.NumberOfStepsParameter).Returns(new Parameter());
            A.CallTo(() => _unSelectedSensitivityParameter.VariationRangeParameter).Returns(new Parameter());
            _sensitivityParameterDTO = new SensitivityParameterDTO(_selectedSensitivityParameter);
            A.CallTo(() => _sensitivityAnalysisParametersView.SelectedParameters()).Returns(new[] { _sensitivityParameterDTO });

            A.CallTo(() => _sensitivityParameterToSensitivityParameterDTOMapper.MapFrom(_selectedSensitivityParameter)).Returns(_sensitivityParameterDTO);
            A.CallTo(() => _sensitivityParameterToSensitivityParameterDTOMapper.MapFrom(_unSelectedSensitivityParameter)).Returns(new SensitivityParameterDTO(_unSelectedSensitivityParameter));
        }
        private void configureSetValuePresenters(ISensitivityAnalysisSetValuePresenter sensitivityAnalysisSetNMaxPresenter, ISensitivityAnalysisSetValuePresenter sensitivityAnalysisSetRangePresenter)
        {
            sensitivityAnalysisSetNMaxPresenter.ApplyAll       = applyValueToAllNMax;
            sensitivityAnalysisSetNMaxPresenter.ApplySelection = applyValueToSelectedNMax;
            sensitivityAnalysisSetNMaxPresenter.ConfigureForUInt();

            sensitivityAnalysisSetRangePresenter.ApplyAll       = applyValueToAllRange;
            sensitivityAnalysisSetRangePresenter.ApplySelection = applyValueToSelectedRange;
        }
        public SensitivityAnalysisParametersPresenter(
            ISensitivityAnalysisParametersView view,
            ISensitivityParameterFactory sensitivityParameterFactory,
            ISensitivityParameterToSensitivityParameterDTOMapper sensitivityParameterDTOMapper,
            ISensitivityAnalysisSetValuePresenter sensitivityAnalysisSetNMaxPresenter,
            ISensitivityAnalysisSetValuePresenter sensitivityAnalysisSetRangePresenter,
            ISensitivityAnalysisTask sensitivityAnalysisTask
            ) : base(view)
        {
            _sensitivityParameterFactory   = sensitivityParameterFactory;
            _sensitivityParameterDTOMapper = sensitivityParameterDTOMapper;

            _sensitivityAnalysisSetRangePresenter = sensitivityAnalysisSetRangePresenter;
            _sensitivityAnalysisTask             = sensitivityAnalysisTask;
            _sensitivityAnalysisSetNMaxPresenter = sensitivityAnalysisSetNMaxPresenter;

            _subPresenterManager.Add(sensitivityAnalysisSetNMaxPresenter);
            _subPresenterManager.Add(sensitivityAnalysisSetRangePresenter);

            _view.SetNMaxView(sensitivityAnalysisSetNMaxPresenter.BaseView);
            _view.SetRangeView(sensitivityAnalysisSetRangePresenter.BaseView);

            configureSetValuePresenters(sensitivityAnalysisSetNMaxPresenter, sensitivityAnalysisSetRangePresenter);
        }
 public void AttachPresenter(ISensitivityAnalysisSetValuePresenter presenter)
 {
     _presenter = presenter;
 }