Exemple #1
0
 public ExecutionContext(IPKSimProjectRetriever projectRetriever, IWithIdRepository withIdRepository,
                         ILazyLoadTask lazyLoadTask, IRegistrationTask registrationTask,
                         IEventPublisher eventPublisher, IObjectTypeResolver objectTypeResolver,
                         IBuildingBlockRetriever buildingBlockRetriever, ICompressedSerializationManager serializationManager,
                         IBuildingBlockVersionUpdater buildingBlockVersionUpdater, IProjectChangedNotifier projectChangedNotifier,
                         ICloner cloner, IContainer container,
                         IReportGenerator reportGenerator,
                         IFullPathDisplayResolver fullPathDisplayResolver,
                         IParameterChangeUpdater parameterChangeUpdater)
 {
     _projectRetriever            = projectRetriever;
     _withIdRepository            = withIdRepository;
     _lazyLoadTask                = lazyLoadTask;
     _registrationTask            = registrationTask;
     _eventPublisher              = eventPublisher;
     _objectTypeResolver          = objectTypeResolver;
     _buildingBlockRetriever      = buildingBlockRetriever;
     _serializationManager        = serializationManager;
     _buildingBlockVersionUpdater = buildingBlockVersionUpdater;
     _projectChangedNotifier      = projectChangedNotifier;
     CloneManager             = cloner;
     _container               = container;
     _reportGenerator         = reportGenerator;
     _fullPathDisplayResolver = fullPathDisplayResolver;
     _parameterChangeUpdater  = parameterChangeUpdater;
 }
Exemple #2
0
        protected override void Context()
        {
            _projectRetriever            = A.Fake <IPKSimProjectRetriever>();
            _registrationTask            = A.Fake <IRegistrationTask>();
            _eventPublisher              = A.Fake <IEventPublisher>();
            _lazyLoadTask                = A.Fake <ILazyLoadTask>();
            _objectTypeResolver          = A.Fake <IObjectTypeResolver>();
            _buildingBlockRetriever      = A.Fake <IBuildingBlockRetriever>();
            _buildingBlockVersionUpdater = A.Fake <IBuildingBlockVersionUpdater>();
            _projectChangedNotifier      = A.Fake <IProjectChangedNotifier>();
            _withIdRepository            = A.Fake <IWithIdRepository>();
            _stringSerializer            = A.Fake <ICompressedSerializationManager>();
            _cloneManager                = A.Fake <ICloner>();
            _reportGenerator             = A.Fake <IReportGenerator>();
            _fullPathDisplayResolver     = A.Fake <IFullPathDisplayResolver>();
            _project                = A.Fake <IPKSimProject>();
            _idThatDoesNotExist     = "tralalalal";
            _parameter              = A.Fake <IParameter>();
            _parameterChangeUpdater = A.Fake <IParameterChangeUpdater>();
            A.CallTo(() => _projectRetriever.CurrentProject).Returns(_project);
            _idThatDoesExist = "toto";
            _container       = A.Fake <IContainer>();
            A.CallTo(() => _withIdRepository.ContainsObjectWithId(_idThatDoesExist)).Returns(true);
            A.CallTo(() => _withIdRepository.Get <IParameter>(_idThatDoesExist)).Returns(_parameter);
            A.CallTo(() => _withIdRepository.Get(_idThatDoesExist)).Returns(_parameter);
            A.CallTo(() => _withIdRepository.ContainsObjectWithId(_idThatDoesNotExist)).Returns(false);
            A.CallTo(() => _withIdRepository.Get(_idThatDoesNotExist)).Throws(new Exception());

            sut = new ExecutionContext(_projectRetriever, _withIdRepository, _lazyLoadTask, _registrationTask,
                                       _eventPublisher, _objectTypeResolver, _buildingBlockRetriever,
                                       _stringSerializer, _buildingBlockVersionUpdater, _projectChangedNotifier,
                                       _cloneManager, _container, _reportGenerator, _fullPathDisplayResolver, _parameterChangeUpdater);
        }
 protected override void Context()
 {
     base.Context();
     _context = A.Fake <IMoBiContext>();
     _buildingBlockVersionUpdater = A.Fake <IBuildingBlockVersionUpdater>();
     A.CallTo(() => _context.Resolve <IBuildingBlockVersionUpdater>()).Returns(_buildingBlockVersionUpdater);
 }
Exemple #4
0
 protected override void Context()
 {
     _formula       = new ExplicitFormula("A+B").WithId("id");
     _buildingBlock = A.Fake <IBuildingBlock>();
     _context       = A.Fake <IMoBiContext>();
     _newObjectPath = new FormulaUsablePath("NEW", "PATH").WithAlias("C1");
     _oldObjectPath = new FormulaUsablePath("OLD", "PATH").WithAlias("C1");
     sut            = new EditPathAtUsablePathCommand(_formula, _newObjectPath, _oldObjectPath, _buildingBlock);
     _formula.AddObjectPath(_oldObjectPath);
     A.CallTo(() => _context.Get <IFormula>(_formula.Id)).Returns(_formula);
     _buildingBlockVersionUpdater = A.Fake <IBuildingBlockVersionUpdater>();
     A.CallTo(() => _context.Resolve <IBuildingBlockVersionUpdater>()).Returns(_buildingBlockVersionUpdater);
 }