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);
        }
Example #2
0
        private void updateMolecule(IOSPSuiteExecutionContext context)
        {
            if (_metaDataChanged.NewName != Constants.ObservedData.MOLECULE)
            {
                return;
            }

            var observedDataTask = context.Resolve <IObservedDataTask>();

            observedDataTask.UpdateMolWeight(_observedData);
        }