protected override void Context()
        {
            base.Context();
            var parameterStartValuesBuildingBlock1 = new ParameterStartValuesBuildingBlock().WithName("Tada");

            var parameterStartValueA = new ParameterStartValue().WithName("MSVa");

            parameterStartValueA.ContainerPath = new ObjectPath("Root", "Liver", "Plasma");

            var parameterStartValueB = new ParameterStartValue().WithName("MSVb");

            parameterStartValueB.ContainerPath = new ObjectPath("Root", "Liver", "Plasma");
            parameterStartValueB.Formula       = new ExplicitFormula("1+2").WithName("HELLO");

            parameterStartValuesBuildingBlock1.Add(parameterStartValueA);
            parameterStartValuesBuildingBlock1.Add(parameterStartValueB);

            var parameterStartValuesBuildingBlock2 = new ParameterStartValuesBuildingBlock().WithName("Tada");

            parameterStartValueA = new ParameterStartValue().WithName("MSVa");
            parameterStartValueA.ContainerPath = new ObjectPath("Root", "Liver", "Plasma");

            parameterStartValueB = new ParameterStartValue().WithName("MSVb");
            parameterStartValueB.ContainerPath = new ObjectPath("Root", "Liver", "Cell");
            parameterStartValueB.StartValue    = 10;
            parameterStartValueB.Dimension     = DomainHelperForSpecs.TimeDimensionForSpecs();

            parameterStartValuesBuildingBlock2.Add(parameterStartValueA);
            parameterStartValuesBuildingBlock2.Add(parameterStartValueB);

            _object1 = parameterStartValuesBuildingBlock1;
            _object2 = parameterStartValuesBuildingBlock2;
        }
        protected override void Context()
        {
            base.Context();
            _buildConfiguration = A.Fake <IMoBiBuildConfiguration>();
            _psvInfo            = new ParameterStartValuesBuildingBlockInfo {
                UntypedBuildingBlock = new ParameterStartValuesBuildingBlock().WithId("psvbb1")
            };

            _templateMoleculeBuildingBlock = new MoleculeBuildingBlock {
                Id = "templateMoleculeBuildingBlock"
            };
            _templateSpatialStructure = new MoBiSpatialStructure()
            {
                Id = "templateSpatialStructure"
            };
            _moleculesInfo = new MoleculesInfo {
                UntypedBuildingBlock = _templateMoleculeBuildingBlock
            };
            _spatialStructureInfo = new SpatialStructureInfo {
                UntypedBuildingBlock = _templateSpatialStructure
            };

            _buildConfiguration.ParameterStartValuesInfo = _psvInfo;
            _buildConfiguration.SpatialStructureInfo     = _spatialStructureInfo;
            _buildConfiguration.MoleculesInfo            = _moleculesInfo;
            A.CallTo(() => _buildConfiguration.AllBuildingBlockInfos()).Returns(new IBuildingBlockInfo[] { _psvInfo, _moleculesInfo, _spatialStructureInfo });
            _cloneBuildingBlock = new ParameterStartValuesBuildingBlock().WithId("psvbb2");
            A.CallTo(() => _cloneManager.CloneBuidingBlock(_psvInfo.BuildingBlock)).Returns(_cloneBuildingBlock);
            A.CallTo(() => _simulation.MoBiBuildConfiguration).Returns(_buildConfiguration);
            A.CallTo(_nameCorrector).WithReturnType <bool>().Returns(true);
        }
Exemplo n.º 3
0
        protected override void Context()
        {
            base.Context();

            // We'll need a real building block for this test so that it will return null when asked for a start value from a path
            _startValuesBuildingBlock = new ParameterStartValuesBuildingBlock();
            _tables = new WithDimensionColumnDataTable().ImportTables();
        }
Exemplo n.º 4
0
        protected override void Context()
        {
            base.Context();

            // We'll need a real building block for this test so that it will return null when asked for a start value from a path
            _startValuesBuildingBlock = new ParameterStartValuesBuildingBlock();
            _tables            = new DataTableProvider().ImportTables();
            _tables.Rows[0][2] = string.Empty;
        }
        public void TestComplexParameterStartValuesBuildingBlock()
        {
            ParameterStartValuesBuildingBlock x1 = _buildConfiguration.ParameterStartValues as ParameterStartValuesBuildingBlock;

            Assert.IsNotNull(x1);
            IParameterStartValuesBuildingBlock x2 = SerializeAndDeserialize(x1);

            AssertForSpecs.AreEqualParameterStartValuesBuildingBlock(x2, x1);
        }
Exemplo n.º 6
0
        protected override void Context()
        {
            _context   = A.Fake <IInteractionTaskContext>();
            _editTasks = A.Fake <IEditTasksForBuildingBlock <IParameterStartValuesBuildingBlock> >();
            _parameterStartValuesCreator      = A.Fake <IParameterStartValuesCreator>();
            _cloneManagerForBuildingBlock     = A.Fake <ICloneManagerForBuildingBlock>();
            _parameterStartValueBuildingBlock = new ParameterStartValuesBuildingBlock();
            _parameterResolver = A.Fake <IParameterResolver>();

            sut = new ParameterStartValuesTask(_context, _editTasks,
                                               _parameterStartValuesCreator,
                                               _cloneManagerForBuildingBlock,
                                               new ImportedQuantityToParameterStartValueMapper(_parameterStartValuesCreator), _parameterResolver, A.Fake <IParameterStartValueBuildingBlockMergeManager>(),
                                               A.Fake <IMoBiFormulaTask>(), A.Fake <IMoBiSpatialStructureFactory>(), new ParameterStartValuePathTask(A.Fake <IFormulaTask>(), _context.Context));
        }
