Exemple #1
0
        protected override void Context()
        {
            _view                            = A.Fake <IEditTableFormulaWithOffsetFormulaView>();
            _mapper                          = A.Fake <ITableFormulaWithOffsetToTableFormulaWithOffsetDTOMapper>();
            _context                         = A.Fake <IMoBiContext>();
            _mobiFormulaTask                 = A.Fake <IMoBiFormulaTask>();
            _displayUnitRetriever            = A.Fake <IDisplayUnitRetriever>();
            _applicationController           = A.Fake <IApplicationController>();
            _selectReferencePresenterFactory = A.Fake <ISelectReferencePresenterFactory>();
            _timeDimension                   = DomainHelperForSpecs.TimeDimension;
            A.CallTo(() => _context.DimensionFactory.Dimension(Constants.Dimension.TIME)).Returns(_timeDimension);

            sut = new EditTableFormulaWithOffsetFormulaPresenter(_view, _mapper, _context, _mobiFormulaTask, _displayUnitRetriever, _applicationController, _selectReferencePresenterFactory);

            _commandCollector = A.Fake <ICommandCollector>();
            _buildingBlock    = A.Fake <IBuildingBlock>();

            sut.InitializeWith(_commandCollector);
            sut.BuildingBlock = _buildingBlock;
            _formula          = new TableFormulaWithOffset();
            _usingFormula     = new Parameter();
            _dto = new TableFormulaWithOffsetDTO();

            _selectFormulaUsablePathPresenter = A.Fake <ISelectFormulaUsablePathPresenter>();
            A.CallTo(() => _applicationController.Start <ISelectFormulaUsablePathPresenter>()).Returns(_selectFormulaUsablePathPresenter);

            _selectReferenceAtParameterPresenter = A.Fake <ISelectReferenceAtParameterPresenter>();
            A.CallTo(_selectReferencePresenterFactory).WithReturnType <ISelectReferenceAtParameterPresenter>().Returns(_selectReferenceAtParameterPresenter);

            A.CallTo(() => _selectFormulaUsablePathPresenter.Init(A <Func <IObjectBase, bool> > ._, _usingFormula, A <IEnumerable <IObjectBase> > ._, A <string> ._, _selectReferenceAtParameterPresenter))
            .Invokes(x => _predicate = x.GetArgument <Func <IObjectBase, bool> >(0));
        }
Exemple #2
0
 public EditParametersInContainerPresenter(IEditParametersInContainerView view,
                                           IFormulaToFormulaBuilderDTOMapper formulaMapper,
                                           IParameterToParameterDTOMapper parameterToDTOParameterMapper,
                                           IInteractionTasksForParameter parameterTask,
                                           IEditDistributedParameterPresenter editDistributedParameterPresenter,
                                           IEditParameterPresenter editParameterPresenter,
                                           IQuantityTask quantityTask,
                                           IInteractionTaskContext interactionTaskContext,
                                           IClipboardManager clipboardManager,
                                           IEditTaskFor <IParameter> editTask,
                                           ISelectReferencePresenterFactory selectReferencePresenterFactory,
                                           IFavoriteTask favoriteTask)
     : base(view, quantityTask, interactionTaskContext, formulaMapper, parameterTask, favoriteTask)
 {
     _clipboardManager = clipboardManager;
     _editTask         = editTask;
     _selectReferencePresenterFactory   = selectReferencePresenterFactory;
     _editDistributedParameterPresenter = editDistributedParameterPresenter;
     _editParameterPresenter            = editParameterPresenter;
     EditMode = EditParameterMode.All;
     _parameterToDTOParameterMapper     = parameterToDTOParameterMapper;
     _editParameterPresenter            = editParameterPresenter;
     _editDistributedParameterPresenter = editDistributedParameterPresenter;
     AddSubPresenters(_editDistributedParameterPresenter, _editParameterPresenter);
     _getParametersFunc        = x => x.GetChildrenSortedByName <IParameter>();
     ChangeLocalisationAllowed = true;
 }
