Beispiel #1
0
        protected override void Context()
        {
            _applicationController            = A.Fake <IApplicationController>();
            _buildingBlockTask                = A.Fake <IBuildingBlockTask>();
            _buildingBlockInSimulationManager = A.Fake <IBuildingBlockInSimulationManager>();
            _lazyloadTask               = A.Fake <ILazyLoadTask>();
            _heavyWorkManager           = A.Fake <IHeavyWorkManager>();
            _containerTask              = A.Fake <IContainerTask>();
            _objectReferencingRetriever = A.Fake <IObjectReferencingRetriever>();
            _projectRetriever           = A.Fake <IProjectRetriever>();
            _renameAbsolutePathVisitor  = new RenameAbsolutePathVisitor();
            _objectPathFactory          = new ObjectPathFactoryForSpecs();
            _parameterIdentificationSimulationPathUpdater = A.Fake <IParameterIdentificationSimulationPathUpdater>();
            _dataRepositoryNamer = A.Fake <IDataRepositoryNamer>();
            _curveNamer          = A.Fake <ICurveNamer>();

            sut = new RenameBuildingBlockTask(_buildingBlockTask, _buildingBlockInSimulationManager, _applicationController, _lazyloadTask,
                                              _containerTask, _heavyWorkManager, _renameAbsolutePathVisitor, _objectReferencingRetriever, _projectRetriever, _parameterIdentificationSimulationPathUpdater, _dataRepositoryNamer, _curveNamer);

            _initialSimulationName      = "S";
            _individualSimulation       = new IndividualSimulation().WithName(_initialSimulationName);
            _individualSimulation.Model = new Model().WithName(_initialSimulationName);
            _simulation = _individualSimulation;
            _root       = new Container().WithName(_initialSimulationName);
            _individualSimulation.Model.Root = _root;
        }
 public SimulationSubjectConfigurationPresenter(ISimulationSubjectConfigurationView view, ILazyLoadTask lazyLoadTask, IBuildingBlockInSimulationManager buildingBlockInSimulationManager)
     : base(view)
 {
     _lazyLoadTask = lazyLoadTask;
     _buildingBlockInSimulationManager = buildingBlockInSimulationManager;
     SubjectChanged = false;
 }
Beispiel #3
0
 public ProjectTask(IWorkspace workspace,
                    IApplicationController applicationController,
                    IDialogCreator dialogCreator,
                    IExecutionContext executionContext,
                    IHeavyWorkManager heavyWorkManager,
                    IWorkspaceLayoutUpdater workspaceLayoutUpdater,
                    IUserSettings userSettings,
                    IJournalTask journalTask,
                    IJournalRetriever journalRetriever,
                    ISnapshotTask snapshotTask,
                    IBuildingBlockInSimulationManager buildingBlockInSimulationManager
                    )
 {
     _workspace                        = workspace;
     _applicationController            = applicationController;
     _dialogCreator                    = dialogCreator;
     _executionContext                 = executionContext;
     _heavyWorkManager                 = heavyWorkManager;
     _workspaceLayoutUpdater           = workspaceLayoutUpdater;
     _userSettings                     = userSettings;
     _journalTask                      = journalTask;
     _journalRetriever                 = journalRetriever;
     _snapshotTask                     = snapshotTask;
     _buildingBlockInSimulationManager = buildingBlockInSimulationManager;
 }
