public void testWithCellDefWithSpaces() { MuCell.Model.SBML.Model model = new MuCell.Model.SBML.Model(); MuCell.Model.Experiment experiment = new MuCell.Model.Experiment("experimen1"); MuCell.Model.Simulation simulation = new MuCell.Model.Simulation("simulation1"); setupExperiment(model, experiment, simulation); experiment.GetCellDefinition("celldef1").Name = "cell def1"; Assert.That(experiment.ContainsCellDefinition("cell_def1")); // Test parsing cell def references, group references etc. MuCell.Model.SBML.Reader.SBMLReader reader = new MuCell.Model.SBML.Reader.SBMLReader(); FormulaParser fp = new FormulaParser(reader, "cell_def1", model, experiment, simulation); MathTree formulaTree = fp.getFormulaTree(); MuCell.Model.SBML.AggregateReferenceNode root = (MuCell.Model.SBML.AggregateReferenceNode)formulaTree.root; Assert.AreEqual("cell def1", root.ToString()); Assert.AreEqual(experiment.getCellDefinitions()[0], root.CellDefinition); Assert.AreEqual(null, root.Group); Assert.AreEqual(null, root.Species); }
public void TestCellDefinitionsWithSpaces() { MuCell.Model.Experiment experiment = new MuCell.Model.Experiment("experiment1"); MuCell.Model.Simulation simulation = new MuCell.Model.Simulation("simulation1"); Setup(experiment, simulation); experiment.GetCellDefinition("celldef1").Name = "cell def1"; // Check cell definitions AssertDouble.AreEqual(10, evaluate("cell_def1", experiment, simulation)); AssertDouble.AreEqual(20, evaluate("celldef2", experiment, simulation)); AssertDouble.AreEqual(12.3, evaluate("cell_def1+2.3", experiment, simulation)); AssertDouble.AreEqual(11.0, evaluate("1.1*(celldef2/2.0)", experiment, simulation)); }