Exemplo n.º 7
0
        protected override void Context()
        {
            _context = A.Fake <IMoBiContext>();

            _parameterStartValue = new ParameterStartValue {
                Path = new ObjectPath("Path1", "Path2", "Name")
            };

            _buildingBlock = new ParameterStartValuesBuildingBlock {
                _parameterStartValue
            };
            sut = new ChangeParameterStartValueNameCommand(_buildingBlock, _parameterStartValue.Path, "Name2");

            A.CallTo(() => _context.Get <IParameterStartValuesBuildingBlock>(_buildingBlock.Id)).Returns(_buildingBlock);
        }
        protected override void Context()
        {
            base.Context();
            _simulation = A.Fake <IModelCoreSimulation>();
            var parameterStartValues = new ParameterStartValuesBuildingBlock();

            _parameterStartValue = new ParameterStartValue()
            {
                Name          = "P1",
                ContainerPath = new ObjectPath("Organism"),
                Dimension     = A.Fake <IDimension>(),
                DisplayUnit   = A.Fake <Unit>(),
                StartValue    = 33
            };
            parameterStartValues.Add(_parameterStartValue);
            _simulation.BuildConfiguration.ParameterStartValues = parameterStartValues;
            _parameter =
                new Parameter().WithName("P1").WithValue(11).WithDimension(A.Fake <IDimension>()).WithDisplayUnit(A.Fake <Unit>());
            A.CallTo(() => _entityPathResolver.ObjectPathFor(_parameter, false)).Returns(new ObjectPath("Organism", "P1"));
        }
 protected override void Context()
 {
     sut = new ParameterStartValuesBuildingBlock();
 }
Exemplo n.º 10
0
        protected override void Context()
        {
            base.Context();
            _returnedBuildingBlocks = new List <IBuildingBlock>();
            _childReactionBuilder   = new ReactionBuilder().WithName("Test").WithId("FindME");
            _reactionBuildingBlock  = new MoBiReactionBuildingBlock()
            {
                _childReactionBuilder
            };
            _allBuildingBlocks.Add(_reactionBuildingBlock);
            _moleculeBuilder       = new MoleculeBuilder();
            _moleculeBuildingBlock = new MoleculeBuildingBlock()
            {
                _moleculeBuilder
            };
            _allBuildingBlocks.Add(_moleculeBuildingBlock);
            _obseverBuilder        = new ObserverBuilder();
            _observerBuildingBlock = new ObserverBuildingBlock()
            {
                _obseverBuilder
            };
            _allBuildingBlocks.Add(_observerBuildingBlock);
            _passiveTranportBuilder       = new TransportBuilder();
            _passiveTranportBuildingBlock = new PassiveTransportBuildingBlock()
            {
                _passiveTranportBuilder
            };
            _allBuildingBlocks.Add(_passiveTranportBuildingBlock);
            _applicationBuilder      = new ApplicationBuilder();
            _eventGroupBuildingBlock = new EventGroupBuildingBlock()
            {
                _applicationBuilder
            };
            _allBuildingBlocks.Add(_eventGroupBuildingBlock);
            _parameter = new Parameter().WithName("Para");
            var container = new Container().WithName("Cont");

            container.Add(_parameter);
            _objectBaseFactory = A.Fake <IObjectBaseFactory>();
            _parmaeterFactory  = A.Fake <IParameterFactory>();
            A.CallTo(() => _objectBaseFactory.Create <IContainer>()).Returns(A.Fake <IContainer>());
            A.CallTo(() => _objectBaseFactory.Create <IMoBiSpatialStructure>()).Returns(new MoBiSpatialStructure());
            var diagramManagerFactory = A.Fake <IDiagramManagerFactory>();

            _spatialStructure = new MoBiSpatialStructureFactory(_objectBaseFactory, _parmaeterFactory, A.Fake <IconRepository>(), diagramManagerFactory).Create().DowncastTo <IMoBiSpatialStructure>();
            _spatialStructure.AddTopContainer(container);
            _allBuildingBlocks.Add(_spatialStructure);
            _formula = new ExplicitFormula();
            _moleculeBuildingBlock.AddFormula(_formula);
            _parameterStartValue = new ParameterStartValue {
                Path = new ObjectPath {
                    "test"
                }, StartValue = 1, Dimension = A.Fake <IDimension>()
            };
            _parameterStartValueBuildingBlock = new ParameterStartValuesBuildingBlock()
            {
                _parameterStartValue
            };
            _allBuildingBlocks.Add(_parameterStartValueBuildingBlock);
            _moleculeStartValue = new MoleculeStartValue {
                ContainerPath = new ObjectPath {
                    "test"
                }, Name = "drug"
            };
            _moleculeStartValuesBuildingBlock = new MoleculeStartValuesBuildingBlock()
            {
                _moleculeStartValue
            };
            _allBuildingBlocks.Add(_moleculeStartValuesBuildingBlock);
        }