Esempio n. 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()
        {
            _subPresenterManager = SubPresenterHelper.Create <IIndividualItemPresenter>();
            _view                                  = A.Fake <IScaleIndividualView>();
            _propertiesMapper                      = A.Fake <IBuildingBlockPropertiesMapper>();
            _workspace                             = A.Fake <IWorkspace>();
            _individualExpressionsUpdater          = A.Fake <IIndividualExpressionsUpdater>();
            _cloner                                = A.Fake <ICloner>();
            _sourceIndividual                      = A.Fake <Individual>();
            _cloneIndividual                       = A.Fake <Individual>();
            _scaledIndividual                      = A.Fake <Individual>();
            _objectBaseDTOFactory                  = A.Fake <IObjectBaseDTOFactory>();
            _settingPresenter                      = _subPresenterManager.CreateFake(ScaleIndividualItems.Settings);
            _parameterPresenter                    = _subPresenterManager.CreateFake(ScaleIndividualItems.Parameters);
            _scalingConfigurationPresenter         = _subPresenterManager.CreateFake(ScaleIndividualItems.Scaling);
            _moleculePresenter                     = _subPresenterManager.CreateFake(ScaleIndividualItems.Expressions);
            ScaleIndividualItems.Expressions.Index = 3;
            A.CallTo(() => _cloner.Clone(_sourceIndividual)).Returns(_cloneIndividual);
            _individualSettingsDTO = new IndividualSettingsDTO();

            _dialogCreator = A.Fake <IDialogCreator>();
            A.CallTo(() => _settingPresenter.Individual).Returns(_scaledIndividual);
            _scaleIndividualPropertiesDTO = new ObjectBaseDTO();
            A.CallTo(() => _objectBaseDTOFactory.CreateFor <Individual>()).Returns(_scaleIndividualPropertiesDTO);

            sut = new ScaleIndividualPresenter(_view, _subPresenterManager, _dialogCreator, _individualExpressionsUpdater,
                                               _objectBaseDTOFactory, _propertiesMapper, _cloner);
            sut.Initialize();
        }
        protected override void Context()
        {
            _view = A.Fake <ICreateSimulationView>();
            _subPresenterManager           = A.Fake <ISubPresenterItemManager <ISimulationItemPresenter> >();
            _buildConfigurationPresenter   = _subPresenterManager.CreateFake(SimulationItems.BuildConfiguration);
            _moleculeStartValuesPresenter  = _subPresenterManager.CreateFake(SimulationItems.MoleculeStartValues);
            _parameterStartValuesPresenter = _subPresenterManager.CreateFake(SimulationItems.ParameterStartValues);
            _finalActionPresenter          = _subPresenterManager.CreateFake(SimulationItems.FinalOptions);

            A.CallTo(() => _subPresenterManager.AllSubPresenters).Returns(new ISimulationItemPresenter[] { _buildConfigurationPresenter, _moleculeStartValuesPresenter, _parameterStartValuesPresenter, _finalActionPresenter });
            _context          = A.Fake <IMoBiContext>();
            _modelConstructor = A.Fake <IModelConstructor>();
            _dialogCreator    = A.Fake <IDialogCreator>();
            A.CallTo(() => _modelConstructor.CreateModelFrom(A <IBuildConfiguration> ._, A <string> ._)).Returns(A.Fake <CreationResult>());


            _validationVisitor = A.Fake <IDimensionValidator>();
            _userSettings      = A.Fake <IUserSettings>();
            _userSettings.CheckCircularReference = true;
            _simulationFactory         = A.Fake <ISimulationFactory>();
            _buildConfigurationFactory = A.Fake <IBuildConfigurationFactory>();
            _heavyWorkManager          = new HeavyWorkManagerForSpecs();
            _forbiddenNameRetriever    = A.Fake <IForbiddenNamesRetriever>();
            sut = new CreateSimulationPresenter(_view, _context, _modelConstructor, _validationVisitor,
                                                _simulationFactory, _buildConfigurationFactory, _heavyWorkManager, _subPresenterManager, _dialogCreator,
                                                _forbiddenNameRetriever, _userSettings);

            _simulation = A.Fake <IMoBiSimulation>();
            A.CallTo(() => _simulationFactory.Create()).Returns(_simulation);
            _buildConfiguration = createBuildConfiguration();
            A.CallTo(() => _simulation.MoBiBuildConfiguration).Returns(_buildConfiguration);
            A.CallTo(() => _moleculeStartValuesPresenter.StartValues).Returns(A.Fake <IMoleculeStartValuesBuildingBlock>().WithId(_useId));
            A.CallTo(() => _parameterStartValuesPresenter.StartValues).Returns(A.Fake <IParameterStartValuesBuildingBlock>().WithId(_useId));
        }
        protected override void Context()
        {
            _simulationFactory = A.Fake <ISimulationFactory>();
            _view = A.Fake <ISimulationModelConfigurationView>();
            _subPresenterManager = SubPresenterHelper.Create <ISimulationModelConfigurationItemPresenter>();
            _simulationSubjectConfigurationPresenter = _subPresenterManager.CreateFake(SimulationModelConfigurationItems.Subject);
            _simulationModelSelectionPresenter       = _subPresenterManager.CreateFake(SimulationModelConfigurationItems.ModelSelection);

            sut = new SimulationModelConfigurationPresenter(_view, _subPresenterManager, _simulationFactory);
        }
 protected override void Context()
 {
     _view = A.Fake <IEditProtocolView>();
     _subPresenterManager       = SubPresenterHelper.Create <IProtocolItemPresenter>();
     _simpleProtocolPresenter   = _subPresenterManager.CreateFake(ProtocolItems.Simple);
     _advancedProtocolPresenter = _subPresenterManager.CreateFake(ProtocolItems.Advanced);
     _protocolChartPresenter    = A.Fake <IProtocolChartPresenter>();
     _schemaTask      = A.Fake <ISchemaTask>();
     _protocolUpdater = A.Fake <IProtocolUpdater>();
     _dialogCreator   = A.Fake <IDialogCreator>();
     sut = new EditProtocolPresenter(_view, _subPresenterManager, _protocolChartPresenter, _schemaTask, _protocolUpdater, _dialogCreator);
 }
