protected override void Context()
 {
     _projectRetriever                        = A.Fake <IProjectRetriever>();
     _view                                    = A.Fake <ISimulationExplorerView>();
     _regionResolver                          = A.Fake <IRegionResolver>();
     _treeNodeFactory                         = A.Fake <ITreeNodeFactory>();
     _viewItemContextMenuFactory              = A.Fake <IViewItemContextMenuFactory>();
     _context                                 = A.Fake <IMoBiContext>();
     _classificationPresenter                 = A.Fake <IClassificationPresenter>();
     _toolTipPartCreator                      = A.Fake <IToolTipPartCreator>();
     _multipleTreeNodeContextMenuFactory      = A.Fake <IMultipleTreeNodeContextMenuFactory>();
     _interactionTaskForSimulation            = A.Fake <IInteractionTasksForSimulation>();
     _parameterAnalysablesInExplorerPresenter = A.Fake <IParameterAnalysablesInExplorerPresenter>();
     sut = new SimulationExplorerPresenter(_view, _regionResolver, _treeNodeFactory, _viewItemContextMenuFactory, _context,
                                           _classificationPresenter, _toolTipPartCreator, _multipleTreeNodeContextMenuFactory, _projectRetriever, _interactionTaskForSimulation, _parameterAnalysablesInExplorerPresenter);
 }
        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);
        }