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

📄 testdicegames.java

📁 通过JAVA编写的一个小游戏,键盘打字练习
💻 JAVA
字号:
/**
 * 
 */
package docAndJUnit;

import static org.junit.Assert.assertEquals;
import junit.framework.TestCase;

/**
 * @author 吴诗阳
 *
 */
public class TestDiceGames extends TestCase {

	DiceGames diceGames;
	
	long exception;
	/**
	 * @throws java.lang.Exception
	 */
	protected void setUp() throws Exception {
		diceGames=new DiceGames();
		System.out.println("a");
	}

	/**
	 * @throws java.lang.Exception
	 */
	protected void tearDown() throws Exception {
		System.out.println("b");
	}

	public void testcountFormations1()
	{
		exception = 1;
		int[] sides={1};
		assertEquals(exception,diceGames.countFormations(sides));
	}
	
	public void testcountFormations2()
	{
		exception = 3;
		int[] sides={2,2};
		assertEquals(exception,diceGames.countFormations(sides));
	}
	
	public void testcountFormations3()
	{
		exception = 10;
		int[] sides={4,4};
		assertEquals(exception,diceGames.countFormations(sides));
	}
	
	public void testcountFormations4()
	{
		exception = 9;
		int[] sides={3,4};
		assertEquals(exception,diceGames.countFormations(sides));
	}
	
	public void testcountFormations5()
	{
		exception = 48;
		int[] sides={4,5,6};
		assertEquals(exception,diceGames.countFormations(sides));
	}
	
	public void testcountFormations6()
	{
		exception = -1;
		int[] sides={4,5,6,0};
		assertEquals(exception,diceGames.countFormations(sides));
	}

	public void testcountFormations7()
	{
		exception = 916312070471295267L;
		int[] sides=new int[32];
		for(int i=0;i<32;i++)
			sides[i]=32;
		
		assertEquals(exception,diceGames.countFormations(sides));
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -