本文整理汇总了C#中libsbmlcs.SBMLDocument.getNumErrors方法的典型用法代码示例。如果您正苦于以下问题:C# SBMLDocument.getNumErrors方法的具体用法?C# SBMLDocument.getNumErrors怎么用?C# SBMLDocument.getNumErrors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libsbmlcs.SBMLDocument
的用法示例。
在下文中一共展示了SBMLDocument.getNumErrors方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: test_SBMLDocument_createWith
public void test_SBMLDocument_createWith()
{
SBMLDocument d = new SBMLDocument(1,2);
assertTrue( d.getTypeCode() == libsbml.SBML_DOCUMENT );
assertTrue( d.getNotes() == null );
assertTrue( d.getAnnotation() == null );
assertTrue( d.getLevel() == 1 );
assertTrue( d.getVersion() == 2 );
assertTrue( d.getNumErrors() == 0 );
d = null;
}
示例2: test_WriteL3SBML_error
public void test_WriteL3SBML_error()
{
SBMLDocument d = new SBMLDocument();
SBMLWriter w = new SBMLWriter();
assertEquals( false, w.writeSBML(d, "/tmp/impossible/path/should/fail") );
assertTrue( d.getNumErrors() == 1 );
assertTrue( d.getError(0).getErrorId() == libsbml.XMLFileUnwritable );
d = null;
w = null;
}
示例3: test_ReadSBML_notes_sbml
public void test_ReadSBML_notes_sbml()
{
string s = wrapXML("<sbml level='1' version='1'>" +
" <notes>Notes are not allowed as part of the SBML element.</notes>" +
"</sbml>");
D = libsbml.readSBMLFromString(s);
assertTrue( D.getNotes() != null );
string notes = D.getNotes().getChild(0).getCharacters();
assertTrue( ( "Notes are not allowed as part of the SBML element." != notes ) == false );
assertTrue( D.getNumErrors() > 0 );
}
示例4: test_ReadSBML_invalid_default_namespace
//.........这里部分代码省略.........
" <listOfCompartments>" +
" <compartment id=\"compartmentOne\" size=\"1\"/>" +
" </listOfCompartments>" +
" <listOfSpecies>" +
" <species id=\"S1\" initialConcentration=\"1\" compartment=\"compartmentOne\"/>" +
" <species id=\"S2\" initialConcentration=\"0\" compartment=\"compartmentOne\"/>" +
" </listOfSpecies>" +
" <listOfParameters>" +
" <parameter id=\"t\" value = \"1\" units=\"second\"/>" +
" </listOfParameters>" +
" <listOfConstraints>" +
" <constraint sboTerm=\"SBO:0000064\">" +
" <math xmlns=\"http://www.w3.org/1998/Math/MathML\">" +
" <apply>" +
" <leq/>" +
" <ci> S1 </ci>" +
" <ci> t </ci>" +
" </apply>" +
" </math>" +
" <message>" +
" <p xmlns=\"http://www.w3.org/1999/xhtml\"> Species S1 is out of range </p>" +
" </message>" +
" </constraint>" +
" </listOfConstraints>" +
" <listOfReactions>" +
" <reaction id=\"reaction_1\" reversible=\"false\">" +
" <listOfReactants>" +
" <speciesReference species=\"S1\"/>" +
" </listOfReactants>" +
" <listOfProducts>" +
" <speciesReference species=\"S2\">" +
" </speciesReference>" +
" </listOfProducts>" +
" </reaction>" +
" </listOfReactions>" +
" </model>" +
" </sbml>");
string invalid = wrapXML("<sbml xmlns=\"http://www.sbml.org/sbml/level2/version4\" level=\"2\" version=\"4\"> " +
" <model xmlns=\"http://invalid/custom/default/uri\">" +
" <notes xmlns=\"http://invalid/custom/default/uri/in/notes\">" +
" <p xmlns=\"http://www.w3.org/1999/xhtml\">Some text.</p>" +
" </notes>" +
" <annotation xmlns=\"http://invalid/custom/default/uri/in/annotation\">" +
" <example xmlns=\"http://www.example.org/\"/>" +
" </annotation>" +
" <listOfCompartments>" +
" <compartment id=\"compartmentOne\" size=\"1\"/>" +
" </listOfCompartments>" +
" <listOfSpecies>" +
" <notes xmlns=\"http://invalid/custom/default/uri/in/notes\">" +
" <p xmlns=\"http://www.w3.org/1999/xhtml\">Some text.</p>" +
" </notes>" +
" <annotation xmlns=\"http://invalid/custom/default/uri/in/annotation\">" +
" <example xmlns=\"http://www.example.org/\"/>" +
" </annotation>" +
" <species id=\"S1\" initialConcentration=\"1\" compartment=\"compartmentOne\"/>" +
" <species id=\"S2\" initialConcentration=\"0\" compartment=\"compartmentOne\"/>" +
" </listOfSpecies>" +
" <listOfParameters>" +
" <parameter id=\"t\" value = \"1\" units=\"second\"/>" +
" </listOfParameters>" +
" <listOfConstraints>" +
" <constraint sboTerm=\"SBO:0000064\">" +
" <math xmlns=\"http://www.w3.org/1998/Math/MathML\">" +
" <apply>" +
" <leq/>" +
" <ci> S1 </ci>" +
" <ci> t </ci>" +
" </apply>" +
" </math>" +
" <message xmlns=\"http://invalid/custom/default/uri/in/message\">" +
" <p xmlns=\"http://www.w3.org/1999/xhtml\"> Species S1 is out of range </p>" +
" </message>" +
" </constraint>" +
" </listOfConstraints>" +
" <listOfReactions>" +
" <reaction id=\"reaction_1\" reversible=\"false\">" +
" <listOfReactants>" +
" <speciesReference xmlns=\"http://invalid/custom/default/uri\" species=\"S1\"/>" +
" </listOfReactants>" +
" <listOfProducts>" +
" <speciesReference species=\"S2\">" +
" <notes xmlns=\"http://invalid/custom/default/uri/in/notes\">" +
" <p xmlns=\"http://www.w3.org/1999/xhtml\">Some text.</p>" +
" </notes>" +
" <annotation xmlns=\"http://invalid/custom/default/uri/in/annotation\">" +
" <example xmlns=\"http://www.example.org/\"/>" +
" </annotation>" +
" </speciesReference>" +
" </listOfProducts>" +
" </reaction>" +
" </listOfReactions>" +
" </model>" +
" </sbml>");
D = libsbml.readSBMLFromString(valid);
assertTrue( D.getNumErrors() == 0 );
D = null;
D = libsbml.readSBMLFromString(invalid);
assertTrue( D.getNumErrors() == 9 );
}
示例5: test_ReadSBML_FunctionDefinition_OnlyBVars
public void test_ReadSBML_FunctionDefinition_OnlyBVars()
{
FunctionDefinition fd;
SBMLError error;
int numErrors;
ASTNode math;
string formula;
string s = wrapSBML_L2v1("<listOfFunctionDefinitions>" +
" <functionDefinition id='invalid'>" +
" <math xmlns='http://www.w3.org/1998/Math/MathML'>" +
" <lambda>" +
" <bvar><ci> x </ci></bvar>" +
" <bvar><ci> y </ci></bvar>" +
" <bvar><ci> z </ci></bvar>" +
" </lambda>" +
" </math>" +
" </functionDefinition>" +
"</listOfFunctionDefinitions>");
D = libsbml.readSBMLFromString(s);
M = D.getModel();
D.checkInternalConsistency();
D.checkConsistency();
numErrors = (int)D.getNumErrors();
assertTrue( numErrors == 1 );
error = D.getError(0);
int errorId = (int)error.getErrorId();
assertTrue( errorId == libsbml.NoBodyInFunctionDef );
assertTrue( M.getNumFunctionDefinitions() == 1 );
fd = M.getFunctionDefinition(0);
assertTrue( fd != null );
assertEquals( true, fd.isSetId() );
assertEquals( false, fd.isSetName() );
assertTrue(( "invalid" == fd.getId() ));
assertTrue( fd.getBody() == null );
assertEquals( true, fd.isSetMath() );
math = fd.getMath();
formula = libsbml.formulaToString(math);
assertTrue( formula != null );
assertTrue(( "lambda(x, y, z)" == formula ));
}
示例6: test_ReadSBML_annotation_sbml_L2
public void test_ReadSBML_annotation_sbml_L2()
{
string s = wrapXML("<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\"> " +
" <annotation>" +
" <rdf xmlns=\"http://www.w3.org/1999/anything\">" +
" </rdf>" +
" </annotation>" +
" <model>" +
" </model>" +
" </sbml>");
D = libsbml.readSBMLFromString(s);
M = D.getModel();
assertTrue( D.getNumErrors() == 0 );
}
示例7: test_ReadSBML_annotation_sbml
public void test_ReadSBML_annotation_sbml()
{
string s = wrapXML("<sbml level=\"1\" version=\"1\">" +
" <annotation xmlns:jd = \"http://www.sys-bio.org/sbml\">" +
" <jd:header>" +
" <VersionHeader SBMLVersion = \"1.0\"/>" +
" </jd:header>" +
" <jd:display>" +
" <SBMLGraphicsHeader BackGroundColor = \"15728639\"/>" +
" </jd:display>" +
" </annotation>" +
"</sbml>");
D = libsbml.readSBMLFromString(s);
assertTrue( D.getNumErrors() > 0 );
}
示例8: test_ReadSBML_notes_sbml_L2
public void test_ReadSBML_notes_sbml_L2()
{
string s = wrapXML("<sbml xmlns=\"http://www.sbml.org/sbml/level2\" level=\"2\" version=\"1\"> " +
" <notes>" +
" <html xmlns=\"http://www.w3.org/1999/xhtml\">" +
" </html>" +
" </notes>" +
" <model>" +
" </model>" +
" </sbml>");
D = libsbml.readSBMLFromString(s);
assertTrue( D.getNotes() != null );
assertTrue( D.getNumErrors() == 0 );
}