?? maplisttest.java
字號:
/**
* @(#)MapListTest.java
* @Unit tests for MapList class.
*
* @Link Scholes
* @version 1.00 2008/7/24
*/
package Test;
import junit.framework.*;
import Data.*;
public class MapListTest extends TestCase
{
//The MapList instance for test.
private MapList mapList = null;
//Set up the testing environment.
protected void setUp()
{
mapList = new MapList();
}
//Returns the test suite of this class.
public static Test suite()
{
return new TestSuite(MapList.class);
}
//Accuracy test for contructor MapList().
public void testMapList()
{
assertNotNull("The instance should not be null.",mapList);
}
//Accuracy test for getList().
public void testGetList()
{
String list[] = {"DEFAULT","Fatally","GAY","rush"};
assertEquals("The list should be correct",list,mapList.getList());
}
//Accuracy test for addMap().
public void testAddMap()
{
mapList.addMap("test");
assertEquals("The result should be correct",true,mapList.hasMap("test"));
}
//Accuracy test for hasMap().
public void testHasMap()
{
assertEquals("The result should be correct",true,mapList.hasMap("absurd"));
assertEquals("The result should be correct",false,mapList.hasMap("test"));
}
} //end class MapListTest
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -