예제 #1
0
 public SimulationRunner(ISimulationEngineFactory simulationEngineFactory, ISimulationAnalysisCreator simulationAnalysisCreator, ILazyLoadTask lazyLoadTask,
                         IEntityValidationTask entityValidationTask, ISimulationSettingsRetriever simulationSettingsRetriever, ICloner cloner)
 {
     _simulationEngineFactory   = simulationEngineFactory;
     _simulationAnalysisCreator = simulationAnalysisCreator;
     _lazyLoadTask                = lazyLoadTask;
     _entityValidationTask        = entityValidationTask;
     _simulationSettingsRetriever = simulationSettingsRetriever;
     _cloner = cloner;
 }
        protected override Task Context()
        {
            _simulationAnalysisCreator = A.Fake <ISimulationAnalysisCreator>();
            _cloner = A.Fake <ICloner>();
            _simulationSettingsRetriever = A.Fake <ISimulationSettingsRetriever>();
            _simulationRunner            = A.Fake <ISimulationRunner>();

            sut = new InteractiveSimulationRunner(_simulationSettingsRetriever, _simulationRunner, _cloner, _simulationAnalysisCreator);
            return(_completed);
        }
예제 #3
0
 protected EditAnalyzablePresenter(TView view, ISubPresenterItemManager <TSubPresenter> subPresenterItemManager, IReadOnlyList <ISubPresenterItem> subPresenterItems,
                                   ISimulationAnalysisPresenterFactory simulationAnalysisPresenterFactory,
                                   ISimulationAnalysisPresenterContextMenuFactory contextMenuFactory,
                                   IPresentationSettingsTask presentationSettingsTask, ISimulationAnalysisCreator simulationAnalysisCreator)
     : base(view, subPresenterItemManager, subPresenterItems)
 {
     _simulationAnalysisPresenterFactory = simulationAnalysisPresenterFactory;
     _contextMenuFactory        = contextMenuFactory;
     _presentationSettingsTask  = presentationSettingsTask;
     _simulationAnalysisCreator = simulationAnalysisCreator;
     _settings = new TabbedPresenterSettings();
 }
        public InteractiveSimulationRunner(ISimulationSettingsRetriever simulationSettingsRetriever, ISimulationRunner simulationRunner, ICloner cloner, ISimulationAnalysisCreator simulationAnalysisCreator)
        {
            _simulationSettingsRetriever = simulationSettingsRetriever;
            _simulationRunner            = simulationRunner;
            _cloner = cloner;
            _simulationAnalysisCreator = simulationAnalysisCreator;

            _simulationRunOptions = new SimulationRunOptions
            {
                CheckForNegativeValues = true,
                RaiseEvents            = true,
                RunForAllOutputs       = false,
                SimModelExportMode     = SimModelExportMode.Optimized
            };
        }
        protected override Task Context()
        {
            _dialogCreator = A.Fake <IDialogCreator>();
            _templateTask  = A.Fake <ITemplateTask>();
            _keyPathMapper = A.Fake <IKeyPathMapper>();
            _entitiesInContainerRetriever = A.Fake <IEntitiesInContainerRetriever>();
            _entityTask = A.Fake <IEntityTask>();
            _cloner     = A.Fake <ICloner>();
            _simulationAnalysisWorkflowMapper = A.Fake <IAnalysableToSimulationAnalysisWorkflowMapper>();
            _simulationAnalysisCreator        = A.Fake <ISimulationAnalysisCreator>();
            _lazyLoadTask = A.Fake <ILazyLoadTask>();
            sut           = new PopulationAnalysisTemplateTask(_templateTask, _dialogCreator, _entitiesInContainerRetriever,
                                                               _keyPathMapper, _entityTask, _cloner, _simulationAnalysisWorkflowMapper, _simulationAnalysisCreator, _lazyLoadTask);

            return(_completed);
        }
