Пример #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 override void Context()
        {
            _simulationPropertiesDTO = new ObjectBaseDTO();
            _subPresenterManager     = SubPresenterHelper.Create <ISimulationItemPresenter>();
            _simulationModelConfigurationPresenter             = _subPresenterManager.CreateFake(SimulationItems.Model);
            _simulationCompoundConfigurationCollectorPresenter = _subPresenterManager.CreateFake(SimulationItems.Compounds);
            _simulationCompoundProtocolCollectorPresenter      = _subPresenterManager.CreateFake(SimulationItems.CompoundProtocols);
            _simulationCompoundProcessCollectorPresenter       = _subPresenterManager.CreateFake(SimulationItems.CompoundsProcesses);
            _simulationEventsConfigurationPresenter            = _subPresenterManager.CreateFake(SimulationItems.Events);
            _view = A.Fake <ICreateSimulationView>();
            _buildingBlockDTOFactory    = A.Fake <IObjectBaseDTOFactory>();
            _simulationPropertiesMapper = A.Fake <IBuildingBlockPropertiesMapper>();
            A.CallTo(() => _buildingBlockDTOFactory.CreateFor <Simulation>()).Returns(_simulationPropertiesDTO);
            _simulationModelCreator = A.Fake <ISimulationModelCreator>();
            _heavyWorkManager       = new HeavyWorkManagerForSpecs();
            _dialogCreator          = A.Fake <IDialogCreator>();

            sut = new CreateSimulationPresenter(_view, _subPresenterManager, _simulationModelCreator, _heavyWorkManager, _simulationPropertiesMapper, _buildingBlockDTOFactory, _dialogCreator);
            sut.Initialize();
        }
 public void AttachPresenter(ISimulationItemPresenter presenter)
 {
     _presenter = presenter as ISimulationCompoundProcessSummaryCollectorPresenter;
 }