summaryrefslogtreecommitdiffstats
path: root/docs/teaching/exercises/tests/Test3c.java
diff options
context:
space:
mode:
Diffstat (limited to 'docs/teaching/exercises/tests/Test3c.java')
-rw-r--r--docs/teaching/exercises/tests/Test3c.java40
1 files changed, 23 insertions, 17 deletions
diff --git a/docs/teaching/exercises/tests/Test3c.java b/docs/teaching/exercises/tests/Test3c.java
index a8d888366..b410905e0 100644
--- a/docs/teaching/exercises/tests/Test3c.java
+++ b/docs/teaching/exercises/tests/Test3c.java
@@ -14,8 +14,9 @@ package tests;
import figures.*;
import support.Log;
-
import junit.framework.*;
+import java.util.List;
+import java.util.Arrays;
public class Test3c extends Test {
@@ -23,24 +24,29 @@ public class Test3c extends Test {
junit.textui.TestRunner.run(Test3c.class);
}
- public void setUp() {
+ public void testCreateWithPointLog() {
Log.clear();
- super.setUp();
- }
-
- public void testCreateLog() {
- assertEquals("", Log.getString());
+ Point p1 = new Point(10, 100);
+ Group g = new Group(p1);
+ List foundLog = Log.getData();
+
+ List desiredLog =
+ Arrays.asList(new String[] {
+ "adding Point"
+ });
+ assertEquals(desiredLog, foundLog);
}
- public void testMoveLonePoint() {
- p1 = new Point(0, 0);
- p1.move(37, 88);
- assertEquals("moving as a part of null;", Log.getString());
- }
-
- public void testMoveGroupedPoint() {
- g = new Group(p1);
- p1.move(0, 0);
- assertEquals("moving as a part of " + g + ";", Log.getString());
+ public void testCreateWithoutPointLog() {
+ Log.clear();
+ Point p1 = new Point(10, 100);
+ Point p2 = new Point(20, 200);
+ Line l = new Line(p1, p2);
+ Group g = new Group(l);
+ List foundLog = Log.getData();
+
+ List desiredLog = Arrays.asList(new String[] {});
+ assertEquals(desiredLog, foundLog);
}
}
+