예제 #6
0
        protected override void Context()
        {
            _view = A.Fake <IPopulationSimulationComparisonView>();
            _subPresenterManager            = A.Fake <ISubPresenterItemManager <IPopulationSimulationComparisonItemPresenter> >();
            _analysisPresenterFactory       = A.Fake <ISimulationAnalysisPresenterFactory>();
            _populationSimulationComparison = A.Fake <PopulationSimulationComparison>();
            _contextMenuFactory             = A.Fake <ISimulationAnalysisPresenterContextMenuFactory>();
            _presenterSettingsTask          = A.Fake <IPresentationSettingsTask>();
            _simulationAnalysisCreator      = A.Fake <ISimulationAnalysisCreator>();
            sut = new PopulationSimulationComparisonPresenter(_view, _subPresenterManager, _analysisPresenterFactory, _contextMenuFactory, _presenterSettingsTask, _simulationAnalysisCreator);

            _analysis = A.Fake <ISimulationAnalysis>();
            _simulationAnalysisPresenter = A.Fake <ISimulationAnalysisPresenter>();

            A.CallTo(() => _populationSimulationComparison.Analyses).Returns(new[] { _analysis });
            A.CallTo(() => _analysisPresenterFactory.PresenterFor(_analysis)).Returns(_simulationAnalysisPresenter);
            sut.Edit(_populationSimulationComparison);
        }
        protected override void Context()
        {
            _view       = A.Fake <IEditIndividualSimulationView>();
            _repository = A.Fake <IRepository <ISimulationItemPresenter> >();
            _simulationAnalysisPresenterFactory = A.Fake <ISimulationAnalysisPresenterFactory>();
            _subPresenterManager       = A.Fake <ISubPresenterItemManager <IEditIndividualSimulationItemPresenter> >();
            _contextMenuFactory        = A.Fake <ISimulationAnalysisPresenterContextMenuFactory>();
            _presenterSettingsTask     = A.Fake <IPresentationSettingsTask>();
            _simulationAnalysisCreator = A.Fake <ISimulationAnalysisCreator>();
            _analysis       = A.Fake <ISimulationAnalysis>();
            _chartPresenter = A.Fake <ISimulationTimeProfileChartPresenter>();
            _simulation     = A.Fake <IndividualSimulation>();
            A.CallTo(() => _simulationAnalysisPresenterFactory.PresenterFor(_analysis)).Returns(_chartPresenter);
            A.CallTo(() => _simulation.Analyses).Returns(new List <ISimulationAnalysis> {
                _analysis
            });
            A.CallTo(() => _subPresenterManager.AllSubPresenters).Returns(new IEditIndividualSimulationItemPresenter[] {});

            sut = new EditIndividualSimulationPresenter(_view, _subPresenterManager, _simulationAnalysisPresenterFactory,
                                                        _contextMenuFactory, _presenterSettingsTask, _simulationAnalysisCreator);
        }
 public EditIndividualSimulationPresenter(IEditIndividualSimulationView view, ISubPresenterItemManager <IEditIndividualSimulationItemPresenter> subPresenterItemManager,
                                          ISimulationAnalysisPresenterFactory simulationAnalysisPresenterFactory, ISimulationAnalysisPresenterContextMenuFactory contextMenuFactory,
                                          IPresentationSettingsTask presentationSettingsTask, ISimulationAnalysisCreator simulationAnalysisCreator)
     : base(view, subPresenterItemManager, EditIndividualSimulationItems.All, simulationAnalysisPresenterFactory, contextMenuFactory, presentationSettingsTask, simulationAnalysisCreator)
 {
 }
 public PopulationSimulationComparisonPresenter(IPopulationSimulationComparisonView view, ISubPresenterItemManager <IPopulationSimulationComparisonItemPresenter> subPresenterItemManager, ISimulationAnalysisPresenterFactory simulationAnalysisPresenterFactory,
                                                ISimulationAnalysisPresenterContextMenuFactory contextMenuFactory, IPresentationSettingsTask presentationSettingsTask, ISimulationAnalysisCreator simulationAnalysisCreator)
     : base(view, subPresenterItemManager, PopulationSimulationComparisonItems.All, simulationAnalysisPresenterFactory, contextMenuFactory, presentationSettingsTask, simulationAnalysisCreator)
 {
 }
예제 #10
0
 protected EditSimulationPresenter(TView view, ISubPresenterItemManager<TSubPresenter> subPresenterItemManager, IReadOnlyList<ISubPresenterItem> subPresenterItems, 
    ISimulationAnalysisPresenterFactory simulationAnalysisPresenterFactory, ISimulationAnalysisPresenterContextMenuFactory contextMenuFactory, 
    IPresentationSettingsTask presentationSettingsTask, ISimulationAnalysisCreator simulationAnalysisCreator)
    : base(view, subPresenterItemManager, subPresenterItems, simulationAnalysisPresenterFactory, contextMenuFactory, presentationSettingsTask, simulationAnalysisCreator)
 {
 }