package lectures.test.junit;
import util.annotations.WebDocuments;
import lectures.graphics.ACartesianPoint;
import lectures.graphics.Point;
import org.junit.Assert;
import org.junit.Test;
@WebDocuments({"Lectures/TestJunit.pptx", "Lectures/TestJunit.pdf", "Videos/TestJunit.avi"})
public class ACartesianPointJUnitTester {
@Test
public void test() {
test(10, 0, 10.0, 0); test(0, 10, 10.0, Math.PI / 2); test(0, -10, 10.0, -Math.PI / 2); test(-10, 0, 10.0, Math.PI); }
public void test(int theX, int theY, double theCorrectRadius,
double theCorrectAngle) {
Point point = new ACartesianPoint(theX, theY);
double computedRadius = point.getRadius();
double computedAngle = point.getAngle();
Assert.assertTrue(computedRadius == theCorrectRadius);
Assert.assertTrue(computedAngle == theCorrectAngle);
}
}