本文整理汇总了C#中libsbmlcs.ASTNode.setCharacter方法的典型用法代码示例。如果您正苦于以下问题:C# ASTNode.setCharacter方法的具体用法?C# ASTNode.setCharacter怎么用?C# ASTNode.setCharacter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libsbmlcs.ASTNode
的用法示例。
在下文中一共展示了ASTNode.setCharacter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: test_ASTNode_setCharacter
public void test_ASTNode_setCharacter()
{
ASTNode node = new ASTNode();
node.setName( "foo");
assertTrue( node.getType() == libsbml.AST_NAME );
assertTrue( node.getCharacter() == '\0' );
assertTrue(( "foo" == node.getName() ));
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node.setCharacter( '+');
assertTrue( node.getType() == libsbml.AST_PLUS );
assertTrue( node.getCharacter() == '+' );
assertTrue( node.getName() == null );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node.setCharacter( '-');
assertTrue( node.getType() == libsbml.AST_MINUS );
assertTrue( node.getCharacter() == '-' );
assertTrue( node.getName() == null );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node.setCharacter( '*');
assertTrue( node.getType() == libsbml.AST_TIMES );
assertTrue( node.getCharacter() == '*' );
assertTrue( node.getName() == null );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node.setCharacter( '/');
assertTrue( node.getType() == libsbml.AST_DIVIDE );
assertTrue( node.getCharacter() == '/' );
assertTrue( node.getName() == null );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node.setCharacter( '^');
assertTrue( node.getType() == libsbml.AST_POWER );
assertTrue( node.getCharacter() == '^' );
assertTrue( node.getName() == null );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node.setCharacter( '$');
assertTrue( node.getType() == libsbml.AST_UNKNOWN );
assertTrue( node.getCharacter() == '$' );
assertTrue( node.getName() == null );
assertTrue( node.getInteger() == 0 );
assertTrue( node.getReal() == 0 );
assertTrue( node.getExponent() == 0 );
assertTrue( node.getDenominator() == 1 );
node = null;
}
示例2: test_ASTNode_deepCopy_1
public void test_ASTNode_deepCopy_1()
{
ASTNode node = new ASTNode();
ASTNode child, copy;
node.setCharacter( '+');
node.addChild(new ASTNode());
node.addChild(new ASTNode());
node.getLeftChild().setValue(1);
node.getRightChild().setValue(2);
assertTrue( node.getType() == libsbml.AST_PLUS );
assertTrue( node.getCharacter() == '+' );
assertTrue( node.getNumChildren() == 2 );
child = node.getLeftChild();
assertTrue( child.getType() == libsbml.AST_INTEGER );
assertTrue( child.getInteger() == 1 );
assertTrue( child.getNumChildren() == 0 );
child = node.getRightChild();
assertTrue( child.getType() == libsbml.AST_INTEGER );
assertTrue( child.getInteger() == 2 );
assertTrue( child.getNumChildren() == 0 );
copy = node.deepCopy();
assertTrue( copy != node );
assertTrue( copy.getType() == libsbml.AST_PLUS );
assertTrue( copy.getCharacter() == '+' );
assertTrue( copy.getNumChildren() == 2 );
child = copy.getLeftChild();
assertTrue( child != node.getLeftChild() );
assertTrue( child.getType() == libsbml.AST_INTEGER );
assertTrue( child.getInteger() == 1 );
assertTrue( child.getNumChildren() == 0 );
child = copy.getRightChild();
assertTrue( child != node.getRightChild() );
assertTrue( child.getType() == libsbml.AST_INTEGER );
assertTrue( child.getInteger() == 2 );
assertTrue( child.getNumChildren() == 0 );
node = null;
copy = null;
}