⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 maplisttest.java

📁 一个贪吃蛇游戏
💻 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 + -