Beispiel #4
0
        protected override void Context()
        {
            _project           = A.Fake <IPKSimProject>();
            _entityTask        = A.Fake <IEntityTask>();
            _templateTaskQuery = A.Fake <ITemplateTaskQuery>();
            _executionContext  = A.Fake <IExecutionContext>();
            A.CallTo(() => _executionContext.CurrentProject).Returns(_project);
            _applicationController            = A.Fake <IApplicationController>();
            _buildingBlockInSimulationManager = A.Fake <IBuildingBlockInSimulationManager>();
            _buildingBlockRepository          = A.Fake <IBuildingBlockRepository>();
            _clonePresenter             = A.Fake <ICloneBuildingBlockPresenter>();
            _renamePresenter            = A.Fake <IRenameObjectPresenter>();
            _dialogCreator              = A.Fake <IDialogCreator>();
            _singleStartPresenterTask   = A.Fake <ISingleStartPresenterTask>();
            _lazyLoadTask               = A.Fake <ILazyLoadTask>();
            _presenterSettingsTask      = A.Fake <IPresentationSettingsTask>();
            _simulationReferenceUpdater = A.Fake <ISimulationReferenceUpdater>();

            sut = new BuildingBlockTask(_executionContext, _applicationController, _dialogCreator, _buildingBlockInSimulationManager,
                                        _entityTask, _templateTaskQuery, _singleStartPresenterTask, _buildingBlockRepository, _lazyLoadTask, _presenterSettingsTask, _simulationReferenceUpdater);
            A.CallTo(() => _applicationController.Start <ICloneBuildingBlockPresenter>()).Returns(_clonePresenter);
            A.CallTo(() => _applicationController.Start <IRenameObjectPresenter>()).Returns(_renamePresenter);

            _buildingBlock = A.Fake <IPKSimBuildingBlock>();
        }
 protected override void Context()
 {
     _simulation = new IndividualSimulation();
     _buildingBlockInSmulationManager = A.Fake <IBuildingBlockInSimulationManager>();
     _buildingBlockRepository         = A.Fake <IBuildingBlockRepository>();
     sut = new FormulationFromMappingRetriever(_buildingBlockInSmulationManager, _buildingBlockRepository);
 }
Beispiel #6
0
        public override Task GlobalContext()
        {
            _project                          = new PKSimProject();
            _dialogCreator                    = A.Fake <IDialogCreator>();
            _workspace                        = A.Fake <IWorkspace>();
            _executionContext                 = A.Fake <IExecutionContext>();
            _applicationController            = A.Fake <IApplicationController>();
            _workspaceLayoutUpdater           = A.Fake <IWorkspaceLayoutUpdater>();
            _userSettings                     = A.Fake <IUserSettings>();
            _journalTask                      = A.Fake <IJournalTask>();
            _journalRetriever                 = A.Fake <IJournalRetriever>();
            _snapshotTask                     = A.Fake <ISnapshotTask>();
            _buildingBlockInSimulationManager = A.Fake <IBuildingBlockInSimulationManager>();
            _workspace.Project                = _project;
            _workspace.WorkspaceLayout        = new WorkspaceLayout();
            _heavyWorkManager                 = new HeavyWorkManagerForSpecs();

            _simulation = new IndividualSimulation();

            _project.AddBuildingBlock(_simulation);

            sut = new ProjectTask(_workspace, _applicationController, _dialogCreator,
                                  _executionContext, _heavyWorkManager, _workspaceLayoutUpdater, _userSettings,
                                  _journalTask, _journalRetriever, _snapshotTask, _buildingBlockInSimulationManager);

            _oldFileExitst = FileHelper.FileExists;

            return(_completed);
        }
        protected override void Context()
        {
            _executionContext = A.Fake <IExecutionContext>();
            _simulationBuildingBlockUpdater   = A.Fake <ISimulationBuildingBlockUpdater>();
            _buildingBlockInSimulationManager = A.Fake <IBuildingBlockInSimulationManager>();
            sut = new MultipleUsedBuildingBlockNodeContextMenuFactory(_buildingBlockInSimulationManager, _executionContext);

            _usedBuildingBlocksTreeNode = new List <ITreeNode>();
            _presenter = A.Fake <IPresenterWithContextMenu <IReadOnlyList <ITreeNode> > >();

            _buildingBlock1 = A.Fake <IPKSimBuildingBlock>().WithId("bb1");
            _buildingBlock2 = A.Fake <IPKSimBuildingBlock>().WithId("bb2");
            _buildingBlock3 = A.Fake <IPKSimBuildingBlock>().WithId("bb3");

            _usedIndividual1 = new UsedBuildingBlock("1", PKSimBuildingBlockType.Individual)
            {
                BuildingBlock = _buildingBlock1
            };
            _usedIndividual2 = new UsedBuildingBlock("2", PKSimBuildingBlockType.Individual)
            {
                BuildingBlock = _buildingBlock2
            };
            _usedCompound1 = new UsedBuildingBlock("3", PKSimBuildingBlockType.Compound)
            {
                BuildingBlock = _buildingBlock3
            };
            _command = new CompareObjectsUICommand(A.Fake <IEventPublisher>());
            A.CallTo(() => _container.Resolve <CompareObjectsUICommand>()).Returns(_command);
            A.CallTo(() => _executionContext.Resolve <ISimulationBuildingBlockUpdater>()).Returns(_simulationBuildingBlockUpdater);
        }
Beispiel #8
0
 public EventMappingToEventMappingDTOMapper(IBuildingBlockRepository buildingBlockRepository,
                                            IParameterToParameterDTOInContainerMapper <EventMappingDTO> parameterDTOMapper,
                                            IBuildingBlockInSimulationManager buildingBlockInSimulationManager)
 {
     _buildingBlockRepository          = buildingBlockRepository;
     _parameterDTOMapper               = parameterDTOMapper;
     _buildingBlockInSimulationManager = buildingBlockInSimulationManager;
 }
        protected override void Context()
        {
            _cloner = A.Fake <ICloner>();
            _buildingBlockInSimulationManager = A.Fake <IBuildingBlockInSimulationManager>();
            _compoundPropertiesUpdater        = A.Fake <ICompoundPropertiesUpdater>();

            sut = new BuildingBlockInSimulationSynchronizer(_buildingBlockInSimulationManager, _cloner, _compoundPropertiesUpdater);
        }
Beispiel #10
0
 public BuildingBlockFinalizer(IReferencesResolver referencesResolver, IKeywordReplacerTask keywordReplacerTask,
                               INeighborhoodFinalizer neighborhoodFinalizer, IBuildingBlockInSimulationManager buildingBlockInSimulationManager, IIndividualPathWithRootExpander individualPathWithRootExpander)
 {
     _referencesResolver               = referencesResolver;
     _keywordReplacerTask              = keywordReplacerTask;
     _neighborhoodFinalizer            = neighborhoodFinalizer;
     _buildingBlockInSimulationManager = buildingBlockInSimulationManager;
     _individualPathWithRootExpander   = individualPathWithRootExpander;
 }
 protected override void Context()
 {
     _referenceResolver                = A.Fake <IReferencesResolver>();
     _keywordReplacerTask              = A.Fake <IKeywordReplacerTask>();
     _neighborhoodFinalizer            = A.Fake <INeighborhoodFinalizer>();
     _buildingBlockInSimulationManager = A.Fake <IBuildingBlockInSimulationManager>();
     _individualPathWithRootExpander   = A.Fake <IIndividualPathWithRootExpander>();
     sut = new BuildingBlockFinalizer(_referenceResolver, _keywordReplacerTask, _neighborhoodFinalizer, _buildingBlockInSimulationManager, _individualPathWithRootExpander);
 }
Beispiel #12
0
        protected override void Context()
        {
            _view = A.Fake <ISimulationCompoundProtocolView>();
            _simulationCompoundProtocolFormulationPresenter = A.Fake <ISimulationCompoundProtocolFormulationPresenter>();
            _buildingBlockInSimulationManager = A.Fake <IBuildingBlockInSimulationManager>();
            _lazyLoadTask = A.Fake <ILazyLoadTask>();

            sut = new SimulationCompoundProtocolPresenter(_view, _simulationCompoundProtocolFormulationPresenter, _lazyLoadTask, _buildingBlockInSimulationManager);
        }
Beispiel #13
0
 protected override void Context()
 {
     _simulation        = A.Fake <Simulation>();
     _usedBuildingBlock = A.Fake <UsedBuildingBlock>();
     _version           = 3;
     _context           = A.Fake <IExecutionContext>();
     _buildingBlockInSimulationManager = A.Fake <IBuildingBlockInSimulationManager>();
     A.CallTo(() => _context.Resolve <IBuildingBlockInSimulationManager>()).Returns(_buildingBlockInSimulationManager);
     sut = new SetUsedBuildingBlockVersionCommand(_simulation, _usedBuildingBlock, _version, _context);
 }
Beispiel #14
0
 public CloneSimulationTask(IBuildingBlockTask buildingBlockTask, IExecutionContext executionContext, IBuildingBlockInSimulationManager buildingBlockInSimulationManager,
                            ISimulationSettingsRetriever simulationSettingsRetriever, ISimulationResultsTask simulationResultsTask, IApplicationController applicationController)
 {
     _buildingBlockTask = buildingBlockTask;
     _executionContext  = executionContext;
     _buildingBlockInSimulationManager = buildingBlockInSimulationManager;
     _simulationSettingsRetriever      = simulationSettingsRetriever;
     _simulationResultsTask            = simulationResultsTask;
     _applicationController            = applicationController;
 }
 protected override void Context()
 {
     _buildingBlockTask = A.Fake <IBuildingBlockTask>();
     _buildingBlockInSimulationManager = A.Fake <IBuildingBlockInSimulationManager>();
     _simulationSettingsRetriever      = A.Fake <ISimulationSettingsRetriever>();
     _simulationResultsTask            = A.Fake <ISimulationResultsTask>();
     _applicationController            = A.Fake <IApplicationController>();
     _renameBuildingBlockTask          = A.Fake <IRenameBuildingBlockTask>();
     sut = new CloneSimulationTask(_buildingBlockTask, _buildingBlockInSimulationManager, _simulationSettingsRetriever, _simulationResultsTask, _applicationController, _renameBuildingBlockTask);
 }
Beispiel #16
0
 public CloneSimulationTask(IBuildingBlockTask buildingBlockTask, IBuildingBlockInSimulationManager buildingBlockInSimulationManager,
                            ISimulationSettingsRetriever simulationSettingsRetriever, ISimulationResultsTask simulationResultsTask, IApplicationController applicationController, IRenameBuildingBlockTask renameBuildingBlockTask)
 {
     _buildingBlockTask = buildingBlockTask;
     _buildingBlockInSimulationManager = buildingBlockInSimulationManager;
     _simulationSettingsRetriever      = simulationSettingsRetriever;
     _simulationResultsTask            = simulationResultsTask;
     _applicationController            = applicationController;
     _renameBuildingBlockTask          = renameBuildingBlockTask;
 }
 public SimulationExplorerPresenter(ISimulationExplorerView view, ITreeNodeFactory treeNodeFactory, ITreeNodeContextMenuFactory treeNodeContextMenuFactory,
                                    IMultipleTreeNodeContextMenuFactory multipleTreeNodeContextMenuFactory, IBuildingBlockIconRetriever buildingBlockIconRetriever,
                                    IRegionResolver regionResolver, IBuildingBlockTask buildingBlockTask, IBuildingBlockInSimulationManager buildingBlockInSimulationManager,
                                    IToolTipPartCreator toolTipPartCreator, IProjectRetriever projectRetriever, IClassificationPresenter classificationPresenter, IParameterAnalysablesInExplorerPresenter parameterAnalysablesInExplorerPresenter, IObservedDataInSimulationManager observedDataInSimulationManager) :
     base(view, treeNodeFactory, treeNodeContextMenuFactory, multipleTreeNodeContextMenuFactory, buildingBlockIconRetriever, regionResolver, buildingBlockTask, RegionNames.SimulationExplorer, projectRetriever, classificationPresenter, toolTipPartCreator)
 {
     _buildingBlockInSimulationManager        = buildingBlockInSimulationManager;
     _parameterAnalysablesInExplorerPresenter = parameterAnalysablesInExplorerPresenter;
     _observedDataInSimulationManager         = observedDataInSimulationManager;
     _parameterAnalysablesInExplorerPresenter.InitializeWith(this, classificationPresenter);
 }
 public SimulationCompoundProtocolPresenter(ISimulationCompoundProtocolView view,
                                            ISimulationCompoundProtocolFormulationPresenter simulationCompoundProtocolFormulationPresenter,
                                            ILazyLoadTask lazyLoadTask, IBuildingBlockInSimulationManager buildingBlockInSimulationManager)
     : base(view)
 {
     _simulationCompoundProtocolFormulationPresenter = simulationCompoundProtocolFormulationPresenter;
     _lazyLoadTask = lazyLoadTask;
     _buildingBlockInSimulationManager = buildingBlockInSimulationManager;
     _view.AddFormulationMappingView(_simulationCompoundProtocolFormulationPresenter.View);
     _simulationCompoundProtocolFormulationPresenter.StatusChanged += onFormulationChanged;
 }
 public SimulationCompoundsSelectionPresenter(ISimulationCompoundsSelectionView view, IBuildingBlockRepository buildingBlockRepository,
                                              IBuildingBlockInSimulationManager buildingBlockInSimulationManager, ICompoundTask compoundTask, IBuildingBlockSelectionDisplayer buildingBlockSelectionDisplayer)
     : base(view)
 {
     _buildingBlockRepository          = buildingBlockRepository;
     _buildingBlockInSimulationManager = buildingBlockInSimulationManager;
     _compoundTask = compoundTask;
     _buildingBlockSelectionDisplayer = buildingBlockSelectionDisplayer;
     _compoundSelectionDTOs           = new NotifyList <CompoundSelectionDTO>();
     _view.BindTo(_compoundSelectionDTOs);
     _compoundSelectionDTOs.CollectionChanged += onCollectionChanged;
 }
 protected override void Context()
 {
     _simulation        = A.Fake <Simulation>();
     _buildingBlock     = A.Fake <IPKSimBuildingBlock>();
     _context           = A.Fake <IExecutionContext>();
     _usedBuildingBlock = A.Fake <UsedBuildingBlock>();
     _buildingBlockInSimulationManager = A.Fake <IBuildingBlockInSimulationManager>();
     _buildingBlockId = "toto";
     A.CallTo(() => _simulation.UsedBuildingBlockById(_buildingBlockId)).Returns(_usedBuildingBlock);
     _buildingBlock.Id = _buildingBlockId;
     _altered          = false;
     A.CallTo(() => _simulation.GetAltered(_buildingBlockId)).Returns(true);
     A.CallTo(() => _context.Resolve <IBuildingBlockInSimulationManager>()).Returns(_buildingBlockInSimulationManager);
     sut = new SetUsedBuildingBlockAlteredFlagCommand(_simulation, _usedBuildingBlock, _altered, _context);
 }
 public RenameBuildingBlockTask(IBuildingBlockTask buildingBlockTask, IBuildingBlockInSimulationManager buildingBlockInSimulationManager,
                                IApplicationController applicationController, ILazyLoadTask lazyLoadTask, IContainerTask containerTask,
                                IHeavyWorkManager heavyWorkManager, IRenameAbsolutePathVisitor renameAbsolutePathVisitor, IObjectReferencingRetriever objectReferencingRetriever,
                                IProjectRetriever projectRetriever, IParameterIdentificationSimulationPathUpdater simulationPathUpdater)
 {
     _buildingBlockTask = buildingBlockTask;
     _buildingBlockInSimulationManager = buildingBlockInSimulationManager;
     _applicationController            = applicationController;
     _lazyLoadTask               = lazyLoadTask;
     _containerTask              = containerTask;
     _heavyWorkManager           = heavyWorkManager;
     _renameAbsolutePathVisitor  = renameAbsolutePathVisitor;
     _objectReferencingRetriever = objectReferencingRetriever;
     _projectRetriever           = projectRetriever;
     _simulationPathUpdater      = simulationPathUpdater;
 }
