TestQuiz2

TestQuiz2 - import junit.framework.TestCase A JUnit test case class Every method starting with the word"test will be called when running the test

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
import junit.framework.TestCase; i /** * A JUnit test case class. * Every method starting with the word "test" will be called when running * the test with JUnit. */ public class TestQuiz2 extends TestCase { int [][] A1 = {{7, 9, 11}, {3, 5, 7}}; double A2[][] = {{7.2, 9.1, 11.3}, {3.8, 5.5, 7.2}}; double A3[][] = {{7.2, 9.1, 11.3}, {3.8, 5.5, 7.2}, {17.0, 52.1, 61.3}}; int [] V = {1, 2, 3}; int [] V1 = {98, 17, 32, 1, 21, 47, 84, 55, 17, 22}; // ************************************************************************* public void test_twoSmallest() { int ret[] = {0,0}; ret = Quiz2Answers.twoSmallest(V1); assertEquals("Looking for min in twosmallest: ", 1, ret[0]); assertEquals("Looking for second min in twosmallest: ", 17, ret[1]); } // ************************************************************************* public void test_makeRange() { int A = 10; int B = 20; int ret[] = new int[B-A+1]; ret = Quiz2Answers.makeRange(A,B); assertEquals("Looking for first in makeRange: ", A, ret[0]); assertEquals("Looking for last in makeRange: ", B, ret[ret.length-1]);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/31/2010 for the course CS 110 taught by Professor Cettei during the Spring '08 term at UVA.

Page1 / 2

TestQuiz2 - import junit.framework.TestCase A JUnit test case class Every method starting with the word"test will be called when running the test

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online