summaryrefslogtreecommitdiffstats
path: root/docs/teaching/exercises/tests/Test2a.java
diff options
context:
space:
mode:
Diffstat (limited to 'docs/teaching/exercises/tests/Test2a.java')
-rw-r--r--docs/teaching/exercises/tests/Test2a.java20
1 files changed, 7 insertions, 13 deletions
diff --git a/docs/teaching/exercises/tests/Test2a.java b/docs/teaching/exercises/tests/Test2a.java
index 0b737020b..4bc6dd28a 100644
--- a/docs/teaching/exercises/tests/Test2a.java
+++ b/docs/teaching/exercises/tests/Test2a.java
@@ -16,18 +16,16 @@ import figures.*;
import junit.framework.*;
-public class Test2a extends Test {
+public class Test2a extends TestCase {
public Test2a(String name) { super(name); }
public static void main(String[] args) {
+ junit.textui.TestRunner.run(Test.class);
junit.textui.TestRunner.run(Test2a.class);
}
- public void setUp() {
- super.setUp();
- }
-
public void testTooSmall() {
+ Point p1 = new Point(10, 100);
try {
p1.setX(-10);
fail("should have thrown IllegalArgumentException");
@@ -35,17 +33,13 @@ public class Test2a extends Test {
}
}
-
- public void testTooBig() {
- try {
- p1.setY(1000);
- fail("should have thrown IllegalArgumentException");
- } catch (IllegalArgumentException ea) {
- }
+ public void testNotTooSmall() {
+ Point p1 = new Point(10, 100);
+ p1.setX(0);
}
-
public void testMove() {
+ Line l1 = new Line(new Point(10, 100), new Point(20, 200));
try {
l1.move(-500, -500);
fail("should have thrown IllegalArgumentException");