Exemple #3
0
        protected override void Context()
        {
            _view                            = A.Fake <IEditTableFormulaWithXArgumentFormulaView>();
            _mapper                          = A.Fake <ITableFormulaWithXArgumentToTableFormulaWithXArgumentDTOMapper>();
            _formulaTask                     = A.Fake <IMoBiFormulaTask>();
            _displayUnitRetriever            = A.Fake <IDisplayUnitRetriever>();
            _applicationController           = A.Fake <IApplicationController>();
            _selectReferencePresenterFactory = A.Fake <ISelectReferencePresenterFactory>();
            _commandCollector                = A.Fake <ICommandCollector>();
            sut = new EditTableFormulaWithXArgumentFormulaPresenter(_view, _mapper, _formulaTask, _displayUnitRetriever, _applicationController, _selectReferencePresenterFactory);

            _tableFormulaWithXArgument = new TableFormulaWithXArgument();
            _parameter = new Parameter().WithName("Parameter");
            _container = new Container().WithName("Parent");
            _container.Add(_parameter);
            _referencePresenter = A.Fake <ISelectReferenceAtParameterPresenter>();
            _selectFormulaUsablePathPresenter = A.Fake <ISelectFormulaUsablePathPresenter>();
            _buildingBlock = A.Fake <IBuildingBlock>();

            A.CallTo(() => _selectReferencePresenterFactory.ReferenceAtParameterFor(_container)).Returns(_referencePresenter);
            A.CallTo(() => _applicationController.Start <ISelectFormulaUsablePathPresenter>()).Returns(_selectFormulaUsablePathPresenter);

            sut.BuildingBlock = _buildingBlock;
            sut.InitializeWith(_commandCollector);
        }
Exemple #4
0
 public EditTableFormulaWithXArgumentFormulaPresenter(
     IEditTableFormulaWithXArgumentFormulaView view,
     ITableFormulaWithXArgumentToTableFormulaWithXArgumentDTOMapper mapper,
     IMoBiFormulaTask moBiFormulaTask,
     IDisplayUnitRetriever displayUnitRetriever,
     IApplicationController applicationController,
     ISelectReferencePresenterFactory selectReferencePresenterFactory) : base(view, displayUnitRetriever)
 {
     _mapper                          = mapper;
     _moBiFormulaTask                 = moBiFormulaTask;
     _applicationController           = applicationController;
     _selectReferencePresenterFactory = selectReferencePresenterFactory;
 }
 public EditTableFormulaWithOffsetFormulaPresenter(
     IEditTableFormulaWithOffsetFormulaView view,
     ITableFormulaWithOffsetToTableFormulaWithOffsetDTOMapper mapper,
     IMoBiContext context,
     IMoBiFormulaTask moBiFormulaTask,
     IDisplayUnitRetriever displayUnitRetriever,
     IApplicationController applicationController,
     ISelectReferencePresenterFactory selectReferencePresenterFactory) : base(view, displayUnitRetriever)
 {
     _mapper                          = mapper;
     _moBiFormulaTask                 = moBiFormulaTask;
     _applicationController           = applicationController;
     _selectReferencePresenterFactory = selectReferencePresenterFactory;
     _timeDimension                   = context.DimensionFactory.Dimension(Constants.Dimension.TIME);
 }
 protected override void Context()
 {
     _view            = A.Fake <IEditParametersInContainerView>();
     _formulaMapper   = A.Fake <IFormulaToFormulaBuilderDTOMapper>();
     _parameterMapper = A.Fake <IParameterToParameterDTOMapper>();
     _inteactionTasks = A.Fake <IInteractionTasksForParameter>();
     _distributeParameterPresenter = A.Fake <IEditDistributedParameterPresenter>();
     _parameterPresenter           = A.Fake <IEditParameterPresenter>();
     _parameter                 = new Parameter().WithId("P").WithName("P");
     _parameter.Visible         = true;
     _advancedParameter         = new Parameter().WithId("AP").WithName("AP");
     _quantityTask              = A.Fake <IQuantityTask>();
     _clipboardManager          = A.Fake <IClipboardManager>();
     _advancedParameter.Visible = false;
     _interactionTaskContext    = A.Fake <IInteractionTaskContext>();
     _editTask = A.Fake <IEditTaskFor <IParameter> >();
     _selectReferencePresenterFactory = A.Fake <ISelectReferencePresenterFactory>();
     _favoriteTask = A.Fake <IFavoriteTask>();
     sut           = new EditParametersInContainerPresenter(_view, _formulaMapper, _parameterMapper, _inteactionTasks,
                                                            _distributeParameterPresenter, _parameterPresenter, _quantityTask, _interactionTaskContext, _clipboardManager, _editTask, _selectReferencePresenterFactory, _favoriteTask);
     sut.InitializeWith(A.Fake <ICommandCollector>());
 }
Exemple #7
0
 public EditTasksForParameter(IInteractionTaskContext interactionTaskContext, ISelectReferencePresenterFactory selectReferencePresenterFactory) : base(interactionTaskContext)
 {
     _selectReferencePresenterFactory = selectReferencePresenterFactory;
 }