Ejemplo n.º 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;
        }
        protected override void Context()
        {
            _oldName        = "oldName";
            _newName        = "newName";
            _timeDimension  = new Dimension(new BaseDimensionRepresentation(), "Time", "min");
            _concDimension  = new Dimension(new BaseDimensionRepresentation(), "Conc", "mg/l");
            _dataRepository = new DataRepository {
                Name = _oldName
            };
            sut       = new RenameObservedDataCommand(_dataRepository, _newName);
            _baseGrid = new BaseGrid("Time", _timeDimension);
            _column   = new DataColumn("Col", _concDimension, _baseGrid);

            var quantityInfo = new QuantityInfo(new[] { _oldName, ObjectTypes.ObservedData, "Organ", "Compartment", "Drug", _column.Name }, QuantityType.Undefined);

            _baseGrid.QuantityInfo = new QuantityInfo(new[] { _oldName, ObjectTypes.ObservedData }, QuantityType.BaseGrid);
            _column.QuantityInfo   = quantityInfo;
            _dataRepository.Add(_baseGrid);
            _dataRepository.Add(_column);
            _executionContext = A.Fake <IOSPSuiteExecutionContext>();

            A.CallTo(() => _executionContext.Project.ObservedDataBy(_dataRepository.Id)).Returns(_dataRepository);
            _dataRepositoryNamer = A.Fake <IDataRepositoryNamer>();
            A.CallTo(() => _executionContext.Resolve <IDataRepositoryNamer>()).Returns(_dataRepositoryNamer);
        }
 public RenameBuildingBlockTask(
     IBuildingBlockTask buildingBlockTask,
     IBuildingBlockInProjectManager buildingBlockInProjectManager,
     IApplicationController applicationController,
     ILazyLoadTask lazyLoadTask, IContainerTask containerTask,
     IHeavyWorkManager heavyWorkManager,
     IRenameAbsolutePathVisitor renameAbsolutePathVisitor,
     IObjectReferencingRetriever objectReferencingRetriever,
     IProjectRetriever projectRetriever,
     IParameterIdentificationSimulationPathUpdater simulationPathUpdater,
     IDataRepositoryNamer dataRepositoryNamer,
     ICurveNamer curveNamer,
     IExpressionProfileUpdater expressionProfileUpdater)
 {
     _buildingBlockTask             = buildingBlockTask;
     _buildingBlockInProjectManager = buildingBlockInProjectManager;
     _applicationController         = applicationController;
     _lazyLoadTask               = lazyLoadTask;
     _containerTask              = containerTask;
     _heavyWorkManager           = heavyWorkManager;
     _renameAbsolutePathVisitor  = renameAbsolutePathVisitor;
     _objectReferencingRetriever = objectReferencingRetriever;
     _projectRetriever           = projectRetriever;
     _simulationPathUpdater      = simulationPathUpdater;
     _dataRepositoryNamer        = dataRepositoryNamer;
     _curveNamer = curveNamer;
     _expressionProfileUpdater = expressionProfileUpdater;
 }
Ejemplo n.º 4
0
 protected override void Context()
 {
     base.Context();
     _dataRepository.Name = "OLD";
     _newName             = "New";
     A.CallTo(() => _dialogCreator.AskForInput(A <string> ._, A <string> ._, A <string> ._, A <IEnumerable <string> > ._, A <IEnumerable <string> > ._)).Returns(_newName);
     _dataRepositoryNamer = A.Fake <IDataRepositoryNamer>();
     A.CallTo(() => _context.Resolve <IDataRepositoryNamer>()).Returns(_dataRepositoryNamer);
 }