Beispiel #22
0
 public BuildingBlockTask(IExecutionContext executionContext, IApplicationController applicationController,
                          IDialogCreator dialogCreator, IBuildingBlockInSimulationManager buildingBlockInSimulationManager,
                          IEntityTask entityTask, ITemplateTaskQuery templateTaskQuery,
                          ISingleStartPresenterTask singleStartPresenterTask, IBuildingBlockRepository buildingBlockRepository,
                          ILazyLoadTask lazyLoadTask, IPresentationSettingsTask presentationSettingsTask, ISimulationReferenceUpdater simulationReferenceUpdater)
 {
     _executionContext                 = executionContext;
     _applicationController            = applicationController;
     _dialogCreator                    = dialogCreator;
     _buildingBlockInSimulationManager = buildingBlockInSimulationManager;
     _entityTask                 = entityTask;
     _templateTaskQuery          = templateTaskQuery;
     _singleStartPresenterTask   = singleStartPresenterTask;
     _buildingBlockRepository    = buildingBlockRepository;
     _lazyLoadTask               = lazyLoadTask;
     _presentationSettingsTask   = presentationSettingsTask;
     _simulationReferenceUpdater = simulationReferenceUpdater;
 }
Beispiel #23
0
        protected override void Context()
        {
            _compoundTask                     = A.Fake <ICompoundTask>();
            _view                             = A.Fake <ISimulationCompoundsSelectionView>();
            _buildingBlockRepository          = A.Fake <IBuildingBlockRepository>();
            _buildingBlockInSimulationManager = A.Fake <IBuildingBlockInSimulationManager>();
            _buildingBlockSelectionDisplayer  = A.Fake <IBuildingBlockSelectionDisplayer>();


            A.CallTo(() => _buildingBlockRepository.All <Compound>()).Returns(_allCompoundTemplates);
            A.CallTo(() => _view.BindTo(A <NotifyList <CompoundSelectionDTO> > ._))
            .Invokes(x => _compoundDTOList = x.GetArgument <NotifyList <CompoundSelectionDTO> >(0));

            sut = new SimulationCompoundsSelectionPresenter(_view, _buildingBlockRepository, _buildingBlockInSimulationManager, _compoundTask, _buildingBlockSelectionDisplayer);

            sut.Initialize();

            CompoundSelectionDTOFor(_compound1).Selected = true;
        }
        protected override void Context()
        {
            _simulationPresenter = A.Fake <ICreateSimulationPresenter>();
            _view = A.Fake <ISimulationSubjectConfigurationView>();
            _simulationFactory = A.Fake <ISimulationFactory>();
            _buildingBlockInSimulationManager = A.Fake <IBuildingBlockInSimulationManager>();
            _simulation   = A.Fake <Simulation>();
            _lazyLoadTask = A.Fake <ILazyLoadTask>();
            sut           = new SimulationSubjectConfigurationPresenter(_view, _lazyLoadTask, _buildingBlockInSimulationManager);
            A.CallTo(() => _view.BindTo(A <SimulationSubjectDTO> ._))
            .Invokes(x => _simulationSubjectDTO = x.GetArgument <SimulationSubjectDTO>(0));

            sut.InitializeWith(_simulationPresenter);

            _subject = A.Fake <ISimulationSubject>();
            var originData = new OriginData {
                SpeciesPopulation = A.Fake <SpeciesPopulation>()
            };

            A.CallTo(() => _subject.OriginData).Returns(originData);

            sut.Initialize();
        }
Beispiel #25
0
 public BuildingBlockInSimulationSynchronizer(IBuildingBlockInSimulationManager buildingBlockInSimulationManager, ICloner cloner, ICompoundPropertiesUpdater compoundPropertiesUpdater)
 {
     _buildingBlockInSimulationManager = buildingBlockInSimulationManager;
     _cloner = cloner;
     _compoundPropertiesUpdater = compoundPropertiesUpdater;
 }