Esempio n. 6
0
        protected override void Context()
        {
            _subPresenterManager     = SubPresenterHelper.Create <ISettingsItemPresenter>();
            _userSettings            = _subPresenterManager.CreateFake(SettingsItems.UserGeneralSettings);
            _appSettings             = _subPresenterManager.CreateFake(SettingsItems.ApplicationSettings);
            _userDisplayUnitSettings = _subPresenterManager.CreateFake(SettingsItems.UserDisplayUnitsSettings);

            _dialogCreator = A.Fake <IDialogCreator>();
            _workspace     = A.Fake <ICoreWorkspace>();
            _view          = A.Fake <ISettingsView>();
            sut            = new SettingsPresenter(_view, _subPresenterManager, _dialogCreator, _workspace);
        }
Esempio n. 7
0
 protected override void Context()
 {
     _workspace                     = A.Fake <IWorkspace>();
     _view                          = A.Fake <IEditRandomPopulationView>();
     _subPresenterManager           = SubPresenterHelper.Create <IPopulationItemPresenter>();
     _popSettingsPresenter          = _subPresenterManager.CreateFake(RamdomPopulationItems.Settings);
     _popAdvancedParameterPresenter = _subPresenterManager.CreateFake(RamdomPopulationItems.AdvancedParameters);
     _popDistributionPresenter      = _subPresenterManager.CreateFake(RamdomPopulationItems.ParameterDistribution);
     //This line is required because of some generic issues
     A.CallTo(_subPresenterManager).WithReturnType <IPopulationSettingsPresenter <RandomPopulation> >().Returns(_popSettingsPresenter);
     _randomPopulation = A.Fake <RandomPopulation>();
     A.CallTo(() => _popSettingsPresenter.Population).Returns(_randomPopulation);
     sut = new EditRandomPopulationPresenter(_view, _subPresenterManager);
     sut.InitializeWith(_workspace);
 }
