Example #1
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()
 {
     _context  = A.Fake <IInteractionTaskContext>();
     _editTask = A.Fake <IEditTasksForSimulation>();
     _applicationController = A.Fake <IMoBiApplicationController>();
     _dialogCreator         = A.Fake <IDialogCreator>();
     A.CallTo(() => _context.ApplicationController).Returns(_applicationController);
     A.CallTo(() => _context.DialogCreator).Returns(_dialogCreator);
     _simulationReferenceUpdater = A.Fake <ISimulationReferenceUpdater>();
     sut = new InteractionTasksForSimulation(_context, _editTask, _simulationReferenceUpdater);
 }
Example #3
0
        protected override void Context()
        {
            _context       = A.Fake <IExecutionContext>();
            _oldSimulation = A.Fake <Simulation>();
            _newSimulation = A.Fake <Simulation>();
            _project       = A.Fake <IPKSimProject>();
            _simulationDifferenceBuilder = A.Fake <ISimulationCommandDescriptionBuilder>();
            _simulationReferenceUpdater  = A.Fake <ISimulationReferenceUpdater>();
            A.CallTo(() => _context.CurrentProject).Returns(_project);
            A.CallTo(() => _context.Resolve <ISimulationCommandDescriptionBuilder>()).Returns(_simulationDifferenceBuilder);
            A.CallTo(() => _context.Resolve <ISimulationReferenceUpdater>()).Returns(_simulationReferenceUpdater);
            var reportPart = new ReportPart();

            reportPart.AddToContent("toto");
            A.CallTo(() => _simulationDifferenceBuilder.BuildDifferenceBetween(_oldSimulation, _newSimulation)).Returns(reportPart);
            sut = new SwapSimulationCommand(_oldSimulation, _newSimulation, _context);
        }
Example #4
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;
 }
        protected override void Context()
        {
            base.Context();
            _project = A.Fake <IProject>();
            _parameterIdentification = A.Fake <ParameterIdentification>();
            _context = A.Fake <IMoBiContext>();
            _simulationReferenceUpdater         = A.Fake <ISimulationReferenceUpdater>();
            _simulationParameterOriginIdUpdater = A.Fake <ISimulationParameterOriginIdUpdater>();

            A.CallTo(() => _context.PublishEvent(A <SimulationUnloadEvent> ._))
            .Invokes(x => _event = x.GetArgument <SimulationUnloadEvent>(0));

            A.CallTo(() => _context.Project).Returns(_project);
            A.CallTo(() => _context.Resolve <ISimulationReferenceUpdater>()).Returns(_simulationReferenceUpdater);
            A.CallTo(() => _context.Resolve <ISimulationParameterOriginIdUpdater>()).Returns(_simulationParameterOriginIdUpdater);
            A.CallTo(() => _project.AllParameterIdentifications).Returns(new[] { _parameterIdentification });
            _parameterIdentification.AddSimulation(_simulation);
        }
Example #6
0
 public InteractionTasksForSimulation(IInteractionTaskContext interactionTaskContext, IEditTasksForSimulation editTask, ISimulationReferenceUpdater simulationReferenceUpdater)
     : base(interactionTaskContext, editTask)
 {
     _simulationReferenceUpdater = simulationReferenceUpdater;
 }