package P1;
import junit.framework.TestCase;
public class SearchBallTest extends TestCase { int a0[]={1,2,2,2,2,2,2,2,2,2}; int a1[]={2,1,2,2,2,2,2,2,2,2}; int a2[]={2,2,1,2,2,2,2,2,2,2}; int a3[]={2,2,2,1,2,2,2,2,2,2}; int a4[]={2,2,2,2,1,2,2,2,2,2}; int a5[]={2,2,2,2,2,1,2,2,2,2}; int a6[]={2,2,2,2,2,2,1,2,2,2}; int a7[]={2,2,2,2,2,2,2,1,2,2}; int a8[]={2,2,2,2,2,2,2,2,1,2}; int a9[]={2,2,2,2,2,2,2,2,2,1}; public void testBeginSearch() { SearchBall SB=new SearchBall(); SB.setBWeight(a0); assertEquals("1号是假球",SB.BeginSearch()); SB.setBWeight(a1); assertEquals("2号是假球",SB.BeginSearch()); SB.setBWeight(a2); assertEquals("3号是假球",SB.BeginSearch()); SB.setBWeight(a3); assertEquals("4号是假球",SB.BeginSearch()); SB.setBWeight(a4); assertEquals("5号是假球",SB.BeginSearch()); SB.setBWeight(a5); assertEquals("6号是假球",SB.BeginSearch()); SB.setBWeight(a6); assertEquals("7号是假球",SB.BeginSearch()); SB.setBWeight(a7); assertEquals("8号是假球",SB.BeginSearch()); SB.setBWeight(a8); assertEquals("9号是假球",SB.BeginSearch()); SB.setBWeight(a9); assertEquals("10号是假球",SB.BeginSearch()); } public static void main(String args[]) { junit.textui.TestRunner.run(SearchBallTest.class); }
}
|