protected override void Context() { sut = new ParameterStartValue(); _comparable = new ParameterStartValue(); sut.Path = new ObjectPath("A", "B", "Name"); _comparable.Path = sut.Path.Clone <IObjectPath>(); sut.StartValue = 1.0; _comparable.StartValue = sut.StartValue; sut.Formula = new ExplicitFormula("MV"); _comparable.Formula = new ExplicitFormula("MV"); sut.Dimension = DimensionFactoryForSpecs.Factory.Dimension(DimensionFactoryForSpecs.DimensionNames.Mass); _comparable.Dimension = sut.Dimension; sut.DisplayUnit = sut.Dimension.DefaultUnit; _comparable.DisplayUnit = sut.DisplayUnit; sut.Icon = "string"; _comparable.Icon = "string"; sut.Description = "Description"; _comparable.Description = "Description"; }
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 Because() { _startValue = new ParameterStartValue { ContainerPath = new ObjectPath("A", "B") }; _parameterStartValueBuildingBlock.Add(_startValue); sut.EditStartValueContainerPath(_parameterStartValueBuildingBlock, _startValue, 5, "C"); }
protected override void Context() { _context = A.Fake <IMoBiContext>(); _buildingBlock = new ParameterStartValuesBuildingBlock(); _psv = new ParameterStartValue { Path = new ObjectPath("path1"), StartValue = -1, DisplayUnit = new Unit("Dimensionless", 1.0, 1) }; sut = new AddParameterStartValueToBuildingBlockCommand(_buildingBlock, _psv); A.CallTo(() => _context.Get <IStartValuesBuildingBlock <IParameterStartValue> >(A <string> ._)).Returns(_buildingBlock); }
protected override void Because() { _startValue = new ParameterStartValue(); _parameterStartValueBuildingBlock.Add(_startValue); _valueOrigin = new ValueOrigin { Method = ValueOriginDeterminationMethods.Assumption, Description = "hello" }; sut.SetValueOrigin(_parameterStartValueBuildingBlock, _valueOrigin, _startValue); }
protected override void Context() { _context = A.Fake <IMoBiContext>(); _buildingBlock = new ParameterStartValuesBuildingBlock(); _psv = new ParameterStartValue { Path = new ObjectPath("path1"), StartValue = -1, DisplayUnit = new Unit("Dimensionless", 1.0, 1) }; _buildingBlock.Add(_psv); sut = new RemoveParameterStartValueFromBuildingBlockCommand(_buildingBlock, _psv.Path); A.CallTo(() => _context.Deserialize <IParameterStartValue>(A <byte[]> ._)).Returns(_psv); A.CallTo(() => _context.Get <IStartValuesBuildingBlock <IParameterStartValue> >(_buildingBlock.Id)).Returns(_buildingBlock); }
public void TestSerialization() { var x1 = new ParameterStartValue { ContainerPath = new ObjectPath("A", "B"), StartValue = 3.6, Dimension = DimensionLength }; x1.ValueOrigin.Description = "Hello"; x1.ValueOrigin.Method = ValueOriginDeterminationMethods.Assumption; x1.ValueOrigin.Id = 5; x1.IsDefault = true; var x2 = SerializeAndDeserialize(x1); AssertForSpecs.AreEqualParameterStartValue(x1, x2); }
public IParameterStartValue CreateParameterStartValue(IObjectPath parameterPath, double startValue, IDimension dimension, Unit displayUnit = null, ValueOrigin valueOrigin = null, bool isDefault = false) { var psv = new ParameterStartValue { StartValue = startValue, Dimension = dimension, Id = _idGenerator.NewId(), Path = parameterPath, DisplayUnit = displayUnit ?? dimension.DefaultUnit, IsDefault = isDefault }; psv.ValueOrigin.UpdateAllFrom(valueOrigin); return(psv); }
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(); _comparerSettings.FormulaComparison = FormulaComparison.Value; var msv1 = new ParameterStartValue().WithName("Tada").WithFormula(new ExplicitFormula("1+1")); msv1.Path = new ObjectPath("Root", "Liver", "Plasma"); var msv2 = new ParameterStartValue().WithName("Tada").WithFormula(new ExplicitFormula("2")); msv2.Path = new ObjectPath("Root", "Liver", "Plasma"); _object1 = msv1; _object2 = msv2; }
protected override void Context() { base.Context(); var msv1 = new ParameterStartValue().WithName("Tada").WithFormula(new ConstantFormula(2)); msv1.Path = new ObjectPath("Root", "Liver", "Plasma"); var msv2 = new ParameterStartValue().WithName("Tada").WithFormula(new ExplicitFormula("2")); msv2.Path = new ObjectPath("Root", "Liver", "Plasma"); _object1 = msv1; _object2 = msv2; }
protected override void Context() { base.Context(); _comparerSettings.FormulaComparison = FormulaComparison.Value; var dim = A.Fake <IDimension>(); var msv1 = new ParameterStartValue().WithName("Tada").WithFormula(new ConstantFormula(2)).WithDimension(dim); msv1.Path = new ObjectPath("Root", "Liver", "Plasma"); var dim2 = A.Fake <IDimension>(); var msv2 = new ParameterStartValue().WithName("Tada").WithFormula(new ConstantFormula(2)).WithDimension(dim2); msv2.Path = new ObjectPath("Root", "Liver", "Plasma"); _object1 = msv1; _object2 = msv2; }
protected override void Context() { base.Context(); var msv1 = new ParameterStartValue().WithName("Tada"); msv1.Path = new ObjectPath("Root", "Liver", "Plasma"); msv1.StartValue = 5; var msv2 = new ParameterStartValue().WithName("Tada"); msv2.Path = new ObjectPath("Root", "Liver", "Plasma"); msv2.StartValue = null; _object1 = msv1; _object2 = msv2; }
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() { _builder = new ParameterStartValue(); sut = new ParameterStartValueToObjectBaseSummaryDTOMapper(); }
protected override void Context() { sut = new ParameterStartValue(); }
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); }