Esempio n. 8
0
        protected override void Context()
        {
            _view          = A.Fake <ICreatePopulationAnalysisView>();
            _dialogCreator = A.Fake <IDialogCreator>();
            _populationAnalysisTemplateTask = A.Fake <IPopulationAnalysisTemplateTask>();
            _populationAnalysisChartFactory = A.Fake <IPopulationAnalysisChartFactory>();
            _lazyLoadTask           = A.Fake <ILazyLoadTask>();
            _populationAnalysisTask = A.Fake <IPopulationAnalysisTask>();

            _subPresenterManager               = SubPresenterHelper.Create <IPopulationAnalysisItemPresenter>();
            _parameterSelectionPresenter       = _subPresenterManager.CreateFake(TimeProfileItems.ParameterSelection);
            _pkParameterSpecificationPresenter = _subPresenterManager.CreateFake(TimeProfileItems.PKParameterSpecification);

            sut = new CreateTimeProfileAnalysisPresenter(_view, _subPresenterManager, _dialogCreator, _populationAnalysisTemplateTask, _populationAnalysisChartFactory, _lazyLoadTask, _populationAnalysisTask);
        }
 protected override void Context()
 {
     _subPresenterManager          = SubPresenterHelper.Create <IIndividualItemPresenter>();
     _propertiesMapper             = A.Fake <IBuildingBlockPropertiesMapper>();
     _buildingBlockDTOFactory      = A.Fake <IObjectBaseDTOFactory>();
     _individualSettingsPresenter  = _subPresenterManager.CreateFake(IndividualItems.Settings);
     _individualParameterPresenter = _subPresenterManager.CreateFake(IndividualItems.Parameters);
     _individualMoleculesPresenter = _subPresenterManager.CreateFake(IndividualItems.Expression);
     _dialogCreator           = A.Fake <IDialogCreator>();
     _individualPropertiesDTO = new ObjectBaseDTO();
     _view = A.Fake <ICreateIndividualView>();
     A.CallTo(() => _buildingBlockDTOFactory.CreateFor <Individual>()).Returns(_individualPropertiesDTO);
     sut = new CreateIndividualPresenter(_view, _subPresenterManager, _dialogCreator, _propertiesMapper, _buildingBlockDTOFactory);
     sut.Initialize();
 }
 protected override void Context()
 {
     _buildingBlockDTOFactory = A.Fake <IObjectBaseDTOFactory>();
     _subPresenterManager     = SubPresenterHelper.Create <IPopulationItemPresenter>();
     _propertiesMapper        = A.Fake <IBuildingBlockPropertiesMapper>();
     _view = A.Fake <ICreateRandomPopulationView>();
     _popSettingsPresenter          = _subPresenterManager.CreateFake(RamdomPopulationItems.Settings);
     _popAdvancedParameterPresenter = _subPresenterManager.CreateFake(RamdomPopulationItems.AdvancedParameters);
     _popDistributionPresenter      = _subPresenterManager.CreateFake(RamdomPopulationItems.ParameterDistribution);
     _buildingBlockRepository       = A.Fake <IBuildingBlockRepository>();
     _dialogCreator  = A.Fake <IDialogCreator>();
     _allIndividuals = new List <Individual>();
     A.CallTo(() => _buildingBlockRepository.All <Individual>()).Returns(_allIndividuals);
     sut = new CreateRandomPopulationPresenter(_view, _subPresenterManager, _dialogCreator, _propertiesMapper, _buildingBlockDTOFactory, _buildingBlockRepository);
     sut.Initialize();
 }
      protected override void Context()
      {
         _view = A.Fake<ICreatePopulationAnalysisView>();
         _dialogCreator = A.Fake<IDialogCreator>();
         _populationAnalysisTemplateTask = A.Fake<IPopulationAnalysisTemplateTask>();
         _populationAnalysisChartFactory = A.Fake<IPopulationAnalysisChartFactory>();
         _lazyLoadTask = A.Fake<ILazyLoadTask>();
         _populationAnalysisTask = A.Fake<IPopulationAnalysisTask>();

         _subPresenterManager = SubPresenterHelper.Create<IPopulationAnalysisItemPresenter>();
         _parameterSelectionPresenter = _subPresenterManager.CreateFake(TimeProfileItems.ParameterSelection);
         _pkParameterSpecificationPresenter = _subPresenterManager.CreateFake(TimeProfileItems.PKParameterSpecification);
         _populationAnalysisFieldFactory= A.Fake<IPopulationAnalysisFieldFactory>();
         _populationAnalysisChart = new TimeProfileAnalysisChart {PopulationAnalysis = new PopulationStatisticalAnalysis()};
         A.CallTo(() => _populationAnalysisChartFactory.Create<PopulationStatisticalAnalysis, TimeProfileAnalysisChart>()).Returns(_populationAnalysisChart);
         sut = new CreateTimeProfileAnalysisPresenter(_view, _subPresenterManager, _dialogCreator, _populationAnalysisTemplateTask, _populationAnalysisChartFactory, _lazyLoadTask, _populationAnalysisTask, _populationAnalysisFieldFactory);
      }
 protected override void Context()
 {
     _view = A.Fake <IEditObserverSetView>();
     _subPresenterManager = SubPresenterHelper.Create <IObserverSetItemPresenter>();
     _observerSet         = new ObserverSet().WithName("TOTO");
     sut = new EditObserverSetPresenter(_view, _subPresenterManager);
     _importObserverSetSettings = _subPresenterManager.CreateFake(ObserverSetItems.ImportSettings);
     _importObserverSetSettings.ShowFilePath = true;
     sut.Edit(_observerSet);
 }
        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();
        }
Esempio n. 14
0
        protected override void Context()
        {
            _view = A.Fake <ICreatePopulationAnalysisView>();
            _subPresenterManager               = A.Fake <ISubPresenterItemManager <IPopulationAnalysisItemPresenter> >();
            _dialogCreator                     = A.Fake <IDialogCreator>();
            _populationAnalysisTemplateTask    = A.Fake <IPopulationAnalysisTemplateTask>();
            _populationAnalysisChartFactory    = A.Fake <IPopulationAnalysisChartFactory>();
            _subPresenterManager               = SubPresenterHelper.Create <IPopulationAnalysisItemPresenter>();
            _parameterSelectionPresenter       = _subPresenterManager.CreateFake(BoxWhiskerItems.ParameterSelection);
            _pkParameterSpecificationPresenter = _subPresenterManager.CreateFake(BoxWhiskerItems.PKParameterSpecification);
            _chartPresenter                    = _subPresenterManager.CreateFake(BoxWhiskerItems.Chart);
            _analysis = new PopulationBoxWhiskerAnalysis();
            _boxWiskerAnalysisChart = new BoxWhiskerAnalysisChart {
                PopulationAnalysis = _analysis
            };
            A.CallTo(_populationAnalysisChartFactory).WithReturnType <BoxWhiskerAnalysisChart>().Returns(_boxWiskerAnalysisChart);
            _populationAnalysisTask = A.Fake <IPopulationAnalysisTask>();

            sut = new CreateBoxWhiskerAnalysisPresenter(_view, _subPresenterManager, _dialogCreator, _populationAnalysisTemplateTask, _populationAnalysisChartFactory, _populationAnalysisTask);
        }
        protected override void Context()
        {
            _view = A.Fake <IEditParameterIdentificationView>();
            _subPresenterItemManager = SubPresenterHelper.Create <IParameterIdentificationItemPresenter>();
            _parameterIdentificationDataSelectionPresenter      = _subPresenterItemManager.CreateFake(ParameterIdentificationItems.Data);
            _parameterIdentificationParameterSelectionPresenter = _subPresenterItemManager.CreateFake(ParameterIdentificationItems.Parameters);
            _parameterIdentificationConfigurationPresenter      = _subPresenterItemManager.CreateFake(ParameterIdentificationItems.Configuration);

            _simulationAnalysisPresenterFactory = A.Fake <ISimulationAnalysisPresenterFactory>();
            _contextMenuFactory        = A.Fake <ISimulationAnalysisPresenterContextMenuFactory>();
            _presentationSettingsTask  = A.Fake <IPresentationSettingsTask>();
            _simulationAnalysisCreator = A.Fake <IParameterIdentificationAnalysisCreator>();
            _executionContext          = A.Fake <IOSPSuiteExecutionContext>();
            _simulation = A.Fake <ISimulation>();

            sut = new EditParameterIdentificationPresenter(_view, _subPresenterItemManager, _executionContext, _simulationAnalysisPresenterFactory, _contextMenuFactory, _presentationSettingsTask, _simulationAnalysisCreator);

            sut.InitializeWith(A.Fake <ICommandCollector>());
            _parameterIdentification = new ParameterIdentification();
            _parameterIdentification.AddSimulation(_simulation);
        }
 protected override void Context()
 {
     _view = A.Fake <ICreateEventView>();
     _subPresenterManager = SubPresenterHelper.Create <IEventItemPresenter>();
     _dtoFactory          = A.Fake <IObjectBaseDTOFactory>();
     _eventFactory        = A.Fake <IEventFactory>();
     _propertiesMapper    = A.Fake <IBuildingBlockPropertiesMapper>();
     _dialogCreator       = A.Fake <IDialogCreator>();
     _eventSettings       = _subPresenterManager.CreateFake(EventItems.Settings);
     sut = new CreateEventPresenter(_view, _subPresenterManager, _dialogCreator, _dtoFactory, _eventFactory, _propertiesMapper);
     sut.Initialize();
 }