exceptionnodetest.java
来自「Java编写后缀表达式计算器, 用于输出生成后缀表达式, 程序包含完整的Docu」· Java 代码 · 共 81 行
JAVA
81 行
/* * To change this template, choose Tools | Templates * and open the template in the editor. */import junit.After;import junit.AfterClass;import junit.Before;import junit.BeforeClass;import junit.Test;
import junit.framework.TestCase;
import exception.*;
import postfix.*;/** * * @author zouhao */public class ExceptionNodeTest extends TestCase{ public ExceptionNodeTest() { } @BeforeClass public static void setUpClass() throws Exception { } @AfterClass public static void tearDownClass() throws Exception { } @Before public void setUp() { } @After public void tearDown() { } /** * Test of ToString method, of class ExceptionNode. */ @Test public void ToString() { System.out.println("ToString"); ExceptionNode instance = new ExceptionNode(1,"test"); String expResult = "test"; String result = instance.ToString(); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. //fail("The test case is a prototype."); } /** * Test of getIndex method, of class ExceptionNode. */ @Test public void getIndex() { System.out.println("getIndex"); ExceptionNode instance = new ExceptionNode(1,"test"); int expResult = 1; int result = instance.getIndex(); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. //fail("The test case is a prototype."); } /** * Test of getException method, of class ExceptionNode. */ @Test public void getException() { System.out.println("getException"); ExceptionNode instance = new ExceptionNode(1,"test"); String expResult = "test"; String result = instance.getException(); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. //fail("The test case is a prototype."); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?