Beispiel #26
0
 public FormulationFromMappingRetriever(IBuildingBlockInSimulationManager buildingBlockInSimulationManager, IBuildingBlockRepository buildingBlockRepository)
 {
     _buildingBlockInSimulationManager = buildingBlockInSimulationManager;
     _buildingBlockRepository          = buildingBlockRepository;
 }
 public MultipleUsedBuildingBlockNodeContextMenuFactory(IBuildingBlockInSimulationManager buildingBlockInSimulationManager, IExecutionContext executionContext)
 {
     _buildingBlockInSimulationManager = buildingBlockInSimulationManager;
     _executionContext = executionContext;
 }
 public BuildingBlockIconRetriever(IBuildingBlockInSimulationManager buildingBlockInSimulationManager, IBuildingBlockRepository buildingBlockRepository)
 {
     _buildingBlockInSimulationManager = buildingBlockInSimulationManager;
     _buildingBlockRepository          = buildingBlockRepository;
 }
        protected override void Context()
        {
            _buildingBlockIconRetriever = A.Fake <IBuildingBlockIconRetriever>();
            _view = A.Fake <ISimulationExplorerView>();
            A.CallTo(() => _view.TreeView).Returns(A.Fake <IUxTreeView>());
            _treeNodeFactory    = A.Fake <ITreeNodeFactory>();
            _contextMenuFactory = A.Fake <ITreeNodeContextMenuFactory>();
            _regionResolver     = A.Fake <IRegionResolver>();
            _buildingBlockInSimulationManager = A.Fake <IBuildingBlockInSimulationManager>();
            _buildingBlockTask  = A.Fake <IBuildingBlockTask>();
            _toolTipNodeCreator = A.Fake <IToolTipPartCreator>();
            _projectRetriever   = A.Fake <IProjectRetriever>();
            _multipleTreeNodeContextMenuFactory      = A.Fake <IMultipleTreeNodeContextMenuFactory>();
            _parameterAnalysablesInExplorerPresenter = A.Fake <IParameterAnalysablesInExplorerPresenter>();
            _simulationComparisonTask = A.Fake <ISimulationComparisonTask>();
            _simulationFolderNode     = new RootNode(RootNodeTypes.SimulationFolder);
            _comparisonFolderNode     = new RootNode(RootNodeTypes.ComparisonFolder);
            _project          = new PKSimProject();
            _usedObservedData = new UsedObservedData {
                Id = "UsedData"
            };
            _simulation           = new IndividualSimulation().WithName("individualSimulation").WithId("individualSimulation");
            _populationSimulation = new PopulationSimulation().WithName("populationSimulation").WithId("populationSimulation");
            _importedSimulaton    = A.Fake <Simulation>().WithName("ImportedSimulation").WithId("ImportedSimulation");
            A.CallTo(() => _importedSimulaton.IsImported).Returns(true);
            _simulation.Properties                   = new SimulationProperties();
            _simulation.ModelProperties              = new ModelProperties();
            _simulation.ModelConfiguration           = A.Fake <ModelConfiguration>();
            _populationSimulation.Properties         = new SimulationProperties();
            _populationSimulation.ModelProperties    = new ModelProperties();
            _populationSimulation.ModelConfiguration = A.Fake <ModelConfiguration>();
            _classificationPresenter                 = A.Fake <IClassificationPresenter>();
            _project.AddBuildingBlock(_simulation);
            _project.AddBuildingBlock(_populationSimulation);
            var classifiableIndividualSimulation = new ClassifiableSimulation {
                Subject = _simulation
            };
            var classfiablePopulationSimulation = new ClassifiableSimulation {
                Subject = _populationSimulation
            };
            var classifiableImportSimulation = new ClassifiableSimulation {
                Subject = _importedSimulaton
            };

            _project.AddClassifiable(classifiableIndividualSimulation);
            _project.AddClassifiable(classfiablePopulationSimulation);
            _individualSimulationNode = new SimulationNode(classifiableIndividualSimulation);
            _populationSimulationNode = new SimulationNode(classfiablePopulationSimulation);
            _importedSimulationNode   = new SimulationNode(classifiableImportSimulation);
            _usedObservedDataNode     = A.Fake <ITreeNode>();
            A.CallTo(() => _treeNodeFactory.CreateFor(classifiableIndividualSimulation)).Returns(_individualSimulationNode);
            A.CallTo(() => _treeNodeFactory.CreateFor(classfiablePopulationSimulation)).Returns(_populationSimulationNode);
            A.CallTo(() => _treeNodeFactory.CreateFor(classifiableImportSimulation)).Returns(_importedSimulationNode);
            A.CallTo(() => _treeNodeFactory.CreateFor(_usedObservedData)).Returns(_usedObservedDataNode);
            _project.AddBuildingBlock(_importedSimulaton);

            var simulationComparison   = A.Fake <ISimulationComparison>().WithId("SimComp_Id");
            var classifiableComparison = new ClassifiableComparison {
                Subject = simulationComparison
            };

            _comparisonNode = new ComparisonNode(classifiableComparison);
            _project.AddSimulationComparison(simulationComparison);
            A.CallTo(() => _treeNodeFactory.CreateFor(classifiableComparison)).Returns(_comparisonNode);


            _usedCompoundBuildingBlock = new UsedBuildingBlock("toto", PKSimBuildingBlockType.Compound)
            {
                Id = "usedBB"
            };
            _simulation.AddUsedBuildingBlock(_usedCompoundBuildingBlock);
            _simulation.AddUsedObservedData(_usedObservedData);

            _project.AddClassifiable(classifiableComparison);

            _templageCompoundBuildingBlock = A.Fake <IPKSimBuildingBlock>();
            _usedBuildingBlockNode         = new UsedBuildingBlockInSimulationNode(_simulation, _usedCompoundBuildingBlock, _templageCompoundBuildingBlock);
            A.CallTo(() => _treeNodeFactory.CreateFor(_simulation, _usedCompoundBuildingBlock)).Returns(_usedBuildingBlockNode);
            A.CallTo(() => _buildingBlockIconRetriever.IconFor(_simulation)).Returns(ApplicationIcons.SimulationGreen);
            A.CallTo(() => _buildingBlockIconRetriever.IconFor(_populationSimulation)).Returns(ApplicationIcons.SimulationGreen);
            A.CallTo(() => _buildingBlockIconRetriever.IconFor(_usedCompoundBuildingBlock)).Returns(ApplicationIcons.CompoundRed);
            A.CallTo(() => _view.TreeView.NodeById(_simulation.Id)).Returns(_individualSimulationNode);
            A.CallTo(() => _view.TreeView.NodeById(_usedCompoundBuildingBlock.Id)).Returns(_usedBuildingBlockNode);
            A.CallTo(() => _view.TreeView.NodeById(RootNodeTypes.SimulationFolder.Id)).Returns(_simulationFolderNode);
            A.CallTo(() => _view.TreeView.NodeById(RootNodeTypes.ComparisonFolder.Id)).Returns(_comparisonFolderNode);

            _observedDataInSimulationManager = A.Fake <IObservedDataInSimulationManager>();
            sut = new SimulationExplorerPresenter(
                _view, _treeNodeFactory, _contextMenuFactory,
                _multipleTreeNodeContextMenuFactory, _buildingBlockIconRetriever,
                _regionResolver, _buildingBlockTask, _buildingBlockInSimulationManager,
                _toolTipNodeCreator, _projectRetriever, _classificationPresenter,
                _parameterAnalysablesInExplorerPresenter, _observedDataInSimulationManager, _simulationComparisonTask);

            A.CallTo(() => _projectRetriever.CurrentProject).Returns(_project);
        }
Beispiel #30
0
 public BuildingBlockVersionUpdater(IBuildingBlockInSimulationManager buildingBlockInSimulationManager)
 {
     _buildingBlockInSimulationManager = buildingBlockInSimulationManager;
 }