exceptioncontainertest.java
来自「Java编写后缀表达式计算器, 用于输出生成后缀表达式, 程序包含完整的Docu」· Java 代码 · 共 67 行
JAVA
67 行
/* * 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 ExceptionContainerTest extends TestCase{ public ExceptionContainerTest() { } @BeforeClass public static void setUpClass() throws Exception { } @AfterClass public static void tearDownClass() throws Exception { } @Before public void setUp() { } @After public void tearDown() { } /** * Test of getinstance method, of class ExceptionContainer. */ @Test public void getinstance() { System.out.println("getinstance"); ExceptionContainer expResult = ExceptionContainer.getinstance(); ExceptionContainer result = ExceptionContainer.getinstance(); 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 add method, of class ExceptionContainer. */ @Test public void add() { System.out.println("add"); int in = 1; String e = "test"; ExceptionContainer instance = new ExceptionContainer(); instance.add(in, e); assertEquals(instance.exceptionlist.get(0),new ExceptionNode(1,"test")); // 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 + -
显示快捷键?