Exemple #1
0
        protected override void Context()
        {
            _view = A.Fake <IConfigureSimulationView>();
            _subPresenterManager    = SubPresenterHelper.Create <ISimulationItemPresenter>();
            _simulationModelCreator = A.Fake <ISimulationModelCreator>();
            _heavyWorkManager       = new HeavyWorkManagerForSpecs();
            _cloner        = A.Fake <ICloner>();
            _dialogCreator = A.Fake <IDialogCreator>();
            _simulationParametersUpdater           = A.Fake <ISimulationParametersUpdater>();
            _fullPathDisplayResolver               = A.Fake <IFullPathDisplayResolver>();
            _buildingBlockInSimulationSynchronizer = A.Fake <IBuildingBlockInSimulationSynchronizer>();
            _validationResult = new ValidationResult();

            _simulationModelConfigurationPresenter = _subPresenterManager.CreateFake(SimulationItems.Model);
            _simulationCompoundsPresenter          = _subPresenterManager.CreateFake(SimulationItems.Compounds);
            _simulationCompoundProtocolsPresenter  = _subPresenterManager.CreateFake(SimulationItems.CompoundProtocols);
            _simulationCompoundProcessesPresenter  = _subPresenterManager.CreateFake(SimulationItems.CompoundsProcesses);
            _simulationEventsPresenter             = _subPresenterManager.CreateFake(SimulationItems.Events);

            sut = new ConfigureSimulationPresenter(_view, _subPresenterManager, _simulationModelCreator, _heavyWorkManager, _cloner, _dialogCreator, _simulationParametersUpdater, _fullPathDisplayResolver, _buildingBlockInSimulationSynchronizer);

            _originalSimulation = A.Fake <Simulation>();
            _clonedSimulation   = A.Fake <Simulation>();
            A.CallTo(() => _cloner.CloneForModel(_originalSimulation)).Returns(_clonedSimulation);
            A.CallTo(() => _simulationModelConfigurationPresenter.Simulation).Returns(_clonedSimulation);

            A.CallTo(_simulationParametersUpdater).WithReturnType <ValidationResult>().Returns(_validationResult);
        }
 protected ConfigureSimulationPresenterBase(TSimulationView view, ISubPresenterItemManager <ISimulationItemPresenter> subPresenterItemManager,
                                            ISimulationModelCreator simulationModelCreator, IHeavyWorkManager heavyWorkManager,
                                            ICloner cloner, IDialogCreator dialogCreator, ISimulationParametersUpdater simulationParametersUpdater, IFullPathDisplayResolver fullPathDisplayResolver, IBuildingBlockInSimulationSynchronizer buildingBlockInSimulationSynchronizer, CreationMode creationMode)
     : base(view, subPresenterItemManager, simulationModelCreator, heavyWorkManager, dialogCreator)
 {
     _cloner = cloner;
     _simulationParametersUpdater           = simulationParametersUpdater;
     _fullPathDisplayResolver               = fullPathDisplayResolver;
     _buildingBlockInSimulationSynchronizer = buildingBlockInSimulationSynchronizer;
     _creationMode    = creationMode;
     AllowQuickFinish = true;
 }
 public CloneSimulationPresenter(ICloneSimulationView view, ISubPresenterItemManager <ISimulationItemPresenter> subPresenterItemManager, ISimulationModelCreator simulationModelCreator,
                                 IHeavyWorkManager heavyWorkManager, ICloner cloner, IDialogCreator dialogCreator, IObjectBaseDTOFactory buildingBlockDTOFactory,
                                 IRenameBuildingBlockTask renameBuildingBlockTask, ISimulationParametersUpdater simulationParametersUpdater, IFullPathDisplayResolver fullPathDisplayResolver, IBuildingBlockInSimulationSynchronizer buildingBlockInSimulationSynchronizer)
     : base(view, subPresenterItemManager, simulationModelCreator, heavyWorkManager, cloner, dialogCreator, simulationParametersUpdater, fullPathDisplayResolver, buildingBlockInSimulationSynchronizer, CreationMode.Clone)
 {
     _buildingBlockDTOFactory = buildingBlockDTOFactory;
     _renameBuildingBlockTask = renameBuildingBlockTask;
 }
 public ConfigureSimulationPresenter(IConfigureSimulationView view, ISubPresenterItemManager <ISimulationItemPresenter> subPresenterItemManager, ISimulationModelCreator simulationModelCreator,
                                     IHeavyWorkManager heavyWorkManager, ICloner cloner, IDialogCreator dialogCreator, ISimulationParametersUpdater simulationParametersUpdater,
                                     IFullPathDisplayResolver fullPathDisplayResolver, IBuildingBlockInSimulationSynchronizer buildingBlockInSimulationSynchronizer)
     : base(view, subPresenterItemManager, simulationModelCreator, heavyWorkManager, cloner, dialogCreator, simulationParametersUpdater, fullPathDisplayResolver, buildingBlockInSimulationSynchronizer, CreationMode.Configure)
 {
 }