46 CPPUNIT_ASSERT(pModel != NULL);
48 CPPUNIT_ASSERT(pModel->getVolumeUnitEnum() ==
CModel::ml);
49 CPPUNIT_ASSERT(pModel->getTimeUnitEnum() ==
CModel::s);
50 CPPUNIT_ASSERT(pModel->getCompartments().size() == 1);
51 const CCompartment* pCompartment = pModel->getCompartments()[0];
52 CPPUNIT_ASSERT(pCompartment != NULL);
54 CPPUNIT_ASSERT(pModel->getMetabolites().size() == 2);
55 CMetab* pA = pModel->getMetabolites()[0];
56 CPPUNIT_ASSERT(pA != NULL);
58 const CMetab* pB = pModel->getMetabolites()[1];
59 CPPUNIT_ASSERT(pB != NULL);
61 CPPUNIT_ASSERT(pModel->getModelValues().size() == 1);
62 const CModelValue* pModelValue = pModel->getModelValues()[0];
63 CPPUNIT_ASSERT(pModelValue != NULL);
65 CPPUNIT_ASSERT(pModelValue->getInitialExpression() !=
"");
66 const CExpression* pExpr = pModelValue->getInitialExpressionPtr();
67 CPPUNIT_ASSERT(pExpr != NULL);
70 CPPUNIT_ASSERT(pNode != NULL);
72 CPPUNIT_ASSERT(pObjectNode != NULL);
74 CPPUNIT_ASSERT(!objectCN.empty());
75 std::vector<CCopasiContainer*> listOfContainers;
76 listOfContainers.push_back(pModel);
78 CPPUNIT_ASSERT(pObject != NULL);
80 CPPUNIT_ASSERT(pObject->
getObjectName() == std::string(
"InitialParticleNumber"));
83 CPPUNIT_ASSERT(pModel->getReactions().size() == 2);
84 const CReaction* pReaction1 = pModel->getReactions()[0];
85 CPPUNIT_ASSERT(pReaction1 != NULL);
86 CPPUNIT_ASSERT(pReaction1->isReversible() ==
false);
88 const CFunction* pKineticFunction = pReaction1->getFunction();
89 CPPUNIT_ASSERT(pKineticFunction != NULL);
93 CPPUNIT_ASSERT(pMassAction == NULL);
94 const CChemEq* pChemEq = &pReaction1->getChemEq();
95 CPPUNIT_ASSERT(pChemEq != NULL);
99 CPPUNIT_ASSERT(pElement != NULL);
100 CPPUNIT_ASSERT(fabs(pElement->getMultiplicity() - 1.0) < 1e-3);
101 CPPUNIT_ASSERT(pElement->getMetabolite() == pA);
105 const CReaction* pReaction2 = pModel->getReactions()[1];
106 CPPUNIT_ASSERT(pReaction2 != NULL);
107 CPPUNIT_ASSERT(pReaction2->isReversible() ==
false);
109 pKineticFunction = pReaction2->getFunction();
110 CPPUNIT_ASSERT(pKineticFunction != NULL);
111 CPPUNIT_ASSERT(pKineticFunction->getObjectName() == std::string(
"Function for reaction_1"));
113 CPPUNIT_ASSERT(pFunctionParameters->size() == 4);
115 CPPUNIT_ASSERT(pFunctionParameter != NULL);
118 pFunctionParameter = (*pFunctionParameters)[1];
119 CPPUNIT_ASSERT(pFunctionParameter != NULL);
122 pFunctionParameter = (*pFunctionParameters)[2];
123 CPPUNIT_ASSERT(pFunctionParameter != NULL);
126 pFunctionParameter = (*pFunctionParameters)[3];
127 CPPUNIT_ASSERT(pFunctionParameter != NULL);
130 pNode = pKineticFunction->getRoot();
132 CPPUNIT_ASSERT(pCallNode != NULL);
134 CPPUNIT_ASSERT(pCallNode->
getData() == std::string(
"Henri-Michaelis-Menten (irreversible)_2"));
136 CPPUNIT_ASSERT(pOperatorNode != NULL);
139 CPPUNIT_ASSERT(pVariableNode != NULL);
140 CPPUNIT_ASSERT(pVariableNode->getIndex() == 3);
142 CPPUNIT_ASSERT(pVariableNode != NULL);
143 CPPUNIT_ASSERT(pVariableNode->getIndex() == 2);
145 CPPUNIT_ASSERT(pVariableNode != NULL);
146 CPPUNIT_ASSERT(pVariableNode->getIndex() == 0);
148 CPPUNIT_ASSERT(pVariableNode != NULL);
149 CPPUNIT_ASSERT(pVariableNode->getIndex() == 1);
152 CPPUNIT_ASSERT(pKineticFunction != NULL);
153 CPPUNIT_ASSERT(pKineticFunction->getObjectName() == std::string(
"Henri-Michaelis-Menten (irreversible)_2"));
154 pNode = pKineticFunction->getRoot();
155 CPPUNIT_ASSERT(pNode != NULL);
157 CPPUNIT_ASSERT(pOperatorNode != NULL);
160 CPPUNIT_ASSERT(pOperatorNode2 != NULL);
163 CPPUNIT_ASSERT(pVariableNode != NULL);
164 CPPUNIT_ASSERT(pVariableNode->getIndex() == 2);
166 CPPUNIT_ASSERT(pVariableNode != NULL);
167 CPPUNIT_ASSERT(pVariableNode->getIndex() == 0);
169 CPPUNIT_ASSERT(pOperatorNode2 != NULL);
172 CPPUNIT_ASSERT(pVariableNode != NULL);
173 CPPUNIT_ASSERT(pVariableNode->getIndex() == 1);
175 CPPUNIT_ASSERT(pVariableNode != NULL);
176 CPPUNIT_ASSERT(pVariableNode->getIndex() == 0);
179 pChemEq = &pReaction2->getChemEq();
180 CPPUNIT_ASSERT(pChemEq != NULL);
181 CPPUNIT_ASSERT(pChemEq->getCompartmentNumber() == 1);
182 CPPUNIT_ASSERT(pChemEq->getSubstrates().size() == 1);
183 pElement = pChemEq->getSubstrates()[0];
184 CPPUNIT_ASSERT(pElement != NULL);
185 CPPUNIT_ASSERT(fabs(pElement->getMultiplicity() - 1.0) < 1e-3);
186 CPPUNIT_ASSERT(pElement->getMetabolite() == pA);
187 CPPUNIT_ASSERT(pChemEq->getProducts().size() == 1);
188 pElement = pChemEq->getProducts()[0];
189 CPPUNIT_ASSERT(pElement != NULL);
190 CPPUNIT_ASSERT(fabs(pElement->getMultiplicity() - 1.0) < 1e-3);
191 CPPUNIT_ASSERT(pElement->getMetabolite() == pB);
192 CPPUNIT_ASSERT(pChemEq->getModifiers().size() == 0);
193 const std::vector<std::vector<std::string> > parameterMappings = pReaction2->getParameterMappings();
194 CPPUNIT_ASSERT(parameterMappings.size() == 4);
195 CPPUNIT_ASSERT(parameterMappings[2].size() == 1);
196 std::string parameterKey = parameterMappings[2][0];
197 CPPUNIT_ASSERT(parameterKey == pCompartment->getKey());
198 CPPUNIT_ASSERT(parameterMappings[3].size() == 1);
199 parameterKey = parameterMappings[3][0];
200 CPPUNIT_ASSERT(parameterKey == pA->getKey());
size_t getCompartmentNumber() const
const CEvaluationTree * getCalledTree() const
const std::string & getObjectName() const
virtual size_t size() const
const CRegisteredObjectName & getObjectCN() const
const Type & getType() const
const CCopasiVector< CChemEqElement > & getProducts() const
virtual const Data & getData() const
const CCopasiVector< CChemEqElement > & getSubstrates() const
static Type subType(const Type &type)
const CCopasiVector< CChemEqElement > & getModifiers() const
bool importSBMLFromString(const std::string &sbmlDocumentText, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
The class for handling a chemical kinetic function.
static const char * MODEL_STRING
static CCopasiDataModel * pCOPASIDATAMODEL
CCopasiNode< Data > * getChild()
CCopasiObject * ObjectFromName(const std::vector< CCopasiContainer * > &listOfContainer, const CCopasiObjectName &CN) const
CCopasiContainer * getObjectParent() const